jiangxl 发表于 2020-12-11 18:37:21

py编写ssh应用扫描器

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 '+user,pwd+' fail'

叼辣条闯世界 发表于 2020-12-13 14:26:36

代码报错了,改了一下
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]
查看完整版本: py编写ssh应用扫描器