Next Article in Journal
An Experimental Analysis of Deep Learning Architectures for Supervised Speech Enhancement
Next Article in Special Issue
The Influences of Feature Sets on the Detection of Advanced Persistent Threats
Previous Article in Journal
Development of a Portable, Reliable and Low-Cost Electrical Impedance Tomography System Using an Embedded System
Previous Article in Special Issue
Quantifiable Interactivity of Malicious URLs and the Social Media Ecosystem
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Magniber v2 Ransomware Decryption: Exploiting the Vulnerability of a Self-Developed Pseudo Random Number Generator

1
Department of Financial Information Security, Kookmin University, Seoul 02707, Korea
2
Department of Information Security, Cryptology and Mathematics, Kookmin University, Seoul 02707, Korea
*
Author to whom correspondence should be addressed.
Electronics 2021, 10(1), 16; https://doi.org/10.3390/electronics10010016
Submission received: 28 November 2020 / Revised: 18 December 2020 / Accepted: 20 December 2020 / Published: 24 December 2020
(This article belongs to the Special Issue New Challenges on Cyber Threat Intelligence)

Abstract

:
With the rapid increase in computer storage capabilities, user data has become increasingly important. Although user data can be maintained by various protection techniques, its safety has been threatened by the advent of ransomware, defined as malware that encrypts user data, such as documents, photographs and videos, and demands money to victims in exchange for data recovery. Ransomware-infected files can be recovered only by obtaining the encryption key used to encrypt the files. However, the encryption key is derived using a Pseudo Random Number Generator (PRNG) and is recoverable only by the attacker. For this reason, the encryption keys of malware are known to be difficult to obtain. In this paper, we analyzed Magniber v2, which has exerted a large impact in the Asian region. We revealed the operation process of Magniber v2 including PRNG and file encryption algorithms. In our analysis, we found a vulnerability in the PRNG of Magniber v2 developed by the attacker. We exploited this vulnerability to successfully recover the encryption keys, which was by verified the result in padding verification and statistical randomness tests. To our knowledge, we report the first recovery result of Magniber v2-infected files.

1. Introduction

1.1. Background

Ransomware, a compound word of ransom and software, is a malicious software that encrypts important files such as documents, photos and videos and requires payment for data recovery. Enabled by advanced IT technology, increased PC penetration rate, and the advent of Bitcoin that allows anonymous transactions, ransomware attacks can accrue financial benefits. Ransomware has transformed from non-targeted infection of unspecified targets to targeted infection of companies or institutions. In March of 2019, the Norwegian aluminum producer Norsk Hydro was infected with LockerGoga, a ransomware that enforced the shutdown of the extrusion process, and the separation of all the company’s factories and operations networks from the global network. During this process, some automated processes were switched to manually operation. The known damage was approximately US $41 million [1]. In early March of 2019, computers in the government offices of Jackson County, Georgia, were infected with Ryuk and many jobs except 911 were paralyzed. As Jackson County City’s backup systems were also encrypted, the government paid 100 bitcoins for quick recovery [2]. If the required ransom is paid, the attacker notices not only the victims of the individual or group victims, but also that their industry is willing to pay for recovering the information. It was also recently reported that ISS World, which provides cleaning, catering, security and other services in UK, has become a victim of a ransomware in 2020. The company’s website has been down since Feb and the management at the London’s Surrey, Canary Wharf and Weybridge offices consisting of 43,000 staff members are inaccessible emails since then. ISS officials say that the database has been locked from being accessed because of file-encrypting malware infection [3]. To overcome the damage caused by ransomware, a fundamental solution other than ransom payment is required. One effective solution is recovery of the encryption key that encrypted the file. Ransomware generates encryption keys by a PRNG. After encrypting the files in the victim’s PC, the encryption keys are protected and can be recovered only by the attacker. One protection method is hybrid encryption that combines symmetric- and asymmetric-key ciphers. The high-speed symmetric-key cipher is used for data encryption and the asymmetric-key cipher is used for encrypting the encryption key of the symmetric-key cipher. File encryption is performed by a symmetric-key cipher: the attacker encrypts the encryption keys using their public key and places it in the victim’s system. The encryption keys are safely protected because only the attacker’s private key, which is not stored in the victim’s system, is imperative information for decrypting them. Therefore, obtaining the encryption keys is notoriously difficult.
Magniber, a variant of Cerber ransomware, is mainly targeted South Korean victims in the mid-2017. According to AhnLab statistics, Magniber’s sample rate was highest from the fourth quarter of 2017 to the first quarter of 2018 [4]. The two existing versions of Magniber (versions 1 and 2) were distributed via the Magnitude exploit kit. A main feature of Magniber v1 is the encryption of all files by the same encryption key, which is received from the Command and Control (C&C) server. If the C&C server closes or the network is disconnected, the encryption key is not received and a hard-coded value is used instead  [5]. The hard-coded encryption key is identified by inspecting the extension of the infected file. The decryption tool distributed by AhnLab can decrypt Magniber v1-infected files using the hard-coded value, but cannot yet decrypt the encryption key received from the C&C server  [6]. Magniber v2 uses a hybrid encryption that combines the symmetric-key cipher AES and the asymmetric-key cipher RSA. All files infected by Magniber v2 are encrypted with AES using different encryption keys, which are themselves encrypted using the attacker’s RSA public key. In other words, the victims need to obtain the attacker’s RSA private key to decrypt the encrypted AES encryption keys and hence recover the infected file. However, the asymmetric-key cryptography ensures that the attacker’s private key is only owned by the attacker and cannot be obtained by another party. In addition, cryptographic algorithms (including AES and RSA used in Magniber v2) have been continuously researched for decades, ensuring sufficient security. For these reasons, Magniber v2 remains as unrecoverable ransomware to date. Table 1 summarizes the features of Magniber v1 and v2.
In this paper, we provide (to our knowledge) the first decryption of files infected by Magniber v2. Magniber v2 generates encryption keys for file encryption using a PRNG developed by the attacker. However, our analysis revealed that Magniber’s PRNG is not cryptographically secure. This crucial weakness is essential for encryption keys recovery. We were able to reduce the range of encryption key candidates by exploiting the vulnerability of the PRNG. The encryption key was then recovered by verifying whether the ciphertext decrypted by the encryption key candidates is plaintext or not. To distinguish between plaintext and ciphertext, we employed padding verification and the statistical randomness tests of the National Institute of Standards and Technology (NIST) SP800-22 [7]. For efficient encryption key recovery, we first performed a padding verification, which has a relatively low execution cost, then the second verification through statistical randomness tests on the encryption key candidates that passed the first verification. The correct encryption key was then selected as the encryption key candidate that passed both verifications. Using this key, we were able to decrypt the infected files.

