Detectionhighstable

Potential Powershell ReverseShell Connection

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.

Convert In Phoenix Studio

Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.

Launch
FPT.EagleEye, wagga, Nasreddine Bencherchali (Nextron Systems)Created Wed Mar 03Updated Wed Apr 05edc2f8ae-2412-4dfd-b9d5-0c57727e70bewindows
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic2 selectors
detection:
    selection_img:
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
    selection_cli:
        CommandLine|contains|all:
            - ' Net.Sockets.TCPClient'
            - '.GetStream('
            - '.Write('
    condition: all of selection_*
False Positives

In rare administrative cases, this function might be used to check network connectivity

MITRE ATT&CK
Rule Metadata
Rule ID
edc2f8ae-2412-4dfd-b9d5-0c57727e70be
Status
stable
Level
high
Type
Detection
Created
Wed Mar 03
Modified
Wed Apr 05
Path
rules/windows/process_creation/proc_creation_win_powershell_reverse_shell_connection.yml
Raw Tags
attack.executionattack.t1059.001
View on GitHub