기본 콘텐츠로 건너뛰기

Bandit11

Bandit11 Bandit Level 11 이번 level은 ROT13(13회 순환)된 대소문자를 원래대로 돌려 패스워드 값을 구하는 문제이다. tr 명령어를 사용하면 이를 쉽게 구할 수 있다. ascii table을 참고하면 13번째 문자는 n 이라는 것을 알 수 있다. 이를 참고하여 tr 명령어 구문을 구성해보자. ASCII Table Tables For convenience, below are more compact tables in hex and decimal. 2 3 4 5 6 7 30 40 50 60 70 80 90 100 110 120 ------------- --------------------------------- 0: 0 @ P ` p 0: ( 2 < F P Z d n x 1: ! 1 A Q a q 1: ) 3 = G Q [ e o y 2: " 2 B R b r 2: * 4 > H R \ f p z 3: # 3 C S c s 3: ! + 5 ? I S ] g q { 4: $ 4 D T d t 4: " , 6 @ J T ^ h r | 5: % 5 E U e u 5: # - 7 A K U _ i s } 6: & 6 F V f v 6: $ . 8 B L V ` j t ~ 7: ' 7 G W g w 7: % / 9 C M W a k u DEL 8: ( 8 H X h x 8: & 0 : D N X b l v 9: ) 9

Bandit10

Bandit10 Bandit Level 10 이번 level의 패스워드는 base64로 인코딩되어 있다. 간단히 base64 명령어를 이용하여 디코딩 후 패스워드를 얻을 수 있다. bandit10@bandit:~$ ls -al total 24 drwxr-xr-x 2 root root 4096 Nov 13 15:58 . drwxr-xr-x 29 root root 4096 Nov 13 15:57 .. -rw-r--r-- 1 root root 220 Sep 1 2015 .bash_logout -rw-r--r-- 1 root root 3771 Sep 1 2015 .bashrc -rw-r--r-- 1 root root 655 Jun 24 2016 .profile -rw-r----- 1 bandit11 bandit10 69 Nov 13 15:58 data.txt bandit10@bandit:~$ base64 -d data.txt The password is IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR

Bandit9

Bandit9 Bandit Level 9 data.txt 파일에서 = 으로 시작하는 문자열 중 이번 level의 패스워드가 있다. 우선 문자열 목록을 얻기 위해서는 strings 명령어를 사용해야한다. 그렇게 얻은 목록에서 grep 명령어를 이용하여 = 이 포함된 문자열을 추출해내면 패스워드를 확인할 수 있다. bandit9@bandit:~$ ls -al total 40 drwxr-xr-x 2 root root 4096 Nov 13 15:58 . drwxr-xr-x 29 root root 4096 Nov 13 15:57 .. -rw-r--r-- 1 root root 220 Sep 1 2015 .bash_logout -rw-r--r-- 1 root root 3771 Sep 1 2015 .bashrc -rw-r--r-- 1 root root 655 Jun 24 2016 .profile -rw-r----- 1 bandit10 bandit9 19379 Nov 13 15:58 data.txt bandit9@bandit:~$ strings data.txt | grep = == == == == == theOkM L = 8@ = hrV` == == == == == password == == == == == is H ) = QU > ] ".x = { = u/,i_ { = jh = GUl e = y: 4H5 = ) == == == == == truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk = /wW ~BX =

Bandit8

Bandit8 Bandit Level 8 data.txt 에서 중복되지 않는 문자열이 이번 level의 패스워드이다. 중복 제거를 위해서 흔히 sort 와 uniq 를 활용한다. uniq [-c/d/D/u][파일 명] c: 중복 수 출력 d: 중복 라인 중 한 열만 출력 D: 중복되는 모든 열 출력 u: 중복 열이 없는 열만 출력 bandit8@bandit:~$ ls -al total 56 drwxr-xr-x 2 root root 4096 Nov 13 15:58 . drwxr-xr-x 29 root root 4096 Nov 13 15:57 .. -rw-r--r-- 1 root root 220 Sep 1 2015 .bash_logout -rw-r--r-- 1 root root 3771 Sep 1 2015 .bashrc -rw-r--r-- 1 root root 655 Jun 24 2016 .profile -rw-r----- 1 bandit9 bandit8 33033 Nov 13 15:58 data.txt bandit8@bandit:~$ cat data.txt | sort | uniq -u UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR

Bandit7

Bandit7 Bandit Level 7 패스워드를 찾을 수 있는 단서 하나를 제공하고 있다. The password for the next level is stored in the file data.txt next to the word millionth grep 명령어를 이용하여 data.txt 파일에 저장된 millionth 문자열 위치를 찾고, 그 뒤에 삽입된 패스워드 를 확인한다. bandit7@bandit:~$ ls -al total 4108 drwxr-xr-x 2 root root 4096 Nov 13 15:58 . drwxr-xr-x 29 root root 4096 Nov 13 15:57 .. -rw-r--r-- 1 root root 220 Sep 1 2015 .bash_logout -rw-r--r-- 1 root root 3771 Sep 1 2015 .bashrc -rw-r--r-- 1 root root 655 Jun 24 2016 .profile -rw-r----- 1 bandit8 bandit7 4184396 Nov 13 15:58 data.txt bandit7@bandit:~$ grep -rn millionth ./data.txt 34210:millionth cvX2JJa4CFALtqS87jk27qwqGhBM9plV

Bandit6

Bandit6 Bandit Level 6 패스워드 파일을 찾을 수 있는 세 가지 단서를 제공하고 있다. owned by user bandit7 owned by group bandit6 33 bytes in size 이 정보를 조합하여 find 명령어를 구성하여 문제를 해결할 수 있다. -user [유저 명] -group [그룹 명] 2> /dev/null (/dev/null로 표준 에러 리다이렉트) bandit6@bandit:~$ find / -size 33c -user bandit7 -group bandit6 2 > /dev/null /var/lib/dpkg/info/bandit7.password bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs

Bandit5

Bandit5 Bandit Level 5 패스워드 파일을 찾을 수 있는 세 가지 단서를 제공하고 있다. human-readable 1033 bytes in size not executable 이 정보를 조합하여 find 명령어를 구성하여 문제를 해결할 수 있다. -size [+파일크기/-파일크기/파일크기][b/c/k/w] b: 블록단위 512kb, c: byte, k: kbyte, w: 2byte 워드 (default: b) -perm [-][권한] ([-]: 최소한) -exec [command] {} ; bandit5@bandit:~/inhere$ ls -al total 88 drwxr-x--- 22 root bandit5 4096 Nov 13 15:58 . drwxr-xr-x 3 root root 4096 Nov 13 15:58 .. drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere00 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere01 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere02 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere03 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere04 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere05 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere06 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere07 drwxr-x--- 2 root bandit5 4096 Nov 13 15:58 maybehere08 drwxr-x--- 2 root ba