ALL PASS, NO FAIL!

CEH v13 Module 14: Hacking Web Applications

This module covers attacks against web applications, focusing on the OWASP Top 10 vulnerabilities. Attackers exploit XSS (reflected, stored, DOM-based), CSRF, injection flaws, security misconfigurations, and broken authentication to compromise web application systems and data.

The CEHStudy app carries 11 flashcards for Module 14 across 3 sections — resolve every question by naming the OWASP Top 10 (2021) category first; Broken Access Control leads the list, and stems about object IDs, payloads, or cookie handling all fall out from there.

Key Topics Covered

Important Terms & Concepts

OWASP Top 10: The ten most critical web application security risks, updated periodically. Categories include injection, broken authentication, XSS, insecure direct object references, security misconfiguration, and more.
Reflected XSS: Malicious script is embedded in a URL or form submission and executed immediately in the victim's browser. Not stored on the server. Requires tricking user into clicking a crafted link.
Stored XSS: Malicious script is permanently stored on the target server (in comments, user profiles, forums). Every user who views the stored data is affected — most dangerous XSS type.
DOM-based XSS: Vulnerability exists in client-side JavaScript rather than server code. The attack modifies the DOM environment in the victim's browser without server interaction.
CSRF (Cross-Site Request Forgery): Forces an authenticated user's browser to perform unwanted actions on a trusted site. Mitigated with anti-CSRF tokens, SameSite cookies, and re-authentication for sensitive operations.
IDOR (Insecure Direct Object References): Accessing resources by manipulating object identifiers in URLs (e.g., changing ?user_id=100 to ?user_id=101). Allows unauthorized access to other users' data.

How to Study This Module

Frequently Asked Questions

What is the OWASP Top 10?
A standard awareness document for web application security listing the ten most critical security risks. It is updated every few years to reflect evolving threats.

What are the types of XSS attacks?
Three types: Reflected (script delivered via link), Stored (script saved on server), and DOM-based (exploits client-side JavaScript). Stored XSS is most dangerous as it affects all visitors.

Related Modules

What is Web Application Hacking in Ethical Hacking?

Web Application Hacking is the highest-weighted web security domain on the CEH v13 exam. The module targets vulnerabilities in the application layer — code, inputs, sessions, and business logic running on top of web servers (Module 13) — organized around the OWASP Top 10, the most commonly exploited web application vulnerabilities in production. Module 14 topics account for approximately 15% of CEH v13 exam questions.

Key Concepts in Hacking Web Applications

Common Exam Mistakes in Module 14

Mixing up the three XSS flavors: reflected XSS rides in the URL and echoes back in the response; stored XSS persists on the server (a database row) and executes for every visitor; DOM-based XSS moves from an untrusted source to a sink such as innerHTML entirely inside the browser, staying invisible to server-side WAFs. The data path in the stem picks the flavor — stored is the one that reaches everyone.
Treating CSRF and XSS as one client-side problem: XSS runs attacker script in the victim browser with stolen context; CSRF makes the victim browser send a forged request with its own cookies attached, unverified by the application. Defenses differ — output encoding and HttpOnly for XSS; per-request anti-CSRF tokens plus SameSite for CSRF.
Testing access control only in the interface: IDOR (incrementing an object reference like /order/1234) and privilege escalation are server-side authorization failures; a hidden button is not a control. Exam answer: enforce authorization server-side on every request.

Tools Used in Web Application Hacking

Tools the CEH v13 exam references for web application testing:

Worked Example: One Comment Field, Two Different Flaws

A tester posts a <script> tag into a comment field. If the payload only echoes back to the poster through URL parameters it is reflected XSS; once saved and executed for every visitor reading the thread, it is stored XSS — typically the most damaging flavor. A DOM-based variant never round-trips to the server: location.hash flows into innerHTML client-side, so a WAF watching HTTP traffic sees nothing.

The twist: the same profile page serves another user's data when the tester increments its ID — broken access control, the top of the OWASP Top 10 (2021) list. A fake "account suspended" screen on an invisible iframe over the real page is clickjacking, closed by X-Frame-Options: DENY or CSP frame-ancestors. One test session, three categories; reporting each under the right name separates a passing write-up from a failing one.

How to Study Web Application Hacking for the CEH v13 Exam

To study Module 14 for the CEH v13 exam:

  1. Build a reference table of all 10 OWASP Top 10 (2021) categories: Category Name | Example Attack | Mitigation Technique | CEH Exam Tip. Exam stems classify specific attacks into their category — e.g., "An attacker manipulates a URL parameter to access another user's account" = A01 Broken Access Control (IDOR). Practice 20+ scenarios until each takes under 30 seconds
  2. Hands-on: set up OWASP WebGoat locally (Docker or standalone JAR). Work through all XSS lessons (reflected, stored, DOM-based), the CSRF lab, and IDOR challenges. For each, document the triggering request, the response, and the mitigation that would have prevented it — this mirrors scenario questions asking for the right defense
  3. Memorize XSS payloads per type: Reflected = '' in a URL parameter; Stored = same payload in a comment/profile field; DOM-based = vulnerable JavaScript like document.write(location.hash). Know which HttpOnly/Content-Security-Policy/SameSite flags block which vector
  4. Review related modules: Module 15 (SQL Injection) for deep-dive SQLi techniques in the OWASP A03 Injection category, and Module 11 (Session Hijacking) for how XSS steals session cookies — the XSS-to-session-theft chain is a common exam scenario

Frequently Asked Questions About Web Application Hacking

What is Content-Security-Policy (CSP) and how does it prevent XSS?

Content-Security-Policy is an HTTP response header telling the browser which content sources may execute. A strict CSP (e.g., "default-src 'self'") lets only same-origin scripts run — injected inline or attacker-domain scripts are blocked before execution. CSP complements other XSS defenses: HttpOnly blocks cookie theft but not the XSS itself (the script still executes for DOM manipulation and exfiltration via API calls); CSP stops the malicious script from executing at all. Most effective: both together — CSP prevents execution, HttpOnly limits damage if XSS occurs anyway. A bypass tested on advanced exams: if the policy allows 'unsafe-inline', inline scripts still run — the strongest CSP omits 'unsafe-inline' and uses nonces or hashes. Stems may show a CSP header and ask whether a given attack is blocked.

How does SQL injection differ from other injection flaws in the OWASP Top 10?

All injection flaws share one root cause: user input concatenated into a command (SQL query, OS command, LDAP query, XML document) without sanitization or parameterization. The difference is the target language and impact. SQL Injection (most common): input into SQL queries — read/modify/delete data, authenticate as any user, or in some DBMS configurations execute OS commands. OS Command Injection: input to system() or exec() calls — arbitrary shell commands on the server. LDAP Injection: input into directory queries — enumerate users, bypass authentication, modify attributes. XML Injection (XXE): input processed as XML — read local files, SSRF, denial of service. All four fall under OWASP A03:2021 (Injection). Universal defense: input validation and parameterization — prepared statements for SQL, escaped arguments for OS commands, XML parsers with external entity loading disabled for XXE. Stems may show code snippets and ask which injection type is present.

Related CEH v13 Modules