Writes KQL queries for Microsoft Sentinel, Defender, and Azure Log Analytics detections and hunts. Translates findings from hash-investigation or malware-analysis into KQL.
Ships in cti-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
KQL (Kusto Query Language) is used in Microsoft Sentinel, Microsoft Defender, and Azure Data Explorer for querying security logs and building detection rules.
SecurityEvent // Windows Security Events
DeviceProcessEvents // Defender for Endpoint
DeviceNetworkEvents // Network connections
DeviceFileEvents // File operations
EmailEvents // Defender for Office 365
SigninLogs // Azure AD sign-ins
AuditLogs // Azure AD audit
CommonSecurityLog // CEF/Syslog
ThreatIntelligenceIndicator // TI feed indicators
| where TimeGenerated > ago(24h) // Time filter
| where EventID == 4688 // Exact match
| where ProcessCommandLine contains "-enc" // Substring
| where ProcessCommandLine matches regex @".*-e(nc)?.*" // Regex
| where SourceIP !in ("10.0.0.1", "10.0.0.2") // Not in list
| where isnotempty(AccountName) // Not null/empty
| extend NewColumn = extract(@"pattern", 1, SourceField) // Extract
| project TimeGenerated, Account, Computer // Select columns
| summarize count() by bin(TimeGenerated, 1h), Account // Aggregate
| sort by TimeGenerated desc // Sort
| take 100 // Limit results
| join kind=inner (OtherTable) on CommonField // Join
| Operator | Description | Case-sensitive |
|---|---|---|
== | Exact match | Yes |
=~ | Exact match | No |
contains | Substring | No |
contains_cs | Substring | Yes |
startswith | Starts with | No |
endswith | Ends with | No |
matches regex | Regex match | Yes |
has | Word boundary match | No |
in | In list | Yes |
in~ | In list | No |
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where FileName in~ ("powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe")
| where ProcessCommandLine contains_cs "-enc"
or ProcessCommandLine contains "bypass"
or ProcessCommandLine contains "downloadstring"
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where InitiatingProcessFileName in~ ("outlook.exe", "winword.exe", "excel.exe", "powerpnt.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "mshta.exe", "certutil.exe")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine
let IOC_IPs = dynamic(["203.0.113.42", "198.51.100.10"]);
let IOC_Domains = dynamic(["evil.example.com", "c2.badactor.net"]);
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where RemoteIP in (IOC_IPs) or RemoteUrl has_any (IOC_Domains)
| project TimeGenerated, DeviceName, RemoteIP, RemoteUrl, RemotePort, InitiatingProcessFileName
SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType != "0"
| summarize FailedAttempts = count(), DistinctAccounts = dcount(UserPrincipalName)
by IPAddress, bin(TimeGenerated, 15m)
| where FailedAttempts > 10
| sort by FailedAttempts desc
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where FileName =~ "psexesvc.exe"
or (FileName =~ "cmd.exe" and ProcessCommandLine contains "\\\\")
or ProcessCommandLine contains "-accepteula -s cmd"
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine
DeviceEvents
| where TimeGenerated > ago(24h)
| where ActionType == "DnsQueryResponse"
| extend DnsQuery = extractjson("$.DnsQueryString", AdditionalFields)
| where DnsQuery endswith ".onion.ws"
or DnsQuery endswith ".tor2web.io"
or DnsQuery matches regex @"^[a-z0-9]{20,}\."
| project TimeGenerated, DeviceName, DnsQuery
// Rule name: [Descriptive title]
// Description: [What this detects and why]
// MITRE ATT&CK: [Technique IDs]
// Severity: High|Medium|Low|Informational
// Tactics: [InitialAccess, Execution, etc.]
// Query:
[KQL query here]
ago()) to limit query scopehas instead of contains when searching for whole words (faster)in~ over multiple or conditions for case-insensitive list matchinglet statements for IOC lists to keep queries readableproject to select only needed columns (reduces result size)This skill authors queries. To run them against a real Microsoft Sentinel workspace — or to hunt interactively — chain /lookup-sentinel. Two rules apply the moment a query targets live data:
/lookup-sentinel discovers which tables the workspace actually ingests (tables / ingestion / probe) and adapts — e.g. no DeviceProcessEvents (no Defender for Endpoint) means falling back to SecurityEvent EventID 4688, which itself requires command-line auditing. Never ship a hunt referencing unverified tables.For portable analytics rules meant for any environment, keep the canonical table names from this guide and document the connector prerequisite in the rule header comment.
Write KQL queries to: data/detection-rules/kql/<technique-id>-<slug>.kql
What SKILL.md sets; muted values are Claude Code's defaults
/cti-skills:kql-writingfrom cti-skills
npx claudepluginhub liberty91ltd/cti-skills --plugin cti-skills78 skills in this plugin
/abuseipdb-apiAbuseIPDB API reference. IP reputation and abuse report lookups./achAnalysis of Competing Hypotheses — structured technique for evaluating multiple explanations against evidence. Use when facing ambiguous attribution or multiple plausible scenarios. Prefers graded evidence items from /quality-of-information-check and runs that skill first when handed raw URLs or text. Runs on ungraded evidence when asked, labelled as such, unweighted, and capped at Moderate confidence./campaign-trackingUse when documenting a named campaign across time and victims, the user asks to start or update a campaign record, or another skill identified a multi-incident cluster that warrants formal tracking. Provides the template (timeline, attribution, victimology, attack chain, Diamond Model mapping, IOC clusters) and the lifecycle from active to historical.Other plugins' skills for the same job