A few week ago there was a ransomware called Petya delivered via Dropbox links. The new ransomware is inserted into the master boot record (MBR) of the victim's computer, and the system restarts. On reboot, the hard disk will be encrypted. The solution is described here :

Computer experts from the popular tech support forum BleepingComputer.com confirmed that the technique works, but it requires extracting some data from an affected hard drive: 512 bytes starting at sector 55 (0x37h) with an offset of 0 and an 8-byte nonce from sector 54 (0x36) offset 33 (0x21).

How does the Master File Table encryption/decryption work (For non-expert users)?


This article at malwarebytes is very informative.

The ransomware uses a small kernel with a built in crypto engine, and when it pretends to run chkdsk it actually encrypts the MFT using a key generated for that machine and sent to the attacker.

The same engine will run the decrypt based on a key given when you pay the attacker.

As the MFT is the reference for every block of every file, without it you can still see all the data if you analyse the drive, but you don't know how it fits together, what block is part of what file etc.

The Salsa20 algorithm works like this:

uint8_t *key = 128_bit_key_generation();
uint8_t *nonce = unique_message_number();
unsigned len = 500;
uint8_t buf[len];

// Position (in bytes) in the stream
uint32_t sindex = 0;

for (sindex = 0; sindex < 5000; sindex += len) {
    // recv 'len' bytes into 'buf'
    s20_crypt(key, S20_KEYLEN_128, nonce, sindex, buf, len);
    // copy 'len' bytes from 'buf' elsewhere

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.