Wargame: Bandit
Level: 32
Category: Linux Fundamentals
Description
The login shell is a custom “UPPERCASE SHELL” that converts all input to uppercase before executing it. Standard commands like cat become CAT which are not found. The goal is to escape to a normal shell.
Overview
$0is a special shell variable that expands to the name (or path) of the current shell.- In an interactive shell,
$0is the shell binary itself (e.g.,/bin/sh). - Typing
$0at the uppercase shell prompt executes/bin/sh, spawning a standard shell. - The uppercase shell converts
$0to$0(dollar and digit are not letters), so it reachesexecveunchanged.
Solution
>> $0
$ whoami
bandit33
$ cat /etc/bandit_pass/bandit33
Password
odHo63fHiFqcWWJG9rLiLDtPm45KzUKy