Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Port Knocking 접근 제어는 미리 약속한 포트들에 대한 접촉(Knocking)을 통해 정해진 서비스의 허용 여부를 정하는 시스템입니다. (https://en.wikipedia.org/wiki/Port_knocking 참조)

Xshell로 SSH 등의 접속을 할 경우 미리 Port Knocking 과정을 거처야 하는데 다음 과정을 통해서 세션 파일 실행만으로 한번에 접속할 수 있습니다.

Port Knocking: SSH 포트 개방 => SSH 세션 실행 => Port Knocking: SSH 포트 차단

  1. Port Knocking 클라이언트 프로그램 설치
    다음에서 프로그램을 다운로드 받아 윈도우에 설치합니다.
    https://www.epinox.de/en/windows/port-knocking-tool.html

  2. Port Knocking을 실행하기 위한 스크립트 파일을 생성합니다. ex)portKnocking.vbs

    sub main
      xsh.screen.synchronous true
      Dim SERVER
      SERVER="192.168.79.148"
      xsh.screen.send "\"c:\\Program Files (x86)\\Port Knocking Tool\\knock.exe\" /delay:100  /usepcap "&SERVER&" 7000:tcp,8000:tcp,9000:tcp"&vbcr
      xsh.session.sleep 500
      xsh.screen.waitforstring("[C:\~]$")
      xsh.screen.send "ssh "&SERVER&vbcr
      xsh.session.sleep 500
      xsh.screen.waitforstring("[C:\~]$")
      xsh.screen.send "\"c:\\Program Files (x86)\\Port Knocking Tool\\knock.exe\" /delay:100  /usepcap "&SERVER&" 9000:tcp,8000:tcp,7000:tcp"&vbcr
    end sub
  3. Xshell에서 로컬 셸 세션 생성

    1. 프로토콜로 ‘LOCAL’을 선택합니다.

    2. Login Scripts에 위 2.의 스크립트 파일을 지정합니다.

    3. 접속하고자 하는 서버의 인증 정보를 설정합니다.

  4. 해당 세션을 실행합니다.


  • No labels