Windows XP Service Pack 2 includes the Windows Firewall, a replacement for the Internet Connection Firewall component in Windows XP with Service Pack 1 and Windows XP with no service packs installed. Windows Firewall is a stateful host-based firewall that drops all unsolicited incoming traffic that does not relate to either traffic sent in response to solicited traffic or unsolicited traffic that has been specified as allowed.
One of the enhancements in Windows XP SP2 is the enabling of Windows Firewall by default during the installation of Windows XP or update to Windows XP SP2. In this thread, i’ll describe how to edit the Windows Firewall INF file in order to create custom default configurations for Windows Firewall or just to have a tinker. There are so many configurations that can be use so i can’t tell you all of them, but tinkering and knowing what you wan’t will help alot.
If you have a second machine running XP, you may wan’t to experiment with that first so you don’t screw anything up too bad.
Scenarios for Firewall modification
Disabling the Windows Firewall:
If a third party firewall such as ZoneLabs’ ZoneAlarm is enabled by default, then it is recommended that Windows Firewall be disabled. This can be done by modifying the Windows Firewall INF file to disable Windows Firewall by default.
Preinstalled Programs:
An OEM or yourself may choose to install a suite of programs. Some of these programs may need to receive unsolicited incoming traffic in order to function properly. The Windows Firewall can be configured to allow unsolicited incoming traffic by default by adding the programs to the Windows Firewall’s exceptions list. This can be done by adding entries for the programs to the Windows Firewall INF file. Only programs that require unsolicited incoming traffic should be added to the exceptions list; programs that do not require unsolicited incoming traffic should not be added.
Opening Ports:
You may choose to use various network services and want to ensure that the network traffic for those services are allowed through the Windows Firewall. Windows Firewall can be configured to open the necessary ports by adding them to the Windows Firewall’s exceptions list. This can be done by adding entries for the TCP or UDP ports to the Windows Firewall INF file. Statically opening ports does potentially increase a computer’s exposure to an attack, so the number of ports opened in Windows Firewall should be kept to a minimum.
Location of Windows Firewall INF File:
On a Windows XP CD, the location of the Windows Firewall INF file is:
CD Drive:\I386\Netfw.in_
Note; On the Windows CD, the file’s name is Netfw.in_ (not .inf).
On the machine Windows is installed on, the location of the Windows Firewall INF file is: %windir%\Inf\Netfw.inf
Replacing the Default Windows Firewall Configuration:
- Copy the Windows Firewall INF file (Netfw.inf) from an installation of Windows XP SP2 to somwehere else on your machine
- Make the desired modifications to the INF file
- Save the modified INF file as Netfw.inf
- Replace the default Netfw.inf with the modified Netfw.inf
- Run the command netsh firewall resetfrom command prompt.
To customize Netfw.inf prior to installing XP SP2:
- Extract the Netfw.in_ file from an XP SP2 Integrated CD image.
- Make the desired modifications to the INF file.
- Replace Netfw.in_ on your XP SP2 CD image with your customized version.
- Burn your customised XP image
This is what Netfw.inf (and Netfw.in_) contain by default:
[CODE][version]
Signature = “$Windows NT$”
DriverVer =07/01/2001,5.1.2600.2132
[DefaultInstall]
AddReg=ICF.AddReg.DomainProfile
AddReg=ICF.AddReg.StandardProfile
[ICF.AddReg.DomainProfile]
HKLM,"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\AuthorizedApplications\List","%windir%\system32\sessmgr.exe",0x00000000,"%windir%\system32\sessmgr.exe:*:enabled:@xpsp2res.dll,-22019"
[ICF.AddReg.StandardProfile]
HKLM,"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List","%windir%\system32\sessmgr.exe",0x00000000,"%windir%\system32\sessmgr.exe:*:enabled:@xpsp2res.dll,-22019"[/CODE]
Standard profile: used by default in workgroup environments (computer not connected to a domain).
Domain profile: used by default in domain environments and allows exceptions based on installed Windows XP services and applications.
Continued…