[OverTheWire System - Bandit] Level 19 >> Level 20

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.

 

다음 레벨에 액세스하려면 홈 디렉토리에서 setuid 바이너리를 사용해야 합니다. 인수 없이 실행하여 사용법을 알아보세요. 이 레벨의 비밀번호는 setuid 바이너리를 사용한 후 일반적인 위치(/etc/bandit_pass)에서 찾을 수 있습니다.

Hint

1. setuid와 euid

Write Up

더보기

문제 설명대로 setuid가 bandit20으로 설정된 파일이 있었다.

혹시 help 문서가 있는지 확인해봤는데 있었다.
일단 help 문서만 봐서는 잘 모르겠다.

 

그래서 인자 값을 안 넣고 실행했는데, 인자 값을 id를 넣어서 실행하라는 예시가 출력됐다.
그래서 예시 그대로 실행했는데, euid가 bandit20으로 실행되는 것을 볼 수 있었다.

 

이를 이용하여 /etc/bandit_pass/baindit20 파일을 읽을 수 있었다.

 

bandit20 :: GbKksEFF4yrVs6il55v6gwY5aVje5f0j