You are currently viewing SQL injection vulnerability allowing login bypass

SQL injection vulnerability allowing login bypass

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

SQL injection vulnerability allowing login bypass

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.

SQL injection vulnerability allowing login bypass

After accessing the lab, click on “My Account.”

SQL injection vulnerability allowing login bypass

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.”

SQL injection vulnerability allowing login bypass

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.

SQL injection vulnerability allowing login bypass

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

What is web security?

Website security refers to protecting a website or web application from cyberattacks, unauthorized access, or other security threats.

What is web application security?

Web application security means protecting a website from cyberattacks. These attacks may include vulnerabilities such as SQL injection, XSS, file inclusion, and others.

Which of the following is a good security practice for web browsing?

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.

How to find someone’s social security number on the dark web

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.

Leave a Reply