// op_003 — case study Live

Terminal Connection

[ iOS / Android Client ] React Native + xterm.js (WebView) custom virtual keyboard overlay | | WebSocket, short-lived signed token v [ Relay Broker ] Node.js + Socket.io session multiplexing, message routing host never exposes a public socket | | bidirectional stdin/stdout pipe v [ Kali Linux Host ] Python PTY server -- pty.spawn() pseudo-terminal on the host machine
Remote access to a personal Kali Linux box from a phone usually means a janky SSH client app or punching a hole straight to a public socket on the host — neither is acceptable when the host is running real offensive tooling. The goal was full interactive terminal access from iOS or Android, with the host never exposed directly to the internet and no hardcoded credentials anywhere in the chain.
PTY Server
A Python server uses pty.spawn to open a real pseudo-terminal on the host, piping stdin/stdout bidirectionally over WebSocket — the mobile client gets a genuine shell, not a command-and-response approximation.
Relay Broker
A Node.js/Socket.io relay sits between host and client, handling session multiplexing and message routing. The host never opens a public-facing socket — it only dials out to the relay.
Mobile Terminal
The React Native client embeds xterm.js inside a WebView, with a custom virtual keyboard overlay built specifically for terminal input — arrow keys, Ctrl combos, and Tab completion all need to exist on a screen with no physical keyboard.
Auth & Reconnection
Token-based auth uses short-lived signed tokens instead of stored credentials. The relay handles reconnection and session keepalives, so a dropped connection resumes the same terminal state instead of losing the session.
Three components, each with one job — host PTY, relay broker, mobile client — means no single piece needs to trust the others beyond a signed token. The result is a phone that can drive a full interactive Kali shell from anywhere, with the host's network surface unchanged from the outside.