Giter Club home page Giter Club logo

multiscanner's Introduction

MultiScanner

A Security Tool which scans a target using OpenVAS, Zap, and Nexpose. And consolidates the scan results.


Usage

Start a scan against a Target

./main.py --scan-name <scan-name> --target <url>

Get scan result

./main.py --scan-name <scan-name>

Pause/Resume a scan result

  • ./main.py --scan-name <scan-name> --pause
  • ./main.py --scan-name <scan-name> --resume

Screenshots

Scanner Options:

Scanner Options

Scanner Report:

Scanner Report

Final Output:

Final Output


Prerequisites

  • Python 3
  • Zap
  • Nexpose
  • OpenVAS

Installation

pip3 install -r requirements.txt

OR

Run in Virtual Env:

python3 -m venv .venv

source .venv/bin/activate

pip3 install -r requirements.txt

Configuration

The configuration of scanners will be in Environment File .env. There is sample .env.example file in the codebase, update the values with the proper API Keys and Credentials details before using. Rename it to .env.


Targets to Test


ToDo

  • Dockerize
  • Add Nessus
  • Error Stack
  • auto reload
  • Remove logs
  • Save to CSV
  • Make it interactive
  • OOPs
  • Improve Scan Results and Output
  • Color logging

Scanner Interface:

  • start
  • scan
  • get_scan_status
  • get_scan_results
  • is_valid_scan
  • list_scans
  • pause
  • resume
  • stop

Development Notes

        pprint(core.htmlreport())


        # address = rapid7vmconsole.Address(ip=target)
        # asset = rapid7vmconsole.Asset(addresses=[address])


        scan_targets = rapid7vmconsole.IncludedScanTargets(addresses=[target])

        asset = rapid7vmconsole.StaticSite(included_targets=scan_targets)

        scan_scope = rapid7vmconsole.ScanScope(assets=asset)

        site_create_resource = rapid7vmconsole.SiteCreateResource(name=scan_name, scan=scan_scope)

        site = self.nexpose_site.create_site(site=site_create_resource)

        print('Site Created', site)

        adhoc_scan = rapid7vmconsole.AdhocScan(hosts=[target])
        print('adhoc_scan', adhoc_scan)

        site_id = site.id

        scan = self.nexpose.start_scan(site_id, scan=adhoc_scan)
        print('start scan response id', scan.id)
        # scan['vulnerabilities']
        pprint(scan)

if shutdownOnceFinished:
    # Shutdown ZAP once finished
    pprint('Shutdown ZAP -> ' + core.shutdown())

report_config_scope = rapid7vmconsole.ReportConfigScopeResource(scan=nexpose_id)

report_config_categories = rapid7vmconsole.ReportConfigCategoryFilters(included=[])

report_config_filters = rapid7vmconsole.ReportConfigFiltersResource(categories=report_config_categories)

report_config = rapid7vmconsole.Report(name=f'{scan_name}-Report', template='audit-report', format='csv-export', scope=report_config_scope)

        report_config = rapid7vmconsole.Report(name=f'{scan_name}-Report', format='sql-query', query='select * from dim_asset', version='2.3.0')

report_config = rapid7vmconsole.Report(name=f'{scan_name}-SampleXML-Report', format='nexpose-simple-xml', scope=report_config_scope)
report = nexpose_report.create_report(report=report_config)
report_instance = nexpose_report.generate_report(report.id)
nexpose_report.download_report(report.id, report_instance.id)



report_config = rapid7vmconsole.Report(name=f'{scan_name}-sml2-Report', format='xml-export-v2', scope=report_config_scope)
report = nexpose_report.create_report(report=report_config)
report_instance = nexpose_report.generate_report(report.id)
dd = nexpose_report.download_report(report.id, report_instance.id)


report_config = rapid7vmconsole.Report(name=f'{scan_name}-html-Report', format='html', template='audit-report', scope=report_config_scope)
report = nexpose_report.create_report(report=report_config)
report_instance = nexpose_report.generate_report(report.id)
dd = nexpose_report.download_report(report.id, report_instance.id)


