heroui logo

Persistence via PowerShell profile

Elastic Detection Rules

View Source
Summary
This detection rule identifies the creation or modification of a PowerShell profile, which is a script that gets executed whenever PowerShell starts. Attackers often abuse PowerShell profiles for persistence, allowing malicious code to run every time PowerShell is launched. The rule monitors file events to detect changes in specific profile-related paths, like `profile.ps1` and `Microsoft.Powershell_profile.ps1`. When such changes are detected, it may indicate potential malicious activity and should prompt further investigation. Analysts are advised to scrutinize the PowerShell profile content for suspicious activities, such as unusual function calls or commands, and to track the process responsible for the modification. If malicious activities are confirmed, it is essential to enact incident response measures, including isolating affected hosts, removing threats, and updating controls to mitigate similar risks in the future.
Categories
  • Endpoint
  • Windows
Data Sources
  • File
  • Process
  • Application Log
ATT&CK Techniques
  • T1546
  • T1546.013
Created: 2022-10-13