All Projects → Grunny → Zap Cli

Grunny / Zap Cli

Licence: mit
A simple tool for interacting with OWASP ZAP from the commandline.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Zap Cli

Fdsploit
File Inclusion & Directory Traversal fuzzing, enumeration & exploitation tool.
Stars: ✭ 199 (+19.88%)
Mutual labels:  pentesting, penetration-testing, owasp
Faraday
Faraday introduces a new concept - IPE (Integrated Penetration-Test Environment) a multiuser Penetration test IDE. Designed for distributing, indexing, and analyzing the data generated during a security audit.
Stars: ✭ 3,198 (+1826.51%)
Mutual labels:  pentesting, penetration-testing, security-audit
Crithit
Takes a single wordlist item and tests it one by one over a large collection of websites before moving onto the next. Create signatures to cross-check vulnerabilities over multiple hosts.
Stars: ✭ 182 (+9.64%)
Mutual labels:  pentesting, penetration-testing, security-audit
Whatweb
Next generation web scanner
Stars: ✭ 3,503 (+2010.24%)
Mutual labels:  pentesting, penetration-testing, owasp
Habu
Hacking Toolkit
Stars: ✭ 635 (+282.53%)
Mutual labels:  pentesting, penetration-testing, security-audit
Pentest Notes
Collection of Pentest Notes and Cheatsheets from a lot of repos (SofianeHamlaoui,dostoevsky,mantvydasb,adon90,BriskSec)
Stars: ✭ 89 (-46.39%)
Mutual labels:  pentesting, penetration-testing, security-audit
Wstg
The Web Security Testing Guide is a comprehensive Open Source guide to testing the security of web applications and web services.
Stars: ✭ 3,873 (+2233.13%)
Mutual labels:  pentesting, penetration-testing, owasp
Archstrike
An Arch Linux repository for security professionals and enthusiasts. Done the Arch Way and optimized for i686, x86_64, ARMv6, ARMv7 and ARMv8.
Stars: ✭ 401 (+141.57%)
Mutual labels:  pentesting, penetration-testing, security-audit
Dradis Ce
Dradis Framework: Colllaboration and reporting for IT Security teams
Stars: ✭ 443 (+166.87%)
Mutual labels:  pentesting, penetration-testing, security-audit
Resources
A Storehouse of resources related to Bug Bounty Hunting collected from different sources. Latest guides, tools, methodology, platforms tips, and tricks curated by us.
Stars: ✭ 62 (-62.65%)
Mutual labels:  pentesting, penetration-testing, security-audit
Horn3t
Powerful Visual Subdomain Enumeration at the Click of a Mouse
Stars: ✭ 120 (-27.71%)
Mutual labels:  pentesting, penetration-testing, security-audit
Find Sec Bugs
The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects)
Stars: ✭ 1,748 (+953.01%)
Mutual labels:  security-audit, owasp
Jwtxploiter
A tool to test security of json web token
Stars: ✭ 130 (-21.69%)
Mutual labels:  pentesting, penetration-testing
Git Scanner
A tool for bug hunting or pentesting for targeting websites that have open .git repositories available in public
Stars: ✭ 157 (-5.42%)
Mutual labels:  pentesting, security-audit
Trigmap
A wrapper for Nmap to quickly run network scans
Stars: ✭ 132 (-20.48%)
Mutual labels:  pentesting, penetration-testing
Pidrila
Python Interactive Deepweb-oriented Rapid Intelligent Link Analyzer
Stars: ✭ 125 (-24.7%)
Mutual labels:  pentesting, penetration-testing
Learn Web Hacking
Study Notes For Web Hacking / Web安全学习笔记
Stars: ✭ 2,326 (+1301.2%)
Mutual labels:  pentesting, penetration-testing
Xssmap
XSSMap 是一款基于 Python3 开发用于检测 XSS 漏洞的工具
Stars: ✭ 134 (-19.28%)
Mutual labels:  pentesting, penetration-testing
Reconnoitre
A security tool for multithreaded information gathering and service enumeration whilst building directory structures to store results, along with writing out recommendations for further testing.
Stars: ✭ 1,824 (+998.8%)
Mutual labels:  penetration-testing, security-audit
Minimalistic Offensive Security Tools
A repository of tools for pentesting of restricted and isolated environments.
Stars: ✭ 135 (-18.67%)
Mutual labels:  penetration-testing, security-audit

