Internet Explorer Hardening Mysteries

Today I had a very interesting problem with system hardening and a new application that we are going to use. This application moved from a form based management interface to a web based one. Under normal circumstances this doesn’t provide a huge challenge because management of these type of apps is done over the network from a client based machine. However, since we have a solution that’s sometimes only reachable on the box itself I have to make sure that the local instance of Internet Explorer actually still works after I apply system hardening polices. And that’s where it’s gets confusing. In the explanation below I’ll use a simple page hosted on IIS, accessed locally through Internet Explorer on Windows Server 2012 R2.

On this page:

  1. The Basics
  2. Default Setup
  3. Some Magic
  4. Site to Zone Assignment List
  5. Computer Configuration
  6. Security Zones
  7. The Effects of User Account Control
  8. The Enterprise Solution
  9. Summary
  10. References

The Basics

Before we start there are a few basics that we need to discuss. Internet Explorer has something called security zone assignment. This means that every site that you open in the browser is assessed and placed into one of these zones. Each zone holds a different security configuration, so you can interact differently with sites you trust, are under your control, run in your data centers or are hosted on the Internet. Opening the Internet Properties, Security page actually reveals 4 of the 5 zones. There’s one hidden one (zone 0) which is applicable to the local computer (system) only.

  1. Local Intranet
  2. Trusted Sites
  3. Internet
  4. Restricted sites

These are actually the internal number Internet explorer assigns to the zones. We’ll be using them later.

Next I want to focus on a security feature called “IE Enhanced Security Configuration” that was introduced some time ago, but is almost exclusively disabled on all systems that I’ve seen, which is really unfortunate. Let’s be clear on one thing though. Having a browser installed on a server class device is under almost any circumstance a no-go. Just don’t do it. Your networking people have most likely setup all kind of network devices keeping your network secure and browsing from a server isn’t really helping. Getting all kind of nastiness directly into your server segment is considered bad practice. Having said that, our setup unfortunately can’t work in a different way. We have to deal with a browser on the box, hence we harden Internet Explorer and “IE Enhanced Security Configuration” is part of that. Basically it raises the security settings of the security zones we discussed above and some stuff more. If you want to know the details, type this in the Internet Explorer address bar:


Last thing that I want to address is the addition of “Enhanced Protected mode” of Internet Explorer. This extra layer of security was introduced in Windows 8. Its intent was to further enhance the capabilities of the original implementation of protected mode. It does so by enabling a sandboxing technology, Microsoft named AppContainers. The concept of using AppContainers goes back to the release of Windows Vista where the concept of integrity levels was introduced. Those levels separate abilities of processes running on different levels on the operating system.

More information can be found here:

Default Setup

Having a web application on your box and connecting to it using localhost simply works out of the box. That’s because the security settings in the security zones are configured in such a way that it’s an allowed operation. As I mentioned in the beginning, all sites are evaluated and placed in the appropriate zone. When you connect to localhost, the site is evaluated, placed in the “Intranet Zone” and those security settings are then used. From a UI point of view, just open the “Internet Options” – “Security“. Select the “Local Intranet“, click “Sites“, those sites listed will automatically be placed in the “Local Intranet” zone, sounds logically, right!

Now on Server 2012 R2, from a registry point of view, it gets a little bit more complicated. Per default security zone information is stored in the context of the current user, but depending if you have “IE Enhanced Security Configuration” enabled (or not) it’s stored in a different place. The UI however does a good job on storing them in the appropriate place.

IE Enhanced Security Configuration turned on (default)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains

IE Enhanced Security Configuration turned off

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains

Some Magic

