cscli scenarios install sigmahq/proc_creation_win_powershell_reverse_shell_connection1type: trigger2name: sigmahq/proc_creation_win_powershell_reverse_shell_connection3description: |4 Detects usage of the "TcpClient" class. Which can be abused to establish remote connections and reverse-shells. As seen used by the Nishang "Invoke-PowerShellTcpOneLine" reverse shell and other.5filter: |6 (evt.Meta.service == 'sysmon' && evt.Parsed.EventID == '1') && ((evt.Parsed.OriginalFileName in ['PowerShell.EXE', 'pwsh.dll'] || evt.Parsed.Image endsWith '\\powershell.exe' || evt.Parsed.Image endsWith '\\pwsh.exe') && evt.Parsed.CommandLine contains ' Net.Sockets.TCPClient' && evt.Parsed.CommandLine contains '.GetStream(' && evt.Parsed.CommandLine contains '.Write(')7blackhole: 2m8#status: stable9labels:10 service: windows11 confidence: 212 spoofable: 013 classification:14 - attack.t1059.0011516 label: "Potential Powershell ReverseShell Connection"17 behavior : "windows:audit"18 remediation: false1920scope:21 type: ParentProcessId22 expression: evt.Parsed.ParentProcessId2324