| | | main | | | alphatv | | | cstrike | | | computer | | | resume | | | misc | | | contact | | |
Technical Reference: NT IIS 5.0 and Win2K Hardening Configuration

IIS 5.0 and Windows 2000 Hardening Guide

 

Contents
Overview
Instructions
Table 1: Initial OS Config & Installation
Table 2: Media Configuration
Table 3: Encryption & Patches
Table 4: Services
Table 5: Terminal Service Configuration
Table 6: IIS 5.0 Configuration
Table 7: High Security Webserver App.
Table 8: User Acct & ACL Modification
Table 9: Firewall ACL
Table 10: SSHD for NT Remote Mgmt
Additional Resources
Revision History

Overview

This document is applicable ONLY to Windows 2000 running IIS 5.0. If any other application is running on the server to support its function (e.g., Cold Fusion), then that application must also be secured. The steps in this guide should be performed on new installations only to avoid unpredictable results. This hardening procedure should NOT be used on general-purpose NT servers on an internal LAN (e.g., file servers), as it removes several of the services that NT uses for default functionality.

Instructions

Follow these steps chronologically You may want to print them out and check them off as you do them. A couple of the steps have Best Practices behind them; these steps are optional and considered advisable. Only install and configure Terminal Services if you know you have a need for them. Furthermore, if you do install TS, do not install the clipboard hack unless you have no other more secure way of moving files onto the machine (such as SCP). The RDP protocol and TSs have not undergone thorough scrutiny yet, and if you do install you must ACL down to allow only a few IPs. I would not install TS at all unless behind a firewall. I have included the old SSHD for NT port we used with NT 4.0, however we are no longer using that port but are now installing ssh.com's commercial NT server. I highly recommend that any commercial install does the same. Various files are referenced throughout the document, or you can download them as a single zip file w2k_hardening_files.zip.

 

Table 1: Initial OS Configuration and Installation

Step
Action
1.

Boot up Windows 2000 CD-ROM, and begin installation and configuration.

The Welcome to Setup screen appears. Press Enter to continue.

Click F8 to accept End User License Agreement (EULA).

Note: Install only one instance of the operating system. If you need to get on to a server using another instance, install on need, and delete afterwards.

2.

Choose your partition to install OS onto, choose NTFS for format.

Reserve a separate minimum 4 GB partition for the OS.

3.

Choose regional settings as appropriate.

Type in name and organization.

Choose Per Seat License.

4.

Choose a name for the server and set an administrator password.

5.

Choose components:

  • Go to Details on Accessories and Utilities, uncheck Accessibility Wizard, Communications, Games and Mulitimedia
  • Uncheck Indexing Services
  • Go to Details on IIS Service, uncheck Documentation, Frontpage Server Extensions, and Internet Services Manager (HTML)
  • Go to Details on Management and Monitoring Tools, check Simple Network Management Protocol (SNMP)
  • Uncheck Script Debugger
  • Check Terminal Services
6.

Set Date, Time and Time Zone

7.

Select Remote Administration Mode for terminal services.

Choose Typical Network Settings.

8.

Workgroup or Computer Domain setup:

Choose No, This Computer Is Not On a Network, or Is On a Network Without a Domain.

Type in a random workgroup name (Alt 255 for a blank workgroup).

Note: The file copy starts (takes some time). Log back in after reboot.

9.
.

When the Windows Configure Your Server screen comes up:

Choose I Will Configure This Server Later.

Click Next, then uncheck Show This Screen at Startup. Close window.

.
 

Table 2: Media Configuration

Step
Action
10.

Go to Start > Programs > Administrative Tools > Computer Management > Disk Management.

Right click on CD-rom and choose Change Drive Letter, click Edit, choose Z for drive.

Right click on the unallocated space and choose Create Partition. The Create Partition Wizard appears. Click Next, choose Primary Partition, then allocate space as required.

Click Next, choose drive letter, choose NTFS format.

11.

