Windows DHCP ServerÔ¶³Ì´úÂëÖ´ÐÐÎó²îÆÊÎö£¨CVE-2019-0626£©

Ðû²¼Ê±¼ä 2019-02-19
Îó²îÅä¾°

2ÔÂ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£¬¶¯Ì¬Ö÷»úÉèÖÃЭÒ飬ǰÉíÊÇBOOTPЭÒ飬ÊÇÒ»¸ö¾ÖÓòÍøµÄÍøÂçЭÒé ¡£DHCPͨ³£ÓÃÓÚ¼¯ÖÐÖÎÀí·ÖÅÉIPµØµã£¬Ê¹client¶¯Ì¬µØ»ñµÃIPµØµã¡¢GatewayµØµã¡¢DNS·þÎñÆ÷µØµãµÈÐÅÏ¢ ¡£DHCP¿Í»§¶ËºÍDHCP·þÎñ¶ËµÄ½»»¥Àú³ÌÈçÏÂͼËùʾ ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


´«ÊäµÄ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º¯Êý£¬ÏêϸÈçÏ£º


32~43ÐÐÔÚdo-whileÑ­»·ÖÐÅÌËãOption½á¹¹µÄ LengthÖµÖ®ºÍ£¬ÉúÑĵ½v13£¬×÷Ϊ·ÖÅɶÑÄڴ泤¶È ¡£POCÖаüÀ¨Á½¸övendor_specific½á¹¹£¬Ê×ÏÈ´¦Öóͷ£vendor_specific1£¬ÅÌËãv13£¬¼´vendor_specific1³¤¶Èa£¬²¢ÇÒʹv12Ö¸ÏòÏÂÒ»¸öOption½á¹¹vendor_specific2£¬µ±½øÈë43ÐÐwhileÌõ¼þÅжÏ£¬ÓÉÓÚvendor_specific2³¤¶È²»Õýµ±£¬do-whileÑ­»·¿¢Ê ¡£

48ÐÐŲÓÃHeapAlloc·ÖÅɶÑÄڴ棬·ÖÅɵÄÄÚ´æ¾Þϸv13=a ¡£


51~58ÐÐÔÚforÑ­»·ÖÐÒÀ´Î½«vendor_specific½á¹¹ÖеÄData¿½±´µ½·ÖÅɵĶÑÄÚ´æÖÐ ¡£½øÈëµÚÒ»´ÎÑ­»·Ê±£¬v1Ö¸Ïòvendor_specific1£¬v8Ö¸ÏòĩβλÖã¬Öª×ãÌõ¼þv1
ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

²¹¶¡±È¶Ô

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


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


Çå¾²½¨Òé

ʵʱװÖÃÇå¾²²¹¶ ¡£ºhttps://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0626


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