ByteRay CQL Hub
← All queries

Lateral Movement Detection

This query identifies potential lateral movement activities by detecting remote connections and credential usage patterns across multiple hosts.

CQL · Falcon Next-Gen SIEMCopy query
#event_simpleName=NetworkConnect 
| (RemotePort=445 OR RemotePort=3389 OR RemotePort=5985)
| !cidr(RemoteAddressIP4, subnet=["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"])
| join({#event_simpleName=ProcessRollup2}, field=[aid, RawProcessId], include=[ImageFileName, CommandLine])
| join({#event_simpleName=UserIdentity}, field=AuthenticationID, include=[UserName])
| table([aid, UserName, ImageFileName, RemoteAddressIP4, RemotePort, CommandLine])

This query uses CrowdStrike Query Language (CQL) to detect lateral movement activities:

  1. Network Connections: #event_simpleName=NetworkConnect - Monitors outbound network connections from endpoints

  2. Target Ports: (RemotePort=445 OR RemotePort=3389 OR RemotePort=5985) - Focuses on SMB (445), RDP (3389), and WinRM (5985) connections

  3. External Targets: !cidr(RemoteAddressIP4, subnet=["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]) - Excludes internal network ranges to focus on external connections

  4. Process Context: join({#event_simpleName=ProcessRollup2}, field=[aid, RawProcessId], include=[ImageFileName, CommandLine]) - Adds process information for the connecting application

  5. User Context: join({#event_simpleName=UserIdentity}, field=AuthenticationID, include=[UserName]) - Enriches with user account information

  6. Output: table([aid, UserName, ImageFileName, RemoteAddressIP4, RemotePort, CommandLine]) - Shows user, process, target IP, and connection details

Lateral_Movement_Detection.yml
T1021.001, T1021.002, T1135
ByteRay GmbH
Detection
Network
Insight
2025-08-04
2025-08-26

Get this query running in your SIEM, with someone on call.

Our Managed SIEM team operates CrowdStrike Falcon Next-Gen SIEM in production, with over 350 battle-tested use cases and 24/7 incident response behind them.

Talk to the SIEM team