@miraj181/ipingyou 1.0.2 β 2.0.1
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/README.md +75 -102
- package/package.json +8 -3
- package/src/cli.js +84 -4
- package/src/lib/chat.js +333 -0
- package/src/lib/cleanup.js +78 -0
- package/src/lib/config.js +41 -0
- package/src/lib/crypto.js +23 -14
- package/src/lib/platform.js +415 -53
- package/src/modes/client.js +451 -58
- package/src/modes/host.js +416 -119
package/README.md
CHANGED
|
@@ -1,133 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>π iPingYou β SecureLink CLI v2.0</h1>
|
|
3
|
+
<p><strong>Military-Grade, Zero-Knowledge P2P Remote Access & Collaboration Tool</strong></p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@miraj181/ipingyou)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
</div>
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
---
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
Host Machine Broker (Express.js) Client Machine
|
|
9
|
-
ββββββββββββββββ POST ββββββββββββββββββββ GET ββββββββββββββββ
|
|
10
|
-
β cloudflared βββ/registerβββΆβ In-Memory Map βββ/resolveβββ ipingyou β
|
|
11
|
-
β tunnel :22 β {uid,url} β AES-256-CBC β /:uid β connect β
|
|
12
|
-
β β β 1hr TTL expiry β β β
|
|
13
|
-
β SSH daemon βββββββββββββββββββββββββββββββββββββββββββββββββ SSH via β
|
|
14
|
-
β β cloudflared β β ProxyCmd β ProxyCmd β
|
|
15
|
-
ββββββββββββββββ TCP proxy ββββββββββββββββββββ ββββββββββββββββ
|
|
16
|
-
```
|
|
12
|
+
**iPingYou** is a zero-configuration Node.js CLI that establishes AES-encrypted, peer-to-peer SSH tunnels using Cloudflare's Edge network. Version 2.0 introduces **End-to-End Encrypted WebSockets**, **Terminal Mirroring**, **Passwordless Ephemeral Keys**, and **Background Daemonization**.
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
1. **Host** starts `ipingyou host` β generates an 8-char UID, spins up `cloudflared` tunnel, registers with broker
|
|
20
|
-
2. **Host** shares UID with the client (verbally, chat, etc.)
|
|
21
|
-
3. **Client** runs `ipingyou connect` β enters UID, broker resolves it to tunnel URL β SSH connects via cloudflared proxy
|
|
22
|
-
4. On `Ctrl+C`, all spawned processes are killed via `tree-kill` and the UID is revoked from the broker
|
|
14
|
+
No firewalls to configure. No port forwarding. No plaintext leakage.
|
|
23
15
|
|
|
24
|
-
##
|
|
16
|
+
## β¨ God-Tier Features (New in v2.0)
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
* π **Ephemeral Passwordless Auth**: The Host automatically injects a temporary `Ed25519` key into `authorized_keys`. Clients connect instantly without knowing the machine's actual root/user password. Keys are purged immediately on exit.
|
|
19
|
+
* π¬ **E2E Web Crypto Chat Room**: A real-time, browser-based chat UI using native Web Crypto API (`AES-GCM`). Your chat keys are passed via URL fragments (`#password`) so they never touch a serverβnot even the Host machine's Node server!
|
|
20
|
+
* πΊ **Terminal Mirroring**: Wrap client SSH sessions in a multiplexed `tmux` terminal. The Host can spectate connected clients in real-time right from the dashboard to audit or assist.
|
|
21
|
+
* π **Reverse Port Forwarding (`ssh -R`)**: Clients can expose their *local* `localhost` development ports back to the Host through the secure tunnel.
|
|
22
|
+
* π‘ **Hardware Telemetry Verification**: Clients silently generate hardware footprint reports (OS, RAM, CPU, IP), encrypt them locally with the session password, and send them to the Host for authorization.
|
|
23
|
+
* π¨ **Panic Kill-Switch**: Type `ipingyou panic` to instantly vaporize all associated keys, wipe all alias configs, and send a `SIGKILL` to every active tunnel and SSH shell.
|
|
24
|
+
* π» **Daemonization**: Run `ipingyou service install` to quietly install and run the Host listener in the background (survives system reboots using PM2).
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
cd ipingyou
|
|
30
|
-
cp .env.example .env
|
|
31
|
-
npm install
|
|
32
|
-
npm run broker
|
|
33
|
-
# Broker: http://localhost:4000
|
|
34
|
-
```
|
|
26
|
+
---
|
|
35
27
|
|
|
36
|
-
|
|
28
|
+
## π Quick Start
|
|
37
29
|
|
|
30
|
+
You don't need to download any code. `iPingYou` runs natively from the global npm registry.
|
|
31
|
+
|
|
32
|
+
### The "On-the-Fly" Way (Recommended)
|
|
38
33
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
npx ipingyou
|
|
42
|
-
```
|
|
34
|
+
# Start the interactive wizard
|
|
35
|
+
npx @miraj181/ipingyou
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
# Instantly spin up your machine as a Host
|
|
38
|
+
npx @miraj181/ipingyou host
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
npx ipingyou connect
|
|
48
|
-
# or interactively:
|
|
49
|
-
npx ipingyou
|
|
40
|
+
# Connect to a remote machine using a session UID
|
|
41
|
+
npx @miraj181/ipingyou connect
|
|
50
42
|
```
|
|
51
43
|
|
|
52
|
-
|
|
44
|
+
### Global Install
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @miraj181/ipingyou
|
|
53
47
|
|
|
48
|
+
# Execute globally using aliases:
|
|
49
|
+
ipingyou
|
|
50
|
+
# or
|
|
51
|
+
securelink
|
|
54
52
|
```
|
|
55
|
-
ipingyou Interactive mode (prompts for host/client)
|
|
56
|
-
ipingyou host Start as host β allow remote access
|
|
57
|
-
ipingyou connect Start as client β access a remote machine
|
|
58
|
-
ipingyou broker Start the central broker server
|
|
59
|
-
ipingyou broker -p 5000 Start broker on custom port
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Prerequisites
|
|
63
53
|
|
|
64
|
-
|
|
65
|
-
|------|----------|---------|
|
|
66
|
-
| Node.js β₯18 | β
| [nodejs.org](https://nodejs.org) |
|
|
67
|
-
| `ssh` | β
| Ships with macOS/Linux; `winget install Microsoft.OpenSSH.Client` on Windows |
|
|
68
|
-
| `cloudflared` | β
| `brew install cloudflared` / [download](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) |
|
|
54
|
+
---
|
|
69
55
|
|
|
70
|
-
|
|
56
|
+
## π Zero-Knowledge Architecture
|
|
71
57
|
|
|
72
|
-
|
|
58
|
+
The public broker server exists solely to rendezvous connections. It is fundamentally a **"Dumb Pipe"**.
|
|
73
59
|
|
|
60
|
+
```mermaid
|
|
61
|
+
graph LR
|
|
62
|
+
H[Host CLI] -->|AES-256-CBC Encrypted Payload| B((Broker Relay))
|
|
63
|
+
B -->|Encrypted Payload| C[Client CLI]
|
|
64
|
+
C -->|Locally Decrypts Password| C
|
|
65
|
+
C -->|Direct Cloudflare SSH| H
|
|
66
|
+
C -->|E2E AES-GCM WebSockets| H
|
|
74
67
|
```
|
|
75
|
-
ipingyou/
|
|
76
|
-
βββ src/
|
|
77
|
-
β βββ cli.js β Main CLI entry (npx-ready, shebang)
|
|
78
|
-
β βββ server.js β Central Broker (Express.js)
|
|
79
|
-
β βββ lib/
|
|
80
|
-
β β βββ cleanup.js β Graceful shutdown + tree-kill
|
|
81
|
-
β β βββ crypto.js β AES-256-CBC encrypt/decrypt
|
|
82
|
-
β β βββ platform.js β OS detection + dependency check
|
|
83
|
-
β β βββ uid.js β Random 8-char UID generator (nanoid)
|
|
84
|
-
β βββ modes/
|
|
85
|
-
β βββ host.js β Host mode logic
|
|
86
|
-
β βββ client.js β Client mode logic
|
|
87
|
-
βββ .env.example
|
|
88
|
-
βββ .gitignore
|
|
89
|
-
βββ package.json
|
|
90
|
-
βββ render.yaml β One-click Render deploy
|
|
91
|
-
βββ README.md
|
|
92
|
-
```
|
|
93
68
|
|
|
94
|
-
|
|
69
|
+
1. **Host** starts up, spawns `cloudflared` tunnels for SSH and Chat, and generates a random, offline **AES-256 Session Password**.
|
|
70
|
+
2. **Host** encrypts the tunnel data with the password and sends the *ciphertext* to the Broker alongside a short UID.
|
|
71
|
+
3. **Client** runs `ipingyou connect`, enters the UID and Password.
|
|
72
|
+
4. **Client** fetches the ciphertext, decrypts it locally, and connects directly via SSH and WebSockets.
|
|
73
|
+
5. On `Ctrl+C`, `tree-kill` initiates a graceful shutdown, revokes the UID from the broker, and scrubs `/tmp` memory.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## π Prerequisites
|
|
95
78
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
| Tool | Required | Installation Guide |
|
|
80
|
+
|------|----------|--------------------|
|
|
81
|
+
| **Node.js β₯18** | β
| [nodejs.org](https://nodejs.org) |
|
|
82
|
+
| **`ssh`** | β
| Ships native on macOS/Linux. Windows: `winget install Microsoft.OpenSSH.Client` |
|
|
83
|
+
| **`cloudflared`** | β
| `brew install cloudflared` or [Download Here](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) |
|
|
84
|
+
| **`tmux`** | γ°οΈ | *Optional*. Required on Host machine if you want to use **Terminal Mirroring**. |
|
|
102
85
|
|
|
103
|
-
|
|
86
|
+
*(Note: The CLI auto-detects your OS and will attempt to guide you on how to install any missing dependencies!)*
|
|
104
87
|
|
|
105
|
-
|
|
106
|
-
2. Go to [render.com/new](https://render.com/new)
|
|
107
|
-
3. Click **"New Web Service"** β connect your repo
|
|
108
|
-
4. Render auto-detects `render.yaml` β click **Deploy**
|
|
109
|
-
5. Set `SECRET_KEY` in Render Dashboard β Environment
|
|
110
|
-
6. Set `BROKER_URL` in your local `.env` to your Render URL
|
|
88
|
+
---
|
|
111
89
|
|
|
112
|
-
##
|
|
90
|
+
## π CLI Command Reference
|
|
113
91
|
|
|
114
|
-
|
|
|
115
|
-
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
92
|
+
| Command | Description |
|
|
93
|
+
|---------|-------------|
|
|
94
|
+
| `ipingyou` | Interactive CLI dashboard wizard. |
|
|
95
|
+
| `ipingyou host` | Start hosting and exposing your local machine securely. |
|
|
96
|
+
| `ipingyou connect -u <UID>` | Connect directly to a specific UID. |
|
|
97
|
+
| `ipingyou panic` | π¨ Self-destruct mode. Wipes configs, memory, and kills all processes. |
|
|
98
|
+
| `ipingyou service install` | π» Installs Host mode as an always-on background daemon. |
|
|
99
|
+
| `ipingyou service stop` | Stops and removes the background daemon. |
|
|
119
100
|
|
|
120
|
-
|
|
101
|
+
---
|
|
121
102
|
|
|
122
|
-
|
|
123
|
-
|--------|-------------------|----------|
|
|
124
|
-
| Interface | Shell scripts + web dashboard | Interactive Node.js CLI |
|
|
125
|
-
| Direction | One-way (runner β C2) | Peer-to-peer (host β client) |
|
|
126
|
-
| UID System | Hardcoded PC IDs | Random per-session UIDs |
|
|
127
|
-
| Process Mgmt | Manual | tree-kill auto-cleanup |
|
|
128
|
-
| Install | Copy scripts | `npx ipingyou` |
|
|
129
|
-
| Modes | Reporter only | Host + Client + Broker |
|
|
103
|
+
## π License
|
|
130
104
|
|
|
131
|
-
|
|
105
|
+
[MIT License](LICENSE) Β© Sk Mirajul Islam
|
|
132
106
|
|
|
133
|
-
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraj181/ipingyou",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "SecureLink-CLI β Secure peer-to-peer remote access via SSH & Cloudflare Tunnels",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -45,10 +45,15 @@
|
|
|
45
45
|
"chalk": "^5.3.0",
|
|
46
46
|
"commander": "^12.1.0",
|
|
47
47
|
"execa": "^9.5.2",
|
|
48
|
+
"express": "^5.2.1",
|
|
49
|
+
"express-rate-limit": "^8.5.2",
|
|
50
|
+
"helmet": "^8.1.0",
|
|
48
51
|
"inquirer": "^12.3.2",
|
|
49
52
|
"nanoid": "^5.0.9",
|
|
53
|
+
"open": "^11.0.0",
|
|
50
54
|
"ora": "^8.1.1",
|
|
51
|
-
"tree-kill": "^1.2.2"
|
|
55
|
+
"tree-kill": "^1.2.2",
|
|
56
|
+
"ws": "^8.20.1"
|
|
52
57
|
},
|
|
53
58
|
"devDependencies": {
|
|
54
59
|
"nodemon": "^3.1.4"
|
|
@@ -57,4 +62,4 @@
|
|
|
57
62
|
"node": ">=18.0.0"
|
|
58
63
|
},
|
|
59
64
|
"type": "module"
|
|
60
|
-
}
|
|
65
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -23,9 +23,14 @@ import inquirer from 'inquirer';
|
|
|
23
23
|
import chalk from 'chalk';
|
|
24
24
|
|
|
25
25
|
import { detectOS, checkDependencies } from './lib/platform.js';
|
|
26
|
-
import { installShutdownHandlers } from './lib/cleanup.js';
|
|
26
|
+
import { installShutdownHandlers, executePanicMode } from './lib/cleanup.js';
|
|
27
27
|
import { startHostMode } from './modes/host.js';
|
|
28
28
|
import { startClientMode } from './modes/client.js';
|
|
29
|
+
import { execa } from 'execa';
|
|
30
|
+
import path from 'node:path';
|
|
31
|
+
import { fileURLToPath } from 'node:url';
|
|
32
|
+
|
|
33
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
34
|
|
|
30
35
|
// βββ ASCII Banner ββββββββββββββββββββββββββββββββββββββββββββ
|
|
31
36
|
function showBanner() {
|
|
@@ -67,10 +72,20 @@ function showRichHelp() {
|
|
|
67
72
|
console.log(` β’ The Broker never sees your plaintext URL, only ciphertext.`);
|
|
68
73
|
console.log('');
|
|
69
74
|
|
|
75
|
+
console.log(chalk.bold.white(' π₯ Advanced Features:'));
|
|
76
|
+
console.log(` β’ ${chalk.green('Terminal Mirroring')} : Host can spectate connected SSH clients in real-time.`);
|
|
77
|
+
console.log(` β’ ${chalk.green('Reverse Forwarding')} : Clients can expose their local localhost ports back to the Host.`);
|
|
78
|
+
console.log(` β’ ${chalk.green('E2E Chat Room')} : Real-time Web Crypto AES-GCM secure chat UI for Host & Clients.`);
|
|
79
|
+
console.log(` β’ ${chalk.green('Daemonization')} : Run Host mode as a background service via PM2.`);
|
|
80
|
+
console.log(` β’ ${chalk.green('Panic Kill-Switch')} : Instantly purge all processes, configurations, and traces.`);
|
|
81
|
+
console.log('');
|
|
82
|
+
|
|
70
83
|
console.log(chalk.bold.white(' π‘ Examples:'));
|
|
71
|
-
console.log(` $ npx ipingyou
|
|
72
|
-
console.log(` $ npx ipingyou host
|
|
73
|
-
console.log(` $ npx ipingyou connect
|
|
84
|
+
console.log(` $ npx ipingyou ${chalk.dim('# Interactive wizard (Recommended)')}`);
|
|
85
|
+
console.log(` $ npx ipingyou host ${chalk.dim('# Quick start as Host')}`);
|
|
86
|
+
console.log(` $ npx ipingyou connect ${chalk.dim('# Quick start as Client')}`);
|
|
87
|
+
console.log(` $ npx ipingyou panic ${chalk.dim('# Self-destruct and wipe memory/traces')}`);
|
|
88
|
+
console.log(` $ npx ipingyou service install ${chalk.dim('# Install Host mode as a background daemon')}`);
|
|
74
89
|
console.log('');
|
|
75
90
|
}
|
|
76
91
|
|
|
@@ -91,6 +106,16 @@ function fatal(context, err) {
|
|
|
91
106
|
process.exit(1);
|
|
92
107
|
}
|
|
93
108
|
|
|
109
|
+
// βββ Process-Level Error Catching ββββββββββββββββββββββββββββ
|
|
110
|
+
process.on('uncaughtException', (err) => {
|
|
111
|
+
fatal('uncaughtException', err);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
process.on('unhandledRejection', (reason) => {
|
|
115
|
+
const err = reason instanceof Error ? reason : new Error(String(reason));
|
|
116
|
+
fatal('unhandledRejection', err);
|
|
117
|
+
});
|
|
118
|
+
|
|
94
119
|
// βββ Interactive Mode Selection ββββββββββββββββββββββββββββββ
|
|
95
120
|
async function interactiveMode() {
|
|
96
121
|
showBanner();
|
|
@@ -158,6 +183,7 @@ program
|
|
|
158
183
|
.name('ipingyou')
|
|
159
184
|
.description('SecureLink-CLI β Secure P2P remote access via SSH & Cloudflare Tunnels')
|
|
160
185
|
.version('1.0.0')
|
|
186
|
+
.option('-b, --broker <url>', 'Override the central broker URL')
|
|
161
187
|
.addHelpText('beforeAll', () => {
|
|
162
188
|
showBanner();
|
|
163
189
|
showRichHelp();
|
|
@@ -169,6 +195,9 @@ program
|
|
|
169
195
|
.description('Start host mode β allow remote access to this machine')
|
|
170
196
|
.action(async () => {
|
|
171
197
|
try {
|
|
198
|
+
const opts = program.opts();
|
|
199
|
+
if (opts.broker) process.env.BROKER_URL = opts.broker;
|
|
200
|
+
|
|
172
201
|
showBanner();
|
|
173
202
|
showSystemInfo();
|
|
174
203
|
installShutdownHandlers();
|
|
@@ -185,6 +214,9 @@ program
|
|
|
185
214
|
.option('-u, --uid <uid>', 'The remote host UID')
|
|
186
215
|
.action(async () => {
|
|
187
216
|
try {
|
|
217
|
+
const opts = program.opts();
|
|
218
|
+
if (opts.broker) process.env.BROKER_URL = opts.broker;
|
|
219
|
+
|
|
188
220
|
showBanner();
|
|
189
221
|
showSystemInfo();
|
|
190
222
|
installShutdownHandlers();
|
|
@@ -195,9 +227,57 @@ program
|
|
|
195
227
|
}
|
|
196
228
|
});
|
|
197
229
|
|
|
230
|
+
program
|
|
231
|
+
.command('panic')
|
|
232
|
+
.description('π¨ Self-destruct mode: wipe all configs, kill tunnels, and remove traces')
|
|
233
|
+
.action(async () => {
|
|
234
|
+
try {
|
|
235
|
+
showBanner();
|
|
236
|
+
await executePanicMode();
|
|
237
|
+
} catch (err) {
|
|
238
|
+
fatal('panic', err);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
program
|
|
243
|
+
.command('service <action>')
|
|
244
|
+
.description('π» Manage background daemon (actions: install, stop, status)')
|
|
245
|
+
.action(async (action) => {
|
|
246
|
+
try {
|
|
247
|
+
showBanner();
|
|
248
|
+
console.log(chalk.bold.cyan(' π» Background Service Manager'));
|
|
249
|
+
console.log(chalk.dim(' ββββββββββββββββββββββββββββββββββββββ'));
|
|
250
|
+
|
|
251
|
+
const { execaCommand } = await import('execa');
|
|
252
|
+
|
|
253
|
+
if (action === 'install') {
|
|
254
|
+
console.log(chalk.dim(' Installing PM2 globally and starting host...'));
|
|
255
|
+
await execaCommand('npm install -g pm2', { stdio: 'inherit' });
|
|
256
|
+
await execaCommand('pm2 start ipingyou --name "ipingyou-host" -- host', { stdio: 'inherit' });
|
|
257
|
+
await execaCommand('pm2 save', { stdio: 'inherit' });
|
|
258
|
+
await execaCommand('pm2 startup', { stdio: 'inherit' });
|
|
259
|
+
console.log(chalk.green('\n β
Service installed and running in the background.'));
|
|
260
|
+
} else if (action === 'stop') {
|
|
261
|
+
await execaCommand('pm2 stop ipingyou-host', { stdio: 'inherit' });
|
|
262
|
+
await execaCommand('pm2 delete ipingyou-host', { stdio: 'inherit' });
|
|
263
|
+
await execaCommand('pm2 save', { stdio: 'inherit' });
|
|
264
|
+
console.log(chalk.green('\n β
Service stopped and removed.'));
|
|
265
|
+
} else if (action === 'status') {
|
|
266
|
+
await execaCommand('pm2 status ipingyou-host', { stdio: 'inherit' });
|
|
267
|
+
} else {
|
|
268
|
+
console.log(chalk.red(` β Unknown action: ${action}. Use install, stop, or status.`));
|
|
269
|
+
}
|
|
270
|
+
} catch (err) {
|
|
271
|
+
fatal('service', err);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
198
275
|
// βββ Default: interactive mode ββββββββββββββββββββββββββββββ
|
|
199
276
|
program.action(async () => {
|
|
200
277
|
try {
|
|
278
|
+
const opts = program.opts();
|
|
279
|
+
if (opts.broker) process.env.BROKER_URL = opts.broker;
|
|
280
|
+
|
|
201
281
|
installShutdownHandlers();
|
|
202
282
|
await interactiveMode();
|
|
203
283
|
} catch (err) {
|