MSãæ£ããè¿°ã¹ãŠããããã«ããã®æè¡ã¯æ»æã®éçºãã¯ããã«é«äŸ¡ãªã€ãã³ãã«ããŸãããªããªããæ»æè
ã¯ãœãããŠã§ã¢ã®è匱æ§ãæªçšããããšã«å ããŠãæäœæã«äºæž¬å¯èœãªã¡ã¢ãªã¢ãã¬ã¹ã«äŸåããå¿
èŠããããASLRã¯ããã奪ãããã§ãã ã芧ã®ãšãããæè¿ãææ°ã®Windows 8 / 8.1ã®ãªãªãŒã¹ãå«ããMSã¯ãã®æ©èœãã·ã¹ãã ã«å±éããããã«ããæ·±å»ãªã¢ãããŒããåãããšã決å®ããŸããã çãæå³ã§ãASLRãåèµ·åã®ãã³ã«äºæž¬äžå¯èœãªã¢ãã¬ã¹ã«ã€ã¡ãŒãžã移åããã ãã§ãããšç解ãããå Žåãããäžè¬çãªæå³ã§ãã·ã¹ãã ã¬ãã«ã§ã®ãã®æ©äŒã¯ãã·ã¹ãã ã©ã€ãã©ãªããã³ä»ã®ã·ã¹ãã ãªããžã§ã¯ãã®æ©èœã®ç¹å®ã®ã¢ãã¬ã¹ã«åºå·ããæ©äŒãæ»æè
ãã奪ãã¯ãã§ãïŒASLRãã€ãã¹ç·©å/ã¢ãã¬ã¹ç©ºéæ
å ±é瀺匷åïŒãDEPïŒROPïŒããã€ãã¹ããŠå®è¡ã§ããæ°åãã€ãã®ã·ã§ã«ã³ãŒãã
ã»ãšãã©ãã¹ãŠã®äººã«æ¢ã«ç¥ãããŠããASLRã®æŽå²ã«ã€ããŠã¯è§ŠããŸãããMicrosoftãäž»åã®Windows 7-8-8.1ã§ASLRãæ¹åããããã«äœ¿çšããŠãããããŸãæããã§ã¯ãªãæ©èœã®ã¿ã«æ³šç®ããŸãã
ASLRã«ãŒã«
Microsoftã¯ãASLRã«é¢ããŠDEPãšåæ§ã®ã¢ãããŒãã䜿çšããŠããŸããã€ãŸããã¢ããªã±ãŒã·ã§ã³ããµããŒãä»ãã§ã³ã³ãã€ã«ãããŠããå Žåãå¿
èŠã«å¿ããŠDELRã䜿çšã§ããŸãã ãã®ææ³ã¯ãããã°ã©ã ãäžé©åã«å¿çããå¯èœæ§ã®ãããã¯ãããžã§å®è¡ãããå Žåã«çºçããå¯èœæ§ãããæãããªäºææ§ã®åé¡ãèæ
®ããŠé©çšãããŸãã ããããASLRã®å Žåããã®ç¶æ³ã¯ããå€ãã®å¶éãšãšãã«æ©èœããŸãã ããšãã°ãWindows 8 / 8.1ã®ææ°çã§ã¯ããµããŒãä»ãã§ã³ã³ãã€ã«ãããŠãããã©ããã«é¢ä¿ãªããã¢ããªã±ãŒã·ã§ã³ã§DEPãåžžã«æå¹ã«ãªã£ãŠããŸãïŒå°ãªããšã64ãããããã»ããµäžã§ãOSããã³ããŒãããŒããŒãã©ã¡ãŒã¿ãŒã®ããã深床ã«é¢ä¿ãªãïŒã ASLRã§ã¯ãç¶æ³ã¯ç°ãªããŸããWindows8 / 8.1ã§å®è¡ããŠããå Žåã§ããã¢ããªã±ãŒã·ã§ã³èªäœã«ãããµããŒãã®ã«ãŒã«ã«äŸåããããããŒã«ãã®ãã©ã°ããªãå Žåãç»åã®ã©ã³ãã åã¯å«ãŸããŸããã
æ»æè
ã¯ãããšãã°ããµããŒããããŠãããã¹ãŠã®OSã§åäœããå®å®ããROPãã§ãŒã³ãå®è£
ããããã«ãASLRãµããŒãä»ãã§ã³ã³ãã€ã«ãããŠããªãã·ã¹ãã ã©ã€ãã©ãªãç¬èªã®ç®çã§å©çšã§ããŸãã è¿å¹Žã®æ
£äŸã瀺ãããã«ããã®æ©äŒã¯æšçåæ»æã®çµç¹ã§è€æ°å䜿çšãããŸããã 以äžã¯ãRCEïŒãã©ã€ããã€ããŠã³ããŒãïŒã®ãããªã€ã³ã¶ã¯ã€ã«ãã®è匱æ§ãæªçšãããŠããŸãã
ã芧ã®ãšãããMS Officeã©ã€ãã©ãªïŒhxds.dllïŒã¯ASLRïŒOffice 2007-2010ïŒããµããŒãããŠããããæ»æè
ã¯å€æŽãããŠããªãããŠã³ããŒãã¢ãã¬ã¹ã䜿çšããŠè匱æ§ãæªçšããããšãã§ããŸããã 12æã®ãããç«ææ¥ã®äžç°ãšããŠãå瀟ã¯ãã®ç£èŠïŒã»ãã¥ãªãã£æ©èœãã€ãã¹ãšåŒã°ããïŒãMS13-106ã§çµäºã ããã®ããŒãžã§ã³ã®Officeã§äœæ¥ããWindowsãŠãŒã¶ãŒã«é©åãªã¬ãã«ã®ä¿è·ãæäŸããŸããã
MSãWindows 8ã§å°å
¥ããäž»ãªASLRãµããŒãæ©èœã®1ã€ã¯ãForce ASLRæ©èœã§ãã ãã®æ©èœã¯ãã·ã¹ãã å
šäœã®OptIn DEPããªã·ãŒèšå®ã«å€å°äŒŒãŠããŸãã ã€ã¡ãŒãžãã¡ã€ã«å®è¡ãªãã·ã§ã³ïŒIFEOïŒã¬ãžã¹ããªããŒHKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Image File Execution OptionsãšMitigationOptionsãã©ã¡ãŒã¿ãŒã䜿çšããŠããŠãŒã¶ãŒã¯PEå®è¡å¯èœãã¡ã€ã«ã®ASLRãæåã§æå¹ã«ã§ããŸãã 次ã®è¡šã¯ãForceASLRã䜿çšããŠããŸãã¯äœ¿çšããã«å®è¡å¯èœãã¡ã€ã«ãã¡ã¢ãªã«ããŒããããšãã®OSã®åäœã瀺ããŠããŸãã
ãªãã·ã§ã³ã®æŽæ°KB2639308ãã€ã³ã¹ããŒã«ãããšãWindows 7ãŠãŒã¶ãŒãåæ§ã®æ©èœãå©çšã§ããŸãã
Internet ExplorerïŒ10+ïŒãããå®å
šã«ããããã«ãå瀟ã¯ãã©ãŠã¶ãŒã¢ãã¬ã¹ç©ºéïŒForceASLRïŒã«èªã¿èŸŒãŸãããã¹ãŠã®ã©ã€ãã©ãªãŒã«å¯ŸããASLR匷å¶æ©èœïŒWindows 8+ããã³KB2639308ãã€ã³ã¹ããŒã«ãããWindows 7ïŒã®ãµããŒããå°å
¥ããŸããã ãããã£ãŠãã©ã€ãã©ãªãŸãã¯ãã©ã°ã€ã³ã®ããããããã®é¢æ°ã®ãµããŒããªãã§å
ã
ã³ã³ãã€ã«ãããå Žåã匷å¶çã«é©çšãããŸãã
æ»æè
ã¯Windowsãå©çšããŠã VirtualAllocãä»ããŠã¯ã©ã€ã¢ã³ãïŒããã»ã¹ïŒã«é©åãªãµã€ãºã®é£æ¥ããé åãé çªã«å²ãåœãŠãããšã«ãããä»®æ³ã¡ã¢ãªãæäœããéã«æé©åãé©çšããŸãã ã¢ããªã±ãŒã·ã§ã³ã¯ãããã ã¢ããïŒããã©ã«ãïŒããããããŠã³ïŒMEM_TOP_DOWNïŒããŸãã¯åºå®ã¢ãã¬ã¹ïŒé¢æ°ã§æå®ãããã¢ãã¬ã¹ïŒãšããŠä»®æ³ã¡ã¢ãªã®ãããã¯ãå²ãåœãŠãæ¹æ³ãèŠæ±ã§ããŸãã æ¢å®ã§ã¯ãWindowsã¯ããã ã¢ããã®å²ãåœãŠæ¹æ³ã䜿çšããŸããã€ãŸããäžäœã¢ãã¬ã¹ããäžäœã¢ãã¬ã¹ãžãã¢ããªã±ãŒã·ã§ã³ã«æäŸããããã«å¿
èŠãªãµã€ãºã®ãããã¯ãæ¢ããŸãã
Windows 8以éãASLRã¯ä»®æ³ã¡ã¢ãªã®å²ãåœãŠã«åœ±é¿ãäžããå¯èœæ§ããããŸãã Windows 8ããåã®ããŒãžã§ã³ã§ã¯ãã¹ããªãŒã ã¹ã¿ãã¯ãšTEBããã³PEBã®ãããã¯ãäºçŽãããšãã«ãããŒãã«ã¡ã¢ãªãããã¯ãå²ãåœãŠãããã®ããªã·ãŒãæ¢ã«é©çšãããŠããŸããã æåŸã®2ã€ã®æ§é ã¯ãããŸããŸãªã·ã¹ãã æ©èœãžã®äžå®æ°ã®ãã€ã³ã¿ãŒãæœåšçã«å«ã¿ãã¡ã¢ãªå
ã®ã©ã€ãã©ãªã®å Žæãæããã«ãããããæ»æè
ã«ãšã£ãŠéåžžã«åœ¹ç«ã¡ãŸãã Windows 8ã§ã¯ã VirtualAllocã¯ãããããŠã³ãšããã ã¢ããã®éžæãªãã·ã§ã³ãåºå¥ããŸããããããã®å²ãåœãŠã®éå§ã®ããŒã¹ã¢ãã¬ã¹ã¯ãOSãèµ·åãããã³ã«ASLRã«ãã£ãŠåºå®ãããŸããã€ãŸããäºæž¬ããããšã¯ã§ããŸããã ã¢ãã¬ã¹ç©ºéã§ã¯ãé«éã®æçåã«ããã¡ã¢ãªããŸã£ããã©ã³ãã ã«å²ãåœãŠãããšãã§ããªãããšã¯æããã§ãããããã£ãŠãããã»ã¹ã®ãããã¯å²ãåœãŠã®éå§ã®ããŒã¹ã¢ãã¬ã¹ãèšé²ãããã®ã¯ASLRãéããŠã§ãã ããã»ã¹ã®MSã«ãããšããã®ãªãã·ã§ã³ã¯ãASLRããã®å®è¡å¯èœãã¡ã€ã«ïŒ / DYNAMICBASE ïŒã«ãã£ãŠé©åã«ãµããŒããããŠããå Žåã«ã®ã¿æå¹ã«ãªããŸãã
é«ãšã³ããããŒASLR
ASLRã¯ã64ãããã¢ãã¬ã¹ç©ºéã§ããå¹ççã«æ©èœããå¯èœæ§ããããŸãããã®ãããªå€§ããªã¢ãã¬ã¹ç©ºéã§ã¯ãä»»æã®ã¡ã¢ãªå²ãåœãŠã®æ©äŒãã¯ããã«å€ãããã§ãã æããã«ããã®äœ¿çšèªäœã¯ãã§ã«ããŒãã¹ãã¬ãŒã®è€éãªèŠå ã§ãã Internet Explorer EPM for Windows 7 x64ãåç
§ããŠãã ããã åæã«ãWindows 8ãŸã§ã®OSã¯ãx64äžã®ASLRãæãå®å
šãªæ¹æ³ã§äœ¿çšããŸããã ããã¯äž»ã«ããšã³ããããŒã®å¯èœæ§ïŒã€ãŸããã©ã³ãã æ§ã®åºŠåã/ã¢ãã¬ã¹éžæã®äºæž¬å¯èœæ§ïŒãšããã®å Žæã®ã©ã³ãã æ§ãèšç®ããããã«ã¢ãã¬ã¹ã®ãããæ°ã䜿çšãããããšã«é¢ãããã®ã§ãã Windows 8ã§ã¯ããã®æ©èœã¯é«ãšã³ããããŒã©ã³ãã åãšåŒã°ããŸãã
Windows 8以éã«ã¯ãé«ãšã³ããããŒã©ã³ãã åãå®è£
ããæ©èœãå«ãŸããŠããããã®ãã¯ãããžãŒã¯ãããã»ã¹ã«ãã£ãŠå²ãåœãŠãããä»®æ³ã¡ã¢ãªãããã¯ãšããŠã³ããŒãå¯èœãªå®è¡å¯èœãã¡ã€ã«ã®äž¡æ¹ã«æ¡åŒµãããŸãã / LARGEADDRESSAWAREãã©ã°ã䜿çšããŠã³ã³ãã€ã«ããã64ãããã¢ããªã±ãŒã·ã§ã³ã®å ŽåãWindows 8ã¯äœ¿çšããããã«8 TBã®ä»®æ³ã¡ã¢ãªãå²ãåœãŠãŸãïŒWindows 8.1ã§ã¯128 TBïŒã æ¯èŒã®ããã«ã32ãããã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã¢ãã¬ã¹ã¹ããŒã¹ã®ãŠãŒã¶ãŒéšåã®ãµã€ãºã¯2 GBã«å¶éãããŠããŸãã ãã®å Žåãé«ãšã³ããããŒã©ã³ãã åæ©èœã«ããããšã³ããããŒãååŸããããã®24ãããã®ã¢ãã¬ã¹ãšãšã³ããããŒã®ããã®17ãããã®ã¢ãã¬ã¹ã®ãããããŠã³å²ãåœãŠã䜿çšããŠãããã ã¢ããã¡ã¢ãªââå²ãåœãŠã®ããŒã¹ã¢ãã¬ã¹ã«ASLRã䜿çšã§ããŸãã ãã®ASLRã¬ãã«ã䜿çšããããã ã¢ããéžæã䜿çšããå ŽåïŒããã©ã«ãïŒã64ãããã¢ããªã±ãŒã·ã§ã³ã/ HIGHENTROPYVAããã³/ DYNAMICBASEãã©ã°ã 䜿çšããŠã³ã³ãã€ã«ããå¿
èŠããããŸãã
/ HIGHENTROPYVAèªäœã¯ãOSã§HEASLRã䜿çšããOptInå¶éã¢ãŒããšããŠäœ¿çšãããããšã«æ³šæããŠãã ããã ã€ãŸããWindows 8ã§ã®éåžžã®åäœïŒããã ã¢ãããããã¯å²ãåœãŠïŒã®VirtualAllocã¯ããã®ãã©ã°ãªãã§ã³ã³ãã€ã«ãããã¢ããªã±ãŒã·ã§ã³ã«å¯ŸããŠåŒ·åãããASLRã䜿çšããŸããã ãã®å¶éã¯ããã®ãããªç¶æ³ã§ã®ãããã®ã¢ããªã±ãŒã·ã§ã³ã®äºææ§ã®åé¡ãšäºæ³ãããäºæããªãåäœã«é¢é£ããŠããŸãã äžèšã®ããã«ãé«ãšã³ããããŒã©ã³ãã åæ©èœã¯64ãããã®å®è¡å¯èœãã¡ã€ã«ã«ãé©çšã§ããŸãã
Internet Explorer 10以éã¯ãé«ãšã³ããããŒASLRïŒx64ïŒã¢ãŒãã䜿çšããŸãã Windows 8ã§å®è¡äžã®ããã»ã¹ã®ããããã£ã以äžã«ç€ºããŸãããMicrosoftãWindows 8ã«å梱ãããã¹ãŠã®ã·ã¹ãã å®è¡å¯èœãã¡ã€ã«ã¯HEASLRã䜿çšããŸãã
ASLRãã€ãã¹ã®ç·©åïŒå¥åã¢ãã¬ã¹ç©ºéæ
å ±é瀺匷åïŒ
Windows 8ã®ãªãªãŒã¹ã«äŒŽããå瀟ã¯ã·ã¹ãã æ©èœãšãªããžã§ã¯ãã®ããŸããŸãªã¢ãã¬ã¹ãé衚瀺ã«ããæŠç¥ãè©Šã¿ãŸããã ãããã®æ©èœã®äžéšã¯ãWindows 7ã®æŽæ°ãšããŠæäŸãããŸãããã¢ãã¬ã¹ãæ»æããããã®äºæž¬å¯èœãªã¢ãã¬ã¹ã«ãã®ãããªæ
å ±ãååšãããšãæ¢åã®DEPããã³ASLRãã¯ãããžãŒã®æ©èœã倧å¹
ã«äœäžããæ»æè
ãæ»æã«æåããå¯èœæ§ãé«ãŸããŸãã
é¡èãªäŸã®1ã€ã¯MS13-031æŽæ°ããã°ã©ã ã§ãããã¯ãŒãããŒãžã¡ã¢ãªå²ãåœãŠå¶éïŒWindows 7以éïŒãå°å
¥ããŸãã ãã®ããŒãžã«ã³ãŒããé
眮ãããã©ã€ããŒã®è匱æ§ãæªçšãããšãæ»æè
ã¯LPEãšããŠäœ¿çšããŸããã€ãŸããç¹æš©ãã·ã¹ãã ç¹æš©ã«äžããã³ãŒããã«ãŒãã«ã¢ãŒãã§å®è¡ããŸãã ã«ãŒãã«ã¯ã EPROCESSïŒLowVaAccessibleãã£ãŒã«ãã䜿çšããŠããã®ãããªç¶æ³ãèŠå¶ããŸããã€ãŸããä»®æ³ã¡ã¢ãªã®é åãäºçŽã§ããæå°ã¢ãã¬ã¹ãæ€åºããŸãã
å¥ã®äŸã¯ãWindows Vista +ïŒããã©ã«ãã§ã¯Windows 8ïŒçšã®MS13-063æŽæ°ã§ãã ãã®æŽæ°ã«ããã ntdllãžã®ãã€ã³ã¿ãŒãåé€ãããŸãïŒLdrHotPatchRoutineã¯UserSharedDataïŒKUSER_SHARED_DATAïŒããåé€ãããæ»æè
ãå¿
èŠãšããã©ã€ãã©ãªããã°ããã¡ã¢ãªã«ããŒãããããã«äœ¿çšãããŸããã UserSharedDataã¯ããã¹ãŠã®ããã»ã¹ã§åãã¢ãã¬ã¹ã§äœ¿çšå¯èœã§ãããã«ãŒãã«ã¢ãŒãã§ã䜿çšããããããæ»æè
ã«ãšã£ãŠéåžžã«äŸ¿å©ã§ãã
Windows 8.1ã§ã¯ãä¿¡é Œã§ããªãã¢ããªã±ãŒã·ã§ã³ïŒæŽåæ§ã¬ãã«<äžïŒã®ã«ãŒãã«ãªããžã§ã¯ãã®ã¢ãã¬ã¹ã«é¢ããæ
å ±ãé ãããšãå¯èœã«ãªããŸããã ãã®é¢æ°ã®è©³çŽ°ã«ã€ããŠã¯ã ãã¡ããã芧ãã ãã ã éèŠãªntoskrnlé¢æ°ã¯ãããŸããŸãªã«ãŒãã«ãªããžã§ã¯ãã®ã¢ãã¬ã¹ã«é¢ããæ
å ±ãèŠæ±ãããšããšã©ãŒã¹ããŒã¿ã¹ãè¿ããŸãã
PS Microsoftã®ç¡æã®BinScopeããŒã«ã䜿çšããŠãASLRãµããŒãã®ããã°ã©ã ã®ã¢ãžã¥ãŒã«ã確èªã§ããŸãïŒiTunesãäŸãšããŠåãäžããããŠããŸãïŒã
blogs.technet.com/b/srd/archive/2013/12/11/software-defense-mitigating-common-exploitation-techniques.aspx