Blog
/

Inside the SOC

/
September 20, 2022

Modern Extortion: Detecting Data Theft From the Cloud

Default blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog image
20
Sep 2022
Darktrace highlights a handful of data theft incidents on shared cloud platforms, showing that cloud computing can be a vulnerable place for modern extortion.

Ransomware Industry

The ransomware industry has benefitted from a number of factors in recent years: inadequate cyber defenses, poorly regulated cryptocurrency markets, and geopolitical tensions have allowed gangs to extort increasingly large ransoms while remaining sheltered from western law enforcement [1]. However, one of the biggest success stories of the ransomware industry has been the adaptability and evolution of attacker TTPs (tactics, techniques and procedures). The WannaCry and NotPetya attacks of 2017 popularized a form of ransomware which used encryption algorithms to hold data to ransom in exchange for a decryption key. Last year in 2021, almost all ransomware strains evolved to use double extortion tactics: holding stolen data to ransom as well as encrypted data [2]. Now, some ransomware gangs have dropped encryption entirely, and are using data theft as their sole means of extortion. 

Using data theft for extortion is not new. In 2020 the Finnish psychotherapy center Vastaamo had over 40,000 patient records stolen. Impacted patients were told that their psychiatric transcripts would be published online if they failed to pay a Bitcoin ransom. [3]. A later report by BlackFog in May 2021 predicted data theft extortion would become one of the key emerging cybersecurity trends that year [4]. Adoption of offline back-ups and endpoint detection had made encryption harder, while a large-scale move to Cloud and SaaS platforms offered new vectors for data theft. By moving from data encryption to data exfiltration, ransomware attackers pivoted from targeting data availability within the CIA triad (Confidentiality, Integrity, Availability) to threatening data confidentiality.

In November 2021, Darktrace detected a data theft incident following the compromise of two SaaS accounts within an American tech customer’s Office365 environment. The client was a longstanding user of Darktrace DETECT/Network, and was in the process of expanding their coverage by trialing Darktrace DETECT+RESPOND/ Apps + Cloud.

Attack Overview

On November 23rd 2021, an Ask the Expert (ATE) ticket was raised prompting investigation into a breached SaaS model, ‘SaaS / Access / Unusual External Source for SaaS Credential Use’, and the activities of a user (censored as UserA) over the prior week.

1. Office365: UserA 

The account UserA had been logging in from an unusual location in Nigeria on November 21st. At the time of the incident there were no flags of malicious activity from this IP in widely used OSINT sources. It is also highly probable the attacker was not located in Nigeria but using Nigerian infrastructure in order to hide their true location. Regardless, the location of the login from this IP and ASN was considered highly unusual for users within the customer’s digital estate. The specific user in question most commonly accessed their account from IP ranges located in the US.

Figure 1: In the Geolocation tab of the External Sites Summary on the SaaS Console, UserA was seen logging in from Nigeria when previous logins were exclusively from USA

Further investigation revealed an additional anomaly in the Outlook Web activity of UserA. The account was using the Firefox browser to access their account for the first time in at least 4 weeks (the maximum period for which the customer stored such data). SaaS logs detailing the access of confidential folders and other suspicious actions were identified using the Advanced Search (AS) query:

@fields.saas_actor:"UserA@[REDACTED]" AND @fields.saas_software:"Firefox"

Most actions were ‘MailItemsAccessed’ events originating from IPs located in Nigeria [5,6] and one other potentially malicious IP located in the US [7].

‘MailItemsAccessed’ is part of the new Advanced Audit functionality from Microsoft and can be used to determine when email data is accessed by mail protocols and clients. A bind mail access type denotes an individual access to an email message [8]. 

Figure 2: AS logs shows UserA had not used Firefox to access Office365 for at least 4 weeks prior to the unusual login on the 21st November

Below are details of the main suspicious SaaS activities: 

·      Time: 2021-11-21 09:05:25 - 2021-11-22 16:57:39 UTC

·      SaaS Actor: UserA@[REDACTED]

·      SaaS Service: Office365

·      SaaS Service Product: Exchange

·      SaaS Software: Firefox

·      SaaS Office365 Parent Folders:

          o   \Accounts/Passwords
          o   \Invoices
          o   \Sent Items
          o   \Inbox
          o   \Recoverable Items\Deletions

·      SaaS Event:

          o   MailItemsAccessed
          o   UserLoggedIn
          o   Update

·      SaaS Office365 Mail Access Type: Bind (47 times)

·      Source IP addresses:

          o   105.112.59[.]83
          o   105.112.36[.]212
          o   154.6.17[.]16
          o   45.130.83[.]129

·      SaaS User Agents: 

          o   Client=OWA;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0;
          o   Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0

·      Total SaaS logs: 57 

