TryHackMe File Inclusion Challenge

This Challenge Lab is relatively easy if you already did the HTTP Web Fundamentals. If you have not done that Lab yet, I highly recommend you do this Lab first before attempting to get the flags in this room. Watch the video walk-though and you will get your answer for flag1 and flag3 (skip to the last 5 mins).  HTTP Web fundamentals

Flag1: Using curl

File Inclusion Curl POST command

Running curl command and saving the output in a file called results.html.  As per image below, we could see flag1 content after viewing the HTML file.

TryHackMe File inclusion flag1

Flag2: Cookie manipulation on client side

From your browser, using the developer mode (F12), you will notice that the website is using a cookie called THM with value Guest.  .

THM Flag2 cookie manipulation

Changing the Value to Admin, and refreshing the page will give you admin access.

THM Flag 2 admin access

 

Changing the value of the cookie after obtaining admin access, we should be able to view flag2.  Hint: use null bytes to terminate the string.

try hack me file inclusion challenge

Flag3 : Using curl

Testing the form of challenge 3, notice how an extension, PHP in this instance, is getting added to the file we are trying to include.  This should be fairly easy to bypass using null bytes characters.

THM File Inclusion challenges flag 3

So we constructed our curl command, by trial and error until we get as close to the one below (which worked) and saving output to file named flag3.html.

curl -x POST --data

Viewing our HTML file, to grab our last flag.

THM File Inclusion Challenges

If you have attempted this challenge, using BURP suite, kindly share link in comment below.