It's rare for a router to be infected with malware. More commonly, viruses and spyware will infect the computer and then make changes to the router configuration.
Router infected with malware
Well, in practice the answer is no. Routers are, I can't say "never," but extremely rarely infected with malware.
What more often happens with routers is that your computer will be infected with some kind of malware that then knows how to reach out to your router. If you haven't changed the default password, the default administration password for your router, the malware on your computer can reach out to your router and reconfigure it.
It doesn't install any malware, it just reconfigures it:
- It may set security settings to "off";
- It may redirect where your DNS is coming from;
- It can cause a lot of havoc.
The malware is not on the router, the malware is on one of your computers - and that malware has reconfigured the router so that the router contains bad information.
But it's not the router itself having been itself infected.