bandit16->bandit17

mjdevv·2024년 1월 30일

bandit16 link
https://overthewire.org/wargames/bandit/bandit17.html


command to solve this level

이 레벨을 풀기 위해 알아야 하는 커맨드들은 아래와 같다.


1. ssh :

  • ssh 접속 커맨드
  • ssh [id]@[url] -p[port]

2. telnet :

  • text-based communication protocol
  • telnet [hostname][port]

3. nc(Netcat) :

  • networking utility for reading from and writing to network connections using TCP or UDP
  • port scanning, file transfers, and creating network connections
  • nc -vz [hostname][port]

4. openssl :

  • A robust open-source toolkit for implementing SSL/TLS protocols.
  • connects to a remote SSL/TLS server

5. s_client :

  • A specific OpenSSL tool that connects to a remote SSL/TLS server and prints information about the SSL connection

6. nmap :

  • open-source network scanning tool for discovering hosts and services on a computer network
  • security auditing, and finding open ports
  • nmap -p 1-1000 hostname (to scan ports 1 through 1000)

문제 :

The credentials for the next level can be retrieved by submitting the password of the current level to a port on localhost in the range 31000 to 32000. First find out which of these ports have a server listening on them. Then find out which of those speak SSL and which don’t. There is only 1 server that will give the next credentials, the others will simply send back to you whatever you send to it.

  1. a port on localhost in the range 31000 to 32000
  2. listening port which of those speak SSL

문제 풀이 :

1. listening 포트를 찾는다.

	nmap -p 31000-32000 localhost

2. SSL로 로그인 가능한 포트를 찾는다.

	nmap --script ssl-enum-ciphers -p 31000-32000 hostname

nmap은 네트워크 스캐닝 툴 중 하나로, 강력한 기능들이 스크립트 되어 있다고 한다. 호스트 찾아내기, 호스트의 운영체제, 어떤 포트를 어떤 프로세스가 사용하고 있는지(오....), 스텔스 스캔, 방화벽 사용감지 등을 할 수 있다고 한다.

nmap을 사용하면 명시한 호스트의 포트 레인지를 스캔하게 된다. 그리고 해당 포트들 중 어떤 SSL cipher를 사용하는지 보여준다.

31518번 포트와 31790번 포트 ssl 통신으로 열려 있는 걸 확인할 수 있다. 이제 접속해보자.

31790포트로 접속해보면 다음 스테이지 패스워드를 돌려준다.


REFERENCE

[1] https://m.blog.naver.com/alice_k106/221468341565
[2] https://namu.wiki/w/nmap

profile
방구석 언어기술자

0개의 댓글