Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may abuse print processors to run malicious DLLs during system boot for persistence and/or privilege escalation.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-10 | ✓→✗ | ▼ Worse | -39% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 65% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 83% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 142% | 0% |
> Sub-technique of: T1547
Adversaries may abuse print processors to run malicious DLLs during system boot for persistence and/or privilege escalation. Print processors are DLLs that are loaded by the print spooler service, spoolsv.exe, during boot.
Adversaries may abuse the print spooler service by adding print processors that load malicious DLLs at startup. A print processor can be installed through the <code>AddPrintProcessor</code> API call with an account that has <code>SeLoadDriverPrivilege</code> enabled. Alternatively, a print processor can be registered to the print spooler service by adding the <code>HKLM\SYSTEM\\CurrentControlSet or ControlSet001]\Control\Print\Environments\\Windows architecture: e.g., Windows x64]\Print Processors\\user defined]\Driver</code> Registry key that points to the DLL.
For the malicious print processor to be correctly installed, the payload must be located in the dedicated system print-processor directory, that can be found with the <code>GetPrintProcessorDirectory</code> API call, or referenced via a relative path from this directory. After the print processors are installed, the print spooler service, which starts during boot, must be restarted in order for them to run.
The print spooler service runs under SYSTEM level permissions, therefore print processors installed by an adversary may run under elevated privileges.
Platforms: Windows
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Establishes persistence by creating a new print processor registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors. The new print processor will point to a DLL which will be loaded by the spooler service after a reboot. The DLL will then create the file AtomicTest.txt in C:\Users\Public\ as validation that the test is successful.
Note: The test assumes a x64 Windows operating system.
The payload source code is based on a blog post by stmxcsr: https://stmxcsr.com/persistence/print-processor.html
Supported Platforms: windows Elevation Required: Yes
powershellif( $(get-service -Name spooler).StartType -eq "Disabled") {Set-Service -Name "spooler" -StartupType Automatic} net stop spooler Copy-Item "$PathToAtomicsFolder\T1547.012\bin\AtomicTest.dll" C:\Windows\System32\spool\prtprocs\x64\AtomicTest.dll reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors\AtomicRedTeam" /v "Driver" /d "AtomicTest.dll" /t REG_SZ /f net start spooler if(#{restart}){ Restart-Computer }
If Atomic Red Team tests are not applicable, manually verify the technique by:
Limit user accounts that can load or unload device drivers by disabling <code>SeLoadDriverPrivilege</code>.
| Finding | Severity | Impact | | ------------------------------------- | -------- | ----------- | | Print Processors technique applicable | High | Persistence |
| CWE ID | Title | | ------- | ----------------------------- | | CWE-276 | Incorrect Default Permissions |
Other measured skills in the registry, with their headline benchmark lift.