Windows Group Privileges
Last updated
Last updated
Membership of this group grants its members the SeBackup and SeRestore privileges. The SeBackupPrivilege allows us to traverse any folder and list the folder contents.
Importing Libraries
We can use this to exploit the SeBackupPrivilege, and copy this file. First, let's import the libraries in a PowerShell session.
Verifying SeBackupPrivilege is Enabled
Copying a Protected File
Members of this group can read event logs from local machine
Searching the Security event log with Get-WInEvent requires administrator access or permissions adjusted on the registry key HKLM\System\CurrentControlSet\Services\Eventlog\Security. Membership in just the Event Log Readers group is not sufficient.
For Get-WinEvent, the syntax is as follows. In this example, we filter for process creation events (4688), which contain /user in the process command line.
Members of the DnsAdmins group have access to DNS information on the network. The DNS service runs as NT AUTHORITY\SYSTEM, so membership in this group could potentially be leveraged to escalate privileges on a Domain Controller or in a situation where a separate server is acting as the DNS server for the domain.
In the attacker machine we can generate a malicious DLL to add a user to the domain admins group using msfvenom.
Another way to abuse DnsAdmins group privileges is by creating a WPAD record. Membership in this group gives us the rights to disable global query block security, which by default blocks this attack.
After disabling the global query block list and creating a WPAD record, every machine running WPAD with default settings will have its traffic proxied through our attack machine. We could use a tool such as Responder or Inveigh to perform traffic spoofing, and attempt to capture password hashes and crack them offline or perform an SMBRelay attack.
To set up this attack, we first disabled the global query block list using PowerShell.
Next, we add a WPAD record pointing to our attack machine.
The Server Operators group allows members to administer Windows servers without needing assignment of Domain Admin privileges. Membership of this group confers the powerful SeBackupPrivilege and SeRestorePrivilege privileges and the ability to control local services.
Querying the Service
Find the services running as SYSTEM
First of all, we have to confirm if the service starts as SYSTEM, for it we can use sc.exe utility.
If we have SERVICE_ALL_ACCESS access right, which gives us full control over this service.
Modifying the Service Binary Path
Let's change the binary path to execute a command which adds our current user to the default local administrators group.
And finally start the service
The Print Operators group is a highly privileged group in Windows that grants its members several significant permissions, including:
SeLoadDriverPrivilege: Allows members to load and manage system drivers.
The ability to manage, create, share, and delete printers connected to a Domain Controller.
The ability to log on locally to a Domain Controller and shut it down.
Given these privileges, members of this group can load system drivers, enabling them to exploit the system further.
The Capcom.sys driver is a well-known driver that allows users to execute shell code with system privileges. This driver can be particularly useful for escalating privileges in a Windows environment.
Download the Capcom.sys Driver
The Capcom.sys driver can be downloaded from the following GitHub repository:
Additionally, you can find useful tools such as LoadDriver.ex and ExploitCapcom.exe in the following repository:
Create a Malicious Executable:
Using msfvenom, create a malicious executable (e.g., rev.exe) that will provide a reverse shell when executed. This executable will be run with elevated privileges after loading the Capcom.sys driver.
Load the Capcom.sys Driver:
Use the LoadDriver.exe tool to load the Capcom.sys driver. The command syntax is as follows:
Upon successful execution, this command should return NTSTATUS: 00000000, WinError: 0
. If it does not, check the location of Capcom.sys or ensure that you are executing LoadDriver.exe from the correct directory.
Execute the Malicious Executable:
After successfully loading the driver, use ExploitCapcom.exe to execute your malicious executable with elevated privileges:
This command runs the rev.exe file with system privileges, providing the attacker with a reverse shell.
We can use the service viewer/controller , which is part of the Sysinternals suite, to check permissions on the service