nerdexam
EC-Council

EC0-350 · Question #832

The following script shows a simple SQL injection. The script builds an SQL query by concatenating hard-coded strings together with a string entered by the user: The user is prompted to enter the…

The correct answer is A. Chicago'; drop table OrdersTable --. See the full explanation below for the reasoning.

Question

The following script shows a simple SQL injection. The script builds an SQL query by concatenating hard-coded strings together with a string entered by the user:

The user is prompted to enter the name of a city on a Web form. If she enters Chicago, the query assembled by the script looks similar to the following:

SELECT * FROM OrdersTable WHERE ShipCity = 'Chicago' How will you delete the OrdersTable from the database using SQL Injection?

Options

  • AChicago'; drop table OrdersTable --
  • BDelete table'blah'; OrdersTable --
  • CEXEC; SELECT * OrdersTable > DROP --
  • Dcmdshell'; 'del c:\sql\mydb\OrdersTable' //

How the community answered

(49 responses)
  • A
    80% (39)
  • B
    12% (6)
  • C
    2% (1)
  • D
    6% (3)

Community Discussion

No community discussion yet for this question.

Full EC0-350 Practice