Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Cloudflare IP resolver API by Down from HF(ajones)
- function is_ipv4($ip)
- {
- return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? $ip : '(Null)';
- }
- $me = $_SERVER['REMOTE_ADDR'];
- $url = $_GET['url'];
- $headers = get_headers($url, 1);
- $server = $headers['Server'];
- $key = array('aSd0Rla23-OWNER');
- $key_count = count($key);
- $sdom = array('cpanel.', 'ftp.', 'mail.', 'webmail.', 'direct.', 'direct-connect.', 'record.', 'ssl.', 'dns.', 'help.', 'blog.', 'forum.');
- if(!isset($url))
- {
- die("\n[Notice] Usage: api_cf.php?url=http://example.tld&api_key=api_key_here");
- }
- if(!isset($key_count))
- {
- die("Key not set");
- }
- $gKey = $_GET['api_key'];
- if(!in_array($gKey, $key))
- {
- die("Key not found in list");
- }
- // asumes true
- if(preg_match('/^(https?):\/\/(w{3}|w3)\./i', $url, $matches))
- {
- if($mathces[2] != 'www')
- {
- $url = preg_replace('/^(https?):\/\//', '', $url);
- }
- else
- {
- $url = explode($matches[0], $url);
- $url = $url[1];
- }
- }
- if(is_array($server))
- $server = $server[0];
- if(preg_match('/cloudflare/i', $server))
- {
- echo "\n[Notice] CloudFlare detected: ".$server."\n";
- }
- else
- {
- echo "\n[Notice] CloudFlare not detected.";
- }
- echo "[Scanner] IP: " . is_ipv4(gethostbyname($url)) . "\n\n";
- echo "[Scanner] Searching for more IP Addresses\n\n";
- for ($x = 0; $x < $count; $x++)
- {
- $site = $sdom[$x] . $url;
- $ip = is_ipv4(gethostbyname($site));
- echo "Trying ".$site.": ".$ip."\n";
- }
- echo "\n[Notice] Finished.";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment