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

OverTheWire Bandit Level 28 → 29 tutorial!!

Login

Log in as bandit28 using the password you obtained from Level 27 → 28.

ssh bandit28@bandit.labs.overthewire.org -p 2220
# password: Yz9IpL0sBcCeuG7m9uQFt8ZNpS4HZRcN

Why? Each Bandit level is a separate UNIX user. To solve 28 → 29, you must be the bandit28 user.

Task

Task placeholder

There is a git repository at:

ssh://bandit28-git@localhost:2220/home/bandit28-git/repo

The password for bandit28-git is the same as for bandit28. Clone the repo and find the password for bandit29.

A little bit of Theory

  • Git keeps full history; removing a secret in a later commit doesn’t erase it from older commits.
  • git log shows commit history; git show <commit> displays the changes/content for that commit.
  • Look for a commit message like “fix info leak”—that’s a classic hint the password was present before.

Further reading:

Solution

  1. Clone the repository to a writable temp folder

    WORKDIR=$(mktemp -d)
    cd "$WORKDIR"
    git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/repo "repo-$RANDOM"
    cd repo-*
    

    Why? /tmp is writable for us, and the remote user bandit28-git authenticates with your bandit28 password.

    git clone placeholder

  2. Open the README to see what’s currently shown

    ls -la
    cat README.md
    

    Why? The README usually mentions credentials but hides the password (often as xxxxxxxxxx). That’s your hint to check history.

    readme placeholder

  3. List commit history and spot the suspicious one

    git log --oneline --decorate
    

    Why? You’ll typically see something like: fix info leak, add missing data, initial commit. The “fix info leak” commit suggests a secret was removed.

    git log placeholder

  4. Show the diff of the leaking commit

    # replace <hash> with the commit ID of "fix info leak"
    git show <hash>
    

    Why? The diff reveals that the README used to contain the actual password before it was redacted to xxxxxxxxxx.

    git show placeholder


Password

This is the password revealed by the leaking commit on my run:

4pT1t5DENaYuqnqvadYs1oE4QLCdjmJ7

Troubleshooting

  • Permission denied (publickey) → You’ll be prompted for bandit28’s password when cloning as bandit28-git@localhost on port 2220.
  • “not a git repository”cd into the cloned directory (e.g., cd repo-*) before running git log / git show.
  • Commit not found → Use git log --oneline to copy the exact hash of the “fix info leak” commit.
  • Nothing in README → That’s expected in the latest commit; the secret lives in the older revision’s diff.

Congrats 🎉 You performed git history forensics to recover a removed secret and unlocked bandit29!


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