Skip to content
SQL injection Write-up Beginner

How I Hacked A News Website

A frontend login form was vulnerable to SQL injection, allowing the attacker to dump the entire database. The attacker then cracked a weak MD5 hash, found the admin panel via robots.txt, logged in, and uploaded a shell to achieve remote code execution.

Krishnadev P Melevila Follow

Published on infosecwriteups.com

Hey guys, It’s me Krishnadev P Melevila Again!! I am a self-made cyber enthusiast and Web application pentester.

Krishnadev P Melevila, on infosecwriteups.com

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 was vulnerable to SQL injection, passwords were hashed with unsalted MD5, the admin panel was discoverable via robots.txt, and the image upload lacked validation.

Impact

The attacker could access the entire database, log in as admin, and upload a shell to gain complete server access, potentially destroying the website.

What the attacker needed

None

The fix

The vulnerabilities were fixed by the site admin within two days after the report was validated.

How it was found

  1. Open the site and find a login page.
  2. Capture the login POST request with Burp Suite and exploit SQL injection with sqlmap to dump the database.
  3. Notice many password hashes are identical and crack one MD5 hash using an online decryptor.
  4. Find the admin panel URL in robots.txt.
  5. Log in to the admin panel with the cracked credentials.
  6. Use the image upload feature to upload a shell and gain remote code execution.

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 website's login form did not properly handle special characters, so an attacker could trick the database into revealing all its data. The stolen passwords were stored in a weak form that was easily reversed, and the admin panel was listed in a public file. Finally, the image upload feature allowed uploading a malicious script that gave full control of the server.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by Krishnadev P Melevila

View all

18 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.