본문 바로가기
Utils & Infra & Tool/Shell

서버 간 방화벽 확인 Shell (Python)

by 무대포 개발자 2020. 7. 10.
728x90
반응형

서버 간 방화벽 확인 Shell (Python)

  • 사용법
    • python connect.py
    • '127.0.0.1'
    • 12000
    • HOST ip 를 입력할 때는 '127.0.0.1' 로 입력.
    • connected 라고 출력되면 연결된 거임.
import socket

print("##### example #####")
print("host : '127.xx.xx.xx'")
print("port : xxxx")
print("#################")

HOST = input("host : ")
PORT = input("port : ")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST,PORT))
print("HOST : ", HOST, " connected")

댓글