PS C:\Users\USER> ssh bandit3@bandit.labs.overthewire.org -p2220
...
bandit3@bandit.labs.overthewire.org's password:
...
bandit3@bandit:~$
Bandit3의 서버에 접속했다.
The password for the next level is stored in a hidden file in the inhere directory.
먼저 inhere 디렉토리로 들어가 보자.
bandit3@bandit:~$ pwd
/home/bandit3
bandit3@bandit:~$ ls -al
total 24
drwxr-xr-x 3 root root 4096 Apr 10 14:23 .
drwxr-xr-x 70 root root 4096 Apr 10 14:24 ..
-rw-r--r-- 1 root root 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 root root 3771 Mar 31 2024 .bashrc
drwxr-xr-x 2 root root 4096 Apr 10 14:23 inhere
-rw-r--r-- 1 root root 807 Mar 31 2024 .profile
bandit3@bandit:~$ cd inhere
bandit3@bandit:~/inhere$
inhere 디렉토리는 홈 디렉토리의 하위 디렉토리라는 것을 알아냈고 cd 명령어를 이용해서 inhere 디렉토리로 이동했다.
bandit3@bandit:~/inhere$ ls -l
total 0
bandit3@bandit:~/inhere$ ls -al
total 12
drwxr-xr-x 2 root root 4096 Apr 10 14:23 .
drwxr-xr-x 3 root root 4096 Apr 10 14:23 ..
-rw-r----- 1 bandit4 bandit3 33 Apr 10 14:23 ...Hiding-From-You
bandit3@bandit:~/inhere$
ls -l 명령어를 입력했을 때는 디렉토리 내에 파일이 존재하지 않는 것으로 나온다.
다시 한 번 확인해보기 위하여 ls -al 명령어를 입력하면 몇 가지 항목을 확인할 수 있다.
ls 명령어에서 -a 옵션은 숨겨진 파일이나 디렉토리까지 보여주기 때문에 발생하는 차이이다.
. 은 현재 디렉토리, .. 은 상위 디렉토리를 뜻한다.
따라서 마지막으로 출력된 파일이 우리가 찾는 숨겨진 파일이겠다.
참고로, 파일명의 첫 글자가 온점(.)으로 시작하면 숨겨진 파일이나 디렉토리라는 뜻이다.
bandit3@bandit:~/inhere$ cat ...Hiding-From-You
2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ
'Bandit' 카테고리의 다른 글
| Bandit: Level 5 (3) | 2025.07.28 |
|---|---|
| Bandit: Level 4 (2) | 2025.07.28 |
| Bandit: Level 2 (0) | 2025.07.28 |
| Bandit: Level 1 (0) | 2025.07.28 |
| Bandit: Level 0 (0) | 2025.07.19 |