[Bandit] Level 19 → Level 20
Bandit Level 19 풀이 과정을 설명합니다.
문제
Level Goal
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.
해결
ls -al명령어를 통해 bandit20-do 파일을 확인할 수 있습니다.현재 bandit20-do 파일에는
setuid권한이 있는 것을 알 수 있습니다.즉, 현재 접속한 계정은 bandit19이지만 bandit20의 권한을 잠시동안 가질 수 있다는 것을 의미합니다.
예를 들자면,
/etc/bandit_pass/bandit20파일은 bandit20만 읽을 수 있습니다.그러나 setuid 는 bandit19 에서도
/etc/bandit_pass/bandit20파일을 읽을 수 있다.
해당 파일을 실행시켜보면 다음과 같습니다.
./bandit20-do뒤에 명령을 입력하면 되는 구조입니다.
이런식으로 사용해볼 수 있겠습니다.
두 가지 명령을 동시에 시도해보고 싶다면, 세미콜론을 이용해 사용할 수 있습니다.
따라서 password가 저장된
/etc/bandit_pass/bandit20파일을 읽어보면 bandit19 계정으로도 읽을 수 있게 됩니다.
댓글
이 글이 마음에 드셨다면 반응이나 댓글을 남겨주세요!
댓글을 작성하려면 로그인하세요

뉴스레터 구독하기
새로운 포스트가 올라오면 이메일로 알려드려요!