Level 00
Finding and exploiting a SetUID binary hidden in the file system.
Description
This level requires you to find a Set User ID program that will run as the flag00 account. You could also find this by carefully looking in top level directories in / for suspicious looking directories.
Alternatively, look at the find man page.
To access this level, log in as level00 with the password of level00.
Approach
The goal of this challenge is to locate a hidden SUID (Set Owner User ID) binary that allows us to execute code with the privileges of the user flag00.
- We start by SSH-ing into the machine as
level00. - We can use the
findcommand to search the entire filesystem for files that have the SUID bit set. We redirect standard error to/dev/nullto hide permission denied errors.level00@nebula:~$ find / -type f -perm -4000 2>/dev/null - Looking through the output, we notice an unusual binary:
/bin/.../flag00(also visible at/rofs/bin/.../flag00). - We execute this binary, which grants us the privileges of
flag00. - Finally, we run the
getflagcommand to complete the level.
Output
level00@nebula:~$ find / -type f -perm -4000 2>/dev/null
/bin/.../flag00
/bin/fusermount
/bin/mount
/bin/ping
/bin/ping6
/bin/su
/bin/umount
...
/rofs/bin/.../flag00
...
level00@nebula:~$ /bin/.../flag00
Congrats, now run getflag to get your flag!
flag00@nebula:~$ getflag
You have successfully executed getflag on a target account