본문 바로가기
CTF/Bandit

Bandit Level 9 → Level 10 [9/34]

by LimSeongHyeon 2025. 6. 22.
 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> Level Goal The password for the next level is stored in the file data.txt and is the only line of text that occurs only once Commands you may need to solve th

overthewire.org

 

The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several ‘=’ characters.

 

문제를 보면 data.txt에 비밀번호가 있고, human-redable strings 형태로 있는데 여러개의 = 근처에 있는 모양이다.

 

 

우선 디렉터리부터 탐색

$ bandit9@bandit:~$ ls
data.txt

 

 

cat으로 양상이 어떤식인지 확인해본다

$ bandit9@bandit:~$ cat data.txt
...
�:���[Gm�qs���m�        ��c
�␦���t��g���~����ڼ?as�cl�g�K#��F��$*�;��#��V��*��Z;�u��v*���e}��v�c
U6���o�x�V]�!�Xq�є��S�y�������m
c�"��l>IF<¨"��ʋM���GHof/;��␦)
��8".�x�5Q���_Fo�b`��d���/��^8m�7���]
���{�uG_V����fJ<�ʐ|e�B�Z(+���&X����F՚���T�@Ǿ=˚I�3s��8���jʿs3v�^t��
�D�␦��*�U��>��ZaW����N͔�O6���␦=#�}�x␦����8L�{�4k�֒��R�6�v!x�F"��֏�,~襪

확인조차 불가능한 문자열로 가득 차있다.

 

 

우선 man strings로 쓸만한 옵션들을 확인해보자.

-s
--output-separator
	By default, output strings are delimited by a new-line. This option allows you to supply any string to  be
	used  as the output record separator.  Useful with --include-all-whitespace where strings may contain new-
	lines internally.

우선 separator 옵션으로 =가 들어있는걸 좀 확인해보면 좋지 않을까 싶어 사용해 보았다.

 

 

결과를 보아하니 "="뭉치를 혼동될 수 있게 여기저기 넣어놓은 모양이다.

 

 

다른 옵션이 있나 man strings로 옵션들을 다시 확인해보자.

이렇게 encoding되는 문자열을 출력해주는 옵션을 찾았다. 해당 경우에는 default가 아닐까 싶어 옵션을 사용해보았다.

 

$ strings -U d data.txt

 

 

결과를 스크롤 하다보면 비밀번호 처럼 생긴 문자열을 발견할 수 있다. 조금더 다듬어 보자면.

$ strings -U d data.txt | grep "=="

 

 

Hit !

'CTF > Bandit' 카테고리의 다른 글

Bandit Level 8 → Level 9 [8/34]  (0) 2025.05.28
Bandit Level 7 → Level 8 [7/34]  (0) 2025.05.28
Bandit Level 6 → Level 7 [6/34]  (0) 2025.05.28
Bandit Level 5 → Level 6 [5/34]  (0) 2025.05.28
Bandit Level 4 → Level 5 [4/34]  (0) 2025.05.27