Zap cli scans

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

OWASP ZAP Headless-Scan ohne Docker

Einführung

OWASP ZAP (Zed Attack Proxy) ist ein weit verbreiteter Open-Source-Sicherheitsscanner für Webanwendungen. Der Headless-Modus ermöglicht automatisierte Scans ohne grafische Oberfläche, ideal für:

  • Integration in CI/CD-Pipelines
  • Regelmäßige Sicherheitstests
  • Automatisierte Berichterstellung

Grundlegender Scan

Der einfachste Befehl für einen schnellen Scan mit HTML-Report:

/usr/share/zaproxy/zap.sh -cmd -quickurl "http://victim.secure.local" -quickout "/tmp/report.html"

Erweiterte Optionen

Mehrere Report-Formate

Generieren Sie HTML, JSON und XML parallel:

/usr/share/zaproxy/zap.sh -cmd -quickurl "http://victim.secure.local" \
  -quickout "/tmp/report.html" \
  -quickout "/tmp/report.json" \
  -quickout "/tmp/report.xml"

Unterschiedliche Scan-Typen

Scan-Typ Befehl Beschreibung
Spider
/usr/share/zaproxy/zap.sh -cmd -spider \
  -quickurl "http://victim.secure.local" \
  -quickout "/tmp/spider_report.html"
Crawlt die Website-Struktur
Aktiver Scan
/usr/share/zaproxy/zap.sh -cmd -activescan \
  -quickurl "http://victim.secure.local" \
  -quickout "/tmp/active_scan.json"
Führt Angriffstests durch
Kombinierter Scan
/usr/share/zaproxy/zap.sh -cmd \
  -quickurl "http://victim.secure.local" \
  -quickadv \
  -quickout "/tmp/full_report.html"
Spider + Aktiver Scan

API-Methode

Für maximale Flexibilität:

# ZAP als Daemon starten
/usr/share/zaproxy/zap.sh -daemon -port 8080 -config api.disablekey=true

# Report per API generieren
curl "http://localhost:8080/JSON/reports/action/generate/\
?title=Scan-Report\
&template=traditional-html\
&reportFileName=report.html\
&reportDir=/tmp"

Tipps

  • Für interne URLs: -config network.trustAllCerts=true
  • Template-Anpassung: -config report.template=modern
  • Speicherlimit: -Xmx4096m (4GB RAM)