Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Created January 26, 2016 00:24
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 JavaScript-Packer/a208d091cd9b9fac132d to your computer and use it in GitHub Desktop.
Save JavaScript-Packer/a208d091cd9b9fac132d to your computer and use it in GitHub Desktop.
Hidden evil eval in JavaScript www.JavaScriptCrypt.com
var evil_eval = (!+[] + [])[!+[] + !+[] + !+[]] + "v" + (!1 + [])[+!+[]] + (!1 + [])[!+[] + !+[]];
function test() {
alert("WHAK.com");
}
this[evil_eval](test());
@JavaScript-Packer
Copy link
Author

Minified it down a bit for ya:

function test(){alert("WHAK.com")}var evil_eval=(!0+[])[3]+"v"+(!1+[])[1]+(!1+[])[2];this[evil_eval](test());

@JavaScript-Packer
Copy link
Author

Rid of the letter v?

//var evil_eval=(!0+[])[3]+"v"+(!1+[])[1]+(!1+[])[2];
var evil_eval=(!0+[])[3]+"\x76"+(!1+[])[1]+(!1+[])[2];
var evil_eval=(!0+[])[3]+\u0076+(!1+[])[1]+(!1+[])[2];//doesn't work, thinks v is a function
var evil_eval=(!0+[])[3]+"\166"+(!1+[])[1]+(!1+[])[2];

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