Post

HackTheBox File Inclusion (Skills Assessment)

HackTheBox File Inclusion (Skills Assessment)

Hello World

Today, I will solve the File Inclusion Skills Assessment in the HackTheBox Web Penetration Tester Path.

Image

Reconnaissance

First, I used the IP address provided to access the web application through the browser.

There is a site that provides World Wide Freight services.

Image

Then I started browsing the site and found a parameter called “page”.

Image

So I went to Burp, took this request to Repeater, and started testing the LFI vulnerability, but it did not work.

So I tried using PHP wrappers to display the contents of the files, and it worked.

1
php://filter/read=convert.base64-encode/resource=contact

Image

So I decoded it and found that its content was not useful, so I decided to fuzz the PHP files using ffuf.

1
ffuf -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u http://94.237.48.253:38964/FUZZ.php -ic

Image

So I tried using PHP wrappers with the index file.

Image

Then I decoded it and found this.

Image

This indicates that there is a hidden admin panel, and it displays some logs.

Image

I also noticed that there is another parameter that specifies the type of logs displayed. So I tried using LFI payloads, and it worked.

Image

Log Poisoning

Then I tried to access the file that contains the web application’s logs by fuzzing these files to reach the correct path.

1
ffuf -w LFI-gracefulsecurity-linux.txt:FUZZ -u http://94.237.48.253:38964/ilf_admin/index.php?log=../../../../../../../FUZZ -fs 2046

and I found the ‘access.log’ file.

Image

Then I displayed its content directly on the page using the “log” parameter.

Image

I noticed that it was storing the user-agent header, so I tried log poisoning, and it worked.

Image

And now we got our flag.

Image

Image

Conclusion

If you find it helpful, Kindly give me respect from here N0UR0X01-HTB

Stay in touch

LinkedIn | Twitter

This post is licensed under CC BY 4.0 by the author.