1.2. Our Contributions

This paper analyzes the encryption process of Magniber v2 and proposes a method that decrypts Magniber v2 without requiring the attacker’s private key. Our contributions are summarized below.
  • The existing decryption technique for Magniber-infected files decrypts only version 1, in which the main parameters are hard-coded key. Files infected by Magniber v2, which uses hybrid encryption, cannot be decrypted. We present the first successful decryption of Magniber v2-infected files. Our proposed method is experimentally verified in a demonstration.
  • The existing ransomware generates the encryption keys for file encryption by a random number generator (RNG). A typical RNG determines the security strength from seeds generated by collecting various noise sources. Well-known RNGs such as Hash DRBG and CTR DRBG, are deterministic algorithms that derive pseudo random numbers by inputting seeds. However, Magniber v2’s RNG is developed by an attacker and its security is not guaranteed. We reveal the inherent vulnerabilities in Magniber v2’s RNG and exploit them to recover the key parameters such as encryption key and initialization vector (IV). The vulnerability is derived from the seed input and structure of the RNG.
  • Once the encryption key has been recovered, its correctness must be verified. Valid encryption key verification can apply a fixed known value, commonly called an authenticator. However, an authentication based verification is difficult when the ransomware encrypts various files. To solve this problem, we apply padding verification and statistical randomness tests. Padding verification is computationally cheaper than randomness tests, but gives a high false-positive rate. To compensate this deficiency, we perform additional randomness tests on the objects passed by the padding verification. By reducing the number of randomness tests, we improve the efficiency of the encryption key verification.

2. Related Work

There are various techniques and tools developed for detecting and decryption different types of ransomware. Ransomware detection systems determine whether it is ransomware through static or dynamic analysis. The static analysis-based detection identifies ransomware by using information such as strings, Application Programming Interface (API), signatures and metadata in the ransomware binary. Kanwal, Meet et al developed a model that can statically detect ransomware in the Android system by collecting strings that frequently used in ransom notes such as “_RANSOM”, “_locked”, and “_money” and analyzing API [8]. Similarly, Andronio et al proposed a model that can detect ransomware in Android systems by comprehensively analyzing API related to data encryption and device locking [9]. Since static analysis-based detection analyzes binary files, it is possible to diagnose before ransomware execution, which is a technique often used by antivirus. However, it is difficult to apply the technique if the ransomware is packed or code obfuscated [10]. The dynamic analysis-based detection collects and detects behavior data generated when ransomware is running. The behavior data includes information such as entropy, I/O frequency, API, etc. Unlike static analysis, the method has a high detection rate as the behavior of the actual ransomware does not change even if obfuscation or packing is applied. It also has a high detection rate in new variants. However, some files are lost because the actual ransomware needs to be executed, and if false-positive occurs, all files are at risk of being encrypted [11,12,13,14,15].
Recently, various ransomware detection studies using artificial intelligence techniques have researched. Hasan, Md Mahbub et al developed a ransomware detection framework. The Author extracted more than 60 features including API Call, registry, file system and process operation, and trained using Support Vector Machine (SVM) algorithm [16]. Lee et al. used machine learning algorithm to detect if files were encrypted before being copied to the backup file system. Each file’s entropy was estimated using some of the NIST900-80b tests, and it was trained via the model of k-NN, Decision Tree, kernel support vector machine and Multi-Layer Perceptrons algorithms [17]. Almashhadani et al. described a detection system that extracted the features exclusively from network traffic. The authors obtained twenty features from the characteristics of TCP, HTTP and DNS traffic. They made a decision making module based on two classifiers that one classifier was based on per-packet features, the other was based on flow-based features. The classifiers evaluated were Random Forests, Bayes Networks, SVM and Random Trees [18].
Decryption studies fall into two main categories: targeting multiple ransomware and individual ransomware. Targeting multiple ransomware focuses on restoring the random number used in the current encryption key by hooking or monitoring the PRNG function. Kolodenker et al. focused on the fact that ransomware employing hybrid cryptosystem creates symmetric-keys during infected  [19]. Symmetric keys are encrypted and stored by the attacker’s public key and can be decrypted by a private key held by the attacker. As the private key is difficult to acquire, the authors suggested setting up a key escrow, observing the symmetric keys used for file encryptions and hooking the Crypto API in Windows to acquire the session keys. Similarly, Kim et al proposed that the cryptographically secure pseudo random number generator (CSPRNG, provided by Windows as CryptoGenRandom) can be replaced by a user-defined deterministic random bit generator (DRBG) [20]. They suggested storing the seed used in the DRBG in an external repository and reproducing the encryption key using stored seed when a ransomware infection occurs.
Meanwhile, individual ransomware is decrypted by guessing the key (exploiting, if present, the cryptographic vulnerability of a ransomware), or extracting the key from memory (exploiting the system vulnerability). Hidden-Tear is an open source ransomware released in August 2015. Originally created for educational purposes, it has been modified by cybercriminals to spread various ransomware. Hidden-Tear uses the AES algorithm for file encryption and sends the key to the C&C server [21]. However, a vulnerability in the Hidden-Tear design enables the decryption of infected files. In particular, the PRNG seed of Hidden-Tear is predictable and uses a hard-coded IV and salt data. The author has published the Hidden-Tear decryption tool, meaning that variants with the same PRNG can be decrypted [22]. The PRNG of Donut ransomware, a variant of Hidden-Tear that appeared in 2018, differs from that of Hidden-Tear, so cannot be decrypted with the Hidden-Tear decryption tool. Lee et al. found that because the key of Donut is not deleted from memory, it can be extracted from memory and used for file decryption  [23]. They also proposed a method that decrypts LooCipher, a ransomware that appeared in 2019 [24] and encrypts all files with AES128-ECB using a unique key. They found that the LooCipher’s PRNG uses a R a n d o m ( ) function that is seeded with the current time, so the unique key can be recreated using the time of infection.
WannaCry ransomware that has infected more than 200,000 computers in 150 countries around the world since May of 2017 [25]. This ransomware encrypts files using AES and encrypts an AES key with a locally generated RSA implemented through a Crypto API [26]. However, in some versions of Windows XP and Windows 7, the prime number of the RSA private key of the Crypto API is not deleted from memory. By exploiting these vulnerabilities, the decryption tool Wanakiwi was developed to extract it existing in memory to recovering the RSA private key [27]. Boczan reported the evolutionary changes in the cryptographic algorithms of GandCrab ransomware (versions 1–5) and the packing technique of GandCrab that bypasses antivirus software [28]. In GandCrab versions 1, 2 and 3, the file encryption key and IV are generated by a CSPRNG, and the file is encrypted using an AES. The AES key and IV are then encrypted with a locally generated RSA public key and the RSA key pair is transmitted to the C&C server. In versions 4 and 5, the AES is replaced by the stream cipher Salsa20 for faster encryption, the encryption system newly encrypts the existing locally generated RSA private key with the attacker’s public key to ensure that encryption works well even when communication is impossible. Currently, the GandCrab v1, v4 and v5.0–v5.2 only are known to be decryptable. To prevent the damage by GandCrab, the Federal Bureau of Investigation, several law enforcement agencies, and individual companies have collaborated to obtain a master private key [29,30]. In addition, European law enforcement and IT Security companies have launched the No More Ransomware project to mitigate the impact of ransomware on business and individuals [31]. This collaborative project offers decryption tools for a range of ransomware.

3. Analysis of Magniber v2

This section details the encryption process of Magniber v2 together with its malicious behavior process, which we reveal by reverse engineering.

3.1. Malicious Behavior Process

Figure 1 shows the 10 steps of the entire malicious behavior process. Magniber v2 begins by running Loader.dll, which is installed and executed on the victim’s PC through the malvertising technique. Loader.dll unpacks Payload.dll (1), which performs the malicious actions, searches from the target process (2) and injects dll into process (3). After identifying the system language, Payload.dll performs malicious actions on victim’s computers (4).
Thereafter, Payload.dll generates a mutex (5) that encrypts the files in a non-duplicable way. For victim identification purposes, its PRNG generates a victim’s ID (6). The PRNG is customized directly by the developer of Magniber v2 and generates both the IV and encryption key. The structure of the Magniber v2 PRNG, which plays a major role in our research, is detailed in the next section. The files to be encrypted are documents, media, image, audio and etc., with 748 extensions in total(7). Folders required for program files, booting and running the operation system are excluded from encryption. Finally, the ransomware deletes the Volume Shadow Copy (VSC) would otherwise allow a system restore (8) and registers the ransom note and recovery guide browser on the task scheduler. The ransomware then runs automatically at the designated time (9, 10).
A working sample of Magniber v2 has been obtained in a hybrid analysis [32]. The hash value of each object is as follows.
  • Loader.dll
    • MD5: 72FCE87A976667A8C09ED844564ADC75
    • SHA1: D3E17F5ECA5FB23B272549692D84CC449CF71527
    • SHA256: 6E57159209611F2531104449F4BB86A7621FB9FBC2E90ADD2ECDFBE
      293AA9DFC
  • Payload.dll
    • MD5: 19599CAD1BBCA18AC6473E64710443B7
    • SHA1: F9E2111E2903838BB9F4EFB557F75745D028BC3E
    • SHA256: FB6C80AE783C1881487F2376F5CACE7532C5EADFC170B39E06E174
      92652581C2

3.2. Encryption Process

Because our aim is to decrypt infected files, we first describe the encryption process in detail. The order of file infection by Magniber v2 is determined by Depth First Search (DFS) (Depth-first search is an algorithm that traverses or searches tree or graph data structures. The algorithm starts at the root node (on a graph, the root is an arbitrary node) and explores as far as possible along each branch before backtracking).
Folders at the same depth are searched and infected in ascending order of their folder names. Next, files in the same folder are preferentially infected in ascending order of their file names. File encryption by Magniber v2 proceeds in three steps: file encryption key ( F E K ) and I V generation, F E K  and I V encryption and file encryption. These steps are applied to each target file. Each step of the Magniber v2 file encryption process is presented in Figure 2 and described below.

3.2.1. F E K and I V Generation

Using its PRNG, Magniber v2 generates different 16-byte F E K and 16-byte I V for file encryption. This PRNG (hereinafter referred as to the Magniber PRNG (MPRNG)) is not a well-known algorithm such as Hash DRBG, HMAC DRBG and CTR DRBG, but is custommade by the attacker. MPRNG is seeded by the output of GetTickCount and outputs a random string composed of ASCII characters from ‘0’ to ‘9’ and ‘a’ to ‘z’. As MPRNG internally calls the GetTickCount function twice while generating each one-byte random character, it calls the GetTickCount function 2 n times when deriving an n-byte random string. The structure of MPRNG is important for decrypting an encrypted file, as will be explained in detail in the next section.

3.2.2. F E K and I V Encryption

Magniber v2 encrypts the key parameters of file encryption, F E K and I V , using the hard-coded public key developed by the attacker. The use of a public (hard-coded) key for encryption, which is the inability to decrypt the ciphertext (encrypted key parameters) without the private key, are the main features of asymmetric (public-key) ciphers. The F E K and I V are concatenated and encrypted with RSA2048-OAEP as shown in Equation (1).
C = RSA2048-OAEP ( F E K | | I V , P u b K e y )
where C is the encrypted value of the concatenated F E K and I V , P u b K e y is the attacker’s RSA public key, which is hard-coded in Magniber v2.

3.2.3. File Encryption

File encryption is performed by the encryption algorithm AES128 using the Cipher Block Chaining (CBC) mode of operation and PKCS#7 padding (denoted AES128-CBCPKCS7Padding). This step is described by
C = AES128-CBC-PKCS7Padding ( P , F E K , I V )
Here, P is a file to be encrypted and C is an encrypted file. The encrypted file is created by concatenating C to C (C and C are outputs of Equations (1) and (2), respectively). Once the file encryption is completed, the F E K and I V are then zeroized, which prevents their recovery through memory analysis.

4. Method for Finding the Encryption Keys of Magniber v2

In general, ransomware employing hybrid encryption can maintain its malicious behavior provided that the the attacker’s private key is unknown. Although Magniber v2 uses hybrid encryption, we have found a technique that recover the F E K and I V of the file encryption without requiring the attacker’s RSA private key, resulting in the success of file decryption.

4.1. Magniber PRNG