ZAP CLI

.. image:: https://travis-ci.org/Grunny/zap-cli.svg?branch=master :target: https://travis-ci.org/Grunny/zap-cli

A commandline tool that wraps the OWASP ZAP API for controlling ZAP and executing quick, targeted attacks.

Installation

To install the latest release from PyPI, you can run the following command:

::

pip install --upgrade zapcli

To install the latest development version of ZAP CLI, you can run the following:

::

pip install --upgrade git+https://github.com/Grunny/zap-cli.git

To install ZAP CLI for development, including the dependencies needed in order to run unit tests, clone this repository and use pip install -e .[dev].

Usage

To use ZAP CLI, you need to set the port ZAP runs on (defaults to 8090) and the path to the folder in which ZAP is installed. These can be set either as commandline parameters or with the environment variables ZAP_PORT and ZAP_PATH. If you have an API key set for ZAP, this can likewise be set either as a commandline parameter or with the ZAP_API_KEY environment variable.

ZAP CLI can then be used with the following commands:

::

Usage: zap-cli [OPTIONS] COMMAND [ARGS]...

  ZAP CLI - A simple commandline tool for OWASP ZAP.

Options:
  --boring            Remove color from console output.
  -v, --verbose       Add more verbose debugging output.
  --zap-path TEXT     Path to the ZAP daemon. Defaults to /zap or the value of
                      the environment variable ZAP_PATH.
  -p, --port INTEGER  Port of the ZAP proxy. Defaults to 8090 or the value of
                      the environment variable ZAP_PORT.
  --zap-url TEXT      The URL of the ZAP proxy. Defaults to http://127.0.0.1
                      or the value of the environment variable ZAP_URL.
  --api-key TEXT      The API key for using the ZAP API if required. Defaults
                      to the value of the environment variable ZAP_API_KEY.
  --log-path TEXT     Path to the directory in which to save the ZAP output
                      log file. Defaults to the value of the environment
                      variable ZAP_LOG_PATH and uses the value of --zap-path
                      if it is not set.
  --help              Show this message and exit.

Commands:
  active-scan  Run an Active Scan.
  ajax-spider  Run the AJAX Spider against a URL.
  alerts       Show alerts at the given alert level.
  context      Manage contexts for the current session.
  exclude      Exclude a pattern from all scanners.
  open-url     Open a URL using the ZAP proxy.
  policies     Enable or list a set of policies.
  quick-scan   Run a quick scan.
  report       Generate XML, MD or HTML report.
  scanners     Enable, disable, or list a set of scanners.
  scripts      Manage scripts.
  session      Manage sessions.
  shutdown     Shutdown the ZAP daemon.
  spider       Run the spider against a URL.
  start        Start the ZAP daemon.
  status       Check if ZAP is running.

You can use --help with any of the subcommands to get information on how to use them.

Getting started running a scan

In order to run a scan, you can use either the active-scan or the quick-scan command. The active-scan only runs an active scan against a URL that is already in ZAP's site tree (i.e. has already been opened using the open-url command or found by running the spider). The quick-scan command is intended to be a way to run quick scans of a site with most options contained within a single command (including being able to start and shutdown ZAP before and after), so you can do everything in one go. Without any other options passed to the command, quick-scan will open the URL to make sure it's in the site tree, run an active scan, and will output any found alerts.

As an example, to run a quick scan of a URL that will open and spider the URL, scan recursively, exclude URLs matching a given regex, and only use XSS and SQLi scanners, you could run:

