Skip to content

Commit 895c5ba

Browse files
author
Rory McCune
committed
Fixed over-write when same host is scanned on multiple ports
1 parent 6229706 commit 895c5ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

testsslautoanalyzer.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def parse_files
146146
#Parse the testssl.sh format file and populate the hashes for the report
147147
#Remember one file only ever contains one host
148148
def parse_file(doc)
149-
address = doc[0]['ip']
149+
address = doc[0]['ip'] + ':' + doc[0]['port']
150150
@host_results[address] = Hash.new
151151

152152

@@ -393,7 +393,7 @@ def excel_report
393393
row_count = 1
394394
@host_results.each do |host, vulns|
395395
host_name = host.split(':')[0]
396-
cert_sheet.add_cell(row_count,0,host.split('/')[1])
396+
cert_sheet.add_cell(row_count,0,host.split('/')[1].split(':')[0])
397397
cert_sheet.add_cell(row_count,1,host.split('/')[0])
398398
cert_sheet.add_cell(row_count,2,vulns['port'])
399399
cert_sheet.add_cell(row_count,3,vulns['self_signed'])
@@ -417,7 +417,7 @@ def excel_report
417417
end
418418
end
419419

420-
cipher_sheet.add_cell(row_count,0,host.split('/')[1])
420+
cipher_sheet.add_cell(row_count,0,host.split('/')[1].split(':')[0])
421421
cipher_sheet.add_cell(row_count,1,host.split('/')[0])
422422
cipher_sheet.add_cell(row_count,2,vulns['port'])
423423
cipher_sheet.add_cell(row_count,3,vulns['anonymous_ciphers'])
@@ -436,7 +436,7 @@ def excel_report
436436
end
437437
end
438438

439-
protocol_sheet.add_cell(row_count,0,host.split('/')[1])
439+
protocol_sheet.add_cell(row_count,0,host.split('/')[1].split(':')[0])
440440
protocol_sheet.add_cell(row_count,1,host.split('/')[0])
441441
protocol_sheet.add_cell(row_count,2,vulns['port'])
442442
protocol_sheet.add_cell(row_count,3,vulns['sslv2_supported'])

0 commit comments

Comments
 (0)