Compare Devo vs. Splunk vs. Elastic in the Buyer's Guide to Log Management Download Now
Request Demo

The Threat

Black Kingdom is targeting Exchange servers that remain unpatched against the ProxyLogon vulnerabilities disclosed by Microsoft earlier this month. It strikes the on-premises versions of Microsoft Exchange Server, abusing the remote code execution (RCE) vulnerability also known as ProxyLogon[1] (CVE-2021-27065[2]).

[1] https://www.devo.com/blog/detect-and-investigate-hafnium-using-devo/

[2] https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-27065

BlackKingdom runs a script on all vulnerable Exchange servers via ProxyLogon vulnerability.

 

Executable seems to be py2exe, and if run successfully users see something like this:

The bitcoin address included in the script has a couple of transactions when these words are written (11:30 UTC, March 25th).

https://www.blockchain.com/btc/address/1Lf8ZzcEhhRiXpk6YNQFpCJcUisiXb34FT

The encryption process includes three main stages:

  • In the first, it performs a reading of the file
  • In the second an overwriting of the file with the encrypted data
  • And in the third a name change so that the file is not associated with any application.

In the first samples found, it seems that there is a list of locations that will not be affected by file encryption. The directories are all related to the operating system in order not to affect its operation.

  • ProgramData
  • Windows
  • Program Files (x86)
  • Program Files
  • AppData\Roaming\
  • AppData\LocalLow\
  • AppData\Local\

 

Delivery

Orchestrated from a remote server 185.220.101.204 and operated from 185.220.101.216. The threat actor exploited the on-premises versions of Microsoft Exchange Server, abusing the remote code execution (RCE) vulnerability also known as ProxyLogon (CVE-2021-27065).

These two IP addresses are part of the anonymous network TOR. If we get all the information related to these two TOR nodes we can show that the network usage has increased in the last few days. Also, both servers have an uptime of only almost five days.

 

 

 

Alerting

The Devo Security Operations alert dataset includes an alert that can be used because detects anonymous connections over firewall logs.

  • SecOpsAnonymousConnection

Due to the threat type we’re trying to detect we can add a new alert to monitor all connections to our web servers from anonymous servers.

  • SecOpsWebConnectionFromAnonymousServer

Both alerts could be improved for this threat by adding some filtering:

  • IP addresses from known threat actors.

  • Owa http path to monitor only Exchange Servers.

  • Looking for ASPX resources.

Persistence

Once the server compromise has occurred, the attacker installs a webshell. This webshell offers remote access to the server and allows the execution of arbitrary commands.

The process in charge of webshell creation is named “w3wp.exe.”

 

 

 

 

 

 

 

One of the actions that is triggered is an attempt to stop all services that include the word “sql” in their name. Surely this is done with the intention of being able to encrypt all the files in the existing databases.

Alerting

Webshell deploy

Devo released a new alert to detect a command execution that appears to be in charge of creating the webshell file. This alert could be correlated with others to detect the complete or partial behaviour of the ransomware.

  • SecOpsBlackKingdomWebshellInstalation

Powershell

Devo released a new alert to detect attempts to stop services that are related by name with SQL services. This alert could be correlated with others to detect the complete or partial behavior of the ransomware.

  • SecOpsStopSqlServicesRunning

 

IoCs

The Devo security team is pushing all the indicators into a lookup that is available in all domains across the platform. Customers can use it to create new alertes, perform hunting, or create active dashboards.

Additionally, it is necessary to activate the alerts related to the ProxyLogon (HAFNIUM) threat available in Devo.

 

 

 

 

 

 

 

 

[3] https://docs.devo.com/confluence/ndt/searching-data/working-in-the-search-window/data-enrichment/manage-and-edit-lookup-tables

Mitigation

Follow the recommendations from Microsoft. They release the “Exchange On-premises Mitigation Tool (EOMT)”. This script contains mitigations to help address CVE-2021-26855 vulnerability.

References

[1] https://news.sophos.com/en-us/2021/03/23/black-kingdom 

[2] https://www.bankinfosecurity.com/black-kingdom-ransomware-hits-unpatched-exchange-servers-a-16258 

[3] https://securityaffairs.co/wordpress/115912/malware/black-kingdom-microsoft-exchange.html 

[4] https://www.pcrisk.com/removal-guides/17885-black-kingdom-ransomware 

[5] https://searchsecurity.techtarget.com/news/252498313/Black-Kingdom-ransomware-impacting-Exchange-servers

[6] https://github.com/sophoslabs/IoCs/blob/master/Ransomware_BlackKingDom.csv 

[7] https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-27065 

[8] https://tria.ge/210320-3ndwxm4phj 

[9] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-27065 

[10] https://github.com/microsoft/CSS-Exchange/tree/main/Security

Get the latest updates

Sign up to stay informed with the latest updates from Devo.

Want a live demo or have specific questions? SPEAK WITH A DEVO SPECIALIST