Skip to content
  • English Deutsch

benjamin-abt.com

Performance is a feature | Cloud - AI - Azure - .NET - Sustainability

  • Home
  • Blog
  • Portfolio
    • Overview
    • Workshops & Training
    • Publications
  • Contact
  • Home
  • Blog

IIS und ASP.NET Header verstecken

benjamin-abt.com
March 16, 2015 2 min read BEN ABT
IIS ASP.NET

Dieser Artikel stammt aus dem Jahr 2015. Versionen, Werkzeuge und Empfehlungen können sich seitdem geändert haben. Neuere Beiträge findest du unter Blog.

Nicht jeder möchte, dass jeder sehen kann, was für ein Webserver für die eigene Homepage verwendet wird. Dies sind bzw. können schließlich auch sicherheitsrelevante Informationen darstellen.

Der IIS sowie ASP.NET verschicken aber standardmäßig ihre Versionssignaturen über die HTTP-Header an den Client.

IIS Header Bloat

Die ungeliebten Header sind hierbei

  • Server Microsoft/IIS8.0
  • X-AspNetMvc-Version 5.5.2
  • X-AspNet-Version 4.0.30319
  • X-Powered-By: ASP.NET

Um diese künftig nicht mehr zu verwenden reichen zwei Einträge in der Web-Config:

XML
1<configuration>
2  <system.webServer>
3    <httpProtocol>
4      <customHeaders>
5        <remove name="X-Powered-By" />
6        <remove name="Server" />

Das deaktiviert die Header des IIS, also Server sowie X-Powered-By

Zusätzlich brauchen wir noch

XML
1 <system.web>
2    <httpRuntime enableVersionHeader="false"/>

um X-AspNet-Version aus dem Header zu bekommen.

Für ASP.NET sieht das nicht ganz so einfach aus; hier müssen wir leider den Code anfassen.

Dazu müssen wir folgenden Code in die Global.asax.cs einfügen:

C#
1public class MvcApplication : System.Web.HttpApplication
2{
3    protected void Application_Start()
4    {
5        MvcHandler.DisableMvcResponseHeader = true;

Dies entfernt den Header X-AspNetMvc-Version.

Der Webserver verschickt nun keine weiteren Header-Informationen, die ihn bzw. dessen Version entlarven könnte.

Security through Obscurity

Auch wenn dieses Vorgehen nur eine Taktik der Verschleierung darstellt sorgt es gleichermaßen für eine Erhöhung der Sicherheit. Es gibt durchaus Bots, die gezielt auf Webserver-Produkte und -Versionen ausgerichtet sind. Nimmt man diesen die Grundinformation erhöht das die Wahrscheinlichkeit, dass eine Unregelmäßigkeit in den Anfragen frühzeitig erkannt wird.

Related articles

Warum IP-Adressen kein eindeutiges Merkmal sind

Jan 28, 2020 - 8 min read

Warum IP-Adressen kein eindeutiges Merkmal sind

Immer wieder sieht man in Code, der für den Login eines Benutzers verwendet wird, dass mit Hilfe der IP-Adresse oder zum Beispiel auch dem …

Using ASP.NET Core 3 in .NET libraries

Oct 4, 2019 - 2 min read

Using ASP.NET Core 3 in .NET libraries

With the release of ASP.NET Core 3, Microsoft has also changed the way how to use and reference ASP.NET Core dependencies. In the past you …

Better exception details with ASP.NET Core

Mar 26, 2017 - 1 min read

Better exception details with ASP.NET Core

By default, ASP.NET Core suppresses Exceptions on Startup on external environments. So you only get Exceptions in Startup on localhost.


BEN ABT

BEN ABT

Ben is Chief Engineering Officer and Principal Software Engineer at Medialesson.de, with a strong focus on .NET and Microsoft Azure. In his professional role, he designs and builds highly scalable platforms for hybrid and cloud-based scenarios. He also advises companies and C-levels on migrating to the sovereign cloud.

He runs myCSharp.de, the largest and most active German-speaking C# community forum, actively contributes to both his own and external open-source projects and regularly shares his knowledge through his blog, at community events, conferences and as a writer for technical magazines.

Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms

Modernization

Training & Consulting

Contact Me
X Facebook LinkedIn WhatsApp
Back Next Blog Post

Open for work!

Contact Me
BEN ABT BEN ABT Software Engineer · Microsoft MVP Passionate about .NET, Azure, performance optimization and sustainable software engineering.

Medialesson GmbH Logo

Microsoft MVP Logo

Recent posts

View all
Stop Using nginx as Your Default Static File Server in Docker

Stop Using nginx as Your Default Static File Server in …

Oct 24, 2026
Containerizing .NET in 2026 Without a Dockerfile

Containerizing .NET in 2026 Without a Dockerfile

Oct 20, 2026
Problem Details in ASP.NET Core and .NET 11

Problem Details in ASP.NET Core and .NET 11

Oct 5, 2026
Resilience in .NET with Microsoft.Extensions.Resilience

Resilience in .NET with Microsoft.Extensions.Resilience

Sep 21, 2026
What Matters in ASP.NET Core 11

What Matters in ASP.NET Core 11

Sep 14, 2026

Tags

.NET (192) Csharp (96) ASP.NET Core (48) Azure (41) DevOps (17) Docker (14) Microsoft (14) EF Core (11) Microsoft MVP (11) AI (10) GitHub (10) GitHub Copilot (10) ASP.NET (9) Security (9) Synology (9) Architecture (8) Raspberry (8) Azure Functions (7) Cloudflare (7) Bicep (6)
benjamin-abt.com

About BEN

Benjamin Abt is a Software Engineer, Platform Architect and Microsoft MVP specializing in .NET, Azure, cloud architecture, performance optimization and sustainable software development.

Connect

  • Follow me on GitHub
  • Follow me on LinkedIn
  • Follow me on Mastodon
  • Microsoft MVP profile
  • Follow SchwabenCode on GitHub
  • Follow me on X

Quick Links

  • Portfolio
  • Blog
  • Workshops & Training
  • Publications
  • Get in Touch
  • Sitemap
Open for Work

© Copyright Benjamin Abt & SchwabenCode | 2011 - 2026

Content licensed under CC BY 4.0 unless otherwise noted.

  • Impressum
  • Privacy
  • Contact