Router Redirector
This tool was made sometime between 2011 and 2015, as a troubleshooting aid. It's main goal was to redirect a user to the configuration web interface of a consumer grade router.
It does not, and cannot work with modern browsers.
Theory of operation
- A WebRTC leak is used to determine the private IP address of the user
- The tool checks if the address is likley a private IP range in a consumer device. (in 192.168/16)
- The tool dispatches a worker-based HTTP request to 192.168.X.1. This request will fail, either because there is nothing listening, or because of CORS.
- The timing of the prior step is evaluated to determine if the request failed fast (due to CORS) or slow (due to timeout)
- If the request was "fast", the user is redirected to the determined address.
- If the request was "slow", repeat the request and timing check for 192.168.X.254
- If this second request was "fast", redirect there, if "slow", display a failure message
FAQ
- Q: Why won't this work now?
A: WebRTC no longer leaks the user's internal IP in a simple way
- Q: The JS doesn't appear to work at all, WTF?
A: This is an old WIP copy posted here for posterity
- Q: Why is the HTML/JS such a mess
A: This code is old enough to drink in some european countires. I had barely any idea what I was doing