Krypton Level 3 -> Level 4

Gunter·2024년 4월 10일
0

OverTheWire - Krypton

목록 보기
4/5

Level Info

Well done. You’ve moved past an easy substitution cipher.

The main weakness of a simple substitution cipher is repeated use of a simple key. In the previous exercise you were able to introduce arbitrary plaintext to expose the key. In this example, the cipher mechanism is not available to you, the attacker.

However, you have been lucky. You have intercepted more than one message. The password to the next level is found in the file ‘krypton4’. You have also found 3 other files. (found1, found2, found3)

You know the following important details:

The message plaintexts are in American English ( very important) - They were produced from the same key ( even better!)
Enjoy.

 


 

얻고자 하는 krypton3 디렉토리에 들어가준 뒤


info에서 말한 found1, found2, found3 파일이 있었다.




encoding 된 문자열이 가득 있었고,


힌트도 확인해 봤지만 전혀 감이 오지 않았다.

그래서 그냥 crypto solver site 에서 found 1, 2, 3 파일을 모두 합쳐서 넣어봣는데
https://quipqiup.com


첫 문단에 info에서 말했던 'message plaintexts are in American English' 가 나왔다. 나머지 문단은 쓰레기 단어들이었다.

그치만 문장들을 읽어봐도 pw에 관련된 얘기는 딱히 나오지 않았다.


아까 디렉토리를 살펴봤을때 나온 krypton4를 살펴보니 found 파일들과 비슷한 형식이어서

found 1, 2, 3을 붙인 뒤에 바로 krypton4에서 나온 암호를 붙이니
(그냥 krypton4만 붙이면 plain american english text가 뜨지 않고 쓰레기값만 뜬다. 꼭 found1, 2, 3 뒤에 붙여야 뜬다.)

첫 문단 마지막 문장에 'well done level four password is brute' 라고 나왔다.

brute

 


 
풀긴 풀었는데 솔직히 때려맞춰서 푼거라 왜 정답이 저렇게 나오는지 궁금해서 좀 찾아봤다.

https://reversingfun.com/posts/overthewire-krypton/
이분의 블로그를 보고 이해 완.
단순 치환 암호의 주요 약점은 단순 키를 반복적으로 사용한다는 것.

힌트가 frequency analysis is your friend 인 이유가 있었다.
빈도 수를 이용하는 것이었다.

https://asecuritysite.com/coding/freq
이 사이트를 사용하면 텍스트에 대한 단일 문자 빈도 분석을 수행할 수 있는데, 가장 많은 문자는 S가 나왔다. 통계적으로 영어에서 가장 많이 사용되는 알파벳은 e 이므로 S가 E에 매핑된다고 킹리적 갓심 가능.

첫번째는 킹리적갓심으로 하고, 나머지는 문장에 나올 것 같은 cryptography 같은 단어를 가정하여 rpy같은 특정한 패턴을 이용해 알파벳들을 매핑해나가서 답을 맞춰야 하는거였다.

나는 너무,,, 너~무 사이트를 이용해 때려맞힌 것 같아서 민망하다 저렇게 하나하나 매핑해보면서 머리 깨지면서 풀어야 실력이 느는건데 허허

 

https://programmercave.com/blog/2020/01/07/Krypton-Level-3-to-Level-5-Basic-Cryptographic-Techniques
quipquip을 사용할 때 found 파일들 뒤에 krypton4를 붙여야 되었던 이유가 뭐냐면,

found 파일들을 입력했을때 나오는 출력이 한개가 아니라 이렇게 출력이 9개로 떨어져서 나온다. 따라서 found 뒤에 붙여야만 출력이 한개로 올바르게 작동된다.

0개의 댓글