How does wanacrypt ransomware work?
Table of contents:
- How does Wanacrypt ransomware work?
- What is an opcode?
- We continue ...
- How does Wanacrypt ransomware work?
Wanacrypt has worm-like capabilities and this means that it tries to spread over the network. To do this, it uses the Eternalblue exploit (MS17-010) with the intention of spreading to all machines that do not have this vulnerability patched.
Index of contents
How does Wanacrypt ransomware work?
Something that catches the attention of this ransomware is that it not only searches within the local network of the affected machine, but also proceeds to scan public IP addresses on the internet.
All these actions are carried out by the service that ramsonware itself installs after its execution. Once the service is installed and executed, 2 threads are created which are in charge of the replication process to other systems.
In the analysis, experts in the field have observed how it uses exactly the same code used by the NSA. The only difference is that they have no need to use the DoublePulsar exploit since their intention is simply to inject themselves into the LSASS (Local Security Authority Subsystem Service) process.
For those who do not know what LSASS is, it is the process that makes Windows security protocols work correctly, so this process should always be executed. As we can know, the EternalBlue payload code has not been altered.
If you compare with existing analyzes you can see how opcode is identical to opcode…
What is an opcode?
An opcode, or opcode, is a fragment of a machine language instruction that specifies the operation to be performed.
We continue…
And this ransomware makes the same function calls to finally inject the.dll libraries sent in the LSASS process and execute its "PlayGame" function with which they start the infection process again on the attacked machine.
By using a kernel-code exploit, all operations performed by malware have SYSTEM or system privileges.
Before starting the encryption of the computer, the ransomware verifies the existence of two mutexes in the system. A mutex is a mutual exclusion algorithm, this serves to prevent two processes in a program from accessing its critical sections (which are a piece of code where a shared resource can be modified).
If these two mutex exist, it does not perform any encryption:
'Global \ MsWinZonesCacheCounterMutexA'
'Global \ MsWinZonesCacheCounterMutexW'
The ransomware, for its part, generates a unique random key for each encrypted file. This key is 128bits and uses the AES encryption algorithm, this key is kept encrypted with a public RSA key in a custom header that the ransomware adds to all encrypted files.
Decryption of files is only possible if you have the RSA private key corresponding to the public key used to encrypt the AES key used in the files.
The AES random key is generated with the Windows function "CryptGenRandom" at the moment it does not contain any known vulnerabilities or weaknesses, so currently it is not possible to develop any tool to decrypt these files without knowing the RSA private key used during the attack.
How does Wanacrypt ransomware work?
In order to carry out all this process, the ransomware creates several execution threads on the computer and begins to carry out the following process to carry out the encryption of the documents:
- Read the original file and copy it by adding the extension.wnryt Create a random AES 128 key Encrypt the file copied with AESA Add a header with the key AES encrypted with the key
publishes RSA that carries the sample. Overwrites the original file with this encrypted copy Finally renames the original file with the extension.wnry For each directory that the ransomware has finished encrypting, it generates the same two files:
@ Please_Read_Me @.txt
@ WanaDecryptor @.exe
We recommend reading the main reasons to use Windows Defender in Windows 10.
Ip: what is it, how does it work and how to hide it
What is IP, how does it work and how can I hide my IP. Everything you need to know about IP to navigate safely and hidden on the Internet. Meaning IP.
What is it and how does a gpu or graphics card work?
We explain what it is and how a GPU or graphics card that coexists inside your computer works. History, models and their functions in your system.
What can I do if it falls out of place or does not work?
Pordede falls regularly. We tell you what to do if Pordede falls so you can continue enjoying movies and series by free streaming.