What is CloudFlare
CloudFlare is one of the fastest growing CDN providers, which has free and premium service to accelerate, optimize & secure websites. There are more than 2,000,000 web properties powered by CloudFlare and I use their service too. If you are already using CloudFlare then you might have noticed IP address in DNS lookup get reflected with CloudFlare.
How this script works
this script is designed to discover the origin IP of a server that is behind Cloudflare,The work method of this script is to scan the NS of a domain,This tool only works to domains that are the domains of the original NS server This tool scans the default Private Name Server, and if they exist, they will find the original server IP
Example NS
ns1,"ns2","ns3","ns4","primary","host1","host2","masterdns","slavedns" "dns1","dns2","master","slave","node1","node2" |
Ping Test
With a ping of the domain, the Cloudflare fake IP is displayed :
C:\Users\root>ping cafeigapp.com Pinging cafeigapp.com [172.64.197.10] with 32 bytes of data: Reply from 172.64.197.10: bytes=32 time=153ms TTL=60 Reply from 172.64.197.10: bytes=32 time=150ms TTL=60 Reply from 172.64.197.10: bytes=32 time=149ms TTL=60 Reply from 172.64.197.10: bytes=32 time=155ms TTL=60 Ping statistics for 172.64.197.10: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 149ms, Maximum = 155ms, Average = 151ms |
CloudFlare Bypasser script result The script has detected the original IP by scanning Name Server on port 80 and 53, real IP is 144.76.174.208
Enter your domain: cafeigapp.com Starting... [+] Open ns1.cafeigapp.com 53 144.76.174.208 [+] Open ns1.cafeigapp.com 80 144.76.174.208 [+] Open ns2.cafeigapp.com 53 144.76.174.208 [+] Open ns2.cafeigapp.com 80 144.76.174.208 [-] Hostname could not be resolved. [-] Hostname could not be resolved. [-] Hostname could not be resolved. [-] Hostname could not be resolved. [*] Finished! |
Cloudflare Bypasser Script:
Download script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ''' File name: Bypass Cloudflare To Get Real IP Address Author: Dariush Nasirpour (Net.Edit0r) Date created: 11/10/2018 Web: http://nasirpour.info Spicial Thanks to Ehsan Nezami ''' import socket socket.setdefaulttimeout(1) domain = raw_input("Enter your domain: ") try: print "Starting...\n\r" dns = ["ns1.", "ns2.", "ns3.", "ns4.", "primary.", "host1.", "host2.", "masterdns.", "slavedns.", "dns1.", "dns2.", "master.", "slave.", "node1.", "node2."] for dns_name in dns: remoteServerIP = dns_name + domain for port in [53, 80]: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) IP = socket.gethostbyname(remoteServerIP) result = sock.connect_ex((remoteServerIP, port)) if result == 0: print "[+] Open\t{:<50}{:<3}\t{}".format(remoteServerIP, port, IP) sock.close() except socket.gaierror: print "[-] Hostname could not be resolved." pass except socket.error: print "[-] Couldn't connect to server" pass print "\n[*] Finished!" except KeyboardInterrupt: print "You pressed Ctrl+C" pass |