Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Bandit Level 5 Level 6
Christian Paez
Christian Paez

Posted on

     

Bandit Level 5 Level 6

Introduction

Bandit 6 is the seventh level of the OverTheWire Bandit wargame, we are tasked with finding a file within a directory hierarchy and extracting a password from that file.

Steps

  1. Connect to the remote server using SSH by running the following command in your terminal:

    ssh bandit5@bandit.labs.overthewire.org -p 2220

    You will be prompted to enter the password for Bandit level 6, which islrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR. Enter the password and hit enter.

  2. Once you have successfully logged in, navigate to theinhere directory by running the following command:

    cd inhere/

    This directory contains a number of subdirectories and files, and our task is to find the file containing the password.

  3. To find the file, we can use thefind command with a combination of flags to search for files that meet certain criteria. In this case, we want to find files that are not executable and have a size of exactly 1033 bytes. We can use the following command:

    find . -type f -not -executable -size 1033c

    This will return a list of files that meet the criteria.

  4. Next, we want to check the contents of each file in the list to see if it contains the password. We can use thefile command to check if each file is an ASCII text file, and then usecat to print the contents of any file that matches the criteria. We can use the following command:

    find . -type f -not -executable -size 1033c | xargs file | grep "ASCII text" | awk -F: '{print $1}' | xargs cat

    This will print the contents of any file that is an ASCII text file and has a size of 1033 bytes and is not executable.

  5. The password is located in the file/home/bandit6/inhere/maybehere07/.file2. Use the following command to print the contents of the file:

    cat /home/bandit6/inhere/maybehere07/.file2

    This will output the password, which isP4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU.

Congratulations! You have successfully completed Bandit level 6.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Software and Data Science
  • Joined

More fromChristian Paez

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp