Writeups OverTheWireBanditLinux

Bandit 2 Writeup - OverTheWire

Writeup for Bandit level 2 from OverTheWire: reading a file with spaces in the name.

Contents

Wargame: Bandit

Level: 2

Category: Linux Fundamentals

Description

The password is stored in a file named spaces in this filename in the home directory. Passing the name unquoted to cat splits it into separate arguments.

Overview

Solution

channel = connect.system('cat "spaces in this filename"')
result = channel.recv().decode().strip()

Password

aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG

← Back to Blog