Skip to content
File upload Write-up Intermediate

From file upload to email:pass

An unauthenticated file upload form allowed uploading a reverse shell disguised as an image by setting the Content-Type header to image/png. The attacker then executed the shell, found database credentials in a connection string, and queried the database to obtain administrator and user passwords.

fr0stNuLL Follow

Published on medium.com

Hi everybody, today I want to show you a cool experience that I had, doing a Pentest in a private program. First of all, I overshadowed all the sensitive information of the company.

fr0stNuLL, on medium.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

Impact

An unauthenticated attacker could execute arbitrary code on the server and access the database, potentially compromising all user accounts.

What the attacker needed

Unauthenticated access to upload form; server supports ASP

How it was found

  1. Find an unauthenticated form that allows file uploads.
  2. Upload a reverse shell file with .asp extension and set Content-Type to image/png.
  3. Obtain the upload path from the application response.
  4. Access the uploaded shell to get a reverse shell.
  5. Search for sensitive files and find a database connection string.
  6. Use the database credentials to query the database and retrieve user passwords.

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 file upload form let anyone send files. The attacker uploaded a malicious script that gave them control of the server. Then they found a file with database login details and used it to read user passwords.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by fr0stNuLL

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.