EC-Council
312-50V7 · Question #4
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
(36 responses)- A78% (28)
- B14% (5)
- C6% (2)
- D3% (1)
Community Discussion
No community discussion yet for this question.