UPnPЭÒéCallStrangerÎó²îÓ°ÏìÊý°ÙÍò×°±¸

Ðû²¼Ê±¼ä 2020-06-30

Ò»¡¢Îó²î¸ÅÊö


2020Äê6ÔÂ8ÈÕ £¬Çå¾²Ñо¿Ô±Yunus ?adirciÐû²¼UPnP£¨Í¨Óü´²å¼´Óã©Ð­ÒéÎó²îͨ¸æ£¨CVE-2020-12695£© £¬²¢½«ÆäÃüÃûΪCallStrangerÎó²î¡£¸ÃÎó²îÔÊÐí¹¥»÷ÕßÈƹýÄÚÍøµÄÊý¾Ý·Àй¶ϵͳ£¨DLP£©¾ÙÐÐÊý¾ÝÌÓÒÝ £¬¿Éµ¼ÖÂÃô¸ÐÊý¾Ýй¶ £¬²¢ÇҿɶÔ×°±¸ËùÔÚÄÚ²¿ÍøÂç¾ÙÐÐɨÃè £¬ÉõÖÁÄÜЮÖÆ×°±¸¾ÙÐÐÂþÑÜʽ¾Ü¾ø·þÎñ£¨DDOS£©¹¥»÷¡£ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÒÔij¿îÖÇÄܵçÊÓ×÷Ϊ²âÊÔÄ¿µÄ £¬¶ÔCallStrangerÎó²îµÄΣº¦ÐÔ¾ÙÐÐÁËÑÝʾÆÊÎö¡£


¶þ¡¢Îó²îÓ°Ïì


Óë֮ǰµÄUPnPÎó²î²î±ð £¬CallStrangerÎó²î±£´æÓÚЭÒéÉè¼ÆÖÐ £¬Òò´Ë¸ÃÎó²îÓ°ÏìÏÕЩËùÓÐÖ§³ÖUPnPµÄ×°±¸ £¬°üÀ¨Windows 10ËùÓа汾¡¢Â·ÓÉÆ÷¡¢»á¼û½ÓÈëµã¡¢´òÓ¡»ú¡¢ÓÎÏ·»ú¡¢ÃÅÁå¶Ô½²»ú¡¢Ã½ÌåÓ¦ÓóÌÐòºÍ×°±¸¡¢ÉãÏñÍ·¡¢µçÊÓ»úµÈ¡£Æ¾Ö¤SHODANºÍZoomEyeµÄËÑË÷Ч¹û £¬ÖÁÉÙÓÐÊýÒÔ°ÙÍò¼ÆµÄÔÚÏß×°±¸Êܵ½Ó°Ïì¡£


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


Èý¡¢Îó²îÆÊÎö


UPnPÈ«³ÆΪUniversal Plug andPlay £¬¼´Í¨Óü´²å¼´Óà £¬UPnPÔÊÐíÖÖÖÖÍøÂç×°±¸ÔÚûÓÐÈκÎÌØÊâÉèÖûòÉèÖõÄÇéÐÎϾÙÐÐͨѶ £¬Ê¹×°±¸Ï໥¿É×Ô¶¯ÅþÁ¬ºÍЭͬÊÂÇé¡£ÀýÈçеĴòÓ¡»ú²åÉϵ粢ÅþÁ¬ÍøÂçÖ®ºó £¬¾ÖÓòÍøÄÚµÄÅÌËã»ú¾ÍÖªµÀÁË´òÓ¡»úµÄÐͺŵÈÐÅÏ¢ £¬Àû±ã¾ÙÐÐÇý¶¯×°Öá£


ÔÚUPnPЭÒé¹æ·¶ÖÐÓÐÒ»¸öºÜÊÇÖ÷ÒªµÄ¹¦Ð§Ä£¿é £¬½Ð×öÊÂÎñ(Eventing)¡£ÔÚUPnP·þÎñ¾ÙÐеÄʱ¼äÄÚ £¬Ö»Òª×°±¸ÓÃÓÚUPnP·þÎñµÄ±äÁ¿Öµ±¬·¢×ª±ä»òÕßģʽ±¬·¢Á˸ıä £¬¾Í»á±¬·¢Ò»¸öÊÂÎñ £¬ËæÖ®ÏòÕû¸öÍøÂç¾ÙÐй㲥¡ £»òÕßÓû§¿ÉÒÔÊÂÏÈÏòUPnP×°±¸·¢ËͶ©ÔÄÇëÇó £¬°ü¹ÜUPnP×°±¸ÊµÊ±µØ½«ÊÂÎñ´«Ë͹ýÀ´¡£


UPnP DeviceArchitecture 2.0[1]ÖйØÓÚUPnPµÄNTÓëCALLBACK¶©ÔÄÄ£¿éÓÐÈçÏÂÃûÌãº


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


publisher pathÒ»Ñùƽ³£Îª¶©ÔĵķþÎñ £¬ÒÔGENAÃûÌôæ·ÅÔÚ×°±¸µÄij¸öXMLÎļþÖÐ £¬ÀàËÆÏÂͼ¡£


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


CALLBACKµÄÖµÒ»Ñùƽ³£Îª»Øµ÷µØµãµÄURL¡£NTÈ¡upnp:eventÌåÏÖ¶©ÔÄÊÂÎñ¡£


UPnPЭÒé¹æ·¶ÎĵµÖÐÌáµ½£ºCALLBACKÊDZØÌîÇøÓò £¬ËùÌîÐÅϢΪ·¢ËÍÊÂÎñÐÅÏ¢µÄURL¡£Ò»Ñùƽ³£ÇéÐÎÏÂΪUPnP¹©Ó¦ÉÌÖ¸¶¨¡£ÈôÊÇÆäÖнç˵Á˲»Ö¹Ò»¸öURL £¬×°±¸»á°´Ë³ÐòʵÑéÅþÁ¬ £¬Ö±µ½ÓÐÒ»¸öÅþÁ¬Àֳɡ£Ã¿¸öURLÒ»Ñùƽ³£ÎªHTTPЭÒé(¼´Ç°×ºÎª¡±http://¡±)¡£×°±¸²»µÃÒÔÈκη½·¨½Ø¶ÏÕâЩURL¡£ÈôÊÇÄÚ´æȱ·¦ÒÔ´æ´¢ËùÓеÄCALLBACK URL £¬×°±¸»á¾Ü¾ø¶©ÔÄ¡£


Õû¸ö¶©ÔÄÁ÷³Ì»òÔÊÐíÒÔ¼ò»¯ÈçÏÂͼ¡£


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

ºÜÏÔÈ» £¬¸ÃЭÒ鲢ûÓжÔCALLBACK´«ÈëµÄURL¾ÙÐÐÏÞÖƺ͹淶 £¬Ò²¾ÍÊÇ˵ £¬CALLBACKURLÊǹ¥»÷Õ߿ɿصÄ¡£


ÏÂͼΪIntel UPnP SDKÖмì²éCALLBACK URLµÄÏà¹Ø´úÂë £¬create_url_listº¯Êý½ö½ö¼ì²éÁËURLÊÇ·ñÕýµ± £¬²¢Ã»ÓÐÈ·¶¨ÆäÊÇ·ñºÏÀí¡£


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


ËÄ¡¢Îó²îΣº¦


CallStrangerÎó²îËùÔì³ÉµÄΣº¦¿ÉÒÔ·ÖÈý¸ö·½Ã棺DDoS¹¥»÷¡¢Êý¾ÝÌÓÒݺͶ˿ÚɨÃè¡£ÆäÖÐÔì³ÉµÄDDoS¹¥»÷¿ÉÒÔ·ÖÁ½ÖÖ £¬SYNºéË®¹¥»÷ºÍTCP·´Éä·Å´ó¹¥»÷ £¬ÈçÏÂͼËùʾ¡£


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


4.1 SYNºéË®¹¥»÷


¼ÙÉèÎÒÃÇÒѾ­Í¨¹ýһЩҪÁì(ÈçÔÚ¾ÖÓòÍø¹ã²¥µÈ)»ñµÃÁËijЩװ±¸UPnP·þÎñµÄeventSubURL £¬ÏÂÃæ¾Í¿ÉÒÔÏòUPnP×°±¸ÌᳫһÏÔÄ·þÎñ £¬ÃûÌÃÈçÏÂ:


SUBSCRIBE eventSubURLHTTP/1.1

NT:upnp:enent

Callback: deliveryURL

Host: upnp×°±¸:upnp·þÎñ¶Ë¿Ú


ÈçÇ°ÎÄЭÒé¹æ·¶ÖÐÌáµ½µÄ £¬ÈôCALLBACL ValueÖнç˵Á˲»Ö¹Ò»¸öURL £¬Ôò»á°´Ë³ÐòʵÑéTCPÅþÁ¬ £¬Ö±µ½ÓÐÒ»¸öÅþÁ¬Àֳɡ£ÄÇô¹¥»÷Õß¿ÉÔÚCALLBACK ValueÖÐÈ«ÐĽṹ¶à¸öURL £¬Ê¹Ã¿Ò»¸ö¶¼ÎÞ·¨ÅþÁ¬ÀÖ³É £¬ÕâÑùUPnP×°±¸¾Í»áÓöà¸öSYN°üÒÀ´Î¶Ôÿ¸öURLʵÑéTCPÎÕÊÖ¡£¼ÙÉè¹¥»÷Õß¿ÉÒÔ²Ù¿ØÐí¶à¸ö×°±¸ £¬¾Í»áµ¼ÖÂÊܺ¦×°±¸ÔâÊÜDDoS¹¥»÷¡£


SYNÊý¾Ý°üµÄÊýĿƾ֤װ±¸²Ù×÷ϵͳºÍÉèÖõIJî±ð¶ø²î±ð £¬Ê¹ÓÃijƷÅÆÖÇÄܵçÊÓ¶ÔÊܺ¦×°±¸¾ÙÐÐSYNºéË®¹¥»÷²âÊÔ £¬²âÊÔЧ¹ûÈçÏÂͼËùʾ¡£


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


¸ÃÖÇÄܵçÊÓÿÊÕµ½Ò»¸öCALLBACK Value¾Í»á·¢ËÍ8¸öSYNÊý¾Ý°üʵÑéÅþÁ¬Êܺ¦×°±¸¡£ÈôÎÒÃÇÿ¸öCALLBACKµÄURLֵΪ25×Ö½Ú £¬ÄÇô´ø¿í·Å´óÒò×Ó±ã¿ÉÒÔµÖ´ï8*60/25=19.2¡£ÓÉÓÚCALLBACK ValueµÄ¸öÊýÊÇûÓÐÏÞÖÆµÄ £¬ÒÔÊÇÀíÂÛÉÏÊÇ¿ÉÒÔÎÞÏÞ·Å´óµÄ¡£


4.2 TCP·´Éä·Å´ó¹¥»÷


Windows Media PlayerÔÚ²¥·ÅÊÓƵʱҲÓÐÏìÓ¦µÄUPnP·þÎñ £¬ÎÒÃÇ»ñÈ¡µ½µÄUPnP·þÎñÁбíÈçÏ£º


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


ÎÒÃÇÑ¡È¡ÆäÖÐÒ»Ïî·þÎñÀ´²âÊÔһϡ£¹¥»÷ÕßÖ»ÐèÒª·¢ËÍ210×Ö½Ú¶©ÔÄ°ü £¬ÈçÏÂͼ¡£


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


Êܺ¦×°±¸Ö®ºó¾Í»áÊÕµ½½ü700×Ö½ÚµÄÊý¾Ý°ü £¬·Å´óÒò×Ó´ïÈý±¶¶à¡£Æä·Å´óЧ¹ûÒ»Ñùƽ³£ÓëUPnP×°±¸µÄ²Ù×÷ϵͳºÍ³§ÉÌÉèÖÃÓйØ¡£


4.3 Êý¾ÝÌÓÒÝ


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


Ò»Ñùƽ³£ÇéÐÎÏ £¬ÆóÒµÄÚ²¿ÍøÂ綼Óвî±ðµÄÇ徲Ʒ¼¶»®·Ö¡£µ±¹¥»÷ÕßÉø͸µ½ÆóÒµÄÚÍøʱ £¬ÈôÄÚÍø¿ªÆôÊý¾Ýй¶·À»¤ÏµÍ³ £¬ÎÞ·¨½«»ñµÃµÄÃô¸ÐÊý¾Ý´«Êä³öÈ¥ £¬´ËʱUPnP×°±¸»áÊÇÒ»¸öºÜºÃµÄÌø°å¡£


ÔÚRFC7230µÄ3.1.1½Ú[2]ÖÐ £¬²¢Ã»ÓжÔRequest LineµÄ³¤¶È×öÈκÎÏÞÖÆ £¬ÕâʹµÃ¹¥»÷Õß¿ÉÒÔ½«Êý¾Ýͨ¹ýCallbackµÄURLÖµ´«Êä³öÈ¥¡£ÈçÏÂͼ £¬Ä³Æ·ÅÆÖÇÄܵçÊÓÒ»´ÎÇëÇó¾Í´«ÊäÁË2500KBµÄÊý¾Ý¡£


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


4.4 ¶Ë¿ÚɨÃè


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


ÈçÇ°ÎÄÌáµ½µÄ £¬ÈôCALLBACK½ç˵Á˲»Ö¹Ò»¸öURL £¬Ôò»á°´Ë³ÐòʵÑéTCPÅþÁ¬ £¬Ö±µ½ÓÐÒ»¸öÀÖ³É £¬ÄÇôÕâ¸ö¹æÔòÏÔȻҲ¿ÉÒÔÓÃÓڶ˿ÚɨÃè £¬ÈçÏÂͼËùʾ £¬¼ÙÉè¹¥»÷ÕßÐèҪɨÃèIPΪ192.168.1.13µÄ555¶Ë¿ÚÊÇ·ñ¿ªÆô £¬ÄÇô¹¥»÷ÕßÖ»ÐèÒª½«Ä³¸ö¿ÉÒÔ¼à¿ØµÄURL°²ÅÅÔÚºó¼´¿ÉÈ·ÈÏ £¬Èô¹¥»÷ÕßÊÕµ½ÅþÁ¬ÇëÇó £¬Ôò¶Ë¿Ú먦Æô £¬·´Ö® £¬Ôò¿ªÆô¡£


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


Îå¡¢Îó²î»º½â¼°ÐÞ¸´


¿É½ÓÄÉÈçϲ½·¥¾ÙÐÐÎó²î»º½â£º

¼ì²é¿ÉÒÉ×°±¸ £¬ÈôÊÇûÓÐÐëÒª £¬Ôò¹Ø±ÕUPnP¶Ë¿Ú¡£

ÔÚÍø¹ØµÈ×°±¸ÖÐÉó¼ÆNOTIFYHTTPÊý¾Ý°ü¡£

ÔÚ×îиüеÄUPnPЭÒé¹æ·¶[1]4.1.1½ÚÖÐ £¬¿ÉÒÔ¿´³ö¿ª·¢ÕßÏÞÖÆÁ˶©ÔÄÊÂÎñµÄÔ´IPºÍÄ¿µÄIP¶¼±ØÐèÔÚÄÚÍøÖÐ £¬Õâ´ÓÒ»¶¨Ë®Æ½ÉÏÐÞ¸´Á˸ÃÎó²î¡£


²Î¿¼Á´½Ó£º


[1]https://openconnectivity.org/upnp-specs/UPnP-arch-DeviceArchitecture-v2.0-20200417.pdf

[2]https://tools.ietf.org/html/rfc7230#section-3.1.1

[3]https://delaat.net/rp/2008-2009/p26/report.pdf

[4]https://kb.cert.org/vuls/id/339275

[5]https://zh-cn.tenable.com/blog/cve-2020-12695-callstranger-vulnerability-in-universal-plug-and-play-upnp-puts-billions-of

[6]https://www.youtube.com/watch?v=hJSxDHPyTBE




ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÆð¾¢·ÀÓùʵÑéÊÒ£¨ADLab£©


ADLab½¨ÉèÓÚ1999Äê £¬ÊÇÖйúÇå¾²ÐÐÒµ×îÔ罨ÉèµÄ¹¥·ÀÊÖÒÕÑо¿ÊµÑéÊÒÖ®Ò» £¬Î¢ÈíMAPPÍýÏë½¹µã³ÉÔ± £¬¡°ºÚȸ¹¥»÷¡±¿´·¨Ê×ÍÆÕß¡£×èÖ¹ÏÖÔÚ £¬ADLabÒÑͨ¹ýCVEÀÛ¼ÆÐû²¼Çå¾²Îó²î1000Óà¸ö £¬Í¨¹ý CNVD/CNNVDÀÛ¼ÆÐû²¼Çå¾²Îó²î800Óà¸ö £¬Ò»Á¬¼á³Ö¹ú¼ÊÍøÂçÇå¾²ÁìÓòÒ»Á÷Ë®×¼¡£ÊµÑéÊÒÑо¿Æ«Ïòº­¸Ç²Ù×÷ϵͳÓëÓ¦ÓÃϵͳÇå¾²Ñо¿¡¢Òƶ¯ÖÇÄÜÖÕ¶ËÇå¾²Ñо¿¡¢ÎïÁªÍøÖÇÄÜ×°±¸Çå¾²Ñо¿¡¢WebÇå¾²Ñо¿¡¢¹¤¿ØϵͳÇå¾²Ñо¿¡¢ÔÆÇå¾²Ñо¿¡£Ñо¿Ð§¹ûÓ¦ÓÃÓÚ²úÆ·½¹µãÊÖÒÕÑо¿¡¢¹ú¼ÒÖصã¿Æ¼¼ÏîÄ¿¹¥¹Ø¡¢×¨ÒµÇå¾²·þÎñµÈ¡£



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