Feature-rich remote access malware Pekraut emerges. The rodent seems to be of German origin and is ready to be released. We analyzed the malware in-depth.
While searching for new malware via suspicious pathes, a fake svchost.exe in %APPDATA%/Microsoft tipped us off. The sample is a .NET application which is packed with ConfuserEx. The file was uploaded as netRat.exe to Virustotal. The same name is also stated in the file's version information as InternalName and OriginalFilename. Version information also has a copyright statement for 2019.
Via similarity search we found a second sample that was uploaded to Virustotal a day later. It is not packed but obfuscated with Dotfuscator. Unpacking the ConfuserEx sample results in a file that is almost the same as the second sample.
The obfuscation removed the original names of .NET symbols like classes, variables and methods. We didn't find any non-obfuscated Pekraut sample, so we manually named the symbols based on their usage resulting in sample. The deobfuscated sample is also used for screenshots in this article. Please note that those symbol names aren't part of the original source code and thus do not suffice for signatures.
Pekraut's client accepts 27 commands. The help command sends a German description for every command to the server. The commands themselves are still English, though.
Some commands aren't exactly offering what the explanations are saying. E.g. the dbg command is not fully implemented.
The class responsible for managing all commands has seven placeholder objects in the command listing (see image below). The reason is most likely just a quirky way to place a newline when printing the help string of all commands.
To sum up, the whole RAT is quite function-rich and fully implemented except for the debugging option. Malware authors are not excempt from being so confident in their code that precautionary steps are neglected.
The table below sums up our analysis of the actual implementation for the commands.
|Writes the clipboard data or reads and sends it back to the server. Images stored in the clipboard are also supported.
|Logs keystrokes. Supports these special keys: VK_OEM_NEC_EQUAL, VK_LShift, VK_RShift, VK_Scroll, VK_LMenu, VK_RMenu, VK_RControl, VK_LControl
|Starts and stops recording with a microphone and sends the data to the server.
|Shows information about a screen or takes a screenshot for a chosen screen and sends it to the server.
|Takes a single picture via webcam or streams webcam to the server.
|Lists all subkeys and values of a given registry key.
|Deletes a registry key/value and sends the deleted key to the server.
|Reads a registry value and sends it to the server.
|Creates/writes a value in the registry.
|Kills a process via name or ID.
|Sends process names and IDs of all running processes to the server.
|Executes a file via a given path.
|Deletes a file or folder.
|Downloads a file from a given URL.
|Sends the following information about a file to the server : filename, filename extension, size, creation date, last access and the read-only attribute.
|Sends all file and folder names within a folder to the server. Extra option to list all available drives.
|Sends a file to the server.
|Uses a Windows 10 UAC bypass method to start a given program with admin rights. More details to this later on.
|Starts a command via cmd.exe and sends the output to the server.
|Shuts down the PC.
|Sends information like the machine name, the username, the OS and processor architecture, the screen count, the webcam count and the microphone count to the server.
|Option to start an endless-loop. Supposed to debug the client but not fully implemented yet.
|Disconnects from the server and terminates itself.
|Sends all commands / the description of a command to the server.
|Sends the last error to the server.
|Sends currently executed commands to the server and has the option to terminate them.
|Installs / uninstalls the client by using the procedure outlined in PekrautRAT's install / uninstall routine.
ComputerDefaults.exe will now execute the program since the DelegateExecute value is present. After launching ComputerDefaults.exe, Pekraut will remove all registry traces of the UAC bypass.
Pekraut RAT contains an installation and uninstallation routine. This Pekraut sample fakes svchost.exe and an update for Internet Explorer.
Install and uninstall routines use nine different flags that make it possible to turn certain behaviour on and off easily. There are also four public static strings that denote the install location, install subfolder, name of the copied files and name of the windows shortcut. Those flags and strings are most likely to be set via a malware builder. A summary is in the screenshot below. As you can see all flags are turned on for our sample except the useInstallSubFolder option. If it was turned on, the file would be copied to the location
Pekraut RAT sets up a socket connection to the server. The connection details are provided in the configuration class (see picture below).
The threat actor uses the portfowarding service portmap.io to hide the real IP address of their server. Possibly the server is even the actors home desktop machine.
The RAT has different data classes to send or receive the following types of data: a new password for encryption, keystrokes, text, images, audio, video, errors, files or authentication info.
Text data is encrypted via AES with the password in the configuration. Other data is compressed via zlib.
We didn't see any other samples in the wild so far but there are indications that this malware is just about to be released.
| Pekraut, ConfuserEx packed
| Pekraut, unpacked, Dotfuscator
| Pekraut deobfuscated, symbol renaming
|[HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell] = "explorer.exe, %APPDATA%\Microsoft\svchost.exe"
|[HKCU\Software\Classes\ms-settings\shell\open\command\DelegateExecute] = ""
|[HKCU\Software\Classes\ms-settings\shell\open\command\(default)] = <Program path>
|Password used to encrypt commands and logs