본문 바로가기

리눅스/리눅스 페도라 Bandit - OverTheWire

OverTheWire Bandit Level 0~6

리눅스 페도라 bandit Level 0~6 문제풀이

Bandit Level 0

The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1.

(이 레벨의 목표는 SSH를 사용하여 게임에 로그인하는 것입니다. 연결해야 하는 호스트는 포트 2220의 bandit.labs.overthewire.org입니다. 사용자 이름은 bandit0이고 암호는 bandit0입니다. 로그인한 후 레벨 1 페이지로 이동하여 레벨 1을 이기는 방법을 확인하십시오.)

홈 디렉터리에서 밑줄 친 부분을 복사 붙여넣기 한 후 2번째로 밑줄 쳐진 password에 bandit0입력 (password 칸에는 입력을 해도 보이지 않으니 주의)

Bandit 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.

다음 단계의 암호는 홈 디렉토리에 있는 readme라는 파일에 저장됩니다. SSH를 사용하여 bandit1에 로그인하려면 이 암호를 사용합니다. 수준 암호를 찾을 때마다 SSH(포트 2220)를 사용하여 해당 수준에 로그인하고 게임을 계속합니다.

파일 목록 출력 명령어 ls를 사용하여 readme 파일이 있는지 확인 후 파일 내용 출력 명령어 cat을 사용하여 readme 파일 안에 있는 password를 확인한다.

파일 목록 출력 명령어인 ls를 사용하여 readme파일이 있는지 확인 후 파일 내용 출력 명령어 cat을 사용하여 password를 확인한다

Bandit Level 1 → Level 2

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

다음 수준의 암호는 홈 디렉토리에 있는 -라는 파일에 저장됩니다.

ls를 사용하여 -파일이 있는지 확인 후 -는 옵션이기 때문에 파일임을 나타내주기 위해 ./를 사용하여 경로를 지정해줌

password를 확인 할 수 있음 

ls를 사용하여 -파일이 있는지 확인 -는 옵션이기 때문에 cat -는 -파일을 읽을 수 없으므로 ./를 사용하여 파일 경로를

지정 해주면 암호를 얻을 수 있다.

Bandit 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를 사용하여 파일확인 공백이 있기 때문에 4개의 파일인지 하나의 파일인지 확인하기 위해 파일의 상세 정보 출력

옵션 -l을 사용하여 확인 명령어 cat을 사용할때 역시 공백이 있기 때문에 공백사이에 \(역슬래쉬)를 사용하여 공백을 인식하도록 한다.

 

Bandit Level 3 → Level 4

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

다음 수준의 암호를 숨겨진 파일에 있는inhere 디렉터리에 저장됩니다.

ls를 통하여 inhere이 디렉토리 파일인 것으 확인 cd inhere를 사용하여 들어간 뒤 ls를 사용한 뒤 아무것도 나오지 않음 

숨겨진 파일을 찾을 수 있도록 옵션 -al을 사용하여 .hidden파일을 찾은 뒤 확인하여 password를 얻는다.

Bandit 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.

다음 단계의 암호는 inhere 디렉토리에서 사람이 읽을 수 있는 유일한 파일에 저장됩니다. 팁: 단말기가 고장 나면 "reset" 명령을 사용해 보십시오

ls를 사용하여 디렉토리 파일 inhere 확인 후 그 안에서 ls를 다시 입력 많은 파일이 나오게 되는데

cat ./-file0?(-file0으로 시작하는 파일 모두 읽기)또는 cat ./*(모든 파일 읽기)을 사용하면 파일을 읽고 password를 확인 할 수 있음

Bandit Level 5 → Level 6

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 디렉토리 아래의 파일에 저장되며 다음 속성을 모두 가집니다.

사람이 읽을 수 있음
크기 1033바이트
실행 불가

ls를 확인하여 디렉토리 파일 inhere 확인 후 그 안에서 ls -l 입력 무수히 많은 파일이 나오는데 find라는 명령어를 사용하여 주어진 조건과 함께 find ./ -size 1033c를 입력하면 그에 맞는 파일이 나온다 cat명령어를 사용하여 읽어주면 암호가 나온다.

Bandit Level 6 → Level 7

The password for the next level is stored somewhere on the server and has all of the following properties:

  • owned by user bandit7
  • owned by group bandit6
  • 33 bytes in size

다음 단계의 암호는 서버의 어딘가에 저장되며 다음 모든 속성을 가집니다.

사용자 bandit7이 소유

그룹 bandit6이 소유

33바이트의 크기

서버 어딘가에 저장되기 때문에 cd /를 사용하여 최상위 디렉토리로 이동하여 주어진 조건에 맞게

find -user bandit7 -group bandit6 -size 33c를 사용하여 파일을 찾으면 무수히 많은 권한이 없는 파일(에러가 남)이 뜬다 그중에서 권한이 있는 파일을 찾아 암호를 확인 할 수 있지만 2>dev/null을 사용하면 에러가 나지 않은 파일을 찾게 된다 

사진과 같이 find -user bandit7 -group bandit6 -size 33c 2>dev/null를 사용하여 에러가 나지 않은 파일을 찾고 cat을 사용하여 읽는다면 암호를 획득 할 수 있다. HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs
 

'리눅스 > 리눅스 페도라 Bandit - OverTheWire' 카테고리의 다른 글

Bandit Level 11 → Level 12  (0) 2022.04.17
Bandit Level 10 → Level 11  (0) 2022.04.14
Bandit Level 9 → Level 10  (0) 2022.04.14
Bandit Level 8 → Level 9  (2) 2022.04.14
Bandit Level 7 → Level 8  (0) 2022.04.13