Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check remote port is open or not using python


def port_check(HOST):
   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   try:
      s.connect((HOST, int(22)))
      s.shutdown(2)
      return True
   except:
      return False
 
PREVIOUS NEXT
Tagged: #check #remote #port #open #python
ADD COMMENT
Topic
Name
8+4 =