Once you have setup your attacker environment it’s time to get connected to the HTB VPN.
The quickest way to get conneceted is to simply download your
.ovpn file from the Access section, open your terminal within the download directory and connect with the command:
Make sure you substitute
yourusername for the name of your
.ovpn file which by default uses your HTB username. Mine is
sabebarker.ovpn for example.
If you connect successfully you will see a bunch of output with the last line being something like:
Initialization Sequence Completed
That’s it! you are now connected to the HTB VPN.
I personally like to have my VPN connection setup as a service and have it connect at boot. I use a virtual machine specifically for HTB so when I boot it up I want it connected. Let’s take a look at how to do that.
Run as a service
Let’s assume you are using a Debian based system such as Kali or Parrot and that you are running as
root. If you are using a different distro then you will need to lookup how to setup a VPN. Your favourite search engine should do the trick.
Check for Conflicts
First off, if you used the
openvpn yourusername.ovpn command above you will need to do
CTRL + c in the terminal window or if you closed the terminal window run the command:
openvpn is still running you will see an output such as:
root 12142 0.0 0.3 12348 7468 ? S 22:46 0:00 openvpn yourusername.ovpn
If there is an
openvpn process that is using your HTB
.ovpn file you will need to kill the process by running the command:
Be sure to replace
12142 with the PID of your running process shown in your output.
Now we have cleaned up that mess let’s move on.
From your download location that you chose above move the
.ovpn file to your
openvpn directory changing the filename to
To start the service we do:
If for any reason we need to restart the service like when we are having connection issues we can do:
And to stop the service, yep you guessed it:
Once the service is started you can check it’s status with:
Your output should look something like this:
● email@example.com - OpenVPN connection to yourusername Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled) Active: active (running) Main PID: 823 (openvpn) Status: "Initialization Sequence Completed"
Now if you check your network configuration you should see your HTB IP address:
Make sure you always keep note of your IP as you will be using it alot :)
Autostart on Boot
If you would like to enable the service on boot you can run the command:
On success you should see the output:
Created symlink /firstname.lastname@example.org → /lib/systemd/system/openvpn@.service.
That’s it! You are up and running.