Query Details

Total SMB Sessions Created by FileName

SMB Sessions Generated By File

Query

let TimeFrame = 24h; //Customizable h = hours, d = days
DeviceNetworkEvents
| where TimeGenerated > ago(TimeFrame)
| where RemotePort == 445
| where InitiatingProcessFileName <> "Microsoft.Tri.Sensor.exe" // MDI Sensor
| where InitiatingProcessFileName <> "sensendr.exe" // MDE Device Discovery
| summarize dcount(RemoteIP) by InitiatingProcessFileName, InitiatingProcessFolderPath

About this query

Total SMB Sessions Created by FileName

Defender For Endpoint

let TimeFrame = 24h; //Customizable h = hours, d = days
DeviceNetworkEvents
| where Timestamp > ago(TimeFrame)
| where RemotePort == 445
| where InitiatingProcessFileName <> "Microsoft.Tri.Sensor.exe" // MDI Sensor
| where InitiatingProcessFileName <> "sensendr.exe" // MDE Device Discovery
| summarize dcount(RemoteIP) by InitiatingProcessFileName, InitiatingProcessFolderPath

Sentinel

Versions

VersionComment
1.0Initial commit
1.1Timespan update

Explanation

The query calculates the total number of SMB sessions created by each file name within a specified time frame. It filters out specific process file names and folders and groups the results by the initiating process file name and folder path. The query can be used in both Defender for Endpoint and Sentinel.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: April 17, 2023

Tables

DeviceNetworkEvents

Keywords

DevicesIntuneUser

Operators

whereletsummarizebyago<>

Actions

GitHub