fix intendation
This commit is contained in:
118
breacher.py
118
breacher.py
@@ -25,40 +25,40 @@ print ('''\n I am not responsible for your shit and if you get some error while
|
|||||||
print ('\033[1;31m--------------------------------------------------------------------------\033[1;m\n')
|
print ('\033[1;31m--------------------------------------------------------------------------\033[1;m\n')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
target = target.replace('https://', '') #Removes https://
|
target = target.replace('https://', '') #Removes https://
|
||||||
except:
|
except:
|
||||||
print ('\033[1;31m[-]\033[1;m -u argument is not supplied. Enter python breacher -h for help')
|
print ('\033[1;31m[-]\033[1;m -u argument is not supplied. Enter python breacher -h for help')
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
target = target.replace('http://', '') #and http:// from the url
|
target = target.replace('http://', '') #and http:// from the url
|
||||||
target = target.replace('/', '') #removes / from url so we can have example.com and not example.com/
|
target = target.replace('/', '') #removes / from url so we can have example.com and not example.com/
|
||||||
target = 'http://' + target #adds http:// before url so we have a perfect URL now
|
target = 'http://' + target #adds http:// before url so we have a perfect URL now
|
||||||
if args.prefix != None:
|
if args.prefix != None:
|
||||||
target = target + args.prefix
|
target = target + args.prefix
|
||||||
try:
|
try:
|
||||||
r = requests.get(target + '/robots.txt') #Requests to example.com/robots.txt
|
r = requests.get(target + '/robots.txt') #Requests to example.com/robots.txt
|
||||||
if '<html>' in r.text: #if there's an html error page then its not robots.txt
|
if '<html>' in r.text: #if there's an html error page then its not robots.txt
|
||||||
print (' \033[1;31m[-]\033[1;m Robots.txt not found\n')
|
print (' \033[1;31m[-]\033[1;m Robots.txt not found\n')
|
||||||
else: #else we got robots.txt
|
else: #else we got robots.txt
|
||||||
print (' \033[1;32m[+]\033[0m Robots.txt found. Check for any interesting entry\n')
|
print (' \033[1;32m[+]\033[0m Robots.txt found. Check for any interesting entry\n')
|
||||||
print (r.text)
|
print (r.text)
|
||||||
except: #if this request fails, we are getting robots.txt
|
except: #if this request fails, we are getting robots.txt
|
||||||
print (' \033[1;31m[-]\033[1;m Robots.txt not found\n')
|
print (' \033[1;31m[-]\033[1;m Robots.txt not found\n')
|
||||||
print ('\033[1;31m--------------------------------------------------------------------------\033[1;m\n')
|
print ('\033[1;31m--------------------------------------------------------------------------\033[1;m\n')
|
||||||
|
|
||||||
def scan(links):
|
def scan(links):
|
||||||
for link in links: #fetches one link from the links list
|
for link in links: #fetches one link from the links list
|
||||||
link = target + link # Does this--> example.com/admin/
|
link = target + link # Does this--> example.com/admin/
|
||||||
r = requests.get(link) #Requests to the combined url
|
r = requests.get(link) #Requests to the combined url
|
||||||
http = r.status_code #Fetches the http response code
|
http = r.status_code #Fetches the http response code
|
||||||
if http == 200: #if its 200 the url points to valid resource i.e. admin panel
|
if http == 200: #if its 200 the url points to valid resource i.e. admin panel
|
||||||
print (' \033[1;32m[+]\033[0m Admin panel found: %s'% link)
|
print (' \033[1;32m[+]\033[0m Admin panel found: %s'% link)
|
||||||
elif http == 404: #404 means not found
|
elif http == 404: #404 means not found
|
||||||
print (' \033[1;31m[-]\033[1;m %s'% link)
|
print (' \033[1;31m[-]\033[1;m %s'% link)
|
||||||
elif http == 302: #302 means redirection
|
elif http == 302: #302 means redirection
|
||||||
print (' \033[1;32m[+]\033[0m Potential EAR vulnerability found : ' + link)
|
print (' \033[1;32m[+]\033[0m Potential EAR vulnerability found : ' + link)
|
||||||
else:
|
else:
|
||||||
print (' \033[1;31m[-]\033[1;m %s'% link)
|
print (' \033[1;31m[-]\033[1;m %s'% link)
|
||||||
paths = [] #list of paths
|
paths = [] #list of paths
|
||||||
def get_paths(type):
|
def get_paths(type):
|
||||||
try:
|
try:
|
||||||
@@ -66,46 +66,46 @@ def get_paths(type):
|
|||||||
for path in wordlist: #too boring to describe
|
for path in wordlist: #too boring to describe
|
||||||
path = str(path.replace("\n",""))
|
path = str(path.replace("\n",""))
|
||||||
try:
|
try:
|
||||||
if 'asp' in type:
|
if 'asp' in type:
|
||||||
if 'html' in path or 'php' in path:
|
if 'html' in path or 'php' in path:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
paths.append(path)
|
paths.append(path)
|
||||||
if 'php' in type:
|
if 'php' in type:
|
||||||
if 'asp' in path or 'html' in path:
|
if 'asp' in path or 'html' in path:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
paths.append(path)
|
paths.append(path)
|
||||||
if 'html' in type:
|
if 'html' in type:
|
||||||
if 'asp' in path or 'php' in path:
|
if 'asp' in path or 'php' in path:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
paths.append(path)
|
paths.append(path)
|
||||||
except:
|
except:
|
||||||
paths.append(path)
|
paths.append(path)
|
||||||
except IOError:
|
except IOError:
|
||||||
print ('\033[1;31m[-]\033[1;m Wordlist not found!')
|
print ('\033[1;31m[-]\033[1;m Wordlist not found!')
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
if args.fast == True: #if the user has supplied --fast argument
|
if args.fast == True: #if the user has supplied --fast argument
|
||||||
type = args.type #gets the input from --type argument
|
type = args.type #gets the input from --type argument
|
||||||
get_paths(type) #tells the link grabber to grab links according to user input like php, html, asp
|
get_paths(type) #tells the link grabber to grab links according to user input like php, html, asp
|
||||||
paths1 = paths[:len(paths)/2] #The path/links list gets
|
paths1 = paths[:len(paths)/2] #The path/links list gets
|
||||||
paths2 = paths[len(paths)/2:] #divided into two lists
|
paths2 = paths[len(paths)/2:] #divided into two lists
|
||||||
def part1():
|
def part1():
|
||||||
links = paths1 #it is the first part of the list
|
links = paths1 #it is the first part of the list
|
||||||
scan(links) #calls the scanner
|
scan(links) #calls the scanner
|
||||||
def part2():
|
def part2():
|
||||||
links = paths2 #it is the second part of the list
|
links = paths2 #it is the second part of the list
|
||||||
scan(links) #calls the scanner
|
scan(links) #calls the scanner
|
||||||
t1 = threading.Thread(target=part1) #Calls the part1 function via a thread
|
t1 = threading.Thread(target=part1) #Calls the part1 function via a thread
|
||||||
t2 = threading.Thread(target=part2) #Calls the part2 function via a thread
|
t2 = threading.Thread(target=part2) #Calls the part2 function via a thread
|
||||||
t1.start() #starts thread 1
|
t1.start() #starts thread 1
|
||||||
t2.start() #starts thread 2
|
t2.start() #starts thread 2
|
||||||
t1.join() #Joins both
|
t1.join() #Joins both
|
||||||
t2.join() #of the threads
|
t2.join() #of the threads
|
||||||
else: #if --fast isn't supplied we go without threads
|
else: #if --fast isn't supplied we go without threads
|
||||||
type = args.type
|
type = args.type
|
||||||
get_paths(type)
|
get_paths(type)
|
||||||
links = paths
|
links = paths
|
||||||
scan(links)
|
scan(links)
|
||||||
|
|||||||
Reference in New Issue
Block a user