Our security operations team contacted me about an SMB worm alert. The source was one of the Windows servers I manage: in five minutes it had made 1,572 connections to TCP port 139 on 86 different internal IP addresses.
The traffic turned out to be real, and it came from a web security product’s user identification agent. I got there by matching destination IPs and timestamps across Windows and application logs, and the vendor later confirmed it. This post walks through the checks in the order I ran them, and keeps what I found separate from what the vendor confirmed.
The Alert
The detection came from the firewall’s IPS:
- Detection: SMB worm attack
- Source: one internal Windows server
- Activity: 1,572 connections to TCP 139 on 86 destination IPs within five minutes
- Targets: hosts across several internal /24 networks
That’s what worm propagation looks like on a network: one host reaching out to the SMB service of many others. The security team’s question was whether it was normal.
Is the Traffic Real?
Before deciding whether the alert was right or wrong, I checked whether the server was actually making these connections.
Get-NetTCPConnection -RemotePort 139 -ErrorAction SilentlyContinue |
Select-Object LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess
It was. There were outbound connections to remote port 139 in SYN_SENT, and the owning process was PID 4.
TCP 139 is the NetBIOS session service, the older transport for SMB. TCP 445 is SMB directly over TCP. PID 4 is the System process on Windows.
PID 4 was the first trap. It told me the connections were being made at the operating system level, but not which application had asked for them. I needed other logs to answer that.
The remote addresses also kept changing. A few of them:
Workstation A:139
Workstation B:139
Workstation C:139
Workstation D:139
Workstation E:139
They fell inside the subnets the SOC had reported. This wasn’t one leftover session to one file server.
Recording Every Connection with Event 5156
Get-NetTCPConnection only shows what exists at the moment you run it, and these connections came and went quickly. To keep a record, I turned on Windows Filtering Platform connection auditing:
auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable
With that on, Windows writes Security Event 5156 for every allowed connection and 5157 for every blocked one. Then I pulled the events for ports 139 and 445:
Get-WinEvent -FilterHashtable @{
LogName = 'Security'
ID = 5156
StartTime = (Get-Date).AddMinutes(-15)
} -ErrorAction SilentlyContinue |
Where-Object { $_.Message -match 'Destination Port:\s+(139|445)\b' } |
Select-Object TimeCreated, Message |
Format-List
The events matched what the SOC saw:
Application Name: System
Process ID: 4
Direction: Outbound
Source Address: <this server>
Destination Address: 10.x.x.x
Destination Port: 139
Protocol: 6
Including port 445 in the filter showed something I’d missed by looking at 139 alone:
14:42:14 System (PID 4) -> Workstation A:445
14:42:16 System (PID 4) -> Workstation A:139
14:42:20 System (PID 4) -> another workstation:445
14:42:21 System (PID 4) -> another workstation:139
For the same destination, the server tried TCP 445 first, and a connection to TCP 139 followed a second or two later. The IPS only flagged the 139 half.
A note on this audit setting: it can fill the Security log quickly on a busy server. I turned it off once I had what I needed:
auditpol /set /subcategory:"Filtering Platform Connection" /success:disable /failure:disable
The Windows SMB Client Was Involved
The SMB client has its own log:
Get-WinEvent -LogName "Microsoft-Windows-SMBClient/Connectivity" -MaxEvents 50 -ErrorAction SilentlyContinue |
Select-Object TimeCreated, Id, Message |
Format-List
Event ID 30803 entries looked like this:
Failed to establish a network connection.
Server name: 10.x.x.x
Server address: 10.x.x.x:445
Instance name: \Device\LanmanRedirector
Connection type: TCPIP
Error: Device Timeout
\Device\LanmanRedirector is the Windows SMB client. The IPs in these events were the same ones I’d seen in Event 5156. So the SMB client was trying to reach these workstations on 445 and timing out on some of them. Something on the server was asking it to.
I also checked the server’s SMB configuration so I wouldn’t confuse it with the outbound traffic:
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol, EnableSMB2Protocol
Get-SmbConnection
SMB1 was disabled on the server side, and the existing SMB sessions used dialect 3.1.1. That rules out very little about the outbound connections: the server-side setting controls what this server accepts, not what it connects to.
Back to What the Server Actually Does
At this point I stopped looking at the network and looked at the server’s role. It wasn’t a general-purpose server. It ran Forcepoint (formerly Websense) Web Security components:
Get-CimInstance Win32_Service |
Where-Object { $_.Name -like 'Websense*' } |
Select-Object Name, DisplayName, ProcessId, PathName |
Format-List
Name : WebsenseDCAgent
DisplayName : Websense DC Agent
PathName : C:\Program Files\Websense\Web Security\bin\XidDcAgent.exe
DC Agent is the component that works out which user is behind which IP address, so the web filter can apply per-user policy without asking anyone to log in. Forcepoint’s documentation describes it reading logon information from domain controllers and also checking client machines to verify who is still logged on. Its configuration files were in the same folder: transid.ini had UseEventSubscriber=true, and dc_config.txt listed the domain controllers it was set to use.
An agent whose job is to ask workstations who is logged on was worth a closer look.
The DC Agent Log
The DC Agent writes its own log:
C:\Program Files\Websense\Web Security\bin\WebsenseDCAgent.log
I searched it for the destination IPs from the Windows logs:
Select-String -Path "C:\Program Files\Websense\Web Security\bin\WebsenseDCAgent.log" `
-Pattern "10.x.x.1","10.x.x.2","10.x.x.3"
They were there, logged by a worker called WsVerifyWorker:
XidDcAgent.WsVerifyWorker - Could not retrieve hostname for IP: <Workstation A>
NetWkstaGetInfo Error: 53
getUserFromWorkstation:WsVerifyWorker.cpp
XidDcAgent.WsVerifyWorker - Username missing for entry with workstation IP: <Workstation A>
For other workstations the error was different:
NetWkstaGetInfo Error: 5
Error 53 is “The network path was not found”: the call couldn’t reach the workstation. Error 5 is “Access is denied”: it reached the workstation and was refused. Both look like a lookup that failed, not like something spreading.
At least five of the destination IPs from my Windows investigation appeared in WsVerifyWorker entries at closely matching times:
| Workstation | WsVerifyWorker entry | Also seen in Windows 139/445 checks |
|---|---|---|
| Workstation A | around 14:42 | Yes |
| Workstation B | 14:42:55 | Yes |
| Workstation C | 14:45:12 | Yes |
| Workstation D | 14:51:54 | Yes |
| Workstation E | 15:11:31 | Yes |
I didn’t match every event one-to-one to the second, so I won’t claim that. What I had was the same destination IPs, in closely correlated time windows, in three independent places: the Windows Security log, the SMB client log and the DC Agent’s own log.
Why NetWkstaGetInfo Produces SMB Traffic
This is what ties the logs together. NetWkstaGetInfo, called against a remote machine, is a call in the Workstation Service Remote Protocol (MS-WKST). Microsoft’s protocol specification says that protocol runs as RPC over SMB, through the \PIPE\wkssvc named pipe.
So when the DC Agent asks a workstation for its information, the request travels over SMB. That fits all three logs: Event 5156 recorded System (PID 4) connecting to the workstation, the SMB client log recorded \Device\LanmanRedirectortrying to connect, and the DC Agent log recorded NetWkstaGetInfo for the same destination at the same time.
The same interface also shows up in attack tools that enumerate logged-on users across a network. I haven’t seen the IPS signature’s logic, so I can’t say that’s why this traffic was flagged. The broader point holds, though: the same SMB and RPC pattern can come from a management tool or from an attacker’s reconnaissance, and the port alone won’t tell you which.
What I Took to the Vendor
Before the vendor answered, this was my working hypothesis:
Forcepoint Web Security
-> DC Agent (XidDcAgent.exe)
-> WsVerifyWorker: getUserFromWorkstation()
-> NetWkstaGetInfo() against each workstation
-> RPC over SMB (\PIPE\wkssvc)
-> Windows SMB client (LanmanRedirector), recorded as PID 4
-> TCP 445, followed by TCP 139
-> firewall IPS: "SMB worm attack"
I sent the security team the findings and a one-line summary: the DC Agent was suspected as the source of the SMB traffic, based on matching destination IPs and timestamps in its log. They opened a service request with the vendor.
While waiting, I left production alone. I didn’t stop the DC Agent service, block TCP 139 or 445, or disable NetBIOS. Any of these might have made the alert go away. They also would have broken user identification for the web filter, and if the agent had turned out not to be the source, they would have hidden the traffic I was trying to explain.
What the Vendor Confirmed
The vendor’s answer matched the hypothesis:
- The traffic is consistent with DC Agent (XidDcAgent.exe) behavior and comes from its user identification function, not from end-user applications.
- DC Agent queries workstations over NetBIOS TCP 139 as part of that function.
- Errors 53 and 5 can occur during these workstation lookups, and the agent retries failed lookups.
That last point fits the volume. Lookups that fail and get retried, across a large number of workstations, add up quickly, and 1,572 connections in five minutes is what the IPS saw.
To keep the two parts separate: I found the traffic, traced it through the Windows logs, and correlated it with the DC Agent log. The vendor confirmed that this traffic is how their product identifies users.
What’s Still Unknown
Why the IPS flagged it now. The DC Agent wasn’t new, and I haven’t found what changed, whether an IPS signature or policy, a threshold, or something in the environment. I’m leaving that as unknown rather than guessing.
The Evidence, at a Glance
| Evidence | Finding | Meaning |
|---|---|---|
| Firewall IPS | SMB worm attack: 1,572 TCP 139 connections to 86 IPs in 5 minutes | Investigation trigger |
Get-NetTCPConnection | SYN_SENT to many IPs on 139, PID 4 | Traffic exists |
| Security Event 5156 | System (PID 4) → many IPs on 445, then 139 | Traffic recorded, with order |
| SMBClient Event 30803 | LanmanRedirector timeouts to the same IPs on 445 | Windows SMB client involved |
| Windows services | XidDcAgent.exe = Websense DC Agent | Product component identified |
| WebsenseDCAgent.log | WsVerifyWorker, NetWkstaGetInfo, same IPs at closely matching times | Strong correlation |
| MS-WKST specification | NetWkstaGetInfo runs as RPC over SMB | Explains why the lookup produces SMB traffic |
| Vendor | Traffic comes from DC Agent’s user identification function | Cause confirmed |
What I’d Do Again
- Check the traffic on the endpoint before judging the alert. The alert was neither simply right nor simply wrong: the traffic was real, and the question was what made it.
- Treat PID 4 as the start of the question. It tells you the OS made the connection, not which application asked for it.
- Correlate by IP and time across logs. The IPS alert, Event 5156, the SMB client log and the DC Agent log each showed part of it. Matching destination IPs and timestamps across them is what pointed to the agent before the vendor said a word.
- Don’t change production to make an alert stop before you know the cause.
With the vendor’s confirmation in hand, I’ve requested an IPS exception for this traffic. At the time of writing, it’s still waiting on approval.
Related reading: The Installer Exited Without an Error. SentinelOne Had Blocked It. is another case where one security product’s normal behavior ran into another.
Frequently Asked Questions
Why did the SMB connections show up as PID 4 (System)?
Event 5156 recorded them as System (PID 4) because the connections were made at the operating system level, through the Windows SMB client. PID 4 doesn’t say which application requested them. In our case, the SMB client log showed \Device\LanmanRedirector connecting to the same destinations, and the Forcepoint DC Agent log showed NetWkstaGetInfo lookups for those IPs at the same times.
Is an SMB worm alert always a sign of infection?
No, but don’t assume either way. In our case the traffic was real, and the vendor confirmed it came from the DC Agent’s user identification function. Check whether the traffic exists, what requested it, and whether another log explains it before you call it an infection or a false positive.
