
Windows Active Directoryの一般的な列挙および攻撃方法を含むチートシート
このチートシートには、Windows Active Directory の一般的な列挙と攻撃手法が含まれています。
ℹ️ このリポジトリは Nikos Katsiopis と Nikos Vourdas によって作成されました。
このチートシートは、PayloadAllTheThings リポジトリからインスピレーションを得ています。

Get-DomainPolicy
#Will show us the policy configurations of the Domain about system access or kerberos Get-DomainPolicy | Select-Object -ExpandProperty SystemAccess Get-DomainPolicy | Select-Object -ExpandProperty KerberosPolicy
- **ドメインコントローラの取得:** ```powershell
Get-DomainController
Get-DomainController -Domain <DomainName>
ドメインユーザーの列挙: ```powershell #Save all Domain Users to a file Get-DomainUser | Out-File -FilePath .\DomainUsers.txt
#Will return specific properties of a specific user Get-DomainUser -Identity [username] -Properties DisplayName, MemberOf | Format-List
#Enumerate user logged on a machine Get-NetLoggedon -ComputerName
#Enumerate Session Information for a machine Get-NetSession -ComputerName
#Enumerate domain machines of the current/specified domain where specific users are logged into Find-DomainUserLocation -Domain | Select-Object UserName, SessionFromName
ドメインコンピュータの列挙: ```powershell Get-DomainComputer -Properties OperatingSystem, Name, DnsHostName | Sort-Object -Property DnsHostName
#Enumerate Live machines Get-DomainComputer -Ping -Properties OperatingSystem, Name, DnsHostName | Sort-Object -Property DnsHostName
グループとグループメンバーの列挙: ```powershell #Save all Domain Groups to a file: Get-DomainGroup | Out-File -FilePath .\DomainGroup.txt
#Return members of Specific Group (eg. Domain Admins & Enterprise Admins) Get-DomainGroup -Identity '' | Select-Object -ExpandProperty Member Get-DomainGroupMember -Identity '' | Select-Object MemberDistinguishedName
#Enumerate the local groups on the local (or remote) machine. Requires local admin rights on the remote machine Get-NetLocalGroup | Select-Object GroupName
#Enumerates members of a specific local group on the local (or remote) machine. Also requires local admin rights on the remote machine Get-NetLocalGroupMember -GroupName Administrators | Select-Object MemberName, IsGroup, IsDomain
#Return all GPOs in a domain that modify local group memberships through Restricted Groups or Group Policy Preferences Get-DomainGPOLocalGroup | Select-Object GPODisplayName, GroupName
共有の列挙: ```powershell #Enumerate Domain Shares Find-DomainShare
#Enumerate Domain Shares the current user has access Find-DomainShare -CheckShareAccess
#Enumerate "Interesting" Files on accessible shares Find-InterestingDomainShareFile -Include passwords
グループポリシーの列挙: ```powershell Get-DomainGPO -Properties DisplayName | Sort-Object -Property DisplayName
#Enumerate all GPOs to a specific computer Get-DomainGPO -ComputerIdentity -Properties DisplayName | Sort-Object -Property DisplayName
#Get users that are part of a Machine's local Admin group Get-DomainGPOComputerLocalGroupMapping -ComputerName
OUを列挙: ```powershell Get-DomainOU -Properties Name | Sort-Object -Property Name
ACLの列挙: ```powershell
Get-DomainObjectAcl -Identity -ResolveGUIDs
#Search for interesting ACEs Find-InterestingDomainAcl -ResolveGUIDs
#Check the ACLs associated with a specified path (e.g smb share) Get-PathAcl -Path "\Path\Of\A\Share"
ドメイン信頼の列挙: ```powershell Get-DomainTrust Get-DomainTrust -Domain
#Enumerate all trusts for the current domain and then enumerates all trusts for each domain it finds Get-DomainTrustMapping
フォレスト信頼の列挙: ```powershell Get-ForestDomain Get-ForestDomain -Forest
#Map the Trust of the Forest Get-ForestTrust Get-ForestTrust -Forest
ユーザーハンティング: ```powershell #Finds all machines on the current domain where the current user has local admin access Find-LocalAdminAccess -Verbose
#Find local admins on all machines of the domain Find-DomainLocalGroupMember -Verbose
#Find computers were a Domain Admin OR a specified user has a session Find-DomainUserLocation | Select-Object UserName, SessionFromName
#Confirming admin access Test-AdminAccess
❗ ユーザーハンティングによるドメイン管理者への権限昇格:
マシンに対してローカル管理者権限を持っている -> そのマシンにドメイン管理者のセッションがある -> トークンを奪い、なりすます -> Profit!
Get-ADDomainGet-ADDomain -Identity <Domain>Get-DomainSID