Skip to content

Instantly share code, notes, and snippets.

@Jineeshak
Forked from Rhynorater/XSSbookmarklet.js
Created January 10, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jineeshak/17cded23b5c08a3c55490fa0c14b2323 to your computer and use it in GitHub Desktop.
Save Jineeshak/17cded23b5c08a3c55490fa0c14b2323 to your computer and use it in GitHub Desktop.
XSS Discovery Bookmarklet
javascript:(function()%7Bvar j %3D document.getElementsByTagName("input")%3Bif (document.location.href.indexOf("%3F")>-1)%7Bvar l %3D "%26"%3B%7Delse%7Bvar l %3D "%3F"%3B%7Dfor (i%3D0%3Bi<j.length%3Bi%2B%2B)%7Bl%2B%3Dj%5Bi%5D.getAttribute("name")%2B'%3D"><test1234>%26'%7Ddocument.location %3D document.location%2Bl%7D)()
@Jineeshak
Copy link
Author

Jineeshak commented Jan 10, 2018

javascript:(function()%7Bvar str='';var attack=prompt('Attack','');if(!attack)return false;function getallelems(v)%7Bvar ii=document.getElementsByTagName(v);for(var i=0;i<ii.length;i++)%7Bif(!ii%5Bi%5D.name)continue;str+=(str?'&':'')+ii%5Bi%5D.name+'='+attack;%7D%7Dgetallelems('input');getallelems('textarea');getallelems('select');str=document.location.search+(document.location.search.indexOf('?')==-1?'?':'&')+str;alert(str);document.location.search=str;%7D)();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment