added hosts file info
Gitea/Baltimore-hackthebox-knowledgebase/pipeline/head This commit looks good Details

main
s00ner 2022-02-23 18:49:55 -05:00
parent 1dbb06ea50
commit 57bf66bc00
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# 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](https://en.wikipedia.org/wiki/Virtual_hosting)).
For example, on the [Bucket](https://app.hackthebox.com/machines/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](https://en.wikipedia.org/wiki/Hosts_(file)) to resolve the different host names into the IP address.
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.