Hunting query library

Copy-and-paste hunts in KQL, SPL and Elastic. Every one is time-bounded, says what telemetry it needs, names the benign things it will return, and states whether it has ever actually been run.

Every hunt is time-bounded, because an unbounded search against a year of data is an outage. Every hunt names what it returns that is not evil. And every variant says whether it has been run, syntax checked, or only written.

Language
Tactic

8 in all

PersistenceMembersCONSTRUCTED

Hunt: a web server process starting a shell or a reconnaissance tool

IIS, Apache, nginx and Java application servers do not normally start cmd, PowerShell or a Unix shell. When they do, it is the most reliable sign of a web shell in use, on Windows and Linux alike.

KQLSPLElastic
T1505.003T1190
checked 2026-09-263 variants
CollectionCONSTRUCTED

Hunt: inbox rules that forward, redirect, delete or hide mail

New or changed inbox rules with forwarding, deletion or move actions, across every mailbox. The rule an attacker leaves behind to watch for invoices and hide the replies.

KQLSPLElastic
T1114.003T1564.008
checked 2026-09-263 variants
ExfiltrationMembersCONSTRUCTED

Hunt: rclone, including when it has been renamed

Finds rclone by what the binary says about itself rather than by its file name, so a copy renamed to svchost.exe in a user folder still shows up. The commonest data theft tool in ransomware operations.

KQLSPLElastic
T1567.002T1048
checked 2026-09-263 variants
Initial AccessCONSTRUCTED

Hunt: successful sign-ins from an address the user has never used

For each account, the successful sign-ins from an IP address not seen for that account in the previous 30 days. The first question in any unfamiliar sign-in alert, asked across the whole tenant at once.

KQLSPLElastic
T1078.004
checked 2026-09-263 variants
Credential AccessCONSTRUCTED

Hunt: rundll32 calling the comsvcs MiniDump export

Finds LSASS dumps taken with a DLL that ships in System32, whether the export is named or called by ordinal. One idea in three query languages, each bounded to seven days.

KQLSPLElastic
T1003.001
checked 2026-09-213 variants
Defense ImpairmentCONSTRUCTED

Hunt: the Security audit log was cleared

Event 1102 is the first record of the new log, so it survives the clearing and names the account that did it. One of the cheapest hunts there is, and worth thirty days rather than seven.

KQLSPLElastic
T1685.005
checked 2026-09-213 variants