Writeups OverTheWireBanditLinux

Bandit 4 Writeup - OverTheWire

Writeup for Bandit level 4 from OverTheWire: finding the only human-readable file.

Contents

Wargame: Bandit

Level: 4

Category: Linux Fundamentals

Description

The inhere directory contains several files named -file00 through -file09. Only one is human-readable (ASCII text); the rest contain binary data. The goal is to identify and read the correct one.

Overview

Solution

for f in inhere_files:
    channel = connect.system(f"file inhere/{f}")
    output = channel.recv().decode().strip()
    if "ASCII text" in output:
        channel = connect.system(f"cat inhere/{f}")
        result = channel.recv().decode().strip()
        break

Password

lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR

← Back to Blog