Invoke-PowerShellTcpOneLine Usage (Normalized Process Events)
Description
'Invoke-PowerShellTcpOneLine is a PowerShell script to create a simple and small reverse shell. It can be abused by attackers to exfiltrate data. This query looks for command line activity similar to Invoke-PowerShellTcpOneLine.'
Query · kql
imProcessCreate
| where Process has_any ("powershell.exe", "PowerShell_ISE.exe", "cmd.exe")
| where CommandLine has "$client = New-Object System.Net.Sockets.TCPClient"
| extend timestamp = TimeGenerated, AccountCustomEntity = User, HostCustomEntity = Dvc, IPCustomEntity = DvcIpAddr