At the start of the month on the 5th November, the user had also been seen logging in from a potentially malicious endpoint [9] in Europe, performing ‘MailItemsAccessed’ and ‘Updates’ events with subjects and a resource location related to invoices and wire transfers from the Sent items folder. This suggests the initial compromise had been earlier in the month, giving the threat actor time to make preparations for the final stages of the attack.

Figure 3: Event log showing the activity of UserA from IP 45.135.187[.]108 

2. Office365: UserB 

Looking into the model breach ‘SaaS / Access / Suspicious Credential Use And Login User-Agent’, it was seen that a second account, UserB, was also observed logging in from a rare and potentially malicious location in Bangladesh [7]. Similar to UserA, this user had previously logged in exclusively from the USA, and no other accounts within the digital estate had been observed interacting with the Bangladeshi IP address. The login event appeared to bypass MFA (Multi-factor Authentication) and a suspicious user agent, BAV2ROPC, was used. Against misconfigured accounts, this Microsoft user agent is commonly used by attackers to bypass MFA on Office365. It targets Exchange’s Basic Authentication (normally used in POP3/IMAP4 conditions) and results in an OAuth flow which circumvents the additional password security brought by MFA [10].  

During the session, additional resources were accessed which appear to be associated with bill and invoice payments. In addition, on the 4th November, two new suspicious email rules named “..” were created from rare IPs (107.10.56[.]48 and 76.189.202[.]66). This type of behavior is commonly seen during SaaS compromises to delete or forward emails. Typically, an email rule created by a human user will be named to reflect the change being made, such as ‘Move emails from Legal to Urgent’. In contrast, malicious email rules are often short and undescriptive. The rule “..” is likely to blend in without arousing suspicion, while also being easy for the attacker to create and remember. 

Details of these rule changes are as follows:

·      Time: 2021-11-04 13:25:06, 2021-11-05 15:50:00 [UTC]
·      SaaS Service: Office365
·      SaaS Service Product: Exchange
·      SaaS Status Message: True
·      SaaS Source IP addresses: 107.10.56[.]48, 76.189.202[.]66
·      SaaS Account Name: O365
·      SaaS Actor: UserB@[REDACTED]
·      SaaS Event: SetInboxRule
·      SaaS Office365 Modified Property Names:
          o   AlwaysDeleteOutlookRulesBlob, Force, Identity, MoveToFolder, Name, FromAddressContainsWords, StopProcessingRules
          o   AlwaysDeleteOutlookRulesBlob, Force, Identity, Name, FromAddressContainsWords, StopProcessingRules
·      SaaS Resource Name: .. 

During cloud account compromises, attackers will often use sync operations to download emails to their local email client. During the operations, these clients typically download a large set of mail items from the cloud to a local computer. If the attacker is able to sync all mail items to their mail client, the entire mailbox can be compromised. The attacker is able to disconnect from the account and review and search the email without generating additional event logs. 

Both accounts UserA and UserB were observed using ‘MailItemsAccessed’ sync operations between the 1st and 23rd November when this attack occurred. However, based on the originating IP of the sync operations, the activity is likely to have been initiated by the legitimate, US-based users. Once the security team were able to confirm the events were expected and legitimate, they could establish that the contents of the mailbox were not a part of the data breach. 

Accomplish Mission

After gaining access to the Office365 accounts, sensitive data was downloaded by the attackers to their local system. Either on or before 14th December, the attacker had seemingly uploaded the documents onto a data leak website. In total, 130MB of data had been made available for download in two separate packages. The packages included audit and accounting financial documents, with file extensions such as DB, XLSX, and PDF.

Figure 4: The two data packages uploaded by the attacker and the extracted contents

In a sample of past SaaS activity of UserA, the subject and attachments appear related to the ‘OUTSTANDING PREPAY WIRES 2021’ excel document found from the data leak website in Figure 4, suggesting a further possibility that the account was associated with the leaked data. 

Historic SaaS activity associated with UserA: 

·      Time: 2021-11-05 21:21:18 [UTC]
·      SaaS Office365 Logon Type: Owner
·      Protocol: OFFICE365
·      SaaS Account Name: O365
·      SaaS Actor: UserA@[REDACTED].com
·      SaaS Event: Send
·      SaaS Service: Office365
·      SaaS Service Product: Exchange
·      SaaS Status Message: Succeeded
·      SaaS Office365 Attachment: WIRE 2021.xlsx (92406b); image.png (9084b); image.png (1454b); image.png (1648b); image.png (1691b); image.png (1909b); image.png (2094b)
·      SaaS Office365 Subject: Wires 11/8/21
·      SaaS Resource Location: \Drafts
·      SaaS User Agent: Client=OWA;Action=ViaProxy 

Based on the available evidence, it is highly likely that the data packages contain the data stolen during the account compromise the previous month.  

