Allowing login bypass
PreviousWHERE clause allowing retrieval of hidden dataNextUNION attack, determining the number of columns returned by the query
Last updated
Last updated
Lab #2 by PortSwigger Web Security Academy:
This lab contains a SQL injection vulnerability in the login function.
To solve the lab, perform a SQL injection attack that logs in to the application as the administrator
user.
Trying to login by using a single quote ('
) as the username, returns an internal server error, demonstrating that the app is vulnerable.
By intercepting the Login POST request and appending '--
to the administrator username, we can bypass the remaining part of the query that checks the password.
And weβre in!
Letβs script the solution in Python.
Itβs a POST
request that expects three parameters: csrf
, username
, and password
.
Testing the Python script:
It worked! We can also validate it through Burp.