::

$ zap-cli quick-scan -s xss,sqli --spider -r -e "some_regex_pattern" http://127.0.0.1/
[INFO]            Running a quick scan for http://127.0.0.1/
[INFO]            Issues found: 1
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+
| Alert                            | Risk   |   CWE ID | URL                                                                             |
+==================================+========+==========+=================================================================================+
| Cross Site Scripting (Reflected) | High   |       79 | http://127.0.0.1/index.php?foo=%22%3E%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E |
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+

The above example is equivalent to running the following commands in order:

::

$ zap-cli open-url http://127.0.0.1/
[INFO]            Accessing URL http://127.0.0.1/
$ zap-cli exclude "some_regex_pattern"
$ zap-cli spider http://127.0.0.1/
[INFO]            Running spider...
$ zap-cli active-scan --scanners xss,sqli --recursive http://127.0.0.1/
[INFO]            Running an active scan...
$ zap-cli alerts
[INFO]            Issues found: 1
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+
| Alert                            | Risk   |   CWE ID | URL                                                                             |
+==================================+========+==========+=================================================================================+
| Cross Site Scripting (Reflected) | High   |       79 | http://127.0.0.1/index.php?foo=%22%3E%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E |
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+

The quick-scan command also has a --self-contained option (or -sc for short) which will first try to start ZAP if it isn't running already and shutdown ZAP once the scan is finished. For example:

::

$ zap-cli quick-scan --self-contained --spider -r -s xss http://127.0.0.1/
[INFO]            Starting ZAP daemon
[INFO]            Running a quick scan for http://127.0.0.1/
[INFO]            Issues found: 1
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+
| Alert                            | Risk   |   CWE ID | URL                                                                             |
+==================================+========+==========+=================================================================================+
| Cross Site Scripting (Reflected) | High   |       79 | http://127.0.0.1/index.php?foo=%22%3E%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E |
+----------------------------------+--------+----------+---------------------------------------------------------------------------------+
[INFO]            Shutting down ZAP daemon

Extra start options

You can also pass extra options to the start command of ZAP using --start-options or -o with commands that allow it. For example, to start ZAP with a custom API key you could use:

::

$ zap-cli start --start-options '-config api.key=12345'

Or to run a self-contained quick scan (that will start ZAP and shut it down after the scan is complete) with a custom API key, you could use:

::

$ zap-cli --api-key 12345 quick-scan --self-contained -o '-config api.key=12345' -s xss http://127.0.0.1/

Or to run the same scan with the API key disabled:

::

$ zap-cli quick-scan -sc -o '-config api.disablekey=true' -s xss http://127.0.0.1/

Running scans as authenticated users

In order to run a scan as an authenticated user, first configure the authentication method and users for a context using the ZAP UI (see the ZAP help page <https://github.com/zaproxy/zap-core-help/wiki/HelpStartConceptsAuthentication>_ for more information). Once the authentication method and users are prepared, you can then export the context with the configured authentication method so it can be imported and used to run authenticated scans with ZAP CLI.

You can export a context with the authentication method and users configured either through the ZAP UI or using the context export ZAP CLI command. For example, to export a context with the name DevTest to a file, you could run:

::

$ zap-cli context export --name DevTest --file-path /home/user/DevTest.context

To import the saved context for use with ZAP CLI later, you could run:

::

$ zap-cli context import /home/user/DevTest.context

After importing the context with the configured authentication method and users, you can then provide the context name and user name to the spider, active-scan, and quick-scan commands to run the scans while authenticated as the given user. For example:

::

$ zap-cli context import /home/user/DevTest.context
$ zap-cli open-url "http://localhost/"
$ zap-cli spider --context-name DevTest --user-name SomeUser "http://localhost"
$ zap-cli active-scan --recursive -c DevTest -u SomeUser "http://localhost"
$ zap-cli quick-scan --recursive --spider -c DevTest -u SomeUser "http://localhost"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].