-
-
Save Spy0x7/d418c661e4f13829d7a31301356527fa to your computer and use it in GitHub Desktop.
Automated tmux session I use when playing htb boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HTB_DATA_DIR=~/Documents/HTB/ | |
if [[ $1 ]]; then | |
a=1 | |
else | |
echo "Usage: $0 <Box name>" | |
exit 1 | |
fi | |
tmux new-session -s htb -d -n win1 | |
tmux new-window -t htb -d -n win2 | |
tmux new-window -t htb -d -n win3 | |
tmux new-window -t htb -d -n vpn | |
tmux send-keys -t htb:vpn "echo $SUDO_PASS| sudo -S /usr/sbin/openvpn /home/kavi/Documents/HTB/lab_kavigihan.ovpn" Enter | |
tmux select-window -t htb:win1 | |
tmux send-keys -t htb:win1 "if [[ -d $HTB_DATA_DIR$1 ]]; then else htb-init $1; fi; cd $HTB_DATA_DIR$1; clear" Enter | |
tmux split-window -h | |
tmux send-keys "cd $HTB_DATA_DIR$1; clear" Enter | |
tmux split-window -v | |
tmux send-keys "cd $HTB_DATA_DIR$1; clear" Enter | |
tmux select-layout main-vertical | |
tmux select-window -t htb:win2 | |
tmux send-keys "cd $HTB_DATA_DIR$1; clear" Enter | |
tmux split-window -v | |
tmux send-keys "cd $HTB_DATA_DIR$1; clear" Enter | |
tmux send-keys -t htb:win3 "cd $HTB_DATA_DIR$1; clear" Enter | |
tmux select-window -t htb:win1 | |
tmux attach -t htb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment