Maze Ransomware that contains a maze of code

By

SonicWall Capture Labs Threats Research team detected a variant of Maze ransomware that uses an anti-debugging technique though the technique is well documented.

The sample is distributed as a DLL file. Data is decrypted over and over to get the original data and code. It also makes up interesting strings like “dllisaweapon123”, “justanonce12345” in memory

A thread is created which parses PEB, hashing mechanism is used to retrieve APIs. Now the interesting part begins, address of the “ntdll_DbgUiRemoteBreakin” API is retrieved, and prologue is patched with a RET instruction.

As per documentation available in public domain:
“Debugger attaches to a process with DebugActiveProcess api which creates a thread in debuggee, then DbgUiRemoteBreakin() API is called to debug the process.”
By patching DbgUiRemoteBreakin API, the malware has ensured that the process couldn’t be attached for debugging.

It also has other anti-analysis code to verify if it’s being executed inside controlled environment.

It enumerates processes, computes a hash from the process name and compares the hash value against a list of hash belonging to monitoring tools like “procmon” etc. If the comparison is successful, the process is terminated.

Then it begins to encrypt files. Unlike, most of the ransomware where a specific string is appended to the file name, Maze ransomware adds random string to the file name. The folders where files have already been encrypted, a file named “DECRYPT-FILES.txt” is dropped for the victims which contains ransom note in addition to the instructions to be followed to recover the original files.

SonicWall Capture Labs provides protection against this threat via the following signature:

  • GAV: Maze.RSM_7 (Trojan)

This threat is also detected by SonicWall Capture ATP.

Security News
The SonicWall Capture Labs Threat Research Team gathers, analyzes and vets cross-vector threat information from the SonicWall Capture Threat network, consisting of global devices and resources, including more than 1 million security sensors in nearly 200 countries and territories. The research team identifies, analyzes, and mitigates critical vulnerabilities and malware daily through in-depth research, which drives protection for all SonicWall customers. In addition to safeguarding networks globally, the research team supports the larger threat intelligence community by releasing weekly deep technical analyses of the most critical threats to small businesses, providing critical knowledge that defenders need to protect their networks.