Bandit 27 → 28
Goal: clone the level’s git repository and read the password it stores.
Approach
Section titled “Approach”bandit27@bandit:~$ cd "$(mktemp -d)"bandit27@bandit:/tmp/tmp.NxwmnLaKZF$ git clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repo.gitCloning into 'repo'...bandit27@bandit:/tmp/tmp.NxwmnLaKZF$ cat repo/READMEThe password to the next level is: <password>Password
Yz9IpL0sBcCeuG7m9uQFt8ZNpS4HZRcNWhy it works
Section titled “Why it works”A Git remote you can authenticate to is just a readable data source. Using git clone copies the working tree (and the full history) to a directory you own, so a secret committed into the README comes along with it. This is the setup for the next three levels, which all mine a Git repository.