Skip to content
Silicon Shecky

Silicon Shecky

Infosec Practitioner

  • Security is Reactionary, No Matter What Security
  • New Year, New Post, from the start General
  • First Defcon – The results Reviews
  • Defender, KQL and Lockbit Microsoft
  • Do well, not be “popular” Ramblings
  • Defense Layers: A Case Study Microsoft
  • Device vs. User Microsoft
  • Ransomware, Are You Ready? General

Nessus and Python Scripts

Posted on January 17, 2020 By Michael Kavka No Comments on Nessus and Python Scripts

I have been working on some Python scripting over the past couple months for Nessus Pro, which I have been playing with. These are no real big deal, but might be able to help some of you out. The are located at my github page.

The first one, is the grabber script. We had been using one for our local scanner that required username and password. I decided it was about time to do it through API keys so I rewrote the generic script we already head to use them. It was a great way to get to understand how to use API keys to access the Nessus scanner. This script will show you information so you can grab just one scan, or all scans if you have multiple ones set up.

Once that was done, I turned my mind to parsing the raw nessus file, which is XML into an easy to read format (nessus_parser.py). We had been using a perl script from years ago to create a multi-page Excel file. I instead have done it in python, modifying a script I found that was not completely functional, reworking it to use import the CSV feature and output everything into a single CSV file. There is also a remarked out section with some notes, if you only want to parse out vulnerabilities with CVSS scores (so non info data). I personally like having access to all the data.

Inside the parser there is the following line:

csvHeaders = ['CVSS Score', 'IP', 'FQDN', 'OS', 'Port', 'Vulnerability', 'Risk', 'Description', 'Exploit Available', 'Proof', 'Solution', 'See Also', 'CVE'] #headers for the CSV

 

This maps to the line below it:

nessusFields = ['cvss_base_score', 'host-ip', 'host-fqdn', 'operating-system', 'port', 'plugin_name', 'risk_factor', 'description', 'exploit_available', 'plugin_output', 'solution', 'see_also', 'cve'] # headers of the nessus file. These are pulled from the XML. Order here must match up to the CSV headers you want for each item.

 

If you want some piece of data pulled from the raw nessus file that I am not pulling, you can add it into both lines, the lower one being the field in nessus, and the upper being what the head for that data will be called. You can look at the code and the raw nessus file to see what I mean as far as the <tag> goes. Also, there is a section to pull attributes out of the <ReportItem> tag such as port, protocol etc…

if item.tag == 'ReportItem': # this will parse out items that are in the tag <Report item>
            reportRow = dict(reportHost)
            reportRow['Port'] = item.attrib['port']
            reportRow['Vulnerability'] = item.attrib['pluginName']
            reportRow['Plugin ID'] = item.attrib['pluginID']
            for tag in (tag for tag in item if tag.tag in nessusFields):
                reportRow[getKey(tag.tag)] = getValue(tag.text)

 

As I said simple stuff, nothing written from scratch but heavily modified to make them working scripts for this day and age. Enjoy!

Scripts, Security Tags:Nessus, Python, script

Post navigation

Previous Post: Year End Musings
Next Post: Random Stream of Thoughts

Related Posts

  • Security is Reactionary, No Matter What Security
  • Defender, KQL and Lockbit Microsoft
  • Defense Layers: A Case Study Microsoft
  • Device vs. User Microsoft
  • Ransomware, Are You Ready? General
  • Are you sure it is the execs? Ramblings

More Related Articles

Security is Reactionary, No Matter What Security
Defender, KQL and Lockbit Microsoft
Defense Layers: A Case Study Microsoft
Device vs. User Microsoft
Ransomware, Are You Ready? General
Are you sure it is the execs? Ramblings

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • About
  • Links
    • Burbsec
    • BSides312
    • Infosec Exchange Mastodon
    • BSidesRoc
    • Hacks4Pancakes Blog
    • Krebs On Security
    • Bleeping Computer
  • Categories
    • General
    • Computers
    • Software
    • Rants
    • Security
    • Internet/Music
    • Reviews
    • Microsoft
    • Hardware
    • Mobile Computing
  • Archives
  • Social Media

Browse by tags

