SQL Injection Types: There are various types of SQL Injection. We will consider a few of them below. 1.) Union-based SQL Injection: With the help of the union operators, we can combine the results of two or more SELECT statements to a single output. The return of this single output is a part of the HTTP response . We can use it to extract data from other tables as well. Example: ‘ AND ‘a’=’b’ UNION SELECT 101, ‘abc’, ‘xyz’ FROM members WHERE ‘a’=’a The single quote at the start specifies the end of the original query. The first query must set to FALSE , hence we specify the condition as ‘a’=’b’ after AND function. Both queries that are before and after UNION must have the same structure otherwise it will generate an error. It will generate the SQL query after getting the input from the user as: SELECT id, name, description FROM products WHERE category = ” AND ‘a’=’b’ UNION SELECT 101, ‘abc’, ‘xyz’ FROM members WHERE ‘a’=’a’ So it will retu...
Comments
Post a Comment