해킹&보안

[반딧 워게임 : OverTheWire] Level 17 -> 18 (리눅스/해킹/보안 공부)

yamaeking 2025. 3. 17. 18:02

자 오늘은 Level 17 -> 18을 해보도록 하겠다. 

(Login ID :  bandit17 /  Password : EReVavePLFHtFlFsjn3hyzMlvSuSAcRD

 

1. 문제 내용

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

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> Level Goal There are 2 files in the homedirectory: passwords.old and passwords.new. The password for the next level is in passwords.new and is the only line t

overthewire.org

 

 

 

 -> home 디렉토리에 passwords.old 와 passwords.new 라는 파일이 있다고 한다. 비밀번호는 passwords.new 에 있고, passwords.old 와 password.new 중에서 딱 한 줄만 바뀐 것이라고 한다. 

2. 문제 풀이

 -> ls -al 을 해보니 두 파일이 나왔고, 크기는 3300 바이트, 파일 형식은 ASCII text, 그리고 위와 같이 수많은 해쉬값으로 이루어져 있다. 두 파일을 비교했을 때 다른 라인이 비밀번호 같다. 다음의 명령어를 입력해보자.

 

diff passwords.new passwords.old

 

 -> diff : 두 파일의 차이점을 line 단위로 비교해서 출력해 주는 명령어이다. 출력 결과를 해석하자면

 

< 첫 번째 파일(new)의 내용

---

> 두 번째 파일(old)의 내용

 

즉 두 파일을 비교했을 때 다른 라인이 저렇게 나오는데, 그 중에서 비밀번호는 new 에 있다고 하였으니 x2g~로 시작하는 것이 비밀번호라고 볼 수 있겠다!

 

3. 요약

☞ diff : 두 파일을 줄 단위로 비교하면서 다른 것이 있으면 출력해 주는 명령어!