Skip to main content
CTFWorld
WebDifficulty: Beginner -> Elite

Web Exploitation

Web exploitation focuses on identifying and chaining vulnerabilities in HTTP APIs, web applications, templating engines, databases, reverse proxies, and client-side JavaScript. It is the single most directly transferable CTF category to bug bounty hunting and Application Security engineering.

Core Attack Classes & Concepts

SQL & NoSQL Injection

Untrusted input alters database query structure to bypass login or exfiltrate tables.

Key Techniques: UNION-based extraction, boolean/time-based blind inference, and MongoDB operator injection ($ne, $regex).

Cross-Site Scripting (XSS) & CSRF

Injecting attacker-controlled JavaScript into victim origins or forging authenticated state changes.

Key Techniques: DOM sink analysis, CSP bypasses via JSONP/script gadgets, SameSite cookie behavior, and headless bot exploitation.

Server-Side Request Forgery (SSRF)

Coercing a server to send requests to internal services, cloud metadata, or localhost admin panels.

Key Techniques: DNS rebinding, URL parser differentials, redirect chains, and IPv6/octal IP allowlist bypasses.

Server-Side Template Injection (SSTI)

User input evaluated directly inside Jinja2, Twig, ERB, or Pug templates leading to remote code execution.

Key Techniques: Polyglot probes (${7*7}, {{7*7}}), MRO object traversal in Python, and sandbox filter evasion.

Auth, JWT, OAuth & Logic Flaws

Exploiting broken access controls (IDOR), weak JWT verification, race conditions, and OAuth redirect mistakes.

Key Techniques: alg:none / RS256-to-HS256 confusion, kid path traversal, single-packet race attacks, and state parameter omission.

HTTP Request Smuggling & Deserialization

Desynchronizing front-end proxies and back-end servers or abusing unsafe object deserialization.

Key Techniques: CL.TE / TE.CL desync, H2.CL downgrade smuggling, PHP/Java/Python pickle gadget chains.

Competition Methodology Checklist

  1. 1

    Map every endpoint, HTTP method, hidden parameter, JavaScript bundle, and source map through an intercepting proxy.

  2. 2

    Inspect authentication cookies, JWT claims, CORS headers, and Content-Security-Policy rules before sending noisy payloads.

  3. 3

    Differentiate white-box (read Dockerfile, dependencies, and exact sink functions) vs black-box (fingerprint stack and error behavior).

  4. 4

    Test authorization horizontally (another user’s ID) and vertically (admin actions) on every API route.

  5. 5

    Chain low-severity findings—such as an open redirect plus SSRF or a self-XSS plus login CSRF—into flag capture.

Reference Pattern

Spotting Vulnerable vs. Safe SQL Queries (Node.js)
javascript
// VULNERABLE: String interpolation lets attacker input alter SQL logic
const unsafe = `SELECT id, role FROM users WHERE username = '${req.body.user}'`;

// SAFE: Parameterized binding treats input strictly as data
const safe = 'SELECT id, role FROM users WHERE username = $1';
const result = await db.query(safe, [req.body.user]);

Recognizing data-vs-code boundary violations is the core mental model of web security.

Recommended Practice Progression

Challenge / TrackPlatformLevelFocus
SQLi Login & Filter LabsPortSwigger Web Security AcademyBeginnerStructured SQL injection fundamentals
Cookies & Inspector SeriespicoCTFBeginnerHTTP headers, cookies, and client inspection
JWT & OAuth Apprentice LabsPortSwigger Web Security AcademyIntermediateModern token and SSO flaws
Web Exploitation ChallengesHack The BoxAdvancedFull-source Node/Python/PHP exploit chaining

Defensive Engineering Takeaway

Use parameterized queries everywhere, enforce strict server-side authorization checks per object, apply strong non-script-inline CSP headers, and validate URLs against strict allowlists rather than regex denylists.