The page may not load correctly.
|Added to Dr.Web virus database:||2017-05-12|
|Virus description was added:||2017-05-16|
A multi-component network worm known as WannaCry. It is written in C/C++, assembled in MS Visual Studio, not packed. Contains two dynamic libraries in its own body. Once launched, it tries to send GET request to a remote server http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com without caching the results. If the worm receives a response from the server, it shuts down.
It is launched as the mssecsvc2.0 Windows system service (visible name—”Microsoft Security Center (2.0) Service”); The worm can receive arguments of the command line. If at least one argument is indicated, the worm tries to open the mssecsvc2.0 service and configure it for the restart in case of an error. After launch, it tries to rename file C:\WINDOWS\tasksche.exe to C:\WINDOWS\qeriuwjhrf, saves from the resources of the Trojan encoder to file C:\WINDOWS\tasksche.exe and runs it with a parameter /i. Within 24 hours after its launch as a system service, the worm automatically shuts itself down.
To spread itself, the worm initializes Windows Sockets, CryptoAPI and launches several threads. One of them lists all network interfaces on the infected PC and checks available servers in the local network; the rest of them generate random IP addresses. The worm tries to connect to these remote servers using port 445. If this port is available, a separate thread is used for the infection of network servers using a vulnerability in the SMB protocol.
A significant part of the dropper is a password protected ZIP archive, which stores the following files:
After being launched, it tries to install itself to the following folders:
During the installation, the worm creates the corresponding folder, puts inside an enclosed folder with a random name, then creates there its own copy named tasksche.exe.
Attempts to launch its copy as a randomly named system service. If the attempt is unsuccessful, it creates a system service, registers a launch of its own copy inside it using a command interpreter (“cmd.exe /c path”) and runs this service. In case of failure, it runs as an ordinary application.
When the dropper is launched as an application, it tries to write path and name of its current directory to the following system registry branches: HKLM\Software\WanaCrypt0r or HKCU\Software\WanaCrypt0r. Unpacks the archive contents to its current folder, saves to the file c.wncry one of three possible addresses of the BTC wallets. Opens access to the work directory for all system users and installs the hidden argument for it. Then it retrieves the Trojan encoder from the t.wnry file, decrypts it and executes it.
The encoder is stored in a separate dynamic library. It encrypts files using the AES-128 algorithm. Using the CryptGenKey function, the encoder creates the RSA pair, a public part is saved in a file 00000000.pky, a private part is encrypted with the author’s public key and saved in a file 00000000.eky. The key is generated for each encrypted file using the CryptGenRandom function.
The encrypted file stores:
During the course of encryption, a list of files, which could be decrypted in test mode, is created. It is saved to f.wnry. The session AES key for decryption of test files is encrypted with the second RSA key, the private part of which is stored in the Trojan’s body.
The encoder contains the author’s decoder, which performs the following functions:
The decoder accepts the following command line parameters (without arguments):
To exchange data with the onion servers, Trojan.Encoder.11432 uses its own protocol. Unfortunately, at present it is impossible to decrypt files encoded by the Trojan.
To share data with remote servers, the Trojan uses its own protocol. It is possible to point out three types of network activity:
Before session, the Trojan checks whether there is an established connection and chooses one of the addresses of an onion server saved in the configuration. To check the operating capability of the server, the Trojan connects to it through the 80th port via the TOR network and installs a session key; after that useful information is sent.
Transmitted data packages are encrypted.
When the Trojan attempts sending a text to the Trojan's authors, and it is shorter than 10 symbols, the malicious program returns an error “Too short message!”. Messages longer than 1000 symbols are shortened to 1000 symbols. The decoder doesn’t allow sending messages too often (these restrictions are implemented in the decoder itself).
When clicking the button of the payment check, the decoder attempts reading a file that contains a public key and a file with the private key. If the reading was successful, it checks their compliance via encryption and decryption of a test buffer. If there is no file with the private key or if the file doesn’t correspond to the file with the public key, the Trojan refers to its servers.
It sends data to the server and then waits for the decrypted EKY file (private part of the RSA key).