How I Broke Into My Dev Friend’s Website in Less Than 24 Hour
The ticket detail page was vulnerable to SQL injection, allowing an attacker to dump the database and obtain hashed passwords. After cracking a weak password, the attacker logged in and exploited excessive privileges to escalate to a super user.
medium.com
Published on medium.com
You know what they say about ‘bulletproof’ websites? They never are.
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 ticket ID parameter was concatenated into an SQL query without sanitisation, and the application granted excessive privileges to a low-privileged account.
What the attacker needed
Access to the ticket page; no authentication needed for SQL injection
The fix
The SQL injection should be fixed by using parameterised queries, and the principle of least privilege should be applied to user roles.
How it was found
- Open the ticket details page with an id parameter in the URL.
- Run sqlmap against that URL to confirm SQL injection.
- Dump the database and find the user table with hashed passwords.
- Crack the Argon2 hash of the 'add user' account using Hashcat.
- Log in with the cracked password.
- Use the 'edit' account to change any user to a super user.
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 website's ticket page took an ID number from the web address and put it directly into a database command without checking it. This is called SQL injection, and it let the attacker download the whole database, including scrambled passwords. One password was easy to unscramble, and the account it belonged to had too much power, so the attacker could make themselves an admin.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.