MS-CHAPv2 is Obsoleted
DEFCON ã§ãPPTP ã®èªè¨¼æ¹å¼ã¨ãã¦ä¸çªããã¥ã©ã¼ãª MS-CHAPv2 ãã¯ã©ãã¯ãããã¼ã«ãç»å ´ããäºãã大ããªè©±é¡ã«ãªãã¾ããã
DEFCON参加の専門家、「MS-CHAP v2」をクラックするツールを発表 - CNET Japan
DEFCON ã¨ããã¨ãä¸ä»ã®ã¨ã³ã¸ãã¢ã«ã¯é ãåå¨ã§ãèªåãç解ã§ãããããªè©±ã¯ãªããã¨æã£ã¦ããã®ã§ããããã®è©±ã¯ãæãã®å¤ãç°¡åãªè©±ã§ããã
ãããããã解説ããè±èªã®ããã°è¨äºã§ã§ã¦ãã¾ãã
https://www.cloudcracker.com/blog/2012/07/29/cracking-ms-chap-v2/
æ¸ãã¦ããä¸èº«ãåããã¨ãããªãã§èª°ãæ°ãã¤ããªãã£ãï¼ãã¨æããã»ã©ãåç´ãªãã¨ã§ããã
MS-CHAPv2 ã¨ã¯
PPTP ã§æããã使ãããããã£ã¬ã³ã¸ã»ã¬ã¹ãã³ã¹åã®èªè¨¼æ¹å¼ã§ãPPTP 以å¤ã«ããç¡ç· LAN ã®èªè¨¼æ©æ§ã¨ãã¦ã使ãããäºãããããã§ãã
ãã£ã¬ã³ã¸ã»ã¬ã¹ãã³ã¹åãã¨ããã®ã¯ããµã¼ãå´ããã£ã¬ã³ã¸ã»ã³ã¼ãã¨å¼ã°ããããã®å ´éãã®ä¹±æ°ãã¯ã©ã¤ã¢ã³ãã«éããã¯ã©ã¤ã¢ã³ãå´ã¯ããã®ä¹±æ°ã¨ãã¹ã¯ã¼ãã使ã£ãè¨ç®ãè¡ãããã®çµæããµã¼ãå´ã«è¿ãã¾ãããããããã¨ã§ãéä¿¡ä¸ã«ã¯ãã¹ã¯ã¼ããã®ãã®ãæµããäºããªãä¸ã«ãã¯ã©ã¤ã¢ã³ãå´ããéãããã¬ã¹ãã³ã¹ããæ¯åº¦éãç©ã«ãªããããããã¹ã¯ã¼ããã®ãã®ã¯åãããªããã©ããã®æ å ±ããµã¼ãã«æ¸¡ãã°èªè¨¼ãéããã¨ãã£ãäºãèµ·ããªããªãã¾ããå²ã¨æåãªã®ã¯ãPOP ãµã¼ãã¸ç¹ãã¨ãã® APOP ãããã®ãã£ã¬ã³ã¸ã»ã¬ã¹ãã³ã¹åã«ãªãã¾ãã
ã¬ã¹ãã³ã¹ã®è¨ç®æ¹æ³
åè¿°ã®è±èªã®ããã°ã§ããThe Protocolãã®ç« ã«ããçµµãè¦ãã¨ãã¯ã©ã¤ã¢ã³ãå´ãã¦ã¼ã¶ã®ãã¹ã¯ã¼ããããã©ããªæ¹æ³ã§ã¬ã¹ãã³ã¹ãè¨ç®ããã®ããåããã¾ãã
ã¯ã©ã¤ã¢ã³ãã¯ããµã¼ããããã£ã¬ã³ã¸ã»ã³ã¼ãï¼ServerChallengeï¼ãåãåãã¾ããããããå³ã§ã¯ãµã¼ãããã¯ã©ã¤ã¢ã³ãã¸ã®ç¢å°ãå¼ããã¦ãRandom 16 Byte Server Challengeãã¨æ¸ããã¦ããã¨ããã§ãã
ãã®ä¸ã«æ¸ããããã¯ã©ã¤ã¢ã³ãå´ã®æé ãé ã«è¿½ãã¨ãä¸è¨ã®ãããªã«ãªãã¾ãã
- 16 Byte ã®ä¹±æ°ãçæããã
ï¼Generate 16 Byte ClientChallengeï¼ - èªåãçæããä¹±æ°ã¨ããµã¼ãããéããã¦ããä¹±æ°ã¨ãã¢ã«ã¦ã³ãåãã¤ãªããããã«å¯¾ãã SHA1 ã®ããã·ã¥å¤ãè¨ç®ããã
ï¼ChallengeHash = SHA1(ClientChallenge || ServerChallenge || UserName)[0::8]ï¼ - ã¦ã¼ã¶ã®ãã¹ã¯ã¼ãã«å¯¾ãã MD4 ã®ããã·ã¥å¤ãè¨ç®ããã
ï¼NTHash = MD4(UserPassword)ï¼ - ï¼çªç®ã®æé ã§è¨ç®ããããã·ã¥å¤ï¼ChallengeHashï¼ã«å¯¾ãã¦ãï¼çªç®ã®æé ã§è¨ç®ããããã·ã¥å¤ï¼NTHashï¼ãéµã¨ãã¦ãDES ã«ããæå·åãè¡ãããã®ã¨ããNTHash ã®å¤ãï¼ã¤ã®å¤ã«åå²ãã¦ï¼ã¤ã®éµãä½ããï¼ã¤ã®éµããããã§æå·åããçµæãã¤ãªããã
ï¼ChallengeResponse = DESNTHash[00:07](ChallengeHash) || DESNTHash[07:14](ChallengeHash) || DESNTHash[14:21](ChallengeHash)ï¼
ãã®æé ã®ä¸ãããè¦ãã¨ãã¦ã¼ã¶ã®ãã¹ã¯ã¼ããç´æ¥åãããªãã¦ããï¼çªç®ã®æé ã§è¨ç®ãã NTHash ã®å¤ãåããã°ããè©°ã¿ããªäºãåããã¾ãã
ã¯ã©ã¤ã¢ã³ãããéãããã¬ã¹ãã³ã¹ã®å 容ã¯ãå³ã§ä¸è¨ã®å¦çãåæããå¾ã«ãã¯ã©ã¤ã¢ã³ãå´ãããµã¼ãå´ã¸å¼ãããç¢å°ã®ç·ã®ä¸ã«ã24 Byte ChallengeResponse, 16 Byte ChallengeHash, UserNameãã¨æ¸ããã¦ãã¾ããChallengeResponse ãè¨ç®ããããã®å ¥åå¤ã«ãªãç©ã¯ãChallengeHash 㨠NTHash ã§ãChallengeResponse 㨠ChallengeHash ã¯ãããã¯ã¼ã¯ä¸ãæµãã¦ãããã¼ã¿ãªã®ã§ãé ãããå¤ã§ã¯ãªãã§ããã¨ããäºã¯ãChallengeResponse 㨠ChallengeHash ã®å¤ãããNTHash ãéç®ã§ããã°ãã¦ã¼ã¶ã®ãã¹ã¯ã¼ããã®ãã®ãåãããªãã¦ããChallengeResponse ã®å¤ãè¨ç®ããäºãã§ãã¾ãã
NTHash ã®å¤ãéç®ããã«ã¯
NTHash ã®å¤ã¯ãMD4 ã§è¨ç®ãããå¤ãªã®ã§ã128 bit ã®æ°å¤ã§ããä¸æ¹ãDES ã®éµé·ã¯ 56 bit åºå®ã§ãã128 bit ã®å¤ãï¼ã¤ã«åãã¦ã56 bit ã®éµãï¼ã¤ä½ãã®ã§ããããããå®ã«ãç²æ«ã§ãã
ãDivide And Conquerãã®ç« ã®ä¸ã®å³ã§ã説æããã¦ãã¾ããããã®å³ãè¦ãåã«ãã©ããã£ã¦ã128 bit ã®éµãã 56 bit ã®éµãï¼ã¤ä½ããã ï¼ãã¨ããçåããã£ã¦ãMS-CHAPv2 ã® RFC ãèªã¿ã¾ããã
RFC 2759: Microsoft PPP CHAP Extensions, Version 2
ä¸è¨ãã¼ã¸ã®ã8.5. ChallengeResponse()ããèªãã¨ãä¸è¨ã®ããã«æ¸ããã¦ãã¾ãã
Set ZPasswordHash to PasswordHash zero-padded to 21 octets
ãzero-paddedãã¤ã¾ããã¼ãã§ç©´åããã¦ãã¾ãã
ã¨ããäºã¯ã56 bit ã®ï¼ã¤ã®éµã®ãã¡ãæåã®ï¼ã¤ã¯ NTHash ã® 128 bit ã§è³ãã¾ãããæå¾ã®éµã¯ãä½ã£ã 128 - 56 à 2 = 16 bit ã«ã40 bit ã®ã¼ããç¶ãéµãã¨ããäºã«ãªãã¾ããããã ã 216 = 65,536 ã®éµåè£ã調ã¹ãã°è¯ããã¨ã«ãªãã¾ãã
æ®ãï¼ã¤ã®éµã¯ 256 = 72,057,594,037,927,936 éãã®éµã調ã¹ãã°è¦ã¤ããã¾ããè¦ã¤ããã¹ãéµãï¼ã¤ã ããããã®åã調ã¹ãå¿ è¦ãããããã«ä¸ç¬æãã¾ãããï¼ã¤ã®éµåè£ã«å¯¾ãã¦ããã®éµåè£ãï¼ã¤ç®ã®éµãªã®ããï¼ã¤ç®ã®éµãªã®ããã¨ãã£ãå¤æãããã°è¯ãã®ã§ãè¨ç®éã¨ãã¦ã¯ 256ã§å¤ããã¾ããã
DES ã®å®å ¨æ§
ä»æã¯ã»ã¨ãã© AES ã§ããDES ãªãã¦å¤ãæå·ã¯...ãã¨æãããã¡ã§ãããå®ã¯ãããã»ã©èãç©ã§ãããã¾ãããå°ãªãã¨ããæ°åã§è§£ãã¦ãã¾ããããªç©´ããã訳ã§ã¯ããã¾ããã
http://ja.wikipedia.org/wiki/DES_(%E6%9A%97%E5%8F%B7)
çè«çã«ã¯ã256ããå°ãªãè¨ç®éã§è§£ããæ¹æ³ã¯èæ¡ããã¦ãã¾ããããããããå¹³æã¨å¯¾å¿ããæå·æãããç¨åº¦éã¾ã£ã¦ããæã«ãéµã®åè£ãçµãããã¨ãããã®ã§ãåç´ã«æå·æã ããããç¶æ ãã解ãã訳ã§ã¯ããã¾ããã
ããã§ããDES ã®å®å ¨æ§ã«çåãä»ããããã«æãã AES ãä½ããã¨ã«ãªã£ãã®ã¯ã256ã¨ããéµé·ããååã«é·ãã¨ã¯è¨ããªããªã£ã¦ããããã§ãã
å ã® Wikipedia ã§ã®è¨è¿°ã«ãããã¾ããã1999 å¹´ã« 22 æé㧠DES ã解ãã話ãè¼ã£ã¦ãã¾ãããã ãã25 ä¸ãã«æããå°ç¨ãã·ã³ã«ãã¤ã³ã¿ã¼ãããã§åã£ã 10 ä¸å°ã® PC ã使ã£ã¦ãã§ãããå人ã§ã¯ã¨ããããçµç¹ããéãæãã¦è§£ãã°ï¼æ¥è¶³ããã§è§£ãããã¨ããç¶æ³ã«ãªã£ã訳ã§ãããããã13 å¹´åã
ã¨ãããã¨ã§ãDES èªä½ã«ã¯æ¬ é¥ãããæ¬ é¥ã¯ç¡ãã®ã§ããã56 bit ã¨ããéµé·ã¯ä»æãçãããã®ã§ä½¿ãããªããªã£ããã¨ãã£ãã¨ããã§ã*1ãã¡ãªã¿ã« AES ã¯æçã®éµé·ã§ã 128 bit ã§ãã
ã¾ã¨ã
ã¨ãããã¨ã§ãMS-CHAPv2 ã®åé¡ã¯ã
- ã¯ã©ã¤ã¢ã³ãããéãããã¬ã¹ãã³ã¹ã解æããã®ã«å¿ è¦ãªè¨ç®éã¯ã56 bit ã® DES ã解ãã®ã¨åçã
ã¨ãããã¨ã«ãªãã¾ãã
ç§ã¯ãã®è¨äºãèªãã ã¨ããLM Hash ã®åé¡ãæãåºãã¾ãããLM ããã·ã¥ã®åé¡ã¯Windows のパスワード強度 理論編 - JULYの日記ã§ãæ¸ãã¾ãããããã¹ã¯ã¼ãæååãåå²ãã¦ãããããããã«ããã·ã¥å¤ãè¨ç®ãã¦ããã¨ããã§ããããããï¼ã¤ã® DES ã®çµæãã¤ãªãåãããã®ã§ã¯ãªããTriple DES ã®æ§ã«ããDES ã®çµæãããã« DES ã«ããããã¨ããäºããã¦ããã°åé¡ã¯ç¡ãã£ãã®ã«ãã¨æãã¾ãããã®ãåå²ãã¦ããè¨ç®ãã¨ããã®ããããã«ã Microsoft ãããã¨æã£ã¦ãã¾ãã¾ããã
*1:DES ãä¸åç¹°ãè¿ããã¨ã§ã強度ãé«ãã Triple DES ã¯ä»ã§ãè¦ããã¾ããä¸åã®æå·åå¦çã§éµãå¤ãããã¨ã§ã使ããéµé·ãé·ããã¦ãã¾ããï¼åç®ã¨ï¼åç®ã¯åãéµã使ã 112 bit éµã®å ´åã¨ãï¼åã¨ãå¥ã®éµã使ã 168 bit éµã®ç©ãããã¾ããTriple DES ã«å¯¾ãã¦ãï¼åã ãã®ãã®ã Single DES ã¨å¼ã¶ãã¨ãããã¾ãã