[OverTheWire] bandit 19 -> 20

2025. 11. 22. 18:07·bandit

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
'bandit' 카테고리의 다른 글
  • [OverTheWire] bandit 20 -> 21
  • [OverTheWire] bandit 13 -> 14
  • [OverTheWire] bandit 12 -> 13
  • [OverTheWire] bandit 11 -> 12
jokkams
jokkams
jokkams 님의 블로그 입니다.
  • jokkams
    jokkams 님의 블로그
    jokkams
  • 전체
    오늘
    어제
    • 분류 전체보기 (56)
      • 코드업 (8)
      • bandit (32)
      • 학교 (2)
      • 드림핵 (5)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    코드업
    100제
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
jokkams
[OverTheWire] bandit 19 -> 20
상단으로

티스토리툴바