On 20.07.2012 23:35, Dave Land wrote:
> Another approach would be to make a request to any service that is
> available only on the private network. If the request succeeds, bail
> out of the script, because you're on the LAN. This might require some
> fancier coding because the request to the LAN-based service would
> constitute XSS from the perspective of whatever page is being loaded
> by the browser.
var i = new Image();
i.onload = function () {
// executes only if resource on the LAN is accessible
};
i.onerror = function () {
// executes only if resource on the LAN is accessible
};
i.src = "
http://lan.example.com/someresource";
Note that the error path will also be chosen when connected to the LAN
but unable to access the resource.
--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/