This page describes how to get the CTF network and Vulnbox running in a basic setup. There is a multitude of things which could be done differently (and even be improved). So if you already know how to connect to the VPN and host the Vulnbox, feel free to do it differently. In any case, also have a look at the general Setup docs.
We assume that you're playing with a local team (i.e. all people sitting in one room). For a distributed team, large parts will be applicable, but some things will have to be done differently.
In our setup, one physical machine will host the Vulnbox and act as your personal VPN gateway. All team members will connect their personal computers to the team network, for which the machine also acts as gateway. Therefore, the team members can reach your Vulnbox, the other teams and the internet.
You are going to need:
- A PC with an x86-64 CPU and two network interface – one for connecting to the internet and one for your team. A CPU with at least 4 cores, VT-x support and 8 GB of RAM are recommended.
- Physical access, monitor and keyboard/mouse attached to the PC
- A network switch for your team network
In the rest of this guide, we're going to assume a standard Debian 9 ("Stretch") Desktop install on the PC. Other Debian versions or Ubuntu should work similarly and the general setup should also be applicable to other distributions.
We are going to install the required packages (as root):
apt install openvpn dnsmasq virtualbox-qt socat wireshark
We assume that you already have internet connectivity on one interface (the "internet" interface) and will now configure the other one, the team interface. It should be connected to your switch.
Using the NetworkManager GUI (or whatever your system uses for network configuration), manually assign an IP address to that interface. We are going to use
192.168.0.1 with a netmask of
255.255.255.0 for the team network. However, any RFC 1918 range should do as long as it does not collide with any other network attached to your PC or used in the CTF; the team network is not strictly required for the CTF.
To assign IP addresses inside the team network, we are going to set up Dnsmasq as a DHCP server. To this purpose, edit "/etc/dnsmasq.conf", uncomment the line which starts with
interface= and set the name of your team network interface (like "eth1") as value. Additionally, uncomment this line:
If you used the proposed team network (
192.168.0.1/24) when configuring the interface above, the default range should be fine. Otherwise, you must set the value of
dhcp-range to match your network.
Then, restart Dnsmasq using
systemctl restart dnsmasq.
As the PC acts as a gateway, we need to allow IP forwarding in it. To this purpose, edit "/etc/sysctl.conf" and uncomment this line:
Afterwards, reload the config using
Now, we set the following iptables rules:
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -i game -j REJECT iptables -A INPUT -i vboxnet0 -j REJECT iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i game -o vboxnet0 -j ACCEPT iptables -A FORWARD -i vboxnet0 -o game -j ACCEPT iptables -A FORWARD -i <team_interface> -j ACCEPT iptables -P FORWARD DROP iptables -t nat -A POSTROUTING -s <team_network> -j MASQUERADE
<team_interface> with the name of your team interface and
<team_network> with your team network in CIDR notation, e.g.
To make the firewall rules persistent across reboots, install the "iptables-persistent" package and answer "Yes" when it asks you whether to save the current IPv4 rules.
- Disallow all traffic from the VPN or Vulnbox to your host machine
- Allow responses to already established and allowed connections
- Allow communication between the VPN and the Vulnbox
- Allow connections from your team network to everywhere with NAT
- Disallow all other routing between the different networks, e.g. traffic from the Vulnbox to your team network
With this firewalling setup, the Vulnbox will not be able to reach the internet. However, one service requires an internet connection during its initial setup. Use the following rules to enable internet connectivity for the Vulnbox:
iptables -A FORWARD -i vboxnet0 -o <internet_interface> -j ACCEPT iptables -t nat -A POSTROUTING -o <internet_interface> -j MASQUERADE
<internet_interface> with the name of your internet interface.)
It's recommended to disable the access afterwards, even though that means you e.g. won't be able to download software. Keeping the Vulnbox connected to the internet during the competition will be entirely at your own risk! Disallow internet access for the Vulnbox by running:
iptables -D FORWARD -i vboxnet0 -o <internet_interface> -j ACCEPT iptables -t nat -D POSTROUTING -o <internet_interface> -j MASQUERADE
Similarly, traffic from the other teams to your team network is completely blocked, so things like back-connects won't work.
To connect to the VPN, move your personal VPN config ("faustctf.conf", which you have received from us via email) to "/etc/openvpn". Then, start the VPN using:
systemctl start openvpn@faustctf systemctl enable openvpn@faustctf
Everything should be working alright if you can now ping our gatway at
10.65.<team_ID>.1 from your host PC and the team network.
Finally, we are going to launch the Vulnbox (or the test image): Download it from us in OVA format and decrypt it using
gpg -o <filename> -d <filename>.gpg.
Next, launch VirtualBox and go to "File" – "Preferences" – "Network" – "Host-only Networks". Edit "vboxnet0" and set its IPv4 address to
10.66.<team_ID>.1. It also can't hurt to disable the Host-only Network's DHCP Server, although that is not strictly necessary.
Afterwards, click "File" – "Import Appliance". Select the decrypted OVA image and finish the wizard without any changes. Open the settings for the imported VM. In the "Network" section, select "Attached to: Host-only Adapter".
Now comes a bit of a tricky part: The Vulnbox will already work if you start it now and you'll also be able to log in through the VirtualBox GUI. However, it would be kind of hard to get an SSH key onto it, since copy/paste doesn't work. To work around that, we'll attach a Serial Console before starting the Vulnbox: Select "Serial Ports" in the VM's settings, enable Port 1, set "Port Mode: Host Pipe" and "Port/File Path" for example to "/tmp/vulnbox.serial".
You may now start the Vulnbox VM and connect to the serial port as described in the illumos docs:
socat unix-connect:/tmp/vulnbox.serial stdio,raw,echo=0,icanon=0,escape=0x11
This attaches you to a serial console, where you can log into the Vulnbox as root without password (if you don't see anything, just Press Enter to log in). You should be greeted by our initial
accountsetup tool, which will also let you paste SSH keys. The Vulnbox will reboot and you should be able to log in via SSH at