Bandit
Level 0
Link: https://overthewire.org/wargames/bandit/bandit0.html
Goal: Login to the remote system.
Given Data
Username: bandit0
Password: bandit0
Host: bandit.labs.overthewire.org
Port: 2220
Solution
Open terminal and type:
ssh bandit0@bandit.labs.overthewire.org -p 2220
This will ask for password. Type bandit0 and hit enter.
Level 0 -> Level 1
Link: https://overthewire.org/wargames/bandit/bandit1.html
Goal: Find the password for the level 1.
Solution
Login to the system following the solution steps and search for readme file.
bandit0@bandit:~$ ls -lha
[READACTED]
-rw-r----- 1 bandit1 bandit0 438 Oct 25 13:37 readme
Check the password in readme.
bandit0@bandit:~$ cat readme
[READACTED]
The password you are looking for is: 6y2[READACTED]hNR
Level 1 -> Level 2
Link: https://overthewire.org/wargames/bandit/bandit2.html
Goal: Find the password for level 2.
Recon
Login: ssh bandit1@bandit.labs.overthewire.org -p 2220
Password: solution result
Info: The password for the next level is stored in a file called - located in the home directory.
Solution
Login to the system using ssh and the password.
List the contents of home directory (when logged in, we are in home directory).
bandit1@bandit:~$ ls -lha
total 24K
-rw-r----- 1 bandit2 bandit1 33 Oct 25 13:37 -
[READACTED]
A file named - cannot be understood by cat. To see the contents is have, path system to be used.
bandit1@bandit:~$ cat ./-
PK8[READACTED]ToB
Level 2 -> Level 3
Link: https://overthewire.org/wargames/bandit/bandit3.html
Goal: Find the password for level 3.
Recon
Login: ssh bandit2@bandit.labs.overthewire.org -p 2220
Password: solution result
Info: The password for the next level is stored in a file called --spaces in this filename-- located in the home directory.
Solution
Login to the system using ssh and the password.
Listing the contents of home directory.
bandit2@bandit:~$ ls -lha
total 24K
-rw-r----- 1 bandit3 bandit2 33 Oct 25 13:37 --spaces in this filename--
[READACTED]
We are gonna use auto fill up of terminal this case. Type cat ./- and press tab button, the file name will automatically completed. Hit enter next.
bandit2@bandit:~$ cat ./--spaces\ in\ this\ filename--
7ZZ[READACTED]PME
Level 3 -> Level 4
Link: https://overthewire.org/wargames/bandit/bandit4.html
Goal: The password for the next level is stored in a hidden file in the inhere directory.
Solution
Login to the system using ssh bandit3@bandit.labs.overthewire.org -p 2220 and password obtained from the previous solution.
Now notice, there is a inhere directory. Let’s see the contents of inhere directory.
N.B.: as the file is a hidden file we need to use -a with ls.
bandit3@bandit:~$ ls -la
[READACTED]
drwxr-xr-x 2 root root 4096 Oct 25 13:37 inhere
bandit3@bandit:~$ ls -lha ./inhere/
[READACTED]
-rw-r----- 1 bandit4 bandit3 33 Oct 25 13:37 ...Hiding-From-You
Seeing the content. As I am in home directory I am giving the full path.
Sortcut: type cat ./in[press tab].[press tab] and see the magic.
bandit3@bandit:~$ cat ./inhere/...Hiding-From-You
xzT[READACTED]AMq
Level 4 -> Level 5
Link: https://overthewire.org/wargames/bandit/bandit5.html
Goal: The password for the next level is stored in the only human-readable file in the inhere directory.
Solution
Login to the system using ssh bandit4@bandit.labs.overthewire.org -p 2220 and password obtained from the previous solution.
Lisiting the files in inhere directory.
bandit4@bandit:~$ ls -la ./inhere/
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file00
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file01
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file02
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file03
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file04
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file05
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file06
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file07
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file08
-rw-r----- 1 bandit5 bandit4 33 Oct 25 13:37 -file09
As we need to investigate many files now, move to that directory.
cd ./inhere
The given clue is: human-readable file. So, we need to find the file which is human readable. Human only understand ASCII. Looking for that.
bandit4@bandit:~/inhere$ file ./-file0*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data
Explanation:
file: a terminal command used to see file type. more./file0*: we have files named-file00,-file01, … ,-file09. The*matches all available file in this formate.
So, ./-file07 is the only human readable file.
bandit4@bandit:~/inhere$ cat ./-file07
6C7[READACTED]IrG
Level 5 -> Level 6
Link: https://overthewire.org/wargames/bandit/bandit6.html
Goal: 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
Solution
Login to the system using ssh bandit5@bandit.labs.overthewire.org -p 2220 and password obtained from the previous solution. And move to the inhere directory (cd ./inhere).
Listing found
bandit5@bandit:~/inhere$ ls -la
total 88
drwxr-x--- 22 root bandit5 4096 Oct 25 13:37 .
drwxr-xr-x 3 root root 4096 Oct 25 13:37 ..
drwxr-x--- 2 root bandit5 4096 Oct 25 13:37 maybehere00
drwxr-x--- 2 root bandit5 4096 Oct 25 13:37 maybehere01
drwxr-x--- 2 root bandit5 4096 Oct 25 13:37 maybehere02
drwxr-x--- 2 root bandit5 4096 Oct 25 13:37 maybehere03
There are many more directories.
Analysis:
- human-readable: file type
ascii - bytes in size: file size ().
- not executable: file may have read, write permission but not executable permission
Finding file with these criteria:
bandit5@bandit:~/inhere$ find . -type f -size 1033c ! -perm /100
./maybehere07/.file2
Explanation:
.: search in current directory-type f: file type is file.-size 1033c: size is 1033 byte.-perm /100: user having executable permission.! -perm /100: user not having executable permission.
Know more aboutfindcommand here.
So, our desired file is a hidden file .file2 in the directory maybehere07.
bandit5@bandit:~/inhere$ cat ./maybehere07/.file2
pXa[READACTED]SBW
Level 6 → Level 7
Link: https://overthewire.org/wargames/bandit/bandit7.html
Goal: 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
Solution
Login using ssh bandit6@bandit.labs.overthewire.org -p 2220 and password found from the previous problem.
Well this time the password is stored somewhere on the server, so we need to go to the root directory.
bandit6@bandit:~$ cd /
For finding our specific file
bandit6@bandit:/$ find . -user bandit7 -group bandit6 -size 33c -type f 2>/dev/null
./var/lib/dpkg/info/bandit7.password
Explanation:
| Command | Meaning |
|---|---|
find |
Search for files and directories. |
. |
Start searching from the current directory. |
-user bandit7 |
Find files owned by user bandit7. |
-group bandit6 |
Find files belonging to group bandit6. |
-size 33c |
Find files exactly 33 bytes in size. |
-type f |
Find regular files only. |
2>/dev/null |
Hide error messages. |
Understand this in details.
See the password
bandit6@bandit:/$ cat ./var/lib/dpkg/info/bandit7.password
Bmn[READACTED]3E3
Level 7 → Level 8
Link: https://overthewire.org/wargames/bandit/bandit8.html
Goal: The password for the next level is stored in the file data.txt next to the word millionth
Soluton
Login to the system using ssh bandit7@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
Well we have data.txt, which contain may text and after each text there is a password.
bandit7@bandit:~$ ls -la
[READACTED]
-rw-r----- 1 bandit8 bandit7 4184396 Oct 25 13:37 data.txt
bandit7@bandit:~$ less data.txt
Contains
canvasing JC4IdewxEgusyiN9Rmp8aHA07Iz6shpX
dumbly BXX9C4e4gkRO0812T3z6ofU70UG0Alp2
strainers Uf0gjRsjfG0tknaccHwzpNotmWIDaRrV
witchery yc4xZP2mmPFL95xLelPKbwHfN98pEpU6
deepening cXLLjlPtWm7KujVduNMUduJrDPDxUiix
persuading yJSqjx4Vt1M3attfIEgLKl1rkd56TrQv
[READACTED]
press q to close less window.
So, if we find the word millionth then the next word is the password. Learn about grep to solve this.
bandit7@bandit:~$ grep "millionth" data.txt
millionth VR1l[READACTED]tub
Level 8 → Level 9
Link: https://overthewire.org/wargames/bandit/bandit9.html
Goal: The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
Solution
Login to the system using ssh bandit8@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
The data.txt contains many line.
sGnoRpQPqcVpFphSKl8QK7PAAWRl75xc
12D8OH8V9CnJ6QL2GPlin7ssgRoZlbC2
zLcTGHXgASIc1Rq7Pp8KayszoFY5svHT
wAnwVnMnDTDUJkgXyZVAEvsyexjRiFEL
[READACTED]
Problem says there are many duplicate line except one.
sort -u data.txt cannot be used, cause it will sort and remove the duplicates but which line occurs only once is unkwon. uniq provide us with an -c option for counting.
Only uniq -c cannot be used, cause uniq command only remove and count the adjacent duplicates.
sort data.txt | uniq -c
sort data.txt ort the lines, now all duplicates are adjacent then using uniq -c removes the duplicate and shows the count.
But it is not easy to see a line with 1, in a large file. again sorting based on number takes the line count with at the top. Just getting the first line pipe with head -1 which outputs only first line.
bandit8@bandit:~$ sort data.txt | uniq -c | sort -n | head -1
1 Ejm[READACTED]kxl
Learn: sort and uniq command for better understand.
Level 9 → Level 10
Link: https://overthewire.org/wargames/bandit/bandit10.html
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.
Solution
Login to the system using ssh bandit9@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
This time given data.txt with an extension .txt is not a .txt file.
bandit9@bandit:~$ file data.txt
data.txt: data
As the contents are not in ascii, we need to convert it to ascii. Moreover, it is said that before the password there is = , multiple times. For maching, going to use grep -E (I feel comfortable with egrep) and the pattern will be =+.
bandit9@bandit:~$ strings data.txt | grep -E '=+'
`=Sc
}7;========== the
-c=,
=9lj
========== password
Oj(%qy=
========== is
S=/D
=av|
0=6%J3^7
ab={
B=e"
Fy=W
========== B0s[READACTED]3BG
8{=9
9"=>-"
J='h
Level 10 → Level 11
Link: https://overthewire.org/wargames/bandit/bandit11.html
Goal: The password for the next level is stored in the file data.txt, which contains base64 encoded data
Solution
Login to the system using ssh bandit10@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
The data.txt contain base64 encoded text
bandit10@bandit:~$ cat data.txt
VGhlIHBhc3N3b3JkIGlzIHBZZk9ZNkh3VXNEajVyTDlVdnloVTdNQ212OHZONVJvCg==
Decoding this got the password.
bandit10@bandit:~$ cat data.txt | base64 -d
The password is pYf[READACTED]5Ro
Level 11 → Level 12
Link: https://overthewire.org/wargames/bandit/bandit12.html
Goal: The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions.
Solution
Login to the system using ssh bandit11@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
bandit11@bandit:~$ cat data.txt
Gur cnffjbeq vf TEBbmJCB8DlA0zTewHxVQ0JPLxMvDkeA
According to the question, the text is rot13 encoded.
bandit11@bandit:~$ cat data.txt | tr [a-zA-Z] [n-za-mN-ZA-M]
The password is GRO[READACTED]xrN
Level 12 → Level 13
Link: https://overthewire.org/wargames/bandit/bandit13.html
Goal: The password for the next level is stored in the file data.txt, which is a hexdump of a file that has been repeatedly compressed.
Solution
Login to the system using ssh bandit12@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
$ file data.txt
data.txt: ASCII text
$ head -3 data.txt
00000000: 1f8b 0808 ff05 de6a 0203 6461 7461 322e .......j..data2.
00000010: 6269 6e00 0149 02b6 fd42 5a68 3931 4159 bin..I...BZh91AY
00000020: 2653 59b8 b8d3 6700 001d 7fff ffde cfce &SY...g.........
Given data.txt is a text file containing hexdump. In current directory we cannot create any file or do read, write operations. Creating a folder in /tmp and coping the file to it.
mkdir /tmp/Robot-Room-101
cd /tmp/cd Robot-Room-101
cp ~/data.txt .
Restoring the hexdump.
$ xxd -r data.txt restore
$ file restore
restore: gzip compressed data, was "data2.bin", last modified: Sun Oct 25 13:37:03 2026, max compression, from Unix, original size modulo 2^32 585
The restored file is a gzip file. Fix the extension for unzipping and unzip.
$ mv restore restore.gz
$ gunzip restore.gz
$ file restore
restore: bzip2 compressed data, block size = 900k
Unzipping give a restore file with is bzip2 file. Fixing extension then unzipping.
$ mv restore restore.bz2
$ bunzip2 restore.bz2
$ file restore
restore: gzip compressed data, was "data4.bin", last modified: Sun Oct 25 13:37:03 2026, max compression, from Unix, original size modulo 2^32 20480
Unzipipng gives restore file which is again of gzip type. Again fixing extraction and unzip.
$ mv restore restore.gz
$ gunzip restore.gz
$ file restore
restore: POSIX tar archive (GNU)
Now our new file got by unzipping is a tar file. Fixing extration and unzip.
$ mv restore restore.tar
$ tar -xf restore.tar
$ ls -la
total 36
drwxrwxr-x 2 bandit12 bandit12 100 Nov 5 15:01 .
drwxrwx-wt 111 root root 2840 Nov 5 15:01 ..
-rw-r----- 1 bandit12 bandit12 2646 Nov 5 14:56 data.txt
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data5.bin
-rw-rw-r-- 1 bandit12 bandit12 20480 Nov 5 14:57 restore.tar
$ file data5.bin
data5.bin: POSIX tar archive (GNU)
Again fixing extansion and unzip.
$ mv data5.bin data5.tar
$ tar -xvf data5.tar
data6.bin
$ ls -la
total 40
drwxrwxr-x 2 bandit12 bandit12 120 Nov 5 15:02 .
drwxrwx-wt 111 root root 2820 Nov 5 15:02 ..
-rw-r----- 1 bandit12 bandit12 2646 Nov 5 14:56 data.txt
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data5.tar
-rw-r--r-- 1 bandit12 bandit12 226 Oct 25 13:37 data6.bin
-rw-rw-r-- 1 bandit12 bandit12 20480 Nov 5 14:57 restore.tar
$ file data6.bin
data6.bin: bzip2 compressed data, block size = 900k
Again got a bzip2 zipped file. Correcting the extransion and unzip.
$ mv data6.bin data6.bz2
$ bzip2 -d data6.bz2
$ ls -la
total 48
drwxrwxr-x 2 bandit12 bandit12 120 Nov 5 15:03 .
drwxrwx-wt 112 root root 2860 Nov 5 15:03 ..
-rw-r----- 1 bandit12 bandit12 2646 Nov 5 14:56 data.txt
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data5.tar
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data6
-rw-rw-r-- 1 bandit12 bandit12 20480 Nov 5 14:57 restore.tar
$ file data6
data6: POSIX tar archive (GNU)
Further more correcting the extansion and unzip.
$ mv data6 data6.tar
$ tar -xvf data6.tar
data8.bin
$ file data8.bin
data8.bin: gzip compressed data, was "data9.bin", last modified: Sun Oct 25 13:37:03 2026, max compression, from Unix, original size modulo 2^32 49
Now we have a gzip zipped file, correcting the extension, unzip it.
$ mv data8.bin data8.gz
$ gzip -d data8.gz
$ ls -la
total 52
drwxrwxr-x 2 bandit12 bandit12 140 Nov 5 15:04 .
drwxrwx-wt 113 root root 2880 Nov 5 15:04 ..
-rw-r----- 1 bandit12 bandit12 2646 Nov 5 14:56 data.txt
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data5.tar
-rw-r--r-- 1 bandit12 bandit12 10240 Oct 25 13:37 data6.tar
-rw-r--r-- 1 bandit12 bandit12 49 Oct 25 13:37 data8
-rw-rw-r-- 1 bandit12 bandit12 20480 Nov 5 14:57 restore.tar
$ file data8
data8: ASCII text
Finally we get a text file. Seeing the contents.
$ cat data8
The password is qQY[READACTED]uzk
Finally got the password.
N.B.: As we have create a directory under /tmp before logging out please delete the directory.
cd /tmp # move to /tmp direcotory
rm -rf directory-name/ # your directory name
Level 13 → Level 14
Link: https://overthewire.org/wargames/bandit/bandit14.html
Goal: The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14. For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level.
Solution
Login to the system using ssh bandit13@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
Statement: The password for the next level is stored in /etc/bandit_pass/bandit14. So, see the password.
bandit13@bandit:~$ cat /etc/bandit_pass/bandit14
cat: /etc/bandit_pass/bandit14: Permission denied
bandit13@bandit:~$ ls -la /etc/bandit_pass/bandit14
-r-------- 1 bandit14 bandit14 33 Oct 25 13:36 /etc/bandit_pass/bandit14
But I am now bandit13. Statement: /etc/bandit_pass/bandit14 and can only be read by user bandit14. Therefore to see the password we need to log in as user bandit14, then we are able to see the password.
How to log in to next level without password.
Statement: For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level.
They have given us the ssh private key of bandit14.
bandit13@bandit:~$ ls -la
[READACTED]
-rw-r----- 1 bandit14 bandit13 467 Oct 25 13:37 HINT
-rw-r----- 1 bandit14 bandit13 2602 Oct 25 13:37 sshkey.private
bandit13@bandit:~$ cat sshkey.private
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
[READACTED]
KN158egNsB+sEAAAAOcnVkeUBsb2NhbGhvc3QBAgMEBQ==
-----END OPENSSH PRIVATE KEY-----
Given private key is a rsa private key.
Let’s copy it to local file. (I am creating a directory for myself to keep everything organized).
┌──(local㉿kali)-[~/Downloads]
└─$ mkdir OverTheWire-Practise
┌──(local㉿kali)-[~/Downloads]
└─$ cd OverTheWire-Practise
Now copy the file to our local machine.
┌──(local㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ scp -p 2220 bandit13@bandit.labs.overthewire.org:sshkey.private ./
This will ask the password. Enter the password used to login in as bandit13. Now my local machine has the key.
┌──(oreki㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ ls -la
-rw-r----- 1 oreki oreki 2602 Nov 10 07:41 sshkey.private
To log in a remote machine with private key instead of password, use ssh -i file-name.
┌──(local㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ ssh bandit14@bandit.labs.overthewire.org -p 2220 -i sshkey.private
_ _ _ _
| |__ __ _ _ __ __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|
This is an OverTheWire game server.
More information on http://www.overthewire.org/wargames
backend: gibson-0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for 'sshkey.private' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "sshkey.private": bad permissions
bandit14@bandit.labs.overthewire.org's password:
It fails to login using the key, so asking for password. The reason:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for 'sshkey.private' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "sshkey.private": bad permissions
So, our file permission is not correct. key permission cannot be 640. Ours is -rw-r----- = 640. It need to be 700, only accessible by me, not any other user.
┌──(local㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ chmod 700 sshkey.private
┌──(local㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ ls -la
-rwx------ 1 oreki oreki 2602 Nov 10 07:41 sshkey.private
Now the perssion has changed. Let’s try again.
┌──(local㉿kali)-[~/Downloads/OverTheWire-Practise]
└─$ ssh bandit14@bandit.labs.overthewire.org -p 2220 -i sshkey.private
Now we have logged in successfully. Now see the password.
bandit14@bandit:~$ cat /etc/bandit_pass/bandit14
aaW[READACTED]YS65
We don’t have the permission to do so.
bandit13@bandit:~$ ssh bandit14@bandit.labs.overthewire.org -p 2220 -i sshkey.private
The authenticity of host '[bandit.labs.overthewire.org]:2220 ([127.0.0.1]:2220)' can't be established.
ED25519 key fingerprint is: SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory '/home/bandit13/.ssh' (Permission denied).
Failed to add the host to the list of known hosts (/home/bandit13/.ssh/known_hosts).
_ _ _ _
| |__ __ _ _ __ __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|
This is an OverTheWire game server.
More information on http://www.overthewire.org/wargames
!!! You are trying to log into this SSH server from localhost.
!!! Connecting from/to localhost is blocked to conserve resources.
!!! Please log out and log in again, directly from your client machine.
backend: gibson-0
Received disconnect from 127.0.0.1 port 2220:2: no authentication methods enabled
Disconnected from 127.0.0.1 port 2220
See the error: Could not create directory '/home/bandit13/.ssh' (Permission denied). We don’t have directory creation permission.
bandit13@bandit:~$ mkdir .ssh
mkdir: Permission denied
As, the keys and login informations are stored in .ssh/ directory and this command cannot create this directory, so direct login from bandit13 not possible. so, we copied the file to our local machine.
N.B.: One can copy the text of the key and using `nano` create a file and just paste the text in it can also work.
Level 14 → Level 15
Link: https://overthewire.org/wargames/bandit/bandit15.html
Goal: The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost.
Solution
Login to the system using ssh bandit14@bandit.labs.overthewire.org -p 2220 and the password found in the previous level.
Satement Analysis: Submitting password for the current level to port 30000 on localhost.
- Submitting password: some program will run where we need to give the current level password.
- localhost: the program will run on localhost
- port 30000: at port 30000
So, there is a program running on localhost:30000. Command execution can be done usingnc(more).
Using nc
Checking is the port open for running netcat.
bandit14@bandit:~$ nc -z localhost 30000
Connection to localhost (127.0.0.1) 30000 port [tcp/*] succeeded!
succeeded!: the port is open.
Now running the program.
bandit14@bandit:~$ nc localhost 30000
aaW[READACTED]S65
Correct!
pbL[READACTED]8A7
Running nc localhost 30000 , blink the curson in a newline. giving the password there, give us the password for the next level.
Using ncat
Checking is the port open.
bandit14@bandit:~$ nmap localhost -p 30000
Starting Nmap 7.98 ( https://nmap.org ) at 2026-11-12 10:46 +0000
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000034s latency).
Other addresses for localhost (not scanned): ::1
PORT STATE SERVICE
30000/tcp open ndmps
STATE: open
Now running the program on that port.
bandit14@bandit:~$ ncat localhost 30000
aaW[READACTED\S65
Correct!
pbL[READACTED]8A7
Level 15 → Level 16
Link: https://overthewire.org/wargames/bandit/bandit16.html
Goal: The password for the next level can be retrieved by submitting the password of the current level to port 30001 on localhost using SSL/TLS encryption.
Solution
Follow every steps of [[Bandit#Using ncat|solution of level 14 -> 15]] but in the last use --ssl connection as stated there.
bandit15@bandit:~$ ncat --ssl localhost 30001
pbL[READACTED]8A7
Correct!
kS0[READACTED]X8V
Level 16 → Level 17
Link: https://overthewire.org/wargames/bandit/bandit17.html
Goal: The credentials for the next level can be retrieved by submitting the password of the current level to a port on localhost in the range 31000 to 32000. First find out which of these ports have a server listening on them. Then find out which of those speak SSL/TLS and which don’t. There is only 1 server that will give the next credentials, the others will simply send back to you whatever you send to it.
Solution
For obtaining the password they have given us the procedures.
- Step 01: First find out which of these ports have a server listening on them among 31000 to 32000.
- Step 02: Then find out which of those speak SSL/TLS and which don’t.
- Step 03: There is only 1 server that will give the next credentials
Step 01: Indetifing open ports
Our given range of port is . 5 Ports found open using nmap port scan (-p).
bandit16@bandit:~$ nmap -p 31000-32000 localhost
[READACTED]
PORT STATE SERVICE
31046/tcp open unknown
31518/tcp open unknown
31691/tcp open unknown
31790/tcp open unknown
31960/tcp open unknown
Identifing Service and Version
Identifing what service is provided by the open ports use -sV with nmap. (More on: nmap -h)
bandit16@bandit:~$ nmap -sV -p 31046,31518,31691,31790,31960 localhost
[READACTED]
PORT STATE SERVICE VERSION
31046/tcp open echo
31518/tcp open ssl/echo
31691/tcp open echo
31790/tcp open ssl/unknown
31960/tcp open echo
1 service unrecognized despite returning data. If you know the service/version,
[READACTED]
Nmap done: 1 IP address (1 host up) scanned in 122.88 seconds
Understanding your scan results
| Port | State | Service | Meaning |
|---|---|---|---|
| 31046 | Open | echo | Echo service detected |
| 31518 | Open | ssl/echo | Echo service over SSL/TLS |
| 31691 | Open | echo | Echo service detected |
| 31790 | Open | ssl/unknown | SSL/TLS detected, application unknown |
| 31960 | Open | echo | Echo service detected |
What does
echomean? The Echo service is a simple network service that sends back the data it receives.For example:
- You send:
Hello- Server responds:
HelloNmap recognizes this behavior and identifies the service as
echo.
What does
ssl/echomean? It means Nmap detected an Echo-like service communicating through SSL/TLS encryption.
We can two ports running on ssl those are and .
- : is
echotype. so giving something, that same text will be returned. (nothing special) - : is
sslservice but not echo. Suitable for getting credentials items.
Retriving credentials
As the given port is a TCP port with ssl. Usually for reading and writing to tcp connection we use netcat but as this connection is ssl encrypted; netcat don’t have any ssl service.
Using ncat
So, using ncat to connect to the tcp for reading or writing. ncat has --ssl to connect tcp port with ssl like netcat.
bandit16@bandit:~$ ncat --ssl localhost 31790
hello # writing hello
Wrong! Please enter the correct current password.
I typed hello, it says: Wrong! Please enter the correct current password. This TCP port not giving echo service, rather asking for password. Giving the current level password, gives the private login key.
bandit16@bandit:~$ ncat --ssl localhost 31790
kS0[READACTED]0X8V
Correct!
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
[READACTED]
Pfos/2C+rbNuHjAAAADnJ1ZHlAbG9jYWxob3N0AQIDBA==
-----END OPENSSH PRIVATE KEY-----
Using openssl and s_client
Basically when the tcp service is in ssl, it is mainly openssl. Connect to the port.
bandit16@bandit:~$ openssl s_client -connect localhost:31790
Connecting to 127.0.0.1
CONNECTED(00000003)
Can't use SSL_get_servername
[READACTED]
---
read R BLOCK
read R BLOCK: This is an OpenSSL message indicating that it is waiting for data to read from the connection.
hlw
Wrong! Please enter the correct current password.
closed
I typed “hlw” which gives, wrong password. Meaning it is waiting for a password.
read R BLOCK
kS0[READACTED]X8V
KEYUPDATE
Again connecting and giving the password gives KEYUPDATE. Actually, thek “k” in our password kS0[READACTED]X8V is acting like a command.
Read more: OpenSSL commands.
To avoid this, I am connecting openssl in advance mood.
bandit16@bandit:~$ openssl s_client -connect localhost:31790 -adv
Connecting to 127.0.0.1
CONNECTED(00000003)
Can't use SSL_get_servername
[READACTED]
read R BLOCK
kS0Hf0u5HiXFwKMKFqXvPdOTNGGa0X8V
read R BLOCK
Correct!
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
[READACTED]
Pfos/2C+rbNuHjAAAADnJ1ZHlAbG9jYWxob3N0AQIDBA==
-----END OPENSSH PRIVATE KEY-----
closed
Read more: Advance mood of openssl
Level 17 → Level 18
Link: https://overthewire.org/wargames/bandit/bandit18.html
Goal: Finding the uncommon text (password) between two file.
Solution
Save the previous gotten key in a file and login via
ssh bandit17@bandit.labs.overthewire.org -p 2220 -i [file-name]
After login found the two file.
bandit17@bandit:~$ wc -l passwords.new passwords.old
100 passwords.new
100 passwords.old
200 total
Both of the files contains 100 lines. Finding the changed line.
bandit17@bandit:~$ diff passwords.new passwords.old
42c42
< OQx[READACTED]TXI
---
> pmTDnZLl0kLXTAU71zRbREj4tnzETcSP
- 42c42: on line 42, ,there is mismatch.
<first file line,>second file line, that don’t match.
Level 18 → Level 19
Link: https://overthewire.org/wargames/bandit/bandit19.html
Goal: Finding password for the next level
Solution
When trying to log into Bandit18 with the password found from the previous level, it automatically log out.
┌──(oreki㉿kali)-[~]
└─$ ssh bandit18@bandit.labs.overthewire.org -p 2220
[READACTED]
Byebye !
Connection to bandit.labs.overthewire.org closed.
Key point: ssh can execute command instantly as long as it logs in and do rest of the stuffs.
┌──(oreki㉿kali)-[~]
└─$ ssh bandit18@bandit.labs.overthewire.org -p 2220 "cat readme"
_ _ _ _
| |__ __ _ _ __ __| (_) |_
| '_ \ / _` | '_ \ / _` | | __|
| |_) | (_| | | | | (_| | | |_
|_.__/ \__,_|_| |_|\__,_|_|\__|
This is an OverTheWire game server.
More information on http://www.overthewire.org/wargames
backend: gibson-0
bandit18@bandit.labs.overthewire.org's password: # giving the password
Kps[READACTED]xZI
So, running command, ask for password giving password correctly it logs and execute the command and then log out.
Level 19 → Level 20
Link: https://overthewire.org/wargames/bandit/bandit20.html
Goal:
- use the setuid binary in the homedirectory
- Execute it without arguments to find out how to use it
- password in (
/etc/bandit_pass)
Solution
Login to bandit19 with the password found from the previous level. See what files contain.
bandit19@bandit:~$ ls -la
-rwsr-x--- 1 bandit20 bandit19 14880 Oct 25 13:37 bandit20-do
More over this is an executable file.
bandit19@bandit:~$ file bandit20-do
bandit20-do: setuid ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=263f71465a75a599f568ae40f1caca2a9e937892, for GNU/Linux 3.2.0, not stripped
Hint: Execute it without arguments to find out how to use it
Executed the command and it shows how it works.
bandit19@bandit:~$ ./bandit20-do
Run a command as another user.
Example: ./bandit20-do whoami
It say I can run any command acting as another user. Its format is ./bandit20-do [COMMAND]. Tried the example command.
bandit19@bandit:~$ ./bandit20-do whoami
bandit20
It says I am bandit20. That means running any command using this executable file, system think as I am bandit20. As bandit19 I cannot see the password of bandit20 from /etc/bandit_pass.
bandit19@bandit:~$ cat /etc/bandit_pass/bandit20
cat: /etc/bandit_pass/bandit20: Permission denied
but bandit20 can view it’s own password.
bandit19@bandit:~$ ls -l /etc/bandit_pass/bandit20
-r-------- 1 bandit20 bandit20 33 Oct 25 13:36 /etc/bandit_pass/bandit20
As the program let’s me to act as bandit20 and execute any command, lets run cat /etc/bandit_pass/bandit20 command that fails earlier as bandit19.
bandit19@bandit:~$ ./bandit20-do cat /etc/bandit_pass/bandit20
4pI[READACTED]pOA
Level 20 → Level 21
Link: https://overthewire.org/wargames/bandit/bandit21.html
Goal: There is a setuid binary in the homedirectory that does the following: it makes a connection to localhost on the port you specify as a commandline argument. It then reads a line of text from the connection and compares it to the password in the previous level (bandit20). If the password is correct, it will transmit the password for the next level (bandit21).
Solution
Login to the system.
Found executable file.
bandit20@bandit:~$ ls -la
-rwsr-x--- 1 bandit21 bandit20 15604 Oct 25 13:37 suconnect
bandit20@bandit:~$ file suconnect
suconnect: setuid ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=f5f4e327efe53d15fcf0c0fb08324d5f939ac4f0, for GNU/Linux 3.2.0, not stripped
bandit20@bandit:~$ ./suconnect
Usage: ./suconnect <portnumber>
This program will connect to the given port on localhost using TCP. If it receives the correct password from the other side, the next password is transmitted back.
Mistake I made
I thought that some of the port is open on the localhost connecting to that and giving password will give the next level password.
This program will connect to the given port on localhost using TCP:
- given port: port is given by me
- connecting to the given port using the executable file
If it receives the correct password from the other side, the next password is transmitted back.: send the password to the executable file from the other side of the connection and it will give the password there.
For this level we need to connect to the system in two terminal.
First Terminal
creating a chatroom for chat like ( nc chatroom).
bandit20@bandit:~$ nc -lvp 1234
Listening on 0.0.0.0 1234
Second Terminal
Now connect the executable file to that port.
bandit20@bandit:~$ ./suconnect 1234
First Terminal
When second terminal is connect, in first terminal we will see this message.
Connection received on localhost 47272
When this message is seen, connection successfull, type the password in first terminal. As this is a common chatroom, this same text will be going to echo in the second terminal, as the problem Read, so as the password is echoed, it will read it. And as per the problem, as passwords match the next level password forwared to First terminal.
bandit20@bandit:~$ nc -lvp 1234
Listening on 0.0.0.0 1234
Connection received on localhost 47272
4pI[READACTED]pOA
bW9[READACTED]6hY
Second Terminal
Nothing to do. you just see this messages.
bandit20@bandit:~$ ./suconnect 1234
Read: 4pI[READACTED]pOA
Password matches, sending next password
Level 21 → Level 22
Link: https://overthewire.org/wargames/bandit/bandit22.html
Goal: A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in /etc/cron.d/ for the configuration and see what command is being executed.
Solution
Login to the system. Target: Look in /etc/cron.d/ for the configuration and see what command is being executed. So, when to /etc/cron.d/ directory. Found there is some cronjob folder.
bandit21@bandit:~$ cd /etc/cron.d/
bandit21@bandit:/etc/cron.d$ ls -la
[READACTED]
-rw-r--r-- 1 root root 127 Oct 26 15:51 clean_tmp
-rw-r--r-- 1 root root 120 Oct 25 13:37 cronjob_bandit22
-rw-r--r-- 1 root root 122 Oct 25 13:37 cronjob_bandit23
-rw-r--r-- 1 root root 120 Oct 25 13:37 cronjob_bandit24
Let’s see what job is done by cronjob_bandit22.
bandit21@bandit:/etc/cron.d$ cat cronjob_bandit22
@reboot bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null
* * * * * bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null
So, its executing some shell command, /usr/bin/cronjob_bandit22.sh. Similarly other two execute, /usr/bin/cronjob_bandit23.sh and /usr/bin/cronjob_bandit24.sh respectively.
But as a bandit21 we only have permission to execute the /usr/bin/cronjob_bandit22.sh command.
bandit21@bandit:/etc/cron.d$ ls -la /usr/bin/cronjob_bandit22.sh /usr/bin/cronjob_bandit23.sh /usr/bin/cronjob_bandit24.sh
-rwxr-x--- 1 bandit22 bandit21 130 Oct 25 13:37 /usr/bin/cronjob_bandit22.sh
-rwxr-x--- 1 bandit23 bandit22 211 Oct 25 13:37 /usr/bin/cronjob_bandit23.sh
-rwxr-x--- 1 bandit24 bandit23 438 Oct 25 13:37 /usr/bin/cronjob_bandit24.sh
bandit21@bandit:/etc/cron.d$ /usr/bin/cronjob_bandit22.sh
chmod: changing permissions of '/tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv': Operation not permitted
/usr/bin/cronjob_bandit22.sh: line 3: /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv: Permission denied
So, the program is trying to change the permission of the file /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv . Let’s see what this file contain.
bandit21@bandit:/etc/cron.d$ cat /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv
RYV[READACTED]MEz
Got the password.
Level 22 → Level 23
Link: https://overthewire.org/wargames/bandit/bandit23.html
Goal: A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in /etc/cron.d/ for the configuration and see what command is being executed.
Solution
Login and again go to /etc/cron.d/ folder and now reading cronjob_bandit23 found this.
bandit22@bandit:/etc/cron.d$ cat cronjob_bandit23
@reboot bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null
* * * * * bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null
This time it is executing /usr/bin/cronjob_bandit23.sh, bandit23 has permission to execute this file, details in this solution found earlier.
Let’s execute the command.
bandit22@bandit:/etc/cron.d$ /usr/bin/cronjob_bandit23.sh
Copying passwordfile /etc/bandit_pass/bandit22 to /tmp/8169b67bd894ddbb4412f91573b38db3
This file is coping my current password to /tmp/8169b67bd894ddbb4412f91573b38db3. Reason not clear, why my current password is being copied.
NOTE: Looking at shell scripts written by other people is a very useful skill. The script for this level is intentionally made easy to read. If you are having problems understanding what it does, try executing it to see the debug information it prints.
This note in the problem statement, says for more info we have permission to view the script code.
bandit22@bandit:/etc/cron.d$ ls -la /usr/bin/cronjob_bandit23.sh
-rwxr-x--- 1 bandit23 bandit22 211 Oct 25 13:37 /usr/bin/cronjob_bandit23.sh
So we can view it. Let’s view it.
bandit22@bandit:/etc/cron.d$ cat /usr/bin/cronjob_bandit23.sh
#!/bin/bash
myname=$(whoami)
mytarget=$(echo I am user $myname | md5sum | cut -d ' ' -f 1)
echo "Copying passwordfile /etc/bandit_pass/$myname to /tmp/$mytarget"
cat /etc/bandit_pass/$myname > /tmp/$mytarget
$(whoami) execute the whoami command that will return bandit22 as I am bandit22. This bandit22 is stored in myname.
$(echo I am user $myname | md5sum | cut -d ' ' -f 1) becomes $(echo I am user bandit22 | md5sum | cut -d ' ' -f 1) that value is stored in mytarget.
for bandit22 /etc/bandit_pass/$myname is /etc/bandit_pass/bandit22 for bandit23 it will be /etc/bandit_pass/bandit23. But as a bandit22 we don’t have permission to read the file.
bandit22@bandit:/etc/cron.d$ ls -la /etc/bandit_pass/bandit23
-r-------- 1 bandit23 bandit23 33 Oct 25 13:36 /etc/bandit_pass/bandit23
But we understand that the password is stored in /tmp/(the md5sum value of "I am user bandit23"). So, let’s create the file name.
bandit22@bandit:/etc/cron.d$ echo I am user bandit23 | md5sum | cut -d ' ' -f 1
8ca319486bfbbc3663ea0fbe81326349
So, the file name is: 8ca319486bfbbc3663ea0fbe81326349. The password of bandit23 will be in /tmp/8ca319486bfbbc3663ea0fbe81326349.
bandit22@bandit:~$ ls -la /tmp/8ca319486bfbbc3663ea0fbe81326349
-rw-rw-r-- 1 bandit23 bandit23 33 Nov 25 12:01 /tmp/8ca319486bfbbc3663ea0fbe81326349
For others r--, so we can read it. Le’ts read it.
bandit22@bandit:/etc/cron.d$ cat /tmp/8ca319486bfbbc3663ea0fbe81326349
gKX[READACTED]Bsw
Level 23 → Level 24
Link: https://overthewire.org/wargames/bandit/bandit24.html
Goal: Same as level 21 and level 22
Solution
Login to the system and check files in the /etc/cron.d/.
bandit23@bandit:~$ ls -la /etc/cron.d/
[READACTED]
-rw-r--r-- 1 root root 120 Oct 25 13:37 cronjob_bandit24
bandit23@bandit:~$ cat /etc/cron.d/cronjob_bandit24
@reboot bandit24 /usr/bin/cronjob_bandit24.sh &> /dev/null
* * * * * bandit24 /usr/bin/cronjob_bandit24.sh &> /dev/null
Our cronjob is doing some jobs on /usr/bin/cronjob_bandit24.sh script. Let’s see what does this script do.
bandit23@bandit:~$ /usr/bin/cronjob_bandit24.sh
/usr/bin/cronjob_bandit24.sh: line 7: cd: /var/spool/bandit23/foo: No such file or directory
bandit23@bandit:~$ cat /usr/bin/cronjob_bandit24.sh
#!/bin/bash
shopt -s nullglob
myname=$(whoami)
cd /var/spool/"$myname"/foo || exit
echo "Executing and deleting all scripts in /var/spool/$myname/foo:"
for i in * .*;
do
if [ "$i" != "." ] && [ "$i" != ".." ];
then
echo "Handling $i"
owner="$(stat --format "%U" "./$i")"
if [ "${owner}" = "bandit23" ] && [ -f "$i" ]; then
timeout -s 9 60 "./$i"
fi
rm -rf "./$i"
fi
done
The script is executing all commands or scirpts in the folder /var/spool/$myname/foo. If the user is bandit23 then it will be /var/spool/bandit23/foo but if user is bandit24 then it will be /var/spool/bandit24/foo.
As I am now bandit23 so it is trying to executing scripts from folder /var/spool/bandit23/foo but as there is no directory it fails. But there is /var/spool/bandit24/foo directory. And we have read write permission for this folder.
See our cronjob: * * * * * bandit24 /usr/bin/cronjob_bandit24.sh &> /dev/null
It is executing at every minutes.
NOTE 2: Keep in mind that your shell script is removed once executed, so you may want to keep a copy around…
As script is going to remove after each minute so we don’t have so much time to set permissions and write command here.
Yes, we need to write script for this challange. The first note says so.
NOTE: This level requires you to create your own first shell-script. This is a very big step and you should be proud of yourself when you beat this level!
Creating a directory under /tmp for working with it and give it write and executable permission.
bandit23@bandit:~$ mkdir /tmp/kuze713 && chmod 777 /tmp/kuze713
I am bandit23. The script is going to run by cronjob of bandit24. I am going to keep my script folder here.
Though read permission is not required because I cannot change the /usr/bin/cronjob_bandit24.sh and it says scripts are must be under /var/spool/bandit24/foo. So, my plan is to create the script here and fix all the permissions and copy this to /var/spool/bandit24/foo here.
The script will write the gotten password to this directory, if it don’t have write permission by all users bandit24 to write here.
The folder don’t actually need the executable permission, I just given it because it is just a game, no risk. But as the script is going to be run by bandit24 so it should be give executable permission by all users.
First writing the script.
bandit23@bandit:~$ cat > /tmp/kuze713/script.sh
#!/bin/bash
cat /etc/bandit_pass/bandit24 > /tmp/kuze713/pwd.txt
^C
This scripts says that the password of bandit24 that is stored in /etc/bandit_pass/bandit24 will be forwareded to /tmp/kuze713/pwd.txt.
bandit23@bandit:~$ ls -la /tmp/kuze713
total 4
drwxrwxrwx 2 bandit23 bandit23 60 Nov 25 16:11 .
drwxrwx-wt 139 root root 3280 Nov 25 16:11 ..
-rw-rw-r-- 1 bandit23 bandit23 65 Nov 25 16:11 script.sh
bandit23@bandit:~$ chmod +x /tmp/kuze713/script.sh
bandit23@bandit:~$ ls -la /tmp/kuze713
total 4
drwxrwxrwx 2 bandit23 bandit23 60 Nov 25 16:11 .
drwxrwx-wt 141 root root 3320 Nov 25 16:13 ..
-rwxrwxr-x 1 bandit23 bandit23 65 Nov 25 16:11 script.sh
Giving it executable permission, so that when I copy it to /var/spool/bandit24/foo/script.sh, it will automatically have the executable permission. Now coping the file to the given location.
bandit23@bandit:~$ cp /tmp/kuze713/script.sh /var/spool/bandit24/foo/script.sh
Wait untill the next minute starts. After next minute the pwd.txt password file is seen.
bandit23@bandit:~$ ls -la /tmp/kuze713
total 8
drwxrwxrwx 2 bandit23 bandit23 80 Nov 25 16:14 .
drwxrwx-wt 141 root root 3340 Nov 25 16:14 ..
-rw-rw-r-- 1 bandit24 bandit24 33 Nov 25 16:14 pwd.txt
-rwxrwxr-x 1 bandit23 bandit23 65 Nov 25 16:11 script.sh
bandit23@bandit:~$ cat /tmp/kuze713/pwd.txt
hVQ[READACTED]VXv
Found the password. Before logout, delete the directory you have created under /tmp.
Level 24 → Level 25
Link: https://overthewire.org/wargames/bandit/bandit25.html
Goal: A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.
You do not need to create new connections each time