- Packer: absent
Description
A backdoor written in C and designed to operate in the 32-bit versions of the Microsoft Windows operating systems. It allows attackers to remotely control infected computers by implementing remote shell functions—launching cmd.exe and redirecting the I/O to the attacker's C&C server. The malicious module’s original name is client_dll.dll.
Operating routine
The library has one exported function that implements the main functionality of the backdoor: ServiceMain.
At the beginning of the operation, the backdoor creates a mutex to exclude the simultaneous launch of its copy. It then decrypts the strings with an XOR operation with the byte 0x0F. List of decrypted strings:
Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.2;+SV1;
ns02.ns02.us/<redacted>/0xD.html
/webdav/0.htm
/webdav/%s.htm
%02d%02d
-download
Download OK!
Download failed...
-pslist
-pskill
-upload
Upload OK!
Upload failed...
Process is Killed!
Process killed failed.
-exit
cmd.exe /c
The URL ns02[.]ns02[.]us/<redacted>/0xD.html is hardcoded in the body of the backdoor that locates both primary C&C servers.
After decrypting the strings, BackDoor.Remshell.24 uses the %02d%02d format to store the current minutes and seconds. These values are then used in requests to the C&C server.
Next, a separate thread is started in which, in an infinite loop, the program attempts to obtain or update the address of the second-level C&C server. When the address of the secondary C&C server is received, the backdoor starts a thread in which it sends heartbeat requests to this server.
The backdoor then periodically requests commands from the C&C server and executes them.
Obtaining the address of the secondary C&C server
To get an address, a GET request is sent to the URL specified in the configuration. In response, the server sends the string -set <arg> or -SET <arg>, where <arg> is either a number or an IP address. The resulting number is interpreted as the interval for accessing the URL specified in the configuration. If an IP address is received, the backdoor adopts it as a secondary C&C server.
It is worth noting that the thread does not stop working when it receives the valid address of the C&C server. It continues to work, which allows one to change the C&C server addresses without restarting the backdoor.
Protocol for communicating with the secondary C&C server
At the beginning of the data sent by the PUT request, the backdoor appends a header consisting of 5 bytes, which is a string formed according to the format %02d%02d. The minute and second values representing when the request was formed are substituted in this string.
With that, the request and response data are encrypted. The value of each sent byte of the request data is reduced by 0x7F, and each received byte is increased by 0x7F.
As heartbeat requests, a PUT request is sent to <cnc_addr>/webdav/0.htm with data containing the name of the infected computer and the values of the minute and second when the backdoor was launched.
To request commands from the C&C server, the backdoor sends a GET request to <cnc_addr>/webdav/O.html. It then decrypts the server’s response and parses it for commands.
Commands list
Command | Description |
---|---|
-download | To download a specified file |
-exit | To terminate the backdoor operation |
-pskill | To terminate a specified process |
-pslist | To form a list of processes |
-upload | To send a specified file to the server |
others | Other commands are launched via cmd.exe /c |
Responses to commands are sent by PUT requests to <cnc_addr>/webdav/<minsec>.htm, where <minsec> is the values of the minute and second when the backdoor was launched.