heroui logo

User Discovery With Env Vars PowerShell Script Block

Splunk Security Content

View Source
Summary
This rule detects malicious use of PowerShell environment variables, specifically `$env:UserName` and `[System.Environment]::UserName`, to uncover the identity of the currently logged user. This detection relies on PowerShell Script Block Logging (EventCode=4104) and aims to identify activities commonly performed by adversaries or Red Teams during Active Directory reconnaissance and endpoint exploration. When executed, these commands facilitate knowledge gathering about user context, which can be leveraged for further exploitation or lateral movement within the network. The rule monitors script blocks containing the specified phrases, counting occurrences and tracking the first and last time the script was detected. It is crucial for network defenders to monitor such activities to mitigate potential threats arising from user discovery tactics utilized by attackers.
Categories
  • Endpoint
Data Sources
  • Pod
  • Container
  • User Account
  • Windows Registry
  • Script
  • Image
  • Web Credential
  • Named Pipe
  • Certificate
  • WMI
  • Cloud Storage
  • Internet Scan
  • Persona
  • Group
  • Application Log
  • Logon Session
  • Instance
  • Sensor Health
  • File
  • Drive
  • Snapshot
  • Command
  • Kernel
  • Driver
  • Volume
  • Cloud Service
  • Malware Repository
  • Network Share
  • Network Traffic
  • Scheduled Job
  • Firmware
  • Active Directory
  • Service
  • Domain Name
  • Process
  • Firewall
  • Module
  • Pod
  • Container
  • Script
ATT&CK Techniques
  • T1033
Created: 2024-11-13