Exploring OverTheWire: Level 2 to Level 3 - Bandit Challenge

📆 · ⏳ 2 min read · · 👀

Introduction

As we delve deeper into the Bandit Challenge, Level 3 ↗️ presents us with a file containing spaces in its filename. Our mission is to locate and extract the password stored within this file, residing in the home directory.

Challenge Overview

💡

Level 3 introduces us to the challenge of working with filenames that contain spaces. We need to identify the file called “spaces in this filename” and retrieve the password stored within.

By utilizing commands like ls, cd, and cat we’ll navigate the file system, examine the file’s contents, and uncover the password.

Approach and Strategy

Follow these steps to successfully solve Level 3:

Terminal window
ssh [email protected] -p 2220

Enter the password you obtained from the previous level.

Once logged in, execute the following command to view the files in the home directory, including file permissions and ownership.:

Terminal window
ls -l

In the list, you will find the file named "spaces in this filename". To view its contents, use the cat command:

Terminal window
cat "spaces in this filename"

Note: Enclosing the filename in quotes allows the system to interpret the spaces correctly.

Another way of accessing the file with spaces is to escape the spaces with a backslash:

Terminal window
cat spaces\ in\ this\ filename

Choose whichever method you prefer to access the file.

The password for Level 3 will be displayed in the output. Take note of it for the next level.

Lessons Learned

Level 3 taught us the importance of handling spaces in filenames correctly. By enclosing the filename in quotes or using bashslashes, we successfully accessed the file and retrieved the password.

Notes

  • When working with filenames containing spaces, enclose the filename in quotes to ensure proper interpretation.
  • Alternatively, escape the spaces with a backslash to access the file.

Conclusion

Congratulations on completing Level 3 of the Bandit Challenge! We skillfully navigated the file system and successfully accessed the file with spaces in its filename.

Stay tuned for the next blog post, where we’ll embark on Level 4 and face new challenges in our quest for cybersecurity expertise.

You may also like

  • # overthewire

    Exploring OverTheWire: Level 15 to Level 16 - Bandit Challenge

    Welcome back to our captivating journey through the Bandit Challenge! In this blog post, we're poised to conquer Level 16, where the path to victory lies in submitting the current level's password to a specific port on localhost using SSL encryption. Join me as we navigate through secure socket layers, SSL encryption, and gain access to the coveted password. Let's dive in!

  • # overthewire

    Exploring OverTheWire: Level 14 to Level 15 - Bandit Challenge

    Welcome back to our enthralling voyage through the Bandit Challenge! In this blog post, we're set to conquer Level 15, where the key to success lies in submitting the current level's password to a specific port on localhost. Join me as we delve into port communication, networking concepts, and gain access to the coveted password. Let's dive in!

  • # overthewire

    Exploring OverTheWire: Level 13 to Level 14 - Bandit Challenge

    Welcome back to our adventurous journey through the Bandit Challenge! In this blog post, we'll conquer Level 14, where we'll obtain a private SSH key that grants us access to the next level. Join me as we navigate through secure connections, employ cryptographic tools, and use the obtained key to log into the next level. Let's dive in!