Certified Ethical Hacker (CEH v13) — Question 43

As part of a penetration testing team, you've discovered a web application vulnerable to Cross-Site Scripting (XSS). The application sanitizes inputs against standard XSS payloads but fails to filter out HTML-encoded characters. On further analysis, you've noticed that the web application uses cookies to track session IDs. You decide to exploit the XSS vulnerability to steal users' session cookies. However, the application implements HTTPOnly cookies, complicating your original plan. Which of the following would be the most viable strategy for a successful attack?

Answer options

Correct answer: D

Explanation

The correct answer is D because it involves crafting a sophisticated XSS payload that can bypass the application's input sanitization, allowing the attacker to redirect users to a malicious site where their cookies can be captured. Option A incorrectly suggests manipulating server-side code to disable HTTPOnly, which is not feasible. Option B proposes using a browser exploit that is not typically possible, and option C inaccurately describes using a buffer overflow to access HTTPOnly cookies, which is unrelated to XSS vulnerabilities.