Modify the hosts file of the router and redirect trafic

  • My question is how can I modify the hosts file of the router (If it exists), And redirect users to my server when they prompt a specific website?

    Maybe ask two separate questions. DNS redirects don't really have anything to do with the telnet service on your router.

    @VerbalKint Ok i'll edit that out, do you have an answer?

    You'd need DNS server where you can add new zone with your domain you want to block.

  • Verbal Kint

    Verbal Kint Correct answer

    5 years ago

    It depends a lot on the router. Most household/everyday routers don't have the capability to implement local DNS like you're referring to. See here: https://superuser.com/questions/311877/why-do-most-routers-not-include-local-dns

    If you want to do something client side, you could play around with network shortcuts that map to media servers and the like when you enter in the name of the shortcut in your web browser. Although this doesn't really make sense for large networks, at that point you should have a router that has this kind of functionality built-in already.

    Also, this general sort of thing can be exploited in dns redirect attacks, which I feel like you may be alluding to. In the attack, a computer connected to something like a coffee shop wifi network can spoof the router and provide a fake dns/hosts file. This allows an attacker to redirect users, but remember that the attacker's machine is handling redirects, not the router. Not to mention most people use https and verify site security certificates to minimize risks like these.

    And when you think about it, the world would be that much more scary if the average router could have its own hosts file. You could be on some coffee shop's WiFi and the sites you visit could be fake copies designed to steal your personal data. Sure, the store owners wouldn't do it, but someone could hack their fifteen year-old router and exploit the theoretical hosts file, or connect their own WiFi router to some unsuspecting company's LAN and cause all sorts of chaos.

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM