While practising CTF / Pentesting on platforms like TryHackMe / HackTheBox etc., some necessary steps need to be performed every single time such as-
- Spawn a new tmux session
- Use OpenVPN to connect with their private VPN server
- Authenticate with sudo (if non-root user)
- Create a new clean terminal (tmux window)
These usual jobs can be automated to increase productivity and save time-
For storing user's credential, create a .env_file, add following-
USER=<ENTER-USERNAME>
PASS=<ENTER-PASSWORD>
Create a bash shell script to manage the automation (make sure to point to the env file and add the shebang line on the top)
Give the file appropriate permissions-
$ sudo chmod 774 thm_init.sh
On desktop (debian based), mouse right-click > Create Launcher
- Give launcher-name
- Point to shell script path
- Set working directory
- Add icon
- Mark
run in terminal
checkbox
Now a single launcher icon can be double clicked to invoke the shell script and automatically set up the attackbox environment!