Bandit Level 13 → Level 14

Level Goal

The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14. For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level. Note: localhost is a hostname that refers to the machine you are working on

Commands you may need to solve this level

ssh, telnet, nc, openssl, s_client, nmap

Helpful Reading Material

 


비밀번호는 /etc/bandit_pass/bandit14에 있으며  bandit14의 사용자만 읽을 수 있다. 현재의 권한으로는 bandit14의 비밀번호를 얻을 수 없지만 ssh를 통해 다음 레벨로 진행 할 수 있다.

 

bandit13@bandit:~$ ll
total 24
drwxr-xr-x  2 root     root     4096 Oct  5 06:19 ./
drwxr-xr-x 70 root     root     4096 Oct  5 06:20 ../
-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
-rw-r-----  1 bandit14 bandit13 1679 Oct  5 06:19 sshkey.private
bandit13@bandit:~$ ssh -help
unknown option -- h
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command [argument ...]]

 

sshkey.private 파일이 확인된다. ssh로 접속 할 때 비밀번호 대신 사용되는 키로 보인다. 해당 키를 사용 할수 있는 옵션을 찾기위해 ssh -help로 옵션을 찾아보니 [ -i identy_file ] 옵션이 보인다.

 

key를 사용하여 bandit14로 접속

bandit14@bandit:~$ cat /etc/bandit_pass/bandit14
fGrHPx402xGC7U7rXKDaxiWFTOiF0ENq

 

+ Recent posts