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
maybehere01 maybehere04 maybehere07 maybehere10 maybehere13 maybehere16 maybehere19
maybehere02 maybehere05 maybehere08 maybehere11 maybehere14 maybehere17
bandit5@bandit:~/inhere$ find * -size 1033c
maybehere07/.file2
bandit5@bandit:~/inhere$ cat maybehere07/.file2
#비밀번호
inhere 디렉토리 안에 다른 디렉토리가 많고 그 안에 파일 중에서 조건에 맞는 파일을 찾는 것이 핵심이므로 조건에 맞는 파일을 찾는 명령어인 find 명령어를 사용하고자 하였다. 가장 찾기 쉬운 조건인 size를 이용하여 출력하자 파일을 바로 발견할 수 있었다.
+ 파일 크기를 기준으로 할 때 size 다음에 단위에 유의해야한다. 입력하지 않으면 블럭 단위라고 판단하기 때문에 c를 붙여야 바이트 단위로 판단하여 출력한다.
'wargame > bandit' 카테고리의 다른 글
Level 7 → Level 8 (0) | 2019.02.14 |
---|---|
Level 6 → Level 7 (0) | 2019.02.14 |
Level 4 → Level 5 (0) | 2019.02.14 |
Level 3 → Level 4 (0) | 2019.02.14 |
Level 2 → Level 3 (0) | 2019.02.14 |