Bandit Level 7 → Level 8

Minchae Kim·2023년 5월 12일
0

📌 Level 7 → Level 8


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

🚩 Level Goal

The password for the next level is stored in the file data.txt next to the word millionth

🚩 Problem Solving

ls 명령어를 사용하여 home directory 내부를 살펴보았다. 곧장 data.txt 파일이 있음을 알 수 있다.

🔹 Process

주어진 commands들이 많아서 살짝 걱정했지만, 명령어 하나만 알면 바로 password를 찾아낼 수 있었다. 해당 level에서 사용한 명령어는 grep이다. 제시된 word가 millionth임으로, 이에 해당하는 문자열이 있는 라인을 찾아낼 수 있다.

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

🔹 Password

Bandit8 Password : TESKZC0XvTetK0S9xNwm25STk5iWrBvP

📌 Linux Commands


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

🚩 grep

linux에서 grep 명령어는 특정 파일에서 지정한 문자열이나 정규표현식을 포함한 행을 출력해주는 명령어이다. lstail과 같은 명령어와 조합하여 응용되는 경우가 종종 있기 때문에 능숙하게 다룰 수 있도록 익숙해져야 한다.

grep [option][pattern][file name]

🔹 문자열로 찾기

grep 명령어를 사용하면 특정 파일에서 원하는 문자열이 있는 라인을 찾을 수 있다. 파일은 여러개 지정도 가능하다.

grep '문자열' 파일명1 파일명2

현재 directory 내에 있는 모든 파일에서 특정 문자열을 찾아낼 때는 *를 사용한다.

grep '문자열' *

profile
Security Researcher 시켜줘 !

0개의 댓글