Thread: Blog Spammers
View Single Post
Old 01-29-2005, 04:48 PM  
fünkmaster
So Fucking Banned
 
Join Date: Nov 2004
Posts: 791
Quote:
Originally Posted by Alex from Montreal
And most importantly, can this thing get you ban/blacklisted on search engines?
... OMG !!!

... anyway, I am feeling generous today, here is the one that was programmed for me:

Code:
<?php

set_time_limit(0);

require("db.php");

$query = mysql_query("SELECT * FROM Referrers");
while ($row = mysql_fetch_array($query)) {
        $refs[] = $row['Domain'];
}

while (1) {

while (!mysql_query("LOCK TABLES Sites READ")) {
    usleep(200);
}

mysql_query("LOCK TABLES Sites WRITE");
$query = mysql_query("SELECT * FROM Sites ORDER BY LastHit LIMIT 1");
if (!$query) {
   die('Invalid query: ' . mysql_error());
}
$row = mysql_fetch_array($query);
mysql_query("UPDATE Sites SET LastHit = UNIX_TIMESTAMP() WHERE Domain = '".$row['Domain']."'");
mysql_query("UNLOCK TABLES");


        ereg('^([a-zA-Z0-9\.-]+)(.*)$', $row['URL'], $regs);
        $url = $regs[1]; $dir = $regs[2];
        if (!$dir) $dir = "/";

        $sock = @fsockopen($url, 80, $errno, $errstr, 4);
        if (!$sock) continue;
        #$s[] = $sock;

        # generate referrer
        $ref = 'http://www.'.$refs[rand(0, count($refs)-1)].'/';

        #stream_set_blocking($sock, FALSE);
        print $sock." Hitting ".$url." ... ".$ref."\n";
        fputs($sock, "GET ".$dir." HTTP/1.1\nHost: ".$row['URL']."\nReferer: ".$ref."\nUser-Agent: Mozilla/5.0 (compatible; MSIE 6.1; Windows NT 7.1; .Mozilla)\n\n");
        fclose($sock);

        /*$r = $s;
        if (stream_select($r, $w = NULL, $e = NULL, 0)) {
                for ($j=0; $j<count($r); $j++) {
                        if ($r[$j]) {
                                # debugging purposes only
                                # print "closing $j ".$r[$j]."\n";
                                array_splice($s, array_search($r[$j], $s), 1);
                                fclose($r[$j]);
                        }
                }
        }
        $i++;*/

}
?>
fünkmaster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote