Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # script coded by datahack from pentest101.blogspot.com
- # d_f_bruter very smart script to brute force dirs and files
- # we are not responsible for any bad usage
- # have fun
- import re
- import sys
- import httplib
- def usage():
- print "#### script coded by Pentest101 Team ####"
- print "#### brute force dirs and files ####"
- print "[+] usage : ./d_f_bruter.py -[options] [file] [site]"
- print "[+] usage : ./d_f_bruter.py -D file_dris.txt [site]"
- print "[+] usage : ./d_f_bruter.py -F file_files.txt [site]"
- print "[+] usage : ./d_f_bruter.py -A file_dirs.txt file_files.txt [site]"
- print "[+] options:"
- print " -D : brute dirs"
- print " -F : brute files"
- print " -A : brute dirs first files second"
- sys.exit()
- def brute_dirs(filename,site):
- print ">>> brute forcing dirs : ",site
- print ""
- f = open(filename)
- files = f.readlines();
- for ff in files:
- ff = re.sub('\n$','',ff)
- conn = httplib.HTTPConnection(site)
- conn.request("GET","/" + ff)
- r1 = conn.getresponse()
- print ff,' ',r1.status , r1.reason
- conn.close()
- def brute_files(filename,site):
- print ">>> brute forcing files : ",site
- print ""
- f = open(filename)
- files = f.readlines();
- for ff in files:
- ff = re.sub('\n$','',ff)
- conn = httplib.HTTPConnection(site)
- conn.request("GET","/" + ff)
- r1 = conn.getresponse()
- print ff,' ',r1.status , r1.reason
- conn.close()
- def main():
- try:
- if sys.argv[1] == "-D":
- brute_dirs(sys.argv[2],sys.argv[3])
- print "coded by Pentest101.blogspot.com"
- elif sys.argv[1] == "-F":
- brute_files(sys.argv[2],sys.argv[3])
- print "coded by Pentest101.blogspot.com"
- elif sys.argv[1] == "-A":
- brute_dirs(sys.argv[2],sys.argv[4])
- brute_files(sys.argv[3],sys.argv[4])
- print "coded by Pentest101.blogspot.com"
- else:
- usage()
- except IndexError:
- usage()
- # good to go
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement