You are currently viewing File path traversal, validation of file extension with null byte bypass

File path traversal, validation of file extension with null byte bypass

introduction

Hello, friends. How are you all doing? This is our 6th article on path and directory traversal vulnerabilities. In this article, we will cover the PortSwigger Web Security Lab’s File Path Traversal and Validation of File Extension with Null Byte Bypass step by step practically.

Lab Description

In this lab, we have already discussed that there is a file path traversal vulnerability in the product’s image section. The application has implemented security measures to validate your extension. Therefore, if you provide any malicious input, it will not be accepted. To solve this lab, you need to retrieve the /etc/passwd file.

Lab Solution

File path traversal, validation of file extension with null byte bypass

Firstly, access the lab. After accessing it, enable the Burp proxy and configure your browser to use the Burp proxy as well. Once you have done that, click on any product to view its details.

File path traversal, validation of file extension with null byte bypass

When you click on a product, go to the Burp proxy tab and navigate to the HTTP history tab. Click on the filter and select images because this vulnerability can be found in the image section.

File path traversal, validation of file extension with null byte bypass

After doing this, you will find some images. Simply send one of those images to the repeater tab because we need to perform testing on it.

File path traversal, validation of file extension with null byte bypass

../../../etc/passwd%00.png

As you can see, I tried a payload, and I gained access to the /etc/passwd file. In the above payload, I used %00.png, which is a null character used to bypass security.

File path traversal, validation of file extension with null byte bypass

So, as you can see, we have successfully solved the PortSwigger Web Security Lab’s File Path Traversal and Validation of File Extension with Null Byte Bypass. Check our site if you want to learn cybersecurity in-depth

Now you have officially completed all the labs for Directory Traversal, Now you have to move towards the Command Injection Labs Start from Here : OS Command Injection, Simple Case. Good Luck!

FAQS

What is web security?

Website security refers to protecting a website or web application from cyberattacks, unauthorized access, or other security threats.

What is web application security?

Web application security means protecting a website from cyberattacks. These attacks may include vulnerabilities such as SQL injection, XSS, file inclusion, and others.

Which of the following is a good security practice for web browsing?

It is always a good practice to use an up-to-date browser with timely updates. Keep your browser plugins up-to-date, avoid malicious websites and links, and always enable 2-factor authentication while avoiding clickjacking.

How to find someone’s social security number on the dark web

Searching for someone’s social security number or credit card information on the dark web is illegal and unethical. It is important to always avoid such activities and protect yourself and others from cyber threats.

Leave a Reply