메-모해봅시다.

Bandit Level 6 → Level 7 본문

리눅스/Over The Wire

Bandit Level 6 → Level 7

RollingPumpkin 2020. 5. 19. 23:03

Level Goal

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

Commands you may need to solve this level

ls, cd, cat, file, du, find, grep


목표

다음 단계로 가는 비밀번호는 서버 어딘가에 저장되었으며 다음 특성을 가집니다.

  • 사용자명 - bandit7
  • 소유 그룹명 - bandit6
  • 33바이트 크기

이 단계를 해결할 때 유용한 명령어

ls, cd, cat, file, du, find, grep



-어떻게 풀까?


일단 바로 ls -al 명령어를 이용해 존재하는 파일들을 살펴보았으나 별다른 단서가 보이지 않아 cd .. 명령어로 더 상위의 디렉토리로 이동해 ls -al을 사용해 대량의 디렉토리들을 찾았다.

 

이 중에서 문제에 제시된 조건을 이용해 find 명령어를 이용해 원하는 내용만을 찾아보자.

find -user, find -group, find -size 를 모두 사용해 탐색한 결과,

접근 권한이 거부된 다른 파일들이 잔뜩 나온다.

 

접근 권한이 없는 다른 파일들을 제쳐두고 권한을 가진 필요한 파일들만을 검색할 수단으로 2>/dev/null 이 있다.

/dev/null 이란, 블랙홀(휴지통)을 뜻하며 2standard error로 표준 에러 메세지를 뜻합니다.

즉, 에러 메세지들을 버리고 주어진 명령을 수행하도록 find 명령어 뒤에 붙여 사용해 줍시다.

깔끔하게 어디에 들었는지 경로를 안내해 주네요.

그 경로를 열어주면 다음 단계로 가는 비밀번호가 나옵니다.

HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs 를 알아내었으니 다음단계로 넘어가 줍니다.

ssh bandit7@bandit.labs.overthewire.org -p 2220

 

'리눅스 > Over The Wire' 카테고리의 다른 글

Bandit Level 8 → Level 9  (0) 2020.05.20
Bandit Level 7 → Level 8  (0) 2020.05.19
Bandit Level 5 → Level 6  (0) 2020.05.09
Bandit Level 4 → Level 5  (0) 2020.05.08
Bandit Level 3 → Level 4  (0) 2020.05.08