Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/bandit/bandit7.md
URL /wargames/bandit/bandit7/
Date 2026-04-07

Bandit Level 7

Bandit Level 7 — search the whole server with find for a file owned by a given user and group, and silence permission errors.

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Level Goal

The password for the next level is stored somewhere on the server and has all of the following properties:

  • owned by user bandit7
  • owned by group bandit6
  • 33 bytes in size

Commands you may need to solve this level

ls , cd , cat , file , du , find , grep

Study guide

Level map: logged in as bandit6, find the password for bandit7.

What this level teaches

Using find on the entire filesystem with ownership filters, and handling the flood of “Permission denied” messages that results.

Key ideas

  • Ownership. Every file has an owning user and group; find can filter on both with -user and -group.
  • Standard streams. Programs write results to stdout (file descriptor 1) and errors to stderr (2). Redirecting stderr with 2>/dev/null discards the noise without hiding results.
  • /dev/null is a special file that swallows everything written to it.
  • Search scope. Starting from / means every directory you cannot read produces an error.

How to approach it

  1. Combine ownership and size tests, starting your search at /.
  2. Redirect only stderr, so genuine results stay visible.
  3. Read the single remaining match.

Why it matters

Tracking down files by owner is how administrators audit permissions, and redirection is the basis of every shell pipeline you will write.