OverTheWire Bandit: Level 29 → Level 30
Context
We have cloned the repository for this level. Like the previous level, the README.md file in the main branch is empty or doesn’t contain the password.
If the password isn’t in the history (we checked git log and found nothing useful), maybe it’s in a different Branch.
Solution
Step 1: Clone the Repo (Outside)
As usual, clone the repository from your local machine to avoid the localhost block:
git clone ssh://bandit29-git@bandit.labs.overthewire.org:2220/home/bandit29-git/repo
(Password from Level 28)
Step 2: List Branches
Enter the directory and list all available branches (including remote ones):
cd repo
git branch -r
# Output might look like:
# origin/HEAD -> origin/master
# origin/dev
# origin/master
You should see a branch named origin/dev or similar. This is a separate line of development that might contain different files or versions of files.
Step 3: Switch Branch
To see the files in that branch, we need to “checkout” that branch:
git checkout dev
Now, check the README.md file again:
cat README.md
The password for bandit30 should be right there!
Key Takeaways
- Git Branches: Branches allow developers to work on features in isolation. They effectively create parallel versions of the project.
- Exploring Branches:
git branch -a(or-rfor remote) shows you what branches exist.git checkout <branch_name>switches your working directory to that branch.