A free, open-source alternative to Burp Suite: an intercepting proxy and web app security testing suite with Repeater, Intruder, Collaborator and a built-in OWASP ZAP scanner. Linux, AGPL-3.0.
Java application-securityappsecbug-bountyburp-alternativeburp-suitedasthttp-proxyinfosecintercepting-proxyjavaowaspowasp-zappenetration-testingpentestingsecuritysecurity-toolsvulnerability-scannerweb-application-securityweb-security
#!/usr/bin/env bash
# Download the OWASP ZAP engine that Open Suite drives as its crawl + audit backend.
#
# Open Suite runs ZAP (Apache 2.0, by the ZAP dev team / Checkmarx) with NO user
# interface, purely as a headless scan engine on the loopback. Nothing of ZAP is
# shown to the user; its crawler and active scanner power Open Suite's own UI. See
# CREDITS.md for attribution.
#
# This fetches the pinned version into engine/. Updating to a new ZAP release is
# just: bump ZAP_VERSION in tools/versions, re-run this. The Core package is used
# (no bundled JRE) because Open Suite already runs on a JVM.
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
DEST="$DIR/engine"
source "$DIR/tools/versions"
VER="${ZAP_VERSION}"
TAG="v${VER}"
URL="https://github.com/zaproxy/zaproxy/releases/download/${TAG}/ZAP_${VER}_Core.zip"
check() { # <file> <expected sha256>
local got
got="$( { sha256sum "$1" 2>/dev/null || shasum -a 256 "$1"; } | cut -d' ' -f1)"
if [ "$got" != "$2" ]; then
echo "sha256 mismatch for $1:" >&2
echo " expected $2 (update the pin in tools/versions?)" >&2
echo " got $got" >&2
exit 1
fi
}
echo "Installing pinned ZAP engine ${TAG} (edit tools/versions to change)..."
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
echo "Downloading $URL ..."
curl -L --fail -o "$tmp/zap.zip" "$URL"
check "$tmp/zap.zip" "$ZAP_SHA256"
# unzip is not on every machine; Windows' or Python's own unpacker does the same job.
if command -v unzip >/dev/null 2>&1; then
unzip -q "$tmp/zap.zip" -d "$tmp"
elif command -v cygpath >/dev/null 2>&1; then
powershell -NoProfile -Command "\$ProgressPreference='SilentlyContinue'; Expand-Archive -Force '$(cygpath -w "$tmp/zap.zip")' '$(cygpath -w "$tmp")'"
else
python3 -m zipfile -e "$tmp/zap.zip" "$tmp"
fi
# The zip contains a single top-level ZAP_<ver>/ directory; flatten into engine/.
inner="$(ls -d "$tmp"/ZAP_* 2>/dev/null | head -1)"
[ -n "$inner" ] || inner="$(ls -d "$tmp"/*/ 2>/dev/null | head -1)"
[ -n "$inner" ] || { echo "Unexpected archive layout" >&2; exit 1; }
rm -rf "$DEST"; mkdir -p "$DEST"
cp -a "$inner"/. "$DEST"/
# Keep only the add-ons Open Suite actually drives (active + passive scan rules, the
# spider, and the required infrastructure) and drop the rest, so the bundled engine
# stays small. A clean checkout reproduces the exact engine the release ships.
KEEP="ascanrules ascanrulesBeta pscan pscanrules pscanrulesBeta spider spiderAjax selenium retire oast directorylistv1 commonlib network database callhome replacer"
for f in "$DEST"/plugin/*.zap; do
[ -e "$f" ] || continue
name="$(basename "$f" | sed -E 's/-(release|beta|alpha)-.*//')"
keep=0
for k in $KEEP; do [ "$name" = "$k" ] && keep=1; done
[ "$keep" = "0" ] && rm -f "$f"
done
# The AJAX spider (JavaScript-rendering crawl) and its Selenium backend are not
# in the Core package, so fetch them from the ZAP add-on marketplace. spiderAjax
# needs a newer commonlib than Core ships, so replace commonlib too. Versions are
# pinned in tools/versions and must stay compatible with ZAP_VERSION.
EXT="https://github.com/zaproxy/zap-extensions/releases/download"
fetch_addon() { # <id> <version> <quality> <sha256>
local id="$1" ver="$2" q="$3" sha="$4"
rm -f "$DEST"/plugin/${id}-*.zap
echo "Fetching add-on ${id} ${q} ${ver}..."
curl -L --fail -o "$tmp/${id}.zap" "$EXT/${id}-v${ver}/${id}-${q}-${ver}.zap"
check "$tmp/${id}.zap" "$sha"
mv "$tmp/${id}.zap" "$DEST/plugin/${id}-${q}-${ver}.zap"
}
fetch_addon commonlib "${ZAP_ADDON_COMMONLIB}" release "${ZAP_ADDON_COMMONLIB_SHA256}"
fetch_addon selenium "${ZAP_ADDON_SELENIUM}" release "${ZAP_ADDON_SELENIUM_SHA256}"
fetch_addon spiderAjax "${ZAP_ADDON_SPIDERAJAX}" release "${ZAP_ADDON_SPIDERAJAX_SHA256}"
# Beta scan-rule packs: many more active + passive checks than the release packs.
fetch_addon ascanrulesBeta "${ZAP_ADDON_ASCANRULES_BETA}" beta "${ZAP_ADDON_ASCANRULES_BETA_SHA256}"
fetch_addon pscanrulesBeta "${ZAP_ADDON_PSCANRULES_BETA}" beta "${ZAP_ADDON_PSCANRULES_BETA_SHA256}"
# Replacer: puts a scan's session headers on the scanner's requests and no others.
fetch_addon replacer "${ZAP_ADDON_REPLACER}" release "${ZAP_ADDON_REPLACER_SHA256}"
# Logging in with a browser: the authentication add-on and the two it needs.
fetch_addon scripts "${ZAP_ADDON_SCRIPTS}" release "${ZAP_ADDON_SCRIPTS_SHA256}"
fetch_addon zest "${ZAP_ADDON_ZEST}" beta "${ZAP_ADDON_ZEST_SHA256}"
fetch_addon authhelper "${ZAP_ADDON_AUTHHELPER}" beta "${ZAP_ADDON_AUTHHELPER_SHA256}"
# Crawling APIs: definitions, SOAP and GraphQL.
fetch_addon openapi "${ZAP_ADDON_OPENAPI}" beta "${ZAP_ADDON_OPENAPI_SHA256}"
fetch_addon soap "${ZAP_ADDON_SOAP}" beta "${ZAP_ADDON_SOAP_SHA256}"
fetch_addon graphql "${ZAP_ADDON_GRAPHQL}" alpha "${ZAP_ADDON_GRAPHQL_SHA256}"
# Open Suite ships no AI features. The authentication add-on carries an optional
# AI-assisted login; it is taken out of the file altogether, not just left off,
# and the step fails if any of it is still there.
JAVA_BIN="java"
[ -x "$DIR/jdk/bin/java" ] && JAVA_BIN="$DIR/jdk/bin/java"
"$JAVA_BIN" "$DIR/tools/StripAddonAi.java" "$DEST"/plugin/authhelper-*.zap
# The API definitions add-on carries an optional AI import: taken out the same way.
"$JAVA_BIN" "$DIR/tools/StripAddonAi.java" "$DEST"/plugin/openapi-*.zap
JAR="$(ls "$DEST"/zap-*.jar 2>/dev/null | head -1)"
[ -n "$JAR" ] || { echo "No zap jar after unpack" >&2; exit 1; }
# Open Suite's own add-on: the gate that holds scanner requests while a session is restored.
"$DIR/tools/build-gate.sh" "$DEST"
echo "ZAP engine ready: $JAR"
echo "Add-ons: $(ls "$DEST"/plugin/*.zap 2>/dev/null | wc -l)"