From Shodan to SQLi: Hacking an Exposed Company Dashboard
An exposed company dashboard had a login form vulnerable to SQL injection, confirmed by a syntax error when a single quote was entered. The author bypassed authentication with a simple payload and gained access to the internal dashboard.
medium.com
Published on medium.com
Uncovering vulnerabilities and exploiting them: a deep dive into the journey from reconnaissance to a successful SQL injection.
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 form concatenated user input directly into a SQL query without parameterisation or input validation.
What the attacker needed
Internet-exposed server; login form vulnerable to SQLi; no authentication required
The fix
The login form should use parameterised queries or prepared statements and validate input, and the dashboard should not be exposed to the internet.
How it was found
- Found an exposed server via Shodan running an outdated Apache version.
- Visited the IP and saw directory listing enabled, exposing data files.
- Followed links to a login screen and tried some passwords, which failed.
- Entered a single quote in the username field and received a SQL syntax error.
- Crafted a basic payload to extract more details from error messages.
- Used a simple payload to bypass authentication and access the internal dashboard.
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.
The login page put what you typed directly into a database command without cleaning it first. By typing special characters, the author made the database return a valid login even without the right password. This is called SQL injection, and it let them see the company's private dashboard.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.