report_config.id = 42
report_config.timezone = 'Asia/Calcutta'

report_config.language = 'en-US'
report_config.owner = 1
report_config.organization = 'Organization'

# report_config.component = 'Component'
# report_config.email = rapid7vmconsole.ReportEmail(additional_recipients=['[email protected]'])


# print('self.zap.spider.results', self.zap.spider.results(scan_id))




# Retrieve all tasks
tasks = gmp.get_tasks()

# Get names of tasks
task_names = tasks.xpath('task/name/text()')
pretty_print(task_names)

multiscanner's People

Contributors

renovate-bot avatar sweep-ai[bot] avatar vs4vijay 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

multiscanner's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency terminaltables to v3.1.10
  • Update dependency defusedxml to v0.7.1
  • Update dependency xmltodict to v0.13.0
  • Update dependency asn1crypto to v1
  • Update dependency bcrypt to v4
  • Update dependency chardet to v5
  • Update dependency gvm-tools to v24
  • Update dependency python-dotenv to v1
  • Update dependency python-gvm to v24
  • Update dependency soupsieve to v2
  • Update dependency tinydb to v4
  • πŸ” Create all rate-limited PRs at once πŸ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.


Warning

Renovate failed to look up the following dependencies: Failed to look up pypi package pprint, Failed to look up pypi package rapid7-vm-console.

Files affected: requirements.txt


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

pip_requirements
requirements.txt
  • asn1crypto ==0.24.0
  • bcrypt ==3.1.7
  • beautifulsoup4 ==4.8.0
  • certifi ==2019.6.16
  • cffi ==1.12.3
  • chardet ==3.0.4
  • cryptography ==2.7
  • defusedxml ==0.6.0
  • gvm-tools ==2.0.0b1
  • idna ==2.8
  • lxml ==4.4.1
  • nltk ==3.4.5
  • paramiko ==2.6.0
  • pprint ==0.1
  • pycparser ==2.19
  • PyNaCl ==1.3.0
  • python-dateutil ==2.8.0
  • python-dotenv ==0.10.3
  • python-gvm ==1.0.0b3
  • python-owasp-zap-v2.4 ==0.0.15
  • rapid7-vm-console ===1.0.0-6.5.50
  • requests ==2.22.0
  • six ==1.12.0
  • soupsieve ==1.9.2
  • terminaltables ==3.1.0
  • tinydb ==3.13.0
  • urllib3 ==1.25.3
  • xmltodict ==0.12.0

  • Check this box to trigger a request for Renovate to run again on this repository

Err:8 http://ppa.launchpad.net/mrazavi/openvas/ubuntu focal Release 404 Not Found [IP: 2001:67c:1560:8008::15 80]

@vs4vijay sudo add-apt-repository ppa:mrazavi/openvas
OpenVAS is a framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution.

Homepage: http://www.openvas.org/

*** NEW Openvas 10 now called GVM-10 ***

Openvas 10, now called Greenbone Vulnerability Management (GVM-10) has released. Find out more at: https://launchpad.net/~mrazavi/+archive/ubuntu/gvm

*** Openvas 9 ***

A set of packages for openvas 9 is included in this PPA. If you prefer to install them, you just have to install "openvas9" package (instead of "openvas" for the old version). Then, update scripts/data with the following commands:

sudo apt install sqlite3
sudo greenbone-nvt-sync
sudo greenbone-scapdata-sync
sudo greenbone-certdata-sync

sudo service openvas-scanner restart
sudo service openvas-manager restart
sudo openvasmd --migrate #only required when upgrading from an older version
sudo openvasmd --rebuild --progress

Please note that the default port number of the web interface for the new packages are changed to 4000. So, to access the web interface for version 9, go to https://localhost:4000. Use "admin" as username and password.

You can change the web interface port number by modifying /etc/default/openvas-gsa. Then, restart its service by issuing "sudo service openvas-gsa restart".

