#BTCVSGOLD #Yuan #e2n #e2ee e2eencryprion $ENA rub

ENA
ENAUSDT
0.1997
+0.85%

import socket

def scan_port(ip, port):

try:

# 創建套接字

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

sock.settimeout(0.5)

# 嘗試連接

result = sock.connect_ex((ip, port))

if result == 0:

print(f"端口 {port}: 開放")

sock.close()

except Exception as e:

print(f"掃描端口 {port} 時出錯: {e}")

target_ip = "127.0.0.1" # 您的本地地址以進行測試

ports_to_scan = [80, 443, 8080]

print(f"正在掃描 {target_ip}...")

for port in ports_to_scan:

scan_port(target_ip, port) #phyton