Bandit Level 6 → Level 7 [6/34]

2025. 5. 28. 16:22·Security/CTF

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> 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 ban

overthewire.org

 

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

 

언제나 그렇듯 디렉터리부터 탐사해보자

bandit6@bandit:~$ ls -al
total 20
drwxr-xr-x  2 root root 4096 Apr 10 14:22 .
drwxr-xr-x 70 root root 4096 Apr 10 14:24 ..
-rw-r--r--  1 root root  220 Mar 31  2024 .bash_logout
-rw-r--r--  1 root root 3771 Mar 31  2024 .bashrc
-rw-r--r--  1 root root  807 Mar 31  2024 .profile

지금까지와 다르게 초기 디렉터리에 파일이 존재하지 않는 것 같다.

 

user가 bandit7이고 group이 bandit6인 점을 활용해보자. man find에서 아래와 같은 항목들이 명시되어 있다.

-group gname
	File belongs to group gname (numeric group ID allowed).

-user uname
	File is owned by user uname (numeric user ID allowed).

 

 

이를 모두 조합해서 전체 경로에서 파일을 찾아보자

bandit6@bandit:~$ find / -user bandit7 -group bandit6
find: ‘/root’: Permission denied
find: ‘/proc/tty/driver’: Permission denied
find: ‘/proc/1407352/task/1407352/fd/6’: No such file or directory
find: ‘/proc/1407352/task/1407352/fdinfo/6’: No such file or directory
find: ‘/proc/1407352/fd/5’: No such file or directory
find: ‘/proc/1407352/fdinfo/5’: No such file or directory
find: ‘/boot/lost+found’: Permission denied
find: ‘/boot/efi’: Permission denied
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/xinetd.d’: Permission denied
find: ‘/etc/credstore’: Permission denied
find: ‘/etc/multipath’: Permission denied
...

 

 

Permission denied메세지 때문에 결과를 찾기 힘들다. 2>/dev/null을 이용해서 stderr를 제외하고 확인해보자.

bandit6@bandit:~$ find / -user bandit7 -group bandit6 2>/dev/null
/var/lib/dpkg/info/bandit7.password

 

 

파일이 하나 특정되었다! 한번 확인해보자.

bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password 
[PASSWORD]

 

얏호~

'Security > CTF' 카테고리의 다른 글

Bandit Level 8 → Level 9 [8/34]  (0) 2025.05.28
Bandit Level 7 → Level 8 [7/34]  (0) 2025.05.28
Bandit Level 5 → Level 6 [5/34]  (0) 2025.05.28
Bandit Level 4 → Level 5 [4/34]  (0) 2025.05.27
Bandit Level 3 → Level 4 [3/34]  (0) 2025.05.27
'Security/CTF' 카테고리의 다른 글
  • Bandit Level 8 → Level 9 [8/34]
  • Bandit Level 7 → Level 8 [7/34]
  • Bandit Level 5 → Level 6 [5/34]
  • Bandit Level 4 → Level 5 [4/34]
LimSeongHyeon
LimSeongHyeon
개발 + 정보보안
  • LimSeongHyeon
    삽질의 정수
    LimSeongHyeon
  • 전체
    오늘
    어제
    • ALL (46)
      • CS (4)
        • DevOps (1)
        • Network (3)
        • Application (0)
        • Cloud (0)
        • Cryptography (0)
        • Others (0)
      • Programming (0)
        • Others (0)
      • Security (14)
        • 주통기 (1)
        • CTF (11)
        • Forensic (1)
        • Others (1)
      • Certification (18)
        • 리눅스마스터 1급 (17)
        • 정보보안기사 (1)
      • Report (3)
        • Tools (3)
        • Windows (0)
        • Shell (0)
      • Diary (7)
        • 개발 (2)
        • 취미 (0)
        • 일지 (0)
        • 메모 (5)
  • 공지사항

  • 인기 글

  • 최근 글

  • 태그

    Bandit
    s/w 설치 및 관리
    시스템 보안 및 관리
    aws요금
    하드 프리즈
    운영체제 명령실행
    zombie-crontab
    mrproper
    주변장치 관리
    시스템 백업
    파일 시스템
    Proxmark3
    파일 서비스
    리눅스마스터 1급
    xined
    prompt injection
    ssh
    VMware
    tcp wrapper
    인증 서비스
    리눅스 마스터 1급
    mac
    LDAP Injection
    슈퍼 데몬
    소프트웨어 설치 및 관리
    장치의 설치 및 관리
    Phisical Layer
    code injection
    리눅스
    overthewire
  • hELLO· Designed By정상우.v4.10.4
LimSeongHyeon
Bandit Level 6 → Level 7 [6/34]
상단으로

티스토리툴바