본문 바로가기

정보보안/Wargame(Bandit)

Bandit Level 24 → Level 25

A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.

 

daemon이 30002포트 리스닝을 하고 있고, bandit24 계정의 비밀번호와 4자리의 비밀번호(0000~9999)를 입력하면 bandit25계정의 비밀번호가 주어진다고 한다.

일일이 하나하나 다 해볼 순 없으니... 쉘스크립트를 직접 만들어서 해결해야 한다.

 

우선 /tmp에 대충 작업공간 하나 만들어 주고, 거기에 쉘 스크립트 파일을 생성한 후,

num.txt에 bandit24 계정 비밀번호와 0~9999까지의 숫자 조합들을 저장한다.

실행 권한(대충 777 주자)을 주고 실행한다. 

그럼 num.txt에 모든 조합들이 저장된다.

이제 이 num.txt를 cat 명령으로 열고, nc 명령어에 대입 한 후, sort 명령어로 출력된 것들을 정렬하고, uniq -u로 중복된 내용을 제거하면 bandit25의 비밀번호가 나온다. (좀 시간이 걸린다. 최대 10000가지 경우이다 보니...)

 

'정보보안 > Wargame(Bandit)' 카테고리의 다른 글

Bandit Level 29 → Level 30  (0) 2021.12.19
Bandit Level 28 → Level 29  (0) 2021.12.19
Bandit Level 27 → Level 28  (0) 2021.12.19
Bandit Level 26 → Level 27  (0) 2021.12.19
Bandit Level 25 → Level 26  (0) 2021.12.19