문제 링크 : overthewire.org/wargames/bandit/bandit2.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 called - located in the home directory Commands you may need to solve this level ls, cd, cat, file, du, find Helpful Reading Material
overthewire.org
Level 1 : boJ9jbbUNNfktd78OOpsqOltutMc3MY1
Hint
The password for the next level is stored in a file called - located in the home directory
→ 다음 레벨의 패스워드는 홈 디렉터리의 - 폴더에 저장됩니다.
사용 명령어
ls, cd, cat, file, du, find
풀이 방법
1. bandit1 홈 디렉터리의 파일 상세 정보 확인 → - 라는 이름의 파일 존재(dashed filename)

* 파일 이름이 "-" 인 경우, 리눅스에서는 표준 입/출력을 참조하는 것으로 인식한다.(/dev/stdin과 /dev/stdout) 때문에, 일반적인 파일 명령어로 "-" 이름을 가진 파일을 참조할 수 없다. 이 경우 위치를 참조한다는 것을 명시하여 접근해야 한다.(절대경로 또는 상대경로)
* 파일 이름의 앞에 "-" 가 들어가는 경우, "--"(double dashed)를 입력하여 명령어 옵션의 끝을 알리고 그 뒤에 "-" 로 시작하는 파일 이름을 명시한다.(Ex. cat -- -filename)

* 표준입출력에서 입력을 받는 경우 리디렉션(입출력 재지정)을 통해 파일을 참조할 수 있다.(Ex. cat < -)

2. 현재 위치를 기준으로 - 파일을 열어서 bandit2의 패스워드 확인

3. bandit 2 : CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9
'공부 > Bandit' 카테고리의 다른 글
[Bandit] Level 4 → Level 5 (0) | 2021.01.26 |
---|---|
[Bandit] Level 3 → Level 4 (0) | 2021.01.22 |
[Bandit] Level 2 → Level 3 (0) | 2021.01.21 |
[Bandit] Level 0 → Level 1 (0) | 2021.01.19 |
댓글