Certified Ethical Hacker (CEH v12) — Question 213

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 strategically uses HTML encoding to bypass the application's input filters, allowing for successful exploitation of the XSS vulnerability. This method effectively redirects users to a malicious site where their cookies can be captured. The other options either attempt to disable HTTPOnly cookies, which is generally not feasible, or suggest unrealistic attacks that do not directly exploit the XSS vulnerability.