Git Product home page Git Product logo

pynessus-rest's Introduction

pynessus-rest

Python Library to use the implementation of the REST protocol of Tenable’s Nessus scanner. You can use Nessus from your scripts easily!

Installation

Recommended installation using setuptools. Just type: python setup.py install

##Usage. Some examples to use pynessus-rest.

  • Login with the Nessus server.
from pynessus.rest.client.NessusClient import NessusClient
client = NessusClient('127.0.0.1','8834')
client.login('adastra','adastra')
  • Print the Nessus Feed.
print client.feed()
  • List of policies
client.policyList()
  • Upload a policy
client.policyFileUpload("tested.nessus", contents)
  • Import a policy
client.policyFilePolicyImport("tested.nessus")
  • Start a new scan
client.scanNew("8.8.8.4",'1','testScan')
  • Stop a existing scan
client.scanStop('ec665c9e-ce24-336b-acb4-e2b199fac1800854abce5c111a8d')
  • Creates a new Scan Template
client.scanTemplateNew('1','127.0.0.1', 'NewTemplate')
  • Launches a new Scan using the specified templte
client.scanTemplateLaunch('NewTemplate')
  • List of generated reports
client.reportList()
  • Report Details for a specific port number
client.reportDetails('e26d6acf-75b2-a4cb-0ca6-879f0da6ab571a375b02539ff736', '192.168.1.222', '139', 'tcp')
  • List of host for a specific report
client.reportHosts("2e8ed9f5-79b5-4f60-d223-bc08e9688c79a606b97c670a7deb")
  • List of host for a specific report
client.reportHosts("2e8ed9f5-79b5-4f60-d223-bc08e9688c79a606b97c670a7deb")

Using NessusConverter to parse the JSON Response.

The JSON response for some functions of Nessus is very large and complex. Usually, parsing that data structures is a hard job. The NessusConverter class parses the JSON response and generates a Python object with every field filled with the data received from the server. Check the NessusConverter function and NessusStructure attributes to get a clear idea.

  • List the report Attributes.
nessusConverter = NessusConverter(client.reportAttributesList("2e8ed9f5-79b5-4f60-d223-bc08e9688c79a606b97c670a7deb"))
nessusConverter.reportAttributesToStructure()
for reportAttribute in nessusConverter.nessusStructure.nessusReportAttributes:
	print reportAttribute.type +' - '+ reportAttribute.regex
  • Report Tags
nessusConverter = NessusConverter(client.reportTags("2e8ed9f5-79b5-4f60-d223-bc08e9688c79a606b97c670a7deb", '127.0.0.1', jsonFormat=True))
nessusConverter.tagToNessusStructure()
for tag in nessusConverter.nessusStructure.nessusTags:
	print tag.name +' - '+ tag.value
  • Nessus Structure with the Scans in execution.
nessusConverter = NessusConverter(client.scanList())
structure = nessusConverter.scanListToStructure()

##Contact. If you have any issue or query, just send an email to: debiadastra at gmail dot com

pynessus-rest's People

Contributors

adastra-thw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pynessus-rest's Issues

NessusClient reportFileDownload() function

We are currently using your API wrapper to access the Nessus REST API. We just noticed that in the reportFileDownload function, the nessusFunction called is 'report_chapter'. Is this correct? We are thinking that 'report_file_download' should be used instead.
This is in NessusClient.py, line 591.
Thank you in advance.

NessusClient policyFileUpload() function

We are currently using your API wrapper to access the Nessus REST API. However, we encountered issues on the policyFileUpload function since it does return a HTTP error message. We actually asked this in the Tenable Nessus discussion page and they mentioned to consult this issue with you. Here is the link to the discussion thread: https://discussions.nessus.org/message/28016 (new to nessus questions) for your reference.

Thank you in advance.

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.