Suspicious TCP Tunnel Via PowerShell Script


Description

Detects powershell scripts that creates sockets/listeners which could be indicative of tunneling activity

Query · sigma

selection:
  ScriptBlockText|contains|all:
  - '[System.Net.HttpWebRequest]'
  - System.Net.Sockets.TcpListener
  - AcceptTcpClient
condition: selection

Known false positives

  • Unknown
Raw source Suspicious TCP Tunnel Via PowerShell Script · Sigma
Esc
Published by SigmaHQ/sigma ↗, licensed under Detection Rule License 1.1 ↗. Reproduced here unmodified.
title: Suspicious TCP Tunnel Via PowerShell Script
id: bd33d2aa-497e-4651-9893-5c5364646595
status: test
description: Detects powershell scripts that creates sockets/listeners which could be indicative of tunneling activity
references:
    - https://github.com/Arno0x/PowerShellScripts/blob/a6b7d5490fbf0b20f91195838f3a11156724b4f7/proxyTunnel.ps1
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-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

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.