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

Bandit Level 3 → Level 4

Level Goal

The password for the next level is stored in a hidden file in the inhere directory.

Commands you may need to solve this level

ls , cd , cat , file , du , find

 


비밀번호는 inhere 디렉토리에 존재한다.

bandit3@bandit:~$ ll
total 24
drwxr-xr-x  3 root root 4096 Oct  5 06:19 ./
drwxr-xr-x 70 root root 4096 Oct  5 06:20 ../
-rw-r--r--  1 root root  220 Jan  6  2022 .bash_logout
-rw-r--r--  1 root root 3771 Jan  6  2022 .bashrc
drwxr-xr-x  2 root root 4096 Oct  5 06:19 inhere/
-rw-r--r--  1 root root  807 Jan  6  2022 .profile
bandit3@bandit:~$ cd inhere/
bandit3@bandit:~/inhere$ ll
total 12
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 bandit4 bandit3   33 Oct  5 06:19 .hidden
bandit3@bandit:~/inhere$ cat .hidden
2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
bandit3@bandit:~/inhere$

.(dot)으로 시작하는 파일은 숨김파일로 ls명령으로는 볼 수 없다.

ls -a 혹은 ll 명령어를 사용하면 숨김 파일을 볼 수 있다.

 

ls -a: 모든 파일 보기

ls -l: 파일정보 보기

ls -la: 모든 파일과 파일정보보기

 

다음 레벨로 GO

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

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

+ Recent posts