Once the credentials of an Office365 account are stolen, an attacker can not only access the user's mailbox, but also a full range of Office365 applications such as SharePoint folders, Teams Chat, or files in the user's OneDrive [11]. For example, files shared in Teams chat are stored in OneDrive for Business in a folder named Microsoft Teams Chat Files in the default Document library on SharePoint. One of the files visible on the data leak website, called ‘[REDACTED] CONTRACT.3.1.2020.pdf’, was also observed in the default document folder of a third user account (UserC) within the victim organization, suggesting the compromised accounts may have been able to access shared files stored on other accounts by moving laterally via other O365 applications such as Teams. 

One example can be seen in the below AS logs: 

·      Time: 2021-11-11 01:58:35 [UTC]
·      SaaS Resource Type: File
·      Protocol: OFFICE365
·      SaaS Account Name: 0365
·      SaaS Actor: UserC@[REDACTED]
·      SaaS Event: FilePreviewed
·      SaaS Service Product: OneDrive
·      SaaS Metric: ResourceViewed
·      SaaS Office365 Application Name: Media Analysis and Transformation Service
·      SaaS Office365 File Extension: pdf
·      SaaS Resource Location: https://[REDACTED]-my.sharepoint.com/personal/userC_[REDACTED]_com/Documents/Microsoft Teams Chat Files/[REDACTED] CONTRACT 3.1.2020.pdf
·      SaaS Resource Name: [REDACTED] CONTRACT 3.1.2020.pdf
·      SaaS Service: Office365
·      SaaS Service Product: OneDrive
·      SaaS User Agent: OneDriveMpc-Transform_Thumbnail/1.0 

In the period between the 1st and 30th November, the customer’s Darktrace DETECT/Apps trial had raised multiple high-level alerts associated with SaaS account compromise, but there was no evidence of file encryption.  

Establish Foothold 

Looking back at the start of the attack, it is unclear exactly how the attacker evaded the customer’s pre-existing security stack. At the time of the incident, the victim was using a Barracuda email gateway and Microsoft 365 Threat Management for their cloud environment. 

Darktrace detected no indication the accounts were compromised via credential bruteforcing, which would have enabled the attacker to bypass the Azure Active Directory smart lockout (if enabled). The credentials may have been harvested via a phishing campaign which successfully evaded the list of known ‘bad’ domains maintained by their email gateway.  

Upon gaining access to the account, the Microsoft Defender for Cloud Apps anomaly detection policies would have been expected to raise an alert [12]. In this instance, the unusual login from Nigeria occurred over 16 hours after the previous login from the US, potentially evading anomaly detection policies such as the ‘Impossible Travel’ rule. 

Figure 5: Event log showing the user accessing mail from USA a day before the suspicious usage from Nigeria 

Darktrace Coverage

Darktrace DETECT 

Throughout this event, high scoring model breaches associated with the attack were visible in the customer’s SaaS Console. In addition, there were two Cyber AI Analyst incidents for ‘Possible Account Hijack’ associated with the two compromised SaaS Office365 accounts, UserA and UserB. The visibility given by Darktrace DETECT also enabled the security team to confirm which files had been accessed and were likely part of the data leak.

Figure 6: Example Cyber AI Analyst incident of UserB SaaS Office365 account

Darktrace RESPOND

In this incident, the attackers successfully compromised O365 accounts in order to exfiltrate customer data. Whilst Darktrace RESPOND/Apps was being trialed and suggested several actions, it was configured in human confirmation mode. The following RESPOND/Apps actions were advised for these activities:  

·      ‘Antigena [RESPOND] Unusual Access Block’ triggered by the successful login from an unusual IP address, would have actioned the ‘Block IP’ inhibitor, preventing access to the account from the unusual IP for up to 24 hours
·      ‘Suspicious Source Activity Block’, triggered by the suspicious user agent used to bypass MFA, would have actioned the ‘Disable User’ inhibitor, disabling the user account for up to 24 hours 

During this incident, Darktrace RESPOND/Network was being used in fully autonomous mode in order to prevent the threat actor from pivoting into the network. The security team were unable to conclusively say if any attempts by the attacker to do this had been made. 

Concluding Thoughts  

Data theft extortion has become a widely used attack technique, and ransomware gangs may increasingly use this technique alone to target organizations without secure data encryption and storage policies.  

This case study describes a SaaS data theft extortion incident which bypassed MFA and existing security tools. The attacker appeared to compromise credentials without bruteforce activity, possibly with the use of social engineering through phishing. However, from the first new login, Darktrace DETECT identified the unusual credential use in spite of it being an existing account. Had Darktrace RESPOND/Apps been configured, it would have autonomously responded to halt this login and prevent the attacker from accomplishing their data theft mission.

Thanks to Oakley Cox, Brianna Leddy and Shuh Chin Goh for their contributions.

Appendices

References 

[1] https://securelist.com/new-ransomware-trends-in-2022/106457/