The MPRNG derives the F E K and I V used in file encryption. The Magniber v2 RNG function is given in Algorithm 1. The inputs m and M determine the range of the output r. The global parameter f e e d b a c k retains the stored value until the end of the process. The RNG, which includes a Feedback Calculator (FC) and a filter, outputs a one-byte r between m and M. The FC receives (as inputs) the previous f e e d b a c k and the output of the GetTickCount function that returns the current t i c k used as a seed, and outputs a four-byte f e e d b a c k . The current t i c k returned by the GetTickCount function is the number of milliseconds that have elapsed since the system was started. The f e e d b a c k passes through the Filter and outputs 1-byte r between m and M. When the RNG is first called, the previous f e e d b a c k does not exist, so Steps 1 and 2 instead call the GetTickCount function, which provides the t i c k input. In Step 9, the f e e d b a c k uses only 20 bits due to masking with 0x11ee0fff. This vulnerability reduces the attack complexity of acquiring f e e d b a c k , which can accelerate the F E K recovery, from 2 32 to 2 20 . MPRNG is composed of concatenated RNGs as shown in Figure 3, and it is called repeatedly to output a random string composed of ‘0’ to ‘9’ and ‘a’ to ‘z’ characters. MPRNG inputs the desired length n and outputs an n-byte R. MPRNG generates a one-byte random character through two concatenated RNGs, and repeats this process n times to derive an n-byte random string. In the one-byte random character generation, the input parameters m and M of the first RNG are fixed at 0 and 1, respectively.
The output of the first RNG (0 or 1) determines the input of the second RNG: if the output is 0, the second RNG’s input is ‘a’ and ‘z’; otherwise, its input is ‘0’ and ‘9’. The second RNG then outputs a one-byte character between ‘a’ to ‘z’ or ‘0’ to ‘9’. Repeating this process n times generates an n-byte random string. The MPRNG algorithm is given in Algorithm 2.
Algorithm 1 RNG of Magniber v2
Function 
RNG ( m , M )
Input: 
Minimum m and maximum M values
Output: 
1-byte random character r between m and M
Global: 
f e e d b a c k
 // I n i t i a l i z a t i o n is performed only on the initial call.
