GithubHelp home page GithubHelp logo

pynessus's Introduction

PyNessus

Documentation Status

Client for the Nessus vulnerability scanner REST API. Currently support Nessus versions 5.x, support for Nessus 6.x is on its way (see feature-nessus6 branch).

Features

  • Full support of Nessus functionalities

Installation

You can install pynessus either via pip or by cloning the repository :

$ pip install python-nessus
$ git clone https://github.com/QKaiser/pynessus.git pynessus
$ cd pynessus
$ python setup.py install
quentin@grmwl$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynessus import Nessus
>>> Nessus()
<pynessus.nessus.Nessus object at 0x7f2a6f5aae50>

Documentation

The full documentation is available at https://python-nessus.readthedocs.org . You can find example scripts under the scripts directory.

Contribute

Support

If you are having issues, please let me know via the issue tracker or by mail ([email protected]).

License

The project is licensed under the Apache 2.0 License.

Credits

Original ideas were taken from https://code.google.com/p/nessusxmlrpc by Kurtis Miller

pynessus's People

Contributors

qkaiser avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

pynessus's Issues

error SSL when login

There are a error when i login using username, pass:
if server.login(User("admin", "admin")):
File "C:\Python27\lib\site-packages\pynessus\nessus.py", line 205, in login
response = self._api_request("POST", "/login", params)
File "C:\Python27\lib\site-packages\pynessus\nessus.py", line 157, in _api_request
response = json.loads(self._request(method, target, json.dumps(params)))
File "C:\Python27\lib\site-packages\pynessus\nessus.py", line 130, in _request
self._connection.request(method, target, params, self._headers if headers is None else headers)
File "C:\Python27\lib\httplib.py", line 1053, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1093, in _send_request
self.endheaders(body)
File "C:\Python27\lib\httplib.py", line 1049, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 893, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 855, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 1274, in connect
server_hostname=server_hostname)
File "C:\Python27\lib\ssl.py", line 352, in wrap_socket
_context=self)
File "C:\Python27\lib\ssl.py", line 579, in init
self.do_handshake()
File "C:\Python27\lib\ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

PyPI updates

My team uses Poetry to manage dependencies for a variety of reasons

The project looks like its exactly what we need but the PyPi for it hasn't been updated in a bit and the wheel build is failing

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-mcdn5pmj/python-nessus_b2a10e6af8d3490f96a6e989812f5243/setup.py", line 2, in <module>
      VERSION = __import__("pynessus").__version__
    File "/tmp/pip-install-mcdn5pmj/python-nessus_b2a10e6af8d3490f96a6e989812f5243/pynessus/__init__.py", line 2, in <module>
      from nessus import Nessus, NessusAPIError
  ModuleNotFoundError: No module named 'nessus'

@qkaiser would you mind updating that package, please? :)

skanner.py incorrectly detects the scan is complete

in some situations the script decides the scan is complete while it is not.
it appears to happen when scanning a large network with few fast hosts. when all responding hosts are scanned, but not all network is covered, the script stops polling and tries to download the report and fails horribly

Potential division by zero

There is potential division by zero in pynessus/nessus.py line 1232

def get_scan_progress(self, scan):
params = {"id" : scan.uuid}
response = self._api_request("POST", "/result/details", params)
current = 0.0
total = 0.0 if len(response["hosts"]) else 1.0
for host in response["hosts"]:
current += host["scanprogresscurrent"]
total += host["scanprogresstotal"]
return current/total*100.0

Nessus.get_scan_progress() and .get_scan_status() are undocumented

Please document the expected behavior of get_scan_progress() and get_scan_status() commands.

Strings returned by status() should be defined as constants, the client should never be able to compare the result of status() with something line Nessus.STATUS_RUNNING instead of using "running" string in their code.

skanner.py: fails silently if policy not found

To reproduce

abb@e6510x:/dvp/pynessus/scripts$ python skanner.py -c nessus.conf -i localhost -n test201411240745 -p "nonexistent"
abb@e6510x:
/dvp/pynessus/scripts$ echo $?
0

Instead, the scanner should die (throw an exception for example) and return non-zero exit code.

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.