How to Detect and Log ICMP Ping Requests on a Windows XP Machine for Network Troubleshooting


2 views

When troubleshooting network connectivity issues, detecting incoming ICMP (ping) requests can be crucial for diagnosing communication problems between devices. On older systems like Windows XP, this requires more manual configuration than modern Windows versions.

Windows XP includes basic tools that can help identify ping activity:


:: View recent ICMP traffic in Event Viewer
eventvwr.msc → System Log → Filter for Source "TCPIP"

However, this provides limited visibility. For more detailed monitoring, we need additional solutions.

The most reliable method involves configuring the Windows Firewall (even if disabled) to log ICMP traffic:


1. Open Administrative Tools → Windows Firewall with Advanced Security
2. Navigate to Inbound Rules
3. Locate "File and Printer Sharing (Echo Request - ICMPv4-In)"
4. Right-click → Properties → Advanced tab
5. Enable logging for successful connections

For real-time monitoring, create a batch script that watches the firewall log:


@echo off
:loop
find /i "ICMP" %windir%\system32\LogFiles\Firewall\pfirewall.log
timeout /t 1 >nul
goto loop

For more comprehensive analysis, use a lightweight packet sniffer like RawCap:


:: Download RawCap.exe from netresec.com
RawCap.exe interfacenumber outputfile.pcap
:: Filter ICMP traffic in Wireshark with: icmp

If PowerShell is installed, this script provides better filtering:


while ($true) {
    Get-EventLog -LogName "System" -Source "Tcpip" -After (Get-Date).AddMinutes(-1) |
    Where-Object {$_.Message -like "*ICMP*"} |
    Select-Object TimeGenerated,Message
    Start-Sleep -Seconds 5
}

Remember that Windows XP is no longer supported and may have vulnerabilities. These monitoring techniques should only be used on isolated test networks.


When debugging network issues, knowing whether a specific machine is receiving ping (ICMP Echo Request) packets can be crucial for troubleshooting. On modern Windows systems, you might use built-in firewall logging or third-party tools, but Windows XP requires a more hands-on approach.

Windows XP's built-in firewall can log ICMP requests when properly configured:

1. Open Control Panel → Windows Firewall
2. Go to the Advanced tab
3. Under Security Logging, click Settings
4. Check "Log dropped packets" and "Log successful connections"
5. Specify a log file location (default: %systemroot%\pfirewall.log)
6. Create a custom ICMP rule:
   - netsh firewall add icmpsetting 8

The log will contain entries like:

2023-05-15 14:22:33 ALLOW ICMP 192.168.1.100 192.168.1.50 - - - - - - - RECEIVE

For real-time monitoring, create a batch script that continuously checks for ping responses:

@echo off
:loop
ping -n 1 127.0.0.1 | find "Reply"
if %errorlevel%==0 (
    echo %date% %time% - Ping received >> pinglog.txt
)
timeout /t 1 >nul
goto loop

For more advanced monitoring, use RawCap (a lightweight packet capture tool):

1. Download RawCap.exe from netresec.com
2. Run: RawCap.exe eth0 ping_capture.pcap
3. Filter ICMP packets in Wireshark with: icmp.type == 8

For XP machines with PowerShell 1.0/2.0 installed:

while ($true) {
    $ping = Test-Connection -ComputerName $env:COMPUTERNAME -Count 1 -Quiet
    if ($ping) {
        Add-Content -Path "C:\pinglog.txt" -Value "$(Get-Date) - Ping received"
    }
    Start-Sleep -Seconds 1
}

Remember that Windows XP is no longer receiving security updates. Any monitoring solution should:

  • Run with minimal privileges
  • Not expose additional network services
  • Be removed after troubleshooting

For persistent monitoring needs, consider upgrading to a supported OS where more robust tools like Windows Event Collector or Performance Monitor can be used.