Avatar
Part time CTF Player learn every day!!
🌠 I Love Hoshimachi Suisei!! 🌠
🌠 I Love Hoshimachi Suisei!! 🌠

OverTheWire Bandit Level 7 → 8 tutorial!!

Login

Log in as bandit7 using the password you just obtained from Level 6 → 7.

ssh bandit7@bandit.labs.overthewire.org -p 2220
# password: morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj

Why? Each Bandit level is a separate UNIX user. To solve 7 → 8, you must be the bandit7 user.

Task

Task

The password for the next level is stored in the file data.txt and is on the same line as the word millionth.

A little bit of Theory

  • grep searches for lines that match a pattern.

    • Basic: grep PATTERN FILE
    • With line numbers: grep -n PATTERN FILE
    • Match a whole word: grep -w PATTERN FILE
  • The output line typically looks like: millionth <password> → copy the second field. You can also extract it with awk or cut.

Further reading:

Solution

  1. Verify the file is present

    ls -l
    

    Why? Sanity check; the challenge states data.txt is here.

ls data.txt

  1. Search for the keyword

    grep -nw 'millionth' data.txt
    

    Why? -n shows the line number; -w forces a whole-word match.

  2. (Optional) Extract only the password

    awk '/\bmillionth\b/ {print $2}' data.txt
    # or:
    grep -w 'millionth' data.txt | cut -d' ' -f2
    

    Why? Prints just the second field (the password) — copy-friendly.

extract password

  1. Copy the password (no extra spaces/newlines).

  2. Log into the next level (bandit8)

    exit
    ssh bandit8@bandit.labs.overthewire.org -p 2220
    # paste the password you just found when prompted
    

Password

This is the password shown in my run; if yours differs, copy the one from your own terminal output.

dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc

Troubleshooting

  • grep: data.txt: No such file or directory → Check pwd; you should be in /home/bandit7.
  • Multiple matches? → Use -w to match the whole word.
  • Output formatting odd? → Use awk/cut as shown to isolate the second field.

Congrats 🎉 You plucked the right line out of a huge file and can now play as bandit8.


Thanks for reading!

Until next time — Otsumachi!! 💖☄️✨

Cinema

all tags

GOT-overwrite aboutme aead ai alphanumeric-shellcode apt argc0 argon2 aslr assembly asymmetric atoi automation backbox bandit base64 bash beginner behemoth binary binary-exploitation binary-to-ascii blackarch blind blind-sqli blogging blue-team bruteforce buffer-overflow buffer-overwrite c caesar canary capabilities checksec command-injection commonmark cookie cron crypto cryptography ctf cutter cyberchef cybersecurity defenders detection dev directory-traversal dnf docs drifter ecc education elf env envp exploitation finale forensics format-string formulaone frequency frequency-analysis gcc gdb getchar gfm ghidra github-pages governance gpg guide hashing hkdf http jekyll jmpbuf kali kasiski kdf kernel keylength kramdown krypton lab ld_preload leviathan lfi lfsr linux linux-syscall llmops log-poisoning ltrace manpage markdown maze memcpy mitigations mitmproxy mlops narnia natas networking newline-injection nonce nop-sled nx object-injection obsidian openssl osint overflow overthewire package-manager pacman parrot path path-hijacking pathname php pie pkc pki pointer-trick pqc priv-esc privilege-escalation provable-security pwn pwntools pyshark python race-condition radare2 rag randomness recon red-team redirect relro requests ret2env ret2libc reverse-engineering reversing ricing roadmap rop rot13 rsa scapy security seed seo serialization session setjmp-longjmp setuid shell shellcode smoke soc sockets sprintf sql-injection srop stack-canary stack-overflow strace strcmp strcpy streamcipher strings strncpy strtoul substitution suid suisei symlink symmetric terminal test threat-intel time-based tls troubleshooting tshark type-juggling ubuntu udp utumno vigenere virtualbox virtualization vmware vortex walkthrough web windows wireshark writing wsl x86
dash theme for Jekyll by bitbrain made with