PrivEsc - SeBackupPrivilege
Last updated
Was this helpful?
Last updated
Was this helpful?
ref:
In case of non DC machine, it would be much easier for us to grab the admin hash bythe following method
<aside> ⚠️ This will not work in DC machine because. In the case of a DC, the privilege only allows you to make backups not copies. In a standalone system, we can make copies of the files
</aside>
Unlike the standalone exploitation, in the Domain Controller, we need the ntds.dit file to extract the hashes along with the system hive.
The problem with the ntds.dit file is that dc controller is actively using this file, so if it’s in use, it’s not possible to make a copy of that file using conventional method. We need to be more creative.
To circumvent this problem, we need to use diskshadow functionality. This is a built-in function of Windows that can help us create a copy of a drive that is currently in use.
There are methods to use the diskshadow which include providing instructions in a diskshadow shell but that tends to be a bit tricky. Hence, we will be creating a Distributed Shell File or a dsh file which will consist of all the commands that are required by the diskshadow to run and create a full copy of our Windows Drive which we then can use to extract the ntds.dit file from.
We move to our Kali Linux shell and create a dsh file using the editor of your preference. In this file, we are instructing the diskshadow to create a copy of the C:
Drive into a Z Drive with raj as its alias. The Drive Alias and Character can be anything you want. After creating this dsh file, we need to use the unix2dos to convert the encoding and spacing of the dsh file to the one that is compatible with the Windows Machine…
we use the diskshadow with dsh script as shown in the image below
If observed, it can be noticed that diskshadow is indeed executing the same commands that we entered in the dsh file sequentially.
After running, as discussed, it will create a copy of the C drive into Z drive. Now, we can use the RoboCopy tool to copy the file from the Z Drive to the Temp Directory.
Now we finally download the file to our system and use impacket-secretsdump
to extrack the ntml hashes