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 a single-file, self-contained Open Suite AppImage for Linux.
#
# The result (dist/opensuite-x86_64.appimage) bundles a Java runtime and the scan
# engine, so a user downloads one file and runs it, with nothing installed, no
# Java, no terminal. It works across distributions.
#
# Needs: a JDK (for jpackage + jdeps), and internet the first time (to fetch
# appimagetool). Produces the AppImage from the self-contained release jar.
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
source "$DIR/tools/versions"
# The AppImage runtime must be built from the pinned portable JDK (old glibc),
# or the packaged app only starts on machines as new as the build host (it quits
# before showing a window on older distributions). Fetch it if missing, then use
# it for the release build below and for jlink, jpackage and the module list.
[ -x "$DIR/jdk/bin/javac" ] || ./fetch-jdk.sh
export JAVA_HOME="$DIR/jdk"
export PATH="$DIR/jdk/bin:$PATH"
echo ">> building the self-contained release jar"
./release.sh
JAR="$(ls -t dist/opensuite_*.jar | head -1)"
JARNAME="$(basename "$JAR")"
# appimagetool is executed as part of this build, so it is fetched pinned to
# the version and sha256 in tools/versions and cached per version under
# ~/.cache/opensuite. An unverified download is never run.
AIT="$HOME/.cache/opensuite/appimagetool-x86_64-${APPIMAGETOOL_VERSION}.AppImage"
if [ ! -x "$AIT" ]; then
echo ">> fetching appimagetool ${APPIMAGETOOL_VERSION}"
mkdir -p "$(dirname "$AIT")"
curl -fsSL -o "$AIT" "https://github.com/AppImage/appimagetool/releases/download/${APPIMAGETOOL_VERSION}/appimagetool-x86_64.AppImage"
got="$(sha256sum "$AIT" | cut -d' ' -f1)"
if [ "$got" != "$APPIMAGETOOL_SHA256" ]; then
echo "appimagetool sha256 mismatch:" >&2
echo " expected $APPIMAGETOOL_SHA256 (update the pin in tools/versions?)" >&2
echo " got $got" >&2
rm -f "$AIT"
exit 1
fi
chmod +x "$AIT"
fi
echo ">> assembling a portable Java runtime from the bundled JDK"
rm -rf build/otin build/appimage build/runtime AppDir
mkdir -p build/otin
cp "$JAR" build/otin/
# The runtime must keep bin/java and a full module set: the bundled scan engine
# runs as its own Java process (launched with java.home/bin/java), and jpackage's
# default runtime strips bin/java and trims modules, which breaks it. The portable
# Temurin JDK (old glibc) ships without jmods, so jlink cannot repackage it; copy
# it as the runtime image instead and drop only parts not needed at run time.
cp -a jdk build/runtime
rm -rf build/runtime/lib/src.zip build/runtime/include build/runtime/man \
build/runtime/demo build/runtime/sample build/runtime/jmods
echo ">> jpackage: self-contained app image using that runtime"
jpackage --type app-image --name OpenSuite \
--input build/otin --main-jar "$JARNAME" --main-class opensuite.ui.Main \
--icon src/opensuite/ui/icons/opensuite_256.png \
--runtime-image build/runtime --java-options "-XX:MaxRAMPercentage=50 -XX:+UseG1GC -Xms64m -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=30 -XX:G1PeriodicGCInterval=15000" \
--dest build/appimage
echo ">> assembling AppDir (with a scale-probing launcher)"
rm -rf AppDir
mkdir -p AppDir/usr
cp -a build/appimage/OpenSuite/. AppDir/usr/
cp src/opensuite/ui/icons/opensuite_256.png AppDir/opensuite.png
# The browser is part of the product: a scan crawls with it, logins are recorded
# in it, and Open browser starts it. It travels inside the AppImage, with the
# driver that steers it, so all of that works on first start and without a
# network. Open Suite looks for browser/ beside the folder its jar is in.
if [ ! -x browser/chrome-linux/chrome ] || [ ! -x browser/chromedriver ]; then
echo "browser/ is missing or incomplete. Run ./fetch-browser.sh first." >&2
exit 1
fi
echo ">> adding the browser"
mkdir -p AppDir/usr/lib/browser
cp -a browser/chrome-linux AppDir/usr/lib/browser/
cp -a browser/chromedriver AppDir/usr/lib/browser/
# The snapshot's programs carry their debugging tables, a third of their size
# and of no use at run time.
if command -v strip >/dev/null 2>&1; then
strip --strip-unneeded AppDir/usr/lib/browser/chrome-linux/chrome AppDir/usr/lib/browser/chromedriver 2>/dev/null || true
fi
# The launcher picks a HiDPI scale with a quick headless probe and sets it before
# the real JVM starts. This matters inside an AppImage: the in-app relaunch the
# plain jar uses to apply the scale would tear down the AppImage mount and kill
# the app, so here the scale is chosen up front instead.
cat > AppDir/AppRun <<'RUN'
#!/bin/sh
HERE="$(dirname "$(readlink -f "$0")")"
# Java's X11 toolkit assumes a reparenting window manager. Under the tiling
# and wlroots-family compositors below, Swing windows paint blank white unless
# this hint is set. Set it only when the caller has not set it themselves; it
# is harmless where it is not needed.
if [ -z "${_JAVA_AWT_WM_NONREPARENTING+x}" ]; then
for d in $(printf '%s' "${XDG_CURRENT_DESKTOP:-}" | tr ':' ' ' | tr '[:upper:]' '[:lower:]'); do
case "$d" in
sway|i3|hyprland|river|dwl|bspwm|labwc) export _JAVA_AWT_WM_NONREPARENTING=1; break ;;
esac
done
fi
# The scale is the one set by hand: OPENSUITE_SCALE, a sun.java2d.uiScale of
# the caller's own in JAVA_TOOL_OPTIONS, or the one chosen in Settings > User
# interface > Display > Scaling. With none of these nothing is set here, and
# the display's own setting applies.
case "${JAVA_TOOL_OPTIONS:-}" in
*sun.java2d.uiScale*) SCALE="" ;;
*) SCALE="${OPENSUITE_SCALE:-$("$HERE/usr/bin/OpenSuite" --print-scale 2>/dev/null | tr -d '[:space:]')}" ;;
esac
case "$SCALE" in
''|*[!0-9.]*) ;;
*) export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+$JAVA_TOOL_OPTIONS }-Dsun.java2d.uiScale=$SCALE -Dopensuite.scaled=$SCALE" ;;
esac
# Settings > Suite > Performance > Maximum memory usage: a custom limit is left
# in this file as a number of megabytes. Without it, half of system memory.
if [ -r "$HOME/.opensuite/memory-mb" ]; then
MB="$(tr -cd '0-9' < "$HOME/.opensuite/memory-mb" | cut -c1-7)"
if [ -n "$MB" ] && [ "$MB" -ge 256 ]; then export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+$JAVA_TOOL_OPTIONS }-Xmx${MB}m"; fi
fi
# The system allocator otherwise keeps a pool of memory per thread, hundreds of megabytes never given back.
export MALLOC_ARENA_MAX="${MALLOC_ARENA_MAX:-2}"
exec "$HERE/usr/bin/OpenSuite" "$@"
RUN
chmod +x AppDir/AppRun
cat > AppDir/OpenSuite.desktop <<'DESK'
[Desktop Entry]
Type=Application
Name=Open Suite
Comment=Open web security testing proxy
Exec=OpenSuite
Icon=opensuite
Categories=Development;Network;Security;
Terminal=false
DESK
# The small program at the head of every AppImage. appimagetool would fetch it
# afresh on each run, unpinned, and a build fails whenever that fetch does. It
# is fetched once instead, checked against the sha256 in tools/versions, and
# kept beside appimagetool, so a release always carries the same known bytes.
AIR="$HOME/.cache/opensuite/appimage-runtime-x86_64-${APPIMAGE_RUNTIME_SHA256:0:16}"
if [ ! -s "$AIR" ]; then
echo ">> fetching the AppImage runtime"
mkdir -p "$(dirname "$AIR")"
curl -fsSL -o "$AIR" "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64"
fi
got="$(sha256sum "$AIR" | cut -d' ' -f1)"
if [ "$got" != "$APPIMAGE_RUNTIME_SHA256" ]; then
echo "AppImage runtime sha256 mismatch:" >&2
echo " expected $APPIMAGE_RUNTIME_SHA256 (update the pin in tools/versions?)" >&2
echo " got $got" >&2
rm -f "$AIR"
exit 1
fi
echo ">> packing the AppImage"
# Packed beside the old file and then moved over it in one step, so a copy of
# the old one that is running keeps the file it was started from.
rm -f dist/.opensuite-x86_64.appimage.new
ARCH=x86_64 "$AIT" --appimage-extract-and-run --runtime-file "$AIR" AppDir dist/.opensuite-x86_64.appimage.new
mv -f dist/.opensuite-x86_64.appimage.new dist/opensuite-x86_64.appimage
echo
echo "Built dist/opensuite-x86_64.appimage"
echo "Run it with: chmod +x dist/opensuite-x86_64.appimage && ./dist/opensuite-x86_64.appimage"