Setting Up Users, Groups, and Policies
This is a summary of the tasks in this post:
- Tidy up Active Directory Users and Computers
- Add a Domain Administrator Account
- Create A Service Account That Is Also A Domain Administrator
- Create Two Low Level Domain Users
- Create a Fileshare (to be abused later)
- Setup the Service Principle Name (SPN) [SQLService] (Kerberoasting)
- Add a Group Policy Object to Disable Protections on Client Machines
NOTE: Additional Users and Network settings will take place AFTER the client machines have been added to the Domain. These steps will be summarized in the next Section (07H).
Tidy up Active Directory Users and Computers
Shutdown the Windows 10 client machines and boot up the Domain Controller
- Server Manager will start
- Go to: Tools > Active Directory Users and Computers
If you drill down MARVEL.local you will see a number of Organizational Units (OUs). Click on Users; the only real user is the Administrator account we added. However, you can see other interesting accounts such as Domain Administrator and Enterprise Administrator. These are the types of accounts we will want to compromise.
This looks very messy - so let’s create a new OU, called Groups, and move EVERYTHING except Administrator and Guest to Groups.
- Right-Click MARVEL.local > New > Organizational Unit
Shift-Select the accounts and move to Groups.
- You will see a warning
- Enable “Don’t show this warning” and click Yes.
Now this much tidier.
- By the way, the little logo in Guest means the account is not active.
Add a Domain Administrator Account
By the way, double-click the Administrator account and you can see the data associated with the account including “Member Of".
Right-Click Administrator > Copy
Set a password. Enable “Password never expires”, a big no no. For this lab, we used Password12345!
Create A Service Account That Is Also A Domain Administrator
Let’s create another account - another big no no - which is a service account that is a domain administrator.
- This will be used for our SQL server.
- Right-Click Administrator > Copy
For this account, use: MYpassword123#
- Why this password? It meets the requirements for most password rules ie. 14 characters, includes letters, a capital, numbers and a special character. But it is a very weak and crackable passwords. DO NOT use dictionary words.
- For this account, double click the account, and in the Description type: The password is MYpassword123#
- This is a BAD idea. Many administrators will do this not realizing any valid user can view these details.
Create Two Low Level Domain Users
Let’s create two additional low level users, as part of the domain users group.
-
Right-Click (white space) > New > User
-
Password: Password1
-
Be sure to disable “User must change password”, and enable “Password never expires”. This sounds terrible; however, it is a common practice amongst domain administrators.
-
NOTE: User “fcastle” is a Domain user, whereas “frankcastle” is a Local user
Right-Click Frank Castle > Copy
Use Password: Password2
This is the desired state:
Create a Fileshare (to be abused later)
This will open up SMB ports, which will increase the potential attack surface. Most Domain Controllers have a fileshare or SMB open.
-
Launch Server Manager, and click File and Storage Services
-
Click Shares
-
This will open another pane, and click TASKS > New Share…
-
Choose SMB Share - Quick
-
Next > Next > Share name: hackme
-
Notice it will also create a remote path to share as well.
-
Next (Allow share caching) > Next (Permissions) > Create
Setup the Service Principle Name (SPN) [SQLService]
This will provide a target for Kerberoasting to facilitate MYSQL attacks, associated with the SQL service.
- Search “cmd” > Run as Administrator
- Run this command:
setspn -a HYDRA-DC/SQLService.MARVEL.local:60111 MARVEL\SQLService
We should see “Updated object”. But we can also query the SPN too:
setspn -T MARVEL.local -Q */*
Add a Group Policy Object to Disable Protections on Client Machines
This policy will apply to the ENTIRE domain.
- Open the Start Menu and search for Group Policy
Expand your forest until you see your domain.
- Right-Click your domain, and create a new GPO.
- Although we could create a GPO for a particular group, we want to apply this to the entire domain.
Call it: Disable Windows Defender.
- If you click on it, Hit “OK” for the pop-up.
Right-Click on your new group policy object and click Edit
- Expand down into Computer Configuration > Policies > Administrative Templates > Windows Components
Scroll down to find Microsoft Defender Antivirus.
- In older versions of Windows Server, this was located in Windows Defender Antivirus.
- Double-Click “Turn off Microsoft Defender Antivirus”
Set it to Enabled > Apply > OK
Right-Click Disable Windows Defender > Enforced
You can see the GPO is now enforced:
Do not shut down the Domain Controller. The next step is to join the machines to the Domain.