Forked from jsecurity101/SQL Query for Process Reimaging
Created
August 13, 2021 17:03
-
-
Save bigbrobro/9e0e5f1dbed41e8e07243a2e019b7ea3 to your computer and use it in GitHub Desktop.
Query ran to detect Process Reimaging behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
a.computer_name, | |
a.OriginalFileName, | |
a.LogonId, | |
b.ProcessId, | |
c.TargetFilename | |
FROM processreimaging a | |
JOIN processreimaging b | |
ON a.ProcessGuid = b.ProcessGuid | |
AND b.channel = "Microsoft-Windows-Sysmon/Operational" | |
AND b.event_id = 7 | |
AND a.OriginalFileName = b.OriginalFileName | |
AND a.Image = b.ImageLoaded | |
JOIN processreimaging c | |
ON a.ParentProcessGuid = c.ProcessGuid | |
AND c.channel = "Microsoft-Windows-Sysmon/Operational" | |
AND c.event_id = 11 | |
AND a.Image = c.TargetFilename | |
WHERE | |
a.channel = "Microsoft-Windows-Sysmon/Operational" | |
AND a.event_id = 1 | |
AND a.IntegrityLevel = "High" | |
AND LOWER(a.OriginalFileName) != LOWER(substring_index(a.Image, '\\\\', -1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment