Share via


Troubleshooting Windows Firewall in Microsoft Windows XP Service Pack 2

Abstract

The Windows Firewall feature of Microsoft® Windows® XP Service Pack 2 (SP2), a replacement for the Internet Connection Firewall (ICF) in previous versions of Windows XP, is a stateful host firewall that provides protection for computers against incoming traffic from the Internet or from neighboring network devices on a private network. This article describes how Windows Firewall works, the common problems with using Windows Firewall, and the set of tools used to troubleshoot Windows Firewall issues. This article is intended for network administrators and advanced users who are familiar with Windows XP and Transmission Control Protocol/Internet Protocol (TCP/IP).

Bb457029.3squares(en-us,TechNet.10).gif

On This Page

Windows Firewall Overview
Common Problems with Windows Firewall
General Methodology for Determining and Configuring Exceptions
Windows Firewall Troubleshooting Tools
Summary
Related Links

Windows Firewall Overview

A firewall is a protective boundary between a computer or network and the outside world. Windows Firewall is a stateful host firewall in Windows XP Service Pack 2 (SP2) that drops unsolicited incoming traffic that does not correspond to either traffic sent in response to a request of the computer (solicited traffic) or unsolicited traffic that has been specified as allowed (excepted traffic). This behavior of Windows Firewall provides a level of protection from malicious users and programs that use unsolicited traffic to attack computers. With the exception of some Internet Control Message Protocol (ICMP) messages, Windows Firewall does not drop outgoing traffic.

Unlike the Internet Connection Firewall (ICF) provided in Windows XP with Service Pack 1 (SP1) or Windows XP with no service packs installed, Windows Firewall is designed for use on all network connections, including those that are accessible from the Internet, those connected to small office/home office networks, and those connected to private organization networks.

For many enterprise networks using Windows XP with SP1 or Windows XP with no service packs installed, ICF is disabled on all connections connected to the enterprise network because computers on enterprise networks are not directly reachable from the Internet. The enterprise network firewall, proxy, and other security systems provide some level of protection from the Internet to intranet network computers. However, the absence of host firewalls such as Windows Firewall on intranet connections leaves computers vulnerable to malicious programs brought onto the intranet by mobile computers.

For example, an employee connects an organization laptop to a home network that does not have adequate protections. Because the organization laptop does not have a host firewall enabled on its network connection, it gets infected with a malicious program (such as a virus or worm) that uses unsolicited traffic to spread to other computers. The employee then brings his or her laptop back to the office and connects it to the organization intranet, effectively bypassing the security systems that are at the edge of the intranet. Once connected to the intranet, the malicious program begins to infect other computers. If Windows Firewall was enabled by default, the laptop computer might not get infected with the malicious program when connected to their home network. Even if it did get infected, when it connected to the intranet, the local intranet computers might not become infected because they also have Windows Firewall enabled.

If the computers running Windows XP with SP2 are running client-based programs, then enabling Windows Firewall does not impair communications. Web access, email, Group Policy, and management agents that request updates from a management server are examples of client-based programs. For client-based programs, the client computer always initiates the communication and all response traffic from a server is allowed past the firewall because it is solicited incoming traffic.

In Windows XP with SP1 or Windows XP with no service packs installed, ICF is disabled by default for all connections, unless enabled for an Internet connection by the Network Setup Wizard or Internet Connection Wizard. You can manually enable ICF through a single checkbox on the Advanced tab of the properties of a connection, from which you can also configure the set of excepted traffic by specifying Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) ports.

In Windows XP with SP2, Windows Firewall is enabled by default on all network connections and can be configured with exceptions from the Windows Firewall component in Control Panel, which you can run from the new Windows Security Center. For more information, see Manually Configuring Windows Firewall in Windows XP Service Pack 2.

When Windows Firewall has been enabled on a network connection, the corresponding icon in the Network Connections folder appears with a lock and the connection's details display a status of Enabled, Firewalled when it is selected. The following figure shows an example in which Windows Firewall is enabled on all the connections of the computer.

wftsht01.gif
See full-sized image

How Windows Firewall Works

Windows Firewall is a stateful, host-based firewall for incoming traffic. Unlike router-based firewalls deployed at the boundary of a private network and the Internet, Windows Firewall is only designed to act as a firewall for host-based traffic—traffic destined to an IP address on which the computer is listening—rather than for traffic that is destined for another computer.

The basic operation of Windows Firewall is the following:

  • An incoming packet is inspected and compared against a list of allowed traffic. If the packet matches an entry in the list, Windows Firewall passes the packet to the TCP/IP protocol for further processing. If the packet does not match an entry in the list, Windows Firewall silently discards the packet and, if enabled, creates an entry in the Windows Firewall logging file.

Traffic in the exceptions list is specified using IP addresses, TCP ports, and UDP ports. There is no way to specify traffic based on the IP Protocol field in the IP header.

The list of allowed traffic is populated in two ways:

  • When the connection on which Windows Firewall is enabled sends a packet, Windows Firewall creates an entry in the list so that the response to the traffic will be allowed. The response traffic is incoming solicited traffic.

    For example, if a Domain Name System (DNS) Name Query Request message is sent to a DNS server, Windows Firewall adds an entry so that the corresponding DNS Name Query Response message sent by the DNS server can be passed to the TCP/IP protocol for further processing. This behavior makes the Windows Firewall a stateful firewall: state about the traffic initiated by the computer is maintained so the corresponding incoming response traffic will be allowed.

  • When you configure Windows Firewall for exceptions, the excepted traffic is added to the list. This capability allows a computer using Windows Firewall to accept unsolicited incoming traffic when acting as a server, a listener, or a peer.

    For example, if your computer is acting as a Web server, you must configure Windows Firewall to except Web traffic so that the computer can respond to requests from Web clients. You can configure exceptions based on programs, in which case the ports opened by the excepted program are automatically added to the exceptions list, or on TCP or UDP ports, in which case the ports are opened whether the application or services using them is active or not.

