Bandit Level 8 -> Level 9

Gunter·2023년 7월 27일
0

OverTheWire - Bandit

목록 보기
9/13

Level Goal
The password for the next level is stored in the file data.txt annd is the only line of text that occurs only once
다음 레벨을 위한 패스워드는 data.txt 파일에 저장되어 있지만, 단 한 번만 나타난다.

Helpful Reading Material
유닉스 명령줄 : 파이프 그리고 디다이렉트
the unix commandline : pipes and redirects
https://love-every-moment.tistory.com/52

grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd

ls -al 홈 디렉토리 확인 후 데이터 텍스트 파일을 열어보았는데
...
저 캡쳐본보다 훨씬 긴 파일이 들어있었다.

어떻게 비밀번호만 쏙 골라내지 생각했었는데

문제에 단 한번만 나타난다고 되어있는걸 확인했다.

정렬 후에 각 문자열이 몇 번 나타나는지 확인해보았다.
cat은 파일의 내용을 sort로 전달하고, sort는 그 내용을 오름차순으로 정렬하여 uniq에게 전달하고, uniq는 연속으로 중복되는 값들을 제거 후에 중복 횟수를 카운팅(-c)하여 결과를 출력했다.

EN632PlfYiZbn3PhVK3XOGSlNInNE00t

https://www.lesstif.com/lpt/linux-uniq-95879394.html

profile
YSKM

0개의 댓글