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

Enhance your knowledge as a Computer Hacking Forensic Investigator with the CHFI v11 Test. Use flashcards and multiple-choice questions, complete with hints and detailed explanations, to prepare effectively and ace your exam!

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 Examzify

You can unsubscribe at any time. Read our privacy policy