How i found SQL injection in live website
The admin login form passed user input into a SQL query without sanitising it, so a single quote caused an internal server error. An attacker could use a boolean-based blind SQL injection to extract data from the database, though a WAF initially interfered.
medium.com
Published on medium.com
I was just browsing the internet for something and i found this website after navigating this website i found that the technologies used in this website is very old and the design of this website was also not very modern.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the login handler concatenated user input into a SQL query instead of using parameterised queries, so quote characters altered the query syntax.
Impact
An attacker could extract data from the database through blind SQL injection, although a WAF blocked early attempts until encoding and a tamper script were used.
What the attacker needed
Admin login page reachable; WAF bypass needed for the tool
How it was found
- Find the admin login page while browsing the site.
- Try common usernames and passwords, then capture the login request in Burp.
- Send a single quote in the input and observe an internal server error in the response.
- Save the login request to a file and run sqlmap against it.
- Work around the WAF with encoding and a tamper script until the injection succeeds.
- Dump the database name as proof of concept.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A login form sends what you type to a database to check it. Here the site built that database command by gluing your text straight in, so special characters like a single quote broke the command and revealed the flaw. The author then used a tool to ask the database yes/no questions and slowly read its contents.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.