Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * getCF.php
- * I got tired of looking up the DNS records of these various hosts
- * to find the real IP of a CloudFlare protected Server.
- * www.bigkesh.com
- * orgy[at]bigkesh[dot]com
- * Usage: php getCF.php domain.com
- * Usage2: www.yoursite.com/getCF.php?find=domain.com
- */
- if (!isset($argv[1]) && !isset($_GET['find']))
- {
- die("Argument needs to be a valid hostname.\n");
- }
- $lookupArr = array("mail.", "direct.", "direct-connect.", "cpanel.", "ftp.");
- foreach ($lookupArr as $lookupKey)
- {
- if (isset($_GET['find']))
- {
- $newline = "<br />";
- $lookupHost = $lookupKey . $_GET['find'];
- }
- else
- {
- $newline = "\n";
- $lookupHost = $lookupKey . $argv[1];
- }
- $foundHost = gethostbyname($lookupHost);
- if ($foundHost == $lookupHost)
- {
- echo "{$lookupHost} had no DNS record.{$newline}";
- }
- else
- {
- echo "{$lookupHost} = {$foundHost}{$newline}";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment