¼ÇÒ»´ÎVMwareµÄÍß½âµ÷ÊÔÆÊÎöÀú³Ì
Ðû²¼Ê±¼ä 2020-08-111.Ñо¿Åä¾°
ʹÓÃWinDbg-IÖ¸ÁWinDbgÉèÖÃΪ¼´Ê±µ÷ÊÔÆ÷£¬VMware-vmx.exe³ÌÐòÍß½âºó×Ôת¶¯³öWinDbg¡£¿ÍÕ»ÐÅÏ¢ÈçÏ£º
µ÷ÊÔÐÅÏ¢ÏÔʾstack buffer overrunÒì³££¬×î³õÍƶϿÉÄÜÊÇ»º³åÇøÒç³öÎó²î¡£

ͨ¹ýÅÌÎÊ×ÊÁϺó·¢Ã÷£¬´ÓWindows 8×îÏÈ£¬WindowsÉè¼ÆÁËÒ»¸öеÄÖÐÖ¹INT 29H£¬ÓÃÒÔ¿ìËÙÅ׳öʧ°Ü£¬ÔÚsdkÖб»ÉùÃ÷Ϊ__fastfail£¬ __fastfailÄÚ²¿º¯Êý²»»á·µ»Ø¡£
ÔÚÉÏͼÖУ¬³ÌÐòÖÕÖ¹ÓÚint 29h£¬¶øËüµÄ²ÎÊýΪ0xa£¬¶ÔÓ¦FAST_FAIL_GUARD_ICALL_CHECK_FAILURE£¬ÓÉ´ËÍƶÏÎÊÌâ¿ÉÄÜ·ºÆðÔÚCFGµÄ¼ì²éÀú³ÌÖС£
´Óº¯ÊýŲÓÃÕ»ÖÐvmware_vmx+0x58b21µØµãÏòÉÏ×·ËÝ£¬¶¯Ì¬µ÷ÊÔ³ÌÐò£¬½ÏÁ¿³ÌÐòÕý³£ÔËÐÐÓëÒì³£Íß½âµÄº¯ÊýŲÓÃÇø±ð£¬¶¨Î»µ½Óë³ÌÐòÍß½âÏà¹ØµÄº¯Êýsub_1400965A0¡£
ʹÓÃWindbg Attach vmware-vmx.exe³ÌÐò£¬ÔÚsub_1400965A0º¯ÊýÉèÖöϵ㣬×îÏȶ¯Ì¬µ÷ÊÔ¡£´Ó7z·¿ªµÄѹËõÎļþÖÐÍÏקcdp.pcapngµÄÎļþ£¬³ÌÐòÔڶϵ㴦ͣÏ¡£Í¨¹ý¶¯Ì¬µ÷ÊÔ¿ÉÖª¸Ãº¯ÊýÖÐcalloc·ÖÅÉÁËÈý¸ö¶Ñ¿Õ¼ä£¬»®·ÖÓÃÓÚ´æ·Å£ºÖ÷»úÔÝʱÎļþ·¾¶temp_path¡¢Ä¿µÄÎļþÃûfile_nameÒÔ¼°VMwareÖеĻº´æĿ¼Ãûvm_cache_dir_name¡£
¿ÉÊÇ·¿ªÖ÷»úTempĿ¼ÏÂȴûÓз¢Ã÷¸ÃÎļþ£¬ÓÚÊÇÆðÔ´¶Ï¶¨ÕâÊdzÌÐòÍß½âÔµ¹ÊÔÓÉ¡£¼ÌÐøÍùÏ¿´£¬3¸öÎļþÏà¹Ø²ÎÊýÈ«¶¼´«ÈëÁËsub_140579b30º¯Êý¡£
½øÈ뺯Êýsub_140579b30£¬¶¨Î»temp_path²ÎÊýµÄ´¦Öóͷ£¡£ÆäÖУ¬sub_14057FF90º¯Êý¶Ô´«ÈëµÄtemp_path¾ÙÐÐÁËÖðÒ»±éÀú£¬sub_1405B2080º¯Êý¶Ô´«ÈëµÄtemp_path¾ÙÐÐÁ˲»·¨ÐÔ¼ì²é¡£ÏÂÃæÖصãÆÊÎösub_140576460º¯Êý¡£
sub_140576460º¯Êý½«Â·¾¶²ÎÊýtemp_path´«ÈëÁËsub_14049DA50¡£
Ê×ÏÈ£¬º¯Êýsub_14049DA50ͨ¹ýsub_140477C70¶Ô×Ö·û´®¾ÙÐÐÁË´¦Öóͷ£¡£È»ºó£¬Å²ÓÃwstat64»ñÈ¡ÏìӦ·¾¶µÄÎļþ״̬£¬ÈôÊÇÀֳɻñÈ¡ÔòÉúÑĵ½Ò»¸ö½á¹¹ÌåÖУ¬²»È»·µ»Ø0xffffffff¡£ÓÉÓÚTempĿ¼Ï²¢Î´·¢Ã÷±¸·ÝÎļþ£¬µ¼Ö»ñȡ״̬ʧ°Ü£¬´Ó¶ø·µ»Ø0xffffffff¡£
·µ»Ø0xffffffffºó£¬ÖØлص½sub_140579b30º¯ÊýÖУ¬³ÌÐòÌø³öwhileÑ»·µÖ´ïÈçÏÂλÖã¬ÊäÍÉ»¯ÎóÐÅÏ¢²¢ÌøתÖÁsub_140572A70¡£
´Ósub_140572A70×îÖÕÖ´Ðе½sub_1400960C0£¬µÖ´ïÈçÏÂλÖý«vmware_vmx+0xb1ed90´¦µÄÖµ¸³¸øÁËrsi£¬¼´Îª0¡£
¼ÌÐøÍùÏÂÖ´ÐУ¬½«rsiÖÐ0Öµ¸³Öµµ½raxÖУ¬È»ºóŲÓÃ0x7ff8fab0c510´¦£¬¼´ntdll!LdrpDispatchUserCallTarget¡£
´Ë´¦Ó뾲̬ϵÄÀú³ÌÓÐÒ»µã²î±ð£¬¾²Ì¬Ï¸ô¦Å²ÓÃÈçÏ£º
ÈôÊÇƾ֤¾²Ì¬Àú³ÌÖ´ÐУ¬Ó¦µ±µÖ´ïsub_1407C7650,¼´ÈçÏÂλÖãº
ÔÚntdll.dll±»¼ÓÔØ֮ǰ£¬¸Ã´¦Êý¾ÝÒÀ¾ÉΪÉÏͼËùʾµØµã£º
ØʺóÔÚntdll.dllÖÐʵÑéCFG£¨ControlFlowGuard£©±£»¤»úÖÆ£¬½«vmware_vmx+0x7c9668µØµã´¦Êý¾Ý¾ÙÐÐÁ˸Äд£¬´Ó¶øÖ´Ðе½ntdll!LdrpDispatchUserCallTargetÖС£
ÔÚntdll!LdrpDispatchUserCallTargetº¯ÊýÖУ¬È¡r11+r10*8´¦µÄÖµ¸³Öµ¸ør11ʱ·ºÆðÁËÎÊÌ⣬¸ÃµØµãΪ¿Õ£¬¾ÍÔì³ÉÁË¿ÕÖ¸ÕëÒýÓ㬴ӶøÖ´ÐÐÁËint 29h£¬Ôì³ÉÒì³£¡£È»¶ø£¬×ÝȻûÓÐCFG»úÖÆ£¬³ÌÐòÒ²»áÔÚÖ´ÐС°jmp rax¡±´¦Í߽⣬ͨ¹ýÏÂͼ¿ÉÒÔ¿´³ö£¬CFG»úÖƽö½öÊÇÔÚÔ±¾³ÌÐòÌøתָÁîÇ°Ìí¼ÓÁËһЩ¼ì²é¡£
ÖÁ´Ë£¬VMwareÍß½âµÄÔµ¹ÊÔÓÉ»ùÌìÖ°ÎöÇåÎúÁË¡£ÁíÒ»¸öÒÉÎÊÊÇ£¬ÎªÊ²Ã´7zipÒѾÔÚϵͳTempÏÂÌìÉúÁËÎļþ£¬²¢ÇÒVMwareÒ²ÒѾ»ñÈ¡µ½ÁË·¾¶²ÎÊý£¬È´ÔÚÒƶ¯Ç°×Ô¶¯É¾³ýÁËÎļþÄØ¡£Õâ¾ÍÐèÒª´Ó7zipÖÐÑ°ÕÒÃյס£
ÓÉÉÏÒ»½ÚÆÊÎö¿ÉÖª£¬Vmware crashÔµ¹ÊÔÓÉÊÇTempĿ¼ÏÂÎļþ±»É¾³ý¡£ÔĶÁ7zipÔ´Â룬Ëø¶¨ÁËCPP/Windows/FileDir.cppÖеÄÎļþɾ³ýº¯Êý¡£
ʹÓÃWinDbg¼ÓÔØ7zip£¬È»ºóÔÚRemoveº¯ÊýλÖþÙÐÐ϶ϣ¬³ÌÐòÔËÐкó¾ÙÐÐÍÏק²Ù×÷£¬ÔÚRemoveº¯ÊýÖÐÖ¹ºó¶ÔÓ¦µÄŲÓÿÍÕ»ÈçÏÂËùʾ¡£
¿ÍÕ»ÖÐ7zFM+0x5b212µØµãλÓÚº¯ÊýCPanel::OnDragÖУ¬¸Ãº¯ÊýΪÊó±êÍÏק²Ù×÷º¯Êý¡£µ±¼ì²âµ½¶Ô7zip·¿ªµÄĿ¼¾ÙÐвÙ×÷ʱ£¬±ã»áÔÚTempĿ¼ÏÂÌìÉúÒ»¸öÒÔ7zE¿ªÍ·µÄËæ»úÃüÃûÎļþ¼Ð¡£
È»ºó£¬½«¸ÃÎļþ¼ÐÉèÖÃΪĿµÄĿ¼£¬²¢ÇÒÉèÖÃÁËһЩÊý¾Ý¼°IpDropSourse½á¹¹Ìå¡£
¼ÌÐøÍùÏ¿ÉÒÔ¿´µ½Ò»¸öDoDragDropº¯Êý£¬¸Ãº¯Êý¹¦Ð§ÊǾÙÐÐOLEÍÏ·ÅÏà¹Ø²Ù×÷£¬Í¨¹ý¼ì²â¹â±êµÄÐÐΪ»®·ÖŲÓÃһЩҪÁì²¢·µ»Ø¶ÔÓ¦µÄÊýÖµ¡£
È»ºó£¬Æ¾Ö¤DoDragDropº¯ÊýµÄ·µ»ØÖµÀ´ÅжϹâ±êµÄÍÏקÊÇ·ñÓÐÓ㬴ӶøÖ´ÐжÔÓ¦µÄ²Ù×÷¡£
´Ó7zipÖÐÍÏקÎļþµ½ÐéÄâ»ú£¬ÓÉÓÚÎÞ·¨»ñÖªÎļþÍÏקµÄÄ¿µÄ·¾¶£¬Òò´ËDoDragDrop»á·µ»ØDRAGDROP_S_CANCEL(0x40101)£¬²»»áÖ´Ðп½±´²Ù×÷µÄ·ÖÖ§£¬¶øÊÇÖ±½Ó½«TempĿ¼ÏÂÌìÉúµÄÔÝʱĿ¼ɾ³ý¡£
7zipѹËõ°üÖÐÎļþÍÏק²Ù×÷»á´¥·¢DoDragDropº¯ÊýŲÓ㬸ú¯Êý»á»ñÈ¡ÎļþÊý¾Ý¼°¹â±ê×èÖ¹µÄλÖ᣿ÉÊǽ«ÎļþÍÏקµ½VMware´°¿Úʱ£¬DoDragDropº¯Êý²»¿É»ñȡ׼ȷµÄÄ¿µÄ·¾¶£¬Òò´ËÎÞ·¨½«Îļþ¿½±´µ½Ä¿µÄλÖ㬴ӶøÖ±½Óɾ³ýÔÝʱÎļþ£¬×îÖÕµ¼ÖÂVMwareÎÞ·¨»ñÈ¡Îļþ״̬Ôì³ÉÍ߽⡣
²Î¿¼Á´½Ó£º
[1]https://0cch.com/2016/12/13/int29h/
[2]https://docs.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-dodragdrop
[3]https://github.com/kornelski/7z/tree/20e38032e62bd6bb3a176d51bce0558b16dd51e2
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÆð¾¢·ÀÓùʵÑéÊÒ£¨ADLab£©
ADLab½¨ÉèÓÚ1999Ä꣬ÊÇÖйúÇå¾²ÐÐÒµ×îÔ罨ÉèµÄ¹¥·ÀÊÖÒÕÑо¿ÊµÑéÊÒÖ®Ò»£¬Î¢ÈíMAPPÍýÏë½¹µã³ÉÔ±£¬¡°ºÚȸ¹¥»÷¡±¿´·¨Ê×ÍÆÕß¡£×èÖ¹ÏÖÔÚ£¬ADLabÒÑͨ¹ýCVEÀÛ¼ÆÐû²¼Çå¾²Îó²î½ü1100¸ö£¬Í¨¹ý CNVD/CNNVDÀÛ¼ÆÐû²¼Çå¾²Îó²î900Óà¸ö£¬Ò»Á¬¼á³Ö¹ú¼ÊÍøÂçÇå¾²ÁìÓòÒ»Á÷Ë®×¼¡£ÊµÑéÊÒÑо¿Æ«Ïòº¸Ç²Ù×÷ϵͳÓëÓ¦ÓÃϵͳÇå¾²Ñо¿¡¢Òƶ¯ÖÇÄÜÖÕ¶ËÇå¾²Ñо¿¡¢ÎïÁªÍøÖÇÄÜ×°±¸Çå¾²Ñо¿¡¢WebÇå¾²Ñо¿¡¢¹¤¿ØϵͳÇå¾²Ñо¿¡¢ÔÆÇå¾²Ñо¿¡£Ñо¿Ð§¹ûÓ¦ÓÃÓÚ²úÆ·½¹µãÊÖÒÕÑо¿¡¢¹ú¼ÒÖصã¿Æ¼¼ÏîÄ¿¹¥¹Ø¡¢×¨ÒµÇå¾²·þÎñµÈ¡£