문제
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
## 문제 요구사항
human-readable 사람이 읽을 수 있고
1033 bytes in size 사이즈는 1033 바이트
not executable 실행 불가능한 권한
## 내가 사용한 명령어
ssh bandit5@bandit.labs.overthewire.org -p 2220
find inhere/ -type f -size 1033c ! -executable
cat 검색결과
## 왜 이 명령어를 골랐는가
find inhere/ inhere에서 찾아라
-type f 파일 타입만 검색
-size 1033c 사이즈 1033 byte (byte은 c로, kb는 k, block은 512bytes이고 b로 표기)
! -executable rwx 중 실행 비트(x)가 없어야 한다.
아래도 동일한 결과를 표시함.
find inhere/ -type f -size 1033c ! -perm /111
## 다음 단계에서 쓸 수 있는 패턴은 무엇인가
! -executable → 현재 사용자 기준 실행 불가능한 파일만 검색
/ = “이 퍼미션과 하나라도 겹치면 참으로 취급”
-perm /111 → owner/group/others 중 누가 x 권한을 하나라도 갖고 있으면 매칭
! -perm /111 → owner/group/others 모두 실행(x) 권한이 없어야 매칭

'Security > OverTheWire' 카테고리의 다른 글
| Bandit Level 7 → Level 8 (grep) (0) | 2025.12.01 |
|---|---|
| Bandit Level 6 → Level 7 (find, 2>/dev/null) (0) | 2025.12.01 |
| Bandit Level 4 → Level 5 (file 명령어) (0) | 2025.12.01 |
| Bandit Level 3 → Level 4 (숨김 파일) (0) | 2025.12.01 |
| Bandit Level 2 → Level 3 (공백 처리) (0) | 2025.12.01 |