If you turn off “IE Enhanced Security Configuration“, the EscDomains default registry keys are completely cleared. Just take a look in the registry key or in the security tab. However, connecting to the localhost still works, even bringing up the properties of the webpage shows it being in the local intranet zone. Even though the localhost is not specifically mentioned anywhere the setting “Include all local (intranet sites not listed in other zones” is at play here. Anything not mentioned elsewhere and complies as being “local intranet” is placed in this zone. That’s why this still works. Restoring IE Enhanced Security Configuration will restore the default keys.

Site to Zone Assignment List

When you’re in a network managing a lot of machines you want to have a centralized way of managing devices. Usually that implies using group policies. Managing zone assignment for Internet Explorer is easy and at the same time very difficult because of the differences that you can encounter. Take the “Site to Zone Assignment List” policy as an example. This policy allows you to configure sites to fall into a certain zone. However this does not work when you have “IE Enhanced Security Configuration” enabled. And as far as I could find there’s no policy available to manage sites with a GPO when having “IE Enhanced Security Configuration” enabled, besides using group policy preferences. But that’s simply adding registry entries. This is a bit of a mess if you ask me as one would expect to have policies available for managing this.

Computer Configuration

As we have a requirement from the Internet Explorer STIG (Security Technical Implementation Guide) to use only computer based polices for Internet Explorer, this is actually the point where things start getting a bit more confusing. The policy I’m talking about is located here:

Computer Configuration – Administrative Templates – Windows Components – Internet Explorer – Security Zones: Use only machine settings

The idea behind this setting is that regardless if your user account falls into the scope of management for applying this policy, it’s simply always there. To be honest it isn’t even such a bad idea, it’s just that the execution is very different than using it on an user level. Let me explain.

If you set the above policy to enable, the text states. “If you enable this policy, changes that the user makes to a security zone will apply to all users of the computer”.

Right, so in my experience this simple is not true. Let’s give it a try. Enable the policy and open IE, go to “Internet Options“, “Security“, “Trusted sites“. Now add a website, for example to the trusted or intranet websites. Close the dialog and open the web site, next open the properties of the web site. Notice that it’s still in the “Internet” security zone! Hence the settings you make in the UI are not set in the registry and are not in effect. Funny part of the whole situation is that the keys actually end up in the correct registry place, or at least the place you would expect them to be.


Assuming the default setup of Windows with no additional policies, a notification popped up while opening the page. It informs you that the page is blocked, but does provide a means to add the web site. Let’s try the “Add” button and see what happens. Open up the properties of the web site and behold! The site is now placed in the appropriate zone! If you’re just a little bit like me you would what to know what magic is at play here. My choice of tools is again Process Monitor. There we see that the keys end up in a totally different place. In the “HKLM\Software\Wow6432Node” registry location.


So this means that a 32 bit process is actually writing the keys instead of an expected 64 bits process. Adding the architecture column in Process Monitor actually shows this little gotcha.

Now for some real confusion. Yes it’s getting worse. Open IE again, “Internet Options“, “Security“, “Trusted Sites“. Is the page listed? Nope, it’s not! So we can safely conclude that the UI does not play nice when the computer only policy is enabled. It’s registry only and the settings should be in the ‘Wow6432Node” registry key section.

Note! In this case it doesn’t matter if you turn of “IE Enhanced Security Configuration” the effect is still the same.

Note! Per default the Wow6432Node EscDomains registry is empty and is not populated. Turning “IE Enhanced Security Configuration” off and on again creates the keys. That sure causes a lot of confusion.

Security Zones

After I finally figured out what a mess the above actually was it got me wondering if this actually got a further effect on the zone configuration itself. Let’s try a little something. Per default the “Local Intranet” zone doesn’t have protected mode enabled. To get a little more advanced here, the setting in the zones registry configuration has the name “2500”, the value indicates its configuration state. More info can be found here:

Let’s start with the default. Set the policy “Security Zones: Use only machine settings” to off, applying the user policies again. A quick look at the current users hive shows that enabling protected mode for the “local Intranet” zone provides a value of 0 for the name 2500. So protected mode is on. A value of 3 turns it off.

Enable the “Security Zones: Use only machine settings” again, and see the effects. Opening the UI and selecting the “Security” – “Local Intranet” zone sets the “Enable Protected mode” to on. Looking in the registry again, the value ends up in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\2500

So that seems to be doing alright.

Note! After further testing it seems that the key needs to be set in both the local machine and the Wow6432Node key to be effective. This should read, don’t mess around with registry keys when you have a policy available. Just think of the above as nice to know information.

The Effects of User Account Control

In the beginning of this post I mentioned that IE protected mode is built on integrity levels, which are a part of User Account Control. As most of you will start testing with the build in local Administrator account (or the domain administrator for that matter) the outcome will be very different. Per default the local administrator account is exempt from UAC and its effects. This directly implicates that protected mode for the local administrator is not in effect even when it’s set to enable. The full effect of having protected mode becomes visible when the policy “User Account Control: Use Admin Approval Mode for the built-in Administrator account” is set to enabled (a system reboot is required). After that the full implementation of protected mode is in effect. This has a direct effect of being unable to connect to the local host. As Applications that have protected mode enabled are prohibited from making a loopback connection. Solving it can be done by using the registry entry 2500 to the value of 3 (Set them in both the machine and Wow6432Node registry locations), use the UI when available but preferably use the “Turn on protected mode” policy for the Intranet zone.

There is another way, officially just for developers, but it works. Use the CheckNetIsolation.exe tool. Example:

CheckNetIsolation.exe LoopbackExempt –a –n=windows_ie_ac_122

More info can be found here:

The Enterprise Solution

After a few days of testing we’ve found a more effective solution which I would like to share here.

The following is actually the “Site to Zone Assignment List” policy but split up into http and https. This is applicable when “IE Enhanced Security Configuration” is enabled.

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\localhost]

