Web.config File for IIS

Example of a web.config file to be copied into the IIS shares.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="true" />
        <security>
            <requestFiltering>
                <fileExtensions>
                    <remove fileExtension=".resources" />
                    <remove fileExtension=".csproj" />
                    <remove fileExtension=".resx" />
                    <remove fileExtension=".vbproj" />
                    <remove fileExtension=".vb" />
                    <remove fileExtension=".cs" />
                    <remove fileExtension=".vjsproj" />
                    <remove fileExtension=".java" />
                    <remove fileExtension=".ldf" />
                    <remove fileExtension=".mdf" />
                    <remove fileExtension=".mdb" />
                    <remove fileExtension=".config" />
                    <add fileExtension="." allowed="true" />
                </fileExtensions>
                <hiddenSegments>
                    <remove segment="bin" />
                </hiddenSegments>
            </requestFiltering>
        </security>
     <staticContent>
            <mimeMap fileExtension="." mimeType="application/octet-stream" />
            <mimeMap fileExtension=".*" mimeType="application/octet-stream" />
        </staticContent>
    </system.webServer>
</configuration>

https://github.com/DavidWuibaille/IVANTI/tree/main/WebConfig

Script Configuration for IIS

Installing IIS (requires a reboot)

Commands to enable IIS features and manage file sharing permissions.

IIS Configuration for Downloading Files Without Extension

To enable the downloading of files without an extension, an IIS configuration is necessary.

  • In IIS on the HTTP share, configure the “Mime Types”.
  • Add an entry for files without an extension.

If Certain Extensions Cannot Be Downloaded via HTTP

An IIS configuration is necessary.

  • In the virtual directory (NOT on the “Default Web Site”), go to “Request Filtering”.
  • Remove the extensions that are causing issues.