Try it using Invoke-Atomic

Boot or Logon Autostart Execution

Description from ATT&CK

Adversaries may configure system settings to automatically execute a program during system boot or logon to maintain persistence or gain higher-level privileges on compromised systems. Operating systems may have mechanisms for automatically running a program on system boot or account logon.(Citation: Microsoft Run Key)(Citation: MSDN Authentication Packages)(Citation: Microsoft TimeProvider)(Citation: Cylance Reg Persistence Sept 2013)(Citation: Linux Kernel Programming) These mechanisms may include automatically executing programs that are placed in specially designated directories or are referenced by repositories that store configuration information, such as the Windows Registry. An adversary may achieve the same goal by modifying or extending features of the kernel.

Since some boot or logon autostart programs run with higher privileges, an adversary may leverage these to elevate privileges.

Atomic Tests

Atomic Test #1 - Add a driver

Install a driver via pnputil.exe lolbin

Supported Platforms: windows

auto_generated_guid: cb01b3da-b0e7-4e24-bf6d-de5223526785

Inputs:

Name Description Type Default Value
driver_inf A built-in, already installed windows driver inf Path C:\Windows\INF\usbstor.inf

Attack Commands: Run with command_prompt!

1
2
pnputil.exe /add-driver "#{driver_inf}"

source