Detectionmediumtest

New Port Forwarding Rule Added Via Netsh.EXE

Detects the execution of netsh commands that configure a new port forwarding (PortProxy) rule

Open in Detection LabConvert ruleBuild Package
Florian Roth (Nextron Systems), omkar72, oscd.community, Swachchhanda Shrawan PoudelCreated 2019-01-29Updated 2023-09-01322ed9ec-fcab-4f67-9a34-e7c6aef43614windows
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 Logic4 selectors
detection:
    selection_img:
        - Image|endswith: '\netsh.exe'
        - OriginalFileName: 'netsh.exe'
    selection_cli_1:
        CommandLine|contains|all:
            - 'interface'
            - 'portproxy'
            - 'add'
            - 'v4tov4'
    selection_cli_2:
        CommandLine|contains|all:
            # Example: netsh I p a v l=8001 listena=127.0.0.1 connectp=80 c=192.168.1.1
            - 'i ' # interface
            - 'p ' # portproxy
            - 'a ' # add
            - 'v ' # v4tov4
    selection_cli_3:
        CommandLine|contains|all:
            - 'connectp'
            - 'listena'
            - 'c='
    condition: selection_img and 1 of selection_cli_*
False Positives

Legitimate administration activity

WSL2 network bridge PowerShell script used for WSL/Kubernetes/Docker (e.g. https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723)

Rule Metadata
Rule ID
322ed9ec-fcab-4f67-9a34-e7c6aef43614
Status
test
Level
medium
Type
Detection
Created
2019-01-29
Modified
2023-09-01
Path
rules/windows/process_creation/proc_creation_win_netsh_port_forwarding.yml
Raw Tags
attack.lateral-movementattack.command-and-controlattack.t1090
View on GitHub