URL : https://overthewire.org/wargames/bandit/
SSH Port : 2220
OS : kali-linux-2022.1-installer-amd64.iso
Bandit 0 -> 1
1. The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Leve
2. The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game.
01. SSH 접속
- ssh bandit0@bandit.labs.overthewire.org -p 2220
- ID : bandit0
- PW : bandit0
02. readme통해서 bandit1의 PW 얻기
bandit:~$ ls
readme
bandit:~$ cat readme
NH2SXQwcBdpmTEzi3byBHMM9H66vVxjL
![]() |
![]() |
bandit1의 PW : NH2SXQwcBdpmTEzi3byBHMM9H66vVxjL
ssh bandit1@bandit.labs.overthewire.org -p 2220
NH2SXQwcBdpmTEzi3byBHMM9H66vVxjL

Bandit1 -> 2
1.The password for the next level is stored in a file called - located in the home directory
01. ls를 통해 - 파일 존재 확인
02. - 파일은 cat, vi .. 등으로 확인\
- '-'으로 시작하는 파일은 시스템에서 파일이 아닌 옵션 혹은 Redirect으로 인식한다
bandit1:~$ cat -
1234 <- 입력
1234 <- 출력
cat은 입력한것이 출력되는 것을 확인할 수 있다
03. cat ./- 확인
bandit1:~$ cat ./-
rRGizSaX8MK1RTb1CNQoXTcYZWU6lgzi
※ 파일명이 리다이렉션(-, >, <)으로 시작할 경우 경로를 포함해서 읽으면 확인 할 수 있다
![]() |
![]() |
bandit2의 PW : rRGizSaX8MK1RTb1CNQoXTcYZWU6lgzi
ssh bandit2@bandit.labs.overthewire.org -p 2220
PW : rRGizSaX8MK1RTb1CNQoXTcYZWU6lgzi
Bandit2 -> 3
1.The password for the next level is stored in a file called spaces in this filename located in the home directory
01. ls명령어로 spaces in this filename을 확인
bandit2:~$ ls
spaces in this filename
02. 파일 이름에 공백이 들어갈 경우 (백슬레쉬)를 사용하여 파일 확인
bandit2:~$ cat ./spaces\ in\ this\ filename
aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG
![]() |
![]() |
bandit3의 PW : aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG
ssh bandit3@bandit.labs.overthewire.org -p 2220
PW : aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG
Bandit3 -> 4
1. The password for the next level is stored in a hidden file in the inhere directory.
01. ls 명령어로 현재 있는 위치의 디렉토리 확인
bandit3:~$ ls
inhere
bandit3:~$ cd/inhere
02. 숨겨진 파일을 확인
bandit3:~/inhere$ ll
-rw-r----- 1 bandit4 bandit3 33 Jan 8 17:08 .hidden
※ls -l을 이용하여 숨겨진파일까지 확인한다
2. cat명령어로 bandit4의 PW 확인
bandit3:~/inhere$ cat .hidden
2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
![]() |
![]() |
bandit4의 PW : 2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
ssh bandit4@bandit.labs.overthewire.org -p 2220
2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
Bandit4 -> 5
1. The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command.
01. inhere 디렉토리에 들어가서 ls로 파일 찾기
bandit4:~inhere$ ls
-file00 -file02 -file04 -file06 -file08
-file01 -file03 -file05 -file07 -file09
02. 여러가지 파일중 사람이 읽을 수 있는 파일을 찾기 위해 file 명령어 사용
bandit4:~inhere$ file ./*
-file00: data
-file01: data
-file02: data
-file03: data
-file04: data
-file05: data
-file06: data
-file07: ASCII text
-file08: data
-file09: OpenPGP Scret Key Version 4
03. -file07을 확인해서 Bandit05의 PW을 얻는다
badint4:~/inhere$ cat ./-file07
lrIWWI6b837kxfiCQZqUdOIYfr6eEeqR
![]() |
![]() |
bandit5의 PW : lrIWWI6b837kxfiCQZqUdOIYfr6eEeqR
ssh bandit5@bandit.labs.overthewire.org -p 2220
lrIWWI6b837kxfiCQZqUdOIYfr6eEeqR
Bandit5 -> 6
1. The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties:
human-readable
1033 bytes in size
not executable
01. 파일의 조건으로 찾는다
bandit5:~/inhere$ find ./ -type f -size 1033c ! -executable
02. 나온 위치의(./maybehere07/) .file2를 읽는다
bandit5:~inhere$ cat ./maybehere07/.file2
P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
※ find (-type 파일 형태, -size 크기 (c : 바이트, g :기가바이트), !(not) -executable : 실행파일이 아닌)
![]() |
![]() |
bandit6의 PW : P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
ssh bandit6@bandit.labs.overthewire.org -p 2220
P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
Bandit6->7
1. The password for the next level is stored somewhere on the server and has all of the following properties:
owned by user bandit7
owned by group bandit6
33 bytes in size
01. 조건에 맞게 파일을 찾기
bandit6:~$ find / -user bandit7 -group bandit6 -size 33c
02. 권한이 부족하여 열어보지 못하는 파일들이 많아서 Error나오는 파일들은 안나오게 다시 찾기
bandit6:~$ find / -user bandit7 -group bandit6 -size 33c 2> /dev/null
/var/lib/dpkg/info/bandit7.password
bandit6:~$ cat /var/lib/dpkg/info/bandit7.password
z7WtoNQU2XfjmMtWABu5rN4vzqu4v99S
![]() |
![]() |
bandit7의 PW : z7WtoNQU2XfjmMtWABu5rN4vzqu4v99S
ssh bandit7@bandit.labs.overthewire.org -p 2220
z7WtoNQU2XfjmMtWABu5rN4vzqu4v99S
'개인 공부 > Bandit' 카테고리의 다른 글
| Bandit 24 ~ 26 (0) | 2023.04.09 |
|---|---|
| Bandit 21 ~ 23 (0) | 2023.04.08 |
| Bandit 17 ~ 20 (0) | 2023.04.07 |
| Bandit 13 ~ 16 (0) | 2023.04.06 |
| Bandit 7 ~ 12 (0) | 2023.04.04 |









