A cinematic, terminal-only simulated web OS built with Next.js.
r00tsh is an interactive browser terminal that simulates a compromised Linux host end-to-end: boot sequence, shell navigation, network activity, service/process control, missions, and persistent state. It is intentionally terminal-only, with no desktop metaphors or GUI applications.
https://r00tsh.martincasais.com
GIF placeholder: docs/r00tsh-demo.gif
- Terminal-only OS simulation with CRT/glow visual style and boot sequence
- Stateful shell with
cwd, prompt, history, env vars, pipes (|) and chaining (&&) - Context-aware Tab autocomplete for commands, files, and paths
- Persistent simulated filesystem with read/write operations (
touch,mkdir,rm,cp,mv, redirects) - Simulated users and permissions (
su,sudo,chmod,chown, access checks) - Multi-host SSH simulation with isolated remote shell contexts
- Simulated process table and live
topmode - Service manager and log workflows (
service,systemctl,journalctl,tail -f) - Mission/CTF workflow (
mission list/start/hint/submit) with persistent progress - Fake package manager (
rpk) with install/remove/info behavior - Persistent OS state in browser storage (
save,reboot,reset --factory) - In-terminal nano-like editor with save/exit controls
r00tsh follows a modular terminal engine:
- Presentation layer renders terminal UI, boot flow, cursor/input, and interaction modes.
- Command runtime parses commands, handles redirection/pipes/chaining, dispatches command handlers.
- OS simulation modules provide filesystem, shell context, network, processes, services, packages, missions, and persistence.
- State persistence layer snapshots and restores simulated OS data from browser storage.
This keeps high-frequency UI concerns in React components and simulation behavior in lib/*.
- Terminal.tsx: terminal UI, input loop, autocomplete interaction, top/editor modes, reboot transition
- BootSequence.tsx: startup cinematic and system boot reveal
- Editor.tsx: nano-like in-terminal editor surface
- commands.ts: parser/dispatcher and command handlers
- shell.ts: shell session state, prompt, env, history, user context, remote stack
- filesystem.ts: simulated Unix tree, metadata helpers, mutable FS operations
- network.ts: host map, SSH targets, ping/curl/netstat/route/DNS simulation
- processes.ts: dynamic process simulation, kill behavior, top snapshots
- services.ts: service registry/state, status/start/stop/restart, journal sources
- permissions.ts: user/group model and read/write/execute checks
- missions.ts: mission definitions, progression, hints, answer validation
- packages.ts: fake package manager and installable tool payloads
- osState.ts: browser persistence and factory reset lifecycle
- lore.ts: canonical narrative constants and story context
# shell + filesystem
pwd
ls -la /root
cat /var/log/auth.log
echo "incident marker" >> /tmp/notes.log
mkdir /tmp/evidence && cp /var/log/syslog /tmp/evidence/syslog.copy
# users + permissions
whoami
su ghost
sudo cat /etc/shadow
chmod 600 /tmp/notes.log
chown root:root /tmp/notes.log
# network + remote access
hosts
nmap 10.0.0.0/24
ssh 10.0.0.15
netstat -an
dig zetacorp-srv-04.zetacorp.com
# services + processes
service status
service stop beacon
systemctl status watchdog
journalctl -u beacon
ps aux
top
# missions + packages + persistence
mission list
mission start dropzone
mission hint
rpk list
rpk install scanner
save
reboot
reset --factoryThe mission layer turns the shell into a structured investigation flow:
mission listshows available objectivesmission start <id>activates a missionmission statusreports active/completed progressmission hintgives directional clues without full answersmission submit <answer>validates findings against simulated evidence
Current mission themes focus on:
- Identifying exfiltration infrastructure
- Finding and stopping malicious beacon activity
- Recovering and submitting the passphrase from host artifacts
Mission progress is persisted in browser storage with the rest of the OS state.
- Node.js 20+
- npm 10+ (or compatible package manager)
npm install
npm run devOpen: http://localhost:3000
npm run lintAll operating system, network, process, and service behavior in r00tsh is simulated in application code. There is no real host compromise, lateral movement, or network attack execution. The project is built for safe interactive storytelling, terminal UX engineering, and portfolio demonstration.
