Bandit Level 26 → Level 27

장일영·2024년 5월 13일

Bandit

목록 보기
27/33

Level

Goal

Good job getting a shell! Now hurry and grab the password for bandit27!

shell을 얻다니 잘했다! 이제 bandit27의 패스워드를 빨리 잡아라!

Commands you may need to solve this level

ls

Exploit

Connection to bandit.labs.overthewire.org closed.

지난 레벨과 마찬가지로 more 커맨드의 취약점을 이용해 shell을 얻을 수 있을 것이다. vi 에디터를 열고 기본 쉘을 bash로 변경해 /home/bandit26 디렉토리를 확인할 수 있다.

bandit26@bandit:~$ ls -al
total 44
drwxr-xr-x  3 root     root      4096 Oct  5  2023 .
drwxr-xr-x 70 root     root      4096 Oct  5  2023 ..
-rwsr-x---  1 bandit27 bandit26 14876 Oct  5  2023 bandit27-do
-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
drwxr-xr-x  2 root     root      4096 Oct  5  2023 .ssh
-rw-r-----  1 bandit26 bandit26   258 Oct  5  2023 text.txt

bandit27.do 파일은 권한 상승이 가능한 32bit 리눅스 실행 파일이다.

bandit26@bandit:~$ ./bandit27-do id
uid=11026(bandit26) gid=11026(bandit26) euid=11027(bandit27) groups=11026(bandit26)

bandit26@bandit:~$ ./bandit27-do cat /etc/bandit_pass/bandit27

이를 이용해 다음 레벨의 패스워드가 저장된 파일을 읽을 수 있다.

0개의 댓글