Attacks and Exploits

A product search page prints the matching database rows in an HTML table, and a stray quote in the search value triggers a SQL syntax error. The tester wants usernames from a different table shown in that table. Which technique is BEST?

Show the answer

Correct answerA. UNION query matching the original column count

AWhy this is right: UNION appends rows from another table to the visible results, provided the column count and types match.

BWhy not this: Boolean-based extraction infers data from page differences, which is needless when results are displayed.

CWhy not this: Time-based extraction is a blind technique, slow and unnecessary when query output is already displayed.

DWhy not this: A shell separator targets OS command injection, not a SQL query.

Because query results are printed on the page, a UNION query that matches the original column count can append rows from another table to the output. Blind techniques (time-based, boolean) extract data one bit at a time and are only needed when no output is shown.