Common Problems with Windows Firewall

The following are the most common problems encountered when using Windows Firewall:

  • I cannot configure Windows Firewall

  • Nobody can ping my computer

  • Internet users cannot access my game, Web, or other server

  • Local file and printer shares cannot be accessed

  • I cannot see the computers on my network in My Network Places

  • Remote Assistance is not working

I Cannot Configure Windows Firewall

If all the settings on the General, Exceptions, and Advanced tabs for the properties of the Windows Firewall that are not available (appear grayed out), then you are not logged on to the computer with a user account that is a member of the local Administrators group, referred to throughout this article as local administrators. Only local administrators can configure Windows Firewall settings.

If there are settings on the General, Exceptions, and Advanced tabs for the properties of the Windows Firewall that are not available, then your computer is either:

  • Part of a managed network and the network administrator has used Windows Firewall Group Policy settings to enable and configure Windows Firewall behavior. Windows Firewall Group Policy settings also apply to local administrators. In this case, you would see a "For your security, some settings are controlled by Group Policy" message at the top of the Windows Firewall component in Control Panel.

    Contact your network administrator for more information.

  • Running Windows XP Professional and is not a part of a managed network, but local Group Policy settings have been set to configure Windows Firewall behavior.

    To clear local Group Policy settings for the Windows Firewall, use the Local Computer Policy snap-in and set all the settings in Computer Configuration\Administrative Templates\Network\Network Connections\Windows Firewall and in the Domain Profile and Standard Profile folders to Not Configured.

Nobody Can Ping My Computer

A common step in troubleshooting connectivity problems is to use the Ping tool to ping the IP address of the computer to which you are trying to connect. When you ping, you send an ICMP Echo message (also known as an ICMP Echo Request message) and get an ICMP Echo Reply message in response. By default, Windows Firewall does not allow incoming ICMP Echo messages and therefore the computer cannot send an ICMP Echo Reply in response. To configure Windows Firewall locally to allow the incoming ICMP Echo message, you must enable the Allow incoming echo request setting in the ICMP dialog box, available from the ICMP settings on the Advanced tab of the Windows Firewall component of Control Panel. The following figure shows an example.

wftsht02.gif

You can also enable incoming ICMP Echo messages for a specific connection from the ICMP tab of the Advanced Network Settings for a selected connection, available from the Advanced tab of the Windows Firewall component of Control Panel.

If your computer is part of a managed network, then you can also configure ICMP exceptions as part of Windows Firewall Group Policy settings. For more information, see Deploying Windows Firewall Settings for Microsoft Windows XP with Service Pack 2.

Note  Only local administrators can change Windows Firewall settings, unless overridden or prohibited by Windows Firewall Group Policy settings.

Enabling incoming ICMP Echo messages will allow others to ping your computer. However, it also leaves your computer vulnerable to the types of attacks that use ICMP Echo messages. Therefore, it is recommended that you enable the Allow incoming echo request setting temporarily, and then disable it when it is no longer needed.

Internet Users Cannot Access My Game, Web, or Other Server

If your application or service listens for unsolicited incoming traffic—for example, it is a server, a listener, or a peer—then the default configuration of Windows Firewall is to drop the unsolicited incoming traffic for your application or service unless there is an exception that is configured and enabled. Exceptions for applications that listen for traffic on your computer are configured in the following ways:

  • By enabling one of the built-in exceptions from the Exceptions tab of the Windows Firewall component of Control Panel. Built-in exceptions include File and Printer Sharing, Remote Assistance, Remote Desktop, and UPnP Framework.

  • By manually configuring an exception from the Exceptions tab of the Windows Firewall component of Control Panel.

  • When the application is run, it uses Windows Firewall application programming interface (API) function calls to request that exceptions be created. If a local administrator runs the application, the exceptions are configured and enabled.

  • When an application that does not use the Windows Firewall API runs and attempts to listen on TCP or UDP ports, Windows Firewall prompts a local administrator with a Windows Security Alert dialog box, from which they can specify to add to the list of exceptions on the Exceptions tab of the Windows Firewall component of Control Panel but block the traffic for all users (the Keep Blocking option), to add to the exceptions list and allow the traffic for all users (the Unblock option), or to block the traffic for now and prompt again the next time the application is run (the Ask Me Later option).

    To determine the path of the application from the Windows Security Alert dialog box, place the mouse pointer over the name or description of the application. The displayed tool tip text indicates the path to the application.

    If the user is not a local administrator, the Windows Security Alert dialog box informs that the traffic is being blocked, and to contact their network administrator for more information.

    Services do not prompt the user with a Windows Security Alert dialog box. Therefore, you should manually configure exceptions for them.

  • By manually configuring exceptions with commands in the netsh firewall context.

  • By configuring exceptions through Windows Firewall Group Policy settings.

Manually configured exceptions can either be based on program names, in which all of the ports needed by the application or service are automatically opened and closed by Windows Firewall as needed, or based on TCP and UDP ports, in which the specified ports are opened, regardless of whether the program using the ports is running or not. The recommended method for security and ease of configuration is to configure program-based exceptions, rather than port-based exceptions.

To manually configure a program-based exception, do the following:

  1. From the Windows XP desktop, click Start, click Control Panel, click Security Center, and then click Windows Firewall.

  2. Click the Exceptions tab.

  3. Click Add Program and specify the program (the application or service) from the list or using the Browse button and, if needed, its scope. For information about specifying the scope, see Manually Configuring Windows Firewall in Windows XP Service Pack 2.

  4. Click OK to save changes to the exception.

