Level Goal
The password for the next level is stored somewhere on the server and has all of the following properties:Commands you may need to solve this level
owned by user bandit7
owned by group bandit6
33 bytes in size
ls, cd, cat, file, du, find, grepSolution:
- [Comment] Using SSH to connect the server
- sp@simple-plan:~|=> ssh bandit6@bandit.labs.overthewire.org
...
bandit6@bandit.labs.overthewire.org's password: DXjZPULLxYr17uwoI01bNLQbtFemEgo7 - [Comment] Using find command to find the specific file
- [Comment] owned by user bandit7 : -user bandit7 option
- [Comment] owned by group bandit6 : -group bandit6 option
- [Comment] 33 bytes in size : -size 33c option
- [Comment] We use grep command to help us to ignore error messages
- bandit6@melinda:~$ find / -user bandit7 -group bandit6 -size 33c 2>&1 | grep -v -F Permission
/var/lib/dpkg/info/bandit7.password - [Comment] Using cat command to output file's contents
- bandit6@melinda:~$ cat /var/lib/dpkg/info/bandit7.password
HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs - [Comment] Using exit command to disconnect connection to server
- bandit6@melinda:~$ exit
logout
Connection to bandit.labs.overthewire.org closed. - [Comment] It's done! Saving the password for next level.
please can you explain this term "2>&1" , I' m not able to get I tried searching for this. I got a rough idea what don't know how it works and what does it mean. thanks in advance.
ReplyDeleteFunny you should be asking in 2014, the same time I discovered overthewire.org
DeleteWell the explanation is the "2" is the error output the command would dump into your display. The ">" says send this "2" data(wich is error or STDERR data) somewhere. The "&" tells the shell that the next input will not be a filename. The "1" is the place the shell will send the "2"(STDERR/error) data to, in this case to "1" or STDIN/Input location.
I tried to break it down, I hope that makes sense. It is not a perfect explanation, but begs to break down each character and it's approximate function. Have fun1
why not type 2>/dev/null instead ?
ReplyDelete