Python script to check for heartbleed mentioned HERE

If you had a hyphenated list of hosts and ports like 192.168.1.1-443 in a file called targetlist.txt you could do something like this and spit out a list of vulnerable hosts including some SSL certificate info.

Combine the python script with some bash:

#!/bin/bash

while read target; do
host=`echo $target|cut -d “-” -f 1`
port=`echo $target|cut -d “-” -f 2`
result=`python fox_heartbleedtest.py $host -p $port|grep -v NOT`
if [ -n “$result”  ]
then
#optional, get some info about the cert
sslcert=`nmap -A -p $port $host|grep -i “ssl-cert”`
echo $result ‘|’ $port $sslcert
result=”
done < targetlist.txt

Python script download

Alternate Link