Vollständige Testing-Suite für OWASP Top 10 Schwachstellen mit automatisierten und manuellen Testing-Workflows
Dieses Lab bietet eine professionelle Pen-Testing-Umgebung für Webanwendungen mit Fokus auf:
- ✅ Automatisierte Vulnerability Scans (ZAP, Nikto, sqlmap)
- ✅ Manuelle Testing-Workflows (Burp Suite)
- ✅ Authentifizierungs-Support (JWT & Session-based)
- ✅ Strukturierte Dokumentation & Reporting
- Quick Start
- Was wird getestet?
- Tools & Testing-Methodik
- Automatisiertes Scanning
- Authentifizierung
- Ergebnisse & Reports
- Tool-Auswahl & Begründung
# Docker & Docker Compose
docker --version
docker-compose --version
# WSL/Linux mit installierten Tools
curl --version
jq --version# Docker Container hochfahren (Juice Shop + OWASP ZAP)
docker-compose up -d
# Prüfen ob alles läuft
docker-compose psErwartete Container:
juice-shopauf Port 3333 (Test-Target)owasp-zapauf Port 8889 (Web UI) und 8888 (Proxy)
# Automatisierter Scan gegen Juice Shop
cd pentest-lab
chmod +x scripts/automated-scan.sh
./scripts/automated-scan.sh
# Scan dauert ca. 15-20 Minuten# Scan-Summary (zeigt alle Findings)
cat findings/scan_*/00-SCAN-SUMMARY.md
# ZAP HTML Report (im Browser öffnen)
# Windows: findings\scan_TIMESTAMP\zap\baseline-scan.html
# Linux: findings/scan_TIMESTAMP/zap/baseline-scan.html| OWASP Kategorie | Was wird getestet | Tools |
|---|---|---|
| A01: Broken Access Control | IDOR, fehlende Authorization | ZAP, Burp, manuelle Tests |
| A02: Cryptographic Failures | Unverschlüsselte Daten, schwache Krypto | ZAP, manuelle Tests |
| A03: Injection | SQL Injection, Command Injection | sqlmap, ZAP |
| A04: Insecure Design | CORS Misconfiguration, fehlende Security Headers | Custom Scripts, ZAP |
| A05: Security Misconfiguration | Default Credentials, unnötige Features | Nikto, ZAP |
| A06: Vulnerable Components | Veraltete Libraries, bekannte CVEs | Nikto, ZAP |
| A07: Auth & Session Management | Session Fixation, schwache Tokens | ZAP, Burp, manuelle Tests |
| A08: Software & Data Integrity | Fehlende Integrity Checks | ZAP, manuelle Tests |
| A09: Security Logging | Fehlende Logs, unzureichendes Monitoring | Manuelle Tests |
| A10: SSRF | Server-Side Request Forgery | ZAP, manuelle Tests |
- XSS (Reflected, Stored, DOM-based) → ZAP, Burp
- SQL Injection → sqlmap (automatisch)
- CORS Misconfiguration → Custom Script
- Security Headers (CSP, HSTS, X-Frame-Options) → Custom Script
- Clickjacking → Manuelle Tests, ZAP
- DOM-Clobbering → Manuelle Tests
- Authentication Bypass → Mit Auth-Support testbar
- IDOR (Insecure Direct Object References) → Manuelle Tests, Burp
- Port Scanning (nur basic nmap für Context)
- Network-Level Attacks
- Physical Security
- Social Engineering
Was es tut:
- Automatischer Vulnerability Scanner
- Intercepting Proxy (wie Burp)
- Spider/Crawler für alle Endpoints
- Findet: XSS, SQL Injection, CORS-Fehler, fehlende Security Headers
Wann verwenden:
- ✅ Erster automatischer Scan
- ✅ Baseline-Findings schnell finden
- ✅ Regression-Testing nach Fixes
Beispiel:
# Wird automatisch vom Script ausgeführt
# Oder manuell:
docker exec owasp-zap zap-baseline.py \
-t http://juice-shop:3000 \
-r reports/scan.htmlWas es tut:
- Web Server Scanner
- Findet: Veraltete Software, Konfigurationsfehler, bekannte Vulnerabilities
- Checkt: robots.txt, gefährliche Files, Server-Banner
Wann verwenden:
- ✅ Server-Konfiguration prüfen
- ✅ Bekannte CVEs finden
- ✅ Dangerous Files aufspüren (backup files, .git, etc.)
Beispiel:
nikto -h http://localhost:3333Was es tut:
- Automatisches SQL Injection Testing
- Testet: GET/POST Parameter, Cookies, Headers
- Kann: DB extrahieren, OS Commands ausführen (wenn vuln)
Wann verwenden:
- ✅ Jedes Input-Feld testen
- ✅ Search-Funktionen, Login-Forms
- ✅ API-Endpoints mit Parametern
Beispiel:
sqlmap -u "http://localhost:3333/rest/products/search?q=test" \
--batch --smartWas sie tun:
- Security Headers Check: Prüft CSP, HSTS, X-Frame-Options, etc.
- CORS Testing: Testet verschiedene Origins auf Misconfiguration
- Authentication Manager: Automatisches Login für authenticated Scans
Das Haupt-Script führt alle Tools systematisch aus:
./scripts/automated-scan.sh| Phase | Tool | Dauer | Was passiert |
|---|---|---|---|
| 0 | auto-login.sh | 5s | Login + Token-Extraktion (optional) |
| 1 | curl | 2s | Security Headers Check |
| 2 | curl | 5s | CORS Misconfiguration Testing |
| 3 | ZAP Baseline | 5-10 min | Automatischer Vulnerability Scan |
| 4 | ZAP Full | 20-30 min | Aggressiver Deep-Scan (optional) |
| 5 | Nikto | 3-5 min | Web Server Vulnerability Scan |
| 6 | gobuster | 5-10 min | Directory/File Enumeration |
| 7 | sqlmap | 10-15 min | SQL Injection Testing (mehrere Endpoints) |
| 8 | nmap | 1-2 min | Port Scan (für Context) |
Gesamt: ~15-20 Minuten (ohne Full ZAP Scan)
# Target anpassen
TARGET_URL=https://app.example.com ./scripts/automated-scan.sh
# Mit Authentifizierung
TARGET_URL=https://app.example.com \
AUTH_CONFIG=./auth-config.production.json \
./scripts/automated-scan.sh
# Ohne Authentifizierung (Standard)
USE_AUTH=false ./scripts/automated-scan.sh# Nur bestimmte Phasen ausführen
./scripts/all-headers.sh # Nur Headers
./scripts/cors-test.sh # Nur CORS
./scripts/quick-scan.sh # Headers + CORS + ZAP BaselineDie meisten echten Webanwendungen haben geschützte Bereiche die Login erfordern:
- User Profiles, Dashboards
- Admin Panels
- API Endpoints mit Authorization
- Order/Basket Funktionalität
Ohne Auth: Scanner sehen nur öffentliche Seiten (Login-Form, Landing Page)
Mit Auth: Scanner können alle geschützten Endpoints testen
Juice Shop und andere Test-Targets funktionieren AUCH OHNE AUTH!
- ✅ Wenn keine
auth-config.jsonvorhanden → normaler unauthenticated Scan - ✅ Wenn Auth fehlschlägt → Script warnt und macht trotzdem weiter
- ✅
USE_AUTH=false→ Auth komplett deaktivieren
# Für JWT-basierte APIs (z.B. moderne SPAs)
cp auth-config.example.json auth-config.json
# Für Session-basierte Auth (z.B. Django, PHP)
cp auth-config.session.example.json auth-config.json
# Für Juice Shop (Beispiel)
cp auth-config.juiceshop.json auth-config.json{
"auth_type": "jwt",
"login": {
"url": "/api/auth/login",
"username_field": "email",
"password_field": "password"
},
"response": {
"token_path": ".access_token"
},
"verify": {
"url": "/api/user/me"
},
"credentials": {
"username": "test@example.com",
"password": "YourTestPassword"
}
}Wichtig: Details siehe AUTH-CONFIG-GUIDE.md
# Manuell testen ob Login funktioniert
TARGET_URL=https://your-app.com \
AUTH_CONFIG=./auth-config.json \
./scripts/auto-login.sh
# Bei Erfolg:
✅ Authentication successful
✅ Token saved to: ./findings/.auth-token
✅ Testing authenticated endpoints...# Script erkennt automatisch auth-config.json
./scripts/automated-scan.sh
# Oder explizit:
TARGET_URL=https://your-app.com \
AUTH_CONFIG=./auth-config.json \
./scripts/automated-scan.sh# Im Scan-Summary nachschauen
cat findings/scan_*/00-SCAN-SUMMARY.md
# Sollte zeigen:
**Authentication:** ✅ JWT Token
> ℹ️ **Auth Info:** JWT authentication configured (token available)
# Oder:
**Authentication:** ❌ Disabled # Bei unauthenticated Scan| Type | Beispiel | Konfiguration |
|---|---|---|
| JWT / Bearer Token | REST APIs, SPAs | "auth_type": "jwt" |
| Session Cookies | Django, Rails, PHP | "auth_type": "session" |
| OpenID Connect | Keycloak, Auth0 | "auth_type": "jwt" |
Nach einem Scan findest du alle Ergebnisse in:
findings/
└── scan_20251110_043015/ # Timestamped Scan-ID
├── 00-SCAN-SUMMARY.md # ⭐ START HIER
├── zap/
│ ├── baseline-scan.html # ⭐ ZAP HTML Report (öffnen im Browser)
│ ├── baseline-scan.md
│ └── baseline-scan.json
├── nikto/
│ ├── nikto-scan.html
│ └── nikto-scan.txt
├── sqlmap/
│ ├── _rest_products_search_q_test/
│ └── _rest_user_login/
├── gobuster/
│ └── directories.txt
└── manual/
├── 01-security-headers.txt
├── 02-cors-analysis.txt
└── nmap-scan.txt
cat findings/scan_*/00-SCAN-SUMMARY.mdZeigt:
- Alle Scan-Phasen mit Status
- Auth-Status
- Report-Locations
- Next Steps
# Windows
start findings/scan_TIMESTAMP/zap/baseline-scan.html
# Linux/Mac
xdg-open findings/scan_TIMESTAMP/zap/baseline-scan.htmlZeigt:
- Alle gefundenen Vulnerabilities
- Severity-Rating (High/Medium/Low)
- URLs + Request/Response Details
- CWE/OWASP Mapping
cat findings/scan_*/manual/01-security-headers.txtZeigt:
- ❌ Fehlende Headers (CSP, HSTS, X-Frame-Options)
- ✅ Vorhandene Headers
- 💡 Empfehlungen
cat findings/scan_*/manual/02-cors-analysis.txtZeigt:
- Access-Control-Allow-Origin Werte
- Tests mit verschiedenen Origins
- Wildcard (*) Misconfiguration
ls findings/scan_*/sqlmap/
cat findings/scan_*/sqlmap/*/logZeigt:
- Welche Endpoints getestet wurden
- Gefundene SQL Injection Points
- Injizierbare Parameter
Siehe: TESTING-METHODOLOGY.md für detaillierte Anleitung
Typische ZAP-Findings:
| Finding | Severity | Was bedeutet das? |
|---|---|---|
| CORS Misconfiguration | High | Access-Control-Allow-Origin: * → Jede Website kann API aufrufen |
| Missing CSP | High | Keine Content-Security-Policy → XSS schwerer zu verhindern |
| Dangerous JS Functions | Medium | eval(), innerHTML → Potenzielle XSS Injection Points |
| Cross-Domain Script | Low | External Scripts ohne SRI → Supply-Chain Risk |
| Tool | Stärken | Schwächen | Warum gewählt |
|---|---|---|---|
| OWASP ZAP | Kostenlos, gute OWASP-Coverage, automatisiert | Manchmal false positives | Industry Standard, Docker-Support, scriptable |
| Burp Suite | Beste manuelle Testing-Features, Repeater | Community = limited | Gold-Standard für manuelles Testing |
| sqlmap | Beste SQL Injection Detection, Auto-Exploitation | Langsam, kann DB crashen | Spezialist für SQLi, findet komplexe Injections |
| Nikto | Schnell, kennt viele Server-Vulns | Viele false positives | Quick-Win für Server-Config |
| Custom Scripts | Spezifisch für unsere Tests (CORS, Headers) | Kein Tool-Support | Genau das was wir brauchen, simpel |
| Feature | OWASP ZAP | Burp Suite Community |
|---|---|---|
| Preis | Kostenlos (Open Source) | Kostenlos (limited) |
| Automatischer Scan | ✅ Sehr gut | ❌ Nur Pro |
| Manual Testing | ✅ Exzellent | |
| Docker Integration | ✅ Ja | ❌ Nein |
| CI/CD Integration | ✅ Einfach | |
| Learning Curve | Niedrig | Mittel |
| Repeatability | ✅ Scripts |
Unsere Strategie:
- 🤖 ZAP für automatisierte Baseline-Scans
- 👤 Burp für tiefes manuelles Testing und Exploitation
- 🎯 sqlmap als Spezialist für SQL Injection
| Tool | Warum nicht? |
|---|---|
| Nessus/OpenVAS | Fokus auf Network-Scanning, nicht Web-Apps |
| Metasploit | Exploitation-Framework, über Scope hinaus |
| Acunetix/Netsparker | Commercial, nicht nötig für Lernzwecke |
| Wireshark | Network-Analysis, nicht Web-App Testing |
| Dokument | Beschreibung |
|---|---|
| README.md | Dieser File - Overview und Quick Start |
| TESTING-METHODOLOGY.md | Detaillierte Testing-Anleitung, Schritt-für-Schritt |
| QUICK-START.md | Schnelleinstieg für Eilige |
| AUTH-CONFIG-GUIDE.md | Komplettes Handbuch zur Auth-Konfiguration |
| AUTH-SCRIPT-TEST-RESULTS.md | Test-Ergebnisse mit Juice Shop & TransactMail |
| AUTHENTICATION-GUIDE.md | Theoretische Grundlagen zu Auth-Testing |
- OWASP Top 10 2021
- OWASP Juice Shop - Unsere Test-App
- PortSwigger Web Security Academy - Exzellente Labs
NIEMALS diese Tools auf fremden Websites/Systemen verwenden ohne explizite schriftliche Genehmigung!
Legal testen:
- ✅ OWASP Juice Shop (unser Lab)
- ✅ Eigene Webanwendungen
- ✅ Test-Environments mit Genehmigung
- ✅ Bug-Bounty-Programme (nach deren Regeln)
- ❌ Production-Systeme ohne Genehmigung
- ❌ Fremde Websites zum "üben"
sqlmap & ZAP Full Scan können:
- Server belasten (viele Requests)
- Logs füllen
- WAFs triggern
- In seltenen Fällen: Instabilität verursachen
Empfehlung:
- Start mit Baseline-Scan
- Full-Scans nur auf Test-Systemen
- Bei Production: Mit DevOps/SysAdmin absprechen
Pull Requests willkommen! Besonders für:
- Neue Testing-Scripts
- Zusätzliche Auth-Patterns
- Verbesserte Dokumentation
- Bug-Fixes
MIT License - Siehe LICENSE File
Happy Hacking! 🎯
Remember: With great power comes great responsibility. Test ethically!