To manually configure a port-based exception, do the following:

  1. From the Windows XP desktop, click Start, click Control Panel, click Security Center, and then click Windows Firewall.

  2. Click the Exceptions tab.

  3. Click Add Port and specify the TCP or UDP port name and number and, if needed, its scope.

  4. Click OK to save changes to the exception.

Note  You cannot configure an exception based on an IP protocol.

To determine the set of TCP or UDP ports to configure as exceptions, see the program's user guide or Web site for information about how to configure firewalls to allow the program's traffic. If you cannot determine the traffic for your program or the program still does not work after configuring the exception, see the "General Methodology for Determining and Configuring Exceptions" section in this article.

TCP and UDP-based exceptions only work for programs that use static ports. With static ports, the program uses a specific set of ports and those ports do not change. However, some programs use dynamic ports, which change each time the program runs or while it is running. A program that needs to listen on dynamic ports must be configured as a Windows Firewall program-based exception, rather than a TCP or UDP-based exception.

My Local File and Printer Shares Cannot Be Accessed

If you cannot access file or printer shares on a computer that has Windows Firewall enabled, you must enable the pre-defined File and Printer Sharing exception on the Exceptions tab of the Windows Firewall component of Control Panel.

Note  Enabling the File and Printer Sharing exception for computers that are directly connected to the Internet (for managed computers, in the Standard profile) is highly discouraged because malicious users can attempt to obtain access to file shares and compromise your personal files. For single-subnet small office/home office (SOHO) networks, only enable the File and Printer Sharing exception on connections that are directly connected to the SOHO subnet and for the local subnet scope (the My network (subnet) only option in the Change Scope dialog box).

I Cannot Remotely Administer a Computer with Windows Firewall Enabled

If you cannot remotely administer a computer that has Windows Firewall enabled, you must enable the pre-defined Remote Assistance exception on the Exceptions tab of the Windows Firewall component of Control Panel.

Note  Enabling the Remote Assistance exception for computers that are directly connected to the Internet (for managed computers, in the Standard profile) is highly discouraged because malicious users can attempt to remotely control your computer. For single-subnet small office/home office (SOHO) networks, only enable the Remote Assistance exception on connections that are directly connected to the SOHO subnet and for the local subnet scope (the My network (subnet) only option in the Change Scope dialog box).

I Cannot See the Computers on My Network in My Network Places

This problem is similar to the problem with file and print sharing. If you cannot see the computers on your private network in My Network Places after enabling Windows Firewall, you must enable the pre-defined File and Printer Sharing exception on the Exceptions tab for the properties of the Windows Firewall.

Note  Enabling the File and Printer Sharing exception for computers that are directly connected to the Internet is highly discouraged because malicious users can attempt to obtain access to file shares and compromise your personal files. For single-subnet small office/home office (SOHO) networks, only enable the File and Printer Sharing exception on connections that are directly connected to the SOHO subnet and for the local subnet scope (the My network (subnet) only option in the Change Scope dialog box).

Remote Assistance is Not Working

For information about configuring Windows Firewall for Remote Assistance, see Appendix D of Deploying Windows Firewall Settings for Microsoft Windows XP with Service Pack 2.

How To Determine Whether Windows Firewall is Configured with Group Policy Settings

On a managed network, Windows Firewall is configured by the combination of local settings stored in the registry and Group Policy settings. In this case, it is sometimes helpful when troubleshooting to be able to determine if Windows Firewall is using only local settings or whether it is using Group Policy settings, and if so, which Windows Firewall profile is being used (the Standard profile or the Domain profile). Windows XP with SP2 relies on network determination to determine which set of profile settings to apply. For more information, see Network Determination Behavior for Network-Related Group Policy Settings.

To make this determination, type the netsh firewall show state verbose=enable command at a command prompt. Here is an example of the first section of the display:

Firewall status:
-------------------------------------------------------------------
Profile                           = Standard
Operational mode                  = Enable
Exception mode                    = Enable
Multicast/broadcast response mode = Enable
Notification mode                 = Enable
Group policy version              = None
Remote admin mode                 = Disable
        Scope: *

From the "Firewall status" section, look at the items for "Profile" and for "Group policy version". The following table lists the various values for these items and what they mean.

Value of "Profile" item

Value of "Group Policy version" item

Description

Standard

None

No Windows Firewall Group Policy settings exist. Computer is only using local Windows Firewall settings.

Standard

Windows Firewall

The computer is using Windows Firewall Group Policy settings.

Domain

None

The computer is connected to a network containing your domain, however no Windows Firewall Group Policy settings exist.

Domain

Legacy Firewall (ICF)

The Prohibit use of Internet Connection Firewall on your DNS domain network Group Policy setting has been set to Enabled and Windows Firewall Group Policy settings do not exist.

Domain

Windows Firewall

The computer is connected to a network containing your domain and is using Windows Firewall Group Policy settings.

Note  The Prohibit use of Internet Connection Firewall on your DNS domain network Group Policy setting can disable the Windows Firewall (the "Operational Mode" item in the netsh command display is set to "Disable") if you do not also set the Windows Firewall: Protect All Network Connections Group Policy setting to Enabled.

To determine whether program or port-based exceptions were obtained from local settings or from Group Policy, examine the "Program exceptions" and "Port exceptions" sections of the netsh firewall show state verbose=enable command display. These sections are tables containing the list of exceptions. For each table, there is a "Local policy" column. If the entry in the "Local policy" column for an exception is set to "Yes", the exception was configured through local policy settings. If it is set to "No", the exception was configured through Group Policy settings.

Here is an example of a portion of the "Port exceptions" section of the netsh firewall show state verbose=enable command display:

Note: Some of the lines in the following code have been displayed on multiple lines for better readability.

Port exceptions:
Port   Protocol  Local policy  Mode     Name / Service type
-------------------------------------------------------------------
137    UDP       Yes           Enable   NetBIOS Name Service / 
File and Printer Sharing
        Scope: LocalSubNet
