Crack Searcher v1

Status
Not open for further replies.
8 comments
Oh the pain...

crawler.php
Code:
<?php
$startingpoint = "<br>1."; 
$endingpoint = "</a><br><hr>";
preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "http://crackspider.net/search.shtml?q=$q", $matches);
$theDomain = "http://" . $matches[2];
$page = $matches[3];
$fd = fopen($theDomain.$page, "r"); 
$value = "";
while(!feof($fd)){
    $value .= fread($fd, 4096);    
}
fclose($fd);
$start= strpos($value, "$startingpoint");  
$finish= strpos($value, "$endingpoint");  
$length= $finish-$start;
$value=substr($value, $start, $length);
$value = eregi_replace( "<b>CrackSpider</b> does not host any files ! This site merely indexes other sites content", "", $value ); 
$value = eregi_replace( "<IMG alt=[^>]*>", "", $value );   
$value = eregi_replace( "<IMG alt=[^>]*>", "", $value );   
$value = eregi_replace( "<class[^>]*>", "", $value );
$value = eregi_replace( "<table[^>]*>", "", $value ); 
$value = eregi_replace( "<tr[^>]*>", "", $value ); 
$value = eregi_replace( "<td[^>]*>", "", $value ); 
$value = str_replace( "</font>", "", $value ); 
$value = str_replace( "</table>", "", $value ); 
$value = str_replace( "</tr>", "", $value ); 
$value = str_replace( "</td>", "", $value ); 
$value = str_replace( "<center>", "", $value );
$value = str_replace( "</center>", "", $value ); 
$value = str_replace( "<b>", "", $value );
$value = str_replace( "</b>", "", $value ); 
$value = eregi_replace( "href=", "target=\"_blank\" href=", $value ); 
$value = eregi_replace( "href=\"", "target=\"_blank\" href=\"", $value ); 
$FinalOutput = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $theDomain . "\\2", $value);
echo $FinalOutput;
flush (); 
?>
for search.php

Code:
<?php include("crawler.php"); 
      $q = str_replace(" ","_",$q);
$q = str_replace("%20","_",$q);  
      ?>
make sure $GET_['q']; is always at the top of your search page.

to search your site from your index, include this code...

Code:
<form name="form1" method="post" action="search.php">
    <input name="q" type="text" id="q">
    <input type="submit" name="Submit" value="Search">
  </form>
 
lol, cmon addicted i thought you knew better hehe

dont use ereg_replace

in search.php your $q needs to be set BEFORE you include cralwer and try urlencode() on that

its better to CURL rather than fopen on external webmsites
 
Status
Not open for further replies.
Back
Top