Bandit Walkthrough – Level 6
Level Description
http://www.overthewire.org/wargames/bandit/bandit7.shtml
The purpose of this level is to expand upon the previous level, forcing you to search for more than a single parameter at once. The password for bandit7 is in the file that matches these parameters:
owned by user bandit7 owned by group bandit6 33 bytes in size
Hint
You will need to use the find command and figure out the proper way to filter the search to only return the file you want.
Solution | Show> |
---|---|
Oh c’mon, you coulda have explained better. How the fuck are newbs supposed to know what 2>/dev/null is? Smartass
I’m sorry if there was any confusion. I tried to explain it when I said “The only new addition to this level is that we need to discard any errors or we will never be able to sort through all of the junk that comes back. This is done by adding 2>/dev/null to the end of our search (tell the system to output the STDERR to /dev/null (in other words, just trash it).”
There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other program’s output. Programs usually print to standard output, and sometimes prints to standard error. These three file descriptors are often called STDIN, STDOUT, and STDERR.
Sometimes though, they’re not named, they’re numbered. The built-in numberings for them are 0, 1, and 2, in that order. By default, if you don’t name or number one explicitly, you’re talking about STDOUT.
Given that context, you can see the command above is redirecting standard error into /dev/null, which is a place you can dump anything you don’t want. It is a blackhole on the system that simply discards anything sent into it.
Thank you for the follow up responds about 2>/dev/null even thought the guy was really rude about the whole situation
Thanks!
That helped a lot.
thanks for explaining a bit. why would this not work?
find / -user bandit7 -group bandit6 -size 33c -type f STDERR>/dev/null
if STDERR is the same as 2…. sorry if this is a stupid question
What is the significance of the ‘/’ in ‘find /’?
As it says that “stored somewhere on the server” , so firstly we are starting with the root working directory. / is equal to root