138    UDP       Yes           Enable   NetBIOS Datagram Service / 
File and Printer Sharing
        Scope: LocalSubNet
139    TCP       Yes           Enable   NetBIOS Session Service / 
File and Printer Sharing
        Scope: LocalSubNet
445    TCP       Yes           Enable   SMB over TCP / 
File and Printer Sharing
        Scope: LocalSubNet
3389   TCP       No            Enable   Remote Desktop / 
Remote Desktop
        Scope: *

In this example, all the port exceptions except for Remote Desktop were configured through local policy settings.

For a definitive list of Windows Firewall settings that are configured by Group Policy, use the Resultant Set of Policy (RSOP) snap-in. For more information, see Windows XP Help and Support.

General Methodology for Determining and Configuring Exceptions

When an application or service does not work because the Windows Firewall is blocking unsolicited incoming traffic, the solution is not to disable Windows Firewall, but to configure Windows Firewall exceptions so that the blocked traffic is allowed. Disabling Windows Firewall leaves your computer vulnerable to malicious users and programs and is not recommended, unless you are using a third party firewall product.

As described in the "Internet Users Cannot Access My Game, Web, or Other Server" section of this article, applications that listen on ports cause Windows Firewall to prompt the user with a notification. Depending on the selection in the Windows Security Alert dialog box, the application is added to the exceptions list on the Exceptions tab but the traffic is blocked (the Keep Blocking option), added to the exceptions list and allowed (the Unblock option), or not added to the list and blocked (the Ask Me Later option). If you select Keep Blocking, you must enable the application from the Exceptions tab of the Windows Firewall component of Control Panel. Applications can also configure exceptions using the Windows Firewall APIs and you can also manually configure exceptions.

Windows services, unlike applications, do not use the notification feature of Windows Firewall to attempt to automatically configure and enable an exception. Exceptions for Windows services must either be configured by the service using the Windows Firewall APIs or through manually configured program- or port-based exceptions. If the service runs from an executable file (such as an *.exe file), then you can configure a program-based exception. If the service is hosted by another service, such as Svchost.exe, then you must configure port-based exceptions.

If a service needs to be configured for port-based exceptions or ICMP messages, to determine the TCP ports, UDP ports, or ICMP messages that are used by a Windows service, check the documentation for the service or its Web site. Based on the documentation, configure the appropriate port and ICMP message exceptions. If there is no documentation about the TCP ports, UDP ports, or ICMP messages that the service uses, use the following methodology:

  1. From the Advanced tab of the Windows Firewall component of Control Panel, click Settings in the Security Logging section and enable the Log dropped packets option. Click OK to save logging settings and then click OK to close the Windows Firewall component of Control Panel.

  2. From another client computer, note the computer's IP address and attempt to communicate using the client or peer application to the computer on which the Windows Firewall is running with logging enabled. For example, if the server computer is running an email server, then run the appropriate email client program on the client computer.

  3. After the client program on the client computer has failed, go to the server computer and use Windows Explorer to view the contents of the Pfirewall.log file that is stored in your main Windows installation folder.

  4. From the most recent entries on the Pfirewall.log file, look for entries for packets that were dropped with an IP address that matches the IP address of the client computer. From these matching entries, look at the "dst-port" portion of the entry. These are the TCP or UDP ports that need to be configured as port-based exceptions. For ICMP traffic, look at the "icmptype" and "icmpcode" portions of the entry and check the ICMP Parameters Web page for the name of the ICMP message.

Another way to determine the port numbers used by a service is to use audit logging with the following procedure:

  1. Enable audit logging as described in the "Windows Firewall Troubleshooting Tools" section of this article.

  2. Restart your computer. Many services are set for automatic startup. By restarting, you ensure that you can audit your service startup process.

  3. Use the Services snap-in, as described in the "Windows Firewall Troubleshooting Tools" section of this article, to ensure that your service has started.

  4. Use the Event Viewer snap-in, as described in the "Windows Firewall Troubleshooting Tools" section of this article, to look for Failure Audit events in the security event log with an event ID of 861. These events are for applications or services that listen on TCP or UDP ports, but whose traffic was not allowed by Windows Firewall. The text of the error message contains the file path and name of the requestor, the process identifier, whether the requestor is a program or service, and the TCP or UDP port number.

If you can identify the program or service from the information in the Failure Audit event, then use the TCP or UDP port in the event text and configure a port-based exception. Do this for all the ports needed by the program or service.

In some cases, services are run as part of a larger process that hosts multiple services, such as the process named Svchost.exe. In this case, you must use the netstat –abn command to list all of the ports that are being listened to. From the list of components (listed by file name), you can determine the port on which a specific service is listening.

The following is an example of using the netstat –abn command:

F:\>netstat -abn
 
Active Connections
 
  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       892
  f:\xp_pro\system32\WS2_32.dll
  F:\XP_PRO\system32\RPCRT4.dll
  f:\xp_pro\system32\rpcss.dll
  F:\XP_PRO\system32\svchost.exe
  -- unknown component(s) --
  [svchost.exe]
 
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  [System]
 
  TCP    127.0.0.1:1029         0.0.0.0:0              LISTENING       1888
  [alg.exe]
 
  TCP    131.107.81.167:139     0.0.0.0:0              LISTENING       4
  [System]
 
  UDP    0.0.0.0:500            *:*                                    688
  [lsass.exe]
 
  UDP    0.0.0.0:445            *:*                                    4
  [System]
 
  UDP    0.0.0.0:4500           *:*                                    688
  [lsass.exe]
 
  UDP    127.0.0.1:1900         *:*                                    1144
  f:\xp_pro\system32\WS2_32.dll
  f:\xp_pro\system32\ssdpsrv.dll
  F:\XP_PRO\system32\ADVAPI32.dll
  F:\XP_PRO\system32\kernel32.dll
  [svchost.exe]
 
  UDP    127.0.0.1:1025         *:*                                    980
  f:\xp_pro\system32\WS2_32.dll
  F:\XP_PRO\system32\WLDAP32.dll
  F:\XP_PRO\System32\winrnr.dll
  f:\xp_pro\system32\WS2_32.dll
  f:\xp_pro\system32\w32time.dll
  [svchost.exe]
 
  UDP    131.107.81.167:137     *:*                                    4
  [System]
 
  UDP    131.107.81.167:1900    *:*                                    1144
  f:\xp_pro\system32\WS2_32.dll
  f:\xp_pro\system32\ssdpsrv.dll
  F:\XP_PRO\system32\ADVAPI32.dll
  F:\XP_PRO\system32\kernel32.dll
  [svchost.exe]
 
  UDP    131.107.81.167:138     *:*                                    4
  [System]

