Windows File Changes to Microsoft.VSCode_profile.ps1 via PowerShell Profile

Detects creation or modification of Microsoft.VSCode_profile.ps1 based on Windows file events.

FreeReviewedSigma · Medium · v2
Product
windows
Category
file_event
Author
Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2022-08-24
Updated
2026-07-31
title: Windows File Changes to Microsoft.VSCode_profile.ps1 via PowerShell Profile
id: 9f069b91-da06-47d2-9317-28ab928e909f
related:
  - id: b5b78988-486d-4a80-b991-930eff3ff8bf
    type: similar
  - id: 3a9fa2ec-30bc-4ebd-b49e-7c9cff225502
    type: derived
status: test
description: Identifies creation or modification of the VSCode PowerShell profile file named Microsoft.VSCode_profile.ps1 on Windows. Attackers can use PowerShell profiles to execute commands automatically in interactive sessions, enabling persistence or follow-on actions. The rule relies on Windows file event telemetry that records changes to the target filename ending with \Microsoft.VSCode_profile.ps1.
references:
  - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_susp_vscode_powershell_profile.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2022-08-24
modified: 2023-01-06
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1546.013
logsource:
  product: windows
  category: file_event
detection:
  selection:
    TargetFilename|endswith: \Microsoft.VSCode_profile.ps1
  condition: selection
falsepositives:
  - Legitimate use of the profile by developers or administrators
level: medium
license: DRL-1.1