TKCERT / testssl.sh-masscan

Make TLS/SSL security mass scans with testssl.sh and import results into ElasticSearch
GNU General Public License v3.0
108 stars 25 forks source link

Import fails when csv files have no results #1

Closed fishouttah20 closed 8 years ago

fishouttah20 commented 8 years ago

It looks like when any of the sites being scanned are unavailable, decommissioned, etc this results in a csv file being created with nothing but headers in them

"id","fqdn/ip","port","severity","finding"

Because of this the import job fails as below

Undecodable raw error response from server: Expecting value: line 1 column 1 (char 0)
PUT /testssl-scan [status:400 request:0.018s]
Processing './sept/site.com_443-20161013-1633.csv'
Traceback (most recent call last):
  File "import_testssl.sh_csv_to_ES.py", line 36, in <module>
    doc.save()
  File "/Users/evan/ssl/testssl.sh-masscan/docTestssl.py", line 174, in save
    self.svcid = "%s:%d" % (self.ip, int(self.port) or 0)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Ideally, the import job would handle this cleanly as the status of a large set of sites is constantly changing and cleaning out all the empty csv's manually is painful.

Thanks for publishing these scripts and the instructions. This looks like it will massively help in our remediation efforts!

thomaspatzke commented 8 years ago

Thanks for the bug report! I've fixed it in commit 88fd14a.

fishouttah20 commented 8 years ago

Works like a charm. Thanks!