To gain access to the next level, you should use the setuid binary in the homedirectory. Execute it without arguments to find out how to use it. The password for this level can be found in the usual place (/etc/bandit_pass), after you have used the setuid binary.
hint : setuid
- setuid : 파일이 실행될 때 해당 파일 소유자의 권한을 일시적으로 얻도록 하는 특수 권한 부여 명령어
bandit19@bandit:~$ ls -al
total 36
drwxr-xr-x 2 root root 4096 Oct 14 09:26 .
drwxr-xr-x 150 root root 4096 Oct 14 09:29 ..
-rwsr-x--- 1 bandit20 bandit19 14884 Oct 14 09:26 bandit20-do <- 특수권한 부여
-rw-r--r-- 1 root root 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 root root 3851 Oct 14 09:19 .bashrc
-rw-r--r-- 1 root root 807 Mar 31 2024 .profile
보통은 rwx 권한인데 일반 권한이 없는 상태에서 특수권한을 부여받아서 rws가 됐어요
일반 권한 rwx가 있는상태에서 특수권한을 부여받으면 S(대문자)로 부여 받아서 rwS가 된답니다
그래서 이 특수권한을 이용해서 /etc/bandit_pass/bandit20 파일을 읽을 수 있다고 해서 한 번 읽어봅시다
더보기
더보기
bandit19@bandit:~$ ./bandit20-do cat /etc/bandit_pass/bandit20
0qXahG8ZjOVMN9Ghs7iOWsCfZyXOUbYO
'bandit' 카테고리의 다른 글
| [OverTheWire] bandit 20 -> 21 (0) | 2025.11.23 |
|---|---|
| [OverTheWire] bandit 13 -> 14 (0) | 2025.11.23 |
| [OverTheWire] bandit 12 -> 13 (0) | 2025.11.22 |
| [OverTheWire] bandit 11 -> 12 (0) | 2025.11.22 |
| [OverTheWire] bandit 10 -> 11 (0) | 2025.11.22 |