Advertisement
Guest User

Untitled

a guest
Oct 25th, 2011
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. # Created by Pathogen @ www.hakhub.tk
  2.  
  3. import sys,re
  4. import subprocess as sp
  5.  
  6. file = open('results','w')
  7.  
  8. print "\033[1;32;4mChecking for live hosts."
  9.  
  10. command = "grep SUCCESS " + str(sys.argv[1]) + """  | awk '{print $5"\t"$9}'"""
  11. serverhandler = sp.Popen(command,stdout = sp.PIPE,shell=True)
  12. servers = serverhandler.stdout.read()
  13. server = re.split("\n",servers)
  14. for client in server:
  15.  creds = re.split("\t",client)
  16.  ping = "ping -c 1 " + creds[0]
  17.  pingit = sp.Popen(ping,stdout = sp.PIPE,shell=True)
  18.  reply = pingit.stdout.read()
  19.  if re.findall("100% packet loss",reply):
  20.    print "\033[1;31;1m" +  creds[0] + " is down..."
  21.  else:
  22.    if re.findall('NO',creds[1]):
  23.      print "\033[1;36;1m" + creds[0] + " is up!\nPassword:No Auth"
  24.      file.write(creds[0] + " is up!\nPassword:No Auth")
  25.    else:
  26.      print "\033[1;36;1m" + creds[0] + " is up!\nPassword:" + creds[1]
  27.      file.write(creds[0] + " is up!\nPassword:" + creds[1])
  28. ~                                                                                                    
  29. ~                                                                      
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement