SaferComputing.com

Reference · Network exposure

Home router check: remote administration, UPnP, WPS, DNS and port forwards

Check a home router: remote administration off, default password changed, firmware current and not end of life, UPnP mappings listed with upnpc -l and UPnP off, WPS off, DNS servers as you set them, port forwards reviewed, then a test from outside.

Published
Updated
Last checked
Applies to
Home and small office routers and internet provider gateways from any maker; upnpc from miniupnpc 2.2.6 on Ubuntu 24.04
Technical specification
Target artifactThe settings of a home or small office router, or an internet provider's gateway: remote management from the internet, the administrator password, firmware, Universal Plug and Play (UPnP) port mappings, Wi-Fi Protected Setup (WPS), the DNS servers it uses and hands out, and its port forwards.
Default behaviourVaries by maker and model. With UPnP on, programs on the network add port forwards themselves, and no one signs in to the router to approve them. A WPS PIN falls to at most 11,000 guesses. A router at end of life gets no more security updates.
Safe stateRemote management off; a unique administrator password; current firmware on a supported model; UPnP off, or only mappings you recognize; WPS off; DNS servers you chose; only port forwards you created; a test from another network reaches only the ports you meant to publish.
Check in router settingsremote management is off and the firmware page shows the latest version; then the UPnP, WPS, DNS, Port Forwarding and DMZ pages
Check on Linuxupnpc -l
Check on WindowsGet-DnsClientServerAddress -AddressFamily IPv4
Check from another devicenc -vz -w 5 PUBLIC_IP PORT from a network outside yours, for the remote management port and each forwarded port
Fix in router settingsturn off remote management, UPnP and WPS, set a unique administrator password, update the firmware or replace a router at end of life, then reboot

Remote management and the administrator password

Remote management puts the router's settings page on the internet. The US Federal Bureau of Investigation (FBI) reported on 7 May 2025 that end-of-life routers with remote administration turned on had been compromised by a new variant of TheMoon malware, which "does not require a password to infect routers; it scans for open ports and sends a command to a vulnerable script". The malware installs proxies on the routers, which criminals use to act anonymously.

  1. Sign in to the router from inside your network and turn off the setting the FBI calls remote management or remote administration, and the Canadian Centre for Cyber Security (Cyber Centre) calls remote access management. Save, then reboot, as the FBI advises.
  2. Change the default passwords of the router and of the Wi-Fi network, as the Cyber Centre advises. The FBI asks for unique, random passwords of 16 to 64 characters.
  3. Make later changes from inside the network only, as the US National Security Agency (NSA) advises.

To test, use a phone on mobile data: open the router's public address with the port the remote management setting showed, or run the nc test below. A sign-in page, or succeeded! on that port, means the internet still reaches it.

Firmware and end of life

  • Update the firmware, and turn on automatic updates if the model has them, as the Cyber Centre advises. It also says to ask your provider whether the router is at end of life.
  • At end of life the maker no longer supports the router or releases security patches for it. The FBI says routers dated 2010 or earlier likely no longer receive updates; the FBI and the NSA say to replace them.
  • On 18 September 2024, the FBI, the Cyber National Mission Force and the NSA described a botnet of over 260,000 devices in June 2024, among them routers, firewalls, network-attached storage (NAS) and cameras, with 9,200 in Canada; some had reached end of life as early as 2016. Their advice: replace end-of-life equipment, apply firmware updates, replace default passwords, and disable unused services "such as automatic configuration, remote access or file sharing protocols".

Signs of an infected router, in the FBI's list: overheating, connection problems and settings you do not recognize. Update the firmware, change the password and reboot. The Cyber Centre says a reboot may disrupt malware on the router, and the NSA suggests one every week.

UPnP: ports opened without you

UPnP lets a program on the network ask the router to forward a port to it. NAS software uses it to publish itself: Synology's QuickConnect applies port forwarding rules on routers that accept UPnP, and QNAP's myQNAPcloud has an Enable UPnP Port forwarding setting. Some routers even accepted these requests from the internet: note VU#357851 of the CERT Coordination Center (CERT/CC), 5 October 2011, describes routers taking AddPortMapping requests on their internet side, which may let an unauthenticated attacker scan internal hosts or relay internet traffic through them. The NSA's advice is to disable UPnP.

List the current mappings with upnpc

On Ubuntu, upnpc comes in the miniupnpc package. Run it on a computer on the router's network:

Ubuntu, as a user with sudo, on the router's network
sudo apt install miniupnpc
upnpc -l
  • -l lists the port mappings; -L lists them with the GetListOfPortMappings request, for routers with version 2 of the Internet Gateway Device service (IGD:2) only; -s shows the connection status.
  • No IGD UPnP Device found on the network ! means no router answered: UPnP is off, or this computer is not on the router's network.
  • Compare each mapping with what you use. upnpc -d EXTERNAL_PORT TCP deletes one, but a program can add it again while UPnP is on.

Tested on 9 November 2026 with miniupnpc 2.2.6 from Ubuntu 24.04: the options come from upnpc --help, and the "No IGD" message from a network where no router answered. Not run against a router.

Turn UPnP off

Turn UPnP off in the router's settings, then check its port forwarding page for rules that remain. A program that relied on UPnP needs a port forward you create yourself, or a VPN.

WPS

WPS can add a device to the Wi-Fi network with an 8-digit PIN. CERT/CC note VU#723755, 27 December 2011 (CVE-2011-5053), showed that the router's replies reveal when the first half of the PIN is right, and the last digit is a checksum, so the PIN falls to at most 11,000 guesses. Someone within range can then retrieve the Wi-Fi password. CERT/CC knew of no practical fix and said to turn WPS off; makers label the setting external registrar, router PIN or WiFi Protected Setup.

Alert TA12-006A, released on 6 January 2012 and now published by the US Cybersecurity and Infrastructure Security Agency (CISA), warned that some access points may not actually disable WPS when their settings page says it is off, and pointed to the maker's firmware updates. The Cyber Centre advised turning WPS off in October 2022.

DNS settings

The Cyber Centre warns that attackers who change how a router resolves names can steal sign-in details by sending users to fake sites. On the router's internet (WAN) page, check the DNS servers it uses; on the page that hands out addresses to devices (DHCP), check the DNS servers it gives them. Then compare with what a device received:

Windows PowerShell
Get-DnsClientServerAddress -AddressFamily IPv4
Linux
resolvectl status

Each should show the router's own address or servers you chose. Filtering can also run on the router for every device: NextDNS, a DNS service whose profiles hold blocklists and a denylist, documents a client "mostly aimed at routers and UNIX based systems" that sends lookups to it over DNS over HTTPS. For the devices themselves, see Encrypted DNS.

Port forwards and a test from outside

  1. On the router's Port Forwarding, Virtual Server or NAT page, delete every rule you did not create on purpose, and check the DMZ (demilitarized zone) setting too.
  2. From a different network, such as a phone's hotspot, test the remote management port and each forwarded port:
macOS or Linux terminal, on another network
nc -vz -w 5 PUBLIC_IP PORT
Windows PowerShell, on a computer on another network
Test-NetConnection -ComputerName PUBLIC_IP -Port PORT

succeeded! from nc, or TcpTestSucceeded : True, means the internet reaches that port. Open-port self-audit covers what listens on each computer, and IPv6; Synology and QNAP NAS ports covers a NAS behind the router.

Sources