PortScan › Port guide › Port 23
Port 23 (Telnet): Why You Should Close It Right Now
Port 23 is Telnet: everything travels in plaintext, and it was the Mirai botnet's main route into IoT devices with default passwords. Check it and turn it off.
What is port 23?
Telnet is a remote terminal protocol created in 1969. It has all but disappeared from servers since SSH came along, but it lives on in devices with old firmware: routers, IP cameras, DVRs and industrial equipment.
Telnet sends every keystroke, including the login password, without encryption. Having port 23 open to the internet is roughly the same as exposing an admin console with no lock on it.
When it is normally open
- Management interfaces on older routers, switches and IP cameras
- Devices where the manufacturer left Telnet on for remote support and hid the option to turn it off
- Equipment on isolated internal networks (even then, it must not be reachable from the internet)
Risks if it is open
The Mirai botnet
In 2016, Mirai swept ports 23 and 2323 across the internet and infected IoT devices using some 60 default credentials such as admin/admin and root/xc3511. The devices it collected were used to attack the DNS provider Dyn, temporarily making major services like Twitter and Netflix unreachable. Variants are still active today.
Plaintext communication
Passwords, typed commands and output are all visible. Intercepting traffic on the path, or hijacking the session, is easy.
Security checklist
- Turn Telnet off in the device's management interface and switch to SSH if available. If there is no option, check whether a firmware update removed it.
- If port 23 appears in your router's port-forwarding list, delete it.
- Always change default passwords. Mirai spread using nothing but default credentials.
- Disconnect devices that no longer get updates from the internet, or put them on a separate network (guest network or VLAN).
How to check whether port 23 is open
From outside (is it exposed to the internet?)
Whether your server or home router accepts port 23 from the internet can only be confirmed by connecting from outside. A check from inside the same network bypasses the router's firewall and gives a different answer.
PortScan opens a real TCP connection from the Cloudflare edge and reports Open, Closed or Filtered. Members can scan every port on their own IP for free and other targets free once a day.
Check port 23On the server (what is listening?)
Windows (PowerShell):
netstat -ano | findstr ":23 "
Get-NetTCPConnection -LocalPort 23 -State Listen | Select LocalAddress,OwningProcess
Linux:
sudo ss -tlnp | grep ':23 '
If it listens on 0.0.0.0 or [::] it is open on every network; 127.0.0.1 means only that machine can connect. To test port 23 on a server from another computer, use Test-NetConnection server-address -Port 23 on Windows or nc -vz server-address 23 on Linux and macOS.
How to close or restrict port 23
The best fix is to turn the service off or make it listen only on 127.0.0.1 (see the checklist above). If you need the service but must keep it off the internet, use a firewall.
Windows Firewall
# Administrator PowerShell
New-NetFirewallRule -DisplayName "Block TCP 23" -Direction Inbound -Protocol TCP -LocalPort 23 -Action Block
# To allow a single IP instead (block rules take precedence, so use this instead of the rule above)
New-NetFirewallRule -DisplayName "Allow TCP 23 from office" -Direction Inbound -Protocol TCP -LocalPort 23 -RemoteAddress 203.0.113.10 -Action Allow
Linux (ufw)
sudo ufw deny 23/tcp
# Allow a single IP only
sudo ufw allow from 203.0.113.10 to any port 23 proto tcp
On a cloud server, also check port 23 in the security group (inbound rules), which is separate from the OS firewall. For services running in Docker, the rules Docker creates can bypass ufw, so binding the port to localhost with -p 127.0.0.1:23:23 is the reliable option.
Router
At home or in a small office, open the router's admin page and check whether port 23 is in the port forwarding list, whether DMZ is enabled, and whether any program opened ports by itself through UPnP. If any of the three applies, port 23 on your PC is directly visible from the internet.
How to read the scan result
- Open — something accepted a connection on port 23. Work through the risks above.
- Closed — the packet reached the device, but nothing is listening on that port, so it was refused immediately (RST). The service is off.
- Filtered — no response. A firewall or the ISP is dropping packets, or the device is off. From an exposure point of view this is the safest state.
The verdict can depend on where you connect from. Many ISPs (including most Korean ISPs) block some ports such as 135, 139 and 445 on their network, so the same server can look Filtered from inside that network and Closed from abroad.
FAQ
- Port 23 is closed, but what about 2323?
- Some devices accept Telnet on port 2323, and Mirai targeted 2323 as well. Add 2323 to your custom ports and check it.
- Is it okay to use a Telnet client to test other ports?
- Yes. Using the telnet command to see whether a port is open has nothing to do with running a server. The problem is a Telnet server listening on port 23.
Related ports
Last updated 2026-11-04 · Use this guide to check systems you manage. Scanning systems without permission may carry legal liability.