Giter VIP home page Giter VIP logo

limberduck / nessus-file-reader Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 4.0 147 KB

CLI tool and python module which enables you to parse nessus scan files from Nessus and Tenable.SC by (C) Tenable, Inc.

Home Page: https://limberduck.org

License: GNU General Public License v3.0

Python 100.00%
nessus nessus-files nessus-scanner nessus-parser nessus-report tenable tenablesc security-tools

nessus-file-reader's People

Contributors

damian-krawczyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nessus-file-reader's Issues

Counts incorrect

Hello, it appears something is wrong parsing currently.
Using the command line tool you see:
image

Looking in Nessus Pro Web Interface the counts are different:
image

Please fix.

Error when NoneType value in operating_system - function detected_os in host.py

Using Python 3.10.4 in Linux:

_python3.10/site-packages/nessus_file_reader/host/host.py", line 119, in detected_os
    if """ in operating_system:
TypeError: argument of type 'NoneType' is not iterable_

Solution: Verify if is NoneType before if condition:

if operating_system is not None:
    if """ in operating_system:
        operating_system = str(operating_system).strip('["').strip('"]')
    else:
        operating_system = str(operating_system).strip('["').strip('"]')
else:
    operating_system = ''

risk_factor to severity in host.number_of_plugins_per_risk_factor

Report pulled from tenable.sc version 5.16.0
when running number_of_plugins_per_risk_factor all results return 0 on all factors. It seems to be because the they changed it from 'risk_factor' to 'severity'

host.py

def number_of_plugins_per_risk_factor(report_host, risk_factor_level):
    """
    Function returns number of all plugins reported during scan for given risk factor for given target.
    :param report_host: report host element
    :param risk_factor_level:
        'Critical'
        'High'
        'Medium'
        'Low'
        'None'
    :return: number of plugins for given risk factor
    """
    risk_factor_counter = 0
    for report_item in report_host.findall("ReportItem"):
        risk_factor = report_item.find('risk_factor')
        if risk_factor is not None:
            if risk_factor.text == risk_factor_level:
                risk_factor_counter += 1
    return risk_factor_counter

Parsing errors?

Hello,

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:
image

Nessus web interface for comparison:
image

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.

dummy_data.zip

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.