Windows PowerShell: Query TCP connections with Get-NetTCPConnection
Detects PowerShell usage of Get-NetTCPConnection to enumerate TCP network connections.
- Product
- windows
- Category
- ps_classic_start
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2021-12-10
- Updated
- 2026-07-31
ATT&CK techniques
DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule matches PowerShell Classic command/script content containing Get-NetTCPConnection, which lists TCP network connections on the local or remote context available to the process. Adversaries can use this to enumerate active connections during discovery and understand network activity for further targeting. Telemetry relied on is Windows PowerShell Classic script or command text where the string Get-NetTCPConnection appears.
Reporting behind it
- github.comhttps://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1049/T1049.md#atomic-test-2---system-network-connections-discovery-with-powershell
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_classic/posh_pc_susp_get_nettcpconnection.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows PowerShell: Query TCP connections with Get-NetTCPConnection"
id: 85033d6d-9ef9-409c-8953-e3f5dbf24907
status: test
description: This rule matches PowerShell Classic command/script content containing Get-NetTCPConnection, which lists TCP network connections on the local or remote context available to the process. Adversaries can use this to enumerate active connections during discovery and understand network activity for further targeting. Telemetry relied on is Windows PowerShell Classic script or command text where the string Get-NetTCPConnection appears.
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