0

This is my first questionn ever on stackexchange, very excited :)

I'm currently going through OverTheWire War Game and learning the basics of ssh. I was stuck at bandit5 for I encountered something that I could not understand.

Please refer to Over The Wire War Game - Bandit Level 5

Firstly, here are the steps I took to try and solve the problem:

1.See what was available

bandit5@bandit:~$ ls
inhere

2.Go in to 'inhere'

bandit5@bandit:~$ cd inhere
maybehere00  maybehere04  maybehere08  maybehere12  maybehere16
maybehere01  maybehere05  maybehere09  maybehere13  maybehere17
maybehere02  maybehere06  maybehere10  maybehere14  maybehere18
maybehere03  maybehere07  maybehere11  maybehere15  maybehere19

3.Since I did not know which folder was correct, I checked the manual of find and managed to add in file size option.

bandit5@bandit:~/inhere$ find -size 1033c
./maybehere07/.file2

4.Now I knew which file was the correct one, so I accessed it like this...

4a.Go in to the folder where the file belonged (sounds logical right?)

bandit5@bandit:~/inhere$ cd maybehere07

4b.Cat the file so I can access the answer.

bandit5@bandit:~/inhere/maybehere07$ cat ./-file2

Now this produced a weird set of long characters...

J67tSefFKYcCAUUQmclCbDzpijgUE2VZeC2LHFikNP3IuTbERBw6CpeLRqDJskyUvZwpeP6helUWai750jaGVNpGJ94gorbwQLPwHfDwb2XLLzrC4jfmn8JLXT0jeVkIW4VfCqUSeHyKNsozJ2gYgZLInRFlWqxcKG6DR9CIRGAWUKeIBRUN8sxvxdNGvc8jhbg3RIeGq05WlkPxGNPCwxYCcu1hCGqdtfGbqGeyVaYIEDfetHS1siBU1IpM113A2Ysswv79cJ6S2ikv1MpWg8gpWLFaCUCJnyhcLAes1FeQ1e5VqxcxeO11DCxA57thoQ13UnxCBqttGVrez1jmDD22AEVOAASfzbEcXNcmZOBwdbx49AzLyiOmrS2XGZfDKlRVoF09LzUA8XqMPO9B10fSQitGs0Npgy6PQANJNGOVIQoCU4yi4f5lw77KV3f9IGlx2FtChC3F5vyW2fO4YFbp0983sBWScC9UbRhJF1HYCJfRlZ6uuNgcsZJ2I63H7zBPr3t64qEAXABSJcwtiTm68pUuppbApPsA5KjJtC1ih1O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RlqMnnCXDPDiAhLtpTaXO3EYTSU1aUcG9hTG1B0tyBBvw7yQQr349olyczqqgyYpkgd6Lzkc2BlkpjjrNzdUgCZmCZwEA4Ftj4JSb0LZRlt2MbeFMnw33AFoAY3XoSARLuPzlLqE6yTiliGCVUAbVhJkDmP0oSybURITNnCwTvYbbdeXbYbo9BVXMRafxBqZNo4V2lfQdy4WUTgBmhCq0bLyqn7lb8B2E8UuNnVloj4ahn5RrmPfNhRN59X6Ux4nN1ndGj6AOVrJS8BqGMuLKPFIGohyxmylEnTNHbZxg841cLnI57KLQA20DLryXx2qar0X9KvZwoK3Mfm8ydUYlfeAqlzpcfq3rxJAkeV4uIyQMu5ItfXslTTo3pRbbdF8NazwFDEIDzBBBHnA04RW2gdo4FyYKbUHZG2HI8Fc3BQjVLuTJlGH7pfXfubKqza6Q2NJrZ6yGlk1NA2v4XGiAbpl1nonni2u8WnTpNqagMnxbr3fZa1HW0XByt61c1SKMcwKo1PaoPeSvbXOx9ttOCSwoshNSq6GfyWPNUc3iHD3HEIeIfSnJ4G62i0RsLTNxpYfnMk5PjWL7KN83swOBBwYSubE2EWb2nphWADWZo6aeOnoxTcP6Rfl79rCq9P28xiNnV83QG8MVDnEpih2YXQZ5yP66TfoIv3Jth5kRWApANFg6trS6UPHsvEIRBUjknjqdLzuGUo86C76a1nXvTXKXiXOFKkpmdd1OZ2Km9ModpTFjLcNePOQYkrvpufMJFtBgyEfWSs52rzbpzTqZST7vmLPEI0iD2PuCCBHwx1P14n1HPfwNdvDezkllurmVodiE

Which I thought was the password at first, but ofcourse it wasn't :(

So I did a little bit of research and realised all the other players were using the following commands to cat / access the file: bandit5@bandit:~/inhere$ cat maybehere07/.file2

So the question is, what is the difference between:

bandit5@bandit:~/inhere/maybehere07$ cat ./-file2

and

bandit5@bandit:~/inhere$ cat maybehere07/.file2

and why has it produced that kind of output?

Thank you all in advance,

  • There is no difference... Assuming that you meant cat maybehere07/file2 – Andy Dalton Mar 12 '18 at 3:55
4
cat ./-file2

types out the file named -file2 in the current directory.

cat maybehere07/.file2

types out the file name .file2 in the maybeyere07 subdirectory.

In the first command, your current directory was maybehere07; in the second, your current directory was the parent of maybehere07. So if you had tried to cat the file .file2 in the first case, you would have gotten the same result as in the second case. But you tried to cat a DIFFERENT file, one whose name is -file2.

BTW, -file2 seems to be a binary file (image, sound, something else) which is why you get the gibberish you saw.

4

In step 3 you found a file named .file2 but in step 4a you access a file named -file2. That's not exactly the same name.

  • Small correction: those should be .file2 and -file2. – NickD Mar 12 '18 at 13:18
  • You're right, corrected it. – Hans-Martin Mosner Mar 12 '18 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.