HackMyIP

我的端口开放了吗?

免费端口检测器 · 真实的服务器端 TCP 扫描

要检查某个端口是否开放,请在下方输入主机或 IP(留空则检测你自己的公网 IP)。HackMyIP 会从服务器端真实发起 TCP 连接:开放表示有服务在监听,关闭表示连接被拒绝,过滤通常表示防火墙静默丢弃了数据包。
准备扫描
以JSON获取此结果 → GET /api/ports?host=1.1.1.1&ports=80,443  ·  API文档
关于端口扫描

This is a real server-side TCP scan: HackMyIP opens a TCP connection to each port from Cloudflare's network and reports the actual result. Open means the TCP handshake completed (a service is listening). Closed means the connection was actively refused or reset. Filtered means no response within 2.5 seconds, typically a firewall silently dropping packets. Blocked means Cloudflare blocks outbound connections to that port (port 25/SMTP). Leave the field blank to scan your own public IP, or enter any public host or IP you are authorized to test. Only scan networks you own or have permission to test.

常见端口速查表
端口服务用途
22SSHEncrypted remote terminal access
80HTTPUnencrypted web traffic
443HTTPSEncrypted web traffic
21FTPFile transfer
25SMTPOutgoing email (often blocked by ISPs)
53DNSDomain name resolution
3389RDPWindows Remote Desktop
3306MySQLDatabase server
8080HTTP-altProxies and development servers
如何自行检查端口是否开放

Windows (PowerShell)

  1. Test a remote port: Test-NetConnection -ComputerName example.com -Port 443TcpTestSucceeded : True means the port is open.
  2. List ports your PC is listening on: netstat -ano.

macOS / Linux

  1. Test a remote port with netcat: nc -zv example.com 443 — "succeeded" means open.
  2. Or use nmap: nmap -p 443 example.com.
  3. List local listening ports: ss -tuln (Linux) or lsof -i -P | grep LISTEN (macOS).

Any OS (quick check)

  1. Run telnet example.com 443. A blank screen or connection message means the port is open; an immediate error means it is closed or filtered.
最后更新:

常见问题

什么是开放端口?

Open ports are network endpoints that accept incoming connections. Each port is associated with a specific service (e.g., port 80 for HTTP, port 443 for HTTPS, port 22 for SSH). Open ports allow legitimate traffic but can also be entry points for attackers if the services behind them have vulnerabilities or are misconfigured. Firewalls control which ports are accessible.

Is port scanning legal?

Port scanning your own network and systems is legal. Scanning networks you own or have explicit permission to test is standard practice in security assessments. However, scanning third-party systems without authorization may violate computer crime laws in many jurisdictions. Always ensure you have proper authorization before scanning any network that is not your own.

How do I close open ports?

To close open ports: configure your firewall to block unwanted incoming connections, stop unnecessary services running on those ports, use your router's built-in firewall settings to restrict access, and disable port forwarding rules you no longer need. On Windows, use Windows Firewall; on Linux, use iptables or ufw; on macOS, use the built-in firewall in System Preferences.