Skip to main content
5156SecurityObject AccessSecurity tier 1

Event ID 5156: The Windows Filtering Platform has permitted a connection

Event ID 5156 records that the Windows Filtering Platform permitted a connection, and 5157 records one it blocked. Both come from the Filtering Platform Connection subcategory and show the process, addresses, ports and protocol. Success auditing writes one event per connection, so Microsoft recommends leaving Success off and auditing Failure.

What Triggers Event 5156, and Where 5157 Fits

Event 5156 is written by the Filtering Platform Connection subcategory whenever the Windows Filtering Platform allows a connection. Its mirror, event 5157, is written when the platform blocks one. The subcategory also covers port bindings and listen actions, but these two are the ones analysts read. Microsoft's own table for the subcategory shows General Success auditing as No for domain controllers, member servers and workstations, and Failure as Yes. The reasoning is in the comment: Success typically generates one event for every connection made to the system, so it is far more useful to audit blocked connections.

That explains the forum threads. A Splunk Community thread reports about 25,000 of these events per minute from servers, and a Spiceworks poster describes about fifty a second. The usual cause is a policy that turned Success auditing on for this subcategory; the urtech.ca write-up traced it to Audit Object Access in the Default Domain Controller Policy. The fix is the one Microsoft implies: set the subcategory back to Failure only, for example with auditpol /set /subcategory:"Filtering Platform Connection" /success:disable, and turn Success on only for the high-value hosts where you need to see connections to and from untrusted addresses. If you must keep it everywhere, filter at the forwarder rather than discarding whole ranges blindly.

Reading the event takes patience because the fields behave differently from other Security events. Application is a kernel-style path such as \device\harddiskvolume3\windows\system32\svchost.exe, not C:\Windows\System32\svchost.exe. Microsoft points to diskpart's list volume command to map the number to a drive. Any rule written for 4688 or 4663 paths will miss it, so your regex needs a volume wildcard. ProcessID is documented as hexadecimal, but the sample event shows a plain decimal value, and that matches what a SIEM extracts. Compare it with Task Manager directly, and convert it before matching the hexadecimal new process ID in a 4688.

Protocol is the IANA number: 6 for TCP, 17 for UDP and 1 for ICMP, with 47 (GRE), 50 (ESP) and 51 (AH) among those Microsoft lists. FilterRTID is the run-time ID of the filter that made the decision, and netsh wfp show filters writes a filters.xml where you can look it up. LayerName and LayerRTID identify the Application Layer Enforcement layer, resolvable with netsh wfp show state. In the sample, %%14610 is the message code Event Viewer renders as Receive/Accept, and the layer ID is 44. RemoteUserID and RemoteMachineID both show S-1-0-0 in Microsoft's sample.

Test this before you build detections. Microsoft describes SourceAddress in 5156 as the address that initiated the connection and DestAddress as where it was received. The page for 5157 flips that, describing SourceAddress as the local address, and the sample events put the listening process on the source side. The documentation contradicts itself on which end is which. Do not argue it out on paper. Start a simple listener on a lab host with auditing on, connect to it from a second machine, and see which field holds which address. The sample on this page follows the initiator convention: 10.20.4.88 reaching port 3389 on 10.20.4.37, an inbound RDP session between two workstations, which is a lateral movement path worth a rule.

Once the event is flowing, put it to work on three jobs. The first is an egress inventory by process: which executables talk to which external addresses, and from which folders. Microsoft suggests flagging an Application that is not the expected one, that sits outside standard folders, or whose name contains strings such as mimikatz. The second is exposure of administrative ports. Inbound connections to 445, 3389, 5985, 5986 and 135 from outside your management subnets map to remote services (T1021) and deserve review. The third is boundary hygiene: protocol numbers other than 1, 6 and 17 on an endpoint are unusual, and Microsoft calls them out.

