Alright, a friend and myself where working on writing this file to search child directories for index files, and then create one if the there wasn't one.
The results where equal every time we tweaked the script. The script would write the index file in the same directory the script was in, but wouldn't mess with the child directories.
I tested it on a Hosted server, running in Safe_mode, and the script created a file with no extention called "core". The file was 21mb's, and I only got a peice of it. What is the core file? And why is the script making the server write it? Here's the script, and peices of the core file.
function do_the_dir($dir) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "Checking file $file<br>\n";
if(is_dir($file)) {
echo " <b>Found Directory $file</b><br>\n";
$testies = @fopen("$file"."index.html", 'r');
$testies2 = @fopen("$file"."index.php", 'r');
$testies3 = @fopen("$file"."index.asp", 'r');
$testies4 = @fopen("$file"."index.cgi", 'r');
$testies5 = @fopen("$file"."index.htm", 'r');
$testies6 = @fopen("$file"."index.shtml", 'r');
if(!$testies && !$testies6 && !$testies5 && !$testies4 && !$testies3 && ! $testies2) {
//if the directory is without balls
echo " Found no index in $file, creating one<br>\n";
$indexFile="index.html";
$data = "Index File - \n<br>Created by..";
$fp = fopen("
$file$indexFile", "w");
fwrite($fp,$data);
fclose($fp);
}
do_the_dir($file);
} else
echo " No dir found, continuing search";
}
closedir($dh);
}
}
do_the_dir('.');
(It seems as if it's an error log, but the server generates them as error_log)
Core contents:
ELF 4 4 ^ ô H € @9 À= À À à €A €Ë €Ë Ï @ Ï@ pÏ p@ €Ï €@ ......