Skip to content
XSS Write-up Beginner

XSS: Enjeksiyondan Kör Atağa Bir Saldırganın Not Defteri

The text explains XSS types and demonstrates reflected, stored, DOM-based, and blind XSS in PortSwigger labs. An attacker could execute JavaScript in a victim's browser to steal cookies or session data, with blind XSS enabling admin compromise.

medium.com

Published on medium.com

Web uygulaması kullanıcıdan veri alır, bunu işler ve sayfaya yazar. Sorun şu: bu veri güvenilir mi?

Buraktekcan, 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 missing output encoding and unsafe use of DOM sinks such as innerHTML, allowing user input to be interpreted as HTML or JavaScript.

Impact

An attacker could steal session cookies and take over accounts, including admin sessions via blind XSS, though the text only demonstrates this in lab environments.

What the attacker needed

Victim clicks a link (reflected); victim views a page (stored); victim visits a crafted URL (DOM); admin views submitted content (blind)

The fix

The text states that real defence is allowlist, output encoding, and CSP, but does not say a specific fix was applied.

How it was found

  1. Enter test in the search box and inspect the response in Burp Proxy to see if the value is reflected unencoded.
  2. Send a request with a script payload in the search parameter via Burp Repeater and observe execution.
  3. Submit a script payload in the name field of a blog comment form and reload the page to see it execute.
  4. Read the page source to find JavaScript that reads location.hash and writes it to innerHTML.
  5. Craft a URL with a payload after the hash and load it to trigger DOM-based XSS.
  6. Submit a payload that sends an HTTP request to a Collaborator URL via a feedback form and wait for the callback.

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) happens when a website takes input from a user and puts it into a page without making it safe, so a browser runs it as code. An attacker can then run their own JavaScript in someone else's browser, which can steal login cookies or show fake forms. The text walks through lab examples of different XSS types.

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.