Event 5157 is the blocked half. The fields are identical, FilterRTID names the filter that dropped the traffic, and it is logged as an audit failure, which is why you probably collect it already. It is the cleanest place to see scanning. One remote address hitting many different ports on a host and being refused is the shape of network service discovery (T1046), and blocked inbound attempts on 445 or 3389 from a workstation subnet show lateral movement that the firewall stopped. A blocked outbound connection from a server that should never reach the internet tells you something tried to call home.

Event 5156 Fields

FieldWhat it tells youSimulated value
ProcessIDID of the process that made or received the connection; decimal in the sample event.1428
ApplicationKernel-style path of the executable, in the form \device\harddiskvolume#\path.\device\harddiskvolume3\windows\system32\svchost.exe
DirectionDirection of the allowed connection; %%14592 is Inbound.%%14592
SourceAddressAddress from which the connection was initiated, per the 5156 description.10.20.4.88
SourcePortPort from which the connection was initiated.51722
DestAddressAddress where the connection was received.10.20.4.37
DestPortPort where the connection was received.3389
ProtocolIANA protocol number: 6 TCP, 17 UDP, 1 ICMP.6
FilterRTIDRun-time ID of the filter that allowed the connection; look it up with netsh wfp show filters.69142
LayerNameApplication Layer Enforcement layer name as a message code.%%14610
LayerRTIDRun-time ID of the layer; look it up with netsh wfp show state.44
RemoteUserIDS-1-0-0 in the Microsoft sample; the event carries no account name.S-1-0-0
RemoteMachineIDS-1-0-0 in the Microsoft sample.S-1-0-0

Inspect Event 5156 Values

Click a field to inspect the full simulated value, the way you would expand it in a SIEM event view.

Example Event 5156 Log

A representative Security entry for Event 5156, generated deterministically by our telemetry engine so every field holds a realistic, internally consistent value.

Simulated example generated by SOCSimulator Research
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" />
    <EventID>5156</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2025-09-20T06:50:08.000Z" />
    <EventRecordID>837615</EventRecordID>
    <Channel>Security</Channel>
    <Computer>WS-SIM-001.corp.socsimulator.example</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="ProcessID">1428</Data>
    <Data Name="Application">\device\harddiskvolume3\windows\system32\svchost.exe</Data>
    <Data Name="Direction">%%14592</Data>
    <Data Name="SourceAddress">10.20.4.88</Data>
    <Data Name="SourcePort">51722</Data>
    <Data Name="DestAddress">10.20.4.37</Data>
    <Data Name="DestPort">3389</Data>
    <Data Name="Protocol">6</Data>
    <Data Name="FilterRTID">69142</Data>
    <Data Name="LayerName">%%14610</Data>
    <Data Name="LayerRTID">44</Data>
    <Data Name="RemoteUserID">S-1-0-0</Data>
    <Data Name="RemoteMachineID">S-1-0-0</Data>
  </EventData>
</Event>

Detecting Event 5156

Process outside the Windows and Program Files folders connecting to a public address

Application uses \device\harddiskvolume paths, so the regex allows any volume number. This assumes DestAddress holds the remote peer on outbound events; confirm with a listener test first. SPL assumes sourcetype XmlWinEventLog:Security.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5156
| where NOT match(Application, "(?i)^\\\\device\\\\harddiskvolume\\d+\\\\(windows|program files)")
| where NOT (cidrmatch("10.0.0.0/8", DestAddress) OR cidrmatch("172.16.0.0/12", DestAddress) OR cidrmatch("192.168.0.0/16", DestAddress))
| stats count, dc(DestAddress) as destinations by host, Application
| sort - count

Inbound administrative-port connections from outside the management subnet

Uses the initiator convention from the 5156 description: SourceAddress is the client and DestPort the local port. Replace 10.20.1.0/24 with your management range.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5156 (DestPort=445 OR DestPort=3389 OR DestPort=5985 OR DestPort=5986 OR DestPort=135)
| where NOT cidrmatch("10.20.1.0/24", SourceAddress)
| stats count, values(Application) as apps by host, SourceAddress, DestPort

5157: one remote address refused on many ports within five minutes (scan shape)

