Auto-generate /etc/hosts for HackTheBox machines

Overview

Auto-generate /etc/hosts for HackTheBox machines

Save yourself some tedium on getting started on a new machine by having your /etc/hosts ready to go.

Quickstart

curl https://raw.githubusercontent.com/fx2301/htb_etc_hosts/master/hosts_all.txt | sudo tee -a /etc/hosts

To give you an idea of the contents:

curl -s https://raw.githubusercontent.com/fx2301/htb_etc_hosts/master/hosts_all.txt | head -n 10

# === start auto-generated by https://github.com/fx2301/htb_etc_hosts ===

# Easy machines
10.10.10.215    academy.htb          # https://app.hackthebox.com/machines/297
10.10.10.98     access.htb           # https://app.hackthebox.com/machines/156
10.10.10.100    active.htb           # https://app.hackthebox.com/machines/148
10.10.10.187    admirer.htb          # https://app.hackthebox.com/machines/248
10.10.11.107    antique.htb          # https://app.hackthebox.com/machines/400
10.10.10.11     arctic.htb           # https://app.hackthebox.com/machines/9

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install --editable ../htb_cli

^^ note that htb_cli wasn't a published repo at the time of writing this documentation. Create an issue on this repo if you want access - thanks!

Generating

Generate a fully up to date hosts.txt yourself (the code defaults to active machines only):

python3 generate.py > hosts_active.txt

Downloading

Use the file you want from the repo (list is a snapshot from 2021-11-09):

curl -O https://raw.githubusercontent.com/fx2301/htb_etc_hosts/master/hosts_all.txt 

Appending

cat hosts_all.txt | sudo tee -a /etc/hosts

Caveats

This won't play nice with any dynamically IP addresses that are dynamically assigned by HtB.

Contributing

PRs are welcome. Even just to keep the list up to date. Please don't include any fuzzed subdomains, though. No spoilers allowed (even for retired machines).

You might also like...
Generate random german words
Generate random german words

Generate random german words / Generiere zufällige deutsche Wörter Getting Started Pip install with pip install zufallsworte Install the library with

NFT-Generator is the best way to generate thousands of NFTs quick and easily with Python.

NFT-Generator is the best way to generate thousands of NFTs quick and easily with Python. Just add your files, set your configuration and run the scri

python script to generate color coded resistor images

Resistor image generator I got nerdsniped into making this. It's not finished at all, and the code is messy. The end goal it generate a whole E-series

A python script to generate wallpaper
A python script to generate wallpaper

wallpaper eits Warning You need to set the path to Robot Mono font in the source code. (Settings are in the main function) Usage A script that given a

A small python library that helps you to generate localization strings for your mobile projects.

LocalizationUtiltiy A small python library that helps you to generate localization strings for your mobile projects. This small script aims to help yo

Prime Path Generator is a prime path generator used to generate prime paths.

Prime Path Generator is a prime path generator used to generate prime paths.

A program will generate a eth key pair that has the public key that starts with a defined amount of 0

ETHAdressGenerator This short program will generate a eth key pair that has the public key that starts with a defined amount of 0 Requirements Python

A python lib for generate random string and digits and special characters or A combination of them

A python lib for generate random string and digits and special characters or A combination of them

An okayish python script to generate a random Euler circuit with given number of vertices and edges.

Euler-Circuit-Test-Case-Generator An okayish python script to generate a random Euler circuit with given number of vertices and edges. Executing the S

Owner
null
A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python.

Introduction A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python. Requirements Python >=3.7.3 Pika ==1.2.0 Aio-pika

Dali Kewara 1 Feb 5, 2022
Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc.

citation-url Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc. This module has a single parse() function that takes in

Charles Tapley Hoyt 2 Feb 12, 2022
Collection of code auto-generation utility scripts for the Horizon `Boot` system module

boot-scripts This is a collection of code auto-generation utility scripts for the Horizon Boot system module, intended for use in Atmosphère. Usage Us

null 4 Oct 11, 2022
A fast Python implementation of Ac Auto Mechine

A fast Python implementation of Ac Auto Mechine

Jin Zitian 1 Dec 7, 2021
Automatically Generate Rulesets for IIS for Intelligent HTTP/S C2 Redirection

Automatically Generate Rulesets for IIS for Intelligent HTTP/S C2 Redirection This project converts a Cobalt Strike profile to a functional web.config

Jesse 99 Dec 13, 2022
Genart - Generate random art to sell as nfts

Genart - Generate random art to sell as nfts Usage git clone

Will 13 Mar 17, 2022
This is discord nitro code generator and checker made with python. This will generate nitro codes and checks if the code is valid or not. If code is valid then it will print the code leaving 2 lines and if not then it will print '*'.

Discord Nitro Generator And Checker ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast

Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ 37 Jan 7, 2023
Python code to generate and store certificates automatically , using names from a csv file

WOC-certificate-generator Python code to generate and store certificates automatically , using names from a csv file IMPORTANT In order to make the co

Google Developer Student Club - IIIT Kalyani 10 May 26, 2022
A tool written in python to generate basic repo files from github

A tool written in python to generate basic repo files from github

Riley 7 Dec 2, 2021
Search, generate & deliver Msfvenom payloads in an quick and easy way

Goal Search, generate & deliver payloads in an quick and easy way Be as simple as possible BUT with all msfvenom payloads. Ever lost time searching th

null 2 Mar 3, 2022