What is the outcome of executing a vulnerable login query that ends with DROP TABLE members;--' in the same batch as a SELECT query?

Prepare for the Computer Hacking Forensic Investigator v11 exam. Study with flashcards and multiple choice questions. Each question includes hints and explanations. Get exam-ready efficiently!

Multiple Choice

What is the outcome of executing a vulnerable login query that ends with DROP TABLE members;--' in the same batch as a SELECT query?

Explanation:
This question tests how SQL injection can run multiple statements in one batch. In a vulnerable login query, an attacker can finish the first SELECT with a semicolon, then append a second statement. The “--” comments out the rest of the line, ensuring the injected part isn’t rejected by trailing syntax. If the database user has permission and the API allows multiple statements per call, the second statement (DROP TABLE members) executes and deletes the entire table. That’s why the outcome is the deletion of the members table.

This question tests how SQL injection can run multiple statements in one batch. In a vulnerable login query, an attacker can finish the first SELECT with a semicolon, then append a second statement. The “--” comments out the rest of the line, ensuring the injected part isn’t rejected by trailing syntax. If the database user has permission and the API allows multiple statements per call, the second statement (DROP TABLE members) executes and deletes the entire table. That’s why the outcome is the deletion of the members table.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy