Demo entry 6345160

FTP_bruteforcer

   

Submitted by Melih on Jan 30, 2017 at 13:23
Language: Python. Code size: 854 Bytes.

import ftplib 

def connect(host,user,password):
	try:
		ftp = ftpliab.FTP(host)
		ftp.login(user,password)
		ftp.quit()
		return True
	except:
		return False

def main():
	# Variables
	targetHostAddress = '10.0.0.24'
	userName = 'gus'
	passwordFilePath = 'passwords.txt'
	
	# Try to connect using anonymous credentials
	print '[+] Using anonymous credentials for ' + targetHostAddress
	if connect(targetHostAddress,'anonymous','test@test.com'):
		print '[*] FTP Anonymous log on succeeded on host ' + targetHostAddress + " Username:" + password 
	else:
		print '[*] FTP Anonymous log on failed on host ' + targetHostAddress + " Username:" + password 
		
		# try brute force using dictionary file 
		
		# open passwords dictionary file 
		passwordsFile = open(passwordsFilePath,'r')
		
if __name__ == "__main__": 
	main() 

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).