Advertisement
Guest User

Untitled

a guest
Dec 16th, 2012
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import re
  2. import sys
  3. import urllib2
  4. import urllib
  5. import threading
  6.  
  7. websites = []
  8. websiteheaders = []
  9.  
  10. def logfile(websiteheaders):
  11.  
  12.     for line in websiteheaders:
  13.         if "Server" in line:
  14.             print line
  15.  
  16. def headerophalen(websites):
  17.  
  18.     for url in websites:
  19.         response = urllib2.urlopen(url)
  20.         headers = str(response.info())
  21.         websiteheaders.append(headers)
  22.  
  23.     logfile(websiteheaders)
  24.  
  25. def main():
  26.  
  27.     hostsfile = open ("hosts.txt", "r")
  28.  
  29.     for line in hostsfile:
  30.         websites.append("http://" + line)
  31.  
  32.     thread = threading.Thread(target=headerophalen, args=(websites,))
  33.     thread.start()
  34.  
  35.  
  36.  
  37. if __name__=="__main__":
  38.  
  39.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement