Natas Level 10
Natas Level 10 — the site now filters dangerous characters; learn why blocklists fail and how a legitimate tool's own features can be bent to your purpose.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Username: natas10
URL: http://natas10.natas.labs.overthewire.org
Study guide
Level map: sign in as natas10 and find the password for natas11.
What this level teaches
Why filtering out “bad” characters is fragile, and how to achieve the goal using only characters that are allowed.
Key ideas
- Blocklist vs allow-list. A blocklist tries to list everything dangerous and always misses something; an allow-list accepts only what is known to be safe.
- Same program, different use. The command being run has options and arguments of its own. Even without chaining, you can steer what it searches and which files it reads.
- Read the manual. The program’s man page is as useful here as it was in Bandit.
How to approach it
- Compare this level’s code with the previous one and list what changed.
- Ask what the allowed characters still let you tell the command to do.
How developers prevent it
Do not construct shell commands from input. Use library functions that search text directly and never hand user data to a shell.