Windows Active Directory

Introduction

Active Directory is a collection of machines and servers connected inside of domains, that are a collective part of a bigger forest of domains, that make up the Active Directory network. Active Directory contains many functioning bits and pieces. Following are various pieces of Active Directory:

  • Domain Controllers

  • Forests, Trees, Domains

  • Users + Groups

  • Trusts

  • Policies

  • Domain Services


Why Use Active Directory

The majority of large companies use Active Directory because it allows for the control and monitoring of their user's computers through a single domain controller. It allows a single user to sign in to any computer on the active directory network and have access to his or her stored files and folders in the server, as well as the local storage on that machine. This allows for any user in the company to use any machine that the company owns, without having to set up multiple users on a machine. Active Directory does it all for you.


Key Terminologies

Domain Controllers

A domain controller is a Windows server that has Active Directory Domain Services (AD DS) installed and has been promoted to a domain controller in the forest. Domain controllers are the center of Active Directory -- they control the rest of the domain. Tasks of a domain controller are:

  • holds the AD DS data store

    • The Active Directory Data Store holds the databases and processes needed to store and manage directory information such as users, groups, and services. Some of the contents and characteristics of the AD DS Data Store are:

      • Contains the NTDS.dit - a database that contains all of the information of an Active Directory domain controller as well as password hashes for domain users

      • Stored by default in %SystemRoot%\NTDS

      • accessible only by the domain controller

  • handles authentication and authorization services

  • replicate updates from other domain controllers in the forest

  • Allows admin access to manage domain resources

The Forest

When we say "forest", it is only a way of describing the connection created between these trees and domains by the network. A forest is a collection of one or more domain trees inside of an Active Directory network. It is what categorizes the parts of the network as a whole. The Forest consists of these parts:

  • Trees - A hierarchy of domains in Active Directory Domain Services

  • Domains - Used to group and manage objects

  • Organizational Units (OUs) - Containers for groups, computers, users, printers and other OUs

  • Trusts - Allows users to access resources in other domains

  • Objects - users, groups, printers, computers, shares

  • Domain Services - DNS Server, LLMNR, IPv6

  • Domain Schema - Rules for object creation

Users + Groups

When you create a domain controller it comes with default groups and two default users: Administrator and guest. It is up to you to create new users and create new groups to add users to.

Users

There are four main types of users you'll find in an Active Directory network; however, there can be more depending on how a company manages the permissions of its users. The four types of users are:

  1. Domain Admins - This is the big boss: they control the domains and are the only ones with access to the domain controller.

  2. Service Accounts (Can be Domain Admins) - These are for the most part never used except for service maintenance, they are required by Windows for services such as SQL to pair a service with a service account

  3. Local Administrators - These users can make changes to local machines as an administrator and may even be able to control other normal users, but they cannot access the domain controller

  4. Domain Users - These are your everyday users. They can log in on the machines they have the authorization to access and may have local administrator rights to machines depending on the organization.

Groups

Groups make it easier to give permissions to users and objects by organizing them into groups with specified permissions. There are two overarching types of Active Directory groups:

  1. Security Groups - These groups are used to specify permissions for a large number of users

  2. Distribution Groups - These groups are used to specify email distribution lists. As an attacker these groups are less beneficial to us but can still be beneficial in enumeration

Trusts + Policies

Trusts and policies go hand in hand to help the domain and trees communicate with each other and maintain "security" inside of the network. They put the rules in place of how the domains inside of a forest can interact with each other, how an external forest can interact with the forest, and the overall domain rules or policies that a domain must follow.

Domain Trusts

Trusts are a mechanism in place for users in the network to gain access to other resources in the domain. For the most part, trusts outline the way that the domains inside of a forest communicate to each other, in some environments trusts can be extended out to external domains and even forests in some cases. There are two types of trusts that determine how the domains communicate:

  1. Directional - The direction of the trust flows from a trusting domain to a trusted domain

  2. Transitive - The trust relationship expands beyond just two domains to include other trusted domains

