Writeups OverTheWireBanditLinux

Bandit 3 Writeup - OverTheWire

Writeup for Bandit level 3 from OverTheWire: finding a hidden file.

Contents

Wargame: Bandit

Level: 3

Category: Linux Fundamentals

Description

The password is in a hidden file inside the inhere directory. On Unix, files whose names start with . are hidden from plain ls output.

Overview

Solution

channel = connect.system("ls -la inhere")
files = channel.recv().decode().strip().split("\n")[3:]  # skip . and ..
hidden = [f.split()[-1] for f in files][0]

channel = connect.system(f"cat inhere/{hidden}")
result = channel.recv().decode().strip()

Password

2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe

← Back to Blog