Windows DHCP ServerÔ¶³Ì´úÂëÖ´ÐÐÎó²îÆÊÎö£¨CVE-2019-0626£©
Ðû²¼Ê±¼ä 2019-02-192ÔÂ12ÈÕ£¬Î¢ÈíÐû²¼2Ô·ÝÔ¶ÈÀýÐÐÇ徲ͨ¸æ£¬ÐÞ¸´Á˶à¸ö¸ßΣÎó²î£¬ÆäÖаüÀ¨Windows DHCP ServerÔ¶³Ì´úÂëÖ´ÐÐÎó²îCVE-2019-0626¡£µ±¹¥»÷ÕßÏòDHCP·þÎñÆ÷·¢ËÍÈ«ÐÄÉè¼ÆµÄÊý¾Ý°ü²¢ÀÖ³ÉʹÓú󣬾ͿÉÒÔÔÚDHCP·þÎñÖÐÖ´ÐÐí§Òâ´úÂ룬Îó²îÓ°Ïì¹æÄ£½Ï´ó¡£Õë¶Ô´ËÎó²î£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabµÚһʱ¼ä¶ÔÆä¾ÙÐÐÁËÏêϸÆÊÎö¡£
Îó²îÓ°Ïì°æ±¾
Windows 7
Windows 8.1
Windows 10
Windows Server 2008
Windows Server 2012
Windows Server 2016
Windows Server 2019
ÐÒé¼ò½é
´«ÊäµÄDHCPÐÒ鱨ÎÄÐè×ñÕÕÒÔÏÂÃûÌãº
DHCP°üÀ¨Ðí¶àÀàÐ͵ÄOption£¬Ã¿¸öOptionÓÉType¡¢LengthºÍDataÈý¸ö×Ö¶Î×é³É¡£
TypeÈ¡Öµ¹æÄ£1~255£¬²¿·ÖTypeÀàÐÍÈçÏÂͼËùʾ¡£
DHCP·þÎñÔÚ´¦Öóͷ£Vendor Specific ÀàÐÍ£¨Type=43£©µÄOption½á¹¹±£´æÇå¾²Îó²î¡£Ê×ÏÈ¿´ÏÂDHCP·þÎñ³ÌÐò¶ÔOptionµÄ´¦Öóͷ£Àú³Ì£¬ ProcessMessageº¯ÊýÈÏÕæ´¦Öóͷ£ÊÕµ½µÄDHCP±¨ÎÄ£¬Å²ÓÃExtractOptionsº¯Êý´¦Öóͷ£DHCPµÄOption×ֶΣ¬´«È뺯ÊýExtractOptionsµÄ²ÎÊý1£¨v7£©ÎªDHCP±¨ÎÄÖ¸Õ룬²ÎÊý3£¨*(unsigned int *)(v5 + 16)£©¶ÔÓ¦Ö¸ÕëÆ«ÒÆλÖÃ+16µÄÊý¾Ý£¬¼´Len×ֶΡ£
ExtractOptionº¯ÊýÈçÏÂËùʾ¡£ v6 = (unsigned __int64)&a1[a3 - 1];Ö¸Ïò±¨ÎÄĩβλÖã»v10=a1+240;Ö¸Ïò±¨ÎÄÖÐOption½á¹¹¡£ÔÚforÑ»·Öд¦Öóͷ£²î±ðÀàÐ͵ÄOption½á¹¹£¬µ±type=43£¨Vendor Specific Information£©£¬´«ÈëÖ¸Õëv10ºÍÖ¸Õëv6×÷Ϊ²ÎÊý£¬Å²ÓÃParseVendorSpecificº¯Êý¾ÙÐд¦Öóͷ£¡£
ParseVendorSpecificº¯ÊýÄÚ²¿Å²ÓÃUncodeOptionº¯Êý¡£UncodeOptionº¯Êý²ÎÊýa1Ö¸ÏòoptionÆðʼλÖã¬a2Ö¸Ïò±¨ÎĵÄĩβλÖá£UncodeOptionº¯Êý±£´æÇå¾²Îó²î£¬ÏÂÃæÍŽáPOCºÍ²¹¶¡±È¶Ô¾ÙÐÐÆÊÎö¡£
½á¹¹Ò»¸öDHCP Discovery±¨ÎÄ£¬POCÈçÏÂËùʾ£¬POC°üÀ¨Á½¸övendor_specific ÀàÐ͵ÄOption½á¹¹¡£vendor_specific1ÊÇÕýµ±µÄOption½á¹¹£¬LengthÈ¡Öµ0x0a¼´ÊÇDataµÄÏÖʵ³¤¶È£¨0x0a£©£¬vendor_specific2ÊDz»Õýµ±µÄOption½á¹¹£¬ LengthÈ¡Öµ0x0f´óÓÚDataµÄÏÖʵ³¤¶È£¨0x0a£©¡£
DHCP·þÎñÆ÷ÊÕµ½DiscoveryÇëÇó±¨ÎÄ£¬¶ÔÊý¾Ý°ü¾ÙÐд¦Öóͷ£¡£Ê×ÏÈÖ´ÐÐExtractOptions´¦Öóͷ£Options£¬µ±´¦Öóͷ£vendor_specificÀàÐ͵ÄOptionʱ£¬½øÈëµ½ParseVendorSpecific¾ÙÐд¦Öóͷ£¡£POCÖнṹһ¸öÕýµ±µÄvendor_specific1£¬Ä¿µÄÊÇΪÁËÈƹý84~85ÐеÄУÑé´úÂ룬ʹ³ÌÐò˳ËìÖ´Ðе½ParseVendorSpecificº¯Êý¡£
ParseVendorSpecificŲÓÃUncodeOptionº¯Êý£¬ÏêϸÈçÏ£º
48ÐÐŲÓÃHeapAlloc·ÖÅɶÑÄڴ棬·ÖÅɵÄÄÚ´æ¾Þϸv13=a¡£

²¹¶¡±È¶Ô
²¹¶¡ºóµÄ°æ±¾Ìí¼ÓÁ˶ÔLength×ֶεÄÓÐÓÃÐÔÅжϡ£