Domain Policies

Policies are a very big part of Active Directory, they dictate how the server operates and what rules it will and will not follow. You can think of domain policies like domain groups, except instead of permissions they contain rules, and instead of only applying to a group of users, the policies apply to a domain as a whole. Few domain policies are:

  • Disable Windows Defender - Disables windows defender across all machine on the domain

  • Digitally Sign Communication (Always) - Can disable or enable SMB signing on the domain controller

Active Directory Domain Services + Authentication

The Active Directory domain services are the core functions of an Active Directory network; they allow for management of the domain, security certificates, LDAPs, and much more.

Domain Services

They are services that the domain controller provides to the rest of the domain or tree. Outlined below are the default domain services:

  • LDAP - Lightweight Directory Access Protocol; provides communication between applications and directory services

  • Certificate Services - allows the domain controller to create, validate, and revoke public key certificates

  • DNS, LLMNR, NBT-NS - Domain Name Services for identifying IP hostnames

Domain Authentication

The most important part of Active Directory -- as well as the most vulnerable part of Active Directory -- is the authentication protocols set in place. There are two main types of authentication in place for Active Directory: NTLM and Kerberos.


Types of Active Directories

On-Premise Active Directory (AD)

On-premise Active Directory has a record of all users, PCs and Servers and authenticates the users signing in (the network logon). Once signed in, Active Directory also governs what the users are, and are not, allowed to do or access (authorization).

In an on-premise Active Directory environment the authentication can be made by using the following protocols:

1. NTLM / NTLM 2

NTLM uses a challenge-response sequence of messages between a client and a server system. NTLM provides authentication based on a challenge-response authentication scheme. It does not provide data integrity or data confidentiality protection for the authenticated network connection.

2. LDAP / LDAPS

The main difference between LDAP and LDAPS is that LDAPS support encryption and therefore the credentials are not sent in plain text across the network. Another thing to keep in mind is that the Domain Controller (DC) can be considered a database of users, groups, computers and so on (contains information about objects). Using LDAP/LDAPS the user's workstation sends the credentials using an API to the Domain Controller in order to validate them and be able to log in.

3. KERBEROS

Another way to authenticate is using Kerberos. Kerberos uses symmetric-key cryptography and requires trusted third-party authorization to verify user identities. The authentication process is similar to the one below:

Azure Active Directory (AAD)

Azure Active Directory is a secure online authentication store, which can contain users and groups. Users have a username and a password which are used when you sign in to an application that uses Azure Active Directory for authentication. So, for example, all of the Microsoft Cloud services use Azure Active Directory for authentication: Office 365, Dynamics 365 and Azure. Azure Active Directory supports the following authentication methods:

1. SAML (Security Assertion Markup Language)

Security Assertion Markup Language (SAML) is a type of Single Sign-On (SSO) standard. It defines a set of rules/protocols that allow users to access web applications with a single login. This is possible because those applications (referred to as “Service Providers”) all trust the systems that verify users’ identities (referred to as “Identity Providers”).

  • Service Providers - These are the systems and applications that users access throughout the day.

  • Identity Providers - This would be the system that performs user authentication.

2. OAUTH 2.0

OAuth 2.0 is a standard that apps use to provide client applications with access. OAuth 2.0 spec has four important roles:

  1. The authorization server, which is the server that issues the access token.

  2. The resource owner, normally your application's end-user, that grants permission to access the resource server with an access token.

  3. The client, which is the application that requests the access token, and then passes it to the resource server.

  4. The resource server, which accepts the access token and must verify that it is valid. In this case, this is your application.

3. OpenID Connect

OpenID Connect is an authentication standard built on top of OAuth 2.0. It adds an additional token called an ID token. For that, it uses simple JSON Web Tokens (JWT). While OAuth 2.0 is about resource access and sharing, OIDC is all about user authentication


Last updated