Skip to main contentSkip to main content
Room Banner
Back to all walkthroughs
Room Icon

Upload Vulnerabilities

Premium room

Tutorial room exploring some basic file-upload vulnerabilities in websites

easy

45 min

98,574

User profile photo.

To access material, start machines and answer questions login.

Please read and follow the instructions in this task carefully. If you skip over this task and encounter connectivity errors as a result, the Discord volunteers reserve the right to ignore you.

The instructions in this task will help you to configure the hosts file (opens in new tab) of your device. The hosts file is used for local domain name mapping, bypassing . In short, it allows you to map IP addresses to domain names locally without relying on a server to resolve the IP address for you. This is useful in environments such as TryHackMe where is not available as it allows us to manually map one or more domains / subdomains to an IP address of our choosing. Being able to access content using a domain makes it possible to (amongst many other advantages) use name-based virtual hosting -- commonly shortened to "vhosting" -- to serve multiple websites from a single webserver: a feature which is used extensively in this room.

It is very important that you understand these concepts before continuing. If any of the above information does not make sense, please do some background reading (e.g., here) into how domain names, IP addresses, and webserver VHosts work before continuing with the content of this room.


First up, let's deploy the machine to give it a few minutes to boot.

Once you've clicked deploy, you'll need to configure your own computer to be able to connect.

If you've successfully deployed the machine then the following code blocks will already have the IP address filled in. If any of them have "MACH​INE_IP" in them, then you still need to deploy the machine, and the following instructions will not work.


Using your favourite text editor in an administrative session, open the hosts file on your device.

  • On and MacOS the hosts file can be found at /etc/hosts.
  • On Windows the hosts file can be found at C:\Windows\System32\drivers\etc\hosts.

On Linux or MacOS you will need to use sudo to open the file for writing. In Windows you will need to open the file with "Run as Administrator".

Add the following line in at the end of the file:

MACHINE_IP    overwrite.uploadvulns.thm shell.uploadvulns.thm java.uploadvulns.thm annex.uploadvulns.thm magic.uploadvulns.thm jewel.uploadvulns.thm demo.uploadvulns.thm

Note: If you have done this step before then you must remove the previous entry. There should only ever be one line in the file that contains the above URLs. For example, the following example will not work:

10.10.10.10    overwrite.uploadvulns.thm shell.uploadvulns.thm java.uploadvulns.thm annex.uploadvulns.thm magic.uploadvulns.thm jewel.uploadvulns.thm demo.uploadvulns.thm
MACHINE_IP    overwrite.uploadvulns.thm shell.uploadvulns.thm java.uploadvulns.thm annex.uploadvulns.thm magic.uploadvulns.thm jewel.uploadvulns.thm demo.uploadvulns.thm

When you terminate your instance of the upload vulns target machine, make sure to remove this line!

It goes without saying that you will not get the same IP address if you redeploy the target machine later. This means that any existing entries in your hosts file when you redeploy will point at the wrong address (ergo, connectivity error). If you add a duplicate line without removing the original, as mentioned above, you will also get a connectivity error. Removing it as soon as you terminate the machine gives you a clean slate and removes these possibilities for error.


You should now be able to access the virtual machine, so let's get started!

Note: If you find that you cannot access the websites, this is nearly always due to one of:
A) Having duplicate entries in your host file
B) Having an anonymising active alongside your TryHackMe connection pack

Answer the questions below

I solemly swear that I have read (and fully understood) the above information.

I have configured my machine as instructed.

Ready to learn Cyber Security?

The Upload Vulnerabilities room is only available for premium users. Signup now to access more than 500 free rooms and learn cyber security through a fun, interactive learning environment.

Already have an account? Log in

We use cookies to ensure you get the best user experience. For more information see our cookie policy.