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
# Build Open Suite's own engine add-on, the gate that holds scanner requests,
# into the engine's add-on folder. Needs the engine (fetch-zap.sh) for its
# classes. The version is part of the file's name, so an engine unpacked by an
# earlier build is replaced when the add-on changes: raise it in tools/versions.
set -euo pipefail
DIR="$(cd "$(dirname "$0")/.." && pwd)"
# shellcheck disable=SC1091
. "$DIR/tools/versions"
DEST="${1:-$DIR/engine}"
ZAP="$(ls "$DEST"/zap-*.jar 2>/dev/null | head -1)"
[ -n "$ZAP" ] || { echo "No engine in $DEST: run fetch-zap.sh first" >&2; exit 1; }
JAVAC="javac"; JAR="jar"
if [ -x "$DIR/jdk/bin/javac" ]; then JAVAC="$DIR/jdk/bin/javac"; JAR="$DIR/jdk/bin/jar"; fi
OUT="$DEST/plugin/opensuitegate-release-${OPENSUITE_GATE_VERSION}.zap"
SRC="$DIR/engine-addon"
if [ -f "$OUT" ] && [ -z "$(find "$SRC" -newer "$OUT" -type f | head -1)" ]; then exit 0; fi
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
# The engine's own libraries sit beside its jar; the add-on is compiled against both.
# On Windows Java is handed Windows names: Git Bash does not translate a list joined with ';'.
CPZAP="$ZAP"; CPLIB="$DEST/lib"
case "$(uname -s)" in MINGW*|MSYS*|CYGWIN*) S=';'; CPZAP="$(cygpath -m "$ZAP")"; CPLIB="$(cygpath -m "$DEST/lib")" ;; *) S=':' ;; esac
"$JAVAC" --release 17 -nowarn -d "$tmp" -cp "$CPZAP${S}$CPLIB/*" $(find "$SRC" -name '*.java')
sed "s/@VERSION@/${OPENSUITE_GATE_VERSION}/" "$SRC/ZapAddOn.xml" > "$tmp/ZapAddOn.xml"
rm -f "$DEST"/plugin/opensuitegate-*.zap
"$JAR" cfM "$OUT" -C "$tmp" .
echo "Engine add-on built: $(basename "$OUT")"