본문 바로가기

wargame/bandit

Level 9 → Level 10 Level Goal The password for the next level is stored in the file data.txt in one of the few human-readable strings, beginning with several ‘=’ characters. 비밀번호는 몇 개의 '='문자로 시작하는 몇 개의 human-readable 문자열로 data.txt 파일에 저장되어 있다 Code bandit9@bandit:~$ grep '=' data.txt Binary file data.txt matchesbandit9@bandit:~$ file data.txt # file의 타입 확인 data.txt: data # 텍스트 파일의 경우 ASCII text로 출력된다 bandit9@bandit..
Level 8 → Level 9 Level Goal The password for the next level is stored in the file data.txt and is the only line of text that occurs only once 비밀번호는 data.txt 파일에 저장되어 있으며 한 번만 입력된 유일한 텍스트 줄이다 Code bandit8@bandit:~$ cat data.txt | sort -r | uniq -u #비밀번호 즉 한 문장을 제외하면 전부 중복된 문장이란 의미이므로 중복되는 줄을 제거하기로 하였다. 구글링 결과 uniq 명령어를 발견하여 실행하였다. u옵션은 중복된 줄을 제외하고 출력하는 옵션이다
Level 7 → Level 8 Level Goal The password for the next level is stored in the file data.txt next to the word millionth 비밀번호는 data.txt 파일의 millionth 단어 옆에 저장되어 있다 Code bandit7@bandit:~$ cat data.txt #데이터 bandit7@bandit:~$ grep millionth data.txt #비밀번호 처음에는 data.txt 파일을 출력했는데 결과가 너무 많았다. 파일 속에서 단어가 포함된 줄을 출력하기로 하고 grep 명령어를 이용하여 출력하였다
Level 6 → Level 7 Level Goal The password for the next level is stored somewhere on the server and has all of the following properties: owned by user bandit7 owned by group bandit6 33 bytes in size 비밀번호는 서버 어딘가에 저장되어 있고 다음과 같은 속성을 모두 가지고 있다 Code bandit6@bandit:~$ find / -size 33c #데이터 bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c -exec cat {} \; #비밀번호 Level 5의 확장 버전이어서 똑같이 find 명령어를 사용하였다. 다만 서버..
Level 5 → Level 6 Level Goal The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties: human-readable 1033 bytes in size not executable 비밀번호는 inhere 디렉토리 아래 어딘가에 저장되어 있고 다음과 같은 속성을 모두 가지고 있다 Code bandit5@bandit:~$ cd inhere bandit5@bandit:~/inhere$ ls maybehere00 maybehere03 maybehere06 maybehere09 maybehere12 maybehere15 maybehere18 maybeher..
Level 4 → Level 5 Level Goal The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command 비밀번호는 inhere 디렉토리에 사람이 읽을 수 있는 파일에만 저장되어 있다 tip: 터미널이 복잡하면, reset 명령어를 사용하자 Code bandit4@bandit:~$ cd inhere bandit4@bandit:~/inhere$ ls -file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09 bandit4@ban..
Level 3 → Level 4 Level Goal The password for the next level is stored in a hidden file in the inhere directory 비밀번호는 inhere 디렉토리의 숨겨진 파일에 저장되어 있다 Code bandit3@bandit:~$ ls inhere bandit3@bandit:~$ cd inhere bandit3@bandit:~/inhere$ ls -al total 12 drwxr-xr-x 2 root root 4096 Oct 16 14:00 . drwxr-xr-x 3 root root 4096 Oct 16 14:00 .. -rw-r----- 1 bandit4 bandit3 33 Oct 16 14:00 .hidden bandit3@bandit:~/inhere$ ca..
Level 2 → Level 3 Level Goal The password for the next level is stored in a file called spaces in this filename located in the home directory 비밀번호는 홈 디렉토리의 spaces in this filename 파일에 저장되어 있다 Code bandit2@bandit:~$ ls spaces in this filename bandit2@bandit:~$ cat spaces\ in\ this\ filename #비밀번호 bandit2@bandit:~$ cat "spaces in this filename" #비밀번호 파일 이름에 공백이 포함되어 있는 경우, 첫 단어를 입력한 후 tab를 누르면 파일의 나머지 부분을 자동으로 입력할 ..