Heartbleed Detector

Updated -

OpenSSL CVE-2014-0160 (Heartbleed) Detector

This application lets you test whether a given host:port is susceptible to exploitation by CVE-2014-0160 (aka Heartbleed) OpenSSL security vulnerability.

This tool is intended as a supplement to the Red Hat provided remediation and diagnostics steps provided in:

  • Red Hat Enterprise Linux: https://access.redhat.com/site/solutions/781793
  • Red Hat Enterprise Virtualization: https://access.redhat.com/site/solutions/781843
  • Red Hat Storage: https://access.redhat.com/site/solutions/782053

If you are interested in scanning internal systems you can download the offline Heartbleed scanning tool. The offline tool is not supported and is provided for informational purposes only. For more information about the offline tool see the GitHub page.

To verify that your download is correct please use the following sha256 checksum:

$ sha256sum heartbleed-poc.py 
c7ce931feb5d3ad7fc2afca005572d0c6dc2283592df7b5c13498be3f635f437  heartbleed-poc.py

Please only use this to scan servers you have permission to. All scans are logged.

Was this helpful?

We appreciate your feedback. Leave a comment if you would like to provide more detail.
It looks like we have some work to do. Leave a comment to let us know how we could improve.
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.

Get notified when this content is updated

Follow

1 Comments

Subscriber exclusive content

An active Red Hat subscription is required to participate.

Log In

This will only work for servers on the external internet.

This doesnt work -I tried a few different hosts. Please correct it.

I know the offline script is unsupported, but I get this - any quick ideas?

File "heartbleed-detect.py", line 67
pdat = ''.join((c if 32 <= ord(c) <= 126 else '.' )for c in lin)

I am updating the script to support Python 2.4 now. The change should land in minutes.
To ensure that you have the newest script you can use the SHA checksum mentioned above.

Thank you - it runs now - only issue is non-graceful failure if connection is refused (ie: no port 443 listening)

Can just "tail -1" the output for a quick hack, though

./heartbleed-detect.py -q servername

Scanning servername on port 443
Traceback (most recent call last):
File "./heartbleed-detect.py", line 236, in ?
main()
File "./heartbleed-detect.py", line 233, in main
check(args[0], opts.port, opts.file, opts.quiet, opts.starttls)
File "./heartbleed-detect.py", line 199, in check
s = connect(host, port, quiet)
File "./heartbleed-detect.py", line 137, in connect
s.connect((host, port))
File "", line 1, in connect
socket.error: (111, 'Connection refused')

Cool. Glad it works.

Works for me now, too, Ian. Thank you.

[root@xxxxx]# ./heartbleed-detector-2.sh -q xxx.xxx.net
Scanning xxx.xxx.net on port 443
... received message: type = 22, ver = 0301, length = 81
... received message: type = 22, ver = 0301, length = 1540
... received message: type = 22, ver = 0301, length = 525
... received message: type = 22, ver = 0301, length = 4
No heartbeat response received from xxx.xxx.net, server likely not vulnerable
[root@xxxxx nios]#

Same as R Fries, which is python 2.4 as installed with RHEL, so what do we do?... REDHAT?

Same as R Fries and P Samson..

hcmers1

not working with -p option.

[foo@server REACHABLE]$ ./heartbleed-poc.py server.example.com -p 22
Scanning server.example.com on port 22
Connecting...
Sending Client Hello...
Waiting for Server Hello...
Traceback (most recent call last):
File "./heartbleed-poc.py", line 236, in
main()
File "./heartbleed-poc.py", line 233, in main
check(args[0], opts.port, opts.file, opts.quiet, opts.starttls)
File "./heartbleed-poc.py", line 202, in check
version = parseresp(s, quiet)
File "./heartbleed-poc.py", line 149, in parseresp
typ, ver, pay = recvmsg(s)
File "./heartbleed-poc.py", line 102, in recvmsg
pay = recvall(s, ln, 10)
File "./heartbleed-poc.py", line 89, in recvall
data = s.recv(remain)
socket.error: [Errno 104] Connection reset by peer

#

sha256sum heartbleed-poc.py
ec72b8342355cd0480c0e6c90b9381e62e936733e0f7bd25382248b4b6e5a727 heartbleed-poc.py

socket.error: [Errno 104] Connection reset by peer

I think that is expected behavior. Are you running some TLS service on port 22?
It looks like you are testing an SSH server not some SSL/TLS backed server.

Yes, it's not SSL/TLS backend, checking on port 22. Any alternative method to check servers which are not listening on port 443? Without logging on each server manually.

No.

In case you're unaware, SSH was not affected by the Heartbleed vulnerability. If your server isn't offering any services over TLS, then there's not anything you can do with this tool.

Hi, Is there other tool that we can use to check the server's vulnerability if we are not using services over TLS?

I suggest you check out the following solution in our knowledgebase:

OpenSSL CVE-2014-0160 Heartbleed bug and Red Hat Enterprise Linux

In short, if the rpm -q openssl command on a RHEL 6 system returns anything from openssl-1.0.1e-15 through openssl-1.0.1e-16.el6_5.4, then it would be recommended to update openssl. However, you might not have anything on the system actually using openssl. See step 2 in the above solution for commands to determine that on your own.

Thanks Ryan Sawhill.

it doesnt work:

./CVE-2014-0160-checker.py localhost -p 9443

Scanning localhost on port 9443 Connecting... Sending Client Hello... Waiting for Server Hello... ... received message: type = 22, ver = 0302, length = 66 Message Type is 0x02 ... received message: type = 22, ver = 0302, length = 6182 Message Type is 0x0B ... received message: type = 22, ver = 0302, length = 331 Message Type is 0x0C ... received message: type = 22, ver = 0302, length = 16384 Message Type is 0x0D ... received message: type = 22, ver = 0302, length = 561 Message Type is 0x73 Server closed connection without sending Server Hello Done. Got an error while parsing the response, bailing ...