Writeups OverTheWireBanditLinuxSSHBash

Bandit 18 Writeup - OverTheWire

Writeup for Bandit level 18 from OverTheWire: bypassing a modified .bashrc that logs you out.

Contents

Wargame: Bandit

Level: 18

Category: Linux Fundamentals

Description

.bashrc has been modified to run exit immediately, so interactive SSH sessions terminate right away. The password is in readme in the home directory.

Overview

Solution

connect = pwn.ssh(host=hostname, user="bandit18", password=password, port=2220)
channel = connect.system("cat readme")
result = channel.recv().decode().strip()

Password

awhqfNnAbc1naukrpqDYcF95h7HoMTrC

← Back to Blog