본문 바로가기

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:~$ grep -a '=' data.txt
#데이터
bandit9@bandit:~$ strings data.txt | grep '='
#문자열

파일을 grep을 이용해서 출력하려하면 binary file이라서 안된다고 한다. -a 옵션을 사용하여 해당 파일을 텍스트 파일로 인식하도록 하였다. 하지만 여전히 깨진 상태로 출력되어 비밀번호를 찾기 힘들었다. 구글링 결과 이진 파일에서 문자열만 추출할 수 있는 명령어인 string을 발견하여 출력하였다.

'wargame > bandit' 카테고리의 다른 글

Level 11 → Level 12  (0) 2019.02.20
Level 10 → Level 11  (0) 2019.02.20
Level 8 → Level 9  (0) 2019.02.14
Level 7 → Level 8  (0) 2019.02.14
Level 6 → Level 7  (0) 2019.02.14