Courseiva

CCNA Web Application and Injection Attacks Questions

8 of 158 questions · Page 3/3 · Web Application and Injection Attacks · Answers revealed

151
MCQeasy

An attacker attempts to exploit a web application by sending a request that triggers the server to make an internal HTTP request to a sensitive internal service. Which type of attack is this?

A.CSRF
B.XXE
C.SSRF
D.IDOR
AnswerC

Server-Side Request Forgery (SSRF) occurs when a web application is tricked into making requests to an arbitrary domain specified by an attacker. This vulnerability allows an attacker to induce the server-side application to make HTTP requests to an attacker-specified location, potentially targeting internal networks, cloud metadata services, or other external systems. The server acts as a proxy for the attacker, bypassing network segmentation or firewall rules that might otherwise block direct access.

Why this answer

SSRF (Server-Side Request Forgery) occurs when an attacker can induce the server to make requests to internal resources.

152
MCQeasy

Which of the following tools is specifically designed to automate the process of detecting and exploiting SQL injection vulnerabilities in web applications?

A.Burp Suite
B.Metasploit
C.SQLMap
D.Nmap
AnswerC

SQLMap is the standard tool for automated SQL injection detection and exploitation.

Why this answer

SQLMap is an open-source penetration testing tool that automates the detection and exploitation of SQL injection flaws. It supports a wide range of database backends and injection techniques, making it the go-to tool for this specific task.

Exam trap

EC-Council often tests the distinction between general-purpose security tools (like Burp Suite or Metasploit) and specialized automation tools (like SQLMap), leading candidates to choose a tool they recognize for web testing rather than the one specifically designed for SQL injection automation.

How to eliminate wrong answers

Option A is wrong because Burp Suite is an intercepting proxy and web application security testing platform that requires manual configuration or extensions to automate SQL injection exploitation; it is not purpose-built for automated SQL injection detection and exploitation. Option B is wrong because Metasploit is a framework for developing and executing exploit code against remote targets, but it does not natively automate the detection and exploitation of SQL injection vulnerabilities in web applications without additional modules or manual scripting. Option D is wrong because Nmap is a network scanning tool used for host discovery, port scanning, and service enumeration, and it lacks any capability to detect or exploit SQL injection vulnerabilities.

153
MCQmedium

During a penetration test, you identify a parameter in a web application that appears to fetch a file from the server. You modify the parameter to '../../../etc/passwd' and see the contents of the passwd file. Which type of vulnerability is this?

A.Remote File Inclusion (RFI)
B.Directory traversal
C.Server-Side Request Forgery (SSRF)
D.Local File Inclusion (LFI)
AnswerB

Directory traversal, also known as path traversal, is a vulnerability that allows an attacker to access files and directories stored outside the intended root directory by manipulating file paths. This is typically achieved by injecting sequences like `../` (dot-dot-slash) into input parameters, enabling navigation upwards in the directory hierarchy to read sensitive system files or application configuration.

Why this answer

The use of '../' sequences to traverse directories and access files outside the web root is classic directory traversal.

154
Multi-Selecthard

Which THREE of the following are valid defenses against CSRF attacks? (Select 3)

Select 3 answers
A.Custom request headers (e.g., X-Requested-With)
B.SameSite cookies set to Lax or Strict
C.CSRF tokens
D.Input validation
E.Output encoding
AnswersA, B, C

Custom request headers like X-Requested-With serve as an effective CSRF defense by leveraging browser security mechanisms. Modern browsers, adhering to the Same-Origin Policy and CORS specifications, prevent attackers from arbitrarily adding or modifying such custom headers in simple cross-origin requests. The server can then validate the presence and expected value of this header, rejecting any request originating from an unauthorized domain that lacks the legitimate header. This ensures that only requests from the legitimate origin, which can set the header, are processed.

Why this answer

CSRF tokens, SameSite cookies (Lax or Strict), and custom headers (e.g., X-Requested-With with XMLHttpRequest) are all effective CSRF defenses.

155
Multi-Selecthard

Which THREE of the following are effective mitigation techniques against Cross-Site Scripting (XSS) attacks?

