Windows PowerShell: Get-NetTCPConnection Invocation for Network Connection Discovery

Detects PowerShell usage of Get-NetTCPConnection to enumerate TCP network connections.

FreeUnreviewedSigmalowv1
title: "Windows PowerShell: Get-NetTCPConnection Invocation for Network Connection Discovery"
id: 85033d6d-9ef9-409c-8953-e3f5dbf24907
status: test
description: This rule flags execution of PowerShell code that calls Get-NetTCPConnection. Attackers can use this command to enumerate active TCP connections on a host, which supports discovery of communication endpoints and current network activity. The detection relies on PowerShell classic script telemetry capturing the command string containing Get-NetTCPConnection.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1049/T1049.md#atomic-test-2---system-network-connections-discovery-with-powershell
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_classic/posh_pc_susp_get_nettcpconnection.yml
author: frack113, Huntrule Team
date: 2021-12-10
modified: 2023-10-27
tags:
  - attack.discovery
  - attack.t1049
logsource:
  product: windows
  category: ps_classic_start
detection:
  selection:
    Data|contains: Get-NetTCPConnection
  condition: selection
falsepositives:
  - Unknown
level: low
license: DRL-1.1
related:
  - id: b366adb4-d63d-422d-8a2c-186463b5ded0
    type: derived

What it detects

This rule flags execution of PowerShell code that calls Get-NetTCPConnection. Attackers can use this command to enumerate active TCP connections on a host, which supports discovery of communication endpoints and current network activity. The detection relies on PowerShell classic script telemetry capturing the command string containing Get-NetTCPConnection.

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.