Siunam's Website

My personal website

Home About Blog Writeups Projects E-Portfolio

File path traversal, traversal sequences stripped non-recursively | Dec 12, 2022

Introduction

Welcome to my another writeup! In this Portswigger Labs lab, you’ll learn: File path traversal, traversal sequences stripped non-recursively! Without further ado, let’s dive in.

Background

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

The application strips path traversal sequences from the user-supplied filename before using it.

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

Exploitation

Home page:

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

In the background, it said:

The application strips path traversal sequences from the user-supplied filename before using it.

To bypass that, we can use nested traversal sequences, like ....//:

What we’ve learned:

  1. File path traversal, traversal sequences stripped non-recursively