Home - Writeups - Bandit Overthewire wargames walkthrough level 31 – 33

Bandit Overthewire wargames walkthrough level 31 – 33

Bandit is a game for beginners in Linux and Bash. As it is a great guide for learning the command line and Linux. So we will continue with the game here is the link for the next level.

Bandit overthewire wargames level 26 – 30

Level 31→33

  • Host: bandit.labs.overthewire.org
  • port: 2220

bandit level 30 → 31

As we are instructed we have to get a git repository and find the password in it. First, we will make a temporary directory in /tmp folder then we will use “git clone” to download the repository in our temporary folder. Then we will enter the password of the git repository the same as the password of the bandit 30 user.

bandit level 30

After that, we use different commands to get more information about the repository. Firstly, we use git log to see the logs for all the commits that have been made. Secondly, we use the git branch to see all the branches of the git repository. Lastly, we use git tag, Git has the ability to tag specific points in a repository’s history as being important. After that, we use the git show command to get the secret tag.

git
  • git tag
  • git show secret

bandit level 31 → 32

As we are instructed we have to get a git repository and find the password in it. First, we will make a temporary directory in /tmp folder then we will use “git clone” to download the repository in our temporary folder. Then we will enter the password of the git repository the same as the password of the bandit 31 user.

bandit level 31

After downloading the git repository we get the contents of README.md. As we see it tells us to create a file, then add some content to it and push it to the master branch. Therefore we use echo command for the contents of the file and use the stdout “>” operator to store it to the file. After that we use git add command to add the file to the staging area. But we see a warning that this file is ignored by git repository. All the information related to ignored files is stored in the .gitignore file.

git push
  • cd repo
  • cat README.md
  • echo “May I come in?” > key.txt
  • git add key.txt

So to add the ignored file first we remove .gitignore file. Then add key.txt using git add command. After that we use git commit command to commit the change. In the end we use git push origin master to push the changes of local master branch to remote master branch.

origin master
  • rm .gitignore
  • git add key.txt
  • git commit -m”Adding key.txt”
  • git push origin master

After following all the step we get password in the end.

git push

bandit level 32 → 33

As we login to bandit32 we see a message welcome to the uppercase shell. The message on the site was one last escape so we use $0 to get the shell. Then we verify it by using command pwd. After that we ls -l command to see the information of files along with its ownership and permission. After that we see file uppershell has ownership by bandit33. In other words we can access password of /etc/bandit_pass/bandit33. So we use cat command to get the password.

bandit level 33
  • $0
  • pwd
  • ls -l
  • cat /etc/bandit_pass/bandit33

bandit level 33

This is the final level of bandit overthewire wargames. As we use cat command to read the content of README.txt. In conclusion its a fun game and in the end message from team of bandit wargames. The game finished here. Hope to see you all for other articles and walkthroughs.

  • ls
  • cat README.md

Command we learned.

Bandit overthewire wargames level 26 – 30

Share
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x