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 20 to Level 21 - Bandit Challenge

    Welcome back to our captivating journey through the Bandit Challenge! In this blog post, we're geared up to conquer Level 21, where a setuid binary introduces a novel challenge involving network connections. Join me as we delve into the mechanics of connecting to localhost, reading text, and successfully obtaining the password to proceed. Let's dive in!

  • # overthewire

    Exploring OverTheWire: Level 19 to Level 20 - Bandit Challenge

    Welcome back to our thrilling journey through the Bandit Challenge! In this blog post, we're poised to conquer Level 20, where we encounter a setuid binary that holds the key to our progress. Join me as we explore the concept of setuid binaries, learn how to execute them, and successfully uncover the password to continue our journey. Let's dive in!

  • # overthewire

    Exploring OverTheWire: Level 18 to Level 19 - Bandit Challenge

    Welcome back to our riveting journey through the Bandit Challenge! In this blog post, we're set to conquer Level 19, where a password is concealed within a file. However, a clever twist awaits us—someone has tampered with the system to log us out during SSH login. Join me as we navigate through this challenge using commands like ssh, ls, and cat, all while devising strategies to overcome the unexpected hurdle. Let's dive in!