nerdexam
GIAC

GCIH · Question #108

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 the security of a promotional Website penetration…

The correct answer is D. XSS attack. Injecting a script tag into a search field that executes and displays an alert box is a standard proof-of-concept test for a Cross-Site Scripting (XSS) vulnerability.

Web Application Attacks & Post-Exploitation

Question

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 the security of a promotional Website penetration testing, he inserts the following script in the search box at the company home page:

<script>alert('Hi, John')</script> After pressing the search button, a pop-up box appears on his screen with the text - "Hi, John." Which of the following attacks can be performed on the Web site tested by john while considering the above scenario?

Options

  • AReplay attack
  • BCSRF attack
  • CBuffer overflow attack
  • DXSS attack

How the community answered

(62 responses)
  • A
    3% (2)
  • B
    2% (1)
  • C
    6% (4)
  • D
    89% (55)

Why each option

Injecting a script tag into a search field that executes and displays an alert box is a standard proof-of-concept test for a Cross-Site Scripting (XSS) vulnerability.

AReplay attack

A replay attack involves capturing a valid authentication token or message from a network session and retransmitting it to gain unauthorized access, not injecting scripts into web input fields.

BCSRF attack

CSRF (Cross-Site Request Forgery) tricks an already-authenticated user's browser into sending forged requests to a trusted site, but does not involve injecting executable script code into web pages.

CBuffer overflow attack

A buffer overflow attack exploits memory management flaws by sending more data than a buffer can hold to overwrite adjacent memory, not by inserting client-side scripts into web form inputs.

DXSS attackCorrect

XSS occurs when a web application accepts user-supplied input and reflects it back into the page without proper sanitization or encoding, allowing injected scripts to execute in the victim's browser context. John's successful injection of a script tag that triggered an alert box confirms the search field is vulnerable - it echoed his input directly into the HTML response. If exploited maliciously, an attacker could use this to steal session cookies, redirect users, or perform actions on behalf of authenticated victims.

Concept tested: Cross-Site Scripting (XSS) vulnerability identification

Source: https://owasp.org/www-community/attacks/xss/

Topics

#XSS#cross-site scripting#script injection#web vulnerability

Community Discussion

No community discussion yet for this question.

Full GCIH Practice