Post

1337 Ransomware

1337 Ransomware

Executive Summary

This program performs a malicious operation on the computer by encrypting various file types, rendering them inaccessible to the user. It specifically targets files with certain extensions like documents, images, and more. To ensure persistence, it places copies of itself in startup locations, so it re-executes every time the system boots up. The encrypted files will be renamed. Additionally, the program drops a decryptor tool that claims to reverse the encryption, but this tool is likely part of the attack’s mechanism to extort the user. This results in significant disruption, with files becoming inaccessible unless the key was obtained and applied to the decryptor executable file.


Case Details

Sample information

AttributeValue
File nameleetransomware.exe
File size555 KB
File typeExecutive file (EXE)
MD528003e5fb4b9a24c4cba28163d6b7073
SHA17eaf5488fdd370802fb94463b098805a07cb3cc1
SHA256ccae4d7cc4e9efc1ac6882d49de17eb2e9a6fdfd979c1bf9b1d5ad4b4bb439cc
Packer / compiler infoMicrosoft .NET
Compile timeThu Aug 18 08:12:50 2022 (UTC)

Case-Specific Requirements

Environment

  • Operating System: Windows

Tools Used

  • Detect It Easy (DIE)
  • DnSPY
  • FakeNet
  • DiffView

Static Analysis

Open up the Detect It Easy, can see the file was using the dotnet Framework with the version of 4.0.30319 and it was using 32bit.

img

Using DNSPY found two content under the leetransomware.exe

img

Get into the entry point:

img

it initializes Windows Forms settings with visual styles enabled and starts the application by launching the Form1 window.

img

Going to Form1. Theres a overriding class of the Form1 to start the object of common.

img

The PenetrateFirewall function attempts to bypass or disable the system’s firewall. It first tries to check internet connectivity by downloading a string from a hxxp[://]www[.]websitetest[.]com/. If this fails, it executes a hidden command-line process to disable the firewall using the netsh command. The function returns true if either attempt succeeds and false if both fail.

img

Getting back to Form1. A void of startAction ensures the ransomware persists by dropping itself into the startup folder and adding a registry entry ‘Crypt’. It encrypts the target directory at C:\inetpub\wwwroot and generates a password for encryption. Malicious files like decryption tools and messages are also dropped.

img

Notice the Settables class exist outside of Form1. Heading into that class

img

Theres a C2 of URL (hxxp[://]157[.]230[.]253[.]55/info[.]php?info=),an array of SALT and array of extensions file (EXTENTIONS).

img

Heading back to Form1. createPassword generates a random alphanumeric password, includes symbols, and hashes it with SHA-256 for secure encryption.

img

encryptDirectory recursively encrypts files in a directory, targeting specific file types such as .txt, .pdf, .jpg, .sql, and more.

img

EncryptFile reads the file content, encrypts it using AES with a SHA-256-hashed password, and appends a ransomware-specific extension .1337ransom.

img

AES_Encrypt encrypts file data using AES with CBC mode and a derived key and IV from the SHA-256 password.

img

addToStartupRegistry creates persistence by modifying the Windows registry to execute the ransomware on startup.

img

The dropFiles function load malicious files, including a decryption tool(leetransomware.Embedded.leetransomware-Decrypt.exe) and a ransom note(leetransomware.Embedded.leetransomware-Message.exe), to specific locations on the target system, such as the startup folder or root directory, ensuring visibility to the victim.

img

Due to currently we know that the getEmbeddedResource will be called, now we need to check the Embedded file present in these dotnet.

img

Message.exe:

img

Decrypt.exe:

img

Opening the message.exe on DnSPY will be able to see on the Form1 that another resource was present in this dotnet:

img

On the resource of message.exe. The note of ransom was stored on the Resources with the format of HTML:

img


Dynamic Analysis

The message.exe that will display the note of ransomware:

img

The Decrypt.exe:

img

Refer the code that reload the resources of decrypt.exe and decrypt from the leetransomware.exe. The location will be stored on the C:\inetpub\wwwroot\LeetDecryptor.exe:

img

Replicate the file path and rename the file. Taking an example of that encrypted (extension .1337ransom) and load the LeetDecryptor.exe.

img

Using the password SDa5tJMz to decrypt that extension.

img

img

The file can now be opened

img

Executing and checking the Fakenet:

img

Executing and using DiffView to check registry, processes or any changes on the filesystem:

img

Encrypted process:

img

img

Similar like static analysis, Crypt was created on the ‘Run’ and the message will be executed on start.

img

The file exists on the directory:

img

Another message.exe will be created on the location below:

img

IOCs

IOCType
hxxp[://]157[.]230[.]253[.]55/info[.]php?info=URL
LeetCryptor.exeExecutable file
leetransomware.Embedded.leetransomware-Message.exeResource
leetransomware.Embedded.leetransomware-Decrypt.exeResource
hxxp[://]www[.]websitetest[.]com/URL
C:\Documents and Settings\smilysk\Desktop\SneakSense\leetransomware\leetransomware-Message\HtmlDirectory
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\ message.exeDirectory file of Executable file
C:\Users\%user%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\LeetCryptor.exeDirectory file of Executable file
C:\Users$user$\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ message.exeDirectory file of Executable file

Additional Notes

  • Provide the filename that is dropped in the Startup folder:
    • LeetCryptor.exe
  • Provide the registry key name created by the ransomware:
    • Crypt
  • Provide the C2 IP address that the ransomware communicated with:
    • 157.230.253.55
  • Provide the directory that the ransomware will encrypt:
    • C:\inetpub\wwwroot
  • Provide the name of the encryption algorithm used by this ransomware to encrypt files:
    • AES
  • What is the file extension appended to files that have been encrypted?
    • .1337ransom
  • What is the word or title displayed in the ransomware’s readme message?
    • Your PC has been encrypted by 1337 Ransomware!
  • Use the password to decrypt the file and retrieve the flag:
    • SDa5tJMz
    • Flag: flag{helow_there_you_got_some_skills!}
This post is licensed under CC BY 4.0 by the author.