Skip to content

Instantly share code, notes, and snippets.

@DaveGoosem
Created May 9, 2013 01:20
Show Gist options
  • Save DaveGoosem/5544894 to your computer and use it in GitHub Desktop.
Save DaveGoosem/5544894 to your computer and use it in GitHub Desktop.
Encode script for XSS testing
/*
Use the encodeURIComponent to allow you to switch out all characters to their encoded
values. You can then attempt to inject into forms using the encoded values.
Example Below:
*/
//in Web Tools (F12 in chrome), in the console, enter something like this:
encodeURIComponent('<script>alert("please soemthing")</script>')
//will return value like this which you can copy/paste into input fields on site to test
//for XSS vunerabilies.
"%3Cscript%3E%20alert(%22please%20soemthing%22)%3C%2Fscript%3E"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment