OWASP ZAP Downloader - Download and manage ZAP core and addons
Project description
OWASP ZAP Downloader
A Python CLI tool for downloading and managing OWASP ZAP core and addons.
Installation
From PyPI (coming soon)
pip install zap-downloader
From Source
cd apps/zap-downloader
pip install -e .
Setup
Workspace
The default workspace is zap-workspace in the current directory. You can customize it using:
--workspace/-woption on any commandZAP_PACKAGES_WORKSPACEenvironment variable
export ZAP_PACKAGES_WORKSPACE=/path/to/workspace
Create Workspace
zap-downloader workspace /path/to/workspace
Usage
List Available Versions
Show all available ZAP core versions and addons:
zap-downloader list
Options:
--addons/-a- Show addons only--core/-c- Show core versions only
Get Addon Info
Get detailed information about a specific addon:
zap-downloader info <addon-id>
Example:
zap-downloader info commonlib
zap-downloader info ascanrules
Download ZAP Core
Download ZAP core for a specific platform:
zap-downloader core -p <platform> [-o output-dir] [-w workspace]
Platforms: windows, windows32, linux, mac, daily
Example:
zap-downloader core -p windows
zap-downloader core -p linux -o ./zap-install
Download Addons
Download addons by ID or from a config file:
zap-downloader addons [-c config-file] [addon-id ...] [-s status] [-w workspace] [-o output-dir]
Options:
-c,--config- Path to YAML or JSON config file-s,--status- Filter by status:release,beta,alpha-o,--output- Output directory for addons
Examples:
# Download by addon IDs
zap-downloader addons commonlib pscanrules
zap-downloader addons ascanrulesBeta -s beta
# Download from config file
zap-downloader addons -c my-addons.yaml
zap-downloader addons -c config.json -o ./my-addons
Config file example (addons.yaml):
addons:
- id: commonlib
- id: pscanrules
status: release
output: ./addons
Create Config Files
Create Addon Config
zap-downloader create-config -a <addon-id> [<addon-id> ...] [-o output.yaml] [-s status]
Example:
zap-downloader create-config -a commonlib pscanrules -o my-addons.yaml
Create ZAP Config (Core + Addons)
zap-downloader create-zap-config -p <platform> [-a <addon-id> ...] [-o output.yaml]
Example:
zap-downloader create-zap-config -p windows -a commonlib pscanrules
Download from Config
Download ZAP core and addons from a config file:
zap-downloader download-zap -c <config-file> [-w workspace]
Example config (zap-config.yaml):
zap:
platform: windows
version: 2.17.0
addons:
- id: commonlib
- id: pscanrules
- id: ascanrules
status: release
zap-downloader download-zap -c zap-config.yaml
Validate File Hash
Validate a downloaded file's SHA256 hash against the XML data:
zap-downloader validate <file> [-a addon-id] [-p platform]
Options:
-a,--addon- Compare against addon hash-p,--platform- Compare against core platform hash
Examples:
# Just show the file's SHA256
zap-downloader validate ./zap/ZAP_2_17_0_windows.exe
# Validate against platform
zap-downloader validate ./zap/ZAP_2_17_0_windows.exe --platform windows
# Validate against addon
zap-downloader validate ./addons/commonlib-release-1.40.0.zap --addon commonlib
Package Directory
Package ZAP core and addons into a .tar archive:
zap-downloader package [-o output.tar] [-w workspace]
Example:
zap-downloader package -o ./release-package.tar
Unpack Package
Unpack a .tar package and organize addons:
zap-downloader unpack -i <input.tar> [-o output-dir]
Options:
-i,--input- Path to the.tarpackage file (required)-o,--output- Output directory (default: extracted archive name)
Example:
zap-downloader unpack -i linux-zap.tar -o ./zap-install
This command:
- Extracts the
.tararchive - Extracts any
.tar.gzZAP core archive inside - Moves addons to the
pluginfolder (if not already present) - Removes the empty
addonsfolder
Daemon Management
Start, stop, and manage ZAP as a daemon:
zap-downloader daemon <command> [options]
Start Daemon
zap-downloader daemon start [-t toml] [-d dir] [-w workspace] [-P port] [-k api-key]
Options:
-t,--toml- Path to TOML configuration file-d,--dir- ZAP installation directory (where zap.jar is)-w,--workspace- Working directory-P,--port- Proxy port (default: 8080)-k,--api-key- API key (optional, defaults to disabled)-N,--name- Process name (default: zap-daemon)
Examples:
# Start daemon with TOML config
zap-downloader daemon start -t ./workspace/default.toml
# Start daemon with manual options
zap-downloader daemon start -d ./install -w ./workspace -P 8080
Stop Daemon
zap-downloader daemon stop [-w workspace] [-N name]
Status Daemon
zap-downloader daemon status [-N name]
Logs Daemon
zap-downloader daemon log [-w workspace] [-n lines] [-e] [-b]
Options:
-w,--workspace- Workspace directory-n,--lines- Number of log lines (default: 200)-e,--err- Show error log-b,--both- Show both output and error logs
Examples:
# View last 50 lines
zap-downloader daemon log -n 50
# View error log only
zap-downloader daemon log -e
# View both logs
zap-downloader daemon log -b
Ping Daemon
zap-downloader daemon ping [-H host] [-P port] [-T timeout] [--json]
Options:
-H,--host- Host to check (default: 127.0.0.1)-P,--port- Port to check (default: 8080)-T,--timeout- Timeout in milliseconds (default: 2000)--json- Return as JSON
Health Daemon
zap-downloader daemon health [-H host] [-P port]
Check ZAP health via /core/view/version/ API.
Check Started Daemon
zap-downloader daemon started [-H host] [-P port] [-T timeout]
Wait until ZAP daemon responds to API.
Examples:
# Wait up to 60 seconds for ZAP to start
zap-downloader daemon started -T 60
Package with TOML Config
Include a default TOML config in the package:
zap-downloader package [-o output.tar] [-w workspace] [-t toml]
Options:
-o,--output- Output.tararchive path-w,--workspace- Workspace directory-t,--toml- Path to TOML config to include
Example:
zap-downloader package -o ./zap-package.tar -t ./config/default.toml
Offline Package
Create a complete offline ZAP package that can run without internet. This downloads the latest ZAP core and ALL addons (release + beta + alpha), disables auto-update, and packages everything into a tar file.
zap-downloader offline <command>
Pack Offline Package
zap-downloader offline pack [-o output.tar] [-p platform]
Options:
-o,--output- Output.tararchive path (default:zap-offline.tar)-p,--platform- Platform for ZAP core (default:linux)
Example:
# Create offline package
zap-downloader offline pack -o zap-offline.tar
# Create for Windows
zap-downloader offline pack -o zap-offline.tar -p windows
Unpack Offline Package
zap-downloader offline unpack -i <input.tar> [-o output-dir]
Options:
-i,--input- Path to the.tarpackage file (required)-o,--output- Output directory (default: extracted archive name)
Example:
zap-downloader offline unpack -i zap-offline.tar -o /opt/zap
Then start ZAP with:
zap-downloader daemon start -t /opt/zap/workspace/default.toml
Workspace Management
Create or show workspace directory:
zap-downloader workspace [path]
Examples:
# Show current workspace
zap-downloader workspace
# Create specific workspace
zap-downloader workspace ./my-workspace
Global Options
-w,--workspace- Workspace directory (default:zap-workspaceorZAP_PACKAGES_WORKSPACEenv var)-x,--proxy- Proxy URL (e.g.,http://proxy:8080)
Proxy Support
You can use a proxy for downloading by setting either:
Option 1: Command-line flag
zap-downloader core -p linux -x http://proxy:8080
zap-downloader addons -c config.yaml -x http://proxy:8080
Option 2: Environment variable
export HTTP_PROXY=http://proxy:8080
export HTTPS_PROXY=http://proxy:8080
# Or lowercase
export http_proxy=http://proxy:8080
export https_proxy=http://proxy:8080
The proxy option works with all commands that make network requests (e.g., list, info, core, addons, download-zap, create-zap-config, offline pack).
Project Structure
zap-downloader/
├── zap_downloader/
│ ├── cli.py # Main CLI entry point
│ ├── types.py # Data models
│ ├── parser.py # XML parsing
│ ├── downloader.py # File download
│ ├── workspace.py # Workspace management
│ └── commands/ # CLI commands
│ ├── core.py
│ ├── addons.py
│ ├── list_versions.py
│ ├── info.py
│ ├── download_zap.py
│ ├── create_config.py
│ ├── create_zap_config.py
│ ├── package.py
│ ├── unpack.py
│ ├── validate.py
│ ├── workspace.py
│ └── daemon.py
└── pyproject.toml
Development
Install Dev Dependencies
pip install -e ".[dev]"
Run Tests
pytest
Type Checking
mypy zap_downloader/
Formatting
black zap_downloader/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zap_downloader-1.0.3.tar.gz.
File metadata
- Download URL: zap_downloader-1.0.3.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2516b022a08487c31c9bcf50af26775d0d0278824aaafe13474e0b455a75d050
|
|
| MD5 |
569252add1acf89a4e3765fdec452771
|
|
| BLAKE2b-256 |
9afc61844153a2bb77f87f309ae2dd08005ad5df462a47d597a080dbd4f5ca26
|
File details
Details for the file zap_downloader-1.0.3-py3-none-any.whl.
File metadata
- Download URL: zap_downloader-1.0.3-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a1722a611c2b868b1707c9302dec7bc2b402954f8dfce126769adbf84a7b879
|
|
| MD5 |
8940b933253b32809898b5cef46acdce
|
|
| BLAKE2b-256 |
44d25a2f34f3301cdd8c97d74f24342c62b927c0fb393c0659a6ad93ecb01654
|