This week there has been a lot of news about a flaw in Windows that could be used by web sites to easily gain access to a visitor's Windows login name and password. When I tested this flaw it was downright scary.  Using a test site for this flaw, the site was able to get my test Microsoft Account login name and the hash of its password in a few seconds.  Then it took the site less than 30 seconds to crack the password! What is even scarier, is that this flaw is not new and was discovered in March 1997!

Test show my account info and Password
Test shows my account info and Password
Yes. I changed the password already.

News about this flaw was recently reported again by VPN company Perfect Private and by ValdikSS, who is affiliated with the Russian VPN service ProtoVPN.  They have both set up test sites that demonstrate this flaw so that visitors can determine if they are affected and should change their passwords.  I have no idea what information they keep from these tests, so I would change your password if they are able to detect your info. The web sites that can be used to test whether you are vulnerable to this flaw can be found here:

http://msleak.perfect-privacy.com/ (Perfect Privacy's Test Page)
http://witch.valdikss.org.ru/ (ValdikSS's Test Page)

While in the past this flaw was serious, it has become downright dangerous now that more and more people are using Windows 10 and logging into Windows with a Microsoft Account. With the use of Microsoft Accounts, credentials that can be used on the Internet are now more readily exposed through this flaw. Furthermore, since so many users use the same credentials on their Microsoft account as they do on other services, a hacker could potentially gain access to many other sites that a victim uses. This means that a victim's email accounts, bank accounts, government accounts, business accounts, etc could become compromised.

This bug works by somehow getting a user to open a remote SMB network share to access a file, When you connect to a SMB share, Windows automatically sends your user name and your hashed password to try to automatically login into the share.  The problem is that this happens even when the share is located off of your network or over the Internet.  See the problem now?

Essentially, all an attacker has to do is create a web page that contains a link to an  image hosted on a SMB server under their control. They can then monitor the server for credentials being passed to it and then run password cracking programs on the exposed password hashes.  As many people use extremely weak passwords, these programs can crack the passwords incredibly fast. When I say fast, I mean cracking a weak password in 4 seconds.

Cracking Password
Cracking Password

Unfortunately, Microsoft has not released an advisory regarding this flaw.  When I, and other sites, have reached out to Microsoft, we all received the same token response.

We’re aware of this information gathering technique, which was previously described in a paper in 2015. Microsoft released guidance to help protect customers and if needed, we’ll take additional steps.
- a Microsoft spokesperson

Unfortunately, to mitigate this flaw, there is not a lot of good info out there. Microsoft didn't really offer anything useful that I could get to work and Perfect Private advises you to stay away from Microsoft Edge and Internet Explorer. I knew there was a better way, so I dug around and found a few methods that prevented this information from being disclosed.

Preventing Edge and Internet Explorer from disclosing your Login Information

Below is a technique that a user can use to prevent Windows and applications from disclosing login credentials to remote servers. To prevent any application in Windows from disclosing your credentials, you need to configure certain Windows policies that disable outgoing NTLM traffic to remote servers. For Windows Home users, these policies will need to be configured via the registry.  Windows Pro and greater users can configure the policies via the Group Policy editor. 

If you enable this policy, no NTLM traffic will be sent to remote servers and this may cause issues in an enterprise or corporate environment. To resolve these issues you can configure another policy that allows you to add excepts to this restriction. More information can be found in the sections below.

Update 8/7/16: Updated the mitigation information to include registry keys that Home users can use to enable the policies below.

Use the Windows Registry to prevent NTLM Credentials from being sent to Remote Servers:

If you are using Windows Home then you do not have access to the Group Policy Editor to add the necessary Windows policies. Instead you will need to add them via the Windows Registry.  Those those who do not wish to use the Windows Registry Editor, I have created a Registry file that can be used to disable NTML Credentials from being sent to remote servers here. If you need to add server exceptions, you will need to follow the instructions below.

To do this, open the Windows Registry Editor by start the  C:\Windows\regedit.exe program. Then navigate to the following path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 as shown below.

MSV1_0 Registry Key
MSV1_0 Registry Key

Now right click on the MSV1_0 key as shown above and select New and then DWORD (32-bit) Value. A new value will be created and Windows will prompt you to name it as shown below.

Name New Value
Name New Value

Please enter RestrictSendingNTLMTraffic and then press the enter key on your keyboard to finish naming it. You should now see a new registry value called RestrictSendingNTLMTraffic under the MSV1_0 key. Now double-click on the RestrictSendingNTLMTraffic value and you will be shown a dialog asking you to enter data for this value.

Edit RestrictSendingNTLMTraffic Value
Edit RestrictSendingNTLMTraffic Value

In the Value data: field enter 2, which stands for Deny All, and then press the OK button.  Windows will no longer send NTML traffic to remote servers. If you perform another credential leak test, it should state that are no longer vulnerable.

Not Vulnerable
Not Vulnerable

You can now close the Windows Registry Editor and use your computer as normal.

If you need to allow certain remote servers to receive NTLM traffic from this computer, you will need to create another registry key. Using the previous instructions, you can create a new value located at HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\ called ClientAllowedNTLMServers. When creating this value, create it as a Multi-String Value, or REG_MULTI_SZ.

When you double-click on this value to enter its data, you will see a box where you can add text. In this box you should add the names of servers, each on their own line, that you wish to allow NTLM traffic to be sent to.

Use the Group Policy Editor to prevent NTLM Credentials from being sent to Remote Servers:

In order to prevent Microsoft Edge and Internet Explorer from leaking your account credentials, you need to enable a particular policy on the computer called Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers.  This policy will prevent Windows from sending credentials to remote servers when accessing a SMB share.  Though I tested this on my computer with absolutely no problems, this could cause issues in a corporate environment. Therefore, please perform tests before putting this change into production. There is another policy that I will describe below that should allow you to white list certain servers so that credentials are sent as normal.

To enable this policy, you should open the Group Policy Editor and navigate to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers as shown below.

Restrict NTML Outgoing Policy
Restrict NTML Outgoing Policy

To enable this policy, double-click on the Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers and configure it to Deny all as shown below. You can also select Audit All to generate Windows event logs that show what remote servers you are sending credentials. This can be used to create a whitelist in the other policy described later in the article.

Restrict Outgoing NTLM Traffic
Restrict Outgoing NTLM Traffic

Now that you have restricted outgoing NTML traffic, Windows will no longer send your NTLM credentials to remote shares. You can test this, by going to one of the credential leak test sites described earlier in the article. It should now say the computer is not vulnerable.

Test showing that you are no longer Vulnerable

For those who need to send credentials to a remote server, you can add certain servers to a whitelist through the To enable this policy, you should open the Group Policy Editor and navigate to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Network security: Restrict NTLM: Add remote server exceptions for NTLM authentication as shown below.

Restrict NTML Outgoing Policy
Add remote server exceptions for NTLM authentication Policu

To enable this policy, double-click on the Network security: Restrict NTLM: Add remote server exceptions for NTLM authentication and add the servers that you wish to whitelist. This will allow the credentials to be sent to these servers as normal.

Add Exceptions for Outgoing NTLM Traffic
Add Exceptions for Outgoing NTLM Traffic

Your computer will now be protected from the NTML Credentials Leak, while at the same time being able to use remote SMB servers as needed.

Disabled Internet Windows Authentication in Internet Explorer