Same initiator convention; swap SourceAddress and DestAddress if your listener test shows the opposite. The threshold of 20 ports is a starting point.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5157
| bin _time span=5m
| stats dc(DestPort) as ports, count by _time, host, SourceAddress
| where ports >= 20

Protocol other than ICMP, TCP or UDP

Microsoft recommends watching for protocol numbers that are not typical for the device, for example anything other than 1, 6 or 17. VPN clients and tunnels are the usual benign hits.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5156 NOT Protocol IN ("1", "6", "17")
| stats count by host, Application, Protocol, DestAddress

True Positive vs False Positive

Most allowed connections come from the operating system and well-known applications. Browsers, update services, svchost and the System process generate a steady background, and the first task is a per-host baseline of Application against destination port. Rarity beats volume here: a binary that has never connected before, or one that suddenly uses a port it never used, stands out in a table sorted by first-seen date.

The true positives are narrow. An executable running from AppData, Temp, ProgramData or a Downloads folder opening outbound connections is the classic one, and the Application path makes it visible without any hashing. A server that has no business reaching the internet connecting to a public address is the second. The third is inbound administrative-port traffic from hosts that are not your management systems. The fourth is a burst of 5157 events from one peer across dozens of ports.

5156 and 5157 carry no account name, and RemoteUserID shows S-1-0-0 in Microsoft's sample, so attribution goes through the process. Take ProcessID to the 4688 for the same host and time to get the parent and command line, then to the executable's hash and signer. For inbound sessions, match the minute against 4624 events, type 10 for RDP and type 3 for SMB or WinRM, on the destination host. Where you can deploy Sysmon, its network connection event records the user and image directly and is better suited to endpoint-wide collection. Keep 5156 for the places where a built-in source is all you have.

Dropping every connection between private addresses cuts volume sharply, and it is also how you lose the east-west traffic that lateral movement uses. A safer cut is by Application allowlist, plus keeping every connection to the administrative ports regardless of address.

MITRE ATT&CK® Techniques

Event 5156 telemetry feeds detections for these ATT&CK® techniques:

Practice Investigating Event 5156

Reading about the windows filtering platform has permitted a connection is one thing. Working the detection inside a live console is another. These free SOCSimulator operations cover the attack techniques Event 5156 helps you detect:

FortiOS Bypass to Hunters International Ransomware

FortiOS Bypass to Hunters International Ransomware

Operators consistent with the Hunters International ransomware group abuse a FortiOS super-admin authentication bypass on an internet-facing FortiGate, plant rogue accounts, pivot over the SSL-VPN tunnel by RDP, sweep the network with Advanced IP and Port Scanner, and push roughly 6.8 GB of share data to a single external host over SFTP before running the encrypter. Work the FortiGate edge, the directory records, the perimeter egress, and the endpoint process tree to reconstruct the intrusion from entry to encryption.

30m·256 tasks
View Operation
MFA Fatigue: The Notification Flood

MFA Fatigue: The Notification Flood

In this guided walkthrough, you will step into the shoes of a SOC analyst investigating a modern identity-based attack. The threat landscape in 2026 has shifted: adversaries are no longer just 'breaking in'; they are logging in. You will analyze real-time identity signals, correlate disparate log sources across a hybrid cloud environment, and identify the markers of an MFA fatigue attack used by the FlowerStorm phishing kit. This scenario highlights the critical importance of behavioral analysis over simple IOC matching in an era of malware-free intrusions and compromised human identities.

30m·256 tasks
View Operation
RDP Brute Force: Internet-Facing Server Login

RDP Brute Force: Internet-Facing Server Login

An internet-exposed Windows Server running RDP has been receiving a sustained brute-force campaign from an external address. After dozens of failed authentication events, one attempt succeeds and an interactive session is opened. Reconstruct the attack from the Windows Security event log, identify the source and target, and classify the technique.

25m·256 tasks
View Operation
Start investigating free

Frequently Asked Questions

