githubEdit

Print Operators

Print Operators is another highly privileged group, which grants its members the SeLoadDriverPrivilege, rights to manage, create, share, and delete printers connected to a Domain Controller, as well as the ability to log on locally to a Domain Controller and shut it down

Checking Privileges

open CMD with Admin Privilege

C:\htb> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                          State
============================= ==================================  ==========
SeMachineAccountPrivilege     Add workstations to domain           Disabled
**SeLoadDriverPrivilege         Load and unload device drivers       Disabled**
SeShutdownPrivilege           Shut down the system			       Disabled
SeChangeNotifyPrivilege       Bypass traverse checking             Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set       Disabled

Download

It's well known that the driver Capcom.sys contains functionality to allow any user to execute shellcode with SYSTEM privileges. We can use our privileges to load this vulnerable driver and escalate privileges. We can use thisarrow-up-right tool to load the driver. https://raw.githubusercontent.com/3gstudent/Homework-of-C-Language/master/EnableSeLoadDriverPrivilege.cpp

Download it locally and edit it, pasting over the includes below.

Compile with cl.exe

Add Reference to Driver

Next, download the Capcom.sys driver from herearrow-up-right, and save it to C:\temp. Issue the commands below to add a reference to this driver under our HKEY_CURRENT_USER tree.

Verify Driver is not Loaded

we can verify that the Capcom.sys driver is not loaded.

Verify Privilege is Enabled

Run the EnableSeLoadDriverPrivilege.exe binary.

Verify Capcom Driver is Listed

Next, verify that the Capcom driver is now listed.

Use ExploitCapcom Tool to Escalate Privileges

This launches a shell with SYSTEM privileges.

image.png


Alternate Exploitation - No GUI

we can edit line 292 and replace "C:\\Windows\\system32\\cmd.exe" with, say, a reverse shell binary created with msfvenom, for example: c:\ProgramData\revshell.exe.

The CommandLine string in this example would be changed to:



Automating the Steps

Automating with EopLoadDriver

We can use a tool such as EoPLoadDriverarrow-up-right to automate the process of enabling the privilege, creating the registry key, and executing NTLoadDriver to load the driver. To do this, we would run the following:


Clean-up

Removing Registry Key