We need some more details such as the version of Windows you are using and how do you normally connect to the router - wired or wireless ?
If using wireless can you connect when using an Ethernet cable ?
Are you using a laptop or desktop ?
As you can't connect in Safe Mode with Networking, that would suggest system files, drivers or the modem/router rather than an infection.
Are all of the lights on the modem and/or modem/router green - there should be 4 if using wireless and 5 when wired.
Let's try a power cycle first.
Switch off the modem, router (if separate modem and router), the computer and disconnect all cables for a couple of minutes.
Reconnect the cables then switch just the modem on (if applicable), wait for all of the lights to come on and then do the same for the router and then switch the computer on to see if you have a connection.
If you still don't have a connection then try these commands from the Command Prompt run as an administrator, but we'll need the info requested before we can look at other possible solutions if needed.
netsh winsock reset catalog
netsh int ip reset resetlog.txt
ipconfig /release
ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns
exit
Now reboot and check the connection.