Bandit 10
Objective
Level GoalThe password for the next level is stored in the file data.txt in one of the few human-readable strings, beginning with several ‘=’ characters
Solution
so we need to find text in the data.txt file that has several == characther.
first I tried just a grep for == in data.txt
grep complains that is a binary file not a text file
so let try again with the -a switch
here is the man about grep for -a
-a, --text Process a binary file as if it were text; this is equivalent to the --binary-files=text option.
***edited out some the results to make it more readable
bandit9@bandit:~$ grep -a "==" data.txt g͇�#/y�Ú¹c4|�"�X����m���Y��GB7�Õ³&�Õ¥��p����s#�k&K��1��s��֯F�B0�2========== the�X�#��!�n�~�
pretty ugly but we can see right here at the end of the search the password for the next level is
truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk
Now in Python
with open("data.txt", "rb") as text_file: for line in text_file: if "===" in line:
once again out put is kinda ugly and has been scrubbed a bit, put you can see the password
g͇�#/y�Ú¹c4|�"�X����m���Y��GB7�Õ³&�Õ¥��p����s#�k&K��1��s��֯F�B0�2========== the�X�#��!�n�~� '(U�#O�TÓ²��T�m����z��*�S\���g���M&T����þ========== password��Z��
Objective
Level GoalThe password for the next level is stored in the file data.txt in one of the few human-readable strings, beginning with several ‘=’ characters
Solution
so we need to find text in the data.txt file that has several == characther.
first I tried just a grep for == in data.txt
bandit9@bandit:~$ grep "==" data.txtBinary file data.txt matches
grep complains that is a binary file not a text file
so let try again with the -a switch
here is the man about grep for -a
-a, --text Process a binary file as if it were text; this is equivalent to the --binary-files=text option.
***edited out some the results to make it more readable
bandit9@bandit:~$ grep -a "==" data.txt g͇�#/y�Ú¹c4|�"�X����m���Y��GB7�Õ³&�Õ¥��p����s#�k&K��1��s��֯F�B0�2========== the�X�#��!�n�~�
'(U�#O�TӲ��T�m����z��*�S\���g���M&T����þ========== password��Z�� ە �93�4���n�@�JT�;��������========== isa�4z"========== truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk
pretty ugly but we can see right here at the end of the search the password for the next level is
truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk
Now in Python
with open("data.txt", "rb") as text_file: for line in text_file: if "===" in line:
print(line)
once again out put is kinda ugly and has been scrubbed a bit, put you can see the password
Comments
Post a Comment