I read some articles about hacks that have hacked routers which inject ads on websites a visitor visits that replace adsense ads

Is it really possible? How can a router hack inject javascript code into browser I dont understand

1 Answer 1


I'm not sure exactly what type of attack you are referencing but consider this...if an attacker controls your router what is to stop them from making any arbitrary change to unencrypted data? The packets pass through the router and the router could (if desired) make any change to the packet that the attacker desires (assuming he has taught the router how to make the changes properly). If the data is encrypted end to end this becomes much more difficult to pull off (still possible through a more complex attack path).

  • this could also be the results of a malicious DNS setting where all the traffic is routed to a third party which actually injects the JavaScript. That's much more likely than altering the firmware of a specific router to inject JavaScript.
    – Daisetsu
    Commented Dec 22, 2018 at 23:26
  • Yes, I can ente the router admin panel SO I can set the DNS servers to point to my servers And then what? Can you point to a tutorial Commented Jan 3, 2019 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .