Over the Wire/Bandit

[Bandit] OverTheWire : bandit level 0 → 5

ruming 2021. 1. 31. 17:13

 

Level 0

bandit 접속하기

 

putty로 접속하겠다.

호스트에는 bandit.labs.overthewire.org를 입력, port에는 2220을 입력하고 connection type은 SSH로 체크하면 된다.

 

id와 password에 모두 bandit0을 입력하면 서버접속 성공이다.

 


Level 0 Level 1

The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game.

 

ls, cd, cat, file, du, find

 

비밀번호가 있는 readme 파일을 찾아 읽으면 될 것 같다.

 

ls 명령어로 살펴보니 readme 파일이 있는 것을 발견했다.

cat 명령어로 읽자 다음 레벨로 가는 비밀번호가 나왔다.

boJ9jbbUNNfktd78OOpsqOltutMc3MY1

 

 

명령어 
ls : 디렉토리 리스트
cd : 경로 이동
cat : 파일 내용 보기 / 파일을 지정하지 않으면 표준 입력 내용을 그대로 출력한다.
file : 파일의 타입을 확인
du : 디렉토리나 사용자별 디스크 사용량을 확인할 때 사용
find : 특정 파일이나 디렉토리를 검색

 


Level 1 → Level 2

The password for the next level is stored in a file called - located in the home directory

 

ls, cd, cat, file, du, find

 

홈 디렉터리에 있는 -파일에 비밀번호가 들어 있다.

cat 명령어로 읽어보려 했는데 특수문자라 그런지 열리지 않았다.

이럴 때는 절대 경로로 표현하면 된다.

 

 

cat ~/- 을 입력하니 다음 비밀번호가 나왔다.

CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

 


Level 2 → Level 3

The password for the next level is stored in a file called spaces in this filename located in the home directory

 

ls, cd, cat, file, du, find

 

리눅스에서는 공백을 포함한 이름을 허용하지 않는데 이 파일 이름은 spaces in this filename으로 말 그대로 공백이 포함되어 있다.

공백이 포함된 파일은 어떻게 처리해야 하나 구글링해보니 파일 앞뒤에 큰따옴표(")를 붙이면 된다고 한다.

cat "spaces in this filename" 으로 비밀번호를 얻는 데 성공했다.

 

 

UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK

 


Level 3 → Level 4

The password for the next level is stored in a hidden file in the inhere directory.

 

ls, cd, cat, file, du, find

 

이번에는 디렉토리 안에 숨겨진 파일이 존재한다고 한다. cd 명령어로 inhere 디렉토리에 들어간 다음 ls 를 했는데 아무것도 나오지 않아 ls -a 를 쳤더니 숨겨진 파일이 보였다. cat .hidden 으로 비밀번호를 얻을 수 있었다.

ls에서 -a 옵션은 숨겨진 파일을 포함한 모든 파일을 리스트한다.

 

 

pIwrPrtPN36QITSp3EQaw936yaFoFgAB

 


Level 4 → Level 5

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.

 

ls, cd, cat, file, du, find

 

이번에도 마찬가지로 inhere 디렉토리로 들어가 파일을 리스트했는데 10개의 파일이 있었다.

특수기호가 포함되어 있었으므로 절대경로를 붙여서 읽어보니 대부분 이상한 문자로 적혀있었다.

하나씩 읽어서 암호가 들어있는 파일을 찾아봤는데 7번째에 찾을 수 있었다. 다른 두 개의 파일도 이상한 문자였다.

 

 

koReBOKuIDDepwhWk7jZC0RTdopnAYKh

 

지금까지 level 0 → level 5 까지 풀어보았다. 다음 포스팅은 level 5 → level 10 으로 돌아오겠다.

 

'Over the Wire > Bandit' 카테고리의 다른 글

[Bandit] OverTheWire : bandit level 5 → 10  (0) 2021.02.05