본문 바로가기

OverTheWire : Bandit Level 5 -> Level 6

@rn1p4st2023. 1. 15. 21:09
반응형

https://overthewire.org/wargames/bandit/bandit6.html

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. Level Goal 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 Commands yo

overthewire.org

Level Goal

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 디렉토리 내부 어딘가에 FLAG 파일이 존재하는데, 아래 제시된 파일 속성들을 통해서 찾는 문제인 것 같다.

inhere 디렉토리 내부를 보니까 수많은 디렉토리가 존재하고, 그 하위 디렉토리가 계속 존재하는 것을 확인할 수 있다.

위에 세가지 속성 중에서 사람이 읽을 수 있고, 실행 가능하지 않다? 이거는 어떻게 찾을 지 모르겠으니, 파일의 크기가 1033byte인 조건으로 찾아보자.

find 커맨드로 1033byte인 파일 하나를 찾을 수 있다. 해당 파일을 열어보자.

성공적으로 FLAG를 획득할 수 있다.

더보기

P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU


find 커맨드

리눅스 시스템에서 파일을 검색할 때 사용하는 커맨드 이다.

fidn [옵션] [경로] [표현식]

 

size를 통해서 파일을 찾는 방법

-size 표현식을 사용한다.

n(파일 이름) : n 크기의 파일

+n : n크기보다 용량이 더 큰 파일

-n : n보다 크기가 더 작은 파일

 

사이즈 단위

b: 블록단위

c: byte

k: kbyte

w: 2byte

 

커맨드 예시는 아래와 같다.

file ./* -size 1033c
반응형
rn1p4st
@rn1p4st :: 푸들푸들

RECORD STUDY

목차