2008 Active Directory Android Antivirus Apple Beta CarbonBlack Chrome Computers Exchange Exchange 2007 Firefox General Thoughts Google InfoSec Internet Explorer iOS iPad IT Linux Mac Malware Microsoft OS OSx Patches SBS SBS 2008 Security Server SMB Software Support Surface TechEd Thotcon Tweets Ubuntu Verizon Virus Vista Windows Windows 7 Windows 8 XP
  • About
  • Links
    • Burbsec
    • BSides312
    • Infosec Exchange Mastodon
    • BSidesRoc
    • Hacks4Pancakes Blog
    • Krebs On Security
    • Bleeping Computer
  • Categories
    • General
    • Computers
    • Software
    • Rants
    • Security
    • Internet/Music
    • Reviews
    • Microsoft
    • Hardware
    • Mobile Computing
  • Archives
  • Social Media

Connect

  • Bluesky
  • LinkedIn
  • Mastodon
  • RSS
  • Twitter

RSS feed: iFin Intel Feed iFin Intel Feed

  • Google Doc Sidebar Sends Mac and Windows Users Down Different Paths to Malware September 15, 2026
  • Cyberattack causes a flight delay? Airlines won’t owe you a hotel or meal September 11, 2026 Tim Starks
  • Hackers abused Claude to extract secrets from 1.8M Android apps September 11, 2026 Bill Toulas
  • Florida says motor vehicle data breach tied to credentials stolen from officer’s personal device September 11, 2026
  • CVE-2026-89332 - Kiro IDE Sensitive Workspace Data Exfiltration via Agent-Written Workspace Configuration September 11, 2026 aws@amazon.com
  • Florida confirms DMV database breached via stolen police account September 11, 2026 Lawrence Abrams
  • GitLab’s critical flaw is already drawing internet-wide probes September 11, 2026 Greg Otto
  • Microsoft sees some new wrinkles in invoice-scam emails September 11, 2026
  • More JFrog Artifactory bugs under attack, and all 3 have patches September 11, 2026
  • Passkey-themed phishing attacks lead to Microsoft 365 data theft September 11, 2026 Lawrence Abrams
  • CVE-2026-89090 - Denial of service in the event stream header decoder in AWS SDK for Go v2 September 11, 2026 aws@amazon.com
  • No One Inside The Machine September 11, 2026 Kate Lake

Browse by tags

2008 Active Directory Android Antivirus Apple Beta CarbonBlack Chrome Computers Exchange Exchange 2007 Firefox General Thoughts Google InfoSec Internet Explorer iOS iPad IT Linux Mac Malware Microsoft OS OSx Patches SBS SBS 2008 Security Server SMB Software Support Surface TechEd Thotcon Tweets Ubuntu Verizon Virus Vista Windows Windows 7 Windows 8 XP

RSS feed: iFin Intel Feed iFin Intel Feed

  • Google Doc Sidebar Sends Mac and Windows Users Down Different Paths to Malware September 15, 2026
  • Cyberattack causes a flight delay? Airlines won’t owe you a hotel or meal September 11, 2026 Tim Starks
  • Hackers abused Claude to extract secrets from 1.8M Android apps September 11, 2026 Bill Toulas
  • Florida says motor vehicle data breach tied to credentials stolen from officer’s personal device September 11, 2026
  • CVE-2026-89332 - Kiro IDE Sensitive Workspace Data Exfiltration via Agent-Written Workspace Configuration September 11, 2026 aws@amazon.com
  • Florida confirms DMV database breached via stolen police account September 11, 2026 Lawrence Abrams
  • GitLab’s critical flaw is already drawing internet-wide probes September 11, 2026 Greg Otto
  • Microsoft sees some new wrinkles in invoice-scam emails September 11, 2026
  • More JFrog Artifactory bugs under attack, and all 3 have patches September 11, 2026
  • Passkey-themed phishing attacks lead to Microsoft 365 data theft September 11, 2026 Lawrence Abrams
  • CVE-2026-89090 - Denial of service in the event stream header decoder in AWS SDK for Go v2 September 11, 2026 aws@amazon.com
  • No One Inside The Machine September 11, 2026 Kate Lake
  • Security is Reactionary, No Matter What Security
  • New Year, New Post, from the start General
  • First Defcon – The results Reviews
  • Defender, KQL and Lockbit Microsoft
  • Do well, not be “popular” Ramblings
  • Defense Layers: A Case Study Microsoft
  • Device vs. User Microsoft
  • Ransomware, Are You Ready? General

Social Media

  • Bluesky
  • Mastodon
  • Twitter

Copyright © 2026 Silicon Shecky.