Rabu, 04 April 2012

HTTPQuery Script Example






What about httpquery script? Just a script to take queries over http. Make http request, post or get request to the web servers. It is usefull to create any remote exploit. Any request send by the httpquery. This example script can send request by GET method and POST method. I also give example how to use it. Lets coding!


<?php
#### HTTP QUERY by ArRay a.k.a XterM ####

/* define the httpquery functions */
function httpquery($method,$url,$data=''){
    $url = str_replace("http://","",$url);
    $host = explode("/",$url);
    if(eregi(":",$host[0])){
        $gport = explode(":",$host[0]);
    }
    $port = ($gport[1])?$gport[1]:80;
    for($i=1;$i<count($host);$i++){
        $path .= "/".$host[$i];
    }
    $sock = fsockopen($host[0],$port,$errno,$errstr,30);
    if ($sock) {
        $request   = (($method=='post')?"POST":"GET")." ".$path." HTTP/1.1\r\n";
        $request  .= "Host: ".$host[0]."\r\n";
        $request  .= "Referer: www.explorecrew.org\r\n";
        $request  .= "Accept: */*\r\n";
        $request  .= "User-Agent: NetExplorer/5.0\r\n";
        $request  .= ($method=='post')?"Content-type: application/x-www-form-urlencoded\r\n":"";
        $request  .= ($method=='post')?"Content-length: ".strlen($data)."\r\n":"";
        $request  .= "Connection: Close\r\n\r\n";
        fputs($sock,$request);
        if($method=='post')fputs($sock,$data);
        while (!feof($sock)) { 
            $output .= trim(fgets($sock, 3600))."\n";            
        }
        fclose($sock);
    }
    return $output;
}

/* example GET method */
function hashkiller($hash){
    $url = 'http://hashkiller.com/api/api.php?md5='.$hash;
    $data = httpquery('get',$url);
    $xp = explode("<plain>",$data); 
    $xp2 = explode("</plain>",$xp[1]);
    $pwd = $xp2[0];
    return $pwd;
}

/* example POST method */
function passcracking($hash){
    $url  = "http://passcracking.com/index.php";
    $post = 'datafromuser='.$hash.'&submit=DoIT';
    $data = httpquery('post',$url,$post);
    $xp = explode("</td><td bgcolor=#FF0000>",$data);
    $xp2 = explode("</td><td>",$xp[1]);
    $pwd = $xp2[0];
    if($pwd)return $pwd;
    return false;
}


$md5 = "abcdefabcdefabcdefabcdef";

print "hashkiller: ".hashkiller($md5)."<br>";
print "passcracking: ".passcracking($md5)."<br>";

?>

Posting Lebih Baru Posting Lama Beranda

0 komentar:

Posting Komentar