DEV Community

Cover image for ๐Ÿ•น๏ธ My First Steps in OverTheWire Bandit (Levels 0โ€“5) ๐ŸŽฎ
Sriram Bharath
Sriram Bharath

Posted on

๐Ÿ•น๏ธ My First Steps in OverTheWire Bandit (Levels 0โ€“5) ๐ŸŽฎ

Hey friends ๐Ÿ‘‹,

Today I started the OverTheWire Bandit challenges โ€” a playground where you learn real Linux + security skills by solving tiny puzzles.

It felt like a game where each level teaches you one new โ€œhacker move.โ€ Hereโ€™s my journey from Level 0 to Level 4, explained like Iโ€™d tell a friend.


๐Ÿ”‘ Level 0 โ€” Meeting SSH for the First Time

At first, I had no idea what SSH was. After running man ssh, I learned:

SSH (Secure Shell) lets you control another computer securely from far away.

To connect to Bandit, I used:

ssh -p 2220 bandit0@bandit.labs.overthewire.org
# password: bandit0
Enter fullscreen mode Exit fullscreen mode

This dropped me into another computer like stepping into a remote terminal. Boom ๐ŸŽ‰, Level 0 cleared.


๐Ÿ“– Level 1 โ€” The Dreaded โ€œDashโ€ File

I logged into bandit1 and ran:

ls
Enter fullscreen mode Exit fullscreen mode

It showed a file, but its name started with a dash (-). Thatโ€™s tricky, because most commands treat anything starting with - as an option.

For example, cat -n means โ€œcat with line numbers.โ€ So if you just type cat -, the command thinks itโ€™s a flag, not a filename.

๐Ÿ’ก Solution: explicitly tell Linux โ€œthis is a file in the current directoryโ€:

cat ./-
Enter fullscreen mode Exit fullscreen mode

That way, ./ points to this directory and avoids confusion.

๐ŸŽ‰ Password revealed โœ….


๐Ÿ“ Level 2 โ€” Spaces in Filenames (oof)

This one made me suffer. The file literally had spaces in its name:

--spaces in this filename--
Enter fullscreen mode Exit fullscreen mode

Spaces confuse the shell, because it thinks each word is a separate argument. I tried a bunch of tricks, but what worked was:

cat -- "--spaces in this filename--"
Enter fullscreen mode Exit fullscreen mode

Hereโ€™s why it works:

  • -- tells the command: stop parsing options, everything after this is just a filename.
  • Quoting the name "..." ensures spaces are treated as part of one filename, not multiple.

Lesson learned: avoid spaces in filenames if you can. Use - or _ instead.


๐Ÿ‘€ Level 3 โ€” Hidden, But Not Really

At first glance, the folder looked empty:

ls
Enter fullscreen mode Exit fullscreen mode

But I knew better. Linux hides files starting with a dot (.). To see them, you need:

ls -a
Enter fullscreen mode Exit fullscreen mode

And boom, I spotted a sneaky file:

...Hiding-From-You
Enter fullscreen mode Exit fullscreen mode

I opened it with:

cat "...Hiding-From-You"
Enter fullscreen mode Exit fullscreen mode

and there was the password ๐ŸŽ‰.

โšก Quick tip:

  • ls โ†’ shows only normal files.
  • ls -a โ†’ shows all files, including hidden ones.

๐Ÿ—‚๏ธ Level 4 โ€” Too Many Files, Which One?

Inside inhere/, I found multiple files. Instead of opening each one, I asked Linux:

file -- ./*
Enter fullscreen mode Exit fullscreen mode

This command checks every file and tells you what type it is (text, binary, etc.).

Breakdown:

  • file โ†’ tells the type of a file.
  • -- โ†’ again, stop treating things as options.
  • ./* โ†’ means โ€œall files in the current folder.โ€

One of them was marked as plain text. I catโ€™d it and got the password ๐Ÿš€.


๐ŸŽฏ Quick Recap (Levels 0โ€“4)

  • SSH โ†’ secure remote access (ssh -p 2220 user@host).
  • Files starting with - โ†’ use ./- or --.
  • Filenames with spaces โ†’ wrap in quotes, use --.
  • Hidden files โ†’ ls -a (or -A).
  • Too many files? โ†’ file -- ./* finds the right one.

๐Ÿ Wrapping Up

These first few levels taught me something super important: itโ€™s not about memorising commands, itโ€™s about learning how the shell thinks.

Every tricky filename, every hidden file, every โ€œwhy wonโ€™t this work?!โ€ moment is preparing me to think like both a hacker and a problem solver.

This is just the beginning โ€” and I can already see how much fun this journey will be.

Canโ€™t wait to dive into the next levels and share what I learn! ๐Ÿš€

โ€œStay curious, keep exploring, and remember: with great power comes great responsibility.โ€ ๐Ÿ•ท๏ธ

โ€” Sriram Bharath (Gh0stSh3ll) ๐Ÿ‘ป

Top comments (0)