Level 13 → Level 14

옥영진·2020년 5월 17일
0

Bandit - OverTheWire

목록 보기
14/33

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

다음 레벨로 가는 패스워드는 /etc/bandit_pss/bandit14에 있지만 bandit14 계정 소유라서 접근할 수가 없다. 하지만 다음 레벨로 가는 패스워드 대신 private SSH 키를 이용하면 다음 레벨로 로그인할 수 있다고 한다.

해결

ls -al
file ./sshkey.private

홈 디렉토리에 sshkey.private 파일이 존재하는데 이는 SSH 접속용 private 키이다.

ssh -i ./sshkey.private bandit14@localhost

ssh 명령어를 사용하여 bandit14 계정으로 접속 시도를 한다. -i 옵션으로 현재 홈 디렉토리에 존재하는 private SSH key를 사용하여 패스워드를 대신하여 접속할 수 있다.

cd /etc/bandit_pass/
cat ./bandit14

각 레벨(계정)로 접속할 수 있는 패스워드는 /etc/bandit_pass/ 디렉토리에 존재한다. 현재 ssh 명령어를 사용하여 bandit14 계정으로 접속했으므로 패스워드가 저장된 파일을 확인할 수 있다.

profile
안녕하세요 함께 공부합시다

0개의 댓글