A collection of useful functions for hacking on HackTheBox, all contained in a single bash script.
Assumes HackTheBox VPN session to be the ONLY VPN session.
htbinitfile
: Sets or prints the path of the OpenVPN config file to use for connecting to the HackTheBox VPNhtbinit
: Initiates a connection to the HackTheBox VPN using the specified OpenVPN config filehtbhost
: Prints the IP of the current HackTheBox VPN connectionhtbtarget
: Sets or prints the current HackTheBox targethtbkill
: Terminates the current HackTheBox VPN connection and resets the target file
Download bash file to desired location
$ git clone [email protected]:algowful/htbfuncs.git
Edit ~/.bashrc
file with following line:
source <path to htbfuncs>
$ htbinitfile ~/Documents/lab.ovpn
[*] Init File Path Set
$ htbinitfile
/home/user/Documents/lab.ovpn
$ htbinit
[sudo] password for user:
[*] Initiated Connection...
$ htbhost
10.10.14.7
$ htbtarget 10.10.14.9
[*] Set HTB Target...
$ htbtarget
10.10.14.9
$ htbkill
[*] Killing OpenVPN PID: 300243
[sudo] password for user: