OverTheWire Bandit Level 11 -> 12
OverTheWire Bandit Level 11 -> 12OverTheWire Bandit Level 11 -> 12OverTheWire Bandit Level 11에서 Level 12로 가는 풀이Writeup for OverTheWire Bandit Level 11 to Level 12

axii@fedora:~/bandit$ ssh bandit11@bandit.labs.overthewire.org -p 2220
bandit11@bandit:~$ ls -al
total 24
drwxr-xr-x 2 root root 4096 Apr 3 15:17 .
drwxr-xr-x 150 root root 4096 Apr 3 15:20 ..
-rw-r--r-- 1 root root 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 root root 3851 Apr 3 15:10 .bashrc
-rw-r----- 1 bandit12 bandit11 49 Apr 3 15:17 data.txt
-rw-r--r-- 1 root root 807 Mar 31 2024 .profile
bandit11@bandit:~$ cat data.txt
Gur cnffjbeq vf <redacted>설명대로 13칸씩 치환된 것 같다.
힌트로 나온 명령어들의 사용법을 서치하다가 tr로 해결 가능할 것 같은데 어떻게 사용해야 할지 몰라서 tr 명령어 치환의 응용으로 좀 더 서치했다.
https://zidarn87.tistory.com/137 이 블로그가 크게 도움이 되었다.
A+13=N이니까
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is <redacted>다음과 같이 tr을 사용하면 된다.
A-Z까지의 문자를 N-ZA-M으로 치환한다.

axii@fedora:~/bandit$ ssh bandit11@bandit.labs.overthewire.org -p 2220
bandit11@bandit:~$ ls -al
total 24
drwxr-xr-x 2 root root 4096 Apr 3 15:17 .
drwxr-xr-x 150 root root 4096 Apr 3 15:20 ..
-rw-r--r-- 1 root root 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 root root 3851 Apr 3 15:10 .bashrc
-rw-r----- 1 bandit12 bandit11 49 Apr 3 15:17 data.txt
-rw-r--r-- 1 root root 807 Mar 31 2024 .profile
bandit11@bandit:~$ cat data.txt
Gur cnffjbeq vf <redacted>As described, each letter seems to be shifted by 13 positions.
While looking up the hinted commands, I figured tr could solve it, but I didn't know how to use it, so I searched more for examples of substitution with tr.
https://zidarn87.tistory.com/137 This blog was a big help.
Since A+13=N,
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is <redacted>Use tr as above.
This maps A-Z to N-ZA-M.