Skip to content

Shivam-AtlasX/linux_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Cyber Assassins

Linux Terminal Simulator

License: MIT HTML5 CSS3 JavaScript PRs Welcome Stars


A fully interactive, browser-based Linux terminal simulator for cybersecurity students and beginners.
Practice 100+ real Linux commands with zero setup β€” no VM, no installation, no risk.


πŸš€ Live Demo Β Β·Β  πŸ“‹ Command List Β Β·Β  🎨 Themes Β Β·Β  πŸ† Practice Challenges Β Β·Β  🀝 Contributing


πŸ’‘ Tip for your repo: record a short screen capture of the terminal in action (boot animation β†’ running a few commands β†’ switching themes), save it as assets/demo.gif, and it will automatically appear here.


πŸ“– What Is This?

Cyber Assassins is a zero-dependency, fully client-side Linux terminal simulator that runs entirely in your browser. It is designed for:

  • πŸŽ“ Cybersecurity students learning Linux for the first time
  • 🧠 Beginners who want to practice without breaking a real system
  • πŸ† CTF players brushing up on command-line fundamentals
  • πŸ‘©β€πŸ’» Developers who want a quick Linux command reference

Everything runs in-memory in your browser. No data is sent anywhere. No installation needed. Just open and type.


✨ Features

πŸ–₯️ Terminal Experience

