Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feature to Ignore IP addresses in subdomain scan #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cloudfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def inCloudFlare(ip):
return False


def subdomain_scan(target, subdomains):
def subdomain_scan(target, subdomains, ignoreIps):
i = 0
c = 0
if subdomains:
Expand All @@ -191,11 +191,12 @@ def subdomain_scan(target, subdomains):
target_http = str(target_http.status_code)
ip = socket.gethostbyname(subdomain)
ifIpIsWithin = inCloudFlare(ip)
ipIgnored = ip in ignoreIps

if not ifIpIsWithin:
if not ifIpIsWithin and not ipIgnored:
i += 1
print_out(Style.BRIGHT+Fore.WHITE+"[FOUND:SUBDOMAIN] "+Fore.GREEN + subdomain + " IP: " + ip + " HTTP: " + target_http)
else:
elif not ipIgnored:
print_out(Style.BRIGHT+Fore.WHITE+"[FOUND:SUBDOMAIN] "+Fore.RED + subdomain + " ON CLOUDFLARE NETWORK!")
continue

Expand Down Expand Up @@ -252,6 +253,7 @@ def update():
parser.add_argument("-t", "--target", help="target url of website", type=str)
parser.add_argument("-T", "--tor", dest="tor", action="store_true", help="enable TOR routing")
parser.add_argument("-u", "--update", dest="update", action="store_true", help="update databases")
parser.add_argument('-i','--ignore', dest="ignore", nargs='+', help='Space-Delimited list of IP addresses to ignore in subdomain scan', default=[])
parser.add_argument("-s", "--subdomains", help="name of alternate subdomains list stored in the data directory", type=str)
parser.set_defaults(tor=False)
parser.set_defaults(update=False)
Expand Down Expand Up @@ -288,7 +290,7 @@ def update():
crimeflare(args.target)

# Scan subdomains with or without TOR
subdomain_scan(args.target, args.subdomains)
subdomain_scan(args.target, args.subdomains, args.ignore)

except KeyboardInterrupt:
sys.exit(0)