Lateral Movement via SMB
Detects lateral movement using SMB protocol by correlating process events with network connections on port 445.
EDRlateral-movementsmbprocessnetworkT1021.002
FDR intermediatepor SOC Team 1 min read
Query
FileName = "cmd.exe" OR FileName = "powershell.exe"
| join(
{ NetworkEvent
| DestinationPort = 445
},
field=SourceProcessId
)
| groupBy([DestinationIP, SourceIP, ComputerName], limit=100)
| sort(field=_count, order=desc)Explicación
| Pipe | Descripción |
|---|---|
| `FileName = ...` | Filtra procesos sospechosos de ejecución remota |
| `join(...)` | Correlaciona con eventos de red en puerto 445 (SMB) |
| `groupBy(...)` | Agrupa por destino, origen y equipo |
| `sort(...)` | Ordena por frecuencia descendente |
Variables a ajustar
- `FileName`: Ampliar con `wscript.exe`, `mshta.exe` según el entorno
- `DestinationPort`: 445 para SMB, 139 para NetBIOS legacy
- `limit`: Aumentar si hay muchos endpoints