SQL Injection
SQL Injection
INTRODUCTION
1) SQL is the structured query language for storing and processing information in the relational
database.
2) SQL injection is the hacking technique which is the placement of the malicious code in the SQL
statement, via web page input.
3) Any website that is using MYSQL or ORACLE server can be vulnerable to SQL injection.
SELECT *
FROM table name
WHERE Username = 'username'
AND Password = 'password
SELECT *
FROM table name
WHERE Username = ''OR 1=1--'
AND Password = 'password'
Union-based SQLi
- Leverage the union based operator.
- To combine results of two/more SELECT statements in the Input tab.
- Which is returned as part of the HTTP response.
Inferential SQLi
iss mai hum sql ki query ke sath jo search karna hai wo dalte hai , agar sql ki query true hai ( ''
OR 1=1-- ) toh hame kuch result milega else agar sql ki query false hai ( " OR 1=2--) toh hame
kuch bhi show nhi karega toh isse pata chalega ki hamari query run ho rahi hai ya nhi.
Ex - input mai agr SQL ka function SLEEP(10) use kiya and agr database ne 10 sec liye repond
karne keliye toh hame smj jayga ki hamri sql ki query work kar rahi hai and ye bhi samjenga ki
vulnerability hai ya nhi
9) How to Perform?
-Selecting target parameter
-Testing for manual SQL
-Use tools to exploit the DB.
-Report the vulnerability.