Skip to content

A small Python script to automate the setup of a lab machine (e.g., HackTheBox). It creates a folder structure, adds the entry to /etc/hosts, and launches a VPN. Pressing Ctrl+C removes the added entry from /etc/hosts.

License

Notifications You must be signed in to change notification settings

xcotelo/HTB-Machine-Initialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

HTB Machine Initialization

image

A small Python script to automate the setup of a lab machine (e.g., HackTheBox). It creates a folder structure, adds the entry to /etc/hosts, and launches a VPN. Pressing Ctrl+C removes the added entry from /etc/hosts.


Usage

The script will ask for:

  • The machine's IP address (e.g., 10.10.10.5)
  • The machine's name (e.g., machine.htb)

What it does automatically:

  • Creates /home/USER/HTB_<name_without_.htb> with subfolders nmap, exploit, and various.

  • Adds the line IP name to /etc/hosts.

  • Runs sudo openvpn <file>.ovpn.

  • If you press Ctrl+C:

    • Stop the VPN.
    • Remove the entry added to /etc/hosts.

About

A small Python script to automate the setup of a lab machine (e.g., HackTheBox). It creates a folder structure, adds the entry to /etc/hosts, and launches a VPN. Pressing Ctrl+C removes the added entry from /etc/hosts.

Resources

License

Stars

Watchers

Forks

Languages