[Bandit-OverTheWire] Level 4 -> Level 5

두비니

·

2020. 9. 18. 06:46

 

Bandit 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.

Commands you may need to solve this level

ls, cd, cat, file, du, find

 

bandit4@bandit:~$ ls
inhere
bandit4@bandit:~$ cd inhere/
bandit4@bandit:~/inhere$ ls
-file00  -file02  -file04  -file06  -file08
-file01  -file03  -file05  -file07  -file09

 

디렉토리 확인해보면 파일이 총 10개 들어가있습니다. 물론 10개 다 열어봐도 상관은 없다만 file명령어를 이용합시다.

 

bandit4@bandit:~/inhere$ file --help
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.

      --help                 display this help and exit
  -v, --version              output version information and exit
  -m, --magic-file LIST      use LIST as a colon-separated list of magic
  
  ...(생략)
  
  -f, --files-from FILE      read the filenames to be examined from FILE
  -F, --separator STRING     use string as separator instead of `:'
  -i, --mime                 output MIME type strings (--mime-type and
                               --mime-encoding)
      --apple                output the Apple CREATOR/TYPE
      --extension            output a slash-separated list of extensions
      --mime-type            output the MIME type
      --mime-encoding        output the MIME encoding
 
 ...(생략)

 

명령어 뒤에 --help를 붙이면 사용법을 다 알려줍니다.

대충 보니까 -F 옵션이 대충 string가지고 뭔가 나눠준다는거 같네요. 이거 씁시다.

 

bandit4@bandit:~/inhere$ file -F ./-file*
./-file01./-file00 data
./-file02./-file00 data
./-file03./-file00 data
./-file04./-file00 data
./-file05./-file00 data
./-file06./-file00 data
./-file07./-file00 ASCII text
./-file08./-file00 data
./-file09./-file00 data

 

보면 file07만 ascii text로 이루어져있는걸 알 수 있죠?

 

 

bandit4@bandit:~/inhere$ cat ./-file07
koReBOKuIDDepwhWk7jZC0RTdopnAYKh

 

 

끝!

 

password : koReBOKuIDDepwhWk7jZC0RTdopnAYKh