[2] https://www.itpro.co.uk/security/ransomware/367624/the-rise-of-double-extortion-ransomware

[3] https://www.malwarebytes.com/blog/news/2020/10/vastaamo-psychotherapy-data-breach-sees-the-most-vulnerable-victims-extorted

[4] https://www.blackfog.com/shift-from-ransomware-to-data-theft-extortion/

[5] https://www.abuseipdb.com/check/105.112.59.83

[6] https://www.abuseipdb.com/check/105.112.36.212

[7] https://www.abuseipdb.com/check/45.130.83.129

[8] https://docs.microsoft.com/en-us/microsoft-365/compliance/mailitemsaccessed-forensics-investigations?view=o365-worldwide

[9] https://www.abuseipdb.com/check/45.135.187.108

[10] https://www.virustotal.com/gui/ip-address/45.137.20.65/details

[11] https://tidorg.com/new-bec-phishing-attack-steals-office-365-credentials-and-bypasses-mfa/

[12] https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/responding-to-a-compromised-email-account?view=o365-worldwide

Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Author
Adrianne Marques
Senior Research Analyst
Book a 1-1 meeting with one of our experts
Share this article

More in this series

No items found.

Blog

/

September 24, 2024

/

Inside the SOC

Lifting the Fog: Darktrace’s Investigation into Fog Ransomware

Default blog imageDefault blog image

Introduction to Fog Ransomware

As ransomware attacks continue to be launched at an alarming rate, Darktrace’s Threat Research team has identified that familiar strains like Akira, LockBit, and BlackBasta remain among the most prevalent threats impacting its customers, as reported in the First 6: Half-Year Threat Report 2024. Despite efforts by law agencies, like dismantling the infrastructure of cybercriminals and shutting down their operations [2], these groups continue to adapt and evolve.

As such, it is unsurprising that new ransomware variants are regularly being created and launched to get round law enforcement agencies and increasingly adept security teams. One recent example of this is Fog ransomware.

What is Fog ransomware?

Fog ransomware is strain that first appeared in the wild in early May 2024 and has been observed actively using compromised virtual private network (VPN) credentials to gain access to organization networks in the education sector in the United States.

Darktrace's detection of Fog Ransomware

In June 2024, Darktrace observed instances of Fog ransomware across multiple customer environments. The shortest time observed from initial access to file encryption in these attacks was just 2 hours, underscoring the alarming speed with which these threat actors can achieve their objectives.

Darktrace identified key activities typical of a ransomware kill chain, including enumeration, lateral movement, encryption, and data exfiltration. In most cases, Darktrace was able to successfully halt the progression Fog attacks in their early stages by applying Autonomous Response actions such as quarantining affected devices and blocking suspicious external connections.

To effectively illustrate the typical kill chain of Fog ransomware, this blog focuses on customer environments that did not have Darktrace’s Autonomous Response enabled. In these cases, the attack progressed unchecked and reached its intended objectives until the customer received Darktrace’s alerts and intervened.

Darktrace’s Coverage of Fog Ransomware

Initial Intrusion

After actors had successfully gained initial access into customer networks by exploiting compromised VPN credentials, Darktrace observed a series of suspicious activities, including file shares, enumeration and extensive scanning. In one case, a compromised domain controller was detected making outgoing NTLM authentication attempts to another internal device, which was subsequently used to establish RDP connections to a Windows server running Hyper-V.

Given that the source was a domain controller, the attacker could potentially relay the NTLM hash to obtain a domain admin Kerberos Ticket Granting Ticket (TGT). Additionally, incoming NTLM authentication attempts could be triggered by tools like Responder, and NTLM hashes used to encrypt challenge response authentication could be abused by offline brute-force attacks.

Darktrace also observed the use of a new administrative credential on one affected device, indicating that malicious actors were likely using compromised privileged credentials to conduct relay attacks.

Establish Command-and-Control Communication (C2)

In many instances of Fog ransomware investigated by Darktrace’s Threat Research team, devices were observed making regular connections to the remote access tool AnyDesk. This was exemplified by consistent communication with the endpoint “download[.]anydesk[.]com” via the URI “/AnyDesk.exe”. In other cases, Darktrace identified the use of another remote management tool, namely SplashTop, on customer servers.

In ransomware attacks, threat actors often use such legitimate remote access tools to establish command-and-control (C2) communication. The use of such services not only complicates the identification of malicious activities but also enables attackers to leverage existing infrastructure, rather than having to implement their own.

Internal Reconnaissance

Affected devices were subsequently observed making an unusual number of failed internal connections to other internal locations over ports such as 80 (HTTP), 3389 (RDP), 139 (NetBIOS) and 445 (SMB). This pattern of activity strongly indicated reconnaissance scanning behavior within affected networks. A further investigation into these HTTP connections revealed the URIs “/nice ports”/Trinity.txt.bak”, commonly associated with the use of the Nmap attack and reconnaissance tool.

