OverTheWire : Bandit Level 4 → Level 5

heuniy·2023년 9월 24일

bandit_write up

목록 보기
6/10

문제

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

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.

passwordinhere 디렉토리에 사람이 읽을 수 있는 파일 안에 있다.


풀이

cd 명령어로 inhere 디렉토리에 들어간다.

ls 명령어로 목록을 출력한다.

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

파일 여러개가 있음을 알 수 있다.


file 명령어를 사용해서 파일 종류를 확인한다.

file : 파일 종류 확인

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

-file07ASCII 타입으로 되어있다.

data 타입은 사람이 읽을 수 없다.


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

passwordlrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR 이다.


기타

리눅스 명령어 정리 (누적)

pwd : 현재 작업중인 디렉토리 정보(경로) 출력

ls : 디렉토리 목록 확인

  • ls -a : 모든 파일(숨겨진 파일 혹은 디렉토리)을 출력

cat [파일명] : [파일명] 내용 출력

  • cat ./[파일명] : 현재 디렉토리에 있는 [파일명] 내용을 출력
  • cat '[파 일 명]' : space가 있는 [파일명] 내용 출력
  • cat [파\ 일\ 명] : space가 있는 [파일명] 내용 출력

file [파일명] : [파일명] 종류(타입) 확인

profile
고양이 귀여워

0개의 댓글