KQLHunting query: tune before alertingShadow AI and AI-powered attackers
Machine-paced burst of scanning and credential tools launched under an AI agent
In the AI-orchestrated espionage campaign Anthropic disrupted (September 2025), Claude Code ran reconnaissance, exploitation and credential harvesting largely on its own, with tools such as network scanners and password crackers exposed through MCP, at thousands of requests and often several per second. Anthropic published no host indicators, so this hunt looks for the shape: many offensive-tool executions in ten minutes whose parent or grandparent is an AI agent or an MCP server it started.
- Log source
- Microsoft Defender for Endpoint: DeviceProcessEvents
- Techniques
- AML.T0116 Autonomous Reconnaissance · AML.T0124 Autonomous Attack Orchestration · AML.T0053 AI Agent Tool Invocation · ASI10 Rogue Agents
- MITRE ATT&CK
- T1046Network Service DiscoveryT1110Brute ForceT1003OS Credential Dumping
- Reviewed
- 2026-11-10
Query
let ai_agents = dynamic(["claude", "claude.exe", "codex", "codex.exe", "cursor-agent", "Cursor", "Cursor.exe", "Cursor Helper (Plugin)", "gemini", "copilot", "Windsurf", "Windsurf.exe", "q"]);
let offensive_tools = dynamic(["nmap", "masscan", "rustscan", "naabu", "nuclei", "httpx", "ffuf", "gobuster", "feroxbuster",
"sqlmap", "hydra", "netexec", "nxc", "crackmapexec", "kerbrute", "hashcat", "john",
"secretsdump.py", "impacket-secretsdump"]);
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ (offensive_tools)
| where InitiatingProcessFileName in~ (ai_agents) or InitiatingProcessParentFileName in~ (ai_agents)
| summarize Executions = count(), DistinctTools = dcount(FileName), Tools = make_set(FileName),
SampleCommands = make_set(ProcessCommandLine, 10)
by DeviceName, AccountName, Window = bin(Timestamp, 10m)
| where Executions >= 20 or DistinctTools >= 3
| order by Executions desc Expected false positives
- Authorized penetration testers and red teams who drive tools through AI agents
- Security research and CTF machines
Sources
- Anthropic: Disrupting the first reported AI-orchestrated cyber espionage campaign (Nov 2025)
- Anthropic: full report (PDF)
- Defender XDR: DeviceProcessEvents table
Reviewed against vendor documentation, not tested in your environment. Defensive use only.