Since the pre-prep work for HtB is always the same, I created HAS to automate this task.
- Creates a Folder in a given
PATHwith theBOXNAME.
-> Checks if the Folder already exist (If yes, skips the creation). - Creates a
"nmap"Folder in theBOXNAME's Folder. - Adds the IP to
"/etc/hosts"withBOXNAMEandBOXNAME.htb. - Checks if you are connected to the HTB VPN.
-> if not loops till you are. - Checks if
BOXNAMEis reachable.
-> loops till it is.
--> After 3 failed Pings, ask the User to continue or skip the Ping Check. - Opens your default Browser with the
BOXNAME URL(~90% of HTB Machines have a Web server running). - Copies the Pre-defined Folder with .md files into Obsidian.
- Copies the tmux files (.nice.py) in the
BOXNAME's Folder.
--> I had to do this for the functioalty for the "Create new Panel" in tmux, and you're still inBOXNAMEPATH. - After 3 seconds opens tmux with 4 Panes:
nmap -sC -sV, gobuster or feroxbuster, ffuf for subdomain Enumeration, sleep 60; nmap -p- and if you like autorecon.
Firstly download HAS and move into the Foder:
git clone https://github.com/Clipsec/HtB-Auto-Script
cd HtB-Auto-Script
Now you have to change a few things in the script (give it the right PATH).
Have a closer look at:
- Folder Structure
- Obsidian Copy
- Tmux
after that you are ready to go!
python3 HAS.py
- export
BOXNAMEas$target.