본문 바로가기

OverTheWire : Bandit Level8 -> Level 9

@rn1p4st2023. 1. 21. 01:02
반응형

https://overthewire.org/wargames/bandit/bandit9.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 the file data.txt and is the only line of text that occurs only once Commands you may need to solve this level grep, sort, uniq, strings, base64,

overthewire.org

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.

 

풀이

data.txt 파일에 단 한가지의 유효한 FLAG 패스워드가 존재한다고 한다. 찾아주면 된다.

data.txt를 읽어보면, 수많은 문장들이 존재한다. 여러 시행착오를 겪어보니 수많은 문장들이 거의 다 중복된 문장들이며, 그 문장들의 순서가 바뀌어 있기 때문에 알기 힘들었던 것이다.

sort 커맨드를 통해 data.txt파일을 정렬하면 수많은 문자들이 중복되어 있는 것을 확인할 수 있다. 이중에 FLAG는 하나만 존재하니 중복된 문장들을 제거해주면 된다.

여기서 알게된 지식 : sort는 행단위(문장 단위)로 정렬을 해준다.

uniq는 중복된 문장을 제거해주는 명령어 이다. '|' 파이프를 통해서 정렬 후에 중복된 문장을 제거하도록 커맨드를 실행해주면 FLAG를 획득할 수도 있다.

여기서 알게된 지식 : uniq는 중복된 문장을 제거해주는 명령어. 중복된 문장을 제외한 문장을 출력해주는 옵션은 -u이다.

 

더보기

EN632PlfYiZbn3PhVK3XOGSlNInNE00t

 

반응형
rn1p4st
@rn1p4st :: 푸들푸들

RECORD STUDY

목차