How can you prevent others from eavesdropping on network traffic when operating a pc on a public Wi-Fi hotspot?
In today's digital age, the convenience of public Wi-Fi hotspots is undeniable, allowing us to stay connected while…

Windows Defender Firewall can record every connection it allows or drops — but logging is disabled by default, so on a machine where nobody enabled it, there is nothing to read. Turning it on is the first step, and it must be done per network profile.
wf.msc.Set-NetFirewallProfile -Profile Domain,Private,Public `
-LogAllowed True -LogBlocked True `
-LogFileName "%systemroot%\system32\LogFiles\Firewall\pfirewall.log" `
-LogMaxSizeKilobytes 32767
# Confirm
Get-NetFirewallProfile | Select-Object Name, LogAllowed, LogBlocked, LogFileName, LogMaxSizeKilobytesnetsh advfirewall set allprofiles logging droppedconnections enable
netsh advfirewall set allprofiles logging allowedconnections enable
netsh advfirewall set allprofiles logging maxfilesize 32767%systemroot%\system32\LogFiles\Firewall\pfirewall.logTypically C:\Windows\System32\LogFiles\Firewall\pfirewall.log. When the file reaches its size limit it is renamed pfirewall.log.old and a fresh one starts — so you always have between one and two files’ worth of history, and no more.
You need administrator rights to read it, and Notepad will often refuse while the file is in use. Copy it first:
Copy-Item C:\Windows\System32\LogFiles\Firewall\pfirewall.log $env:TEMP\fw.log
notepad $env:TEMP\fw.log#Fields: date time action protocol src-ip dst-ip src-port dst-port size
tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info path
2026-08-28 09:14:22 DROP TCP 203.0.113.44 192.168.1.20 51234 3389 52 S 1234567 0 8192 - - - RECEIVE
2026-08-28 09:14:25 ALLOW TCP 192.168.1.20 142.250.185.78 49876 443 0 - 0 0 0 - - - SEND| Field | Meaning |
|---|---|
action | ALLOW, DROP, INFO-EVENTS-LOST |
protocol | TCP, UDP, ICMP |
src-ip / dst-ip | Source and destination addresses |
src-port / dst-port | Ports — the destination port tells you the service |
tcpflags | S = SYN (connection attempt), A = ACK, R = reset, F = FIN |
path | RECEIVE = inbound, SEND = outbound |
The two entries above read as: someone at 203.0.113.44 tried to open RDP (port 3389) on this machine and was blocked; then this machine made an outbound HTTPS connection, which was allowed.
INFO-EVENTS-LOST means logging could not keep up and entries were discarded — usually a sign the log level is too verbose for the machine’s activity.
The raw file is unusable by hand on a busy machine. Parse it:
$log = "C:\Windows\System32\LogFiles\Firewall\pfirewall.log"
# Everything that was dropped
Get-Content $log | Select-String " DROP "
# Inbound drops only — attempts against this machine
Get-Content $log | Select-String " DROP " | Select-String "RECEIVE"
# Anything involving one address
Get-Content $log | Select-String "203.0.113.44"
# Attempts on RDP
Get-Content $log | Select-String " 3389 "
# Watch live
Get-Content $log -Wait -Tail 20For real analysis, convert it into objects:
$entries = Get-Content $log |
Where-Object { $_ -notmatch '^#' -and $_.Trim() } |
ForEach-Object {
$f = $_ -split '\s+'
[PSCustomObject]@{
Time = "$($f[0]) $($f[1])"
Action = $f[2]
Protocol = $f[3]
SrcIP = $f[4]
DstIP = $f[5]
DstPort = $f[7]
Path = $f[16]
}
}
# Top sources of blocked inbound traffic
$entries | Where-Object { $_.Action -eq 'DROP' -and $_.Path -eq 'RECEIVE' } |
Group-Object SrcIP | Sort-Object Count -Descending | Select-Object -First 20
# Most-targeted ports
$entries | Where-Object { $_.Action -eq 'DROP' } |
Group-Object DstPort | Sort-Object Count -Descending | Select-Object -First 20| Pattern | What it means |
|---|---|
| Many DROPs from one external IP across many ports | Port scan. Normal internet background noise if the machine is exposed. |
| Repeated DROPs on 3389, 445, 22 | Automated attacks against RDP, SMB and SSH. Constant on any public-facing host. |
| DROPs on 137, 138, 139, 5353 | NetBIOS and mDNS discovery from the local network. Usually harmless. |
| An internal app failing to connect | Search the log for its destination port — a DROP there is your missing rule. |
| Unexpected outbound to an unfamiliar address | Worth investigating. Correlate with Event ID 5156 for the process name. |
The firewall log’s biggest limitation is that it does not name the process — you get addresses and ports and nothing about what generated the traffic. For that, use the Windows Filtering Platform audit events:
auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable
auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:enable /failure:enableThen read them from the Security log:
# 5156 = allowed connection, 5157 = blocked connection
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=5157} -MaxEvents 50 |
Select-Object TimeCreated, Message | Format-ListThese events include the application path, which the text log does not. They are also considerably more verbose, so enable them for investigation rather than permanently.
C:\Windows\System32\LogFiles\Firewall\pfirewall.log by default, with the previous file kept as pfirewall.log.old. Administrator rights are required to read it.
Logging is off by default. Enable it per profile in wf.msc under Properties → Logging → Customize, or with Set-NetFirewallProfile.
No. The text log has addresses, ports and protocol only. For the process name, enable Filtering Platform auditing with auditpol and read Security log events 5156 and 5157.
Only until the size limit is reached, at which point the file rotates. There is no time-based retention, so a busy machine may hold only hours of history. Raise the limit or forward the logs elsewhere.
Only while troubleshooting or investigating. It produces far more volume than dropped-only logging and will rotate away the entries you care about.
Constant inbound drops on 3389, 445 and 22 are ordinary internet background scanning against any exposed host, and the firewall is working correctly. Unexpected outbound connections deserve more attention.
One response to “Windows Firewall Logs — How to Enable, Find and Read Them”
I’m using the app Firewall Log Viewer for Windows to analyse log files