Level 6 → Level 7

옥영진·2020년 5월 16일
0

Bandit - OverTheWire

목록 보기
7/33

Level 6 → Level 7

목표

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 bytes

해결

find / -user bandit7 -group bandit6 -size 33c 2>/dev/null

find 명령어를 통해 루트(/) 디렉토리에서부터 위 속성을 가지고 있는 파일을 찾는다. 명령어 끝에 2>/dev/null은 표준 에러 출력을 하지 않는다는 것을 의미한다. 파일을 찾고 cat 명령어를 사용하여 파일 내용을 출력하면 다음 레벨로 가는 패스워드를 얻을 수 있다.

  • find
    find 명령어는 말 그대로 파일 및 디렉토리를 검색할 때 사용하는 명령어다.
profile
안녕하세요 함께 공부합시다

0개의 댓글