wargame/bandit

bandit 4 -> 5

inthewhiteshadow 2024. 4. 30. 04:37

https://overthewire.org/wargames/bandit/bandit5.html

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> 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 “r

overthewire.org

 

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

 

이번에는 inhere 디렉토리에 사람이 읽을 수 있는 파일에 저장되어 있다고 한다. 그리고 만약 터미널이 너무 지저분해졌다면 reset 명령어로 청소하라고 한다.

 

inhere 디렉토리 안의 파일을 살펴보면 여러가지가 있다. 물론 하나하나 다 출력해서 확인해볼수도 있겠지만, file 명령어를 이용하면 간단하게 파일의 정보를 알아낼 수 있다.

/inhere 파일 안으로 먼저 이동한 뒤 (물론 이동하지 않아도 할수는 있다. 다만 경로지정이 복잡해지기 때문에 이동하는것)

file ./*

명령어를 실행해준다.

이 명령어는 현재 디렉토리에 있는 모든 파일의 정보를 출력하라는 것이다. file은 명령어 자체이고 './' 문자들은 현재 디렉토리를 나타내며, '*' 문자는 모든 파일을 지칭하는 문자이다. 그래서 현재 디렉토리에 있는 모든 파일의 정보를 출력하라는 명령어가 되는 것이다. 따라서 출력된 내용이 위에 있다. 그 중에 다른 것들은 다 data인데 '-file07'만 ASCII text라고 되어 있다. 아스키 텍스트는 사람이 읽을 수 있는 형태의 데이터이기 때문에 이것을 출력하면 비밀번호가 나온다.