0

I'm trying to write a parser (in php) for a cloudflare protected page. They have a form that i want to submit with the mentioned type of code. The whole code can look something like this. I have no clue at all how those exclamationmarks and brackets make numbers (strings).

var s,t,o,p,b,r,e,a,k,i,n,g,f, UagTEGd={"frHz":+((!+[]+!![]+!![]+!![]+[])+(+!![]))};
t = document.createElement('div');
t.innerHTML="<a href='/'>x</a>";
t = t.firstChild.href;r = t.match(/https?:\/\//)[0];
t = t.substr(r.length); t = t.substr(0,t.length-1);
a = document.getElementById('jschl-answer');
f = document.getElementById('challenge-form');
;UagTEGd.frHz*=+((+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]));UagTEGd.frHz+=!+[]+!![];UagTEGd.frHz+=+((!+[]+!![]+!![]+[])+(!+[]+!![]+!![]));UagTEGd.frHz*=+((!+[]+!![]+[])+(+[]));UagTEGd.frHz*=+!![];a.value = parseInt(UagTEGd.frHz, 10) + t.length; '; 121'
Floppy
  • 11
  • 2
  • `+[] = 0`, `!+[] = 1`, `!![] = 1`, `1+[] = "1"`, `"1" + 1 = "11"`. See if you can piece that out. – Jeff Mercado Jan 20 '17 at 21:41
  • Thanks for your answer / comment. I'll try to figure it out. Sorry i posted a duplicate question. – Floppy Jan 20 '17 at 21:46
  • [This article](http://www.jazcash.com/a-javascript-journey-with-only-six-characters/) offers a great explanation of this specific wat-worthy aspect of JS. – Matt Mokary Jan 20 '17 at 21:49

0 Answers0