All levels

Bandit · Level 32

Level 32

Login

SSH: ssh [email protected] -p 2220

Challenge URL: https://overthewire.org/wargames/bandit/bandit33.html

Task

After all this git stuff, it is time for another escape. Good luck!

Solution

In Linux, using printenv will give all the environment variables. Some common ones that are good to know:

VariableDescription
TERMCurrent terminal emulation
HOMEPath to home directory of currently logged in user
LANGCurrent locale settings
PATHDirectory list to be searched when executing commands
PWDPathname of the current working directory
SHELL / $0The path of the current user's shell (most important!)
USERCurrently logged-in user

Any command is converted to uppercase and executed, and there are no uppercase commands in Linux. Therefore, we need a way to start a normal terminal. $0 is the shell path - run it:

$0
whoami
cat /etc/bandit_pass/bandit33

Running whoami confirms it is actually logged in as bandit33.