What's this Reffy prog like ?
http://www.adminshop.com/
http://www.adminshop.com/



<?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++;*/
}
?>
<?php
@mysql_pconnect("localhost", "hitter", "hitbot");
@mysql_select_db("hitter");
?>
<?php
require("google.class.php");
require("db.php");
$query_string = 'XXX';
$max = 1000;
function get_domain($domain) {
$tld = Array("co", "com", "net", "org", "id", "ac", "edu", "gov", "mil");
eregi('^([a-zA-Z0-9\.-]+)', $domain, $regs);
$domain = $regs[1];
$parts = explode('.', $domain);
$result = "";
for ($i=count($parts)-1; $i>=0; $i--) {
$result = $parts[$i].($result ? '.' : '').$result;
if ($i != count($parts)-1
&& strlen($parts[$i]) > 2
&& !in_array($parts[$i], $tld)
) break;
}
return $result;
}
function valid($domain) {
$bad = Array("gov", "mil", "edu");
if (!ereg('^([a-zA-Z0-9\.-]+)$', $domain)) return 0;
eregi('^([a-zA-Z0-9\.-]+)', $domain, $regs);
$domain = $regs[1];
$parts = explode('.', $domain);
foreach ($parts as $part) {
if (in_array($part, $bad)) return 0;
}
return 1;
}
$google = new google_search;
$query = @mysql_query("SELECT * FROM TLD");
while ($row = mysql_fetch_array($query)) {
for ($start=0; $start<$max; $start+=100) {
$google->query($query_string.' site:'.$row['TLD'].' ', $start);
if (count($google->results) hahahaha 0) break;
$old_url = $first_url; $first_url = "";
foreach ($google->results as $result) {
eregi(' for ([^ ]+)', $result['title'], $regs);
eregi('^http://([^/]+)', $result['url'], $regs2);
if (!ereg('\.', $regs[1])) $url = $regs2[1];
else $url = $regs[1];
$url = eregi_replace('http://','',$url);
if (!$first_url) {
$first_url = $url;
if ($old_url && $old_url hahahaha $first_url) break(2);
}
if (!valid($url)) continue;
mysql_query("INSERT INTO Sites VALUES (
'".get_domain($url)."',
'".$url."',
'".$result['url']."',
0, 0);");
}
}
}
?>
<?php
class google_search {
var $url = 'http://www.google.com/search?num=100&hl=en&as_qdr=m3&ie=UTF-8&oe=UTF-8&q=';
var $results;
function query($query, $start = 0) {
$fd = fopen($this->url.urlencode($query)."&start=".$start."&sa=N", "r");
$this->results = Array();
while ($line = fgets($fd)) {
$count = preg_match_all("/<p class=g><a href=(.+?)>(.+?)<\/a>/", $line, $matches, PREG_SET_ORDER);
for ($i=0; $i<$count; $i++) {
$this->search_callback($matches[$i]);
}
}
fclose($fd);
}
function search_callback($match) {
$this->results[] = Array(
'url' => $match[1],
'title' => $match[2]);
}
}
?>
#!/usr/local/bin/bash echo DELETE FROM Referrers\; | mysql -u root hitter for i in `cat $1` ; do echo INSERT INTO Referrers VALUES \(\'$i\'\)\; ; done | mysql -u root hitter

Comment