GCIH Exam QuestionsBrowse all questions from this exam

GCIH Exam - Question 57


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?

Show Answer
Correct Answer: BC

If an attacker submitted the value "GIAC'; drop table contacts; --", the SQL command constructed would become: "select PhoneNumber from contacts where Company = 'GIAC'; drop table contacts; --'. The part 'drop table contacts;' is an SQL command that would delete the 'contacts' table from the database. The comment delimiter '--' ensures that any subsequent text is ignored, making the query syntactically valid. Therefore, the 'contacts' table would be deleted from the database.

Discussion

1 comment
Sign in to comment
847ch0n3Option: C
Mar 2, 2024

Should be C if 'contacts' table exists.