【AIS3】深入淺出網域(AD)安全:細探各項AD組態設定的濫用
深入淺出網域(AD)安全:細探各項AD組態設定的濫用
-TXOne Networks Inc. Threat Researcher Dexter Chen
教材
- Windows Server 2019
- Windows 10
- Kali Linux
Active Directory
- Windows Domain Service
- LDAP(Lightweight Directory Access Protocol) + Kerberos(MS ver.) + DNS
- SSO Services (Base on Kerberos)
AD Overview
- Active Directory (AD) - Directory Service
- Domain Controller (DC)
- 某台存著 AD 資料庫、管理網域中 AD Object 的電腦,提供驗證服務
- Domain Directory 存在 DC
- 一個網域可以有多個 DC
- Object
- Attribute
- Forest
LDAP Overview
- LDAP Path
- DN(Distinguished Name)
- RDN(Relative Distinguished Name)
- CN(Common Name)
- OU(Organizational Unit Name)
- DC(Domain Component)
- O(Organizational Unit)
User, Computer, and Group
- Account
- User Account
- Person or service account
- Computer Account
- User Account
- Group
- Active Directory objects that contain users, contacts, computers, and other groups
- Group Policy 作用於 User, Computer Accounts
Security Identifier (SID)
- 識別唯一安全原則或安全群組
- 可以代表 User, Group, Computer
Active Directory Database
- AD DS database (NTDS.DIT)
- 每個 DC 都有一個 NTDS.DIT
GPO
- Virtual collection of policy settings
- 政策設定影響 User, Computer
- SYSVOL folder
- \\\domainname.local\SYSVOL
- \\\dc.local\sysvol\\\DC_FQDN\\\
Lab01
- Windows Server 2019
build AD DC Script
|
|
AD config script
|
|
PC domain join script
|
|
Lab02
Recon
- 有個帳號叫 Anonymous,可能有 read permission
- tools
- nmap LDAP script(kali)
- Idapsearch(kali)
- What can we get
- 1-day 或已知的漏洞
- domain machine 資訊
- domain 群組與使用者資訊
- 如果幸運的話會有敏感資訊
設定 Anonymous
Windows Administrative Tools -> ADSI Edit -> Right Click -> Connection -> Add Configuration
ADSI Edit -> Configuration -> CN=Services -> CN=Windows NT -> CN=Directory -> CN=Anonymous Logon -> Right Click -> Properties -> Set Attribute -> dSHeuristics -> set to 0000002
Windows Administrative Tools -> Active Directory Users and Computers -> enable Advanced Features
training_a.local right click -> Properties -> Security -> Add -> Enter anonymous -> OK
training_a.local right click -> Properties -> Security -> Advanced -> ANONYMOUS LOGON -> Edit -> Applies to “This object and all descendant objects” -> OK