DEV Community

Krishna
Krishna

Posted on

2

OverTheWire Bandit Level 2 Level 3 walk-through

Challenge page => https://overthewire.org/wargames/bandit/bandit3.html

This challenge is very similar to the previous one, as it also involves reading the password from a file with a tricky file name.

The file name where the password resides contains spaces. Now if you've ever had anything to do with filenames on the command lines, you already know how to do this. Its all right if you don't know. By the end of this, you will!


Hint 1: Just google it! "How to read filenames with spaces". There are multiple ways to do this.


You found it didn't you? Awesome.

There's basically two ways you can read a file whose name contains spaces. Both ways ensure that your shell does not interpret the words in the file name as command arguments.

Solution

The first way is to escape the spaces with a backward slash.

The second way is to place quotes around the filename. Both are shown in the below picture.

bandit3

P.S: You can also get the shell to autocomplete the filename for you, by typing a couple of letters in the first word of the file name, and then pressing TAB

Happy Hacking!

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay