-
OverTheWire: Level Goal: Bandit Level 19 → Level 20 풀이2021 SCP Mentoring/OverTheWire: Bandit 2021. 5. 23. 20:34
다음 레벨로 가기위해서는 홈디렉토리의 setuid 바이너리를 사용.
setuid 바이너리를 실행하면 사용 방법을 알 수 있다.
이 레벨의 password는 setuid 바이너리를 사용한 후 일반적인 위치 (/etc/bandit_pass)에서 찾을 수 있다고 한다.
bandit19@bandit:~$ cd /etc/bandit_pass bandit19@bandit:/etc/bandit_pass$ ls bandit0 bandit11 bandit14 bandit17 bandit2 bandit22 bandit25 bandit28 bandit30 bandit33 bandit6 bandit9 bandit1 bandit12 bandit15 bandit18 bandit20 bandit23 bandit26 bandit29 bandit31 bandit4 bandit7 bandit10 bandit13 bandit16 bandit19 bandit21 bandit24 bandit27 bandit3 bandit32 bandit5 bandit8 bandit19@bandit:/etc/bandit_pass$ cat bandit20 cat: bandit20: Permission denied
/etc/bandit_pass/bandit20을 통해 password를 보려고 하면 당연 권한이 없어 볼 수 없다고 한다.
bandit19@bandit:~$ ls bandit20-do
ls 명령어를 사용해보면 bandit20-do 라는 setuid 바이너리를 볼 수 있다.
bandit19@bandit:~$ ./bandit20-do Run a command as another user. Example: ./bandit20-do id bandit19@bandit:~$ ./bandit20-do id uid=11019(bandit19) gid=11019(bandit19) euid=11020(bandit20) groups=11019(bandit19) bandit19@bandit:~$ ./bandit20-do cat /etc/bandit_pass/bandit20 GbKksEFF4yrVs6il55v6gwY5aVje5f0j
./bandit20-do를 실행해보면 ./bandit20-do id를 통해 실행시키라고한다.
./bandit20-do id를 통해 실행하면 bandit20의 실행권한을 가진것을 볼 수 있다.
./bandit20-do cat /etc/bandit_pass/bandit20을 통해 다음 Level의 password인 GbKksEFF4yrVs6il55v6gwY5aVje5f0j 를 볼 수 있다.
'2021 SCP Mentoring > OverTheWire: Bandit' 카테고리의 다른 글
OverTheWire: Level Goal: Bandit Level 20 → Level 21 풀이 (0) 2021.05.23 OverTheWire: Level Goal: Bandit Level 18 → Level 19 풀이 (0) 2021.05.23 OverTheWire: Level Goal: Bandit Level 17 → Level 18 풀이 (0) 2021.05.23 OverTheWire: Level Goal: Bandit Level 16 → Level 17 풀이 (0) 2021.05.17 OverTheWire: Level Goal: Bandit Level 15 → Level 16 풀이 (0) 2021.05.16