Here is the CLI tool count followed by a script that dumps each Vuln Name by criticality and provides a count. Notice the counts are not the same. In this example, lets focus on just the Criticals:
As you can see by comparing, the parser does not account for "Unsupported Web Server Detection".
I've attached the dummy data from the scan against the HTB environment, followed by the script used to dump and count each vuln by severity.
import nessus_file_reader as nfr
nessus_scan_file = r"dummy_data.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)
critical_plugin_tracking={}
high_plugin_tracking={}
medium_plugin_tracking={}
for report_host in nfr.scan.report_hosts(root):
report_items_per_host = nfr.host.report_items(report_host)
for report_item in report_items_per_host:
report_host_ip = nfr.host.resolved_ip(report_host)
plugin_id = int(nfr.plugin.report_item_value(report_item, 'pluginID'))
risk_factor = nfr.plugin.report_item_value(report_item, 'risk_factor')
plugin_name = nfr.plugin.report_item_value(report_item, 'pluginName')
port = nfr.plugin.report_item_value(report_item, 'port')
#print('\t', plugin_id, ' \t\t\t', risk_factor,' \t\t\t', report_host_ip,' \t\t\t', plugin_name)
if plugin_name not in critical_plugin_tracking:
if risk_factor == 'Critical':
critical_plugin_tracking[plugin_name] = [report_host_ip+':'+port]
elif risk_factor =='High':
high_plugin_tracking[plugin_name] = [report_host_ip+':'+port]
elif risk_factor =='Medium':
medium_plugin_tracking[plugin_name] = [report_host_ip+':'+port]
else:
if risk_factor == 'Critical':
critical_plugin_tracking[plugin_name].append(report_host_ip+':'+port)
elif risk_factor == 'High':
high_plugin_tracking[plugin_name].append(report_host_ip+':'+port)
elif risk_factor == 'Medium':
medium_plugin_tracking[plugin_name].append(report_host_ip+':'+port)
else:
pass
print('== CRITICALS: ==')
c = 0
for k,v in critical_plugin_tracking.items():
print(k,':',v)
c += 1
print('Count:{}\n'.format(c))
print('== HIGHS ==')
c = 0
for k,v in high_plugin_tracking.items():
print(k,':',v)
c += 1
print('Count:{}\n'.format(c))
print('')
c = 0
print('== MEDIUMS ==')
for k,v in medium_plugin_tracking.items():
print(k,':',v)
c+=1
print('Count:{}\n'.format(c))
I would appreciate any help.