안녕하세요 오늘은 bandit20을 풀어 보겠습니다.
"bandit20의 홈디렉토리에 setuid 파일이 있고, bandit20의 포트에 비밀번호를
제시하면 bandit21의 비밀번호를 줄것이다" 라고 말하고 있습니다.
우선 setuid 파일이 무엇인지 부터 알아 보겠습니다.
bandit20@bandit:~$ ls -al
total 36
drwxr-xr-x 2 root root 4096 Apr 23 18:04 .
drwxr-xr-x 70 root root 4096 Apr 23 18:05 ..
-rw-r--r-- 1 root root 220 Jan 6 2022 .bash_logout
-rw-r--r-- 1 root root 3771 Jan 6 2022 .bashrc
-rw-r--r-- 1 root root 807 Jan 6 2022 .profile
-rwsr-x--- 1 bandit21 bandit20 15600 Apr 23 18:04 suconnect
여기 보면 x 가 써있는 soconnect 파일 이겠네요.
그럼 저 파일을 사용해 보겠습니다.
bandit20@bandit:~$ ./suconnect
Usage: ./suconnect <portnumber>
This program will connect to the given port on localhost using TCP. If it receives the correct password from the other side, the next password is transmitted back.
포트 넘버를 같이 쓰라고 하네요. 그럼 이제 다른 터미널을 하나 열어서 포트를 nc를 통해 열어 보겠습니다.
bandit20@bandit:~$ nc -l -p 3211
이제 다른 터미널로 가서 접속을 해보겠습니다.
bandit20@bandit:~$ ./suconnect 3211
이제 다른 터미널도 했으면 이제 비밀번호를 보낼일만 남았죠?
bandit20@bandit:~$ nc -l -p 3211
VxCazJaVykI6W36BkBU0mJTCM8rR95XT
NvEJF7oVjkddltPSrdKEFOllh9V1IBcq
bandit21의 비밀번호가 나왔습니다!!
bandit21의 비밀번호는 NvEJF7oVjkddltPSrdKEFOllh9V1IBcq 입니다
[bandit] bandit22 -> bandit23 풀이 (0) | 2023.07.12 |
---|---|
[bandit] bandit21 -> bandit22 (0) | 2023.07.11 |
[bandit] bandit19 -> bandit20 (0) | 2023.07.05 |
[bandit] bandit17 -> bandit18 (0) | 2023.06.27 |
[bandit] bandit16 -> bandit17 (0) | 2023.06.26 |