Bait A Phish
Bait A Phish
Security Pulse
tutorial · bandit

Bandit Level 2

Handle spaces in filenames safely (quotes and escaping).
banditfilesquoting
Narration (cached)
Marks this level complete in your browser.

Goal

The password for the next level is stored in a file with spaces in the name.

Key concept

Shells split on spaces. So you must either:

Steps

  1. SSH in:
ssh bandit2@bandit.labs.overthewire.org -p 2220
  1. List files:
ls
  1. Read the file:

Option A (recommended): quotes

cat "spaces in this filename"

Option B: escape spaces

cat spaces\ in\ this\ filename

That output is the password for Level 3.

Notes

Bandit Level 1Bandit Level 3