247 points · by sohkamyung · 4y ago · 294 comments
It wouldn't be that bad if it was just the status indicator, but several apps refuse to work properly if "internet" isn't detected. The workaround is to disable every other adapter in the system until NCSI is happy. I ended up binary patching the connection test service in memory to get it to always return true.
For me it's very bad code smell when the developers try to check some sort of a global flag ("has internet") instead of just perform the action (eg send http request) and fail gracefully
Why maintain code to duplicate functionality that is provided by the OS? Can I be more reliable than Microsoft?
Absolutely.
Well, this escalated quickly.
How is this executed? I would not know how to patch binaries in memory. Is this a common way to fix bugs under Windows so they have tools for that?
I'm used to just have the source, so I can recompile if ever needed.
I had my share of troubles with it, but most of the times I found a way to force it work as I need.
Writing all these cozie Windows trivia blog posts. That I like.
Why is he not smashed by some manager? Could everyone else do this if they liked?
When you get to that step, press Shift + F10 to bring up the terminal, then type "OOBE\BYPASSNRO" and press enter.
The installer will restart but this time will have a "I don't have Internet" button that you can use to bypass this nonsense.
[1] https://www.windowslatest.com/2022/09/28/spotify-app-is-auto...
(Source: Windows OS admin/engineer for large company where we /do/ manage all of this.)
My best guess after turning my head 270 degrees, closing one eye, and squinting the other is that the noun is Microsoft/Windows, and the verb is running the ncsi daemon and having it fail the check.
It’s definitely not an OS I would like to make my daily driver. I just hope Apple won’t go down that road with macOS.
What is the secret keyboard combination?
How on earth did Microsoft okay releasing a Professional version of their OS that offers no suggestion on how to finish the install when no network devices are detected?
A simple Google found me the answer but it is piss poor UX to offer zero options when it knows there is no network interface to enable.
People like to joke that you need the Terminal in Linux still and yet I couldn't even install the brand new Windows 11 on a computer without needing to open a command prompt using a keyboard shortcut and enter some cryptic command which rebooted my machine and enabled some hidden option.
I used to use it to test connectivity on my own apps because Apple is probably better at making sure a url reachable than I am.
http://neverssl.com also works
And https://1.1.1.1 breaks people's brains if they know enough
A bit harsh I thought!
Android and Chrome do the same sort of thing to detect internet access; this is how Android pops the notification to sign in to the network.
Then, at least on Windows, the results of NCSI flow down into WinHTTP and a ton of other things so apps can know the status of the network.
It's also possible, via Group Policy, to configure a different URL for NCSI. This is useful in enterprises which may not have the NCSI URL available to unauthenticated things (eg: the OS) but still has internet access via proxies.
It's also possible to disable NCSI, captive portal detection, etc, which is useful on some closed network boxes (eg: some enterprises) but this will cause problems if the machines are ever used on public/walled garden/captive portal networks.
The biggest problem I've seen with this comes about where captive portal detection is disabled, a user ends up on a captive portal, tries to hit a website to satisfy the portal, but due to most sites that normal users will try being https these days can't get their session redirected in order to display the portal, so they think "the internet is broken". The NCSI/captive portal detection makes a point of using HTTP so captive portal redirection can work properly.
Not if they parse the payload of the response
Yes if they only use the http status
(I Think they rely on the payload…)Edit: an update (3.0.0) to the Switch changed it to http://ctest.cdn.nintendo.net/ but I can't seem to access it from a web browser.
Apple (iOS, MacOS) checks for https://captive.apple.com/hotspot-detect.html and expects a basic HTML page with the body containing "Success".
I have a problem at your math though, I'm guessing with the overhead and the pretend-IE headers it could be a whole Ethernet packet (which can be up to 1,500TB/day, but realistically it could be around 500TB).
But I guess you could say the content length header would be 1 byte longer in the double digits length contents (which it is).
curl -is http://www.msftconnecttest.com/connecttest.txt | wc -c
520
499TB/d vs 520TB/d, would be that a significant difference?Can anyone give any tips on either of these?
Being shafted like this every now and then has eroded my trust for Windows' updates.
Remember that security vulnerabilities in Windows are discovered all the time, so it's dangerous to use Windows without installing the updates. If you (rightfully) don't want to install the updates, then you should switch to an OS that actually respects your freedom instead, like Linux.
Note you need to disable tamper protection and reboot first otherwise it silently reenables itself.
Is there a nice description / workflow / tutorial / script / community where I can learn how to do that?
I did not find any recommended workflow for this by Microsoft itself, but maybe I was searching for the wrong things - windows updates are generally a bad thing to research anything related for. I expected to find some standard workflow description plus tools on some MS website, but no success. Does that exist?
Thank you very much!
https://download.wsusoffline.net/
will download Windows updates and create an installer for them.
I used thousadands of Windows machines in last decade, this is typical. You can ignore this "feature" almost entirelly.
If you introduce proxy in your system, then you can be certain that it will not work, including Windows updates. You have to masssage your system with net commands and learn about WinHTTP proxy (that nobody heard about) sfor it to sometimes work.
To deal with this and other nuisances I made 2 functions in PowerShell:
Update-Proxy https://github.com/majkinetor/posh/blob/master/MM_Network/Up...
Update-CLIProxy https://github.com/majkinetor/posh/blob/master/MM_Network/Up...
I am currently on basic OS install without anything in between and it doesn't work. I just switched from home router to my phone's hotspot and its the same.
It seems its not only Windows problem. Viber desktop has exclamation icon and it will persist until it is restarted, Mattermost works, Signal works etc.
Check it out: https://i.imgur.com/Oi5gmw4.png
BTW, didnt know proxy is exotic, its literrary the norm in the company.
If they don't load for you you probably modified your install with shutup10, block microsoft domains using your firewall or /etc/hosts or something else and you're out of support.
Is it because I've also created a Mobile Hotspot with the same SSID on a spare mobile phone I have, so my family can use their iPads out and about without having to connect to a new Wifi network? (i.e. I just works)
Is it because for some devices on my network, I DHCP them a different DNS server so they get adblocking via AdGuard home?
Who knows. It's so annoying. The fix if you want to update iOS on my home network is to connect to the Wifi Network called "F*kApple" which is exactly the same network as normal, but with a different SSID. Because that works just fine.
Also, F*k Apple.
PS: Also F Google because trying to search this problem just gives me the most infuriatingly childish "How to fix!" articles.
Apple caches a lot of info about networks it connects to. So it's probably caching that it received this option and "knows" that network to be metered.
Best solution for this is to have either more control over your mobile network so it's not sending that option, or more easily, name the mobile network something else from your home one.
Curiosly, Microsoft does respect it: https://learn.microsoft.com/en-us/openspecs/windows_protocol..., though it has to be matched to 'MSFT 5.0' clients.
You should be able to set wifi network priority so "home network" is first but if not available it automatically goes to "phone network".
If that spare mobile phone is an iphone, probably yes.
Wonder what kind of uptime this service has and what sort of footprint is needed?
Here is a list of Azure operated locations: https://learn.microsoft.com/en-us/azure/cdn/microsoft-pop-ab...
and what about the origin behind the cdn? seems like that it’s still rather critical and would have migrated multiple physical hosts over the past 30 years.
This sort of thing is fascinating and I do something similar at a much smaller scale at day job, keeping a simple service running that enables the rest of the stack to survive.
I doubt there is any origin at all. Since the response is so small and never changes it is likely hard coded into the config. Maybe it is a file on a shared object storage.
I'm in a situation where I needed to modify my Registry https://learn.microsoft.com/en-us/windows/win32/cimwin32prov... in order to convince the Metro UI that I was actually connected, whereas everything else was working fine.
I can't remember exactly what I did now, but it's been working great.
Also, sucks how Spotify wont even try to play songs when Windows displays no internet
But you have to point it at a server with the right file present. It doesn't just do a ping.
[1] https://www.ghacks.net/2014/02/07/disable-customize-windows-...
for spotify, offline playback is premium feature.
I like that one because it provides NAT + DHCP, creating another switch doesn't.
In my experience it is a selectable option when creating a new virtual switch but is not modifiable for the default.
I have my machine directly connected to my underpowered Remote Desktop client via ethernet, and it always picks that connection instead of the WiFi that actually has internet until I disable ethernet (or maybe the virtual adapter created on top of ethernet, I forget every month) and reboot.
In Windows 2000-8.1 the control panel GUI was the standard way of accomplishing this, but in modern Windows 10/11 I doubt Microsoft has the setting still accessible. There are still guides out there with screenshots, though: https://www.windowscentral.com/how-change-priority-order-net...
The automatic metric detection system bases its decision on network speed (https://learn.microsoft.com/en-us/troubleshoot/windows-serve...) so virtual 10gbps adapters can cause problems if you use a common network adapter and the custom settings for Hyper-V and such get messed up.
Note that as with the Windows version, the protocol is HTTP, not HTTPS – because captive portals completely break TLS, but plaintext HTTP will result in a clean redirect to the portal, allowing the network service to detect the presence of the portal and to bring up a browser window to let the user authenticate.
(https://devblogs.microsoft.com/oldnewthing/20221115-00/?p=10...)
I can see no reason why HTTPS is needed in any event. It's a single purpose domain that serves a static text file which everyone knows the content of.
However that doesn't tell you about the presence of a portal or if HTTP traffic is actually possible.
Mayeb that's the problem?
This can be a problem if there's some kind of critical vulnerability in the Microsoft HTTP stack, but I don't think this attack vector is all that relevant.
Same with other captive portal detection endpoints, there's very little actual parsing going on with these requests.
Thus: Hijacking WU to download malicious content takes far, far more than just DNS hijacking. You'd also need to subvert the WU signing system. (This is more nation-state level stuff.)
It should check if you are behind NAT and then say "Your computer doesn't have full Internet access but can reach some services via a gateway"
(And if you want something like UPnP to let programs automatically punch holes themselves anyway, again it doesn't matter much whether we're talking about NAT or "just" a plain firewall.)
The true evilness of NAT only really comes in when it's done by some third party outside of your control (CGNAT and friends), but I think that compared to home routers doing NAT the latter is a slightly more recent phenomenon that only got widespread traction when the IPv4 shortage became more acute.
And even if you somehow have a non-NAT, non-CGNAT, no-ISP-filtering home connection, do you have full Internet access if the server behind NowhereNews.com refuses all your connections because you’re in Europe?
Today most home networks have NAT for for v4, and then NATless IPv6 (or no IPv6 as the case may be).
Trivia: NAT is not routing, the normative router requirements RFC actually specifically forbids tampering with the IP source or destination address fields.
Anyway, won't be my problem much longer.
http://connectivity-check.ubuntu.com/, https://nmcheck.gnome.org/check_network_status.txt, http://captive.apple.com/hotspot-detect.html, http://connectivitycheck.gstatic.com/generate_204, http://www.archlinux.org/check_network_status.txt, http://networkcheck.kde.org/
You can disable the checks if you want. Any application that uses the operating system API/DBus to evaluate network connectivity rather than building its own bespoke online check will probably break if you do, though.
Because all of these have to use HTTP, you can also easily override the standard network addresses in your hosts file and pick your own server if that's what you prefer.
Anyway, won't be a trouble for me much longer. Retiring all my Windows instances, had enough.
Disagree.
Micro$oft is trying to define what is and is not 'internet' access, eg. they turn the definition of 'internet' to mean unfettered access to the micro$oft servers is and you're ability to send personal information over to them.
For some people Facebook is the internet and for others it is Outlook. Somehow a twiddler at MS has decided that a file on a web server at some wanky location is the internet and that's the final answer.
"I cn haz a file" is fine lovely internets! No it bloody well isn't. You should be constructing a response to a challenge from the other end, not a response to a simple GET like it's 1999.
I run quite a few systems/sites that have multiple internet connections - deciding whether the internet is available is quite a nuanced thing and that Windows internet detector is bloody stupid, naive and a fucking hindrance.
Define "internet" and then have a crack at defining "internet accessibility". Those things are quite specific to individuals. orgs and so on. Connectivity is way too complicated for a simple, naive check.
This is asking for the true Scotsman. This is designed for the 99% of users where internet access is a ternary "yes, no, needs credentials". The "naive" check is enough for them.
Also, as far as I know only Windows has defined settings to disable this check and assume that there's a connection (https://learn.microsoft.com/en-us/troubleshoot/windows-clien...). At least you could disable this if you need to, because Android don't have a similar setting.
wot?
> You should be constructing a response to a challenge from the other end, not a response to a simple GET like it's 1999.
Really? Isn't simple better here, why are you making this sound so crazy? Also you can turn it off.
The author also had a good response for spoofing question imo: "So what if somebody spoofs it? Congratulations, you tricked Windows into showing a “full internet access” icon, and then when the user tries to go to a web site, they get an error."
You sound like a typical engineer who cannot see the bigger picture of business decisions.
Seems like it's the same in many linux distros as well as android and chrome os. It's right there in the article. So it's not really MS specific at all.
I'm not following this, where is the nuance? What problems does this cause and why are they so difficult to solve? Even if behind a strict firewall that allows only a few IPs or ranges (arguable that would still be the "internet" as commonly understood), couldn't you just override DNS to return the same file from your server?
I've been annoyed by iOS disconnecting from wifi when no access is detected and I'm just trying to stream something from local network, but not Windows.
For example how do you tell traffic to go via WAN2 (or 3 or whatever) instead of WAN1 if is really down (define really down). So you create a rule that says that all inbound on LAN is routed via a failover thing. That's fine but now you've broken RFC1918 routing. You try to connect to a remote site via 192.168.lol and its fucked.
So you now create a rule that forces 192.168.0.0/16, 172.16.0.0/12 and 10.0.0.0/8 to be routed via the usual routing table and after that you have a rule that worries about internets and multi WAN. Simples.
No of course it isn't that simple but it is quite close and good enough mostly!
There are several problems in search of a solution here. Is a WAN down? Usually you ping something. What do you do if the thing being pinged is down but the link is actually available and how do you deal with that? It gets to charts of risk/reward at this point.
Also, I hope you’re not relying on ICMP to tell you meaningful things about your relationship with the internet. It lies.
If you need some complicated algorithm, write a quick simple web server that runs on 127.123.45.67 and does all of these checks for you when the magical portal URL is requested. Then update your registry to point to that IP (or use hacks like editing your hosts file) and you've just added your special logic to every WinHTTP application on your computer. You can even point Windows to an endpoint only reachable over VPN if you want so the Internet check becomes "is my VPN operational", though that may break the VPN software itself.
Microsoft did a good enough job for all normal use cases of the Internet. Bespoke use cases need bespoke solutions, and they provide the ability to set that up without hacks if you want to change the standard behaviour.