A CLI-based hacking strategy game/MMO which is deployed on a Linux SSH server. Clients interact through an SSH client. The game should be hosted on a *nix server.
Install an SSH server and allow remote connections: 1.1. Enter the command
sudo apt-get install openssh-server1.2. Make a copy of the config file before changing it:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults sudo chmod a-w /etc/ssh/sshd_config.factory-defaults
Install other dependencies with
sudo apt install mysql-server python-dev python-pip python-mysqldb libmysqlclient-dev. During installation of
mysql-server, make note of the default database password you set.
Log into MySQL with the command
mysql -u [username] -p, then create the HTP database with
CREATE DATABASE htp;and exit MySQL.
Load the schema into MySQL with
mysql -u [username] -p htp < db.sql
Install necessary Python libraries with
pip install MySQLdb termcolor yagmail
If you are setting up a production server, uncomment lines 36–37 in game.py to disable keyboard interrupts (Ctrl-C, Ctrl-D, Ctrl-Z)
htppassenvironment variables to the database credentials the game should use. For example, to set the
secr3tyou could add the line
export htpuser='secr3t'to your
Run the game with
Email can optionally be used for password resets. It uses the
yagmail Python library. If you are enabling email,
emailuser environment variable should be set to a valid Gmail address, and
emailpass should be set to the password for that address.
- Create a UNIX user account on the server, e.g.
- Edit the user's
.bashrcfile to contain only
touch .hushloginin the user's home directory to suppress the login banner
sudo apt install lshell. This is used to restrict access to the file system and shell.
- Add the
guestuser account to the
sudo usermod -a -G lshell guest.
- Enter the command
sudo chsh -s /usr/bin/lshell guestto set
lshellas the default shell for
- Edit the file
/etc/lshell.confto look like this:
[guest] login_script : "clear && python /path/to/game.py" path : /path/to forbidden : ["ls", "echo", "cd"] scp : 0 sftp : 0
- Test by connecting to the server via SSH using the username
guest. Ensure that you are not able to run any shell commands or view system files.
- Browser-based SSH client which connects to the game
- Website with connection instructions and information about the game
- APIs which allow the website to interface with the backend code
- Fully-featured browser application which can be used in place of the SSH client