Skip to content

Added password prompt and used print() function #5

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

Open
wants to merge 2 commits 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
36 changes: 22 additions & 14 deletions cloudflare_enum.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# -*- coding: utf-8 -*-
# Created using Metafidv2 by Matthew Bryant (mandatory)
# Unauthorized use is stricly prohibited, please contact mandatory@gmail.com with questions/comments.
from __future__ import print_function
import requests
import getpass
import json
import time
import csv
Expand Down Expand Up @@ -75,7 +77,7 @@ def get_domain_dns( self, domain ):
data = json.loads( r.text )
success = data['success']
if not success:
print r.text
print( r.text )
return False

request_id = data['result']['id']
Expand Down Expand Up @@ -134,7 +136,7 @@ def get_spreadsheet( self, domain ):

def print_banner( self ):
if self.verbose:
print """
print("""

`..--------..`
.-:///::------::///:.`
Expand All @@ -157,25 +159,25 @@ def print_banner( self ):
`//+sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss+/-
`//+ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo+++++/.
``````````````````````````````````````````````````````````````````````````````````````
Cloudflare DNS Enumeration Tool v1.2
By mandatory
"""

Cloudflare DNS Enumeration Tool v1.3
Created by mandatory
Modified by yamakira
""" )

def pprint( self, input_dict ):
print json.dumps(input_dict, sort_keys=True, indent=4, separators=(',', ': '))
print( json.dumps(input_dict, sort_keys=True, indent=4, separators=(',', ': ')) )

def statusmsg( self, msg ):
if self.verbose:
print "[ STATUS ] " + msg
print( "[ STATUS ] " + msg )

def errormsg( self, msg ):
if self.verbose:
print "[ ERROR ] " + msg
print( "[ ERROR ] " + msg )

def successmsg( self, msg ):
if self.verbose:
print "[ SUCCESS ] " + msg
print( "[ SUCCESS ] " + msg )

def find_between_r( self, s, first, last ):
try:
Expand Down Expand Up @@ -205,11 +207,17 @@ def get_cookie_from_file( self, cookie_file ):

return return_dict

def get_creds(self):
username = sys.argv[1]
password = getpass.getpass('Provide your cloudflare password:')
return username,password

if __name__ == "__main__":
if len( sys.argv ) < 3:
print "Usage: " + sys.argv[0] + " username@email.com password domain.com"
if len( sys.argv ) < 2:
print( "Usage: " + sys.argv[0] + " username@email.com domain.com" )
else:
cloud = cloudflare_enum()
username,password = cloud.get_creds()
cloud.print_banner()
cloud.log_in( sys.argv[1], sys.argv[2] )
cloud.get_spreadsheet( sys.argv[3] )
cloud.log_in(username,password)
cloud.get_spreadsheet(sys.argv[2])