Simultaneously, some devices were observed engaging in SMB actions targeting the IPC$ share and the named pipe “srvsvc” on internal devices. Such activity aligns with the typical SMB enumeration tactics, whereby attackers query the list of services running on a remote host using a NULL session, a method often employed to gather information on network resources and vulnerabilities.

Lateral Movement

As attackers attempted to move laterally through affected networks, Darktrace observed suspicious RDP activity between infected devices. Multiple RDP connections were established to new clients, using devices as pivots to propagate deeper into the networks, Following this, devices on multiple networks exhibited a high volume of SMB read and write activity, with internal share drive file names being appended with the “.flocked” extension – a clear sign of ransomware encryption. Around the same time, multiple “readme.txt” files were detected being distributed across affected networks, which were later identified as ransom notes.

Further analysis of the ransom note revealed that it contained an introduction to the Fog ransomware group, a summary of the encryption activity that had been carried out, and detailed instructions on how to communicate with the attackers and pay the ransom.

Packet capture (PCAP) of the ransom note file titled “readme.txt”.
Figure 1: Packet capture (PCAP) of the ransom note file titled “readme.txt”.

Data Exfiltration

In one of the cases of Fog ransomware, Darktrace’s Threat Research team observed potential data exfiltration involving the transfer of internal files to an unusual endpoint associated with the MEGA file storage service, “gfs302n515[.]userstorage[.]mega[.]co[.]nz”.

This exfiltration attempt suggests the use of double extortion tactics, where threat actors not only encrypt victim’s data but also exfiltrate it to threaten public exposure unless a ransom is paid. This often increases pressure on organizations as they face the risk of both data loss and reputational damage caused by the release of sensitive information.

Darktrace’s Cyber AI Analyst autonomously investigated what initially appeared to be unrelated events, linking them together to build a full picture of the Fog ransomware attack for customers’ security teams. Specifically, on affected networks Cyber AI Analyst identified and correlated unusual scanning activities, SMB writes, and file appendages that ultimately suggested file encryption.

Cyber AI Analyst’s analysis of encryption activity on one customer network.
Figure 2: Cyber AI Analyst’s analysis of encryption activity on one customer network.
Figure 3: Cyber AI Analysts breakdown of the investigation process between the linked incident events on one customer network.

Conclusion

As novel and fast-moving ransomware variants like Fog persist across the threat landscape, the time taken for from initial compromise to encryption has significantly decreased due to the enhanced skill craft and advanced malware of threat actors. This trend particularly impacts organizations in the education sector, who often have less robust cyber defenses and significant periods of time during which infrastructure is left unmanned, and are therefore more vulnerable to quick-profit attacks.

Traditional security methods may fall short against these sophisticated attacks, where stealthy actors evade detection by human-managed teams and tools. In these scenarios Darktrace’s AI-driven product suite is able to quickly detect and respond to the initial signs of compromise through autonomous analysis of any unusual emerging activity.

When Darktrace’s Autonomous Response capability was active, it swiftly mitigated emerging Fog ransomware threats by quarantining devices exhibiting malicious behavior to contain the attack and blocking the exfiltration of sensitive data, thus preventing customers from falling victim to double extortion attempts.

Credit to Qing Hong Kwa (Senior Cyber Analyst and Deputy Analyst Team Lead, Singapore) and Ryan Traill (Threat Content Lead)

Appendices

Darktrace Model Detections:

- Anomalous Server Activity::Anomalous External Activity from Critical Network Device

- Anomalous Connection::SMB Enumeration

- Anomalous Connection::Suspicious Read Write Ratio and Unusual SMB

- Anomalous Connection::Uncommon 1 GiB Outbound

- Anomalous File::Internal::Additional Extension Appended to SMB File

- Compliance::Possible Cleartext LDAP Authentication

- Compliance::Remote Management Tool On Server

- Compliance::SMB Drive Write

- Compromise::Ransomware::SMB Reads then Writes with Additional Extensions

- Compromise::Ransomware::Possible Ransom Note Write

- Compromise::Ransomware::Ransom or Offensive Words Written to SMB

- Device::Attack and Recon Tools

- User::New Admin Credentials on Client

- Unusual Activity::Anomalous SMB Move & Write

- Unusual Activity::Internal Data Transfer

- Unusual Activity::Unusual External Data Transfer

- Unusual Activity::Enhanced Unusual External Data Transfer

Darktrace Model Detections:

- Antigena::Network::External Threat::Antigena Suspicious File Block

- Antigena::Network::External Threat::Antigena Suspicious File Pattern of Life Block

- Antigena::Network::External Threat::Antigena File then New Outbound Block

- Antigena::Network::External Threat::Antigena Ransomware Block

