EC-Council
EC0-350 · Question #9
Consider the following code: text=<script>alert(document.cookie)</script> If an attacker can trick a victim user to click a link like this, and the Web application does not validate input, then the…
The correct answer is B. Replace "<" and ">" characters with "& l t;" and "& g t;" using server scripts. See the full explanation below for the reasoning.
Question
Consider the following code:
text=<script>alert(document.cookie)</script> If an attacker can trick a victim user to click a link like this, and the Web application does not validate input, then the victim's browser will pop up an alert showing the users current set of cookies. An attacker can do much more damage, including stealing passwords, resetting your home page, or redirecting the user to another Web site. What is the countermeasure against XSS scripting?
Options
- ACreate an IP access list and restrict connections based on port number
- BReplace "<" and ">" characters with "& l t;" and "& g t;" using server scripts
- CDisable Javascript in IE and Firefox browsers
- DConnect to the server using HTTPS protocol instead of HTTP
How the community answered
(64 responses)- A16% (10)
- B75% (48)
- C3% (2)
- D6% (4)
Community Discussion
No community discussion yet for this question.