Feature Details
100+ Commands Full coverage of navigation, files, permissions, processes, networking, and more
Virtual Filesystem In-memory filesystem that mirrors real Linux structure (/home, /etc, /var, /tmp, etc.)
Interactive nano Editor Full nano simulation with Ctrl+O save and Ctrl+X exit
Command History Arrow keys navigate history, just like a real shell
Tab Autocomplete Completes commands and filenames instantly
Multiple Tabs Open multiple terminal sessions side by side
Piping Support Basic pipe `
Redirection > and >> operators write to virtual files

πŸ” Full Permission Engine

A real Unix-style permission model β€” not just a display string, but an actual rules engine every command respects:

  • Numeric mode: 3-digit (755, 644) and 4-digit with special bits (4755 setuid, 2755 setgid, 1777 sticky)
  • Symbolic mode: single (u+x), comma-chained (u+rwx,g+rx,o-rwx), multi-class (ug+rw), bare operator defaults to "all" (+x)
  • chmod -R recursive and chmod -v verbose (shows before β†’ after)
  • chown user:group file (root only) and chown -R recursive
  • chgrp and chgrp -R recursive
  • Real groups: groupadd, usermod -aG group user, groups [user] β€” group-based access actually works, not just owner-vs-everyone
  • Enforced everywhere: cat/grep/head/tail need read Β· cd needs execute on the directory (the real Linux rule beginners always miss) Β· rm needs write on the parent directory, not the file itself Β· ./script.sh needs +x, while bash script.sh only needs read
  • Educational "Permission denied" messages β€” every denial explains why (which class, which bit) and suggests the exact chmod fix

🧰 Real-World Permission Scenarios

Three files seeded in a deliberately broken state, exactly like the classic sysadmin examples:

  • ~/.ssh/id_rsa β€” world-readable private key (should be 600)
  • ~/backup.sh β€” script missing its execute bit (should be 755)
  • /var/www/html/index.html β€” world-writable website file (should be 644)

Run scenarios to see the problems, fix them with real chmod commands, then scenarios check to verify.

πŸŽ“ Permissions Study Tools

  • revision chmod β€” an exam-style cheat sheet (numeric values, common modes, symbolic syntax, command summary)
  • quiz chmod β€” interview-style practice questions with hints, graded in real time

🌐 Networking Mode β€” A Real Second Machine

nmap, ssh, and scp are no longer flavor text. There's a second, fully independent virtual machine living inside the simulator:

  • nmap 10.0.0.5 β€” scans a real simulated target (webserver01) and returns its actual open ports (22/SSH, 80/HTTP, 3306/MySQL)
  • ssh deploy@10.0.0.5 (password: discoverable on the remote machine itself) β€” really connects, swapping your entire session into the remote filesystem, remote users, remote prompt
  • ssh root@10.0.0.5 β€” escalate to remote root and explore root-only files
  • scp user@host:file ./file / scp file user@host:file β€” real file transfer in both directions, with its own password authentication
  • exit β€” disconnects cleanly back to your local Kali machine; everything you did remotely persists for next time
  • 4 additional CTF flags hidden exclusively on the remote machine β€” reconnaissance, breaking in, exfiltration, and remote privilege escalation

βš™οΈ Process & Job Control β€” A Real Process Table

ps, top, kill, and jobs read from and mutate an actual process table, not static printed text:

  • A runaway process puzzle is seeded on boot β€” something is quietly consuming 97%+ CPU. Find it with ps aux or top (sorted by CPU, so it's impossible to miss), then kill -9 <PID> to stop it
  • sleep 10 & starts a real background job that completes over simulated time as you keep typing commands β€” jobs shows it transition from Running to Done
  • kill <PID> actually removes the process from the table; a later ps reflects the change

πŸ‘€ User & Session Simulation

  • Default user: student Β· password: toor (Kali default)
  • sudo su β†’ prompts for password β†’ switches to root
  • passwd β†’ interactive password change flow
  • exit from root β†’ returns to student
  • whoami, id, groups return realistic output

πŸ“š Educational Layer

  • πŸ’‘ Inline Tips β€” contextual tips appear after commands (40% chance, non-spammy)
  • πŸ“‹ Command Cheatsheet β€” full sidebar with all 100+ commands, click any to insert
  • πŸ—‚ File Explorer β€” visual sidebar showing the virtual filesystem tree
  • ⚠️ Danger Zone Warnings β€” rm -rf / shows a real-world impact warning
  • πŸ“– Man Pages β€” man <command> shows simplified, readable manual pages

🎨 Customization

  • 8 Built-in Themes β€” GitHub Dark, Matrix, VS Code, Kali Red, Midnight, Hacker, Dracula, Light
  • Custom Color Picker β€” change background, prompt, text, and accent colors live
  • Font Size Control β€” increase/decrease with +/βˆ’ buttons
  • Collapsible Panels β€” sidebar and cheatsheet can be toggled

🚩 CTF Mode β€” Capture The Flag

  • 7 hidden flags scattered across the filesystem, each teaching a real technique: hidden files, hidden directories, permission bypass, base64 decoding, archive extraction, root access, and recursive search
  • Live scoreboard panel with progress bar, points, and per-flag hints
  • Toast notifications the moment a flag is captured, right in the terminal
  • Hint system β€” type ctf hints or open the 🚩 CTF panel for nudges without spoilers
  • Commands: ctf, ctf hints, flags

πŸ’Ύ Persistent Sessions

  • Your filesystem, command history, theme, and CTF progress are automatically saved to the browser's localStorage after every command
  • Close the tab, come back later β€” Cyber Assassins remembers exactly where you left off
  • A faster "Welcome back" boot sequence plays for returning users, showing your saved CTF score
  • save β€” manually force a save Β· factory-reset β€” wipe everything and start clean

πŸ“œ Real Bash Script Execution

  • Write actual .sh scripts in the built-in nano editor β€” comments, variables (VAR=value), and variable substitution ($VAR, ${VAR}) are all supported
  • Run them for real with run script.sh or bash script.sh β€” each line executes through the same command engine as the interactive terminal, so anything you can type, a script can do
  • A safety cap (500 lines) prevents runaway loops from freezing the browser

πŸš€ Getting Started

Option 1 β€” Open Directly (Recommended)

# Just open index.html in any browser β€” no server needed
open index.html

Option 2 β€” GitHub Pages

Fork this repo β†’ Go to Settings β†’ Pages β†’ Set source to main branch β†’ Done.

Option 3 β€” Local Server

git clone https://github.com/shivam/cyber-assassins.git
cd cyber-assassins

# Python
python3 -m http.server 8080

# Node.js
npx serve .

# Then open: http://localhost:8080

πŸ“‹ Commands Reference

πŸ—‚ Navigation

Command Description
pwd Print working directory
ls List directory contents
ls -la Detailed listing with hidden files
cd <dir> Change directory
cd .. Go up one level
cd ~ Go to home directory
cd - Go to previous directory
tree Show directory tree

πŸ“ File Operations

Command Description
touch file Create empty file
mkdir dir Create directory
mkdir -p a/b/c Create nested directories
rm file Remove file
rm -r dir Remove directory recursively
rm -rf dir Force remove (shows danger warning)
cp src dst Copy file
cp -r src dst Copy directory
mv src dst Move or rename
ln -s src link Create symbolic link

πŸ‘ View & Edit Files

Command Description
cat file Display file contents
cat -n file Display with line numbers
less file Paginate through file
head file First 10 lines
head -n 20 file First N lines
tail file Last 10 lines
tail -f file Follow log file
wc -l file Count lines
wc -w file Count words
nano file Open interactive editor
echo "text" Print text
echo "text" > file Write to file
echo "text" >> file Append to file

πŸ” Permissions

Command Description
chmod 755 file Set permissions (numeric)
chmod 4755 file Numeric with setuid bit
chmod -R 755 dir/ Apply recursively
chmod -v 644 file Verbose β€” shows before β†’ after
chmod +x file Add execute permission (all classes)
chmod u+r file Add owner read permission
chmod o-w file Remove others write
chmod u+rwx,g+rx,o-rwx f Comma-chained symbolic mode
chown user file Change file owner (root only)
chown user:group file Change owner + group together (root)
chown -R user dir/ Recursive ownership change (root)
chgrp group file Change file group
chgrp -R group dir/ Recursive group change
umask Show default permission mask

πŸŽ“ Learn Permissions

Command Description
revision chmod Exam-style cheat sheet (numeric values, common modes, syntax)
quiz chmod Interview-style Q&A practice, graded in real time
scenarios 3 real-world permission problems to fix
scenarios check Verify your fixes against the real-world scenarios
groupadd name Create a new group (root)
usermod -aG group user Add a user to a group (root)
groups [user] Show group memberships

πŸ” Search & Find

Command Description
grep "pattern" file Search for pattern in file
grep -r "pattern" . Recursive search
grep -i "pattern" file Case-insensitive search
grep -n "pattern" file Show line numbers
grep -v "pattern" file Invert match
find . -name "*.txt" Find by filename
find . -type f Find files only
find . -type d Find directories only
locate filename Quick file search
which command Locate a command
whereis command Find binary, man, source

βš™οΈ System Info

Command Description
whoami Current username
id User ID and group memberships
groups List user groups
uname -a Full system information
hostname Machine hostname
uptime System uptime and load
date Current date and time
cal Calendar
df -h Disk space usage
du -h Directory size
lsblk Block devices
env Environment variables

πŸ”„ Processes (Real Process Table!)

Command Description
ps aux All running processes β€” find the runaway one
top Live monitor, sorted by CPU (runaway jumps to the top)
kill -9 <PID> Actually stops the process β€” verify with ps aux after
sleep 10 & Starts a real background job
jobs Shows your background jobs (Running β†’ Done over time)
fg Bring the most recent background job to foreground

πŸ‘€ Users & Auth

Command Description
sudo <command> Run command as root
sudo su Switch to root shell
su <user> Switch user
passwd Change your password
useradd <user> Create new user (root)
adduser <user> Create user interactively (root)
userdel <user> Delete user (root)

🌐 Network β€” Real Remote Machine

Command Description
nmap 10.0.0.5 Real scan of the simulated remote server
nmap -sV 10.0.0.5 Real scan with service version detection
ssh deploy@10.0.0.5 Really connects β€” find the password on the remote machine itself
ssh root@10.0.0.5 Connect directly as remote root (password: toor)
scp user@host:file ./file Real download from the remote machine
scp file user@host:file Real upload to the remote machine
exit Disconnect SSH cleanly back to local Kali
ping host Test connectivity (flavor text)
ifconfig Network interfaces
ip addr show IP addresses (modern)
ip route Routing table
netstat Network connections
curl url Fetch URL (flavor text)
wget url Download file (flavor text)

πŸ“¦ Archive & Compression

Command Description
tar -czf archive.tgz dir/ Create compressed archive
tar -xzf archive.tgz Extract archive
tar -tzf archive.tgz List archive contents
zip -r file.zip dir/ Create zip
unzip file.zip Extract zip
gzip file Compress with gzip
gunzip file.gz Decompress gzip

πŸ”€ Text Processing

Command Description
sort file Sort lines alphabetically
sort -r file Reverse sort
sort -n file Numeric sort
uniq file Remove consecutive duplicates
diff file1 file2 Show differences
cut -d: -f1 file Cut by delimiter
wc file Word, line, byte count
strings file Extract readable strings

πŸ›‘οΈ Kali Security Tools (Simulated)

Command Description
nmap Network mapper
sqlmap SQL injection tester
nikto Web server scanner
john Password cracker
hydra Login brute-forcer
hashcat Hash cracker
metasploit / msfconsole Exploit framework
aircrack-ng WiFi security tool
wireshark Packet analyzer (GUI note)

πŸ”§ Developer Tools (Simulated)

Command Description
git init/status/log/clone Git version control
python3 / python Python interpreter info
pip install Python package manager
apt install/update Package manager
bash script.sh Run shell script
crontab -l / -e Manage cron jobs
systemctl status Service management
journalctl System logs

🎨 Themes

Theme Description
GitHub Dark Clean dark with green accent (default)
Matrix Classic green-on-black hacker look
VS Code Familiar VS Code dark palette
Kali Red Deep red inspired by Kali Linux
Midnight Dark navy with purple accents
Hacker Pure green terminal
Dracula Popular Dracula color scheme
Light Clean white theme for bright environments

Custom colors: pick any hex for background, prompt, text, and accent.


⌨️ Keyboard Shortcuts

Shortcut Action
Tab Autocomplete command or filename
↑ / ↓ Navigate command history
Ctrl + L Clear terminal screen
Ctrl + C Cancel current input
Ctrl + O (in nano) Save file
Ctrl + X (in nano) Exit nano editor

🧠 Learning Path (Suggested Order)

1. Navigation       β†’ pwd, ls, cd, tree
2. File Basics      β†’ touch, mkdir, cat, echo, nano
3. File Management  β†’ cp, mv, rm, ln
4. Permissions      β†’ chmod, chown, sudo, su
5. Search & Filter  β†’ grep, find, locate, which
6. Text Processing  β†’ sort, uniq, diff, wc, head, tail
7. System Info      β†’ ps, top, uname, df, env
8. Networking       β†’ ping, ifconfig, nmap, ssh
9. Archive          β†’ tar, zip, gzip
10. Security Tools  β†’ nmap, sqlmap, nikto, metasploit

πŸ“˜ Want guided, hands-on exercises instead? Work through CHALLENGES.md β€” 10 progressive levels from "who am I?" to a full recon workflow, each with hidden solutions.


πŸ“ Project Structure

cyber-assassins/
β”‚
β”œβ”€β”€ index.html          ← Single-file application (entire simulator)
β”‚   β”œβ”€β”€ <style>         ← All CSS with CSS custom properties for theming
β”‚   └── <script>        ← JavaScript modules:
β”‚       β”œβ”€β”€ Virtual Filesystem (FS object)
β”‚       β”œβ”€β”€ State management
β”‚       β”œβ”€β”€ 100+ Command implementations
β”‚       β”œβ”€β”€ Tab autocomplete engine
β”‚       β”œβ”€β”€ Nano editor simulation
β”‚       β”œβ”€β”€ sudo/su auth flow
β”‚       β”œβ”€β”€ Theme system
β”‚       └── Boot animation
β”‚
β”œβ”€β”€ CHALLENGES.md        ← 10 guided practice levels with solutions
β”œβ”€β”€ CONTRIBUTING.md      ← How to add new commands
β”œβ”€β”€ LICENSE              ← MIT License
β”œβ”€β”€ .gitignore           ← Standard ignores for editors/OS files
└── README.md            ← This file

Design decision: The entire simulator lives in a single index.html file. This means:

  • βœ… Zero dependencies
  • βœ… Works offline
  • βœ… One file to share, host, or fork
  • βœ… No build step required

🀝 Contributing

Contributions are welcome! Here's how to add a new command:

// In the COMMANDS object inside index.html:
mycommand(args) {
  // args = array of arguments passed to the command
  if (!args.length) return [cl('mycommand: missing argument', 'out-error')];
  
  const target = resolvePath(args[0]);  // resolve path
  
  return [
    cl('Output line 1', 'out-normal'),
    cl('Output line 2', 'out-success'),
  ];
},

Color classes available:

Class Color
out-normal Default text
out-success Green (good output)
out-error Red (errors)
out-warn Yellow (warnings)
out-info Blue (informational)
out-accent Purple (highlights)
out-dim Grey (secondary text)
out-dir Blue bold (directories)
out-exec Green (executable files)

Adding Education Tips

// In the TIPS object:
mycommand: 'Your tip about what this command does and when to use it.',

Steps to Contribute

  1. Fork the repository
  2. Create a branch: git checkout -b feature/add-command-xyz
  3. Make your changes in index.html
  4. Test thoroughly in a browser
  5. Submit a Pull Request with a description of what you added

πŸ›‘οΈ Security & Legal Notice

This simulator is for educational purposes only.

All security tool commands (nmap, sqlmap, hydra, metasploit, etc.) are fully simulated β€” they produce realistic-looking output but perform zero real network activity, scanning, or exploitation.

In the real world, running security tools against systems you do not own or have explicit written permission to test is illegal. Always practice in authorized environments such as HackTheBox, TryHackMe, or your own lab.


πŸ“Š Stats

  • 130+ Linux commands implemented
  • 11 CTF flags hidden across two machines (local + remote)
  • 3 real-world permission scenarios (SSH key, script, website file)
  • 1 real runaway-process puzzle to find and kill
  • 2 fully independent virtual machines (local Kali + remote Ubuntu server)
  • 8 built-in color themes
  • 0 dependencies
  • 0 network requests (fully offline capable)
  • 1 file to rule them all

πŸ“œ Changelog

v1.3.0 (2026) β€” Networking Mode & Real Process Control

  • 🌐 Networking Mode β€” a second, fully independent virtual machine (webserver01 at 10.0.0.5) with its own filesystem, users, and open ports
  • πŸ” Real nmap β€” scans actually return the remote machine's real open ports (22/SSH, 80/HTTP, 3306/MySQL)
  • πŸ”‘ Real ssh β€” genuinely authenticates and swaps your entire session into the remote machine; exit cleanly disconnects back to local
  • πŸ“€ Real scp β€” file transfer in both directions between local and remote filesystems, with its own password prompt
  • 🚩 4 new CTF flags exclusive to the remote machine: reconnaissance, breaking in via SSH, exfiltration via scp, and remote privilege escalation (11 flags total now)
  • βš™οΈ Real process table β€” ps, top, kill, and jobs now read from and mutate an actual process list, not static text
  • πŸ› Runaway process puzzle β€” a suspicious xmrig-helper process eating 97%+ CPU is seeded on boot; find it with ps aux/top, stop it with kill -9
  • ⏱️ Real background jobs β€” sleep 10 & starts a job that completes over simulated time, visible transitioning from Running to Done in jobs
  • πŸ”§ Fixed resolvePath/displayPath/renderFileTree hardcoding /home/student β€” ~ now correctly resolves per active session (local student, local root, or remote user)
  • πŸ”§ Fixed exit not knowing how to disconnect an SSH session (it would incorrectly say "cannot close simulator")
  • πŸ”§ Fixed ls -la's ./.. entries always showing "student" regardless of the active user

v1.2.0 (2026) β€” Full Permission Engine

  • πŸ” Real Unix permission model β€” permissions are now parsed into a structured object (owner/group/other Γ— read/write/execute + setuid/setgid/sticky), not just a display string
  • πŸ”’ Complete chmod β€” numeric (3 & 4-digit), symbolic (single, comma-chained, multi-class), -R recursive, -v verbose
  • πŸ‘₯ Real groups β€” groupadd, usermod -aG, groups [user]; group-based file access actually works for a second simulated identity, not just owner-vs-everyone
  • πŸ”§ chown/chgrp upgraded β€” chown user:group file, -R recursive on both
  • πŸ›‘οΈ Permissions enforced everywhere β€” cd now correctly requires the execute bit (not read) to enter a directory; rm now correctly requires write on the parent directory, not the file itself; ./script.sh requires +x while bash script.sh only requires read β€” all classic real-Linux gotchas, faithfully reproduced
  • 🩺 Educational "Permission denied" messages β€” every denial now explains which permission class and bit is missing, plus the exact chmod fix
  • 🧰 Real-world scenario files β€” a world-readable SSH key, a non-executable backup script, and a world-writable website file, seeded broken and fixable with scenarios / scenarios check
  • πŸ“˜ revision chmod β€” instant exam-style cheat sheet
  • πŸŽ“ quiz chmod β€” interview-style Q&A practice with hints and grading
  • πŸ”§ Fixed chmod symbolic mode being a complete no-op (it printed success without changing the file)
  • πŸ”§ Fixed ls -l <file> ignoring the -l flag for single-file targets

v1.1.0 (2026)

  • 🚩 CTF Mode β€” 7 hidden flags, live scoreboard panel, hints, toast notifications
  • πŸ’Ύ Persistent sessions β€” filesystem, history, theme, and CTF progress saved via localStorage
  • πŸ“œ Real bash script execution β€” write .sh scripts in nano, run them with run/bash
  • πŸ”§ Fixed a tar flag-detection bug where filenames containing certain letters were misread as flags
  • πŸ”§ Added a proper shell-style tokenizer so quoted multi-word arguments (grep -r "some text" /) work correctly
  • πŸ”§ Added real permission enforcement on cat (read-protected files now correctly require chmod/sudo)
  • Updated to Kali GNU/Linux 2026.1 and kernel 6.12

v1.0.0 (2026)

  • Initial release
  • 100+ commands implemented
  • 8 themes + custom color picker
  • Virtual filesystem with full CRUD
  • Interactive nano editor
  • sudo/su authentication flow
  • Tab autocomplete + history navigation
  • Educational tips system
  • Multiple terminal tabs
  • Boot animation sequence
  • Sidebar file explorer + cheatsheet panel

πŸ“„ License

MIT License β€” Copyright (c) 2026 Shivam

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software to use, copy, modify, merge, publish, and
distribute, subject to the conditions in the LICENSE file.

See LICENSE for full text.


Made with ❀️ by Shivam

If this helped you learn Linux, please give it a ⭐ β€” it helps others find it too!

GitHub stars GitHub forks

About

Linux command simulator for learning Linux commands, file permissions, shell scripting, system administration, and cybersecurity basics through hands-on practice.

Topics

Resources

License

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages