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.
|spy_cb||Writes the clipboard data or reads and sends it back to the server. Images stored in the clipboard are also supported.|
|spy_keylogger||Logs keystrokes. Supports these special keys: VK_OEM_NEC_EQUAL, VK_LShift, VK_RShift, VK_Scroll, VK_LMenu, VK_RMenu, VK_RControl, VK_LControl|
|spy_mic||Starts and stops recording with a microphone and sends the data to the server.|
|spy_scr||Shows information about a screen or takes a screenshot for a chosen screen and sends it to the server.|
|spy_cam||Takes a single picture via webcam or streams webcam to the server.|
|reg_list||Lists all subkeys and values of a given registry key.|
|reg_del||Deletes a registry key/value and sends the deleted key to the server.|
|reg_read||Reads a registry value and sends it to the server.|
|reg_value||Creates/writes a value in the registry.|
|proc_kill||Kills a process via name or ID.|
|proc_list||Sends process names and IDs of all running processes to the server.|
|proc_start||Executes a file via a given path.|
|file_delete||Deletes a file or folder.|
|file_download||Downloads a file from a given URL.|
|file_info||Sends the following information about a file to the server : filename, filename extension, size, creation date, last access and the read-only attribute.|
|file_list||Sends all file and folder names within a folder to the server. Extra option to list all available drives.|
|file_send||Sends a file to the server.|
|exploit_admin_win10||Uses a Windows 10 UAC bypass method to start a given program with admin rights. More details to this later on.|
|pc_cmd||Starts a command via cmd.exe and sends the output to the server.|
|pc_shutdown||Shuts down the PC.|
|sysinfo||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.|
|dbg||Option to start an endless-loop. Supposed to debug the client but not fully implemented yet.|
|exit||Disconnects from the server and terminates itself.|
|help||Sends all commands / the description of a command to the server.|
|client_err||Sends the last error to the server.|
|tasks||Sends currently executed commands to the server and has the option to terminate them.|
|client_install||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||MSIL.Backdoor.NetRat.UAPQUG||cbc500b76995d36c76d04061c58ceaf93a1880af32be494e5ac1e099663ed0fd|
| Pekraut, unpacked, Dotfuscator||MSIL.Backdoor.NetRat.ZDZHYY||2dab95abe3460e34954527e88223662a03512938a9a28ab57e7f0a8ec298f367|
| Pekraut deobfuscated, symbol renaming||MSIL.Backdoor.NetRat.IJKLE3||4a89c3676dd86531c1fefb4e76d49cc31dc07a1a68c149dd08967e6fd7f6135a|
|[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||Ag2asgh2thGas37|