Table of contents
#Cybersecurity #sqlinjection
What is SQL Injection?
SQL injection usually occurs when you ask a user for input, like their username/userid, and instead of a name/id, the user gives you an SQL statement that you will unknowingly run on your database.
SQL injection lab
Step 1: Install Burpsuite and set up a proxy with the browser [Link
]
Step 2: Create an account in portswigger academy [Link
]
Step 3: Locate https://portswigger.net/web-security/sql-injection/lab-retrieve-hidden-data and click access the lab.
Step 4: Open Burpsuite and turn the intercept on
Step 5: Click Any Category and analyze the no. of items listed
Step 6: Analyze the intercepted request in the burp suite
Step 7: Tamper the category parameter with this payload [ '+OR+1=1-- ]and analyze the no. of items listed after tampering.
Explanation:
SELECT * FROM products WHERE category = 'Gifts' AND released = 1
The above code in database will be modified as
SELECT * FROM products WHERE category = '' OR 1=1 --' AND released = 1
OR operator is true if any one of the conditions is true, so 1=1 is always true which in turn displays all the products.
The message will be displayed upon successful SQL injection exploitation.
Happy Learning. Cheers🙌❤️