1:
if Initialization then
2:
G ← GetTickCount()
3:
else
4:
G ←  f e e d b a c k
5:
end if
// subfunction Feedback Calculator
6:
f e e d b a c k     G 1
7:
t i c k  ← GetTickCount()
8:
f e e d b a c k     ( t i c k + f e e d b a c k + ( t i c k + f e e d b a c k )
9:
f e e d b a c k     ( f e e d b a c k   mod   0 x 3 e 8 ) & 0 x 11 ee 0 fff
// subfunction Filter
10:
r     m + f e e d b a c k   mod   ( M m   +   1 )
11:
returnr
Algorithm 2 PRNG of Magniber v2
Function 
MPRNG ( n )
Input: 
Desired random string length n
Output: 
n-byte random string R
1:
for  i 0  to n 1  do
2:
m 0, M 1
3:
if RNG ( m , M ) is zero then
4:
   m ‘a’, M ‘z’
5:
else
6:
   m ‘0’, M ‘9’
7:
end if
8:
R i RNG ( m , M )
9:
end for
10:
returnR
The MPRNG derives the victim’s ID, F E K and I V . To acquire the current t i c k used as a seed, it calls the GetTickCount function 2 n times and generates an n-byte random string. Therefore, when attempting to recover an n-byte random string, we must acquire the 2 n t i c k s in order of their generation, which is an apparently intractable task. However, we have observed that the number of t i c k changes is zero or very small. That is, an n-byte random string can be recovered after significantly fewer guesses than intended by the MPRNG developer. The security of MPRNG is guaranteed by the multiple t i c k s used as seeds and the four-byte f e e d b a c k that continuously affects the next RNG output. However, we found defects in two characteristics of MPRNG, which were exploited for F E K and I V recovery as described in Section 4.2.

4.2. Generating File Encryption Key Candidates

Although we reverse-engineered the entire encryption process of Magniber v2, we could not decrypt the infected file without acquiring the attacker’s RSA private key or F E K and I V of each file. As the RSA private key is owned only by the attacker, we focused on obtaining the F E K and I V of encryption infection.
The F E K candidates were generated by guessing their t i c k and f e e d b a c k values. First, we found the t i c k s for deriving the F E K . Figure 4 shows four cases of all possible patterns of t i c k changes when generating an n-byte random string. Note that the same number of t i c k s can be generated with different timings.
For example, in Figure 4a, an n-byte random string is generated with the same t i c k . However, if there is one t i c k change at the time-point of calling t i c k 2 of R[l] ( 0 < l < n 1 ) (where R[l] denotes the l th byte of R), that t i c k endures from t i c k 1 of R [ 0 ] to t i c k 1 of R [ l ] , and also from t i c k 2 of R [ l ] to t i c k 2 of R [ n 1 ] . Therefore, we must guess the values of the t i c k s not only from the number of t i c k changes, but also from the time-points of their changes. We next found the four-byte f e e d b a c k . The f e e d b a c k is the value by which the current call affects the next call in the MPRNG. Therefore, obtaining the f e e d b a c k injected into the first byte of F E K i ( 0 i < n ) is essential for a full F E K i recovery, where F E K i is the encryption key of File i . More specifically, we organized the relationship of the parameters inserted to the MPRNG in chronological order. After injection, MPRNG is first called for generating the victim’s ID. Thereafter, it is repeatedly called in the sequential derivation of F E K i and I V i for the encryption of each File i . As shown in Figure 5, the f e e d b a c k after the victim’s ID generation is injected into the F E K 0 derivation process, and the f e e d b a c k after the I V i 1 generation is injected into the F E K i ( i 1 ) derivation.
The f e e d b a c k injected into the F E K 0 [ 0 ] derivation is generated after deriving the last byte of the victim’s ID. Using the known victim’s ID included in the ransom note, which is known (see Figure 6), the f e e d b a c k s can be guessed by estimating the t i c k s alone.
As the MPRNG is initialized during the victim’s ID generation, we need only guess the t i c k s; a separate f e e d b a c k guess is not required. If we derive the correct victim’s ID, we automatically get the f e e d b a c k injected into the F E K 0 derivation. The F E K i is generated after File 1 is injected with the f e e d b a c k generated after the I V i 1 derivation of File i 1 . In our decryption process, finding the t i c k used to generate the victim’s ID is important for another reason: the GetTickCount function returns the time elapsed (in milliseconds) since the system is started. However, as the system startup times differ among the users, we require a reference point for the t i c k inference. Here, we set the t i c k used in creating the victim’s ID as the reference point.
Once established, the reference provides a starting point for sequentially guessing the t i c k s from the order of infection. If the t i c k changes during I V i 1 generation, the I V i 1 can be verified only when the first block of File i 1 is fixed and known (unlike the case of the victim’s ID). However, the first block of the file is rarely fixed. Even for files of known format, such as doc, hwp and pdf files, the first block is a variable header area of limited use in verification. Despite these limitations, the f e e d b a c k injected into the F E K i derivation can be acquired by brute-force attack of the 2 20 possibilities without recovering the I V i 1 , but merely by exploiting the vulnerability of MPRNG described in Section 4.1. In the first block that is not decrypted, file operation is possible only by filling an appropriate value in a corresponding part in a known file format. The F E K i 1 recovery naturally acquires the t i c k used for generating the F E K i 1 [ 15 ] . This t i c k is continuously injected into the I V i 1 generation, and based on whether it changes or not, we can know the f e e d b a c k injected with F E K i [ 0 ] . The acquisition of the f e e d b a c k greatly affects the efficiency of our decrypting performance. If the f e e d b a c k is obtained, the attack burden of 2 20 possibilities can be reduced. We therefore recover the F E K i assuming no t i c k change in the I V i 1 generation. If the recovery fails, we perform the brute-force attack based on 2 20 f e e d b a c k candidates. The recovery algorithm adopting this scheme is developed in the next section.
Algorithm 3 generates a list L of F E K i candidates with one t i c k change. The L is compiled according to the position and interval of the changed t i c k relative to the reference point (the b a s e ). An algorithm based on Algorithm 3 can also generate a list of F E K i candidates with more than one t i c k change.
In Algorithm 3, p o s represents the position of the t i c k change, and the time interval ranges from the starting point ( b a s e ) to the end point ( e n d t i c k ). Steps 4 and 5 generate F E K candidates within the time range. We introduce a t i c k change in the MPRNG by modifying the argument with two additional t i c k arguments, t i c k 1 and t i c k 2 for mPRNG(n, t i c k 1 , t i c k 2 ), which are input to the first and second RNG, respectively. The t i c k input to the mPRNG is divided into t i c k before the change and d u r a t i o n after the change. In Step 4, c a n d i d a t e F E K 1 is mPRNG( p o s 1 , t i c k , t i c k )‖ mPRNG(1, d u r a t i o n , d u r a t i o n )‖ mPRNG(16- p o s , d u r a t i o n , d u r a t i o n ), indicating a t i c k change to t i c k 1 of p o s position mPRNG. Similarly, in Step 5, a  t i c k change occurred at t i c k 2 of the p o s position mPRNG.
Algorithm 3 F E K i Candidates Generation Algorithm
Function 
DeriveFEKCandidates ( b a s e , Δ t )
Input: 
Reference point b a s e , Time interval Δ t
Output: 
List of FEK Candidates L
1:
for p o s     1 to 16 do
2:
for t i c k     b a s e to e n d t i c k     b a s e   +   Δ t do
3:
  for d u r a t i o n     t i c k to e n d t i c k do
4:
   // A t i c k change t i c k 1 occurs at p o s position mPRNG.
5:
    c a n d i d a t e F E K 1   mPRNG( p o s 1 , t i c k , t i c k ) mPRNG( 1 , d u r a t i o n , d u r a t i o n )
              mPRNG( 16 p o s , d u r a t i o n , d u r a t i o n )
6:
   // A t i c k change t i c k 2 occurs at p o s position mPRNG.
7:
    c a n d i d a t e F E K 2   mPRNG( p o s 1 , t i c k , t i c k ) mPRNG( 1 , t i c k , d u r a t i o n )
              mPRNG( 16 p o s , d u r a t i o n , d u r a t i o n )
   // Generate I V without changing t i c k
8:
    I V   mPRNG( 16 , d u r a t i o n , d u r a t i o n )
9:
   Include c a n d i d a t e F E K 1 I V and c a n d i d a t e F E K 2 I V in L
10:
  end for
11:
end for
12:
end for
13:
returnL

5. Recovery of Encryption Keys and Decryption of Files Encrypted by Magniber v2

5.1. Verifying the Generated File Encryption Key Candidates

Now, we are ready to recover the F E K i . The F E K i recovery process is performed in two steps: padding verification and statistical randomness tests to verify the correctness of the F E K i candidates. We considered the point that it is possible to decrypt all the encrypted blocks except the first block without the I V i as the error propagation property of the CBC mode of operation used for file encryption. That is, if the guessed F E K i candidate is correct, the padding verification accepts F i l e i , which is the decryption result by F E K i . However, in some cases, the padding verification yields a false positive for an incorrect F E K i candidate. To remove these false candidates, we checked whether F i l e i was correctly decrypted in statistical randomness tests. Although there tests reduce the false-positive rate of detecting F E K i candidates, they incur much higher computational cost than padding verification.
Padding verification of decrypted files: The padding, which matches the length of the plaintext before encryption to a multiple of the block length of the symmetric-key cipher, occupies the last block. The ciphertext is obtained by encrypting the padded plaintext. Conversely, the plaintext is obtained by decrypting the ciphertext and removing the padding. Before removing the padding from the decrypted ciphertext, the correctness of the padding must be verified. If the padding fails the verification test, then the decryption of the ciphertext is incorrect. This mechanism can identify the correct F E K i s among the F E K i candidates. We decrypt the data C i of F i l e i encrypted with F E K i , and then verify the padding in the last block of decrypted C i . In the padding verification, we decrypt only the last block (not the entire encrypted file) for efficiency. The padding value of PKCS7Padding used by Magniber v2 is determined by the padding length: for instance, a one-byte padding length is padded with 0x01, whereas a four-byte padding length is padded with 0x04040404. Therefore, we check the value from the last byte of the last block and verify the correctness of the padding with that value. Padding verification is relatively inexpensive because it performs a simple value-checking operation. However, we identified the occurrence of false-positive F E K i candidates in the padding verification. The false positive probability depends on the validated padding length. For example, if a padding value of 0x030303 passes the verification test, its probability of being a false positive is about 256 3 . More generally, the false-positive probability of a length-n padding is about 256 n . Clearly, the false-positive rate of the padding verification increases with decreasing padding length. Therefore, files that passed the padding verification were re-tested more rigorously to find the correct F E K i candidates.
Randomness tests for decrypted files: Our verification method acknowledges that plaintext can be recovered only by decrypting the infected file with the correct F E K i . In other words, we must distinguish whether an infected file decrypted with a F E K i candidate is plaintext or ciphertext (an infected file decrypted with an incorrect F E K i is also expressed as ciphertext). To distinguish between plaintext and ciphertext, we considered the randomness feature of ciphertext and apply the statistical randomness suite NIST SP800-22, which consists of 15 randomness tests. The randomness tests were performed on the data of 600 files (100 files in each of the following formats: video, audio, image, document, compressed and encrypted). The NIST recommends 25 runs of each test to ensure randomness. However, one run of each test is sufficient for our purposes. The statistical randomness results of our test set are listed in Table 2.
Based on the experimental results shown in Table 2, we selected four randomness tests (block frequency, runs, universal, cumulative sums) as suitable tests of F E K i recovery. In selecting these tests, we considered not only the distinction rate between plaintext and ciphertext, but also the test speed. The non-overlapping template, serial and approximate entropy tests gave excellent distinction rates between plaintext and ciphertext, but were slower than the other selected tests. Conversely, the frequency, longest run, random excursions and random excursions variants ran quickly but yielded low distinction rates.
We applied four selected tests to the F E K i , which passed the padding verification. Any F E K i candidate that passed the padding verification, but not passed randomness tests was concluded as the correct F E K i .

5.2. File Encryption Key Recovery

Algorithm 4 gives our F E K i recovery algorithm developed through Section 4.2 and Section 5.1. This algorithm inputs three arguments ( F i l e i , b a s e and Δ t ) and outputs the correct F E K i . Here, F i l e i is the i-th infected file to be decrypted. In the F E K i recovery process, the recovery order of F E K i is important because the previous value of the MPRNG affects the next value. The F E K i s are recovered in the order of their file infection in Magniber v2 based on DFS. The base value provides the reference point of each F E K i recovery. The initial b a s e in F E K 0 recovery is the t i c k used to generate the last byte of the victim’s ID. In subsequent recoveries, b a s e is the t i c k used to generate F E K i 1 [ 15 ] . Δ t represents the time-change range of the t i c k .
This value is arbitrary but must be appropriately set to balance its trade-off relationship with recovery time. Algorithm 4 is divided into two parts, depending on whether or not the t i c k changes during the I V i generation. Steps 1–10 are executed when the t i c k is unchanged in the I V i 1 derivation. Step 1 calls Algorithm 3, which generates the list L of F E K i candidates. Here, f e e d b a c k applies the value generated after deriving F E K i 1 [ 15 ] . Steps 3–9 are then executed on the F E K i candidates in L. First, Step 3 decrypts F i l e i with AES128-CBC using candidate F E K and I V , and obtains plaintext P. Step 4 performs the padding verification of P, and Step 5 performs the four randomness tests if P passes the padding verification; that is, if candidate F E K corresponding to P is concluded as the correct F E K i . If the F E K i recovery fails in Steps 1–9, the algorithm performs a 2 20 f e e d b a c k brute-force attack (Steps 11–24). Apart from the brute-force f e e d b a c k , this process operates similarly to the previous process. RNG, a subfunction of MPRNG, is masked with 0x11ee0fff, so the effective number of bits is reduced from 32 to 20. Steps 12 and 13 exploit this vulnerability in the f e e d b a c k reconstruction. After constructing the F E K i candidate list L based on the reconstructed f e e d b a c k , the process executes identically to the previous process.
Algorithm 4 F E K i Recovery Algorithm
Function 
recoveryFEK ( F i l e i , b a s e , Δ t )
Input: 
Encrypted file data F i l e i , Reference point b a s e , Time interval Δ t
Output: 
Correct F E K i
Global 
f e e d b a c k
 // Assume that the t i c k was not changed in the I V i 1 generation.
1:
L = DeriveFEKCandidates( b a s e , Δ t )
2:
for C a n d i d a t e F E K in L do
3:
P   AES128-CBC( F i l e i , c a n d i d a t a F E K , I V )
4:
if isPadding(P) is True then
5:
  if  B l o c k F r e q T e s t and R u n s T e s t and C u m S u m T e s t and U n i v e r s a l T e s t is not pass
  then
6:
    F E K i     c a n d i d a t a F E K
7:
   return F E K i
8:
  end if
9:
end if
10:
end for
// Assume that the t i c k was changed in the I V i 1 generation.
11:
for i     0 to  2 20 1  do
12:
f e e d b a c k     ( ( i & 0 x 80000 ) 9 ) ( ( i & 0 x 78000 ) 6 )
13:
f e e d b a c k f e e d b a c k ( ( i & 0 x 7000 ) 5 ) ( i & 0 xfff )
14:
L = DeriveFEKCandidates( b a s e , Δ t )
15:
for C a n d i d a t e F E K in L do
16:
   P AES128-CBC( F i l e i , c a n d i d a t a F E K , I V )
17:
  if isPadding(P) is True then
18:
   if B l o c k F r e q T e s t and R u n s T e s t and C u m S u m T e s t U n i v e r s a l T e s t is not pass then
19:
     F E K i c a n d i d a t a F E K
20:
    return F E K i
21:
   end if
22:
  end if
23:
end for
24:
end for
25:
return n u l l

5.3. Experimental Result

The key recovery speed was measured in the following system: 2 GB RAM, 2 processors and Windows 7 32-bit virtual environment. Within the virtual environment, common files were infected with Magniber v2, and the F E K s of the infected files were recovered by running Algorithm 4. During the experiment, the modification time interval of the encrypted files is not exceeded 50 ms. Therefore, we heuristically set Δ t to 50 ms.
Table 3 shows the experimental results. When the t i c k did not change during the I V i 1 and F E K i generation, each F E K i was recovered in 0.140 s at most. When the t i c k changed once and twice during the F E K i derivation but no t i c k change occurred during I V i 1 , the recovery times per F E K i were 2.465 s and 1.5 min at most, respectively.
Conversely, when the t i c k changed during the I V i 1 derivation but not during the F E K i derivation, the maximum recovery time of including the brute force attack of f e e d b a c k took 56 min, owing to the brute-force attack of f e e d b a c k . In this circumstance, we estimated a one- t i c k and two- t i c k change in the F E K i derivation increased the recovery time to 14 h and 41 h per F E K i , respectively.
Although a F E K with 2 128 attack complexity cannot be found by normal approaches, the above results show that our decryption method can recover a F E K within practical time. Moreover, our experiment was performed on limited-resource hardware. The F E K recovery speed would improve if the infected files were moved into an environment with higher computing power, or if Algorithm 4 was parallelized during a feedback brute-force attack. Finally, we successfully decrypted the files using the recovered F E K s, as shown in Figure 7.

6. Conclusions

We analyzed Magniber v2 from a cryptographic viewpoint and studied file decryption through F E K recovery. We exploited a vulnerability in the MPRNG of Magniber v2 to generate the F E K and I V . In addition, we proposed an encryption key verification method that checks the existence of padding and performs statistical randomness tests. We demonstrated that the proposed method can decrypt Magniber v2-infected file without the knowledge of the attacker’s private key.
Most of the latest ransomware use hybrid cryptographic algorithms. Files corrupted by these types of ransomware are commonly decrypted by acquiring the attacker’s private key, which is used to encrypt the encryption keys of the corrupted files. However, if the PRNG that generates the file encryption keys is vulnerable, they can be retrieved by reproducing the seed at the time of the infection. We succeeded in decrypting infected files by recovering the file encryption key for Magniber v2, but files infected by ransomware using PRNG containing the same vulnerability can be decrypted using the proposed method. To complement this study, we will conduct a study on a system that can automatically detect vulnerabilities of PRNGs used in ransomwares.

Author Contributions

Formal Analysis, S.L.; Methodology M.P.; Writing—original draft, S.L.; Writing—reveiew & editing, M.P.; Project administration, J.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Institute for Information & communications Technology Promotion(IITP) grant funded by the Korea government(MSIT) (No. 2017-0-00520, Development of SCR-Friendly Symmetric Key Cryptosystem and Its Application Modes.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Norsk Hydro Ransomware Incident Losses Reach $40 Million after One Week. Available online: https://www.zdnet.com/article/norsk-hydro-ransomware-incident-losses-reach-40-million-after-one-week/ (accessed on 17 December 2020).
  2. Georgia County Pays a Whopping $400,000 to Get Rid of a Ransomware Infection. Available online: https://www.zdnet.com/article/georgia-county-pays-a-whopping-400000-to-get-rid-of-a-ransomware-infection/ (accessed on 17 December 2020).
  3. BBC News, ISS World Hack Leaves Thousands of Employees Offline. Available online: https://www.bbc.com/news/technology-51572575 (accessed on 17 December 2020).
  4. Maginber, The worst Ransomware in First Quarter. Available online: https://www.ahnlab.com/kr/site/securityinfo/secunews/secuNewsView.do?menu_dist=2&seq=27370 (accessed on 17 December 2020).
  5. Magniber Ransomware: Exclusively for South Koreans. Available online: https://blog.malwarebytes.com/threat-analysis/2017/10/magniber-ransomware-exclusively-for-south-koreans/ (accessed on 17 December 2020).
  6. Magniber Decryptor Release. Available online: https://www.ahnlab.com/kr/site/securityinfo/secunews/secuNewsView.do?seq=27312 (accessed on 17 December 2020).
  7. Rukhin, A.; Soto, J.; Nechvatal, J.; Smid, M.; Barker, E.; Leigh, S.; Levenson, M.; Vangel, M.; Banks, D.; Heckert, A.; et al. A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications; SP 800-22; NIST: Gaithersburg, MD, USA, 2010.
  8. Kanwal, M.; Thakur, S. An app based on static analysis for android ransomware. In Proceedings of the 2017 International Conference on Computing, Communication and Automation (ICCCA), Greater Noida, India, 5–6 May 2017; pp. 813–818. [Google Scholar]
  9. Andronio, N.; Zanero, S.; Maggi, F. Heldroid: Dissecting and detecting mobile ransomware. In International Symposium on Recent Advances in Intrusion Detection; Springer: Berlin, Germany, 2015; pp. 382–404. [Google Scholar]
  10. Moser, A.; Kruegel, C.; Kirda, E. Limits of static analysis for malware detection. In Proceedings of the Twenty-Third Annual Computer Security Applications Conference (ACSAC 2007), Miami Beach, FL, USA, 10–14 December 2007; pp. 421–430. [Google Scholar]
  11. Continella, A.; Guagnelli, A.; Zingaro, G.; De Pasquale, G.; Barenghi, A.; Zanero, S.; Maggi, F. ShieldFS: A self-healing, ransomwareaware filesystem. In Proceedings of the 32nd Annual Conference on Computer Security Applications, Los Angeles, CA, USA, 5–9 December 2016; pp. 336–347. [Google Scholar]
  12. Mehnaz, S.; Mudgerikar, A.; Bertino, E. Rwguard: A real-time detection system against cryptographic ransomware. In International Symposium on Research in Attacks, Intrusions, and Defenses; Springer: Berlin, Germany, 2018; pp. 114–136. [Google Scholar]
  13. Jung, S.; Won, Y. Ransomware detection method based on context-aware entropy analysis. Soft Comput. 2018, 22, 6731–6740. [Google Scholar] [CrossRef]
  14. Hampton, N.; Baig, Z.; Zeadally, S. Ransomware behavioural analysis on windows platforms. J. Inf. Secur. Appl. 2018, 40, 44–51. [Google Scholar] [CrossRef] [Green Version]
  15. Kharaz, A.; Arshad, S.; Mulliner, C.; Robertson, W.; Kirda, E. {UNVEIL}: A large-scale, automated approach to detecting ransomware. In Proceedings of the 25th {USENIX} Security Symposium ({USENIX} Security 16), Austin, TX, USA, 10–12 August 2016; pp. 757–772. [Google Scholar]
  16. Hasan, M.M.; Rahman, M.M. RansHunt: A support vector machines based ransomware analysis framework with integrated feature set. In Proceedings of the 2017 20th International Conference of Computer and Information Technology (ICCIT), Dhaka, Bangladesh, 22–24 December 2017; pp. 1–7. [Google Scholar]
  17. Lee, K.; Lee, S.Y.; Yim, K. Machine learning based file entropy analysis for ransomware detection in backup systems. IEEE Access 2019, 7, 110205–110215. [Google Scholar] [CrossRef]
  18. Almashhadani, A.O.; Kaiiali, M.; Sezer, S.; O’Kane, P. A multi-classifier network-based crypto ransomware detection system: A case study of Locky ransomware. IEEE Access 2019, 7, 47053–47067. [Google Scholar] [CrossRef]
  19. Kolodenker, E.; Koch, W.; Stringhini, G.; Egele, M. Paybreak: Defense against cryptographic ransomware. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, Abu Dhabi, UAE, 2–6 April 2017; pp. 599–611. [Google Scholar]
  20. Kim, H.; Yoo, D.; Kang, J.S.; Yeom, Y. Dynamic ransomware protection using deterministic random bit generator. In Proceedings of the 2017 IEEE Conference on Application, Information and Network Security (AINS), Miri, Malaysia, 13–14 November 2017; pp. 64–68. [Google Scholar]
  21. García, H.M.; Us, L.C. Hidden Tear: Análisis del primer Ransomware Open Source. Av. Perspect. Innov. Investig. Vincul. Mérida Yucatán M. 2015, 1, 31–54. [Google Scholar]
  22. Destroying The Encryption of Hidden Tear Ransomware. Available online: https://utkusen.com/blog/destroying-the-encryption-of-hidden-tear-ransomware.html (accessed on 17 December 2020).
  23. Lee, S.; Kim, S.; Kim, G.; Kim, D.; Park, Y.; Kim, J. A Study on the Decryption of Donut Ransomware through Memory Analysis. J. Digit. Forensics 2019, 13, 13–22. [Google Scholar]
  24. Lee, S.; Youn, B.; Kim, S.; Kim, G.; Lee, Y.; Kim, D.; Park, H.; Kim, J. A Study on Encryption Process and Decryption of Ransomware in 2019. J. Korea Inst. Inf. Secur. Cryptol. 2019, 29, 1339–1350. [Google Scholar]
  25. Cyber Attack Hits 200,000 in at Least 150 Countries: Europol. Available online: https://www.reuters.com/article/us-cyber-attack-europol/cyber-attack-hits-200000-in-at-least-150-countries-europol-idUSKCN18A0FX (accessed on 17 December 2020).
  26. Akbanov, M.; Vassilakis, V.G.; Logothetis, M.D. WannaCry ransomware: Analysis of infection, persistence, recovery prevention and propagation mechanisms. J. Telecommun. Inf. Technol. 2019. [Google Scholar] [CrossRef]
  27. Github, Wanakiwi. Available online: https://github.com/gentilkiwi/wanakiwi (accessed on 17 December 2020).
  28. Boczan, T. The Evolution of GandCrab Ransomware. Available online: https://www.youtube.com/watch?v=b57VV9BC6tE&t=1863s (accessed on 17 December 2020).
  29. Bitdefender, Europol, Romanian Police, DIICOT team up for GandCrab Decryption Tool. Available online: https://labs.bitdefender.com/2018/02/bitdefender-europol-romanian-police-diicot-team-up-for-gandcrab-removal-tool/ (accessed on 17 December 2020).
  30. Bleeping Computer, FBI Releases Master Decryption Keys for GandCrab Ransomware. Available online: https://www.bleepingcomputer.com/news/security/fbi-releases-master-decryption-keys-for-gandcrab-ransomware/ (accessed on 17 December 2020).
  31. No More Ransom Project. Available online: https://www.nomoreransom.org (accessed on 17 December 2020).
  32. Hybrid Analysis. Available online: https://www.hybrid-analysis.com (accessed on 17 December 2020).
Figure 1. Entire process of malicious behavior by Magniber v2.
Figure 1. Entire process of malicious behavior by Magniber v2.
Electronics 10 00016 g001
Figure 2. Encryption process of Magniber v2.
Figure 2. Encryption process of Magniber v2.
Electronics 10 00016 g002
Figure 3. Structure of Magniber’s Pseudo Random Number Generator (PRNG), Magniber PRNG (MPRNG).
Figure 3. Structure of Magniber’s Pseudo Random Number Generator (PRNG), Magniber PRNG (MPRNG).
Electronics 10 00016 g003
Figure 4. Tick changes during generation of an n-byte random string: (a) no tick changed, (b) one-tick changed, (c) two-tick changed and (d) three-tick changed
Figure 4. Tick changes during generation of an n-byte random string: (a) no tick changed, (b) one-tick changed, (c) two-tick changed and (d) three-tick changed
Electronics 10 00016 g004
Figure 5. Entire process of MPRNG during infection.
Figure 5. Entire process of MPRNG during infection.
Electronics 10 00016 g005
Figure 6. Ransom note of Magniber v2 (the victim’s ID is enclosed in the red-edged box).
Figure 6. Ransom note of Magniber v2 (the victim’s ID is enclosed in the red-edged box).
Electronics 10 00016 g006
Figure 7. (a) Encrypted files (b) Decrypted files after applying our proposed method.
Figure 7. (a) Encrypted files (b) Decrypted files after applying our proposed method.
Electronics 10 00016 g007aElectronics 10 00016 g007b
Table 1. Comparison of Magniber version 1 and 2.
Table 1. Comparison of Magniber version 1 and 2.
RansomwareMagniber v1Magniber v2
Crypto systemAES128-CBC-PKCS7PaddingAES128-CBC-PKCS7Padding
RSA2048-OAEP
Key generation1. Receive from C&C server
2. Fixed in code
Attacker’s PRNG
Key managementNoneEncrypted AES key with RSA
stored in end of file
Key destructionYesYes
Decryption toolYesNo
Known extensionskympzmzw, owxpzylj, prueitfik, rwighmoz,
bnxzoucsx, tzdbkjry, iuoqetgb, pgvuuryti,
zpnjelt, gnhnzhu, hssjfbd, ldolfoxwu,
zskgavp, gwinpyizt, hxzrvhh, cmjedin,
dzvtwtqz, pxynindl, sqzprtt, etc.
fprgbk, ihsdj, kgpvwnr, vbdrj,
skvtb, vpgvlkb, dlenggrl, dxjay,
fbuvkngy, xhspythxn, demffue, mftzmxqo,
qmdjtc, wmfxdqz, ndpyhss, dyaaghemy, etc.
Table 2. Results of statistical randomness tests on our test set.
Table 2. Results of statistical randomness tests on our test set.
Test List (ms/Test *)VideoImageAudioDocumentCompressedEncryptedFalse Positive Rate
Frequency (4)2811551005.17%
Block frequency (2)00003980.83%
Runs (4)01115971.83%
Longest run (5)3304103110013%
Rank (47)875033559925.67%
FFT (188)423212419815.5%
Non overlapping template (1167)000141000.83%
Overlapping template (35)288412410010.83%
Universal (30)00008962%
Approximate entropy (124)000041000.67%
Serial (343)00008971.83%
Linear complexity (1890)171047235610025.5%
Cumulative sums (5)100141001%
Random excursions (4)00002656.17%
Random excursions variants (4)00102626.83%
These tests are the results for p-value = 0.01. * Time per test in milliseconds.
Table 3. Experimental results of file encryption key ( F E K ) recovery.
Table 3. Experimental results of file encryption key ( F E K ) recovery.
Number of Tick
Changes during FEKi
No Tick Changes during
Generation of IVi−1
Tick Changes during
Generation of IVi−1
00.140 s56 min.
12.465 s17 hrs.
21.5 min.29 day.
In these results, t was 50 ms.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Lee, S.; Park, M.; Kim, J. Magniber v2 Ransomware Decryption: Exploiting the Vulnerability of a Self-Developed Pseudo Random Number Generator. Electronics 2021, 10, 16. https://doi.org/10.3390/electronics10010016

AMA Style

Lee S, Park M, Kim J. Magniber v2 Ransomware Decryption: Exploiting the Vulnerability of a Self-Developed Pseudo Random Number Generator. Electronics. 2021; 10(1):16. https://doi.org/10.3390/electronics10010016

Chicago/Turabian Style

Lee, Sehoon, Myungseo Park, and Jongsung Kim. 2021. "Magniber v2 Ransomware Decryption: Exploiting the Vulnerability of a Self-Developed Pseudo Random Number Generator" Electronics 10, no. 1: 16. https://doi.org/10.3390/electronics10010016

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop