py编写ssh应用扫描器
import paramikodef ssh_login(ip,port,user,pwd):
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip,port,user,pwd,timeout=5)
print '[+] SSH weak password: '+user,pwd
ssh.close()
except:
print '[-] checking for '+user,pwd+' fail' 代码报错了,改了一下
import paramiko
def ssh_login(ip,port,user,pwd):
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip,port,user,pwd,timeout=5)
print('[+] SSH weak password: '+user,pwd)
ssh.close()
except:
print('[-] checking for '+str(user),str(pwd)+' fail')
ip = input('IP:')
port = input("Port:")
user = input("User:")
pwd = input("password:")
ssh_login(ip,port,user,pwd)
页:
[1]