SQL injection vulnerability allowing login bypass

Description

This lab contains an SQL injection vulnerability in the login function.

Reproduction and proof of concept

  1. SQL:

SELECT * FROM users WHERE username = 'administrator' AND password = '' OR 1=1 --
  1. Use Burp Suite to intercept and modify the login request.

  2. Modify the username parameter, giving it the value: administrator'--

Or modify it in the URL:

Basic SQLi

Exploitability

An attacker needs to perform an SQL injection attack that logs in to the application as the administrator user.