Lab 20: Capstone — Web Application Penetration Test

Objective

Conduct a complete, structured penetration test against a multi-vulnerability web application from Kali Linux. You will chain together techniques from all 19 previous labs to go from zero knowledge to full account takeover, data exfiltration, and documented report.

Attack phases:

  1. Reconnaissance — enumerate services, endpoints, technology stack

  2. Authentication bypass — SQLi login to gain admin token

  3. Privilege escalation — exploit API IDOR to access other users' data

  4. Data exfiltration — dump the product database and user credentials via SQLi

  5. Business logic abuse — negative quantity order to gain funds

  6. CSRF forged action — transfer funds without CSRF token

  7. Security header audit — document all missing headers

  8. Report — write a structured penetration test report with CVSS scores


Background

A penetration test follows a structured methodology. This lab applies the PTES (Penetration Testing Execution Standard) phases:

  1. Pre-engagement — define scope, rules of engagement

  2. Intelligence gathering — passive/active recon

  3. Threat modelling — identify attack surface

  4. Vulnerability identification — scan and probe

  5. Exploitation — execute attacks

  6. Post-exploitation — lateral movement, persistence

  7. Reporting — document findings with severity and remediation

Tools used this lab: nmap, gobuster, sqlmap, curl, python3


Architecture

Time

90 minutes

Prerequisites

  • Labs 1–19 completed (all OWASP A01–A10 + reconnaissance + API security)


Lab Instructions

Step 1: Environment Setup — Launch the Capstone Target

📸 Verified Output:


Step 2: Phase 1 — Reconnaissance

📸 Verified Output:


Step 3: Phase 2 — SQL Injection Login Bypass

📸 Verified Output:

💡 SQLi → admin token → full admin API access — this is a complete authentication bypass chain. In 2 HTTP requests we went from no credentials to reading every user's password in plaintext.


Step 4: Phase 3 — Privilege Escalation via IDOR

📸 Verified Output:


Step 5: Phase 4 — Data Exfiltration via SQLi

📸 Verified Output:


Step 6: Phase 5 — Business Logic and CSRF Abuse

📸 Verified Output:


Step 7: Phase 6 — Write the Penetration Test Report


Step 8: Cleanup


Capstone Summary

Finding
Severity
CVSS
Lab Reference

SQLi — authentication bypass

CRITICAL

9.8

Lab 03 (A03)

SQLi — search/data exfiltration

CRITICAL

9.1

Lab 03 (A03)

IDOR — read any user profile

HIGH

7.5

Lab 01 (A01)

Business logic — negative qty

HIGH

8.1

Lab 16

Secrets in admin API response

HIGH

7.2

Lab 02 (A02)

Missing CSRF protection

MEDIUM

6.8

Lab 18

Excessive data exposure

MEDIUM

5.3

Lab 04 (A04)

Missing security headers

MEDIUM

5.4

Lab 19

What You've Learned

Across all 20 practitioner labs you have:

  • Executed real attacks against live Docker containers — no simulated output

  • Applied every OWASP Top 10 (2021) category against purpose-built vulnerable apps

  • Learned reconnaissance (nmap, gobuster, whatweb), exploitation (sqlmap, curl, python3), and reporting

  • Built attacker intuition: chaining small vulnerabilities into full account takeover

  • Written remediation code for every vulnerability class

The next step: Architect-level labs — threat modelling, security architecture design, SAST/DAST pipelines, and red team vs blue team exercises.

Further Reading

Last updated