A deep dive into DCRAT/DarkCrystalRAT malware By Muhammad Hasan Ali Published: 2023-08-30 · Archived: 2026-04-05 22:26:57 UTC 20 minute read بسم الله الرحمن الرحيم FreePalestine IntroductionPermalink Dark Crystal RAT or DCRat is a typical RAT that has been around since at least June 2019. The RAT has ability to do many malicious code such as Power options like shutdown, reboot, or logoff the system, Enumerate operations like enumerate processes, folders, or drives, Execute code like CS, VB, VBS, PS, and create Denial of Service DoS. We will start to deep dive into its capabilities in this blog. Technical summaryPermalink Action Description Power options Reboot and shutdown the system and log off the current user. Enumerate operations Enumerate processes and retrieve information such as executable paths, folders, drives, screens, microphones, and cameras. Clipboard grabber Retrieve data from the clipboard, such as files or text. Execute CS, VB, VBS, PS Run and compile code inside the victim’s system, including C#, VB code, and scripts in bat, VBS, or PS. Denial of Service (DoS) Perform a Denial of Service (DoS) attack using the victim’s computer. Take screenshots Capture screenshots from the victim’s computer screen and obtain the screen’s width and height. Steal Steam credentials Target Steam gaming platform users and attempt to steal Steam credentials from the victim’s user. Retrieve Telegram and Discord path Obtain the installation path of Telegram and the path of local database files of Discord. System info Query and retrieve information about the victim, such as IP address, hostname, country, and more. Persistence Maintain persistence by modifying the registry, such as the Winlogon and run registry keys, and create scheduled tasks. CommandsPermalink The malware get commands from C2 to do malcious functions inside Class30 class, specifically inside C7y method. https://muha2xmad.github.io/malware-analysis/dcrat/ Page 1 of 24 Figure: Commands and malicious functions The malware gets the struct7_0 as an input which contains values of command and data from dictionary2 dictionary. The value of command from dictionary2 dictionary is returned by RL4 method. Then the value is hashed using SHA256 then take the first 4 bytes (32 bits) of the hash and convert to a uint then calculate the 6-digit hash by taking modulo ( % ) 1,000,000. This done by w_compute_SHA256_return_6_digits method. Figure: w_compute_SHA256_return_6_digits method The implementation in python. import hashlib import struct def smethod_1(string_0): sha256 = hashlib.sha256() sha256.update(string_0.encode('utf-8')) hash_hex = sha256.hexdigest() # Convert the first 4 bytes (32 bits) of the hash to a uint hash_value = struct.unpack('