
Blue team Defender ,Security Engineer ( Content Development) | KQL 🕵️♀️🙇♀️
- Tweets437
- Following3.5K
- Followers579
- Likes2.6K
![DeviceEvents | where ActionType == "PnpDeviceAllowed" | extend Fields = parse_json(AdditionalFields) | where Fields["DriverSection"] == "cdrom_install_ISO_drive" // Detect ISO file being mounted | join kind=inner (DeviceEvents | where ActionType == "AntivirusReport" // Get AntivirusReport events (should fire for new files) | where not (isempty(FolderPath)) | where strlen(FolderPath) < 5 // Just look for files in the root of drives (ISO mounts to a drive letter) | where substring(FolderPath, 0, 3) != "C:\\" // Ignore files in C: | project AVDeviceId=DeviceId, AVTimeGenerated=Timestamp, AVFileName=FileName, AVFolderPath=FolderPath, MD5 ) on $left.DeviceId==$right.AVDeviceId | where datetime_diff("second", Timestamp, AVTimeGenerated) < 300 // AV file scan within 5 minutes of ISO mounted | project Timestamp, AVTimeGenerated, DeviceId, DeviceName, Fields["DriverSection"], AVFileName, AVFolderPath, MD5](https://pbs.twimg.com/media/E2fkDQnVUAMWa04.jpg?name=small&format=webp)
ALT DeviceEvents | where ActionType == "PnpDeviceAllowed" | extend Fields = parse_json(AdditionalFields) | where Fields["DriverSection"] == "cdrom_install_ISO_drive" // Detect ISO file being mounted | join kind=inner (DeviceEvents | where ActionType == "AntivirusReport" // Get AntivirusReport events (should fire for new files) | where not (isempty(FolderPath)) | where strlen(FolderPath) < 5 // Just look for files in the root of drives (ISO mounts to a drive letter) | where substring(FolderPath, 0, 3) != "C:\\" // Ignore files in C: | project AVDeviceId=DeviceId, AVTimeGenerated=Timestamp, AVFileName=FileName, AVFolderPath=FolderPath, MD5 ) on $left.DeviceId==$right.AVDeviceId | where datetime_diff("second", Timestamp, AVTimeGenerated) < 300 // AV file scan within 5 minutes of ISO mounted | project Timestamp, AVTimeGenerated, DeviceId, DeviceName, Fields["DriverSection"], AVFileName, AVFolderPath, MD5




































