Zap cli scans: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „Hier ist die korrigierte Version in **MediaWiki-Syntax** mit korrekten Codeblöcken (``<code>`` oder ``<syntaxhighlight>``): --- == OWASP ZAP Headless-Scan (…“) |
|||
| Zeile 1: | Zeile 1: | ||
| − | + | = 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: | |
| + | |||
| + | <pre> | ||
| + | /usr/share/zaproxy/zap.sh -cmd -quickurl "http://victim.secure.local" -quickout "/tmp/report.html" | ||
| + | </pre> | ||
| + | |||
| + | == Erweiterte Optionen == | ||
| + | |||
| + | === Mehrere Report-Formate === | ||
| + | Generieren Sie HTML, JSON und XML parallel: | ||
<pre> | <pre> | ||
| Zeile 15: | Zeile 27: | ||
</pre> | </pre> | ||
| − | === Scan-Typen | + | === Unterschiedliche Scan-Typen === |
| + | |||
{| class="wikitable" | {| class="wikitable" | ||
| − | ! Scan-Typ !! Befehl | + | ! Scan-Typ !! Befehl !! Beschreibung |
|- | |- | ||
| − | | | + | | '''Spider''' || |
<pre> | <pre> | ||
/usr/share/zaproxy/zap.sh -cmd -spider \ | /usr/share/zaproxy/zap.sh -cmd -spider \ | ||
| Zeile 25: | Zeile 38: | ||
-quickout "/tmp/spider_report.html" | -quickout "/tmp/spider_report.html" | ||
</pre> | </pre> | ||
| + | | Crawlt die Website-Struktur | ||
|- | |- | ||
| − | | Aktiver Scan | | + | | '''Aktiver Scan''' || |
<pre> | <pre> | ||
/usr/share/zaproxy/zap.sh -cmd -activescan \ | /usr/share/zaproxy/zap.sh -cmd -activescan \ | ||
-quickurl "http://victim.secure.local" \ | -quickurl "http://victim.secure.local" \ | ||
| − | -quickout "/tmp/ | + | -quickout "/tmp/active_scan.json" |
</pre> | </pre> | ||
| + | | Führt Angriffstests durch | ||
|- | |- | ||
| − | | | + | | '''Kombinierter Scan''' || |
<pre> | <pre> | ||
/usr/share/zaproxy/zap.sh -cmd \ | /usr/share/zaproxy/zap.sh -cmd \ | ||
| Zeile 40: | Zeile 55: | ||
-quickout "/tmp/full_report.html" | -quickout "/tmp/full_report.html" | ||
</pre> | </pre> | ||
| + | | Spider + Aktiver Scan | ||
|} | |} | ||
| − | + | == API-Methode == | |
| − | + | Für maximale Flexibilität: | |
| + | |||
<pre> | <pre> | ||
| + | # ZAP als Daemon starten | ||
/usr/share/zaproxy/zap.sh -daemon -port 8080 -config api.disablekey=true | /usr/share/zaproxy/zap.sh -daemon -port 8080 -config api.disablekey=true | ||
| − | |||
| − | + | # Report per API generieren | |
| − | + | curl "http://localhost:8080/JSON/reports/action/generate/\ | |
| − | curl "http://localhost:8080/JSON/reports/action/generate/ \ | + | ?title=Scan-Report\ |
| − | + | &template=traditional-html\ | |
| − | + | &reportFileName=report.html\ | |
| − | + | &reportDir=/tmp" | |
| − | |||
</pre> | </pre> | ||
| − | + | == Tipps == | |
| − | * Für | + | * Für interne URLs: <code>-config network.trustAllCerts=true</code> |
| − | * | + | * Template-Anpassung: <code>-config report.template=modern</code> |
| − | + | * Speicherlimit: <code>-Xmx4096m</code> (4GB RAM) | |
| − | |||
| − | |||
| − | |||
| − | + | == Siehe auch == | |
| − | + | * [[OWASP ZAP|Offizielle OWASP ZAP Dokumentation]] | |
| − | + | * [[Penetrationstesting|Security Testing Guidelines]] | |
| − | |||
| − | |||
Version vom 16. Mai 2025, 14:42 Uhr
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)