Rapid7’s 2026 Global Cybersecurity Summit is now available on-demand.Watch sessions.
Rapid7

module

Windows Persistence via UserInitMprLogonScript

Disclosed
Jul 1, 2015
Created
Apr 2, 2026

Description

This module establishes persistence by setting the UserInitMprLogonScript
value in HKCU\Environment. During user logon, userinit.exe checks this value
and executes the specified command or binary.

The module writes a payload executable to disk and points
UserInitMprLogonScript to that payload.

Author

Nayera

Platform

Windows

Architectures

x64, x86, aarch64

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/userinit_mpr_logon_script
msf exploit(userinit_mpr_logon_script) > show targets
...targets...
msf exploit(userinit_mpr_logon_script) > set TARGET < target-id >
msf exploit(userinit_mpr_logon_script) > show options
...show and set options...
msf exploit(userinit_mpr_logon_script) > 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.