Adding the following code will populate the registry in all the required places. The trick here is that the settings above have to be set also. Anything listed here is then effectively applied on the system.

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\localhost]

In our very special case we need to have access from the box itself to the localhost. As of Windows Server 2012 this is prohibited by “Enhanced protected mode” because it uses AppContainers. So we have decided that protected mode is turned off for the Intranet Zone when we need to connect to the localhost.

Computer Configuration – Administrative Templates – Windows Components – Internet Explorer – Internet Control Panel – Security Page – Intranet Zone – Turn on Protected Mode

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1]

Just to make your life a bit easier I’ve created a GPO template that can be deployed in your infrastructure. Download it here: templates.

Save the files to the PolicyDefinitions folder and open the group policy editor. You will see an additional policy named “Enable Internet Explorer localhost Connectivity” in “Computer ConfigurationAdministrative TemplatesHardeningInternet Explorer“. Set it to “Enabled” to allow localhost connectivity.


My observations and recommendations.

  • Don’t always trust the UI, it only partially reflects the reality, especially with the computer only configuration.
  • Always set UAC to on, even for the local administrator account.
  • Populate the EscDomain in Wow6432Node using a policy or automate it.
  • Manual population of the keys occurs when you turn ‘IE Enhanced Security Configuration” off and back on again (suspect a bug).
  • Use the “Turn on protected mode” policy for the Intranet zone when you want to connect to the localhost and have “enhanced protected mode” enabled. Set it to disable the protected mode.
  • Windows Server 2016 has the same “bug”.
  • The above is not an issue on Windows Server 2008 R2.

Hopefully this helps you to understand how IE actually handles certain security aspects.


Understanding and Working in Protected Mode Internet Explorer

How the Integrity Mechanism Is Implemented in Windows Vista

A Peek into IE’s Enhanced Protected Mode Sandbox

Enhanced Protected Mode add-on compatibility

Internet Explorer security zones registry entries for advanced users

How to enable loopback and troubleshoot network isolation (Windows Runtime apps)

3DES/FIPS 140-2/RDP Hotfix

In the past I’ve written a blog about the issues my company encountered when we disabled 3DES on our Windows 2008 R2 systems. Since we are obligated to also use FIPS 140-2 for compliance reasons the combination of disabling 3DES, and having FIPS140-2 enabled would break remote desktop functionality. Basically it came down to RDP using hardcoded 3DES when FIPS140-2 was also enabled. Needless to say RDP would stop functioning when you disable the one thing it could use. When the sweet32 vulnerability came along we had to make a choice, do we want to be secure or do we want to be able to remotely connect? Unfortunately since disabling 3DES is a system wide setting it’s not possible to differentiate between protocols. Leaving us stuck in between a rock and a hard place. Last option was to file a case with Microsoft.

It took us several conversations with Microsoft support, providing evidence and creating a business case for the Windows product group to determine the potential impact. One of the challenges we faced was that Windows 2008 R2 has been out of mainstream support for a couple of years now. So any change on this level would require the product group to agree upon a design change, which is very rare in these kind of situations. After a few month’s they agreed and we eventually got a preview fix that worked like a charm!

As of today I’m glad to be able to announce that a permanent fix has been released. As it’s a platform fix, bound to the operating system it will be included in the Microsoft update cycle of next month. My Microsoft representative has promised that an individual KB will be released soon describing the specific issue and solution. I’ll update this post when it becomes available.

A current hotfix is already included in the preview for September 2017, which you can get here:

Or get it from the catalog:

On a personal note, I would like to extend my gratitude to Microsoft support for the excellent push they did towards the product group convincing them on the necessity for this fix and working with me throughout this endeavor. My first experience being a customer instead of a Microsoft employee was a very pleasant experience!

Windows Update Error 0x80072ee2

