DEV Community

Cover image for Bandit Level 7 Level 8
Christian Paez
Christian Paez

Posted on

Bandit Level 7 Level 8

Introduction

Bandit level 8 is all about finding a specific word in a file and extracting its value. In this level, we are given a file called data.txt and are tasked with finding the value of a specific word.

Steps

  1. Connect to the Bandit server using SSH with the following command:
ssh bandit7@bandit.labs.overthewire.org -p 2220
Enter fullscreen mode Exit fullscreen mode
  1. Enter the password for Bandit level 8 when prompted: z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S.
  2. We are given a file called data.txt. Use the cat command to view the contents of the file:
cat data.txt
Enter fullscreen mode Exit fullscreen mode
  1. We are tasked with finding the value of the word "millionth" in the file. To accomplish this, we can use the grep command to search for the word, and then use the awk command to extract its value. The command to do this is as follows:
cat data.txt | grep millionth | awk -F " " '{print $2}'
Enter fullscreen mode Exit fullscreen mode
  1. After running the command, the value of the word "millionth" will be displayed in the terminal.
TESKZC0XvTetK0S9xNwm25STk5iWrBvP
Enter fullscreen mode Exit fullscreen mode

Conclusion

In this level, we learned how to search for a specific word in a file using the grep command and how to extract its value using the awk command. With this knowledge, we were able to successfully complete the level and obtain the password for the next level.

Top comments (2)

Collapse
 
batuecas46 profile image
julio cesar batuecas

recien pude entrar con este serial se me trabo mal probe de todo reinstale todo
y buscando pummmmm...probe esta passwd y adentro...

TESKZC0XvTetK0S9xNwm25STk5iWrBvP lo que me llama la atencion que tengo la otra que me da el ejercicio UTcorS4PSCYINhhArZ2KlPSzVbcx8Ri1

pero bueno gracias super

Collapse
 
christianpaez profile image
Christian Paez

De nada Julio, si necesitas ayuda con algo de Bandit puedes comentar, saludos.