[I] Error-based ~SQLi Attacks
the attacker performs unwanted and undesired actions by sending some malicious query to the database that cause the database to produce error messages. The attacker can potentially use the data provided by these error messages to gather information about the structure of the database.
(a) Comment-Line Based SQLi:Using comment line to cause the database to ignore a part of a valid query.
Select * from stores where product_id = blah’ or 1=1-- (everything after this will be neglected)
(b) Tautology Based SQLi:There are a lot of strings which always evaluates to be true, like ‘1’ = ‘1’ ‘a’ = ‘a’, etc., using them in the query to create constantly true conditions.
Select * from users where username=’blah’ or ‘a’=’a’ -- and password=’pass’