Skip to main content

Overview

Windows services can be configured with recovery actions that execute when the service fails. If you can modify a service’s recovery settings, you can make it run arbitrary commands as SYSTEM on failure.

Check Current Recovery Config

Recovery Action Types


Exploit — Set Recovery to Run Command

Requirements

  • SERVICE_CHANGE_CONFIG permission on the service
  • Or membership in a group that can manage the service

Check Permissions

Set Malicious Recovery Action

Trigger Failure

Stop the service (causes failure on restart attempt):
Or kill the process:

Add Admin User on Failure


SUID Bash on Failure


PowerShell — Modify Recovery


Find Services with Existing Recovery Commands

If existing recovery command points to writable binary → replace it.

Quick Reference