TEG or “Tenes Empanadas Graciela” is a turn-based strategy video game which is played through a server / client system.
Whonix 14 is what this guide is about regarding when you host a TEG server. If you are only a player it shouldn’t matter much what Whonix version you run, though Whonix 13 is no longer supported so try to run version 14 if you can.
You can play the game even if you aren’t running Whonix 14, but this guide will focus mostly on that and specifically running Whonix 14 on VirtualBox.
CONNECTING TO THE GAME
If you are on Whonix 14 you first need to install teg so type this in a terminal:
sudo apt-get install teg
(if it asks for a password type “changeme
” if you haven’t changed it already and hit enter)
After it’s installed open up the game from the system menu “K” => Applications => Games => Tactics & Strategy => Tenes Empanadas Graciela client or type this in a terminal window:
tegclient
When it starts it should open a “Connect to server” window. Otherwise open it from the menu “Game” => “Connect” or press “Connect”.
If it already says “2000” in the Server port field leave it as is.
Where it says “Server name” add the onion address, ie. w7jnpxhu3re5qarr.onion
Then choose a “Name” in that field for your playername and you’re good to go, press OK if you want to join the server.
In case you are the shy type hit the checkbox “Dont play, just observe” and then hit the OK button. This concludes this guide…if you want to host a teg server continue reading the guide by following the instructions below.
TEG SERVER
The initial setup is based on instructions from the Whonix Wiki called “Onion Services”
Go to the VirtualBox Whonix Gateway 14.x >>
and open up a terminal and type
sudo kwrite /usr/local/etc/torrc.d/50_user.conf
(after which you type your password which if not changed from the original is “changeme”)
and modify that file so it looks
like this:
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 2000 10.152.152.11:2000
DisableNetwork 0
Save and close the file. For the changes to take effect open a terminal and type this command:
sudo service tor@default reload
(enter the password mentioned previously if it asks for it)
To check if everything is ok type this command in a terminal:
sudo service tor@default status
(enter the password if it asks for it)
If it says “Active: active (running) since
” where “active (running)
” should be in green, that means everything is just fine. If something went wrong please troubleshoot
Now it’s time to find out which .onion address you can share with your friends so open up a terminal and type the command:
sudo cat /var/lib/tor/hidden_service/hostname
(might ask for password)
The output of that command should be an .onion address with alphanumeric characters like this example that you can share with your friends so they can play on your server:
w7jnpxhu3re5qarr.onion
Everything you did here was in Whonix Gateway 14. Now it is time to go to Whonix Workstation 14 to edit the firewall!
Go to the VirtualBox Whonix Workstation 14.x >>
Open a terminal and type this command:
sudo kwrite /etc/whonix_firewall.d/50_user.conf
(enter the password if it asks for one)
then enter this:
EXTERNAL_OPEN_PORTS+=" 2000 "
and save.
in case you already have a webserver on port 80 and you also want to have this
game server then just change it to
EXTERNAL_OPEN_PORTS+=" 80 2000 "
Now time to reload the firewall so type this command for that:
sudo whonix_firewall
(enter the password if it asks for it)
Ok…now we are ready to begin starting the actual game server software because most of the previous section was related to setting up your whonix gateway so let’s begin!
Still in the Whonix Workstation 14.x open a console and type:
tegserver
The server is running now and you can share the .onion address that you got earlier.
In this example it is w7jnpxhu3re5qarr.onion
but for you it will(most probably) be different. If you do these instructions too quickly the link that was generated for you might not work…in such a case you will have to be more patient and wait until your onion link has been copied enough times across the Tor network. Patience is a good attribute when dealing with Tor.
“Some DDOS protection” guide
Very basic protection against DDOS attacks done versus your server so follow this guide if you want to abandon the ‘single point of failure’ that is your only .onion address that all your players know(as of the previous “normal guide”). This section is to protect you against at least 1 bad player who wants to ddos your game server(regardless of reason). Let’s get to how this extra protection is gonna be set in motion:
Go to the VirtualBox Whonix Gateway 14.x >>
and open up a terminal and type
sudo kwrite /usr/local/etc/torrc.d/50_user.conf
(after which you type your password which if not changed from the original is “changeme”)
and modify that file so it looks
like this:
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 2000 10.152.152.11:2000
#1234567890123400 ends with 00 because this I plan to be the 'public address'
#In the event the server gets a ddos attack the public address should be disabled
#and if not done already give individual players that you trust
#the addresses that are generated from the numbers ending with 01,02 etc.
#max amount of addresses is until 1234567890123415 is reached because that amount+00
#means 16 different .onion addresses which is the current max
#on this specific anti ddos design
HiddenServiceAuthorizeClient stealth 1234567890123400,1234567890123401,1234567890123402,1234567890123403,1234567890123404,1234567890123405,1234567890123406,1234567890123407,1234567890123408,1234567890123409,1234567890123410,1234567890123411,1234567890123412,1234567890123413,1234567890123414,1234567890123415
#The above long line is a total of 16 numbers. If you add another number
#Tor will refuse to reload so stick with 16.
#not sure if we really need "DisableNetwork 0" but let's leave it as is. I didn't have it before but I re-added it just in case it is needed.
DisableNetwork 0
Save and close the file. For the changes to take effect open a terminal and type this command:
sudo service tor@default reload
(enter the password mentioned previously if it asks for it)
or open the K menu, search for reload and click on “Reload Tor”(this is basically sudo service tor@default reload + sudo service tor@default status in one go)
Now it’s time to find out which .onion addresses you can share with your friends so open up a terminal and type the command:
sudo cat /var/lib/tor/hidden_service/hostname
(might ask for password)
Since I’m going to regenerate all my .onion addresses by making new ones I’m posting what this might actually look like when you try it yourself. Your ‘player invites’ will look something like this:
aokofajrpe4g2zrf.onion QlQlXlPdXyTUf6WIOf1tfR # client: 1234567890123400
3wsajgpzqxytcsjo.onion Whi+D0Y/352YqMK3uTJNWx # client: 1234567890123401
umaenixqbqevdk5a.onion TE1Biv1JFjveN/mQqWOmSh # client: 1234567890123402
gwumcsrrfkc3kne5.onion VYzN3LVk9DVhbp3TRQuDXB # client: 1234567890123403
vuhiosfqgegorbkh.onion P5ns2xtCC+VJAVeW3FrC+x # client: 1234567890123404
jye4cftpe6xq2eka.onion vnCPwf6RWWMkv9iCKDZHlh # client: 1234567890123405
gvzl37orywkzxtr7.onion H+izJm1pwnt+FMdJnL2MWh # client: 1234567890123406
hdtjcfdpcnnnxws3.onion H6XIO5+ts0mz2AtBcbEJOx # client: 1234567890123407
gdgj2p5k7jqgv3k7.onion RvnG94Blww6jDLSpQSZW1B # client: 1234567890123408
6np4ynkdqg7e2cmx.onion X1st9nX4486nwJ9LmbJDNx # client: 1234567890123409
ywabarc6ziuwdhbl.onion ym9me7GXGUctLJwTgyWhgh # client: 1234567890123410
agyinmgx7qeodrx2.onion 6YUDbaghoXr0LWSoso7MeR # client: 1234567890123411
6xsjhpgrmf2rbnka.onion JP7giIIzLmhhn2r3EcbWWB # client: 1234567890123412
5fixfx3mvvj5cu7u.onion wmxp4ZoPmFb31WoCS2d/8B # client: 1234567890123413
rczg4s5reivwhd7p.onion pl/3phzLLB4hHsknnfOOxB # client: 1234567890123414
yl6ulm2lzvtsvdfx.onion G0v/YtNeaCgBuvFw6QfTTR # client: 1234567890123415
I posted the above because I’ve already changed the client numbers for all my 16 addresses already to begin with and reloading Tor after changing something in your client numbers makes Tor regenerating a new address for each of those 16 possible clients/‘groups of players’ where you changed an id. Right now I don’t have the above addresses so I took the step to post how it actually looked like when I followed the guide myself and that’s what you see above. Also when Tor generates new addresses it also generates the ‘gibberish’ that you see right next to each .onion address, let’s take the .onion address yl6ulm2lzvtsvdfx.onion as an example. To the right of that address there is this number “G0v/YtNeaCgBuvFw6QfTTR” which is going to be explained later in this guide.
The guide will be expanded on later but for now cheers and don’t forget that if you’re interested in the guide you can subscribe to the thread or like the post. Thanks
Credits
This guide wouldn’t be possible without Tor Onion Services - EASY guide