Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bypass Cloudflare To Get Real IP Address
'''
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.