- Antigena::Network::External Threat::Antigena Suspicious Activity Block

- Antigena::Network::Significant Anomaly::Antigena Controlled and Model Breach

- Antigena::Network::Significant Anomaly::Antigena Enhanced Monitoring from Server Block

- Antigena::Network::Significant Anomaly::Antigena Breaches Over Time Block

- Antigena::Network::Significant Anomaly::Antigena Significant Server Anomaly Block

- Antigena::Network::Insider Threat::Antigena Internal Data Transfer Block

- Antigena::Network::Insider Threat::Antigena Large Data Volume Outbound Block

- Antigena::Network::Insider Threat::Antigena SMB Enumeration Block

AI Analyst Incident Coverage

- Encryption of Files over SMB

- Scanning of Multiple Devices

- SMB Writes of Suspicious Files

MITRE ATT&CK Mapping

(Technique Name) – (Tactic) – (ID) – (Sub-Technique of)

Data Obfuscation - COMMAND AND CONTROL - T1001

Remote System Discovery - DISCOVERY - T1018

SMB/Windows Admin Shares - LATERAL MOVEMENT - T1021.002 - T1021

Rename System Utilities - DEFENSE EVASION - T1036.003 - T1036

Network Sniffing - CREDENTIAL ACCESS, DISCOVERY - T1040

Exfiltration Over C2 Channel - EXFILTRATION - T1041

Data Staged - COLLECTION - T1074

Valid Accounts - DEFENSE EVASION, PERSISTENCE, PRIVILEGE ESCALATION, INITIAL ACCESS - T1078

Taint Shared Content - LATERAL MOVEMENT - T1080

File and Directory Discovery - DISCOVERY - T1083

Email Collection - COLLECTION - T1114

Automated Collection - COLLECTION - T1119

Network Share Discovery - DISCOVERY - T1135

Exploit Public-Facing Application - INITIAL ACCESS - T1190

Hardware Additions - INITIAL ACCESS - T1200

Remote Access Software - COMMAND AND CONTROL - T1219

Data Encrypted for Impact - IMPACT - T1486

Pass the Hash - DEFENSE EVASION, LATERAL MOVEMENT - T1550.002 - T1550

Exfiltration to Cloud Storage - EXFILTRATION - T1567.002 - T1567

Lateral Tool Transfer - LATERAL MOVEMENT - T1570

List of Indicators of Compromise (IoCs)

IoC – Type – Description

/AnyDesk.exe - Executable File - Remote Access Management Tool

gfs302n515[.]userstorage[.]mega[.]co[.]nz- Domain - Exfiltration Domain

*.flocked - Filename Extension - Fog Ransomware Extension

readme.txt - Text File - Fog Ransom Note

xql562evsy7njcsngacphcerzjfecwotdkobn3m4uxu2gtqh26newid[.]onion - Onion Domain - Threat Actor’s Communication Channel

References

[1] https://arcticwolf.com/resources/blog/lost-in-the-fog-a-new-ransomware-threat/

[2] https://intel471.com/blog/assessing-the-disruptions-of-ransomware-gangs

[3] https://www.pcrisk.com/removal-guides/30167-fog-ransomware

Continue reading
About the author
Qing Hong Kwa
Senior Cyber Analyst and Deputy Analyst Team Lead, Singapore

Blog

/

September 11, 2024

/

Inside the SOC

Decrypting the Matrix: How Darktrace Uncovered a KOK08 Ransomware Attack

Default blog imageDefault blog image

What is Matrix Ransomware?

Matrix is a ransomware family that first emerged in December 2016, mainly targeting small to medium-sized organizations across the globe in countries including the US, Belgium, Germany, Canada and the UK [1]. Although the reported number of Matrix ransomware attacks has remained relatively low in recent years, it has demonstrated ongoing development and gradual improvements to its tactics, techniques, and procedures (TTPs).

How does Matrix Ransomware work?

In earlier versions, Matrix utilized spam email campaigns, exploited Windows shortcuts, and deployed RIG exploit kits to gain initial access to target networks. However, as the threat landscape changed so did Matrix’s approach. Since 2018, Matrix has primarily shifted to brute-force attacks, targeting weak credentials on Windows machines accessible through firewalls. Attackers often exploit common and default credentials, such as “admin”, “password123”, or other unchanged default settings, particularly on systems with Remote Desktop Protocol (RDP) enabled [2] [3].

Darktrace observation of Matrix Ransomware tactics

In May 2024, Darktrace observed an instance of KOK08 ransomware, a specific strain of the Matrix ransomware family, in which some of these ongoing developments and evolutions were observed. Darktrace detected activity indicative of internal reconnaissance, lateral movement, data encryption and exfiltration, with the affected customer later confirming that credentials used for Virtual Private Network (VPN) access had been compromised and used as the initial attack vector.

Another significant tactic observed by Darktrace in this case was the exfiltration of data following encryption, a hallmark of double extortion. This method is employed by attacks to increase pressure on the targeted organization, demanding ransom not only for the decryption of files but also threatening to release the stolen data if their demands are not met. These stakes are particularly high for public sector entities, like the customer in question, as the exposure of sensitive information could result in severe reputational damage and legal consequences, making the pressure to comply even more intense.

Darktrace’s Coverage of Matrix Ransomware

Internal Reconnaissance and Lateral Movement

On May 23, 2024, Darktrace / NETWORK identified a device on the customer’s network making an unusually large number of internal connections to multiple internal devices. Darktrace recognized that this unusual behavior was indicative of internal scanning activity. The connectivity observed around the time of the incident indicated that the Nmap attack and reconnaissance tool was used, as evidenced by the presence of the URI “/nice ports, /Trinity.txt.bak”.

Although Nmap is a crucial tool for legitimate network administration and troubleshooting, it can also be exploited by malicious actors during the reconnaissance phase of the attack. This is a prime example of a ‘living off the land’ (LOTL) technique, where attackers use legitimate, pre-installed tools to carry out their objectives covertly. Despite this, Darktrace’s Self-Learning AI had been continually monitoring devices across the customers network and was able to identify this activity as a deviation from the device’s typical behavior patterns.

The ‘Device / Attack and Recon Tools’ model alert identifying the active usage of the attack and recon tool, Nmap.
Figure 1: The ‘Device / Attack and Recon Tools’ model alert identifying the active usage of the attack and recon tool, Nmap.
Figure 2: Cyber AI Analyst Investigation into the ‘Scanning of Multiple Devices' incident.

Darktrace subsequently observed a significant number of connection attempts using the RDP protocol on port 3389. As RDP typically requires authentication, multiple connection attempts like this often suggest the use of incorrect username and password combinations.

Given the unusual nature of the observed activity, Darktrace’s Autonomous Response capability would typically have intervened, taking actions such as blocking affected devices from making internal connections on a specific port or restricting connections to a particular device. However, Darktrace was not configured to take autonomous action on the customer’s network, and thus their security team would have had to manually apply any mitigative measures.

Later that day, the same device was observed attempting to connect to another internal location via port 445. This included binding to the server service (srvsvc) endpoint via DCE/RPC with the “NetrShareEnum” operation, which was likely being used to list available SMB shares on a device.

Over the following two days, it became clear that the attackers had compromised additional devices and were actively engaging in lateral movement. Darktrace detected two more devices conducting network scans using Nmap, while other devices were observed making extensive WMI requests to internal systems over DCE/RPC. Darktrace recognized that this activity likely represented a coordinated effort to map the customer’s network and identity further internal devices for exploitation.

Beyond identifying the individual events of the reconnaissance and lateral movement phases of this attack’s kill chain, Darktrace’s Cyber AI Analyst was able to connect and consolidate these activities into one comprehensive incident. This not only provided the customer with an overview of the attack, but also enabled them to track the attack’s progression with clarity.

Furthermore, Cyber AI Analyst added additional incidents and affected devices to the investigation in real-time as the attack unfolded. This dynamic capability ensured that the customer was always informed of the full scope of the attack. The streamlined incident consolidation and real-time updates saved valuable time and resources, enabling quicker, more informed decision-making during a critical response window.

Cyber AI Analyst timeline showing an overview of the scanning related activity, while also connecting the suspicious lateral movement activity.
Figure 3: Cyber AI Analyst timeline showing an overview of the scanning related activity, while also connecting the suspicious lateral movement activity.

File Encryption

On May 28, 2024, another device was observed connecting to another internal location over the SMB filesharing protocol and accessing multiple files with a suspicious extension that had never previously been observed on the network. This activity was a clear sign of ransomware infection, with the ransomware altering the files by adding the “KOK08@QQ[.]COM” email address at the beginning of the filename, followed by a specific pattern of characters. The string consistently followed a pattern of 8 characters (a mix of uppercase and lowercase letters and numbers), followed by a dash, and then another 8 characters. After this, the “.KOK08” extension was appended to each file [1][4].

Cyber AI Analyst Investigation Process for the 'Possible Encryption of Files over SMB' incident.
Figure 4: Cyber AI Analyst Investigation Process for the 'Possible Encryption of Files over SMB' incident.
Cyber AI Analyst Encryption Information identifying the ransomware encryption activity,
Figure 5: Cyber AI Analyst Encryption Information identifying the ransomware encryption activity.

Data Exfiltration

Shortly after the encryption event, another internal device on the network was observed uploading an unusually large amount of data to the rare external endpoint 38.91.107[.]81 via SSH. The timing of this activity strongly suggests that this exfiltration was part of a double extortion strategy. In this scenario, the attacker not only encrypts the target’s files but also threatens to leak the stolen data unless a ransom is paid, leveraging both the need for decryption and the fear of data exposure to maximize pressure on the victim.

