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/bandit8.md
URL /wargames/bandit/bandit8/
Date 2026-04-07

Bandit Level 8

Bandit Level 8 — find one line in a large text file with grep.

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 in the file data.txt next to the word millionth

Commands you may need to solve this level

man, grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd

Study guide

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

What this level teaches

Searching inside files rather than for them: grep, the tool you will use more than any other for log and data analysis.

Key ideas

  • grep PATTERN FILE prints every line that contains the pattern.
  • Line-oriented thinking. Unix text tools treat each line as a record; the password is on the same line as the marker word.
  • Options like -i (ignore case), -n (show line numbers) and -r (recurse) turn grep into a general search tool.

How to approach it

  1. Look at the file’s size first (ls -l, wc -l). Reading a huge file by eye is the wrong approach.
  2. Search for the marker word named in the Level Goal and read the line that comes back.

Why it matters

Log analysis, code search and threat hunting all begin with grep. Learning it early makes every later level faster.