Windows Firewall Troubleshooting Tools

Windows XP with SP2 provides the following tools for troubleshooting Windows Firewall issues:

  • Netsh firewall show commands

  • Audit logging

  • Windows Firewall logging file

  • The Services snap-in

  • The Event Viewer snap-in

  • The Netstat tool

Netsh Firewall Show Commands

To obtain information when troubleshooting Windows Firewall, use the following netsh commands:

  • netsh firewall show state verbose=enable

    This command displays the actual state of Windows Firewall for the current set of settings, as configured by the combination of local Windows Firewall settings and Group Policy-based Windows Firewall settings, and the current set of open ports.

  • netsh firewall show config verbose=enable

    This command displays only the local Windows Firewall settings as configured by local settings. Note that unlike the netsh firewall show state verbose=enable command, this command only shows what is configured locally, rather than the current state of the Windows Firewall. You can use this command when you want to compare what is configured locally to the actual state of Windows Firewall, to determine the changes in Windows Firewall settings due to Group Policy.

The following is an example of the netsh firewall show state verbose=enable command:

Note: Some of the lines in the following code have been displayed on multiple lines for better readability.

Firewall status:
-------------------------------------------------------------------
Profile                           = Standard
Operational mode                  = Enable
Exception mode                    = Enable
Multicast/broadcast response mode = Enable
Notification mode                 = Enable
Group policy version              = None
Remote admin mode                 = Disable
        Scope: *
 
Local exceptions allowed by group policy:
-------------------------------------------------------------------
Open ports       = Enable
Allowed programs = Enable
 
Log settings:
-------------------------------------------------------------------
File location   = F:\XP_PRO\pfirewall.log
Max file size   = 4096 KB
Dropped packets = Disable
Connections     = Disable
 
Service settings:
Mode     Customized  Name
-------------------------------------------------------------------
Enable   No          File and Printer Sharing
        Scope: LocalSubNet
Disable  No          UPnP Framework
        Scope: *
Disable  No          Remote Desktop
        Scope: *
 
Program exceptions:
Mode     Local policy  Name / Program
-------------------------------------------------------------------
Enable   Yes           Remote Assistance / F:\XP_PRO\system32\
sessmgr.exe
        Scope: *
 
Port exceptions:
Port   Protocol  Local policy  Mode     Name / Service type
-------------------------------------------------------------------
137    UDP       Yes           Enable   NetBIOS Name Service /
File and Printer Sharing
        Scope: LocalSubNet
138    UDP       Yes           Enable   NetBIOS Datagram Service /
File and Printer Sharing
        Scope: LocalSubNet
139    TCP       Yes           Enable   NetBIOS Session Service /
File and Printer Sharing
        Scope: LocalSubNet
445    TCP       Yes           Enable   SMB over TCP / 
File and Printer Sharing
        Scope: LocalSubNet
1900   UDP       Yes           Disable  SSDP Component of UPnP 
Framework / UPnP Framework
        Scope: LocalSubNet
2869   TCP       Yes           Disable  UPnP Framework over TCP / 
UPnP Framework
 
        Scope: LocalSubNet
3389   TCP       Yes           Disable  Remote Desktop / 
Remote Desktop
        Scope: *
 
Ports on which programs want to receive incoming connections:
Port   Protocol  Version  PID       Type  Wildcarded  Forced  Name /
Program
-------------------------------------------------------------------
500    UDP       IPv4     688       App   No          No      (null) / 
F:\XP_PRO\system32\lsass.exe
        Scope: *
4500   UDP       IPv4     688       App   No          No      (null) / 
F:\XP_PRO\system32\lsass.exe
        Scope: *
123    UDP       IPv4     980       App   No          No      (null) / 
F:\XP_PRO\system32\svchost.exe
        Scope: *
123    UDP       IPv4     980       App   No          No      (null) / 
F:\XP_PRO\system32\svchost.exe
        Scope: *
1900   UDP       IPv4     1144      App   No          No      (null) / 
F:\XP_PRO\system32\svchost.exe
        Scope: *
1900   UDP       IPv4     1144      App   No          No      (null) / 
F:\XP_PRO\system32\svchost.exe
        Scope: *
68     UDP       IPv4     980       App   No          No      (null) / 
F:\XP_PRO\system32\svchost.exe
        Scope: *
 
Ports currently open on all network interfaces:
Port   Protocol  Version  Program
-------------------------------------------------------------------
137    UDP       IPv4     (null)
        Scope: LocalSubNet
139    TCP       IPv4     (null)
        Scope: LocalSubNet
138    UDP       IPv4     (null)
        Scope: LocalSubNet
445    TCP       IPv4     (null)
        Scope: LocalSubNet
 
