Resetting Your Router the Paranoid (=Right) Way

Published: 2018-05-31
Last Updated: 2018-05-31 13:17:16 UTC
by Johannes Ullrich (Version: 1)
3 comment(s)

You probably heard the advice given earlier this week to reset your router due to some malware referred to as "VPNFilter" infecting a large number of routers. I do not want to second guess this advice, but instead, outline a couple of issues with "resetting" a router.

First of all: Pretty much all router malware (Mirai variants, TheMoon and various Linux Perl/bash scripts affecting routers) will not survive a simple power cycle of the router. However, the vulnerability that allowed access to the malware will. Secondly, some configuration changes may survive. In particular changes to DNS settings that are often done without actual malware, but by using CSRF vulnerabilities in the routers web-based admin interface.

My main problem with having thousands of users reset their routers to factory default settings is that they inadvertently may reset it to use a simple default password.

So here are some generic step-by-step instructions on what to do:

  1. Write down any important configuration changes that you made to the router. For example any changes to the default IP addresses or DNS settings. Safe any VPN connection settings that you need. In addition, backup your configuration via the router's admin interface as a backup, but we do not expect to use it (you do not want to restore any compromised settings)
  2. Download the latest and greatest firmware for your router. Even if you think you already run this particular version. Verify the firmware's integrity, which can be difficult. But maybe some vendors publish hashes. I do not think any vendor publishes PGP signatures. If you can not find a legit way to verify the integrity, then download it several times, using different networks, and different devices and compare hashes. Just for giggles: Call the manufacturers customer support number and ask for the hash. Maybe they will publish them if enough people complain. Most routers will do some integrity checking before applying the firmware but remember, we assume the router is compromised. Also, try to avoid the built-in "self-update" or "auto update" at this point.
  3. Disconnect the router from the internet (unplug the network cable).
  4. Reboot the router
  5. Reset the router to the factory default settings. It is very important that you do this while the router is disconnected from the internet. It will likely reset the router to use some simple default password. Keep the router disconnected from the Internet.
  6. Apply the latest firmware. Some routers may refuse to do that if they already have this version installed.
  7. Configure your router using the notes you took in step 1. A couple of points to consider:
    1. set a strong admin password
    2. make sure the password is required if you access the router locally.
    3. Disable all remote admin interfaces (http, telnet, ssh...) unless you really really really need them (and if you do: consider using the router as a VPN endpoint if you can)
    4. if possible, change the administrator user name
    5. change the IP address scheme. For example, instead of, use (pick random octets). It doesn't do much, but every bit helps.
    6. If you do not like your ISPs default DNS server, then pick some of the known good public once (Google, OpenDNS, Quad9, Cloudflare ...). Maybe mix two of them by using and ?
  8. If you are really paranoid, then repeat the steps.
  9. If you are not so paranoid (brave?): reconnect the router to the internet.
  10. Post the firmware checksum to any support forums to help others verify their firmware (or learn that your firmware was compromised)

For a simple reset that will take care of > 99% of malware I see on routers:

  1. Reboot the router
  2. Verify that you use a strong password (even for access from your own network)
  3. Disable remote admin features
  4. Verify the DNS settings

Johannes B. Ullrich, Ph.D. , Dean of Research, SANS Technology Institute

3 comment(s)
ISC Stormcast For Thursday, May 31st 2018


Diary Archives