Rapid7

module

Powershell Profile Persistence

Disclosed
Nov 5, 2019
Created
Apr 15, 2026

Description

This module establishes persistence by modifying a PowerShell profile script, which is automatically
executed when PowerShell starts. The module supports multiple profile scopes (current user or all users)
and safely backs up any existing profile prior to modification, enabling clean removal by restoring the original file.

Author

madefourit

Platform

Windows

Architectures

x64, x86

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':


msf > use exploit/windows/persistence/powershell_profile
msf exploit(powershell_profile) > show targets
...targets...
msf exploit(powershell_profile) > set TARGET < target-id >
msf exploit(powershell_profile) > show options
...show and set options...
msf exploit(powershell_profile) > exploit

Title
Rapid7 Labs

2026 Global Threat Landscape Report

The predictive window has collapsed. Exploitation follows disclosure in days. See how attackers are accelerating and how to stay ahead.