musalbas/heartbleed-masstest — pull request #26 by palli (2014-04-13 11:45:14+00:00)
Title: Threading patch

This is a very big patch, because my project diverged quite a bit from yours and originally i was not planning on pushing any code back.

Summary of features:
* Network names and addresses can now be specified from the command line
* Use --json heartbleed.json for a persistable database of scanresults
* Use --input to describe an input file
* --timeout command line option
* --threads command line option
* --only-vulnerable command line option
* --only-unscanned command line option
* --summary command line option to print output from --json

General usage for the new ssltest.py is now as such:

```
python ssltest.py 127.0.0.1 127.0.0.2 10.0.0.0/25
```

This is how i use it for my project:
```
# In cron every 10 minutes, rescan hosts that have been found to be vulnerable
python ssltest.py --json heartbleed.json --only-vulnerable

# In cron every 5 minutes, rescan hosts that have been manually added to the json file
# but not scanned yet
python ssltest.py --json heartbleed.json --only-unscanned

# In cron once every hour, rescan all hosts
python ssltest.py --json heartbleed.json

# Read old results like this
python ssltest.py --json heartbleed.json --summary
```

This is the help screen
```
$ python ssltest.py --help
Usage: ssltest.py [network2] [network3] ...

Test for SSL heartbleed vulnerability (CVE-2014-0160) on multiple domains

Options:
-h, --help show this help message and exit
-i INPUT_FILE, --input=INPUT_FILE
Optional input file of networks or ip addresses, one
address per line
-o LOG_FILE, --logfile=LOG_FILE
Optional logfile destination
--resume Do not rescan hosts that are already in the logfile
-t TIMEOUT, --timeout=TIMEOUT
How long to wait for remote host to respond before
timing out
--threads=THREADS If specific, run X concurrent threads
--json=JSON_FILE Save data as json into this file
--only-vulnerable Only scan hosts that have been scanned before and were
vulnerable
--only-unscanned Only scan hosts that appear in the json file but have
not been scanned
--summary Useful with --json. Don't scan, just print old results
--verbose Print verbose information to screen
--max=MAX Exit program after scanning X hosts. Usefull with
--only-unscanned
```