[OverTheWire] Bandit Level 9 -> Level 10

King's meow·2023년 11월 18일

[Linux] 리눅스 공부

목록 보기
10/17
post-thumbnail

🤔 문제

Level Goal

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.

✅ 풀이

strings

  • 이진 파일에서 사람이 읽을 수 있는 문자열을 추출하는 데 사용

| (파이프)

  • 한 명령어의 출력을 다른 명령어의 입력으로 연결하는 데 사용

grep

  • 텍스트에서 패턴을 검색하는 데 사용x

"^=="

  • ^== 패턴을 사용하여 문자열의 시작이 '=='인 부분을 찾는다.
  • ^는 정규 표현식에서 문자열의 시작을 나타내며, ==는 두 개의 '=' 문자를 나타낸다.

strings data.txt | grep "^=="

  • data.txt 파일에서 사람이 읽을 수 있는 문자열을 먼저 추출하고, 그 중에서 시작이 '=='인 부분을 찾아 출력한다.
bandit9@bandit:~$ strings data.txt | grep "^=="
========== passwordk^
========== is
========== G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s

bandit10 : G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s

profile
백엔드 개발자가 되고 싶은 응애

0개의 댓글