Using Heartbleed PoC for Hijacking User Sessions En Masse
michael-p-davis.com
michael-p-davis.com
Many people have a vague understanding of how bad it is to lose a private key that is used to sign SSL traffic, but showing that one is able to hijack sessions en masse makes this vulnerability much easier to wrap our heads around.
Don't be idiots out there.
So if you want to maximize the data extracted with each connection, you should send FF FF for length, instead of 0x0302 bytes as its requesting now (if n2s is for network byte order to short).
0x18 TLS content type: heartbeat [*]
0x03 0x02 protocol version: TLS 1.1 [RFC 4346, section A.1]
0x01 message type: heartbeat request [RFC 6520, section 3]
0x40 0x00 payload length: 16384 bytes [RFC 6520, section 4]
This should be followed by a payload of that length, but if it isn't (as in the PoC) the vulnerable versions of OpenSSL will then carve it out of the heap to form the response packet - this is what leads to the data leakage.[*] see https://www.iana.org/assignments/tls-parameters/tls-paramete...
0x18 TLS content type: heartbeat [*]
0x03 0x02 protocol version: TLS 1.1 [RFC 4346, section A.1]
0x00 0x03 content length: 3 bytes [RFC 4346, section A.1]
0x01 message type: heartbeat request [RFC 6520, section 3]
0x40 0x00 payload length: 16384 bytes [RFC 6520, section 4]It's possible this has been tuned to avoid some interference regarding that sort of thing.
I wouldn't convict you, but if someone used this tool in a breach that was embarrassing enough to the right person, I don't think a prosecutor would have a very hard time convincing a judge that you were an evil hacker writing evil hacker tools.
I am not an exceptionally gifted programmer. This is a trivial change to the original PoC to point out an additional attack vector. Pointing out that there is more to this attack than leaked private keys is very important.
The title of your post is "Using Heartbleed PoC for Hijacking User Sessions En Masse". Not "Your users' sessions are at risk", or "Heartbleed affects more than private keys". The express intent of the published code is the theft of user sessions. I know that you probably don't have any intent to do Bad Things with it, but if I was a prosecutor looking for someone to slap around with the CFAA, you just threw up a giant neon "SUP BITCHES" sign.
The folks you mentioned all produce tools which are intended and marketed for use by white-hat security professionals in the pre-emptive exploitation of their own networks for the purposes of security. Yes, we all know that the Bad Guys use Metasploit extensively to find and exploit machines, but if Rapid7 were positioning their tool as the premiere solution for pwnz3ring b0x3n, you don't think they'd be in a legally different situation?
I never said you were wrong. In fact, my exact words were "I wouldn't convict you" - I really do get why you published this, and I don't think you're some bad guy cackling to yourself from deep within your evil lair or anything. However, we know from recent history that things less gray have (unjustly, IMO) in fact landed people in prison. It's not illegal to own a crowbar or lockpicking set, but it's illegal to own one with the intent to commit burglary. Intent matters, and they way you positioned your PoC is problematic in that its stated intent is "mass hijacking", rather than "demonstration of an additional security problem". I am not trying to say that there's anything wrong with the code you've published - there isn't - but that the way you've presented it is potentially problematic if it were to attract the wrong kind of attention. That's all.
(but of course courts have sent people to jail for much less...)
At any rate, it certainly doesn't seem correct to say "it isn't illegal" as a blanket statement.
I would agree that collecting session ids on systems that you do not own or have legitimate access to is almost certainly illegal.
I respect the author for wanting to be a part of the community contributing code related to this event but some self-preservation might be in order...