Skip to content
File upload Write-up Intermediate

From basic User to full right Admin access on the server (via XSS, LFI, WebShell)

A tester on a single subdomain found several weaknesses, including a user search that returned extra account details, blind and stored cross-site scripting that leaked an administrator's session token, a readable server log file, and an upload feature that kept the original file extension. By uploading a PHP web shell the tester gained full control of the server and could reach more than ten other projects hosted on it.

medium.com

Published on medium.com

Imagine that you have a business in partnership with someone. At some point, you have an internal conflict.

Valeriy Shevchenko, 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

Root cause

Likely the upload feature renamed files but preserved their extension and did not restrict allowed types, so executable PHP could be stored and run from the web root.

Impact

The tester could run commands on the server and reach more than ten other projects in the root directory, and the other findings could expose user data and administrator tokens.

What the attacker needed

A low-privileged account; ability to create articles; victim opens crafted email or support ticket

How it was found

  1. Create an article and use the wallpaper upload feature
  2. Upload an XML file and observe that the server keeps the .xml extension
  3. Upload a PHP web shell file and note the returned filename
  4. Request the uploaded file directly to run the shell

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 site let people upload a picture for an article, but it did not check what kind of file it was, so the tester uploaded a small program written in PHP (a language many websites use) and the server ran it. That program, called a web shell, gives the attacker a control panel for the server. Separately, a support form and an email template ran attacker-supplied script in an administrator's browser, which let the tester steal the admin's login token.

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.

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.