Bandit Level 33
Bandit Level 33 — escape from a shell that converts everything you type to uppercase.
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level Goal
After all this git stuff, it’s time for another escape. Good luck!
Commands you may need to solve this level
sh, man
Study guide
Level map: logged in as bandit32, find the password for bandit33.
What this level teaches
How shell parameters and expansions work, by being forced to use only characters that survive uppercase conversion.
Key ideas
- Commands are case-sensitive.
LSis notls, so a shell that upper-cases input rejects normal commands. - Special parameters. The shell defines variables such as the name of the running shell and the number of arguments. These are written with symbols and digits that uppercase conversion cannot change.
- Expansions replace such a parameter with its value before the command runs, so you can obtain a lowercase command indirectly.
- Read the “Special Parameters” section of
man bash.
How to approach it
- Log in and observe exactly what the restricted program does to your input.
- Search the bash manual for parameters that are not letters.
- Think about what program that parameter’s value would run, and what you could do from there.
Why it matters
Input filters and blocklists are routinely bypassed by features of the interpreter behind them. This is the mindset behind many web and shell injection techniques.