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

OverTheWire Bandit Level 5 → 6 tutorial!!

Login

Log in as bandit5 using the password you just obtained from Level 4 → 5.

ssh bandit5@bandit.labs.overthewire.org -p 2220
# password: 4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw

Why? Each Bandit level is a separate UNIX user. To solve 5 → 6, you must be the bandit5 user.

Task

Task

The password for the next level is stored somewhere under the directory inhere and the file has all of these properties:

  • human-readable
  • 1033 bytes in size
  • not executable

A little bit of Theory

  • Use find to search recursively by properties:

    • Regular file: -type f
    • Size in bytes: -size 1033c (the c means bytes)
    • Readable: -readable
    • Not executable: ! -executable
  • Chain the tests and print the match:

    find inhere -type f -size 1033c -readable ! -executable -print
    
  • Sometimes file may say “ASCII text, with very long lines (1000)” — that’s still human-readable.
  • Once you have the path, cat <path> to reveal the password.

Further reading:

Solution

  1. Inspect the inhere tree

    cd inhere && ls -la
    

    Why? Quick overview of the directory layout before searching.

Listing inhere

  1. Search for the file matching all constraints

    find .. -path '*/inhere/*' -type f -size 1033c -readable ! -executable -print
    # or, when already inside inhere:
    find . -type f -size 1033c -readable ! -executable -print
    

    Why? Returns the single file that meets all three conditions.

    Example result (from my run):

    inhere/maybehere07/.file2
    
  2. (Optional) Verify the type

    file inhere/maybehere07/.file2
    

    Why? Confirms it’s human-readable (e.g., ASCII text, with very long lines (1000)).

find output

  1. Print the password

    cat inhere/maybehere07/.file2
    

    Why? Outputs the content — the password for the next level.

cat target

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

  2. Log into the next level (bandit6)

    exit
    ssh bandit6@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.

HWasnPhtq9AVKe0dmk45nxy20cvUa6EG

Troubleshooting

  • No results from find? → Ensure the c after 1033 (bytes), and include ! -executable.
  • Unsure which one is text? → file <path> should say ASCII text (possibly with extra notes about long lines).
  • Permission issues → Make sure you’re the right user (bandit5) and searching under inhere.

Congrats 🎉 You found the uniquely matching file and can now play as bandit6.


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