Bandit Level 11 → Level 12

장일영·2024년 5월 10일

Bandit

목록 보기
12/33

Level

Goal

The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions

다음 레벨의 패스워드는 data.txt 파일에 있으며 해당 파일의 모든 소문자(a-z)와 대문자(A-Z)는 13자리씩 회전되어 있다.

Commands you may need to solve this level

grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd

Helpful Reading Material
Rot13 on Wikipedia

Exploit

ROT13(Rotated by 13)은 카이사르 암호의 일종이다. 알파벳을 13글자씩 밀어서 쓴다. 암호학 개론 수업 첫 시간에 교수님이 언급했던 기억이 있다. 재미있는 점은 이미 이름에서 키가 드러나 있다는 점이다. 따라서 ROT13을 사용했다는 것만 알면 복호화가 가능하다. 13이 아니더라도 빈도 분석 등의 방법을 사용하면 쉽게 복호화가 가능하다. 따라서 ROT13의 실제 용도는 데이터를 암호화하기 보다 스포일러 방지 등으로 사용한다.

bandit11@bandit:~$ ls -al
total 24
drwxr-xr-x  2 root     root     4096 Oct  5  2023 .
drwxr-xr-x 70 root     root     4096 Oct  5  2023 ..
-rw-r--r--  1 root     root      220 Jan  6  2022 .bash_logout
-rw-r--r--  1 root     root     3771 Jan  6  2022 .bashrc
-rw-r-----  1 bandit12 bandit11   49 Oct  5  2023 data.txt
-rw-r--r--  1 root     root      807 Jan  6  2022 .profile

bandit11@bandit:~$ file data.txt
data.txt: ASCII text

tr 커맨드를 사용해 표준 입력의 문자를 변환한다. 13번 이동하도록 변환하면 된다.

bandit11@bandit:~$ cat data.txt | tr '[a-zA-Z]' '[n-za-mN-ZA-M]'

0개의 댓글