Detectionmediumtest

Testing Usage of Uncommonly Used Port

Adversaries may communicate using a protocol and port paring that are typically not associated. For example, HTTPS over port 8088(Citation: Symantec Elfin Mar 2019) or port 587(Citation: Fortinet Agent Tesla April 2018) as opposed to the traditional port 443.

Open in Detection LabConvert ruleBuild Package
François HubautCreated 2022-01-23adf876b3-f1f8-4aa9-a4e4-a64106feec06windows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script

Definition

Requirements: Script Block Logging must be enabled

Detection Logic
Detection Logic2 selectors
detection:
    selection:
        ScriptBlockText|contains|all:
            - Test-NetConnection
            - '-ComputerName '
            - '-port '
    filter:
        ScriptBlockText|contains:
            - ' 443 '
            - ' 80 '
    condition: selection and not filter
False Positives

Legitimate administrative script

Testing & Validation

Regression Tests

by frack113
Positive Detection Test1 matchevtx

Microsoft-Windows-PowerShell

Rule Metadata
Rule ID
adf876b3-f1f8-4aa9-a4e4-a64106feec06
Status
test
Level
medium
Type
Detection
Created
2022-01-23
Path
rules/windows/powershell/powershell_script/posh_ps_test_netconnection.yml
Raw Tags
attack.command-and-controlattack.t1571
View on GitHub