Double click "My Computer" Icon. Right mouse click on your C drive.

Click on Security > Remove Everyone Group, and add Administrators and System Groups, giving both Full Control.

IMPORTANT!! Click Advanced > Check Reset Permissions on all Child Objects.

12.

Click Advanced > Auditing > Click Add > Administrator, click OK. Check the boxes for each of the following:

  • Create Files/Write Data
  • Create Folders/Append Data
  • Delete Subfolders and files
  • Delete
  • Change Permissions
  • Take Ownership

Click OK > Apply > OK. You will get a message saying that auditing is not turned on.

13.

Under the General tab, uncheck Allow Indexing Service To Index This Disk For Fast File Searching

Choose Apply Changes to c:\, subfolders and files.

14.
.
Repeat this procedure for all other hard drives.
.
 

Table 3: Encryption and Patch Setup

Step
Action
15.

Install the high encryption pack for Windows 2000:
    http://www.microsoft.com/WINDOWS2000/downloads/recommended/encryption/default.asp.

It will ask you to restart your computer: choose No.

NOTE: After installing the High Encryption Pack, it is necessary to run the KEYMIGRT.EXE utility to upgrade the encryption of the private keys used by IIS SSL from 40-bit RC4 to 168-bit 3DES (http://www.microsoft.com/technet/security/bulletin/ms00-032.asp). Strictly speaking, the upgraded key is the "Master Key" which encrypts IIS's private keys, as well as all the private keys of all the services which use public/private keys on the server.

16.

Right Mouse click on My Computer icon, choose Properties > Advanced > Performance Options.

Choose Change on Virtual Memory Settings.

Set the page file's Min/Max as Equal. Click OK.

You will now need to reboot.

17.

Install SP1 for Windows 2000:
    http://www.microsoft.com/windows2000/downloads/recommended/sp1/x86Lang.asp.

It will ask you to restart your computer, choose Yes.

18.
.

Install patches: currently SP1 and the Unicode patch:
    http://www.microsoft.com/technet/security/bulletin/MS00-078.asp.

For more up to date information refer to:
    http://ntbugtraq.ntadvice.com/default.asp?sid=1&pid=47&aid=65.

.
 

Table 4: Services

19.

Disable all network protocols except TCP, and set fixed IP for server:

Right click on My Network Places, right click on Local Area Connections > Properties > Uninstall File and Print Sharing.

Uncheck Client for Microsoft Networks.

Set Fixed IP Address(s) for the server.

20.
.

Go to Advanced Settings for TCP.

Click DNS, uncheck Register This Connection's Address in DNS.

.
21.

Choose Options > TCP/IP Filtering > Properties.

Check Enable TCP/IP Filtering (All Adapters).

Change Permit All to Permit Only Explicitly Needed Ports.

TCP Ports UDP Ports IP Protocols
80 HTTP 161 SNMP 6
443 SSL 162 SNMP 8
22 SSH      
3389 RDP      

 

 

 

 

Restart your computer when prompted.

22.

Disable NetBios over TCP/IP:

Right click on My Computer > Properties > Hardware > Device Manager.

Click on View > Show Hidden Devices.

Click on View > Devices by Connection.

Right click on NetBios over TCP/IP > Properties

Driver Tab > Type > Disabled.

Click OK.

 

23.

Ensure the following services are set to disable:

  • Alerter
  • DHCP Client
  • Distributed Link Tracking Client
  • Distributed Link Tracking Server
  • Distributed Transaction Coordinator
  • DNS Client
  • License Logging Service
  • Messenger
  • Print Spooler
  • Remote Registry Service
  • Removable Storage
  • Run as a Service
  • Simple Mail Transport Protocol (SMTP)
  • Task Scheduler
  • TCP/IP NetBios Helper Service
  • Telephony
  • Workstation

Set the following manual services to disable:

  • Computer Browser
  • Fax Service
  • File Replication
  • Indexing Service
  • Internet Connection Sharing
  • Netmeeting Remote Desktop
  • QoS RSVP
  • Remote Access Auto Connection Manager
  • Remote Access Connection Manager
  • Smart Card
  • Smart Card Helper
  • Telnet
  • Uninterruptible Power Supply
  • Network DDE
  • Network DDE DSDM
  • Windows Time
24.
.

IPSec Policy:

Setup IPSec policy to deny all and only allow necessary ports. For example:

Use ipsecpol.exe, and make certain these two dll's are in your path: ipsecutil.dll and text2pol.dll. From command prompt, enter following lines:

ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "BlockAll" -n BLOCK -f 0=*::*
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowICMP" -n PASS -f 0::=*:*:ICMP

ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowSMTP-in" -n PASS -f 0:25=*::TCP
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowSMTP-out" -n PASS -f 0:=*:25:TCP

ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowDNS-in" -n PASS -f 0:53+*::UDP
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowDNS-out" -n PASS -f 0:=*:53:UDP

ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowHTTP-in" -n PASS -f 0:80+*::TCP
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowHTTPS-in" -n PASS -f 0:443+*::TCP

ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowPOP3" -n PASS -f 0:110+*::TCP
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowRDP-in" -n PASS -f 0:3389+*::TCP
ipsecpol -x -w REG -p "CISCO_WWWSRV" -r "AllowSSH-in" -n PASS -f 0:22+*::TCP

.
 

Table 5: Terminal Service Configuration

Step
Action
24.

Configure Terminal Service:

Go to Start > Programs > Administrative Tools > Terminal Services Configuration (TSC).

Right mouse click on RDP-TCP, choose Properties > General > Encryption Level: High.

25.

Under Client Setting:

Uncheck Use Connection Settings From User Settings.

Uncheck Connect Client Printers at Logon and Default to Main Client Printer.

Under Disable:

Check all except Clipboard Mapping.

26.

Under Sessions:

Check Override User Settings, then choose

End a Disconnected Session
3 hours Active Session Limit: 1 Day Idle Session Limit: 30 minutes

 

Check the second Override User Settings, and choose Disconnect From Session.

27.

Under Network Adaptor, choose maximum 5 connections.

28.

Under Server Settings for TSC, change Active Desktop to Disable.

29.
.

If needed, do the below edits to the server to enable clipboard file transfer:

1. Open Regedt32, and then change the value data in the Name value from RDPCLIP to FXRDPCLP in the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\AddIns\Clip Redirector

2. Change the value data in the Startup Programs value from RDPCLIP to FXRDPCLP in the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd

3. Rename the new rdpclip.exe file included in the Windows 2000 Resource Kit to Fxrdpclp.exe, and then copy the file to the Winnt\System32 folder.

4. Copy the fxfr.dll file to the Winnt\System32 folder.

To the Clients that wish to use the enhanced clipboard facilities:

5. Copy the 32-bit Fxfr.dll file to the "Program Files\Terminal Services Client" folder.

6. Rename the Rdpdr.dll file in the "Program Files\Terminal Services Client" folder to Rdpdr.pss.

7. Copy the 32-bit rdpdr.dll file from the resource kit to the "Program Files\Terminal Services Client" folder.

.
 

Table 6: IIS 5.0 Configuration

Step
Action
30.

Go into ISM and Stop the Default Website.

31.

Right mouse click on the computer name in ISM:

Choose Properties > Edit The Master Properties For The WWW Service.

Choose Website > Enable Logging > W3C Extended Log File Format > Properties.

Change the New Log Time Period to When The File Reaches 50 MB; click OK.

Click Properties > Extended Properties > and add checks for Cookies and Referrer.

32.

Choose Home Directory > Configuration:

Remove any unnecessary Application Mappings, as below.

NOTE: Remove them all and add back in as needed!

Extension Filetype
.asa Asp files to declare objects with session or application scope
.asp Active server pages
.bat Batch files
.cdx Scripts to create Channel Definition files
.cer Scripts for digital certs
.htr Scripts for remote password change
.htw Index server hit highlighting
.ida Index server performance monitoring
.idc Internet Dbase connection
.idq Index server query definition
.printer Internet Printing
.shtm , .shtml, .stm Server Side Includes

33.

At a minimum, remove the .HTR, .IDC and .PRINTER.

Click OK to get out of edit mode.

34.

Create your new website base directory:

While still in ISM, highlight your computer name, right mouse click, then choose New, Web Site.

This will start the new Web Site Wizard. Click Next.

35. Choose a drive that is NOT your system partition for the path to your home directory.
36.

Choose the minimum set of permissions here for your web site.

Click Next to finish.

37.

Disable Parent paths.

Go to Properties on the Web Site > Home Directory > Configuration > App Options.

Uncheck Enable Parent Paths.

38.

Microsoft recommends configuring a separate directory for each file type so you can easily set ACLs. Best Practice:

This is a good idea if you have the ability to do so. For example, setup your web site:

  • D:\test_website\static (.html)
  • D:\test_website \include (.inc)
  • D:\test_website \script (.asp)
  • D:\test_website \executable (.dll)
  • D:\test_website \images (.gif, .jpeg)
39.

Change the Application Protection to Low (IIS Process):

Go to Web Site Properties > Home Directory tab > Application Protection.

This will stop IIS from using the IWAM_Machiname Account.

40.

Disable the default web site. (It is better to leave the default web site disabled rather than remove it, as it may come in handy down the line.)

Right mouse click on the Default Web Site. Select Properties > Directory > Security > Anonymous Access & Authentication Control > Edit.

Uncheck all the boxes. You will get a warning that you are shutting off all access, click Yes.

It will bring up a box on Inheritance. Click Select All > OK.

Note: Do not use the default web site and disable/delete the administrative one.

41.

Remove all IIS Sample directories:

    IIS %webroot%\iissamples

    IIS SDK %webroot%\iissamples\sdk

    Admin Scripts %webroot%\AdminScripts

    Data access c:\Program Files\Common Files\System\msadc\Samples

    IIS HELP %systemroot%\help\iishelp

    IIS adpwd %systemroot%\system32\inetsrv\iisadmpwd

42.
.

Remove Internet Printing:

Delete the printer's virtual directory at %systemroot%\web\printers

.
 

Table 7: High Security Webserver Template Application

Step
Action
43.

Download and install the MS High Security Web Template hisecweb-cisco.inf :

Copy the hisecweb-cisco.inf to the %windir%\security\templates directory. The one linked here is a slightly modified version of the one found at http://download.microsoft.com/download/win2000srv/SCM/1.0/NT5/EN-US/hisecweb.exe.

44.

Open MMC. Choose Console > Add/Remove Snap-In:

Add the Security Configuration and Analysis tool and the Security Templates.

45.

Right click the Security Configuration and Analysis:

Choose Open Database and give a name to the database.

Click Open, then load the hisecweb-cisco.inf template.

46.

Right-click the Security Configuration and Analysis tool:

Choose Analyze Computer Now. You can browse through the changes the template will make.

47.

Right-click the Security Configuration and Analysis tool:

Choose Configure Computer Now from the context menu.

48.
.
This will make the following changes.
.
 

Table 8: User Account and ACL Modification

Step
Action
49.

Under Local Users and Groups, rename Internet Guest Account to an obscure name.

Create a strong password.

Ensure Guest Account is disabled.

Remove the renamed Internet Guest Account from the Guest Group.

50.

Rename Administrator Account. Change password to a strong password.

Note: You will need to start the Workstation Service to set passwords. Stop and disable service afterwords.

51.

Disable the IWAM_Machiname Account.

52.

Under Admnistrator Tools > Local Policies > User Rights Assignment > Adjust These Rights:

Remove Access This Computer From The Network for ALL users except Administrators.

Add the renamed IUSR account to the Logon Locally Group.

Remove all accounts from the Log On As A Batch Job.

53.

Set File Permissions:

Set permissions for the renamed Internet Guest Account on all volumes to "No Access".

Right mouse click on Properties > Volume > Security > ADD > Choose Renamed IUSR account. Check all Denies, say OK to Caution pop-up.

IMPORTANT!! Click Advanced > Check Reset Permissions on all Child Objects.
54.

Change the renamed IUSR account permission to Read Only for a few directories:

Right mouse click on Directory, go to Properties > Security > Advanced:

Default Path Environment Variable
c:\winnt %SystemRoot%
d:\ InetPub\wwwroot wherever your IIS root is

Uncheck Allow Inheritable Permissions From Parent Object to Propagate to This Object.

The following screen will appear:

Choose Copy.

You can now edit the permissions: Highlight the Internet Guest Account Deny All line and choose Clear All, then check Allow:

  • Traverse Folder/Execute Data
  • List Folder/Read Data
  • Read Attributes
  • Read Permissions

55.
.

Go into ISM and right mouse click on the WWW server you created:

Choose Properties > Directory Security > Anonymous Access and Authentication Control > Edit > Edit For Anonymous Access.

Change Username to the Renamed IUSR_MACHINE. Uncheck Allow IIS to Control Password. Synch the STRONG password you set earlier.


.
 

Table 9: Firewall ACL

This hardening alone is not enough to ensure security. The box must be placed behind a firewall or router.

Step
Action
56.
.

Example ACL for router to permit only HTTP, SSH, SSL, and SNMP:

access-list 150 permit tcp any host yourwebserver eq 80

access-list 150 permit tcp any host yourwebserver eq 443

access-list 150 permit tcp SSH Client networks yourwebserver eq 22

access-list 150 permit udp SNMP Server networks host yourwebserver eq 161

access-list 150 permit udp SNMP Server networks host yourwebserver eq 161

access-list 150 permit udp SNMP Server networks host yourwebserver eq 162

access-list 150 permit udp SNMP Server network host yourwebserver eq 162

access-list 150 permit tcp RDP client networks yourwebserver eq 3389

.
Back to top
 

Table 10: SSHD for NT Remote Management

OK. Now you need to be able to access this machine remotely. Here are the current ports of SSHD for NT Cisco is using.

NOTE: There are issues with the cygwin.dll and separating simultaneous user space. Use with caution!

Step Action
57. Download and unzip sshdnt.zip. Use these files to complete the steps below.
58.

Run install.bat

This batch file should do the following:

  1. Create a server key
  2. Install SSHD as a service
  3. Start the sshd service

Note: Check to make sure SSHD is installed as a service and running. If it is not, refer to sshd_install.txt for instructions on how to create a server key and install SSHD as a service.

59. Edit the passwd file (in c:\etc) to add additional users in this format:

<Username>:x:<User ID>:<Group ID>:<Full Name>:<home directory>:

Example:

  • administrator:x:1:10:Local administrator:/bin:
60.
.

Using SCP:

SCP use on NT DMZ host:

  1. Move file you need to Unix box running sshd (e.g., host.com)
  2. Use srt or terra to connect to NT host running sshd
  3. Type scp.exe <username>@<hostname with file>: <filename><path to place file>

Examples:

  • To move the file "net.txt" from a Unix host (e.g., host.com) to the directory /bin on an NT host running sshd (with IP address 10.0.0.20) do the following:
    1. Login to host.com
    2. scp net.txt administrator@10.0.0.20:/bin
  • To pull test.exe from an NT host running sshd (with IP address 10.0.0.20) to my user directory on host.com do the following:
    1. Login to host.com
    2. scp administrator@10.0.0.20:test.exe /home/user
.
 

Additional Resources

 

Note: For information/questions, please contact:
Eric Hampshire, ehampshire@ehampshire.com,
Cisco Systems Corporate Information Security

.