SETUP LAB 3

Web/API Testing & Vulnerable Application Setup

Deploy a vulnerable OWASP Juice Shop web app inside local Docker containers, setup Burp Suite Community Edition proxy listeners, configure browser network redirects, and import CA certificates.

Environment
Docker / Burp Suite / Browser
Difficulty
Beginner (Level 2)
Course Module
Web Security Setup
Deliverables
Decrypted HTTPS proxies logs & Docker Container
1. System Architecture & Workflow

The diagram below represents the system architecture and operational data flow routing designed for this project.

Architecture Diagram
2. Part 1: Step-by-Step Action Items & Key Execution Steps
STEP 1

Deploy Vulnerable Web Application Container via Docker

Configure a sandboxed Docker container containing deliberately vulnerable code.

$ sudo apt update && sudo apt install -y docker.io
This command installs the Docker engine on the Linux OS target to virtualization host containers.
PartWhat It Does
aptAdvanced Package Tool — the Debian/Ubuntu package manager for installing, updating, and removing software
updateRefreshes the local package index from remote repositories to get the latest available versions
sudoSuperUser Do — executes the following command with root (administrator) privileges
installDownloads and installs the specified package(s)
-yAutomatically answers "yes" to all confirmation prompts
$ sudo docker run -d -p 3000:3000 --name juiceshop bkimminich/juice-shop
This commands pulls bkimminich/juice-shop from DockerHub and launches it in background container mappings mapping port 3000.
PartWhat It Does
dockerThe Docker container runtime CLI tool
runCreates and starts a new container from an image
-dDetached mode — runs the container in the background
-pPort specification — defines which ports to scan (e.g., -p 80 or -p 1-1000)
--nameAssigns a human-readable name to the container
STEP 2

Configure Browser Proxy Settings

Route all browser HTTP traffic manually to transit the local intercept proxy socket.

  1. Open your web browser (Firefox is recommended for lab work).
  2. Click the hamburger menu in the top-right corner, select Settings, and search for proxy.
  3. Click Settings... under Network Settings.
  4. Select the Manual proxy configuration radio button, and enter:
    • HTTP Proxy: 127.0.0.1
    • Port: 8080
  5. Check the box labeled Also use this proxy for HTTPS, then click OK.
STEP 3

Import Burp Suite Certification Authority Cert

Enable proxy engines to decrypt HTTPS streams without browser cert security errors.

  1. Launch Burp Suite Community Edition. Choose temporary project defaults.
  2. With the proxy active, navigate to http://burpsuite in your browser.
  3. Click the CA Certificate button in the top-right corner to download the cert file (cacert.der).
  4. In Firefox Settings, search for certificates, click View Certificates..., go to Authorities tab, click Import..., select cacert.der, check Trust this CA to identify websites, and click OK.
4. Part 2: Complete Deliverable Assets & Production Templates

To verify proxy routing configuration states, save the validation script below as verify_proxy.sh and execute it:

$ chmod +x verify_proxy.sh && ./verify_proxy.sh
This sets file run execution masks and starts the local loop network checks.
PartWhat It Does
+xAdds execute permission to the file
runCreates and starts a new container from an image

Code Breakdown — Line by Line

Copy
Line 1: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
#!/usr/bin/env bash
Line 2: This is a comment that describes what the code does: "!/usr/bin/env bash". Comments start with # and are ignored by Python.
# verify_proxy.sh - Intercept Proxy Verification Helper
Line 3: This is a comment that describes what the code does: "verify_proxy.sh - Intercept Proxy Verification Helper". Comments start with # and are ignored by Python.
set -euo pipefail
Line 4: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
echo "[*] Verifying Local Application & Proxy status..."
Line 5: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
# Check if Juice Shop container is listening on port 3000
Line 6: This is a comment that describes what the code does: "Check if Juice Shop container is listening on port 3000". Comments start with # and are ignored by Python.
if curl -s -o /dev/null -w "%{{http_code}}" http://localhost:3000 | grep -q "200"; then
Line 7: A conditional check — the code inside this block only runs if the condition evaluates to True.
echo "[OK] Juice Shop container is active and reachable."
Line 8: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
else
Line 9: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
echo "[FAIL] Juice Shop container is unreachable on port 3000."
Line 10: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
exit 1
Line 11: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
fi
Line 12: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
# Check if Burp proxy is active on port 8080
Line 13: This is a comment that describes what the code does: "Check if Burp proxy is active on port 8080". Comments start with # and are ignored by Python.
if ss -tulpn | grep -q ":8080 "; then
Line 14: A conditional check — the code inside this block only runs if the condition evaluates to True.
echo "[OK] Burp Suite proxy listener active on port 8080."
Line 15: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
else
Line 16: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
echo "[WARNING] Burp Suite proxy not active on port 8080."
Line 17: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
fi
Line 18: This line performs an operation as part of the script logic. It contributes to the overall functionality of the program.
✓ Complete Combined Script: All lines explained above are combined into the full script shown below. Copy and paste the entire script into your file.
Copy
#!/usr/bin/env bash
# verify_proxy.sh - Intercept Proxy Verification Helper
set -euo pipefail

echo "[*] Verifying Local Application & Proxy status..."

# Check if Juice Shop container is listening on port 3000
if curl -s -o /dev/null -w "%{{http_code}}" http://localhost:3000 | grep -q "200"; then
  echo "[OK] Juice Shop container is active and reachable."
else
  echo "[FAIL] Juice Shop container is unreachable on port 3000."
  exit 1
fi

# Check if Burp proxy is active on port 8080
if ss -tulpn | grep -q ":8080 "; then
  echo "[OK] Burp Suite proxy listener active on port 8080."
else
  echo "[WARNING] Burp Suite proxy not active on port 8080."
fi
5. Deliverables Summary

Created Files / Templates

  • Docker container instance: juiceshop
  • verify_proxy.sh - Automated environment checker script

Verification Artifacts

  • Screenshots showing intercepted web request metrics in Burp Suite HTTP History panel.
  • Output log of verify_proxy.sh confirming running states.
3. Automation Architecture

The diagram below highlights the automated execution flow pipeline or scripting loop implemented for this module.

Automation Flow Diagram