Writeups OverTheWireBanditLinuxSSH

Bandit 0 Writeup - OverTheWire

Writeup for Bandit level 0 from OverTheWire: SSH login and reading a file.

Contents

Wargame: Bandit

Level: 0

Category: Linux Fundamentals

Description

Connect to the Bandit game server via SSH using the provided credentials and read the password for the next level from a file in the home directory.

Overview

Solution

Step 1: Connect via SSH

connect = pwn.ssh(host="bandit.labs.overthewire.org", user="bandit0", password="bandit0", port=2220)

Step 2: Read the Password File

channel = connect.system("ls")
files = channel.recv().decode().strip().split()

channel = connect.system(f"cat {files[0]}")
result = channel.recv().decode().strip()

Password

NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL

← Back to Blog