Recently, I have been able to operate the PHP directory and created an infinite directory traversal:
The functions used are:
isset() determines whether a variable is defined
chdir() Change the current directory to the specified directory.
opendir() opens a directory.
readdir() reads a directory.
getcwd(). Get the current directory.
For if GET is also used to pass the value. Probably these things:
Here is the code:
$s=$_GET['id'];
chdir($s);
}
echo 'Currently in'.getcwd(),'
';
$a=opendir('.');
while($c=readdir($a))
{
if(is_dir($c))
{
$w =getcwd().'\'.$c;
echo $c."Open
" ;
}
else
{
echo $c.'
';
}
}
?>