Select 3 answers
A.Output encoding
B.Implementing Content Security Policy (CSP)
C.Disabling JavaScript in the client browser
D.Using HTTPS for all communications
E.Input validation
AnswersA, B, E

When user-supplied data is rendered back to a client, output encoding converts special characters (like <, >, &, ", ') into their entity equivalents (e.g., &lt;, &gt;). This process prevents the browser from interpreting these characters as active content or HTML tags, effectively neutralizing any embedded malicious scripts and ensuring they are displayed as harmless text rather than executed.

Why this answer

Input validation ensures malicious characters are rejected. Output encoding converts special characters to safe HTML entities. Content Security Policy (CSP) restricts script sources.

Disabling JavaScript is not practical. Using HTTPS protects data in transit but not against XSS.

156
MCQmedium

A penetration tester discovers that a web application's login page does not enforce rate limiting and several usernames are known from a prior data breach. The tester wants to try a few common passwords across many accounts to avoid account lockouts. Which attack technique is being used?

A.Password spraying
B.Credential stuffing
C.Brute force attack
D.Dictionary attack
AnswerA

Password spraying is a targeted attack where an attacker attempts a small number of common passwords against a large list of usernames. This technique is specifically designed to bypass account lockout policies by distributing login attempts across many accounts, rather than repeatedly failing on a single account. By trying 'Password123!' on hundreds of accounts, the attacker significantly increases their chances of finding a valid credential without triggering security alerts for excessive failed logins on one user. This method is highly effective against organizations with weak password policies and large user bases.

Why this answer

Password spraying involves trying a small number of common passwords against many user accounts to avoid account lockout. This contrasts with credential stuffing (using many passwords per account) and brute force (many passwords per user).

157
MCQmedium

A security analyst notices that the web application returns different response times when querying user IDs. For example, a valid user ID returns the page in 2 seconds, while an invalid ID returns in 0.5 seconds. The analyst suspects a blind SQL injection vulnerability. Which SQL injection technique is MOST likely being used?

A.Error-based SQL injection
B.Union-based SQL injection
C.Time-based blind SQL injection
D.Out-of-band SQL injection
AnswerC

Time-based blind SQL injection is a technique where an attacker infers information by observing the time it takes for the database to respond to a query. This method involves injecting SQL commands that include conditional statements (e.g., IF or CASE) combined with time-delay functions (e.g., SLEEP() or WAITFOR DELAY). If the condition is true, the database introduces a noticeable delay, allowing the attacker to deduce the truthfulness of a statement bit by bit, even without direct error messages or data output.

Why this answer

Time-based blind SQL injection relies on causing a time delay (e.g., via SLEEP or WAITFOR DELAY) to infer the truth of conditions. The varying response times (2s vs 0.5s) indicate a time-based attack.

158
MCQhard

During a security assessment, a tester discovers an endpoint that reflects the 'User-Agent' header in the response without sanitization. The tester wants to confirm a reflected XSS vulnerability. Which of the following payloads would be MOST effective to demonstrate the issue in a single request?

A.Set the User-Agent to: <img src=x onerror=alert(1)>
B.Set the User-Agent to: ' OR '1'='1
C.Set the User-Agent to: <script>alert('XSS')</script>
D.Set the User-Agent to: ../../../../etc/passwd
AnswerC

This payload, <script>alert('XSS')</script>, is the most direct and effective proof-of-concept for demonstrating a reflected Cross-Site Scripting (XSS) vulnerability. When the User-Agent header containing this string is reflected unencoded into the HTML response generated by the web application, the browser interprets the <script> tags and executes the embedded JavaScript. The alert('XSS') function then triggers a pop-up box, visually confirming that arbitrary client-side script execution is possible within the victim's browser context.

Why this answer

Using a simple script alert like <script>alert(1)</script> is a standard proof-of-concept for reflected XSS. The exact payload may vary, but it must execute JavaScript. The simplest is an alert.

← PreviousPage 3 of 3 · 158 questions total

Ready to test yourself?

Try a timed practice session using only Web Application and Injection Attacks questions.