nerdexam
CompTIA

PT0-002 · Question #102

A penetration tester is testing input validation on a search form that was discovered on a website. Which of the following characters is the BEST option to test the website for vulnerabilities?

The correct answer is C. Single quote. When testing input validation on a web search form, a single quote is the best character to identify SQL injection vulnerabilities by disrupting SQL query syntax.

Vulnerability discovery and analysis

Question

A penetration tester is testing input validation on a search form that was discovered on a website. Which of the following characters is the BEST option to test the website for vulnerabilities?

Options

  • AComma
  • BDouble dash
  • CSingle quote
  • DSemicolon

How the community answered

(61 responses)
  • A
    3% (2)
  • B
    7% (4)
  • C
    75% (46)
  • D
    15% (9)

Why each option

When testing input validation on a web search form, a single quote is the best character to identify SQL injection vulnerabilities by disrupting SQL query syntax.

AComma

A comma is typically used as a separator in SQL statements but is less likely to cause a fundamental syntax error or allow injection on its own compared to a single quote.

BDouble dash

A double dash (--) is used for comments in SQL, which can sometimes be part of an injection, but it's generally used after breaking out of a string, making the single quote a more primary and immediate indicator of vulnerability.

CSingle quoteCorrect

A single quote character ( ' ) is the best option for initially testing input validation on a search form, as it is a fundamental component of SQL injection attacks. Injecting a single quote can break out of string literals in SQL queries, causing syntax errors or allowing for further injection of malicious commands.

DSemicolon

A semicolon (;) is used to terminate SQL statements or separate multiple statements; while useful in advanced injection, it's often filtered or less effective than a single quote for an initial test against string literal boundaries.

Concept tested: SQL injection testing, web application vulnerabilities

Source: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/sql-injection

Topics

#Input validation#SQL Injection#Web application testing#Vulnerability discovery

Community Discussion

No community discussion yet for this question.

Full PT0-002 Practice