bandit19

KJH·2022년 11월 30일

bandit

목록 보기
15/29
ssh bandit19@bandit.labs.overthewire.org -p 2220 
#awhqfNnAbc1naukrpqDYcF95h7HoMTrC

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.

setuid를 사용한 후, /etc/bandit_pass 에서 비밀번호를 찾아라

풀이

정보

setuid란?

  • 사실 별 생각없이 사용하는 chmod 777은, chmod 0777에서 0이 생략된것이다.
  • 맨 앞의 0은, 리눅스의 특수권한을 뜻한다. (setuid, setgid, stickybit)
  • setuid이란, 파일이 (명령어가) 실행되는 동안 일시적으로 파일 소유주의 권한을 얻게 된다.
bandit19@bandit:~$ ls -al bandit20-do
-rwsr-x--- 1 bandit20 bandit19 14872 Sep  1 06:30 bandit20-do # 여기서처음보는 s가 등장

#example
./bandit20-do whoami
bandit20
whoami
bandit19

./bandit20-do cat /etc/bandit_pass/bandit20
#VxCazJaVykI6W36BkBU0mJTCM8rR95XT

0개의 댓글