Skip to content
XSS Write-up Beginner

Deface XSS

A reflected cross-site scripting flaw was found on a website, allowing an attacker to inject script that replaces the whole page with attacker-controlled HTML. The author demonstrates turning the injection into a full-page defacement.

medium.com

Published on medium.com

Hufft, in my first article here this time, I want to try to do some inject XSS with HTML full-page script. It can be called with “injecting, and then it will show your HTML page”

Rafli Setyawan, 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 site reflected user input into the page without encoding it, so injected script executed in the browser.

Impact

An attacker could make the site display arbitrary attacker-controlled content to any visitor who triggers the injection, effectively defacing the page.

What the attacker needed

A vulnerable input field; victim loads the crafted input

How it was found

  1. Test the target input with a simple script alert to see if it executes.
  2. Convert a full defacement HTML page into character codes using an online text-to-ASCII tool.
  3. Wrap the character codes in a script that sets the page's inner HTML from those codes.
  4. Paste the resulting script into the vulnerable input on the target page and press Enter.

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.

Cross-site scripting (XSS) is when a website puts text from a user into a page without cleaning it, so that text can run as code in a visitor's browser. Here the injected script rewrites the entire page, so the site appears defaced to anyone who loads the crafted link.

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.