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
stringsscans a binary file and prints sequences of printable characters above a minimum length.- Piping to
grep "=="filters for lines with=signs, matching the password entry.
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