Arastiriyorum 9 months ago

Hardening Microsoft IIS 8.5 Security Headers

In this post we will walk through how to implement some of the most common security headers that crop up in Microsoft IIS 8.5 web application testing.

X-Frame-Options header – This can help prevent the clickjacking vulnerability by instructing the browser not to in bed the page in an iframe.

X-XSS-Protection header – This can help prevent some cross site scripting attacks.

X-Content-Type-Options header – This will deny content sniffing.

Content-Security-Policy – This can help prevent various attacks by telling the browser to only load content from the sources you specify. In this example I will only specify the source, ie my webpage however if you have content being pulled from youtube for example you will want to add this site also.

HTTP Strict Transport Security header – This will tell the browser to only ever load https only, once the site has been visited.

Corresponding values for the above headers are described below.

In order to lab this up we will use a vanilla Windows Server 2012 R2 server that has had the IIS role installed and configured and is serving just a simple single page running over HTTPS (only with a self signed cert for testing purposes), which looks like this:

IIS-webpage.jpg

With completely standard configuration output from Nikto would give us the following results:

nikto.jpg

OWASP Zap would give us similar results (I did this whilst still on http, however you get the idea):

zap.jpg

Granted there is next to nothing to actually scan on this pages, however this is really only designed to demonstrate how to implement the security headers.

In the IIS console we will want to select the ‘HTTP Response Headers’, you can do this at the site level as I have done or at the webserver level which will affect all sites.

IIS-response-headers.jpg

Next select Add from the left hand side:

IIS-response-headers-add.jpg

First we will add X-XXS-Protection security header, here we can use the value of ‘1;mode=block’, this essentially means we will turn the feature on and if detected block it. Other basic options consist of ‘1’ to enable or ‘0’ to set the header however disable the feature :

IIS-response-headers-x-xss.jpg

Next the X-Frame-Options security header, here we can use the value of ‘DENY’ to prevent any content embedding, however this maybe too strict otherwise there is ‘SAMEORIGIN’ to allow content from your site, another option is to use ‘ALLOW-FROM’ to allow content framing from another site:

IIS-response-headers-x-frame-options.jpg

Next the X-Content-Type-Options security header, here we can use the value of ‘nosniff’:

IIS-response-headers-x-content-type-options.jpg

The content security policy header, here we are specifying a very basic policy to only load content from the source:

IIS-response-headers-content-securty-policy.jpg

The HTTP Strict Transport Security header, here we are setting the max age the browser should honour the header request, to include all subdomains and the preload essentially means that if HTTP site is available only load via HTTPS so on a second visit load the config first before hitting the site:

IIS-response-headers-HSTS.jpg

Re-running nikto gives us the following output, much better!

nikto-after-headers.jpg

Hopefully this has helped harden your IIS web server just that little bit more!

0
224
Hakikaten Yapay Zekâ Hayatımızı Kökten Değiştirecek mi?

Hakikaten Yapay Zekâ Hayatımızı Kökten Değiştirecek mi?

1713358301.jpg
Arastiriyorum
4 months ago
Araştırma ne işe yarar? Araştırma nasıl kullanılır?

Araştırma ne işe yarar? Araştırma nasıl kullanılır?

1713358301.jpg
Arastiriyorum
1 year ago
Araştırmacılar ve Akademisyenler için Dijital Kütüphane Listesi

Araştırmacılar ve Akademisyenler için Dijital Kütüphane Listesi

1713358301.jpg
Arastiriyorum
2 months ago
TÜAD Araştırmaların Kamuoyu İle Paylaşımına Dair Açıklama

TÜAD Araştırmaların Kamuoyu İle Paylaşımına Dair Açıklama

1713358301.jpg
Arastiriyorum
1 year ago
Dünya Sağlık Örgütü açıkladı: En çok alkol tüketen 10 ülke

Dünya Sağlık Örgütü açıkladı: En çok alkol tüketen 10 ülke

1713358301.jpg
Arastiriyorum
2 weeks ago