News for hackers. Stuff that matters.
Re:WannaCry in-memory key recovery for Windows XP by TazeTSchnitzel on Friday May 19, 2017 @01:20PM (#14377667)
It's hilarious that it uses public-key crypto, yet lets the client know the private key. What's even the point, then?
Re:WannaCry in-memory key recovery for Windows XP by ahomescu1 on Friday May 19, 2017 @03:51PM (#14378848)
I don't know the exact details of how WannaCry encrypts the files, but ransomware generally works like this: when hitting a new machine, it generates a random key K1 and then encrypts all the user's files with AES (or some other symmetric key encryption) using K1 as the key. It then encrypts K1 itself using some public key Kpub embedded in the ransomware, then stores the encrypted K1 on disk. When the user pays the ransom, they receive the corresponding private key Kpriv that allows them to decrypt K1, which then lets them decrypt all their files.

I think what this tool does is read the unencrypted K1 directly from memory, which means Kpriv is no longer needed.

EDIT: One correction: the user doesn't receive Kpriv, instead they send the encrypted K1 to the ransomware owner who decrypts it and sends back K1.

Re:WannaCry in-memory key recovery for Windows XP by CiPHPerCoder on Friday May 19, 2017 @04:25PM (#14379052)
There are 4+N keys involved.

  - The attacker's RSA private key (UNKNOWN)
  - The attacker's RSA public key (KNOWN)
  - The local device's RSA private key (KNOWN, but then poorly wiped)
    - This is encrypted with the attacker's RSA public key
  - The local device's RSA public key (KNOWN)
  - A separate AES key for each file
    - These are encrypted with the local device's RSA public key
How decryption should work: Get the local device's RSA private key from the attacker (EDIT: this is not the attacker's RSA private key, it's the local one), then you can decrypt the AES key for each file.
Re:WannaCry in-memory key recovery for Windows XP by uep on Friday May 19, 2017 @04:33PM (#14379107)
If someone were to pay up and receive the attacker's private key, what's to stop them from distributing it to others?
Re:WannaCry in-memory key recovery for Windows XP by equivrel on Friday May 19, 2017 @04:38PM (#14379148)
That's exactly the trick: the attacker doesn't send you their private key, they decrypt (using their private key) the other private key that the ransomware generated on your machine, which is what was used to encrypt the per-file AES keys.
Re:WannaCry in-memory key recovery for Windows XP by chinhodado on Friday May 19, 2017 @08:55PM (#14380415)
To clarify, the files are encrypted with a symmetric key, which even though is "private", is not part of a public-private key pair in asymmetric crypto.
Re:WannaCry in-memory key recovery for Windows XP by knome on Friday May 19, 2017 @04:40PM (#14379163)
The attacker probably just decrypts your locally generated key. I doubt they send along the master key.
Re:WannaCry in-memory key recovery for Windows XP by equivrel on Friday May 19, 2017 @04:32PM (#14379101)
This doesn't appear to be how WannaCry works: as ridiculous as it sounds, it looks like WannaCry actually generates a private key on the infected machine. If you look in search_primes.cpp (from line 251) in the linked repo, you'll see that the tool is literally searching the memory for prime numbers that divide the public modulus.

EDIT: CiPHPerCoder appears to have figured how the key management works.

Re:WannaCry in-memory key recovery for Windows XP by ahomescu1 on Friday May 19, 2017 @06:21PM (#14379768)
Right, I see that now. Adding an additional layer of RSA and per-file keys is an interesting twist. Generating a public/private key pair instead of a symmetric key seems to let them encrypt as many files as they want without keeping the private key in memory (which they relied on Windows to erase).
Re:WannaCry in-memory key recovery for Windows XP by soared on Friday May 19, 2017 @02:19PM (#14378136)
I mean a technical user capable of this solution is not very likely to get hit by this in the first place. The hacker probably doesn't care if x% of people defeat the encryption.. as long as x% pay the ransom.
Re:WannaCry in-memory key recovery for Windows XP by kybernetikos on Friday May 19, 2017 @04:23PM (#14379035)
Given the infrastructure and health victims that have been hit, I certainly hope that some serious people are looking into this. Given the relatively small sums of money we've seen flowing into the bitcoin addresses, if I were the perpetrator, I would not think I'd got a particularly good deal - exchanging 40k or so for interest from a number of heavy hitting actors just doesn't seem worth it.
Re:WannaCry in-memory key recovery for Windows XP by jamiek88 on Friday May 19, 2017 @06:45PM (#14379899)
It probably does to a pair of 16 year olds in eastern Europe.

The problem with these tools being made and leaked is it lowers the bar of technical expertise needed to run a scheme like this.

If it still took massive knowledge and experience the likelihood is that person could earn more legitimately thus there is a smaller pool of potential attackers.

Re:WannaCry in-memory key recovery for Windows XP by closeparen on Friday May 19, 2017 @10:22PM (#14380723)
If the infrastructure and health victims can be compromised by generic Windows hardware not even targeting them in particular & can't recover from backups, I'd argue they aren't heavy hitters. Though maybe they'll bring some in now.
Re:WannaCry in-memory key recovery for Windows XP by kccqzy on Friday May 19, 2017 @03:19PM (#14378617)
Exactly. I would've thought the malware would ask a C&C server to generate a key pair and then only send the public key to the malware. But I guess perhaps that required too much processing power for the server. But then again this can also distributed: let a random victim generate an RSA keypair for another victim.
Re:WannaCry in-memory key recovery for Windows XP by kaoD on Friday May 19, 2017 @05:31PM (#14379501)
This allows computers cut off from the internet to be infected too. Juicy and the risk is minimal.
Re:WannaCry in-memory key recovery for Windows XP by paulddraper on Sunday May 21, 2017 @12:04PM (#14387851)
Bitcoin payment requires internet.
Re:WannaCry in-memory key recovery for Windows XP by brokenmachine on Sunday May 21, 2017 @11:23PM (#14390800)
You don't need bitcoin payment to be infected.
Re:WannaCry in-memory key recovery for Windows XP by kybernetikos on Friday May 19, 2017 @04:20PM (#14379013)
If those network requests could be identified, the whole thing would be shut down by network operators.
Re:WannaCry in-memory key recovery for Windows XP by derefr on Friday May 19, 2017 @05:21PM (#14379446)
Instances of the worm could notice they've landed on especially-low-activity systems with open ports, and then modify their own "descendants" to contact them on that host for key-generation. (And then relay the key material to the origin host, before wiping their local copy.)

If the worm then notices that their host "goes active" (e.g. starts a login session), they could "submerge", closing the relevant ports and so forth, until the activity goes away; and their descendant instances would, while this is happening, fall back to the ancestor[N+1]th host.

Re:WannaCry in-memory key recovery for Windows XP by gregmac on Friday May 19, 2017 @01:51PM (#14377921)
In the case of ransomware, it just has to work most of the time.

If the WannaCrypt author(s) want to (partly) address this particular tool, they could, for example, just make it reboot on XP after encrypting everything.