Baltimore-hackthebox-knowle.../techniques_and_tools/hosts_file.md

990 B

Add the Box to Your Hosts File

It's common for Hack the Box machines to include web servers that respond differently to HTTP requests depending on if you're requesting the IP address directly, the hostname, or a sub-domain. (This is called virtual hosting). For example, on the Bucket machine the webserver gives different responses for http://10.10.10.212, http://bucket.htb, and http://s3.bucket.htb. There is no DNS service on the HTB network so you have to use your hosts file to resolve host names into IP addresses.

For the Bucket machine, we'd add the following line to /etc/hosts:

10.10.10.212 bucket.htb s3.bucket.htb

You can do this easily from the command line with sudo nano /etc/hosts use the nano text editor to add the line. To make sure it's working you can try ping bucket.htb and it should ping 10.10.10.212.