Writeups OverTheWireBanditLinuxstrings

Bandit 9 Writeup - OverTheWire

Writeup for Bandit level 9 from OverTheWire: extracting strings from a binary file.

Contents

Wargame: Bandit

Level: 9

Category: Linux Fundamentals

Description

data.txt is a binary file. The password is one of the few human-readable strings in it, preceded by several = characters.

Overview

Solution

channel = connect.system("strings data.txt | grep ==")
options = channel.recv().decode().strip().splitlines()
options = [s.replace("=", "").strip() for s in options]
result = sorted(options, key=len)[-1]

Password

G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s

← Back to Blog