Bandit Level 7-8@overthewire.org
Description
The password for the next level is stored in the file data.txt next to the word millionth
Current level credentials
| Key | Value |
|---|---|
| Server-name: | bandit.labs.overthewire.org |
| Port: | 2220 |
| User: | bandit7 |
| Password: | z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S |
Current level login
Log in
1 | |
sshpass before using it. The ssh command can also be used on its own. If so, copy-paste the password when requested.
Hints And Solution
Hint(s)
Find out how to use grep to search for a string in a file.
you can cut out only the password. Use the command cut with the field separator option.
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
- use
grepwith the search stringmillionthon the filedata.txt cutout only the password. It's in field 2 of the line.
ls -alshows that the file data.txt is in the home directory. We can just use grep this time because we know where the file is located. Using the command grep "millionth" data.txt, we look for the term millionth within the file data.txt. The output is a line with two fields, the second of which is the password. As a result, we pipe the grep output to the cut command, wich only displays the second field.
Resources
Resources
Bandit-level8@overthewire
How To Use grep Command In Linux / UNIX With Practical Examples @cyberciti.biz
cut command in Linux with examples @geeksforgeeks.org
Comments
Any feedback and suggestions are welcome. This website was created using mkdocs and the material plugin. If you want, you can make a pull request. The repository is https://github.com/dabonzo/itsec_hp