GIAC Certified Incident Handler (GCIH) — Question 163

Suppose a web application builds the SQL command "select PhoneNumber from contacts where Company = '[value]';". What would the result likely be if an attacker submitted the value "GIAC'; drop table contacts; --" to the database?

Answer options

Correct answer: B

Explanation

The correct answer is B because the SQL injection attempts to drop the 'contacts' table but is structured to first select from a non-existent 'GIAC' table. Options A and D are incorrect since they misinterpret the SQL command's effect, and option C is incorrect as the SQL injection does not execute in that manner.