Suspicious TCP Tunnel Through PowerShell Script (via ps_script)

This rule detects powershell scripts that generates sockets/listeners which could be indicative of tunneling behavior

SigmamediumWindowsv1
sigma
title: Suspicious TCP Tunnel Through PowerShell Script (via ps_script)
id: 40a4fa44-55aa-5d3e-b244-87ea066c8655
status: stable
description: This rule detects powershell scripts that generates sockets/listeners which could be indicative of tunneling behavior
references:
    - https://attack.mitre.org/techniques/T1090/
    - https://github.com/Arno0x/PowerShellScripts/blob/a6b7d5490fbf0b20f91195838f3a11156724b4f7/proxyTunnel.ps1
author: Huntrule Team
date: 2026-03-08
tags:
    - attack.command-and-control
    - attack.t1090
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - '[System.Net.HttpWebRequest]'
            - 'System.Net.Sockets.TcpListener'
            - 'AcceptTcpClient'
    condition: selection
falsepositives:
    - Unknown
level: medium

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.