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
- SSH (Secure Shell) is the standard tool for remote terminal access over an encrypted channel.
- The password file is named
readmeand sits in the home directory. - Reading it with
catgives the password for bandit1.
Solution
Step 1: Connect via SSH
- Connect to
bandit.labs.overthewire.orgon port 2220 as userbandit0with passwordbandit0.
connect = pwn.ssh(host="bandit.labs.overthewire.org", user="bandit0", password="bandit0", port=2220)
Step 2: Read the Password File
- List the home directory and read the
readmefile.
channel = connect.system("ls")
files = channel.recv().decode().strip().split()
channel = connect.system(f"cat {files[0]}")
result = channel.recv().decode().strip()
Password
NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL