아임노드

[OverTheWire Bandit] Bandit Level 17 -> Level 18 문제풀이 (+두 파일 비교하기) 본문

[SK shieldus Rookies 23기] 공부 노트/OverTheWire Bandit 문제풀이

[OverTheWire Bandit] Bandit Level 17 -> Level 18 문제풀이 (+두 파일 비교하기)

Noody 2024. 12. 11.

OverTheWire Bandit

Level 17 -> Level 18

 

 

목표 : 두 파일의 차이를 비교하기

  • 두 파일의 차이 비교하기

 

풀이 방법

 

1. bandit17 서버 접속

ssh bandit17@bandit.labs.overthewire.org -p 2220

 

 

2. 두 파일의 차이 비교하기

먼저 ls로 파일을 확인한다.

 

패스워드는 passwords.new에서 password.old와 다른 유일한 line이라고 했다.

따라서, diff 명령어를 사용하도록 한다.

diff passwords.old passwords.new

 

출력결과는 아래와 같이 나온다.

여기서 < 이후 글자가 old에서 유일한 line이 되고

> 이후 글자 가 new 파일에서 유일한 line이 된다.

 

만일 차이가 나는 라인이 많이 출력된다면

grep를 써서 > 만 확인해볼 수 있다.

diff passwords.old passwords.new | grep '>'

 

*** NOTE: if you have solved this level and see ‘Byebye!’ when trying to log into bandit18, this is related to the next level, bandit19

문제에서 다음 레벨에 접속하면 'Byebye' 문구와 함께 자동으로 종료된다고 알려주고 있다.