Krypton Level 2 -> Level 3

Gunter·2024년 4월 4일
0

OverTheWire - Krypton

목록 보기
3/5

Level Info

ROT13 is a simple substitution cipher.

Substitution ciphers are a simple replacement algorithm. In this example of a substitution cipher, we will explore a ‘monoalphebetic’ cipher. Monoalphebetic means, literally, “one alphabet” and you will see why.

This level contains an old form of cipher called a ‘Caesar Cipher’. A Caesar cipher shifts the alphabet by a set number. For example:

plain: a b c d e f g h i j k ...
cipher: G H I J K L M N O P Q ...
In this example, the letter ‘a’ in plaintext is replaced by a ‘G’ in the ciphertext so, for example, the plaintext ‘bad’ becomes ‘HGJ’ in ciphertext.

The password for level 3 is in the file krypton3. It is in 5 letter group ciphertext. It is encrypted with a Caesar Cipher. Without any further information, this cipher text may be difficult to break. You do not have direct access to the key, however you do have access to a program that will encrypt anything you wish to give it using the key. If you think logically, this is completely easy.

One shot can solve it!

Have fun.

Additional Information:

The encrypt binary will look for the keyfile in your current working directory. Therefore, it might be best to create a working direcory in /tmp and in there a link to the keyfile. As the encrypt binary runs setuid krypton3, you also need to give krypton3 access to your working directory.

Here is an example:

krypton2@melinda:~$ mktemp -d
/tmp/tmp.Wf2OnCpCDQ
krypton2@melinda:~$ cd /tmp/tmp.Wf2OnCpCDQ
krypton2@melinda:/tmp/tmp.Wf2OnCpCDQ$ ln -s /krypton/krypton2/keyfile.dat
krypton2@melinda:/tmp/tmp.Wf2OnCpCDQ$ ls
keyfile.dat
krypton2@melinda:/tmp/tmp.Wf2OnCpCDQ$ chmod 777 .
krypton2@melinda:/tmp/tmp.Wf2OnCpCDQ$ /krypton/krypton2/encrypt /etc/issue
krypton2@melinda:/tmp/tmp.Wf2OnCpCDQ$ ls
ciphertext  keyfile.dat

 


 
요약 : ROT13은 간단한 대체 암호다.

대체 암호는 간단한 대체 알고리즘이다. 대체 암호의 예에서 '단일알파벳'암호를 살펴볼거다. 단일알파벳은 문자 그래도 한개의 알파벳을 의미함.

이 단계는 '카이사르 암호'라고 불리는 오래된 형태의 암호를 포함한다.
카이사르 암호는 알파벳을 정해진 숫자만큼 이동시킨다. 예시.

레벨3의 암호는 krypton3 파일에 있다. 5글자 그룹 암호문으로 되어 있으며, 카이사르 암호문으로 암호화 되이
있다.

추가 정보로 암호화 바이너리는 현재 작업 디렉토리에서 키 파일을 찾는다. 따라서 /tmp와 키 파일에 대한 링크에서 작업 디렉토리를 생성하는것이 가장 좋다.
암호화 바이너리가 setuid krypton3를 실행하므로 작업 디렉토리에 대한 krypton3 액세스 권한도 부여해야 한다.

 

이전 문제와 같이 krypton2에 krypton3 파일이 있기 때문에 krypton2로 들어가서 암호화된 문자를 확인


https://cryptii.com/pipes/caesar-cipher
계산하기 커찮아서 사이트에서 돌리기

$ cat /krypton/krypton2/krypton3 | tr 'MNOPQRSTUVWXYZABCDEFGHIJKL' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

터미널에선 이 명령어를 사용해서 바로 돌릴 수 있음

정답 : CAESARISEASY

0개의 댓글