Introduction
Hello, everyone. How are you all doing? This is our third article on SQL injection. In this article, we will solve the PortSwigger Web Security Lab – SQL injection vulnerability allowing login bypass. We will solve this lab entirely with practical examples and screenshots.
Lab Description
You can read the lab description, which clearly states that the lab is vulnerable to an SQL injection flaw, specifically in the login function. To solve this lab, you need to perform an SQL injection attack to log in as an administrator user in the application.
Lab Solution
First, let’s access the lab.
After accessing the lab, click on “My Account.”
Upon clicking “My Account,” you will see a login form. This login form contains an SQL injection vulnerability that we need to exploit to log in as an administrator user. Now, we already know the username, which is “administrator.”
I tried random passwords with the username “administrator,” but the application did not log me in. Now, we need to use SQL injection to bypass this admin panel and log in without an application.
You can see that I have successfully logged in to the admin panel. Now, you might be wondering, “How did I do it?”
It’s simple. Just try “administrator’–” as the username and enter any random password. You will be able to log in to the admin panel.
Try using “administrator’–” as the username. This contains an SQL injection payload, where we use the single quote (‘) after “administrator” and then comment out the rest of the password section. This way, I can log in using only the username.
Username = “administrator’–” and Password = anything
So, we have successfully solved the PortSwigger Web Security Lab – SQL injection vulnerability allowing login bypass.
You can learn everything related to web security on our website. We upload the latest articles on web security topics on a daily basis, so stay with us.
To continue studying check out the next lab i.e. SQL Injection UNION Attack Determining The Number Of Columns Returned By The Query cover the current lab before visiting the next lab. Good Luck!
FAQS
Website security refers to protecting a website or web application from cyberattacks, unauthorized access, or other security threats.
Web application security means protecting a website from cyberattacks. These attacks may include vulnerabilities such as SQL injection, XSS, file inclusion, and others.
It is always a good practice to use an up-to-date browser with timely updates. Keep your browser plugins up-to-date, avoid malicious websites and links, and always enable 2-factor authentication while avoiding clickjacking.
Searching for someone’s social security number or credit card information on the dark web is illegal and unethical. It is important to always avoid such activities and protect yourself and others from cyber threats.