sequence by process.entity_id with maxspan=5m
[process where host.os.type == "windows" and event.action == "start" and
/* Direct Exec from USB */
(process.Ext.device.bus_type : "usb" or process.Ext.device.product_id : "USB *") and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.code_signature.status : ("errorExpired", "errorCode_endpoint*")]
[network where host.os.type == "windows" and event.action == "connection_attempted"]
Install detection rules in Elastic Security
Detect Execution from a Removable Media with Network Connection in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).