siunam's Website

My personal website

Home Writeups Blog Projects About E-Portfolio

File path traversal, traversal sequences blocked with absolute path bypass | Dec 12, 2022

Introduction

Welcome to my another writeup! In this Portswigger Labs lab, you’ll learn: File path traversal, traversal sequences blocked with absolute path bypass! Without further ado, let’s dive in.

Background

This lab contains a file path traversal vulnerability in the display of product images.

The application blocks traversal sequences but treats the supplied filename as being relative to a default working directory.

To solve the lab, retrieve the contents of the /etc/passwd file.

Exploitation

Home page:

In the previous lab, we found that there is a file path traversal vulnerability in the display of product images:

This time however, the application blocks traversal sequences but treats the supplied filename as being relative to a default working directory.

To bypass this, we can just provide the absolute path of the /etc/passwd:

What we’ve learned:

  1. File path traversal, traversal sequences blocked with absolute path bypass