Skip to content

Latest commit

 

History

History
214 lines (121 loc) · 6.42 KB

T1482.md

File metadata and controls

214 lines (121 loc) · 6.42 KB

T1482 - Domain Trust Discovery

Adversaries may attempt to gather information on domain trust relationships that may be used to identify lateral movement opportunities in Windows multi-domain/forest environments. Domain trusts provide a mechanism for a domain to allow access to resources based on the authentication procedures of another domain.(Citation: Microsoft Trusts) Domain trusts allow the users of the trusted domain to access resources in the trusting domain. The information discovered may help the adversary conduct [SID-History Injection](https://attack.mitre.org/techniques/T1134/005), [Pass the Ticket](https://attack.mitre.org/techniques/T1550/003), and [Kerberoasting](https://attack.mitre.org/techniques/T1558/003).(Citation: AdSecurity Forging Trust Tickets)(Citation: Harmj0y Domain Trusts) Domain trusts can be enumerated using the `DSEnumerateDomainTrusts()` Win32 API call, .NET methods, and LDAP.(Citation: Harmj0y Domain Trusts) The Windows utility [Nltest](https://attack.mitre.org/software/S0359) is known to be used by adversaries to enumerate domain trusts.(Citation: Microsoft Operation Wilysupply)

Atomic Tests


Atomic Test #1 - Windows - Discover domain trusts with dsquery

Uses the dsquery command to discover domain trusts. Requires the installation of dsquery via Windows RSAT or the Windows Server AD DS role.

Supported Platforms: Windows

Attack Commands: Run with command_prompt!

dsquery * -filter "(objectClass=trustedDomain)" -attr *


Atomic Test #2 - Windows - Discover domain trusts with nltest

Uses the nltest command to discover domain trusts. Requires the installation of nltest via Windows RSAT or the Windows Server AD DS role. This technique has been used by the Trickbot malware family.

Supported Platforms: Windows

Attack Commands: Run with command_prompt!

nltest /domain_trusts

Dependencies: Run with command_prompt!

Description: nltest.exe from RSAT must be present on disk
Check Prereq Commands:
WHERE nltest.exe >NUL 2>&1 
Get Prereq Commands:
echo Sorry RSAT must be installed manually


Atomic Test #3 - Powershell enumerate domains and forests

Use powershell to enumerate AD information. Requires the installation of PowerShell AD admin cmdlets via Windows RSAT or the Windows Server AD DS role.

Supported Platforms: Windows

Attack Commands: Run with powershell!

Import-Module "$env:TEMP\PowerView.ps1"
Get-NetDomainTrust
Get-NetForestTrust
Get-ADDomain
Get-ADGroupMember Administrators -Recursive

Dependencies: Run with powershell!

Description: PowerView PowerShell script must exist on disk
Check Prereq Commands:
if (Test-Path $env:TEMP\PowerView.ps1) {exit 0} else {exit 1} 
Get Prereq Commands:
Invoke-WebRequest "https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/f94a5d298a1b4c5dfb1f30a246d9c73d13b22888/Recon/PowerView.ps1" -OutFile "$env:TEMP\PowerView.ps1"
Description: RSAT PowerShell AD admin cmdlets must be installed
Check Prereq Commands:
if ((Get-Command "Get-ADDomain" -ErrorAction Ignore) -And (Get-Command "Get-ADGroupMember" -ErrorAction Ignore)) { exit 0 } else { exit 1 } 
Get Prereq Commands:
Write-Host "Sorry RSAT must be installed manually"


Atomic Test #4 - Adfind - Enumerate Active Directory OUs

Adfind tool can be used for reconnaissance in an Active directory environment. This example has been documented by ransomware actors enumerating Active Directory OUs reference- http://www.joeware.net/freetools/tools/adfind/, https://www.fireeye.com/blog/threat-research/2019/04/pick-six-intercepting-a-fin6-intrusion.html

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
adfind_path Path to the AdFind executable Path PathToAtomicsFolder\T1087.002\src\AdFind.exe

Attack Commands: Run with command_prompt!

#{adfind_path} -f (objectcategory=organizationalUnit)

Dependencies: Run with powershell!

Description: AdFind.exe must exist on disk at specified location (#{adfind_path})
Check Prereq Commands:
if (Test-Path #{adfind_path}) {exit 0} else {exit 1} 
Get Prereq Commands:
Invoke-WebRequest -Uri "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1087.002/src/AdFind.exe" -OutFile #{adfind_path}


Atomic Test #5 - Adfind - Enumerate Active Directory Trusts

Adfind tool can be used for reconnaissance in an Active directory environment. This example has been documented by ransomware actors enumerating Active Directory Trusts reference- http://www.joeware.net/freetools/tools/adfind/, https://www.fireeye.com/blog/threat-research/2019/04/pick-six-intercepting-a-fin6-intrusion.html

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
adfind_path Path to the AdFind executable Path PathToAtomicsFolder\T1087.002\src\AdFind.exe

Attack Commands: Run with command_prompt!

#{adfind_path} -gcb -sc trustdmp

Dependencies: Run with powershell!

Description: AdFind.exe must exist on disk at specified location (#{adfind_path})
Check Prereq Commands:
if (Test-Path #{adfind_path}) {exit 0} else {exit 1} 
Get Prereq Commands:
Invoke-WebRequest -Uri "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1087.002/src/AdFind.exe" -OutFile #{adfind_path}