- Overview
- Firewall Review
- Static Firewall
- Stateful Firewall
- The Internet Connection Firewall
- Enabling & Disabling the ICF
- Services Options
- Adding a Service
- Programs Options
- Security Logging Options
- Setting up Security Logging
- ICMP Options
- Adjusting the ICMP Options
- Understanding the ICMP options
- Issues to clarify before enabling Internet Connection Sharing
- Enabling / Adjusting / Disabling Internet Connection Sharing
- Summary of the ICF
Setting up Security Logging
As stated before, logging is one of the key parts of any secure system. However, the ICF Security Logging is disabled by default. The following steps will enable it:
Right click on Network Neighborhood and click on Properties
Right click the connection using the ICF and select Properties
Click on the Advanced tab and choose Settings
Click the Security Settings tab
Click the Log dropped packets and the Log successful connections check box
Change the location and name of the firewall log file under the Name text box
Click OK, OK, and OK again.
TIP
The last step in a professional hacker attack is to delete any trace of the attack. Since most users never change the location of the log files, it is a simple thing for a hacker to find and alter the log file to cover his tracks. If you move and rename the log file location, it becomes more difficult for the hacker to successfully cover his tracks. This also gives you an edge in removing any Trojan backdoors from a root kit. For these reasons it is highly recommended that you move the log file location.
TIP
To disable the Security Logging, simply ensure the Log dropped packets and Log successful connections options are unchecked.
Figure 5-10 Security Logging setting of the ICF
Reading the log file
A log file can offer a wealth of information. However, the file is worthless if you cannot extract meaningful data. The following section analyzes a sample from an actual log file and explains the various parts.
1. #Verson: 1.0 2. #Software: Microsoft Internet Connection Firewall 3. #Time Format: Local 4. #Fields: date time action protocol src-ip dst-ip src-port dst-port size tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info 5. 2001-08-28 19:41:47 OPEN TCP 64.41.22.233 64.12.162.57 3555 5190 - - - - - - - - 6. 2001-08-28 19:41:48 OPEN TCP 64.41.22.233 205.188.8.12 3556 5190 - - - - - - - - 7. 2001-08-28 19:41:53 OPEN TCP 64.41.22.233 64.4.13.179 3557 80 - - - - - - - - 8. 2001-08-28 19:42:00 OPEN TCP 64.41.22.233 131.107.65.80 3559 80 - - - - - - - - 9. 2001-08-28 19:42:00 OPEN TCP 64.41.22.233 131.107.65.80 3560 80 - - - - - - - - 10. 2001-08-28 19:42:16 CLOSE TCP 64.41.22.233 64.12.162.57 3555 5190 - - - - - - - - 11. 2001-08-28 19:43:16 CLOSE UDP 64.41.22.233 207.69.188.187 3031 53 - - - - - - - -
The above is an excerpt of a log file taken from a dial up computer over a period of a few seconds. In this example, you can see that the log file is full of numbers and other information. The key to understanding the data is found in the header of the file.
Line 4 contains the field names of each column of data. This makes importing the file into a spreadsheet application very easy. Fig. 5-11 shows us the file as it appears after it is imported into MS Excel. Using this method of viewing, the information leaps out at us. The following steps explain how to extract the information and import it into MS Excel.
Figure 5-11 Viewing the ICF log file in Microsoft Excel
Make a copy of the log file from its resident location to a temporary location
Open the file and remove lines 1-3
Remove the '#Fields: ' from the left side of the new top line (previously line 4)
Open Microsoft Excel > Data > Import External Data > Import Data
Change Files of Type to All Files (*.*) and select the *.log file previously copied
Choose Delimited and click Next
Check the Space option
Click Finish and OK to use the existing worksheet
You should now have a window similar to Fig. 5-12. The following will explain each field and its meaning.
Figure 5-12 Using Microsoft Excel to import the log file
1. #Fields: date time action protocol src-ip dst-ip src-port dst-port size tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info
Date: Lists the date on which the connection attempt was made in YYYY-MM-DD format. (e.g. 2002-02-05)
Time: Lists the time that the connection attempt was made in HH:MM:SS format (24 hour format; e.g. 19:41:52)
Action: Identifies the type of operation recorded by the ICF. The possible entries are, OPEN, CLOSE, DROP, INFO-EVENTS-LOST. INFO-EVENTS-LOST is used when a number of actions occurred, but were not entered into the security log.
Protocol: Identifies the protocol that was used for the connection attempt. While normally TCP, UDP, or ICMP will be entered, if an unknown protocol is used then a number representing the number of packets using the unknown protocol will be placed in this field instead.
Src-ip: Identifies the source IP address from which the connection attempt originated (e.g. 192.168.0.4)
Dst-ip: Identifies the destination IP address to which the connection attempt was made (e.g. 192.168.23.34)
Src-port: Identifies the source port from which the connection attempt was made on the requesting computer. The entry will be an integer ranging from 1-65,535. Only TCP and UDP will return a valid port number. If another protocol is used, port 4039 will be entered. (e.g. 3023)
Dst-port: Identifies the local port to which the connection attempt was made. The entry will be an integer ranging from 1-65,535. Only TCP and UDP will return a valid port number. If another protocol is used, port 53 will be entered (e.g. 80 is a common entry if the request is made to retrieve a web page from the local host)
Size: Identifies the size of the packet in Bytes (e.g. 60)
Tcpflags: Identifies the TCP control flag found in the header of all TCP packets. The flags are written as uppercase letters (e.g. ACK).
Begin indent
Ack This flag says that the ack number is valid, which means that the sender is acknowledging the receipt of data.
Fin This flag signifies that the sending end will not be sending any more data.
Psh This flag tells the receiving end to push all buffered data to the destination application. It essentially means there is no more data.
Rst This flag resets the receiving end of the TCP connection. Packets in error are replied to with this flag.
Syn This flag is used to signify that both ends have to synchronize their TCP buffers.
Urg- This flag is used to signify that the urgent pointer is valid and the data it refers to should be processed immediately.
End indent
Tcpsyn: Identifies the sequence number used in a TCP session. This number is present when the tcpflag is set to SYN (e.g. 1315819885)
Tcpack: Identifies the acknowledgement number used in a TCP session. This number is present when the tcpflag is set to ACK. This number will be the next sequence number the local computer should expect to receive (e.g. 0).
Tcpwin: Identifies the TCP window size in bytes of the packet.
Icmptype: Identifies the number that represents the ICMP field Type (e.g. ICMP echo = 8)
Icmpcode: Identifies the number that represents the ICMP field Code. This number have various meanings depending on the ICMP Type (e.g. Type=Desitnation Unreachable (3), Code=Host Unreachable (1)).
Info: Used as an extra entry to clarify an action that occurred. For example, an INFO-EVENTS-LOST action will record the number of events that happened but were not placed in the log since the last incidence of this type of event.
As you can see, the ICF Security log offers its user a wealth of information. Although it seems esoteric to many end-users, this log will provide network administrators substantial proof of a hack attempt and its origin.
For example, one of the first things every hacker does against a target system is a port scan. If this is performed on a system with the ICF logging enabled, the attackers IP address will show up in multiple entries over a brief period of time. In addition, if the hacker used a scanner that sequentially probes ports (e.g. 3045, 3046, 3047), the log file will be full of entries where the dst-port field increases by one. When used in conjunction with other logging options provided by Windows XP, the ICF log from end-user machines provides useful clues.