Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
/ cloudflare-scan Public archive

A simple library able to scan a given domain for IPs outside of CloudFlare's network in a attempt to obtain the real IP of a domain behind it.

License

Notifications You must be signed in to change notification settings

drvy/cloudflare-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudFlareScan

A simple library able to scan a given host for outside of CloudFlare IPs in a attempt to obtain the real IP of server behind the CloudFlare CDN.

This script will not necessarily reveal the real IP of the server. It will just check the IP address of some common (also provided by the user) (sub)domains to verify if their IP address is outside of the CloudFlare's network. The idea is to take advantage of a badly configured DNS.

Usage

Basic usage of the Class.

require 'src/CloudFlareScan.php';
$scan = new CloudFlareScan();

try {

    $scan->scanHost('http://example.net');
    var_dump($scan->result);
    
} catch(Exception $e) { echo $e->getMessage(),PHP_EOL; }

unset($scan);

The result will be an array organized like this:

array(
    [subdomain] => array(
        [IPv4] => array(
            [addr] => '127.0.0.1',
            [CF] => (boolean)
        )
        [IPv6] => array(
            [addr] => '::1',
            [CF] => (boolean)
        )
    [subdomain] => ...
    )
)

Where 'CF' would be a boolean representing TRUE (It's under CloudFlare's Network) and FALSE (It's not).

For more examples check the 'examples.php' file.

ChangeLog

Current Version: 1.2

  • Big part of the code rewrited.
  • Better formating and completly commented.
  • Change TABS to SPACES.
  • Rewrite getHostname() due to bugs.
  • Add examples.
  • Add CLI client.
  • Most errors will now result into an Exception instead of just returning false.

About

A simple library able to scan a given domain for IPs outside of CloudFlare's network in a attempt to obtain the real IP of a domain behind it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages