Lessons learned
Find has modifiers for user, group, size, and can execute a command on find files
Logging into Bandit 6
On a kali vm/ linux machine
Type:
ssh bandit6@bandit.labs.overthewire.org -p 2220
DXjZPULLxYr17uwoI01bNLQbtFemEgo7
Completing The Challenge
The Goal:
password for next level located in a file somewhere in the server and has all of the following properties:
- owned by user bandit7
- owned by group bandit6
- 33 bytes in size
The Solution:
bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null
/var/lib/dpkg/info/bandit7.password
bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null -exec cat {} +
HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs
using what we learned previously we know how to get size
an easy way to look for modifiers if you already have an idea of what your looking for is to do:
man CMD | grep MOD
this pipes/lets grep read the output of the man page and then look for certain strings
in this case i looked for group and user
2> means errors are output here instead of where they normally go such as the screen
/dev/null is a black hole as far as I'm concerned.
you could just cat the file after you found it, but isn't the -exec modifier fun. i sure think so
Comments
Post a Comment