5158 Security log · Filtering Platform Connection low severity medium volume

Windows Event ID 5158 — The Windows Filtering Platform has permitted a bind to a local port

WFP permitted application to bind to a local port. Application and LocalPort are key.

Why event 5158 matters

Malicious services or backdoors binding to network ports for C2 or lateral movement pivoting. Unusual applications binding to well-known ports.

How to detect it

Alert: unexpected processes binding to common service ports (80, 443, 445, 3389). Alert: processes in temp or user profile directories binding to any port.

Log source
Security
Advanced Audit Policy — enable the 'Filtering Platform Connection' subcategory (Success and/or Failure).
Fields to pivot on
SubjectUserNameTargetUserNameLogonTypeIpAddressWorkstationName

Detection queries

Starting points — adapt the log source, projected fields and thresholds for your environment.

Sentinel / Defender KQL
SecurityEvent
| where EventID == 5158   // The Windows Filtering Platform has permitted a bind to a local port
| project TimeGenerated, Computer, SubjectUserName, TargetUserName, LogonType, IpAddress, WorkstationName
| sort by TimeGenerated desc
Splunk SPL
index=* sourcetype="WinEventLog:Security" EventCode=5158
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count   `# The Windows Filtering Platform has permitted a bind to a local port — add EventData fields: SubjectUserName, TargetUserName, LogonType, IpAddress`
Hunt event 5158 in Sentinel/Defender →
Build a KQL query for this event in the KQL Query Builder.
Search all event IDs →
Open the interactive Windows Event ID lookup.

Related Filtering Platform Connection events

5154 The Windows Filtering Platform has permitted an application to listen on a port 5155 The Windows Filtering Platform has blocked an application from listening on a port 5156 The Windows Filtering Platform has permitted a connection 5157 The Windows Filtering Platform has blocked a connection

Frequently asked questions

What is Windows Event ID 5158?

The Windows Filtering Platform has permitted a bind to a local port. WFP permitted application to bind to a local port. Application and LocalPort are key.

Which log records event 5158?

Event 5158 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Filtering Platform Connection' subcategory (Success and/or Failure).

How do you detect activity around event 5158?

Alert: unexpected processes binding to common service ports (80, 443, 445, 3389). Alert: processes in temp or user profile directories binding to any port.