The full impact of this double extortion tactic became evident around two months later when a ransomware group claimed possession of the stolen data and threatened to release it publicly. This development suggested that the initial Matrix ransomware attackers may have sold the exfiltrated data to a different group, which was now attempting to monetize it further, highlighting the ongoing risk and potential for exploitation long after the initial attack.

External data being transferred from one of the involved internal devices during and after the encryption took place.
Figure 6: External data being transferred from one of the involved internal devices during and after the encryption took place.

Unfortunately, because Darktrace’s Autonomous Response capability was not enabled at the time, the ransomware attack was able to escalate to the point of data encryption and exfiltration. However, Darktrace’s Security Operations Center (SOC) was still able to support the customer through the Security Operations Support service. This allowed the customer to engage directly with Darktrace’s expert analysts, who provided essential guidance for triaging and investigating the incident. The support from Darktrace’s SOC team not only ensured the customer had the necessary information to remediate the attack but also expedited the entire process, allowing their security team to quickly address the issue without diverting significant resources to the investigation.

Conclusion

In this Matrix ransomware attack on a Darktrace customer in the public sector, malicious actors demonstrated an elevated level of sophistication by leveraging compromised VPN credentials to gain initial access to the target network. Once inside, they exploited trusted tools like Nmap for network scanning and lateral movement to infiltrate deeper into the customer’s environment. The culmination of their efforts was the encryption of files, followed by data exfiltration via SSH, suggesting that Matrix actors were employing double extortion tactics where the attackers not only demanded a ransom for decryption but also threatened to leak sensitive information.

Despite the absence of Darktrace’s Autonomous Response at the time, its anomaly-based approach played a crucial role in detecting the subtle anomalies in device behavior across the network that signalled the compromise, even when malicious activity was disguised as legitimate.  By analyzing these deviations, Darktrace’s Cyber AI Analyst was able to identify and correlate the various stages of the Matrix ransomware attack, constructing a detailed timeline. This enabled the customer to fully understand the extent of the compromise and equipped them with the insights needed to effectively remediate the attack.

Credit to Christina Kreza (Cyber Analyst) and Ryan Traill (Threat Content Lead)

Appendices

Darktrace Model Detections

·       Device / Network Scan

·       Device / Attack and Recon Tools

·       Device / Possible SMB/NTLM Brute Force

·       Device / Suspicious SMB Scanning Activity

·       Device / New or Uncommon SMB Named Pipe

·       Device / Initial Breach Chain Compromise

·       Device / Multiple Lateral Movement Model Breaches

·       Device / Large Number of Model Breaches from Critical Network Device

·       Device / Multiple C2 Model Breaches

·       Device / Lateral Movement and C2 Activity

·       Anomalous Connection / SMB Enumeration

·       Anomalous Connection / New or Uncommon Service Control

·       Anomalous Connection / Multiple Connections to New External TCP Port

·       Anomalous Connection / Data Sent to Rare Domain

·       Anomalous Connection / Uncommon 1 GiB Outbound

·       Unusual Activity / Enhanced Unusual External Data Transfer

·       Unusual Activity / SMB Access Failures

·       Compromise / Ransomware / Suspicious SMB Activity

·       Compromise / Suspicious SSL Activity

List of Indicators of Compromise (IoCs)

·       .KOK08 -  File extension - Extension to encrypted files

·       [KOK08@QQ[.]COM] – Filename pattern – Prefix of the encrypted files

·       38.91.107[.]81 – IP address – Possible exfiltration endpoint

MITRE ATT&CK Mapping

·       Command and control – Application Layer Protocol – T1071

·       Command and control – Web Protocols – T1071.001

·       Credential Access – Password Guessing – T1110.001

·       Discovery – Network Service Scanning – T1046

·       Discovery – File and Directory Discovery – T1083

·       Discovery – Network Share Discovery – T1135

·       Discovery – Remote System Discovery – T1018

·       Exfiltration – Exfiltration Over C2 Channer – T1041

·       Initial Access – Drive-by Compromise – T1189

·       Initial Access – Hardware Additions – T1200

·       Lateral Movement – SMB/Windows Admin Shares – T1021.002

·       Reconnaissance – Scanning IP Blocks – T1595.001

References

[1] https://unit42.paloaltonetworks.com/matrix-ransomware/

[2] https://www.sophos.com/en-us/medialibrary/PDFs/technical-papers/sophoslabs-matrix-report.pdf

[3] https://cyberenso.jp/en/types-of-ransomware/matrix-ransomware/

[4] https://www.pcrisk.com/removal-guides/10728-matrix-ransomware

Continue reading
About the author
Christina Kreza
Cyber Analyst
Your data. Our AI.
Elevate your network security with Darktrace AI