How I found SQL injection vulnerability on the government organiz
A login page on a Tamil Nadu government portal returned a database error when a quote character was entered in the username field, indicating the input was placed into a SQL query without proper handling. The author then ran an automated SQL injection tool and reports that the database was dumped, exposing confidential drug and distributor records.
Published on systemweakness.com
Last night, while casually poking around the internet (totally not looking for trouble), I stumbled upon a government website. Curiosity kicked in and with a few well-placed SQL payloads, boom — access granted!
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 username input was concatenated directly into a SQL query instead of being passed as a parameter, so a quote character broke the query syntax.
Impact
Attackers could retrieve, modify or delete sensitive citizen records, including confidential drug and distributor data, according to the author.
What the attacker needed
Internet access; no account needed
The fix
The author states the issue was reported and patched, though no technical fix is described; properly it should be fixed by using parameterised queries.
How it was found
- Enumerate subdomains of the target domain with a passive enumeration tool.
- Filter the subdomains for live hosts returning common HTTP status codes.
- Scan the live hosts with an automated vulnerability scanner.
- Manually browse the hosts and find a login page the scanner missed.
- Enter a username containing a single quote and observe a SQL error appear.
- Run an automated SQL injection tool against the login and dump the database.
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 your credentials. If the site builds that database command by gluing your text straight into it, special characters like a single quote can break the command and produce an error. That error is a strong hint that an attacker could rewrite the command and read data they should not see.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.