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

OverTheWire Bandit Level 29 → 30 tutorial!!

Login

Log in as bandit29 using the password you obtained from Level 28 → 29.

ssh bandit29@bandit.labs.overthewire.org -p 2220
# password: 4pT1t5DENaYuqnqvadYs1oE4QLCdjmJ7

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

Task

Task placeholder

There is a git repository at ssh://bandit29-git@localhost:2220/home/bandit29-git/repo The password for bandit29-git is the same as for bandit29. Clone the repo and find the password for bandit30.

A little bit of Theory

  • Git projects can use branches. Production code typically lives on master, while work-in-progress lives on branches like dev.
  • Use git branch -a to list local and remote branches.
  • Switch with git checkout <branch> (or git switch <branch>).
  • Secrets are often left in non-master branches (e.g., dev).

Further reading:

Solution

  1. Clone the repository into a writable temp dir

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

    Why? /tmp is writable. When prompted for bandit29-git@localhost’s password, use your bandit29 password.

    git clone placeholder

  2. List what’s in the repo (on master)

    ls -la
    cat README.md
    

    Why? A quick peek shows the hint: the master README usually says something like “no passwords in production!”, nudging us toward another branch.

    repo contents placeholder

  3. Check what branches exist

    git branch -a
    

    Why? We expect additional remote branches (e.g., origin/dev, maybe origin/sploits-dev) that may contain the secret.

    branches placeholder

  4. Switch to the dev branch

    git checkout dev     # or: git switch dev
    

    Why? The README on master said “no passwords in production,” hinting the dev branch holds it.

    checkout placeholder

  5. Read the README on dev

    cat README.md
    

    Why? The credentials for the next level are stored right in the development branch’s README.

    readme placeholder

Password

This is the password I got for bandit30 (from the dev branch README):

qp30ex3VLz5MDG1n91YowTv4Q8l7CDZL

Troubleshooting

  • “Permission denied (publickey)” → Make sure you used ssh://bandit29-git@localhost:2220/... and typed the bandit29 password at the prompt.
  • No dev branch? → Run git fetch --all then git branch -a again.
  • Detached HEAD or mistakesgit switch - jumps back to the previous branch; git status shows where you are.

Congrats 🎉 You explored git branches and dug the secret out of the dev branch. On to bandit30!


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