ICMP settings for all network interfaces:
Mode     Type  Description
-------------------------------------------------------------------
Disable  2     Allow outbound packet too big
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Enable   8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Additional ICMP settings on Local Area Connection:
Mode     Type  Description
-------------------------------------------------------------------
Disable  2     Allow outbound packet too big
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Additional ICMP settings on Wireless Network Connection:
Mode     Type  Description
-------------------------------------------------------------------
Disable  2     Allow outbound packet too big
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Local Area Connection firewall settings:
-------------------------------------------------------------------
Operational mode = Enable
Version          = IPv4
GUID             = {4C6BDC23-E2CC-4EC3-AF98-2414B6B8DF24}
 
Wireless Network Connection firewall settings:
-------------------------------------------------------------------
Operational mode = Enable
Version          = IPv4
GUID             = {04D0C6EE-DB7B-40A1-A4F9-3BA2E03B3053}

The following is an example of the netsh firewall show config verbose=enable command:

Domain profile configuration:
-------------------------------------------------------------------
Operational mode                  = Enable
Exception mode                    = Enable
Multicast/broadcast response mode = Enable
Notification mode                 = Enable
 
Service configuration for Domain profile:
Mode     Customized  Name
-------------------------------------------------------------------
Enable   No          File and Printer Sharing
        Scope: *
Disable  No          UPnP Framework
        Scope: LocalSubNet
Disable  No          Remote Desktop
        Scope: *
Disable  No          Remote Administration
        Scope: *
 
Allowed programs configuration for Domain profile:
Mode     Name / Program
-------------------------------------------------------------------
Enable   Remote Assistance / F:\XP_PRO\system32\sessmgr.exe
        Scope: *
 
Port configuration for Domain profile:
Port   Protocol  Mode     Name
-------------------------------------------------------------------
139    TCP       Enable   NetBIOS Session Service
        Scope: *
445    TCP       Enable   SMB over TCP
        Scope: *
137    UDP       Enable   NetBIOS Name Service
        Scope: *
138    UDP       Enable   NetBIOS Datagram Service
        Scope: *
1900   UDP       Disable  SSDP Component of UPnP Framework
        Scope: LocalSubNet
2869   TCP       Disable  UPnP Framework over TCP
        Scope: LocalSubNet
3389   TCP       Disable  Remote Desktop
        Scope: *
 
ICMP configuration for Domain profile:
Mode     Type  Description
-------------------------------------------------------------------
Disable  2     Allow outbound packet too big
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Standard profile configuration (current):
-------------------------------------------------------------------
Operational mode                  = Enable
Exception mode                    = Enable
Multicast/broadcast response mode = Enable
Notification mode                 = Enable
 
Service configuration for Standard profile:
Mode     Customized  Name
-------------------------------------------------------------------
Enable   No          File and Printer Sharing
        Scope: LocalSubNet
Disable  No          UPnP Framework
        Scope: LocalSubNet
Disable  No          Remote Desktop
        Scope: *
Disable  No          Remote Administration
        Scope: *
 
Allowed programs configuration for Standard profile:
Mode     Name / Program
-------------------------------------------------------------------
Enable   Remote Assistance / F:\XP_PRO\system32\sessmgr.exe
        Scope: *
 
Port configuration for Standard profile:
Port   Protocol  Mode     Name
-------------------------------------------------------------------
139    TCP       Enable   NetBIOS Session Service
        Scope: LocalSubNet
445    TCP       Enable   SMB over TCP
        Scope: LocalSubNet
137    UDP       Enable   NetBIOS Name Service
        Scope: LocalSubNet
138    UDP       Enable   NetBIOS Datagram Service
        Scope: LocalSubNet
1900   UDP       Disable  SSDP Component of UPnP Framework
        Scope: LocalSubNet
2869   TCP       Disable  UPnP Framework over TCP
        Scope: LocalSubNet
3389   TCP       Disable  Remote Desktop
        Scope: *
 
ICMP configuration for Standard profile:
Mode     Type  Description
-------------------------------------------------------------------
Disable  2     Allow outbound packet too big
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Log configuration:
-------------------------------------------------------------------
File location   = F:\XP_PRO\pfirewall.log
Max file size   = 4096 KB
Dropped packets = Disable
Connections     = Disable
 
Local Area Connection firewall configuration:
-------------------------------------------------------------------
Operational mode                  = Enable
 
Port configuration for Local Area Connection:
Port   Protocol  Mode     Name
-------------------------------------------------------------------
23     TCP       Disable  Telnet Server
3389   TCP       Disable  Remote Desktop
21     TCP       Disable  FTP Server
110    TCP       Disable  Post-Office Protocol Version 3 (POP3)
25     TCP       Disable  Internet Mail Server (SMTP)
143    TCP       Disable  Internet Mail Access Protocol Version 4 (IMAP4)
80     TCP       Disable  Web Server (HTTP)
220    TCP       Disable  Internet Mail Access Protocol Version 3 (IMAP3)
443    TCP       Disable  Secure Web Server (HTTPS)
 
ICMP configuration for Local Area Connection:
Mode     Type  Description
-------------------------------------------------------------------
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Local Area Connection 2 firewall configuration:
-------------------------------------------------------------------
Operational mode                  = Enable
 
Port configuration for Local Area Connection 2:
Port   Protocol  Mode     Name
-------------------------------------------------------------------
21     TCP       Disable  FTP Server
25     TCP       Disable  Internet Mail Server (SMTP)
3389   TCP       Disable  Remote Desktop
443    TCP       Disable  Secure Web Server (HTTPS)
143    TCP       Disable  Internet Mail Access Protocol Version 4 (IMAP4)
23     TCP       Disable  Telnet Server
220    TCP       Disable  Internet Mail Access Protocol Version 3 (IMAP3)
110    TCP       Disable  Post-Office Protocol Version 3 (POP3)
80     TCP       Disable  Web Server (HTTP)
 
