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



This content originally appeared on DEV Community and was authored by Sriram Bharath

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

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

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 ./-

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

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--"

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

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

ls -a

And boom, I spotted a sneaky file:

...Hiding-From-You

I opened it with:

cat "...Hiding-From-You"

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 -- ./*

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) 👻


This content originally appeared on DEV Community and was authored by Sriram Bharath