Skip to content
XSS Write-up Beginner

The Marketplace Xss Sqli And More

A deliberately vulnerable CTF web shop stored user-supplied product titles without sanitising them, so a script in the title ran in the admin's browser and let the author steal the admin session cookie. The admin panel then exposed a SQL injection in a user parameter, which revealed a cleartext password for another user, and that account led to privilege escalation to root.

alda69 Follow

Published on systemweakness.com

This is a writeup to the Marketplace CTF on TryHackMe.

alda69, on systemweakness.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 attacker could run script in the admin's browser, steal the admin session and read private messages containing cleartext passwords, then escalate to root on the host.

What the attacker needed

A free account on the shop; victim (admin) views the reported product; attacker-hosted listener reachable

How it was found

  1. Scan the target to find the open SSH and HTTP ports
  2. Browse the shop, fuzz for hidden directories and create an account
  3. Put a script in the product title field and report the product to the admin
  4. Capture the admin cookie sent to a local listener and swap it into the browser
  5. Use the admin panel user lookup with a UNION query to read the messages table
  6. Log in over SSH as the user whose cleartext password was found

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.

This is a practice challenge, not a real product. A web page showed text that a user typed back to other people without cleaning it, so a small script hidden in that text ran inside the administrator's browser. The attacker used that to copy the administrator's login cookie, which is the token a browser sends to prove who you are, and then logged in as the admin.

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.