LFI cheatsheet - HTB
Local File Inclusion
Command | Description |
Basic LFI | |
| Basic LFI |
| LFI with path traversal |
| LFI with name prefix |
| LFI with approved path |
LFI Bypasses | |
| Bypass basic path traversal filter |
| Bypass filters with URL encoding |
| Bypass appended extension with path truncation (obsolete) |
| Bypass appended extension with null byte (obsolete) |
| Read PHP with base64 filter |
Remote Code Execution
Command | Description |
PHP Wrappers | |
| RCE with data wrapper |
| RCE with input wrapper |
| RCE with expect wrapper |
RFI | |
| Host web shell |
| Include remote PHP web shell |
LFI + Upload | |
| Create malicious image |
| RCE with malicious uploaded image |
| Create malicious zip archive 'as jpg' |
| RCE with malicious uploaded zip |
| Create malicious phar 'as jpg' |
| RCE with malicious uploaded phar |
Log Poisoning | |
| Read PHP session parameters |
| Poison PHP session with web shell |
| RCE through poisoned PHP session |
| Poison server log |
| RCE through poisoned PHP session |
Misc
Command | Description |
| Fuzz page parameters |
| Fuzz LFI payloads |
| Fuzz webroot path |
| Fuzz server configurations |
File Inclusion Functions
Function | Read Content | Execute | Remote URL |
PHP | |||
| ✅ | ✅ | ✅ |
| ✅ | ✅ | ❌ |
| ✅ | ❌ | ✅ |
| ✅ | ❌ | ❌ |
NodeJS | |||
| ✅ | ❌ | ❌ |
| ✅ | ❌ | ❌ |
| ✅ | ✅ | ❌ |
Java | |||
| ✅ | ❌ | ❌ |
| ✅ | ✅ | ✅ |
.NET | |||
| ✅ | ❌ | ❌ |
| ✅ | ❌ | ✅ |
| ✅ | ❌ | ❌ |
| ✅ | ✅ | ✅ |
Last updated