Skip to main content

An interface to Netsparker REST API

Project description

A REST interface to Netsparker

PyPI Version

Dependencies:

  • Netsparker Team or Enterprise License (Not working with standard license)
  • Python 3.3+
  • requests module (install via pip)
  • The dependencies can be satisfied via pip install -r requirements.txt

Quick Install

pip install netsparker-api

API Documentations:

https://www.netsparkercloud.com/docs/index

Some examples:

  • Get your account information.
  from netsparker_api import Netsparker_Account

  credentials = {
  "API_ROOT": "https://www.netsparkercloud.com/api/1.0/%s",
  "USER_ID": "NETSPARKER CLOUD API USER_ID GOES HERE",
  "API_TOKEN": "NETSPARKER CLOUD API API_TOKEN GOES HERE"
  }

  my_info = Netsparker_Account.Account.me(credentials)
  print(my_info)
  • Schedules a scan to be launched in the future.
  from netsparker_api import Netsparker_Scans

  credentials = {
  "API_ROOT": "https://www.netsparkercloud.com/api/1.0/%s",
  "USER_ID": "NETSPARKER CLOUD API USER_ID GOES HERE",
  "API_TOKEN": "NETSPARKER CLOUD API API_TOKEN GOES HERE"
  }

  data = {
  "Name": "Scheduled Scan-1",
  "NextExecutionTime": "15/05/2020 10:20 PM",
  "ScheduleRunType": "Weekly",
  "CustomRecurrence": {
    "RepeatType": "Weeks",
    "Interval": 1,
    "EndingType": "Never",
    "DaysOfWeek": [
      "Friday"
    ],
    "EndOn": "21/07/2022 10:42 PM"
  },
  "TargetUri": "http://php.testsparker.com/",
  "Cookies": "name1=value1; name2=value2",
  "CrawlAndAttack": "true",
  "EnableHeuristicChecksInCustomUrlRewrite": "true",
  }

  schedule_scan = Netsparker_Scans.Scans.schedule(credentials, data)
  print(schedule_scan)
  • Returns the custom report of a scan in the specified format.
  from netsparker_api import Netsparker_Scans

  credentials = {
  "API_ROOT": "https://www.netsparkercloud.com/api/1.0/%s",
  "USER_ID": "NETSPARKER CLOUD API USER_ID GOES HERE",
  "API_TOKEN": "NETSPARKER CLOUD API API_TOKEN GOES HERE"
  }

  data = {
  "id": "8705818b4fc644a33957ab9c01765d06",
  "reportName": "ScheduledScan-1Report ",
  "onlyConfirmedVulnerabilities": "false",
  "excludeIgnoreds": "false",
  "reportFormat": "Json"
  }

  report_csv = Netsparker_Scans.Scans.custom_report(credentials, data)
  print(report_csv)

Building modules:

  • To build a package to install via pip or easy_install, execute:
    • python setup.py sdist
  • The resulting build will be in $PWD/dist/Netsparker_Rest_API-<version>.tar.gz

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netsparker_api-0.2.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

netsparker_api-0.2-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page