Forum Discussion

Sohel68's avatar
Sohel68
Copper Contributor
Jul 12, 2023

Looking for KQL query when high volume of USB writes happens by a user

Hello,

I did some online search, but I couldn't find any working one yet. 

I'm looking for query which I can use in Advance threat hunting in MDE to generate an alert when a user copies huge number of data to an external USB drive.

 

your help is much appreciated.

 

thanks.

 

 

 

  • In Microsoft Defender for Endpoint, you can use the following KQL query to show a high volume of USB writes by a single user. Modify the Threshold value to define what you consider a "high volume" of USB writes.

    DeviceFileEvents
    | where ActionType == "FileWrite" and InitiatingProcessFileName == "explorer.exe" and FileName contains ".usb"
    | summarize USBWriteCount = count() by AccountName
    | where USBWriteCount > Threshold // Replace Threshold with a specific value to define "high volume"
    | order by USBWriteCount desc

Resources