GPEN practice question 11 of 35
John works as a Penetration Tester in a security service providing firm named you-are-secure Inc. Recently, John's company has got a project to test…
Full set: 385 questionsThe scenario describes a Reflected Cross-Site Scripting (XSS) attack. The tester, John, injects a JavaScript payload into a search field. The web application insecurely includes this script in the immediate response without proper validation or output encoding. When John's browser receives the response, it executes the script because it trusts the content coming from the server. The appearance of the alert box confirms that the application is vulnerable to executing arbitrary client-side scripts within the context of a user's browser session. This vulnerability could be exploited to steal session cookies, deface the site, or redirect users to malicious pages.
A. Replay attack: This involves capturing and re-transmitting valid data packets to impersonate a user or repeat a transaction, which is not occurring here.
B. Buffer overflow attack: This is a memory-based attack that involves writing data beyond a buffer's boundary, which is unrelated to injecting and executing a script in a browser.
C. CSRF attack: This attack forges a request from a victim's browser to a web application where they are authenticated, which is different from injecting a script.
1. OWASP Foundation. (n.d.). Cross-Site Scripting (XSS). OWASP. Retrieved from https://owasp.org/www-community/attacks/xss/. The "Reflected XSS (Non-Persistent)" section states: "Reflected XSS occurs when an attacker injects executable code into a single HTTP response. The injected attack is not stored within the application itself; it is non-persistent and only impacts users who open a maliciously crafted link or third-party web page." This directly matches the scenario.
2. Saltzer, J. H., & Kaashoek, M. F. (2014). Lecture 15: Web Security. 6.858 Computer Systems Security, Fall 2014. Massachusetts Institute of Technology: MIT OpenCourseWare. Retrieved from https://ocw.mit.edu/courses/6-858-computer-systems-security-fall-2014/resources/mit6858f14lec15/. Slide 10, "Reflected XSS," provides a canonical example of a script injected into a search query parameter (http://host/search?q=<script>...</script>), which is functionally identical to the attack described in the question.
3. Johns Hopkins University. (n.d.). Web Security: XSS and CSRF. Course materials for 601.749: Web and Mobile Security. Retrieved from https://www.cs.jhu.edu/~fabian/courses/CS601.749/slides/04-web-security-xss-csrf.pdf. Slide 11, "Reflected XSS," explains that the "server reflects the attack back to the user's browser" and provides an example using an alert box, mirroring the question's scenario.
Keep practicing
Take the free GPEN practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GPEN practice questions
- Question 1You want to connect to your friend's computer and run a Trojan on it. Which of the follow…
- Question 2Which protocol would need to be available on a target in order for Nmap to identify servi…
- Question 3Which of the following vulnerability scanner scans from CGI, IDA, Unicode, and Nimda vuln…
- Question 4Which of the following Web attacks is performed by manipulating codes of programming lang…
- Question 5You work as a Web developer in the IBM Inc. Your area of proficiency is PHP. Since you ha…
- Question 6You work as a Network Penetration tester in the Secure Inc. Your company takes the projec…