For a while now I’ve been getting timeouts when using Windows updates through our proxy servers. Everything else seems to be working just fine, no complaints on browsing the web, it just seems that whenever I’m using Windows update through the proxy it takes a few times before it’s successful. Up until now it wasn’t really a problem because we use internal WSUS servers, however testing the Microsoft Operation Manager Suite and pointing Windows update to the Internet for getting the patches made it clear that connectivity issues were getting in the way of progress. Every time we scheduled an update run, it’s would time out on the proxy with error 0x80072ee2, direct connection went fine on all occasions. To make a long story short it turns out that the underlying mechanism of Windows Updates depends on the Background Intelligent Transfer Service (BITS), which in turn uses a different mechanism to connect to the internet (WINHTTP).

Normally it will use your Internet Explorer proxy to connect to the Internet, yet this seems to be having a few issues where Windows Update is unable to connect. What helped me in fixing the problem is telling WINHTTP to always use a dedicated proxy instead of relying of the automatic detection of a proxy or use the settings from Internet Explorer. Simply use good old netsh or use the powershell cmdlet:


to accomplish this task.

List the current proxy
netsh winhttp show proxy

Set a proxy server
netsh winhttp set proxy <FQDN:Port> 

Reset the proxy for winhttp
netsh winhttp reset proxy


Can’t download updates from Windows Update from behind a firewall or proxy server

How the Windows Update client determines which proxy server to use to connect to the Windows Update Web site

Windows Update Error List

Netsh Commands for Windows Hypertext Transfer Protocol (WINHTTP)


Best Practices When Using BITS

Windows Activation

At times I need a semi isolated Lab environment that will last for an extended period of time. Using Windows as an operating system I could fall back on using the evaluation version of the OS but wouldn’t it be cool if I could be using our corporate activation services for that? Luckily there’s a very easy way to get your machines activated, even when you run a lab environment. As most of you know Windows activation is accomplished by using the KMS service. It’s a service that uses anonymous RPC at port 1688. Being anonymous by nature is something we can take advantage of. To start using the corporate server you should do an inventory first. On your corporate network use the NSLookup utility to query for KMS entries.

nslookup -type=srv _vlmcs._tcp

If your environment contains KMS servers it will list something like this: SRV service location
svr internet address =

Now you have the name and IP address of your corporate kms server, go to your lab setup and create a DNS service record in the _tcp. zone.

  1. Open the DNS management on your DNS server.
  2. Expand the DNS Zone.
  3. Right-click on the “_tcp” folder and select “Other” -> “New Records“.
  4. Select Service Location (SRV) as the new record type.

Fill in the following information for the new DNS record:

Service: _VLMCS
Protocol: _tcp
Port: 1688
Priority: 10
Host offering the service: (or the IP address)

Go to your client or server and at an elevated command prompt type:

slmgr /ato

this will activate your machine. Use:

slmgr /dlv

to see the activation status.

32 Bit Processes on 64 Bit Systems

On our systems we apply hardening policies by all kinds of available techniques. Being local policies, PowerShell scripts or classic batch files even. All the settings are eventually applied by a central installer that takes care of the installation, reboots and validation of the settings. Recently on one of our older systems we ran into something that appeared to be magical at first. Simply put we tried to apply a registry setting that was logged as being successfully set, however it never was applied. Although so it seemed to be the case. After a morning of testing we discovered that the registry key was actually applied (as indicated by the logging) but on another location in the registry. The key showed up in a location that’s used for 32 bit processes on 64 bit systems.

Windows has something called redirection for 32 bit processes when running on a 64 bit system. Normally when an application writes content to the registry (Such as a batch file) it’s a 64 bit process, however, as it turns out, our main installer on 64 bit systems is still 32 bit, hence Windows will redirect all writes to “HKLM\Software” to the “HKLM\Software\WOW6432Node” node. If you want to give it a try, open up “cmd.exe” from the “C:\Windows\SysWOW64” folder and add something to “HKLM\Software” using “reg.exe“. The key will be redirected to the “HKLM\Software\WOW6432Node” node.


Under normal circumstances this is a good thing to separate 32 bit application from native 64 bits application. In our case not so much, because it’s an installer, not an application. The solution to this problem is rather easy. Adding the parameter:


after the command-line tells the redirector to act as if it’s a 64 bit application and ignore the 32 bit status. Easy does it.


Registry Redirector

The Microsoft Root Certificate Program

A couple of days ago I had to deal with a situation where our vulnerability tool was complaining that the root certificate store wasn’t updated for a while. After doing some research it turned out that the update service for the Microsoft root certificate program was blocked. That in turn triggered me to dig into the more technical part of the Microsoft Root certificate program. In short the Root Certificate Program makes the end user experience browsing experience a better one. When you visit an https enabled website a check is done if you trust the root authority that handed out the certificate (or the intermediate ca for that matter). If that root certificate is not in the “Trusted Root Certification Authorities” container a list of known participants of the root certificate program is checked if that Root CA is listed. If it is, the certificate is automatically downloaded and stored in the “Trusted Root Certification Authorities”.

