Answers for "portscan with python"

1

portscan with python

import socket
host = "localhost"
ports = [21,22,23,24,25,110,80,443] # Add Port
for port in ports:
  s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  p = s.connect_ex((host,port))
  if p == 0:
    print(f"Port: {port} Open!")
  else:
    print(f"Port: {port} Filter!")
Posted by: Guest on July-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language