What is event ID 5156?
It records that the Windows Filtering Platform allowed a connection. The event shows the process path, direction, source and destination addresses and ports, the protocol number, and the filter and layer IDs. It is generated by the Filtering Platform Connection subcategory when Success auditing is enabled.
Why is my security log full of event 5156 and how do I stop it?
Success auditing for the Filtering Platform Connection subcategory writes one event per allowed connection, so it fills fast. Microsoft's guidance is Success off and Failure on. Disable Success with auditpol or Group Policy, and enable it again only on high-value hosts where you need to monitor connections to untrusted addresses.
Should I drop RFC 1918 events for 5156 before indexing?
You can, and the volume falls sharply, but you lose east-west traffic, which is where lateral movement shows up. A safer approach is to drop by Application allowlist and to keep every connection involving administrative ports such as 445, 3389, 5985, 5986 and 135.
What is the difference between event 5156 and 5157?
5156 is a connection the Windows Filtering Platform allowed, a success audit. 5157 is a connection it blocked, a failure audit. They carry the same fields. Microsoft recommends collecting the failures by default and treating the successes as an opt-in for high-value systems.
How do I find which filter allowed or blocked a connection?
Take the FilterRTID from the event and run netsh wfp show filters on the same host. It writes filters.xml, where you can search for the matching filterId. LayerRTID resolves the same way against wfpstate.xml from netsh wfp show state.

Sources

“5156 fields, Application path format, protocol numbers, netsh wfp lookup of filter and layer IDs, and Microsoft's monitoring recommendations”

“5157 is the blocked-connection counterpart with the same fields; its description of Source and Destination differs from 5156”

“Success auditing is off by default for all computer types and Failure is recommended, because Success writes one event per connection”

“auditpol /set syntax with /subcategory, /success and /failure switches”

“Published 5156 example showing the Receive/Accept layer name with layer run-time ID 44”

“Remote service lateral movement over SMB, one of the connection patterns the administrative-port rule is meant to catch”

“Splunk Community thread reporting about 25,000 5156 events per minute”

“Spiceworks thread reporting event logs filling with 5156 at about 50 events per second”

“Fix applied in the Default Domain Controller Policy, Audit Object Access settings”

“T1046 Network Service Discovery, the scan shape the 5157 query looks for”

Event ID

Event ID 5140: Share Access per Session & Admin Share Alerts

Event ID 5140 is logged once per SMB session. Learn what ShareName, IpAddress and AccessMask tell you, and detect C$ and…

Read more
Event ID

Event ID 5145: Per-File Share Access & PsExec Detection

Event ID 5145 logs every file or folder checked on a network share. Read ShareName and RelativeTargetName, spot ADMIN$ w…

Read more
Event ID

Event ID 4656: Handle Requested, AccessMask & Failures

Event ID 4656 logs a request for a handle to a file or key. Decode the requested AccessMask, read Failure events and Pri…

Read more
Glossary

What is Data Exfiltration? SOC Glossary

Data exfiltration in cyber security is the unauthorized transfer of data from an organization's systems to infrastructur…

Read more
Glossary

What is Persistence? SOC Glossary

Persistence is the set of techniques an adversary uses to keep access to a compromised system after whatever gave them t…

Read more
Glossary

What is Threat Hunting? SOC Glossary

Threat hunting is the proactive search through security telemetry for attackers that existing controls missed. The hunte…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Career Path

Threat Hunter Career Guide: Salary & Skills

Threat Hunters do not wait for alerts. You develop hypotheses based on threat intelligence and adversary behavior models…

Read more
Technique

Remote Services (T1021): Detection Training

Remote Services lateral movement reuses valid credentials against services built to accept remote sessions, RDP, SSH, VN…

Read more
Technique

Network Service Discovery (T1046): Detection Training

T1046 Network Service Discovery (called Network Service Scanning until ATT&CK v11, April 2022) is an adversary mapping l…

Read more
Technique

Application Layer Protocol (T1071): Detection Training

Adversaries run command and control inside common application protocols, HTTP, HTTPS, DNS, and mail, so the traffic blen…

Read more
Comparison

SOCSimulator vs. LetsDefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more