ICMP configuration for Local Area Connection 2:
Mode     Type  Description
-------------------------------------------------------------------
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request
 
Wireless Network Connection firewall configuration:
-------------------------------------------------------------------
Operational mode                  = Enable
 
Port configuration for Wireless Network Connection:
Port   Protocol  Mode     Name
-------------------------------------------------------------------
220    TCP       Disable  Internet Mail Access Protocol Version 3 (IMAP3)
23     TCP       Disable  Telnet Server
25     TCP       Disable  Internet Mail Server (SMTP)
443    TCP       Disable  Secure Web Server (HTTPS)
3389   TCP       Disable  Remote Desktop
110    TCP       Disable  Post-Office Protocol Version 3 (POP3)
143    TCP       Disable  Internet Mail Access Protocol Version 4 (IMAP4)
21     TCP       Disable  FTP Server
80     TCP       Disable  Web Server (HTTP)
 
ICMP configuration for Wireless Network Connection:
Mode     Type  Description
-------------------------------------------------------------------
Disable  3     Allow outbound destination unreachable
Disable  4     Allow outbound source quench
Disable  5     Allow redirect
Disable  8     Allow inbound echo request
Disable  9     Allow inbound router request
Disable  11    Allow outbound time exceeded
Disable  12    Allow outbound parameter problem
Disable  13    Allow inbound timestamp request
Disable  17    Allow inbound mask request

Audit Logging

To track changes that are made to Windows Firewall settings and to see which applications and services asked Windows XP to listen on a port, you can enable audit logging and then look for audit events in the security event log.

To enable audit logging on a computer running Windows XP with SP2, do the following:

  1. Log on using an account that is a local administrator.

  2. From the Windows XP desktop, click Start, click Control Panel, click Performance and Maintenance, and then click Administrative Tools.

  3. In Administrative Tools window, double-click Local Security Policy Shortcut.

  4. In the console tree of the Local Security Settings snap-in, click Local Policies, and then click Audit Policy.

  5. In the details pane of the Local Security Settings snap-in, double-click Audit policy change. Select Success and Failure, and then click OK.

  6. In the details pane of the Local Security Settings snap-in, double-click Audit process tracking. Select Success and Failure, and then click OK.

  7. Close the Local Security Settings snap-in.

You can also enable audit logging for multiple computers in an Active Directory® directory service domain using Group Policy by modifying the Audit policy change and Audit process tracking settings at Computer Configuration\Windows Settings\Security Settings\Local Policies\Audit Policy for the Group Policy objects in the appropriate domain system containers.

Once audit logging is enabled, use the Event Viewer snap-in to view audit events in the security event log.

Windows Firewall uses the following event IDs:

  • 848 - Displays the startup configuration of Windows Firewall.

  • 849 - Displays an application exception configuration.

  • 850 - Displays a port exception configuration.

  • 851 - Displays a change made to the application exceptions list.

  • 852 - Displays a change made to the port exceptions list.

  • 853 - Displays a change made to the Windows Firewall operation mode.

  • 854 - Displays a change made to Windows Firewall logging settings.

  • 855 - Displays a change made to ICMP settings.

  • 856 - Displays a change made to the Prohibit unicast response to multicast or broadcast requests setting.

  • 857 - Displays a change made to the Remote Administration setting.

  • 860 - Displays a change made to a different profile.

  • 861 - Displays an application attempting to listen for incoming traffic.

Windows Firewall Logging File

To determine whether a specific computer is dropping packets, enable Windows Firewall logging, either on an individual computer or through Group Policy settings. Then, check the Windows Firewall log file for entries that correspond to the suspected traffic.

The Pfirewall.log file, stored by default in your main Windows folder, records either discarded incoming requests or successful connections based on the Security Logging settings on the Advanced tab in the Windows Firewall component of Control Panel or through the Windows Firewall: Allow logging Group Policy setting. You can use the contents of the Pfirewall.log file to determine whether traffic is reaching the computer on which Windows Firewall is enabled without having to create an exception or enable ICMP traffic.

For example, when you select the Log dropped packets check box, all incoming traffic that is discarded by the firewall is logged in the Pfirewall.log file. You can view this file by double-clicking it in your main Windows folder with Windows Explorer. Use the contents of the log file to determine whether traffic reached your computer and was discarded by Windows Firewall.

Here is an example of the contents of the Pfirewall.log file:

Note: Some of the lines in the following code have been displayed on multiple lines for better readability.

#Version: 1.5
#Software: Microsoft Windows Firewall
#Time Format: Local
#Fields: date time action protocol src-ip dst-ip src-port dst-port size
tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info path
 
2004-07-08 15:22:30 DROP UDP 157.60.137.221 255.255.255.255 3134 712 88 
- - - - - - - RECEIVE
2004-07-08 15:22:31 DROP UDP 157.60.138.21 239.255.255.250 3289 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:34 DROP UDP 157.60.138.21 239.255.255.250 3289 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:35 DROP UDP 157.60.138.134 239.255.255.250 3507 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:37 DROP UDP 157.60.138.21 239.255.255.250 3289 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:37 DROP UDP 157.60.136.211 239.255.255.250 4274 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:38 DROP UDP 157.60.138.134 239.255.255.250 3507 1900 161 
- - - - - - - RECEIVE
2004-07-08 15:22:38 DROP UDP 192.168.0.1 239.255.255.250 1900 1900 280 
- - - - - - - RECEIVE

The following table lists and describes the fields for a Windows Firewall log entry.

Fields

Description

date

Displays the year, month, and day that the packet was received. Dates are recorded in the format YYYY-MM-DD, where YYYY is the year, MM is the month, and DD is the day.

time

Displays the hour, minute, and seconds when the packet was received. Times are recorded in the format: HH:MM:SS, where HH is the hour in 24-hour format, MM is the number of minutes, and SS is the number of seconds.

