rendered paste body<?php
/*
PHP Mass Mambo/Joomla RFI Scanner version 1.5 - 26/04/2007
Priv8 Tool for all RS mambers.
Written by R00T[ATI] && Minus. hvc88[at]hotmail.com
*/
if ($argc<4) {
echo"\nUsage: php mass_scan.php targets.txt output.txt list.txt\n";
die;
}
$targetsi = $argv[1];
$outputi = $argv[2];
$lista = $argv[3];
if(!$targets=fopen($targetsi,"r"))
{
echo "Error reading input sites file\n";
exit;
}
if(!$list=fopen($lista,"r"))
{
echo "Error reading rfi file\n";
exit;
}
/* For not replace eventual output files Minus plugged-in this code */
if (file_exists($outputi)) {
$outputi = "$outputi.2";
}
if (file_exists("$outputi".".1")) {
$outputi = "$outputi.2";
}
/* End of Minus add-on */
if(!$output=fopen($outputi,"w"))
{
echo "Error writing in output file\n";
exit;
}
ini_set('max_execution_time', 999999999);
while(!feof($targets)) /* First cicle of targets list */
{
$target_h = (fgets($targets));
fclose($list); /* Closing RFI and LFI file */
$list=fopen($lista,"r"); /* Reopening RFI and LFI file for restart the pointer at the first line */
/* 200 control code. */
$site = trim($target_h)."/inexisting_file_for_200_checking.php3";
echo "\n\n$site";
$file = @fopen($site, 'r');
if ($file)
{
echo " - Probably invalid 200 replay Creating probably_sites.txt\n\n";
$not_regular_200 = true; /* If site replay with 200 boolean flag will be set to TRUE */
if(!$probably_200=fopen("probably_sites.txt","w"))
{
echo "Error writing probably_200 file\n"; /* Creating probably.txt file */
exit;
}
}
else
{
echo " - Right 404 replay! \n";
}
/* End 200 control code. */
do { /* Opening second cicle for RFI and LFI file */
$list_h = (fgets($list));
$site = trim($target_h).trim($list_h); /* trim for delete the spaces */
echo $site;
$file = @fopen($site, 'r'); /* Rudimental HTTP replay grabber XD */
if ($file)
{
echo " - 200\n";
if ($not_regular_200)
{
fputs($probably_200 ,"$site
"."\n");
}
else
{
fputs($output ,"$site
"."\n"); /* Write in output file */
}
}
else /* If site replay with 404 */
{
echo " - 404\n"; /* 404??? Maybe also 403 or 500 */
}
} while(!feof($list)); /* Closing RFI and LFI file */
$not_regular_200 = false; /* Resetting boolean flag to false */
} /* Closing first cicle of targets list */
fclose($list);
fclose($targets);
fclose($output);
if(!$probably_200)
{
fclose($probably_200);
}
?>