Alert for each time a usb device is plugged

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Alert for each time a usb device is plugged

L0 Member

Hello,

Is there any way to set up an alert for each time a USB device is plugged into a host?
Even if it's not malicious.

13 REPLIES 13

L3 Networker

Hi,

 

Are you looking for USB device plugin alert or alert on activity such as File operation, execution operation via removable media?

 

USB Device plugin alert may not be possible but definitely you should be able to create a BIOC rule for USB/RemovableMedia file operation, process operation activity with a low severity priority which will only trigger an alert in Alerts Table but not create an Incident.

 

Will be keen to know if someone has other idea.

Kind Regards
KS

L3 Networker

Hi JoaoSantos20,

 

In the Restrictions Profile you have the option to configure notifications for Removable Media for file executions launched from external drives attached to endpoints in your network. To configure:

  1. From Cortex XDR, select Endpoints > Policy Management > Prevention Profiles > + New Profile.
  2. Select the OS to which the profile applies and Restrictions as the profile type.
  3. Click Next.
  4. Enter a Profile Name to identify the profile and Description
  5. Uncheck Use Default
  6. Select which option best fits your use case
    Notify—Allow the file to execute but notify the user that the file is attempting to run from a suspicious location. The Cortex XDR agent also reports the event to Cortex XDR.
    Report—Allow the file to execute but report it to Cortex XDR.

**You may add files or folders to an allow list or block list as well.

jtalton_4-1648588304362.png 

Save and then apply the Restrictions profile to the Security Profiles to Endpoints.

If you already have a Restrictions Profile configured, you may edit and follow steps 5 - 8

 

You may also create an alert via a BIOC rule from an XQL Query for event logs for Windows and Linux system. For example, an XQL query for the Windows event ID 6416: A new external device was recognized by the system. To build the BIOC rule query through a specific entity:

 

Navigate to Detection Rules > BIOC > + Add BIOC > Select the  Event Log Icon

Enter EVENT_ID = 6416 (optional to enter other parameters), Save

jtalton_3-1648588232947.png

 

Select the Type, Severity, Optional select a MITRE Technique or Tactic to associate with the event, such as Technique - T1092 Removal Media and Tactic - TA0010 - Exfiltration. Enter a comment for tracking, then OK

jtalton_2-1648588193698.png

 

The rule will be displayed in the BIOC Rules table. Right-Click on the Rule to add it to the appropriate Restrictions Profile shown in the sub menu for the endpoints you would like monitored. 

jtalton_1-1648588139581.png

 

jtalton_0-1648588087333.png

 

 

 

Reference

Add a New Restrictions Security Profile (paloaltonetworks.com)

Create a BIOC Rule (paloaltonetworks.com)

If you found this answer helpful, please select Accept as Solution.

Hi @jtalton 

Pretty cool way of monitoring of removable media activity, i think the only thing which will be required from the endpoint side will be enable event logging for Removable media?

 

Kind Regards
KS

Isnt it enabled in windows by default ? 

Really good and creative solution from Jtalton. 

That deserves likes, isnt it ? 

Thanks... Microsoft TechDoc doesn't specify if its enabled by default Monitor the use of removable storage devices (Windows 10) - Windows security | Microsoft Docs

If you found this answer helpful, please select Accept as Solution.

 

Open windows event viewer and go to 

Applications and Service Logs > Microsoft > Windows > DriverFrameworks-UserMode

as shown in the pic1

eluis_0-1648591476794.png

 

 

Double click there and you will see the value is 0 

Right click on it and select properties. You will find enable logging check box empty. See pic2

eluis_1-1648591666091.png

I believe it should be possible to propagate this setting through all your endpoints using GPO instead of manually configuring each endpoint.

 

KR,

Luis

 

Additionally in the registry we see that the enable value is 0 for the registry key 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-DriverFrameworks-UserMode/Operational

Changing the value to 1 should also work

 

KR,

Luis

 

 

eluis_0-1648592297033.png

 

Hi @eluis and @jtalton 

 

For monitoring any new USB device it will be Event-ID 6416 but for monitoring removable media which is already registered by the system it will be 4719. So i guess a BIOC with a combination of 6416 and 4719 Event ID will help.

 

KanwarSingh01_0-1648594685226.png

 

 

Kind Regards
KS

L2 Linker

Very interesting solution @eluis @jtalton 

I'm referencing this Cortex XDR documentation: https://docs.paloaltonetworks.com/cortex/cortex-xdr/cortex-xdr-pro-admin/endpoint-security/customiza...

 

Will those Events (6416 & 4719) be collected automatically or would it be necessary to use the Broker VM to collect this additional IDs?

Multiple analytics alerts track USB activities that do not require BrokerVM

 

A user connected a USB storage device to a host for the first time

A user connected a new USB storage device to a host

A user connected a new USB storage device to multiple hosts

 

But you are correct, configuring the BrokerVM Windows Event Collector would allow you to specify collection for event IDs 6416 & 4719

If you found this answer helpful, please select Accept as Solution.

@micomi Don't see Cortex XDR looking for those EVIDs (6416&4719) in default collection, I think Broker VM would be required in this case.

Probably @eluis or @jtalton can let us know?

Kind Regards
KS

L3 Networker

We created a bioc using a reg key

Seems to work 

 

preset = xdr_registry
| filter (action_registry_key_name contains "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\USBSTOR\Enum" and event_sub_type = REGISTRY_CREATE_KEY)

 

NathanBradley_0-1652365387945.png

 

L5 Sessionator

Hi All,

You can also consider using the following BIOC to raise alerts when a USB device is plugged in.

You can play around with the filters to whitelist allowed device IDs/vendors.

 

 

bbarmanroy_2-1652408436992.png

 

 

  • 8948 Views
  • 13 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!