To enable pdf reports:
sudo apt install texlive-latex-extra --no-install-recommends
sudo apt install texlive-fonts-recommended --no-install-recommends

To install openvas-nasl utility:
sudo apt install libopenvas9-dev

*** Openvas 8 ***

To install the old version, openvas 8, install the "openvas" package from this ppa. It is only tested on ubuntu 14.04 trusty and 16.04 xenial.

You have to update openvas scripts/data after installation with the following commands:

sudo apt-get install sqlite3
sudo openvas-nvt-sync
sudo openvas-scapdata-sync
sudo openvas-certdata-sync

sudo service openvas-scanner restart
sudo service openvas-manager restart
sudo openvasmd --rebuild --progress

Login into https://localhost:443 with "admin" as username and password.
More info: https://launchpad.net/~mrazavi/+archive/ubuntu/openvas
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Ign:6 http://ppa.launchpad.net/mrazavi/openvas/ubuntu focal InRelease
Ign:7 http://ppa.launchpad.net/webupd8team/java/ubuntu focal InRelease
Err:8 http://ppa.launchpad.net/mrazavi/openvas/ubuntu focal Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
Err:9 http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.3 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [56.5 kB]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/mrazavi/openvas/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Sweep: Add Unit Tests for the project

Checklist
  • Create tests/test_zap_scanner.py βœ“ c858ad4
  • Check tests/test_zap_scanner.py βœ—
  • Modify requirements.txt βœ“ 2c720dc
  • Check requirements.txt βœ—
  • Check tests/test_zap_scanner.py βœ—
  • Create tests/test_nexpose_scanner.py βœ“ 3223bf6
  • Check tests/test_nexpose_scanner.py βœ—
  • Create tests/test_openvas_scanner.py βœ“ b999729
  • Check tests/test_openvas_scanner.py βœ—
  • Create tests/test_storage_service.py βœ“ 5a379da
  • Check tests/test_storage_service.py βœ—
  • Modify scanners/zap_scanner.py βœ“ 0ffce44
  • Check scanners/zap_scanner.py βœ—
  • Modify scanners/nexpose_scanner.py βœ“ 250c51b
  • Check scanners/nexpose_scanner.py βœ—
  • Modify scanners/openvas_scanner.py βœ“ 1f754f5
  • Check scanners/openvas_scanner.py βœ—
  • Modify core/storage_service.py ! No changes made

Flowchart

not able to connect to the openvas,zap,nexpose i am using ubuntu 16.04

python main.py --scan-name sixyfive7 --target http://scanme.nmap.org
[OpenVAS] Not able to connect to the OpenVAS: (<class 'gvm.errors.RequiredArgument'>, , <traceback object at 0x7f44a94b9308>)
[ZAP] Starting Scan for Target: http://scanme.nmap.org
[ZAP] Starting Scan: sixyfive7
[ZAP] Not able to connect to the ZAP: (<class 'requests.exceptions.ProxyError'>, ProxyError(MaxRetryError("HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: http://scanme.nmap.org/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f44a94b2518>: Failed to establish a new connection: [Errno 111] Connection refused',)))",),), <traceback object at 0x7f44a945ad08>)
[Nexpose] Starting Scan for Target: http://scanme.nmap.org
[Nexpose] Scan Name: sixyfive7
[Nexpose] Not able to connect to the Nexpose: (<class 'urllib3.exceptions.MaxRetryError'>, MaxRetryError("HTTPSConnectionPool(host='localhost', port=3780): Max retries exceeded with url: /api/3/sites (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f44a944bb70>: Failed to establish a new connection: [Errno 111] Connection refused',))",), <traceback object at 0x7f44a9471048>)
[OpenVAS] Starting Scan for Target: http://scanme.nmap.org
[OpenVAS] Scan Name: sixyfive7
[OpenVAS] Not able to connect to the OpenVAS: (<class 'gvm.errors.RequiredArgument'>, , <traceback object at 0x7f44a946ee88>)
β•”Scan Status══╦════════╗
β•‘ # β•‘ Scanner β•‘ Status β•‘

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.