Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Created by Pathogen @ www.hakhub.tk
- import sys,re
- import subprocess as sp
- file = open('results','w')
- print "\033[1;32;4mChecking for live hosts."
- command = "grep SUCCESS " + str(sys.argv[1]) + """ | awk '{print $5"\t"$9}'"""
- serverhandler = sp.Popen(command,stdout = sp.PIPE,shell=True)
- servers = serverhandler.stdout.read()
- server = re.split("\n",servers)
- for client in server:
- creds = re.split("\t",client)
- ping = "ping -c 1 " + creds[0]
- pingit = sp.Popen(ping,stdout = sp.PIPE,shell=True)
- reply = pingit.stdout.read()
- if re.findall("100% packet loss",reply):
- print "\033[1;31;1m" + creds[0] + " is down..."
- else:
- if re.findall('NO',creds[1]):
- print "\033[1;36;1m" + creds[0] + " is up!\nPassword:No Auth"
- file.write(creds[0] + " is up!\nPassword:No Auth")
- else:
- print "\033[1;36;1m" + creds[0] + " is up!\nPassword:" + creds[1]
- file.write(creds[0] + " is up!\nPassword:" + creds[1])
- ~
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement