æšå¹Ž12æã«ãç§ã¯æåã«ããŒã¿ä¿è·ã¢ããªã±ãŒã·ã§ã³ããã°ã©ãã³ã°ã€ã³ã¿ãŒãã§ã€ã¹ïŒç¥ããŠDPAPIïŒã«åºäŒããŸããã 次ã«ãChromeãã©ãŠã¶ã«ãã°ã€ã³/ãã¹ã¯ãŒããä¿åããæ¹æ³ãåŠã³ãŸãã ã ç§ã¯ãã®ã·ã¹ãã ã«è©³çŽ°ã«æã§çœ²åããããšãçŽæããŸããã ãããããªãã®ã§ããã£ãããžããããïŒ
ãŸããDPAPIãšã¯äœãããªãäœæãããã®ãã誰ããããå¿ èŠãšããŠããã®ããšããåºæ¬ããå§ããŸãããã 次ã«ããã®ä»çµã¿ã説æããŸãã
äž»ãªãã®ã«ã€ããŠç°¡åã«
æ å ±ã»ãã¥ãªãã£ã®åé¡ã¯èª°ããé·ãé觊ããŠããŸãããMicrosoftãäŸå€ã§ã¯ãããŸããã§ããããªãã£ã¹ã®PCãããŒã ã·ã¹ãã ããµãŒããŒ-ãã¹ãŠãããçšåºŠãééã£ãæã®ä¿è·ãå¿ èŠã§ããã
ããŒã¿ããªãŒãã³åœ¢åŒã§ä¿åããããšã¯ãå°ãªããšãã確å®ã§ã¯ãããŸããã§ããã ãããã£ãŠãWindows 2000ã®ãªãªãŒã¹ã«ãããDPAPIã®åæã®æªå å·¥ããŒãžã§ã³ãäžçäžã§èŠãããŸããã ãã®äž»ãªç®çã¯ãã³ã³ãã¥ãŒã¿ãŒã«ä¿åãããŠãããã¹ã¯ãŒããšæ©å¯æ å ±ãä¿è·ããããšã§ãã ããã«ããã®ããŒã¿ã®ææè ïŒãŠãŒã¶ãŒïŒãä¿è·ã®ååšã«ã€ããŠãç¥ããªããããªæ¹æ³ã§ããã®ããŒã¿ã¯ã¯ã©ãã«ãŒãå©çšã§ããŸããã§ããã ã·ã¹ãã ã®ã€ããªãã®ãŒã¯ãã以æ¥å€ãã£ãŠããŸããã ã¢ã«ãŽãªãºã ã¯å€æŽãããç©Žã¯éããããŸããããæ¬è³ªã¯åãã§ããã
ãã®çµæãæ©å¯ããŒã¿ããŠãŒã¶ãŒææè ã®ã¿ã«å©çšå¯èœã§ãããä»ã®èª°ã«ãå©çšã§ããªãæ¬æ Œçãªã»ãã¥ãªãã£ã·ã¹ãã ãç»å ŽããŸããã
åäœåç
ããã¯ãDPAPIã䜿çšããç°¡åãªã¹ããŒã ã®å€èŠ³ã§ãã
ã¢ããªã±ãŒã·ã§ã³ã¯ããã©ã¡ãŒã¿ãŒMysecretïŒåé¡ããå¿ èŠã®ããæåå/ãã€ãïŒãšãšã³ããããŒïŒãšã³ããããŒãå°ãåŸã§èª¬æããŸãããã®ãã©ã¡ãŒã¿ãŒã¯ãªãã·ã§ã³ã§ãïŒãèšå®ããŠãOSã«ã¢ã¯ã»ã¹ããŸãã
åºåã¯BLOBã§ãã
BLOB - B inary L arge OBãªããžã§ã¯ãã 埩å·åã¯é称ã§ãã ããã¯ãæ¬è³ªçã«ãã€ããªããŒã¿ã®é åã§ãã ã倧ãããŠåœ¢ããªããã
ãã®BLOBã¯ã埩å·åã«å¿ èŠãªããŒã¿ãšæå·èªäœãéããããã©ãŒã ã«å«ãŸããäžçš®ã®ã³ã³ããã§ãã ã¢ããªã±ãŒã·ã§ã³ã¯ãããä¿åãïŒããšãã°ããã®BLOBãSQLITEããŒã¿ããŒã¹ã®ãã£ãŒã«ãã®1ã€ã«ãã€ãã®é åãšããŠèšé²ããã®ãšåãChromeïŒãåŸã§å¿ èŠã«å¿ããŠåŸ©å·åããŸãïŒã¹ããŒã ã®åŸåïŒã
ããã¯ãåãã¹ããŒã ãã©ã®ããã«èŠãããã§ããããã詳现ã§ãã
æå·åãããã€ããŒã¯ãã¢ãžã¥ãŒã«åœ¢åŒã®ããã·ã¥ãæå·åãããŒäº€æãããžã¿ã«çœ²åã®ããã®ã¢ã«ãŽãªãºã ã®ã»ããã§ãã ããšãã°ããã·ã¢ã«ã¯GOSTã¢ã«ãŽãªãºã ãšããããçµã¿åãããæå·åãããã€ããŒããããŸãããããã£ãŠãã·ã¹ãã ã«æž¡ãå Žåãæšæºã®AESãSHAãRSAã®ä»£ããã«GOSTã䜿çšãããŸãã ãããã¯ãã¹ãŠã¬ãžã¹ããªã§æ§æãããŸãã ãã®çµæãDPAPIèªäœã¯ã©ã®ã¢ã«ãŽãªãºã ãæ©èœãããã«éãããããããããæè¢ã®ããã«ãå€åãããããã·ã¹ãã ããŠãããŒãµã«ã«ãªããŸãã
LSAãšCryptoAPIã«ã€ããŠã¯ãWikipediaããã®åŒçšã§åçããŸãã
ããŒã«ã«ã»ãã¥ãªãã£æ©é¢ãµãã·ã¹ãã ãµãŒãã¹ïŒLSASSïŒ èªèšŒãµãŒããŒã¯ãåã ã®ã³ã³ãã¥ãŒã¿ãŒã®ããŒã«ã«ãŠãŒã¶ãŒã®æ¿èªãæ åœããWindowsãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®äžéšã§ãã ãµãŒãã¹ããªããšãããŒã«ã«ãŠãŒã¶ãŒïŒãã¡ã€ã³ã«ç»é²ãããŠããªãïŒã®ã·ã¹ãã ãžã®ãã°ã€ã³ãååãšããŠäžå¯èœã«ãªãããããã®ãµãŒãã¹ã¯éèŠã§ãã
CryptoAPIã¯ãWindowsã¢ããªã±ãŒã·ã§ã³éçºè ã«æå·åãããã€ããŒãšé£æºããããã®æšæºæ©èœã»ãããæäŸããã¢ããªã±ãŒã·ã§ã³ããã°ã©ãã³ã°ã€ã³ã¿ãŒãã§ã€ã¹ã§ãã Microsoftãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®äžéšã§ãã Windows 2000以éãã»ãšãã©ã®CryptoAPIæ©èœããµããŒããããŠããŸãã
æãèå³æ·±ãããšã¯ãã¹ãŠLSAã®è žã§èµ·ããã人éã¯ããã§äœãããããšããªãã®ã§ããã®ããã»ã¹ã®æäœã«åœ±é¿ãäžããããšã¯ã»ãšãã©äžå¯èœã§ãã
森ã®äžãž
次ã«ãæå·å/埩å·åã¹ããŒã ã«ã€ããŠçŽæ¥è©±ããŸãããã
å®éããããã¯3ã€ã®é¢æ°ã«ãããŸããã
1ïŒãã¹ã¿ãŒããŒãéã
2ïŒæå·å
3ïŒåŸ©å·å
æå·åã埩å·åã®ããããå®è¡ããå Žåã§ããæåã«ãã¹ã¿ãŒããŒãéãå¿ èŠããããŸãã
ãã¹ã¿ãŒã㌠ïŒä»¥éMKãšåŒã³ ãŸã ïŒã¯ã察称æå·åã¢ã«ãŽãªãºã ã®æå·åããŒã§ãïŒWindows 7ã§ã¯ããã©ã«ãã§AESã§ãïŒã ãŸãããªãŒãã³ïŒIDãã¢ã«ãŽãªãºã ..ïŒããã³ã¯ããŒãºïŒããŒèªäœïŒæ å ±ãããBLOBã§ãã
MKã¯ã·ã¹ãã ã®æãéèŠãªéšåã§ãããããä¿¡é Œã§ããä¿è·äžã«ãããŸãã
ããã§ãéçºè ã«ã¯ãžã¬ã³ãããããŸãã ãã¹ã¯ãŒãïŒUSBããŒïŒãå ¥åããŠãŠãŒã¶ãŒãååŸããªãããã«ãããšåæã«ãäœããã®æ¹æ³ã§ãã¹ã¿ãŒããŒãä¿è·ããæ¹æ³ãæããŠãã ããã æããã«ããã®ããã«ã¯ãã·ã¹ãã ã®ãå人çãªãåºæã®æ å ±ãååŸããå¿ èŠããããŸãã ã€ãŸããããã¯ã·ã¹ãã ã«ãã°ã€ã³ããããã®ãŠãŒã¶ãŒãã¹ã¯ãŒãã§ãã ã·ã¹ãã ã«ãã°ã€ã³ãããšãLSAã¯ãã®ãã¹ã¯ãŒããä¿åããèŠæ±ã«å¿ããŠCryptoAPIãçºè¡ããŸãã
å®éãããã¯ããŒåŸ©å·åã¹ããŒã ã§ãã
SIDã¯äžæã®ã»ãã¥ãªãã£èå¥åã§ãã
LSAãã¹ã¯ãŒããã£ãã·ã¥ã¯ãã°ã€ã³ãã¹ã¯ãŒãã®ãã£ãã·ã¥ã§ãããããã§ãªãå Žåã¯nullã䜿çšãããŸãã
ãã®åŸãèšå®ãèªã¿èŸŒãŸããŸã
HMAC ïŒããã·ã¥ããŒã¹ã®ã¡ãã»ãŒãžèªèšŒã³ãŒããã¡ãã»ãŒãžèå¥ããã·ã¥ã³ãŒãã®ç¥ïŒã
ç°¡åã«èšãã°ãããã¯åãMD5ãSHAã«åºã¥ããŠãæ©èœããåãããã·ã¥é¢æ°ã§ã...ããã·ã¥ãååŸããã«ã¯ããã¹ã¯ãŒããå¿ èŠã§ããã€ãŸãã1ã€ã®ãã©ã¡ãŒã¿ãŒã®ä»£ããã«2ã€ãããŸãã
PBKDF2-ãã¹ã¯ãŒãããŒã¹ã®ããŒæŽŸçé¢æ°ã ãã¹ã¯ãŒãããŒã¹ã®ããŒçææšæºã æ¬äŒŒã©ã³ãã é¢æ°ã䜿çšããŠããŒãååŸããŸãã ããŒã®é·ãã«å¶éã¯ãããŸããã å®éãããã¯ããã·ã¥ã¢ã«ãŽãªãºã ã®ãè€éããã§ãã åãSHA256ã1ç§æªæºã§èšç®ãããå Žåããã®å©ããåããŠèšç®ã¯0.1ç§ã«ãã©ãã°ãããŸãã ããã§éèŠãªãã©ã¡ãŒã¿ãŒã¯ãå埩åæ°ã§ãã ç§ã®ã³ã³ãã¥ãŒã¿ãŒã«ã¯ããã©ã«ãã§17400ããããŸãããã¢ã«ãŽãªãºã ãããé·ãå®è¡ãããã»ã©ãéžæãé£ãããªããŸãã ã¢ã«ãŽãªãºã ã®è©³çŽ°ã詳ãã調ã¹ãªããã°ãSHA256ã¢ã«ãŽãªãºã ã17,400åå®è¡ãããšæ³åã§ããŸãã
SHAïŒSHAïŒSHA ... SHAïŒæååïŒïŒ...ïŒ
ãããéæããã«ã¯æéãããããSHAã¯ç¥è©±çãªåæ¹åé¢æ°ã§ãããšäž»åŒµããŠãããããåºåã¯äžæã«ãªããŸãã
ã¢ã«ãŽãªãºã ã1åïŒãŠãŒã¶ãŒã®èŠ³ç¹ããïŒå®è¡ãããå Žåã0.1ç§ã¯äœããããŸããããç¹°ãè¿ãåŠçããã®ã¯æªå€¢ã§ãã
MasterKey BLOBã¯æå·åãããããŒãæã€åãªãããŒã¿ã§ããããœã«ãããã¹ã¿ãŒããŒIDããã®ä»ã®ãµãŒãã¹ãã©ã¡ãŒã¿ãŒãªã©ãã·ã¹ãã ãèªã¿åãå¯èœãªãªãŒãã³ããŒã¿ãä¿åããŸãã
ãã®çµæãåºåã§ããŒãååŸããŸãã
æå·åãéå§ããŸãããã
ããã§ã¯ãã¹ãŠãéåžžã«ç°¡åã§ããæåã«ãããŒã§ããHMACKEY1ïŒã·ã¹ãã ã«ãã£ãŠã©ã³ãã ã«çæãããŸãïŒãšå ¥åãããšã³ããããŒïŒããå°ããããã«ã€ããŠè©³ãã説æããŸãïŒãHMACã¢ã«ãŽãªãºã ã¢ããã°ïŒçŸåš3ã€ã®å ¥åãã©ã¡ãŒã¿ãŒãæã£ãŠããŸãïŒã«äŸçµŠãããŸãã åä¿¡ããããŒã¿ã¯ãæå·åãããããŒã¿ã®ç§å¯éµã§ãã ãœã«ããã©ã³ãã ã«çæãããŸãã ãã®ããŒã¿ã¯ãã¹ãŠãBLOBãäœæãããšãã«äœ¿çšãããŸããBLOBã¯ãæå·åèŠæ±ã®ããã«ããã°ã©ã ã«æ¢ã«è¿ãããŸãã
埩å·åãåæ§ã§ãã
ããã§ã¯ãå¿ èŠãªãã¹ãŠã®ããŒã¿ãBLOBèªäœããèªã¿åãããŸãã åºå£ã§ãç§å¯ãååŸããŸãã
ãã¹ã¿ãŒããŒBLOBã«ã¯ãèªã¿åãçšã«éãããå€ãã®æ å ±ããããŸãã DPAPIããŒãžã§ã³ããã®IDãããŸããŸãªãã©ã°ãMKãµã€ãºããœã«ããå埩ã«ãŠã³ããããã·ã¥ã¢ã«ãŽãªãºã ãæå·åã
æå·åãããããŒã¿ã䜿çšããBLOB'eãå€ãã®æ å ±ã§ãã ç¹°ãè¿ãã«ãªããŸãããæå·åãããã€ããŒã䜿çšããããŒãžã§ã³ID MKã¯ãæå·åã説æãããã³çœ²åïŒããã·ã¥éïŒã«äœ¿çšãããŸããã
ãæåã«æ»ãã
ãããšã¯å¥ã«ã CredHistoryã®ãããªããšã«æ³šæããããšæããŸãã
è³æ Œå±¥æŽã äžèŠ-äžå¿ èŠãªããšã§ãããããã¯èµ·ãããŸãã
ãã¹ã¯ãŒããå€æŽãããšããŸãããã ã¢ã«ãŽãªãºã ã®èŠ³ç¹ããã¯ããã¹ã¿ãŒããŒã«ã¢ã¯ã»ã¹ã§ããªããªããŸããã 解èªãããã®ã¯äœããããŸããïŒ ãããããã®ãã¥ã¢ã³ã¹ã¯èãæãããŠããŸãã ã·ã¹ãã ã¯ãã¹ã¿ãŒããŒãåæå·åããŸãã ãããããã®ããã»ã¹ã«ã¯æéãããããŸã...å€ãã®ããŒãŠã£ã¶ãŒããååšããå¯èœæ§ããããããããã¹ãŠãåæå·åããå¿ èŠããããŸãïŒæ¢å®ã§ã¯ãã»ãã¥ãªãã£ã匷åããããã«90æ¥ããšã«æ°ãããã®ãçæãããæ¢ã«æå·åãããããŒã¿ã¯ç¹å®ã®ããŒã«é¢é£ä»ããããŠããŸãïŒã ãããã£ãŠãMicrosoftã¯ãã®ã¢ã«ãŽãªãºã ãäœæããŸããã åã®ãã¹ã¯ãŒãã¯å¿ããããŸãã...çŸåšã®ãã¹ã¯ãŒãã§æå·åãããã¹ã¿ãã¯ã«ä¿åãããŸãã ãããã£ãŠãã·ã¹ãã ãçªç¶ãã¹ã¿ãŒããŒã解èªã§ããªãã£ãå Žåããããããããšã¯ãããŸããã çŸåšã®ãã¹ã¯ãŒãã䜿çšããŠã圌女ã¯CredHistã®æåã®ãšã³ããªã解èªããŸãã ãããŠã圌ã¯åãåã£ããã¹ã¯ãŒãã§ãã¹ã¿ãŒããŒãåã³è§£èªããããšããŸãã ããïŒ ãã®ãã¹ã¯ãŒãã䜿çšããŠã圌女ã¯ãã§ãŒã³å ã®æ¬¡ã®ãã¹ã¯ãŒãã解èªããŸãã ãã®ããã»ã¹ã¯ããã¹ã¯ãŒãããã§ãŒã³å ã§ãªããªããããã¹ã¿ãŒããŒã埩å·åããããŸã§ç¶ããŸãã MKã埩å·åãããªãã®ã¯ã©ãããŠã§ããïŒ ããšãã°ããµãŒãããŒãã£ã®ãœãããŠã§ã¢ã䜿çšããŠãã¹ã¯ãŒãã匷å¶çã«ãªã»ããããå Žåã éåžžããã®ãããªãœãããŠã§ã¢ã¯DPAPIããŒã®ãåæå·åããããªã¬ãŒããŸããã ãã®ããããã®ãããªæé ã®åŸããã®ã·ã¹ãã ã«ãã£ãŠä¿åããããã¹ãŠã®ãã¹ã¯ãŒãã倱ãããŸãã ãããããã®åŸãã¹ã¯ãŒããCredHistã«ãããã®ã«å€æŽãããšããã¹ãŠã®ãã¹ã¯ãŒããæå¹ã«ãªããŸãã
åäŸé£ãã®ã²ã¹ããããªãã®ãšããã«æ¥ããšæ³åããŠãã ããã åã©ããããã£ã-ãšãã¹ã¯ãŒããå€æŽããŸããã ãµãŒãããŒãã£ã®ãŠãŒãã£ãªãã£ã䜿çšããŠããã¹ã¯ãŒãããªã»ããããŸãã ãã¹ãŠã®ç§å¯ããŒã¿ã«ã¢ã¯ã»ã¹ã§ããªããªããŸãããã以åã®ãã¹ã¯ãŒããè¿ããåŸãããŒã¿ã¯åã³ããªãã®ãã®ã«ãªããŸãã ãã¹ã¯ãŒãããªã»ããããããã«ãã¹ã¯ãŒãããããããŒãã£ã¹ã¯ã«ãã£ãŠãªã»ãããããå Žåãããã§ã·ã¹ãã ã¯ã€ã³ããã¯ã¹ã®åäœæãéå§ããŸãã ã¡ãªã¿ã«ãRSAã·ã¹ãã ã¯ãããããŒãã£ã¹ã¯ã®ãã¹ã¯ãŒãããªã»ããããããã«äœ¿çšãããŸãã æå·åã®å ¬éããŒãšæå·èªäœã¯ã¬ãžã¹ããªã«ä¿åãããç§å¯ããŒã¯ãã£ã¹ã±ããã«ä¿åãããŸãã ãã¹ã¯ãŒããå€æŽãããšãæ°ãããã¹ã¯ãŒãã¯å ¬ééµã§æå·åãããäžæžããããŸãã
ãšã³ããããŒ
ããã§ãšã³ããããŒã«ã€ããŠè©±ãããšãã§ããŸãã ã·ã¹ãã ã®åçãç解ãããšããšã³ããããŒãªãã§ïŒãŸãã¯åããšã³ããããŒã§ïŒæå·åãããããŒã¿ã¯ãåããŠãŒã¶ãŒããå®è¡ãããŠããã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠç°¡åã«è§£èªãããããšãããããŸããã ã€ãŸããæ å ±ã¯ãŠãŒã¶ãŒã®ãã¡ã€ã³å ã§å ¬éãããŠããŸãã ãšã³ããããŒã¯ãæ¬è³ªçã«ãç¹å®ã®æå·åãããããŒã¿ã®ãã¹ã¯ãŒãã§ãã ãšã³ããããŒãèšå®ãããšããã®ãã©ã¡ãŒã¿ãŒãç¥ããªãã³ã³ãã¥ãŒã¿ãŒäžã®ãœãããŠã§ã¢ã¯BLOBã解èªã§ããŸããã
Microsoftã¯IEã§ãšã³ããããŒã䜿çšããèå³æ·±ãäŸãèšå®ããŸããã ãã°ã€ã³æã®ãã¹ã¯ãŒãã¯ã¬ãžã¹ããªã«ä¿åãããŸãã ããŒåã¯ãèªèšŒãééãããªã³ã¯ããã®ããã·ã¥ã§ãããã³ã³ãã³ãã¯æå·åãããããŒã¿ã§ãã ãããã£ãŠããã®ãªã³ã¯ã¯ãšã³ããããŒã§ãã ã€ãŸãããã®ããŒã¿ãååããŠãªãŒãã³ãã¹ã¿ãŒããŒãæã£ãŠããå Žåã§ãããªã³ã¯ãå埩åŠçããå¿ èŠãããããã®çµæããã¹ãŠã®ããŒã¿ãææããŠãããããçãŸããããŒã¿ãå®å šã«æããã«ããããšã¯ã§ããŸããã
ã¹ããŒã ã¯æ¬¡ã®ãšããã§ãã
1ïŒãªã³ã¯mysite.ru/login.phpãéããŸãã
2ïŒIEã¯ãã®ãªã³ã¯ããããã·ã¥ãååŸããŸãã
3ïŒIEã¯ãæå®ãããããã·ã¥ã«äžèŽããååãããŒåã®äžããæ€çŽ¢ããŸãã
4ïŒããŒïŒBLOBïŒãšãªã³ã¯ã®å 容ããšã³ããããŒãšããŠäœ¿çšããŠãIEã¯ãã°ã€ã³ãšãã¹ã¯ãŒãã§æ å ±ãéããŸãã
ã¹ããã3ã§äžèŽãèŠã€ãããªãã£ãå Žåãããã¯ãŠãŒã¶ãŒããã®ããŒãžã«ãŸã äœãå ¥åããŠããªãããšãæå³ããŸãã
Passcapeãããžã§ã¯ããç¹ã«ãããžã§ã¯ã管çè ã«æè¬ã®æãè¡šããããšæããŸãããããžã§ã¯ã管çè ã¯ãDPAPIã«é¢ãããã¹ãŠã®è³ªåã«åãã§ïŒã§ããã°ïŒçããŠãããŸããã ç§ã®ç¥ãéãã圌ãã®ã¢ããªã±ãŒã·ã§ã³ãWindows Password Recoveryãã¯ãŠããŒã¯ã§ãDPAPIã®åäœãå®å šã«ãšãã¥ã¬ãŒãããŠããŸãã
ãæž èŽããããšãããããŸãããã質åã«ãçããããŠããã ããŸãã