OWASP for Penetration Testers
Moving beyond compliance checklists. A definitive guide to real-world exploitation, manual techniques, and the attacker mindset mapped to global security standards.
Offensive Focus
- •Manual exploitation flows
- •WAF evasion techniques
- •Logic & IDOR chaining
- •Cloud metadata pivoting
Business Value
- •Translate risk to executives
- •CVSS v4.0 scoring
- •MITRE ATT&CK mapping
- •Actionable remediation
The Core Philosophy
Understanding OWASP beyond the basic vulnerability checklist.
Compliance vs. Pentesting
Compliance frameworks (PCI-DSS, ISO 27001) are about proving due diligence and auditability. They mandate "what" needs to be done. OWASP, from a pentester's perspective, provides the granular "how-to" guidance for secure coding, architecture, and finding vulnerabilities. Pentesting is about finding exploitable flaws and demonstrating real-world impact, not just checking a box.
The Interconnected Ecosystem
- ASVS (Application Security Verification Standard): The "How to Build Secure" blueprint. Used for architecture reviews and scoping depth.
- WSTG (Web Security Testing Guide): The "How to Break" manual. The premier testing resource guiding the exploitation phase.
- OWASP Top 10: The "What to Focus On" metric. Represents the most critical, real-world impact vulnerabilities.
- Cheat Sheets: The "How to Fix" guide. Direct, practical guidance on effective remediation after a vulnerability is confirmed.
Chapter 0:
Lab Environment Setup
Before diving into the intricacies of web application vulnerabilities, establishing a robust, isolated, and legally compliant testing environment is paramount. Here is how you build your practice arena.
0.1 The "Vulnerable by Design" Philosophy
Testing on live production systems without explicit authorization is illegal. Setting up localized, intentionally vulnerable applications ensures you can learn securely and effectively without causing unintended outages.
0.2 Standard Pentesting Architecture
0.3 Essential Arsenal Toolkit
Having the right tools is half the battle. Here are the indispensable components every penetration tester must configure.
- 1 Proxy (Burp Suite / OWASP ZAP) Intercept and modify HTTP/HTTPS requests on the fly. This is your primary weapon for manipulating application logic.
- 2 Browser Plugins (FoxyProxy) Easily toggle your browser's proxy settings to route traffic through Burp Suite or ZAP at the click of a button.
- 3 Wordlists (SecLists) A comprehensive collection of payloads, passwords, and directories essential for fuzzing and enumeration.
Popular Vulnerable Apps
- OWASP Juice Shop Modern web app vulnerabilities (Node.js, Angular).
- DVWA Damn Vulnerable Web Application (PHP/MySQL).
- WebGoat Java-based vulnerable application maintained by OWASP.
0.4 Installation Commands
OWASP Juice Shop Docker Deployment
docker run --rm -p 3000:3000 bkimminich/juice-shop Accessing Juice Shop
http://localhost:3000.
DVWA Docker Deployment
docker run --rm -it -p 8080:80 vulnerables/web-dvwa Access via http://localhost:8080. Log in with admin / password, and click "Create / Reset Database" at the bottom of the setup page.
bWAPP Docker Deployment
docker run -d -p 8081:80 hackersploit/bwapp-docker Access via http://localhost:8081/install.php to initialize the database, then visit http://localhost:8081/login.php (bee / bug).
Configuring Burp Suite CA Certificate
The HTTPS Error
- Installation Steps
- Start Burp Suite and turn Proxy Intercept ON.
- Visit
http://burpin your proxy-configured browser. - Click "CA Certificate" in the top right to download
cacert.der. - Import this certificate into your browser's Trusted Root Certification Authorities.
Chapter 1:
Broken Access Control
The fundamental failure of an application to enforce policies restricting users to their intended permissions. Moving beyond "authenticated equals authorized."
1.1 Architectural Root Cause
Broken Access Control (BAC) isn't just a simple bug; it's a systemic architectural failure. It occurs when the server implicitly trusts client-side input regarding object identifiers or functional requests without performing a rigorous, contextual re-verification of privileges.
1.2 Request Lifecycle & IDOR Exploitation
1.3 Manual Exploitation Workflow
Automated scanners often miss nuanced logic vulnerabilities. The pentester's mindset must be "never trust the client."
- 1 Recon & Mapping Explore the app as unauthenticated, low-privilege, and admin. Identify all IDs (numeric, UUIDs, strings in JWTs).
- 2 Dual-Session Setup Establish two distinct sessions (User A and User B) in Burp Suite to easily swap contexts.
- 3 Systematic Tampering Capture User A's request, swap the ID parameter to User B's ID, and observe the backend response.
Critical Vectors
- Horizontal IDOR Accessing a peer's data.
- Vertical Escalation Hitting admin endpoints.
- Mass Assignment Injecting unauthorized JSON fields.
1.4 Practical Application
Real-World Request Modification
PUT /api/v1/users/profile HTTP/1.1
Host: api.target.com
Authorization: Bearer eyJhbGciOi...[User A Token]
Content-Type: application/json
{"{"}"email": "userA@test.com", "name": "User A"{"}"} Attack Scenario (BOPLA)
"isAdmin": true, we test if the server implicitly trusts the client object.
PUT /api/v1/users/profile HTTP/1.1
Host: api.target.com
Authorization: Bearer eyJhbGciOi...[User A Token]
Content-Type: application/json
{"{"}"email": "userA@test.com", "name": "User A", "isAdmin": true, "role": 1{"}"} Pentester Detection Methodology
- Burp Suite Autorize: The most critical tool. Supply a low-privileged token, and Autorize automatically replays all captured high-privileged requests to test for authorization failures.
- Burp Repeater: Manual, iterative modification of IDs. Crucial for analyzing complex error messages.
- Param Miner: Discovers hidden or unlinked parameters that might control authorization state.
WAF & Filter Bypass Techniques
WAFs cannot generally stop IDOR because they lack application context (they don't know who owns ID 456). However, parameter pollution can bypass simple checks.
HTTP Parameter Pollution (HPP)
GET /api/get_receipt?user_id=MY_ID&user_id=VICTIM_ID Developer Remediation
Common Developer Mistake
- Centralized Server-Side Enforcement All access decisions must occur on the server. Implement robust ABAC/RBAC mechanisms in a unified middleware layer.
- Ownership Verification: For every request using an object ID, query the database ensuring the
owner_idmatches the session. - Avoid Implicit Binding: Do not automatically map JSON request body properties to internal database models to prevent Mass Assignment. Explicitly whitelist allowed properties.
Chapter 2:
Injection & Execution
Breaking the boundary between data and instruction. Forcing the application to interpret malicious input as executable code.
2.1 Architectural Root Cause
Injection vulnerabilities arise from a fundamental architectural breakdown: the failure to rigorously separate data from executable instructions. Instead of treating input as inert data, the application directly concatenates user-controlled input into a string that forms an executable statement for a downstream interpreter.
2.2 The SQLi Data Exfiltration Chain
2.3 Manual Exploitation Workflow
Automated scanners catch the obvious errors. Senior pentesters find blind, out-of-band, and logic-based injections manually.
- 1 Input Mapping Identify every single input vector (URL params, JSON fields, custom headers like
X-Forwarded-For). - 2 Syntax Breaking Send single quotes
', double quotes", or template syntax{{7*7}}to induce backend errors. - 3 Blind Identification If errors are hidden, use boolean logic (
AND 1=1) or time delays (pg_sleep(10)).
Critical Injection Types
- Time-Based Blind Measuring response time to extract data bit by bit.
- Out-Of-Band (OOB) Forcing a DNS request to an attacker server.
- SSTI Injecting Jinja2/Twig syntax to execute code.
2.4 Practical Application
Real-World Payloads
1' AND (SELECT 1 FROM (SELECT(sleep(10)))a)-- Server-Side Template Injection
__globals__ to access the `os` module and execute arbitrary system commands, bypassing the web application entirely.
{"{"}{"{"} self._TemplateReference__context.joiner.__init__.__globals__.os.popen('id').read() {"}"}{"}"} 127.0.0.1;cat$IFS/etc/passwd Pentester Detection Methodology
- Burp Intruder: Fuzzing parameters with specialized wordlists (e.g., SecLists) designed to trigger specific database errors or time delays.
- sqlmap: Highly automated database takeover tool. Pentesters use it after manually confirming an injection point to speed up exfiltration.
- Burp Collaborator: Essential for Out-of-Band (OOB) injections. Generates unique domain names to detect if a backend system executes a DNS lookup payload.
WAF Bypass & Filter Evasion
WAFs rely on signature matching. Pentesters evade them by altering the payload signature while maintaining its executable logic.
Evasion Strategy
- Encoding: Using URL encoding, Hex encoding, or Unicode variations to hide keywords.
- Obfuscation: Inserting SQL comments inside keywords (e.g.,
SEL/**/ECT) to break WAF regex. - sqlmap --tamper: Utilizing built-in tamper scripts (e.g.,
space2comment.py) to automatically encode payloads on the fly.
Developer Remediation
- Parameterized Queries (Prepared Statements) The absolute best defense against SQLi. It forces the database to treat input strictly as data, never as executable code, regardless of the characters it contains.
- Strict Allow-listing: Validate all input against a strict whitelist of allowed characters or formats.
- Avoid Shell Execution: Never use
exec()orsystem()functions with user-supplied data. Use built-in language APIs instead.
Chapter 3:
Modern Battlegrounds
APIs expose business logic directly. Cloud environments rely on metadata. Exploiting the modern architecture.
3.1 Architectural Root Cause
Insecure Design (OWASP A06:2025) and API-specific flaws manifest when applications expose internal workflows directly via REST or GraphQL endpoints without traditional front-end safety nets. Furthermore, cloud architectures implicitly trust internal network boundaries, making Server-Side Request Forgery (SSRF) a critical pivot point.
3.2 The SSRF to Cloud Pivot Chain
3.3 Manual Exploitation Workflow
API testing requires a methodical analysis of endpoints, parameters, and expected data types. It's about breaking business logic.
- 1 Schema Extraction Attempt to find Swagger docs, OpenAPI specs, or use GraphQL Introspection (
__schema) to map all endpoints. - 2 Parameter Fuzzing Look for parameters like
url=,path=, orwebhook=that might trigger outbound requests (SSRF). - 3 Logic Manipulation Attempt to call multi-step processes out of order, or batch hundreds of GraphQL queries in a single request to test rate limits.
Critical API Vectors
- BOLA (API1:2023) The API equivalent of IDOR. Manipulating object IDs in REST paths.
- Unrestricted Resource Sending deeply nested GraphQL queries to exhaust server memory (DoS).
- SSRF (API7:2023) Forcing the server to make requests to internal networks.
3.4 Practical Application
Real-World Payloads
{"{"} __schema {"{"} types {"{"} name fields {"{"} name {"}"} {"}"} {"}"} {"}"} AWS IMDS Extraction
http://169.254.169.254/latest/meta-data/iam/security-credentials/ dict://127.0.0.1:6379/info Pentester Detection Methodology
- Postman & Burp API Client: Directly interacting with REST endpoints based on discovered documentation.
- InQL (Burp Extension): Essential for GraphQL security testing. Automatically issues introspection queries and generates all possible queries/mutations for testing.
- Burp Collaborator: Used to confirm blind SSRF. Inject a Collaborator URL into an input; if a DNS/HTTP request is received by the Collaborator server, the SSRF is confirmed.
SSRF Filter Evasion
Developers often implement blacklists to block 169.254.169.254 or 127.0.0.1. Pentesters use alternative representations.
DNS Rebinding
- Decimal Encoding:
http://2852039166(resolves to 169.254.169.254). - Octal Encoding:
http://0251.0376.0251.0376.
Developer Remediation
- SSRF Fix & IMDSv2 Implement a strict URL whitelist. Do not use blacklists. If fetching external resources is required, resolve the DNS name and verify the target IP is not within an internal subnet before establishing the connection. For AWS, enforce IMDSv2 (requires session tokens) and disable IMDSv1.
- GraphQL Fix Disable Introspection in production. Implement strict query depth and complexity limits to prevent Denial of Service via recursive queries.
Chapter 4:
The Practical Pentest Flow
Mapping the OWASP Web Security Testing Guide (WSTG) directly to the Penetration Testing Execution Standard (PTES).
4.1 The Engagement Cycle
Phase 1: Recon & Enumeration
Systematically mapping the external attack surface. (WSTG-INFO)
- Passive OSINT & Fingerprinting
Using
theHarvester, Shodan, and Google Dorks. Analyzing HTTP headers (`Server`, `X-Powered-By`) withWappalyzer. - Active Directory/File Fuzzing
Discovering unlinked admin panels, `.git` folders, or `.env` files.
BashTerminalffuf -w wordlist.txt -u https://target.com/FUZZ -mc 200,401,403 - Application Mapping
Intercepting all traffic in Burp Suite, mapping all inputs, parameters, and API endpoints before sending a single payload.
Phase 2: Exploitation to Reporting
Manual execution of payloads and business risk translation.
The Penetration Tester's Core Value
- Manual Exploitation
Using Burp Repeater to heavily tweak payloads. Testing complex IDORs, Blind SQLi, and multi-step Business Logic Flaws.
- Post-Exploitation (Pivoting)
If RCE or SSRF is achieved, pivot to internal networks. Query AWS metadata for IAM credentials or dump database hashes for offline cracking.
- Reporting (Translation)
A finding is useless if management doesn't understand its business impact.
- Taxonomy: Map to OWASP Top 10.
- Scoring: Calculate severity using CVSS v4.0.
- SOC Context: Map to MITRE ATT&CK (e.g., T1190) to aid the defensive teams.