action

Indicates the operation that was observed by the firewall. The options available to the firewall are OPEN, CLOSE, DROP, and INFO-EVENTS-LOST. An INFO-EVENTS-LOST action indicates the number of events that occurred but that were not recorded in the log.

protocol

Displays the protocol that was used for the communication. The protocol can be TCP, UDP, ICMP, or a number corresponding to the Protocol field in the IP header of the dropped packet.

src-ip

Displays the source IP address of the packet.

dst-ip

Displays the destination IP address of the packet.

src-port

Displays the source port number of the TCP or UDP header of the packet. A src-port entry is recorded in the form of a whole number, between 1 and 65,535. Only TCP and UDP traffic displays a valid src-port entry.

dst-port

Displays the destination port number of the TCP or UDP header of the packet. A dst-port entry is recorded in the form of a whole number, between 1 and 65,535. Only TCP and UDP traffic displays a valid dst-port entry.

size

Displays the packet size in bytes.

tcpflags

Displays the TCP control flags in the TCP header for TCP traffic:

A – Ack: Acknowledgment field significant

F – Fin: No more data from sender

P – Psh: Push function

R – Rst: Reset the connection

S – Syn: Synchronize sequence numbers

U – Urg: Urgent Pointer field significant

tcpsyn

Displays the TCP sequence number in the TCP header for TCP traffic.

tcpack

Displays the TCP acknowledgment number in the TCP header for TCP traffic.

tcpwin

Displays the TCP window size in the TCP header for TCP traffic.

icmptype

Displays the ICMP type in the ICMP header for ICMP traffic.

icmpcode

Displays the ICMP code in the ICMP header for ICMP traffic.

info

Displays an information entry that depends on the type of action that occurred. For example, an INFO-EVENTS-LOST action creates an entry for the number of events that occurred but were not recorded in the log from the time of the last occurrence of this event type.

path

Displays the direction that the packet was traveling. Typical values are SEND (for sent packets), RECEIVE (for received packets), and FORWARD (for forwarded packets).

The hyphen (-) is used for fields when there is no information available.

You can also use the contents of the Pfirewall.log file to determine whether a malicious Internet user has scanned your computer.

The Services Snap-in

You use the Services snap-in to check the status of services (programs running on your computer that provide capabilities to other application programs you might run). For Windows Firewall troubleshooting, use the Services snap-in to check the status and properties of the Windows Firewall (WF)/Internet Connection Sharing (ICS) service. Once Windows Firewall has been enabled, the Windows Firewall (WF)/Internet Connection Sharing (ICS) service in the Services snap-in should be started and configured to automatically start.

To use the Services snap-in for Windows Firewall troubleshooting, do the following:

  1. Click Start, click Control Panel, click Performance and Maintenance, click Administrative Tools, and then double-click Services.

  2. In the details pane of the Services snap-in, double-click the Windows Firewall (WF)/Internet Connection Sharing (ICS) service.

    Startup type should be set to Automatic and the Service status should be Started.

An example is shown in the following figure.

wftsht03.gif

The Event Viewer Snap-in

If the Windows Firewall (WF)/Internet Connection Sharing (ICS) service is unable to start, then it adds entries to the system event log with information about why it could not start. Additionally, audit log events corresponding to changes in Windows Firewall configuration and program requests to open ports are stored in the security event log. To view the system or security event logs, use the Event Viewer snap-in.

To view the entries in the system or security event logs with the Event Viewer snap-in, do the following:

  1. Click Start, click Control Panel, click Performance and Maintenance, click Administrative Tools, and then double-click Event Viewer.

  2. To look for error events for the Windows Firewall (WF)/Internet Connection Sharing (ICS) service, click System in the console tree of the Event Viewer snap-in.

  3. In the details pane of the Event Viewer, look for Error events.

  4. To look for audit events corresponding to applications or service attempting to open ports, click Security in the console tree of the Event Viewer snap-in.

  5. In the details pane of the Event Viewer, look for events with the event IDs 849, 850, and 861.

The following figure shows an example of an audit event in the security event log.

wftsht04.gif

The Netstat Tool

The Netstat tool displays a variety of information about active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, and IPv4 and IPv6 statistics. In Windows XP with SP2, the Netstat tool supports a new –b option that displays the set of components by file name that are listening on each open TCP and UDP port.

In Windows XP with SP1 and Windows XP with SP2, you can use the netstat –ano command to display the complete set of ports being listened to in numerical form and their corresponding process IDs (PIDs). You can then look up the PID in the display of the tasklist /svc command to discover the name of the process that owns the port. However, in some cases, there are multiple services within a single process and it is not possible with the netstat –ano command to determine which service within the process owns the port.

With the netstat –anb command, Netstat displays the complete set of TCP or UDP ports in numerical form, the file names corresponding to the components of the service that owns the port, and the corresponding PIDs. From the file names and the PID, you can determine which of the services in the display of the tasklist /svc command opened the port.

Summary

Windows Firewall is a host-based stateful firewall in Windows XP SP2 that discards unsolicited incoming traffic that does not correspond to a configured and enabled exception. Windows Firewall provides a level of security from malicious Internet users who scan computers looking for vulnerabilities. Windows Firewall is enabled by default and can be configured using the new Windows Firewall component of Control Panel and through Group Policy settings. The most common problems with Windows Firewall are the inability of server, peer, or listening applications to receive traffic. In most cases, configuring the appropriate exception is the solution to a lack of connectivity experienced by an application. Windows XP provides several tools to gather information for troubleshooting Windows Firewall issues.

See the following resources for further information:

For information about Windows Firewall in the Microsoft Knowledgebase, go to https://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO and type Windows Firewall in the Search for field.

For the latest information about Windows XP, see the Windows XP Web site at https://www.microsoft.com/windowsxp.