Although it sounds like a good plan, it can be a bit confusing. In our case we work in a disconnected environment. Read, not being able to connect to Windows update. In that case you can tell Windows to use an internal web of file server to host the certificate list. The process is exactly the same in that case, it just uses a different repository. The confusing part was when I noticed that the location wasn’t reachable however the root certificates where installed regardless. What kind of magic was at play her? Turns out that it isn’t magic after all. Already with the introduction of Windows Vista, long long time ago Microsoft embedded the current list of Root certificates in the crypt32.dll. So if the automatic root certificate process can’t reach Windows update, an internal web or file server, it extracts the certificate from crypt32.dll. It took a while before I figured that one.

Quick steps to manage your internal certificate list

Use the following steps on your Server:

  • Create a local folder and share it.
  • Use:Certutil -syncWithWU
    This will get all the appropriate data from Windows update site. Being:

    •, contains a non-Microsoft Certificate trust List (STL)
    •, contains a STL with untrusted certificates
    • disallowedcert.sst, contains a serialized certificate store (SST) for untrusted certificates
    •, contains a STL of certificate pining rules (Windows 10 and higher)
    • Pinrulesstl.sst, contains a serialized certificate store (SST) for Certificate pining.
    • *.crt, all individual root certificate files.

Set the following registry key on your Client/Target point to your share:

HKLM\Software\Microsoft\SystemCertificates\AuthRoot\AutoUpdate\RootDirURL=file://\\server\share (REG_SZ)

These setting are effective immediately.


Enable AutoUpdate of the trusted Certificate Trust List

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SystemCertificates\AuthRoot\DisableRootAutoUpdate=0 (REG_DWORD)

Setting this to 1 turns off the whole auto update mechanism for both trusted and untrusted certificates

Enable AutoUpdate of the untrusted Certificate Trust List (Default is trusted and untrusted certificates)

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SystemCertificates\AuthRoot\EnableDisallowedCertAutoUpdate=1 (REG_DWORD)

Create a custom serialized certificate store

  • Certutil -generateSSTFromWU <path\file.sst>
  • start explorer.exe <path\file.sst>
  • Select the certificates that you want and export the file to a new sst.
  • Import the file in your group policy

Clean the local downloaded cache (Only with the Windows update download)

locate the “CryptnetUrlCache” folder and delete the content. Usually in your user profile. (“%userprofile%\AppData\LocalLow\Microsoft\CryptnetUrlCache“)

Enable CryptoAPI 2.0 Diagnostics

Enable the Capi2 event log (located in the “Applications and Services Logs”) to get crypto operations logging.

Start a cryptographic operation

To initiate a crypto operation and see the automatic root certificate at work, browse to a HTTPS enabled website or open one of the certificates from the download mentioned above. Removing the certificate from the store and starting a crypto operation will reinitiate the process.

Dump the content of a Certificate Trust List

certutil.exe -dump <path\file.stl>


An automatic updater of untrusted certificates is available for Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2,-windows-server-2008,-windows-7,-and-windows-server-2008-r2

Configure Trusted Roots and Disallowed Certificates

Root update download location /static/trustedr/en/


Manually setting Windows Firewall Profiles

What has always bugged me to some extend is that Microsoft removed the possibility to set the Windows firewall profile to my own liking. Not just let Windows decide what’s best. It normally does a pretty good job, but there are occasions where you want to change it manually. Unfortunately, in the network center, there’s no option to just change it. You could always mess around and change the specific network with a policy, but there’s an easier way. PowerShell to the rescue.

Set all firewall Profiles

Use this command to change all the network interfaces to the private profile:
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private

Or apply the public profile
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Public

In case you would like the individual connections to have a different profile assigned you need to use a reference point. Use the Get-NetConnectionProfile first to get all the information about the locally installed network adapters.

In this case we use the “InterfaceIndex” number, but you could also use the adapter name, as long as it’s unique. Now that we have the reference (or entry) point we can use the Set-NetConnectionProfile cmdlet to set the correct state.

The command above sets the firewall profile for that specific adapter to the private profile. The options that are available are:

  • Public
  • Private
  • DomainAuthenticated

To validate the execution use the Get-NetConnectionProfile again.


Understanding Firewall Profiles