OverTheWire : Bandit Level 7 → Level 8

heuniy·2023년 9월 24일

bandit_write up

목록 보기
9/10

문제

https://overthewire.org/wargames/bandit/bandit8.html

Bandit Level 7 → Level 8
Level Goal
The password for the next level is stored in the file data.txt next to the word millionth

data.txt 안에 있는 millionth 단어 옆에 password 가 있다.


풀이

data.txt 을 읽었더니 어마어마하게 많은 내용이 출력되었다.


따라서 grep 명령어를 사용해야 한다.

grep : 특정 파일에서 특정 문자열을 찾을 때 사용

bandit7@bandit:~$ grep "millionth" data.txt
millionth TESKZC0XvTetK0S9xNwm25STk5iWrBvP

passwordTESKZC0XvTetK0S9xNwm25STk5iWrBvP 이다.


기타

리눅스 명령어 정리 (누적)

pwd : 현재 작업중인 디렉토리 정보(경로) 출력

ls : 디렉토리 목록 확인

  • ls -a : 모든 파일(숨겨진 파일 혹은 디렉토리)을 출력

cat [파일명] : [파일명] 내용 출력

  • cat ./[파일명] : 현재 디렉토리에 있는 [파일명] 내용을 출력
  • cat '[파 일 명]' : space가 있는 [파일명] 내용 출력
  • cat [파\ 일\ 명] : space가 있는 [파일명] 내용 출력

file [파일명] : [파일명] 종류(타입) 확인

find [옵션][경로][표현식] : 특정 파일 / 디렉토리 찾기

  • find ./* -size [bytes]c : file 명령어의 표현식, 현재 디텍토리에서 [bytes]파일 찾기
  • find -user(group) : find 명령어의 옵션, user(group) 소유의 파일 찾기

grep [옵션][표현식][파일명] : [파일명] 속 특정 표현식(문자열)을 찾기

profile
고양이 귀여워

0개의 댓글