Bandit Level 7 → Level 8

Level Goal

The password for the next level is stored in the file data.txt next to the word millionth

Commands you may need to solve this level

man, grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd


비밀번호는 data.txt 파일에 존재하며 millionth라는 단어 뒤에 있다.

bandit7@bandit:~$ cat data.txt | grep "millionth"
millionth       TESKZC0XvTetK0S9xNwm25STk5iWrBvP

 

| grep: 이전 실행한 결과에서 특정 문자열을 가지는 "행"을 찾아준다. 

Bandit Level 6 → Level 7

Level Goal

The password for the next level is stored somewhere on the server and has all of the following properties:

  • owned by user bandit7
  • owned by group bandit6
  • 33 bytes in size

Commands you may need to solve this level

ls , cd , cat , file , du , find , grep


비밀번호는 서버 어딘가에 존재한다. 해당 파일속성은 다음과같다.

  • 소유자는 bandit7
  • 소유그룹은 bandit6
  • 크기는 33byte

 

bandit6@bandit:~$ find / -size 33c -user bandit7 -group bandit6 -exec sh -c "file {};" \; 2>/dev/null
/var/lib/dpkg/info/bandit7.password: ASCII text
bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password
z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S

 

find / -size 33c -user bandit7 -group bandit6 -exec sh -c "file {};" \; 2>/dev/null

  • -user bandit7: 소유자가 bandit7인 데이터를 찾는다.
  • -grup bandit6: 소유그룹이 bandit6인 데이터를 찾는다.
  • 2>/dev/null: permission denied와 같은 에러는 표시하지 않는다.

Bandit Level 5 → Level 6

Level Goal

The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties:

  • human-readable
  • 1033 bytes in size
  • not executable

Commands you may need to solve this level

ls , cd , cat , file , du , find


비밀번호는 inhere 디렉토리에 있으며 아래의 속성을 가진다.

  • 사람이 읽을 수 있다.
  • 1033 byte의 크기를 가진다.
  • 실행이 불가능하다.
bandit5@bandit:~/inhere$ find ./ -size 1033c -exec sh -c "file {}" \;
./maybehere07/.file2: ASCII text, with very long lines (1000)
bandit5@bandit:~/inhere$ find ./ -size 1033c -exec sh -c "cat {}" \;
P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU

 

find -size 1033c: 1033 바이트의 데이터를 찾는다.

  • -1033c: 1033바이트 이하 
  • +1033c: 1033바이트 이상
  • 1033b: 1033블록
  • 1033k: 1033킬로바이트
  • 1033m: 1033메가바이트
  • 1033g: 1033기가바이트

-exec sh -c "cat {}" \;

찾은 값을 "{}"에 바인드하고 쉘로 실행시킨다. 

'WarGame > Bandit WarGame' 카테고리의 다른 글

Bandit WarGame Level 7 -> Level 8(grep)  (1) 2023.11.12
Bandit WarGame Level 6 -> Level 7(find -user -group)  (0) 2023.11.10
Bandit WarGame 4 -> 5  (0) 2023.11.10
Bandit WarGame 3 -> 4  (0) 2023.11.10
Bandit WarGame 2->3  (0) 2023.11.10

Bandit Level 4 → Level 5

Level Goal

The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command.

Commands you may need to solve this level

ls , cd , cat , file , du , find

 


비밀번호는 inhere 디렉토리의 사람이 읽을 수 있는 파일에 있다.

화면이 지저분하다면 reset 명령어를 사용해라. (clear 도 가)

drwxr-xr-x 2 root    root    4096 Oct  5 06:19 ./
drwxr-xr-x 3 root    root    4096 Oct  5 06:19 ../
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file00
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file01
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file02
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file03
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file04
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file05
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file06
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file07
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file08
-rw-r----- 1 bandit5 bandit4   33 Oct  5 06:19 -file09
bandit4@bandit:~/inhere$ cat -file00
cat: invalid option -- 'f'
Try 'cat --help' for more information.
bandit4@bandit:~/inhere$ cat ./-file00
QRrtZ�i�╚     �H
                  |��ȧ����^��bandit4@bandit:~/inhere$ cat ./-file01
7L3��Y�ͯ        Ŵ����E�Y�ܚ      �V&��h�F�bandit4@bandit:~/inhere$ cat ./-file02
��y���O̫��`�\�-⃐�Hx��2��Kbandit4@bandit:~/inhere$ cat ./-file03
��╔i�x�#e�>�VO��p{�  �║��MUb4�bandit4@bandit:~/inhere$ cat ./-file04
��gQ��eE}:�g���j8�╚�╝���<.�ebandit4@bandit:~/inhere$ cat ./-file05
��S��e 0�����]7�������b�<�~bandit4@bandit:~/inhere$ cat ./-file06
G=1�������B׃�"
                 ���W��9ؽ5bandit4@bandit:~/inhere$ cat ./-file07
lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR
bandit4@bandit:~/inhere$

 

파일이 많다면 아래와 같은 방법으로 찾아도 될 듯 하다.

bandit4@bandit:~/inhere$ file ./*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data

 

다음 레벨로 GO

'WarGame > Bandit WarGame' 카테고리의 다른 글

Bandit WarGame Level 6 -> Level 7(find -user -group)  (0) 2023.11.10
Bandit WarGame 5 -> 6 (find -size -exec sh -c "file {}" \;)  (0) 2023.11.10
Bandit WarGame 3 -> 4  (0) 2023.11.10
Bandit WarGame 2->3  (0) 2023.11.10
Bandit WarGame 1->2  (0) 2023.11.10

+ Recent posts