Logo
Published on
views

Bandit 29 Writeup

Authors
  • Name
    Pablo
    Twitter
    @pablousu
  • Name
    Maylen Echavez
    Twitter

Concepts to consider

Git branch

A Git branch is a separate line of development in a repository. It allows you to work on different features or fixes independently. The default branch is usually main or master. You can create new branches, switch between them, and merge them back together. This helps in managing parallel work without interfering with the main codebase.

bandit 29

Task

There is a git repository at ssh://bandit29-git@localhost/home/bandit29-git/repo via the port 2220. The password for the user bandit29-git is the same as for the user bandit29.

Clone the repository and find the password for the next level.

Solution

We enter the repository and see the readme file.

cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.

## credentials

- username: bandit30
- password: <no passwords in production!>

We notice that the credentials are not included in the production version, so they must be on another branch.

bandit29@bandit:/tmp/tmp.iUVr8rmYHO/repo$ git checkout
dev                  master               origin/HEAD          origin/sploits-dev
HEAD                 origin/dev           origin/master        sploits-dev

We check out the dev branch and see the updated readme file.

bandit29@bandit:/tmp/tmp.iUVr8rmYHO/repo$ git checkout dev
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Switched to a new branch 'dev'
bandit29@bandit:/tmp/tmp.iUVr8rmYHO/repo$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.

## credentials

- username: bandit30
- password: xbhV3HpNGlTIdnjUrdAlPzc2L6y9EOnS