200-201 Question 148
Single answerA cybersecurity analyst is reviewing logs from a web application after users report unusual behavior. The logs reveal an attacker submitted input containing <script>alert('Test');</script> to the application's search bar. What type of web application attack does this indicate?
- A
SQL Injection
- B
Command Injection
- C
Cross-Site Scripting (XSS)
- D
Man-in-the-Middle Attack
Show answer and explanation
Correct answer: C
Explanation
The malicious input <script>alert('Test');</script> indicates a Cross-Site Scripting (XSS) attack, where the attacker injects harmful scripts into a web application. When executed, these scripts can steal session cookies, perform malicious actions on behalf of the user, or display unwanted content. This is unrelated to SQL queries, command execution, or interception of traffic, making XSS the correct answer.
- A. Incorrect.
SQL Injection occurs when an attacker manipulates a SQL query to access or modify a database. This scenario does not involve database queries, so this is incorrect.
- B. Incorrect.
Command Injection involves executing system-level commands on the server. This scenario involves user input in a browser rather than commands on a server, so this is incorrect.
- C. Correct.
Cross-Site Scripting (XSS) involves injecting malicious scripts into a web application that are executed in the user's browser. The
<script>alert('Test');</script>is a clear example of an XSS attack. - D. Incorrect.
Man-in-the-Middle Attack involves intercepting and manipulating traffic between two parties. This attack does not involve submitting malicious scripts into a web application, so this is incorrect.