← Back to Home

OverTheWire Bandit: Level 32 → Level 33

Technical Note

Context

After logging in to Level 32, we face a strange environment. Every command we type is converted to UPPERCASE, and since Linux commands are case-sensitive, nothing works.

ls
# Output: sh: LS: command not found

We are trapped in a special shell called “uppshell”.

Solution

The solution is deceptively simple. We need to execute a command that spawns a new shell, but without typing any letters that depend on case.

In shell scripting, $0 is a special variable that holds the name of the currently running program (the shell itself).

If we type $0, the uppshell expands this variable. Since $0 usually resolves to sh or bash (and numbers/symbols aren’t affected by uppercase conversion), it effectively executes:

sh

or

bash

Steps:

  1. Type $0 and press Enter. You will see a normal prompt (e.g., $).
  2. Verify access: Now you are in a regular shell! Try ls or whoami.
  3. Get the Password: The password is in the usual place:
    cat /etc/bandit_pass/bandit33

Key Takeaways

  1. Restricted Shells: These are custom environments designed to limit user actions.
  2. $0 Variable: Represents the name of the shell or script coming from the 0th argument. It’s a common way to spawn a new instance of the current shell.