six degrees of domain admin - def con con 24/def con 24... · bsidesde, black hat arsenal •...

37
Six Degrees of Domain Admin Using Graph Theory to Accelerate Red Team Operations DEF CON 24 – Las Vegas, NV 2016 Andy Robbins - @_wald0 Rohan Vazarkar - @CptJesus Will Schroeder - @harmj0y

Upload: others

Post on 26-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

SixDegreesofDomainAdminUsingGraphTheorytoAccelerateRedTeamOperations

DEFCON24– LasVegas,NV2016

AndyRobbins- @_wald0 RohanVazarkar - @CptJesus WillSchroeder- @harmj0y

Page 2: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

AboutUs– AndyRobbins

• OffensiveNetworkServicesTeamLeadatVerisGroup’sAdaptiveThreatDivision• Redteamandpenetrationtestlead• Performedhundredsofnetworkpenetrationtests• WithBrandonHenry,identifiedcriticalvulnerabilityinACHfileprocessingprocedures

Page 3: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

AboutUs– RohanVazarkar

• PenetrationtesteratVerisGroup’sAdaptiveThreatDivision• Co-authorandmajorcontributortomanyprojects,includingEyeWitness andPythonEmpire• Presenter:BSidesDC,BSidesLV,BSidesDE,BlackHatArsenal• Trainer:BlackHatUSA2016

Page 4: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

AboutUs– WillSchroeder

• ResearcheratVerisGroup’sAdaptiveThreatDivision• Co-founderoftheVeil-Framework,PowerView,PowerUp,Empire/EmPyre• ActivePowerSploit devleoper• MicrosoftPowerShell/CDMMVP• SpeakerandvariousconsandBlackHat trainer

Page 5: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

“Defendersthinkinlists.Attackersthinkingraphs.Aslongasthisistrue,attackerswin.”- JohnLambert,GeneralManager,MicrosoftThreatIntelligenceCenter

Page 6: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

Agenda

• TheCurrentStateofADDomainPrivilegeEscalation• TheConceptof“DerivativeLocalAdmin”• ACrashCourseinGraphTheory• StealthyDataCollectionwithPowerView• TheReleaseofBloodHound• ClosingRemarksandFuturePlans

Page 7: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

PriorWork

• ”DerivativeLocalAdmin”byJustinWarner(@sixdub)-http://www.sixdub.net/?p=591• ActiveDirectoryControlPathsbyEmmanuelGrasandLucasBouillot -https://github.com/ANSSI-FR/AD-control-paths• OneofthebestADSecurityresources- https://adsecurity.org/

Page 8: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

TheCurrentStateofActiveDirectoryDomainPrivilegeEscalation

Page 9: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

CurrentStateofADDomainPriv Esc

• ActiveDirectoryisubiquitous.• LOTSofsecurityresearchdevotedtoActiveDirectory• Sometimeswegeteasybuttons!J• Easybuttonshaveatendencytodisappear.• Thebesttradecraftincludes,butdoesnotrelyoneasybuttons

Page 10: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

ATaleofTwoNetworks

Page 11: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

ATaleofTwoNetworks

Page 12: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

TheConceptof“DerivativeLocalAdmin”

Page 13: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

DerivativeLocalAdmin

• Thechainingorlinkingofadministratorrightsthroughcompromisingotherprivilegedaccounts• Alsoreferredtoasa“Snowballattack”byMicrosoftResearchasearlyas2009• “DerivativeLocalAdmin”firstcoinedinthisblogpost:sixdub.net/asdf

Steve Bob Mary

Page 14: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

DerivativeLocalAdmin

• Thisoftenoccursduetorunawaynestedgroups,makingitdifficulttodeterminewhotheeffectiveadminsareonagivensystem.

Steve MaryGroup1 Group2

Page 15: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

DerivativeLocalAdmin– ForwardEscalation

Steve Mary

Bob

Susan

Jeff

Page 16: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

DerivativeLocalAdmin– ReverseAnalysis

Steve Mary

Bob

Dave

Sarah

Page 17: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

DerivativeLocalAdmin– TheCombinatorialExplosion

Steve Mary

Chris

Susan

Clara

Rita

Clark

John

David

Jason

Jen

Cliff

Diane

Jose

Bob

Susan

Jeff

Page 18: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

Challengeswiththisapproach

• Doesn’tscale• Extremelytimeconsumingandtedious• Maynotidentifytheshortest(andcertainlynotall)pathpossible• DomainAdminmightnotbenecessary• Limitedsituationalawareness

Page 19: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

ACrashCourseinGraphTheory

Page 20: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

GraphTheoryCrashCourse

• Graphsarecomprisedofvertices(ornodes)andedges(orrelationships).• Verticesthatshareanedgearesaidtobe“adjacent”• Edgescanbedirected(or“one-way”)orundirected(or“bidirectional”)• Apathisasetofverticesandedgeslinkingonevertextoanother,whetherthoseverticesareadjacentornot

Page 21: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

GraphTheoryCrashCourse

Vertex1 Vertex2Edge

Page 22: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

GraphTheoryCrashCourse

Vertex1 Vertex4

Vertex2

Vertex3

Page 23: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

BloodHound GraphDesign

Page 24: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

StealthyDataCollectionwithPowerView

Page 25: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

Thanks?

•“ThebesttoolthesedaysforunderstandingwindowsnetworksisPowerview [1].”

-PhineasFisherhttp://pastebin.com/raw/0SNSvyjJ

Page 26: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

PowerView

•ApurePowerShellv2.0domain/networksituationalawarenesstool• Fullyself-containedandloadableinmemory• NowpartofPowerSploit™(notreallytrademarked)

•Builttoautomatelargecomponentsofthetradecraftonourredteamengagements

•CollectsthedatathatBloodHound isbuilton

Page 27: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

Who’sLoggedInWhere?

•Wedeemthis“userhunting”

• Invoke-UserHunter isbuilton:• Get-NetSession – whohassessionswitharemotemachine• Get-NetLoggedOn – who’sloggedinonwhatmachine• Get-LoggedOnLocal – who’sloggedinonamachine(withremoteregistry)

• “Stealth”approach:• Enumeratecommonlytraffickedservers(i.e.fileservers)andremotesessioninformationforeach

Page 28: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

WhoCanAdminWhat?

•DidyouknowthatWindowsallowsanydomain-authenticatedusertoenumeratethemembersofalocal grouponaremote machine?• EitherthroughtheNetLocalGroupGetMembers()Win32APIcallortheWinNTserviceprovider

•PowerView:• Get-NetLocalGroup –ComputerName IP[-API]

Page 29: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

WhoCanAdminWhat(GPOEdition)?

• Let’scorrelatewhatGPOssetthelocaladministratorsgroupwithwithOUs/sitstheseGPOsareappliedto• LetsusdeterminewhohasadminrightswherebasedonGPOsettings• Thisisn’tasupersimpleprocess…

• PowerView’s Find-GPOLocationwillenumeratethisforaspecifictargetordumpallrelationshipsbydefault

Page 30: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

Who’sinWhatGroups?

• Nottoocrazy,justenumerateallgroupsandallmembersofeachgroupthroughLDAP/ADSIsearches

• Get-NetGroup |Get-NetGroupMember

• That’sit!

Page 31: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

BringingitAllTogether

• TheBloodHound ingestor isacustomizedversionofPowerViewwiththefollowingtwofunctionsadded:• Export-BloodHoundData – exportsPowerViewdataobjectstotheBloodHoundNeo4jbatchRESTful API• Get-BloodHoundData – automatesthedataingestionandpipesresultstoExport-BloodHoundData

•WehaveaPowerShellv2.0ingestiontoolthat:• Doesn’tneedadministratorrightstopulllotsofdata• DirectlyingestsdataintoBloodHound

Page 32: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

TheReleaseofBloodHound

Page 33: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

TheReleaseofBloodHound

• Easy-to-use,intuitivewebinterfaceforinteractingwithagraphdatabase• BuiltwithLinkurious.js• LotsoffuncapabilitiesthatRohanwilldemorightnow

Page 34: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

ClosingRemarksandFuturePlans

Page 35: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

FuturePlans

• IncreasethescopeofelementsmodeledintheBloodHound graph,includingADobjectACLs,GPOs,andmore• ContinuedresearchontheapplicationsofgraphtheorytoActiveDirectorysecurity• Defense-centriccapability• Continuingmaturationofdatacollection,ingestion,andanalysismethods

Page 36: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

ClosingRemarks

• Asdefensiveposturesimprove,attackpathswillincreasinglyrelyonenvironmentalmisconfigurations,andpoorimplementationsofleastprivilegeandadministratoraccounthygiene• Graphtheoryenablesrapidattackpathanalysis• BloodHound isafreeandopensourceActiveDirectorydomainprivilegeescalationcapabilitywhichutilizesgraphtheory

Page 37: Six Degrees of Domain Admin - DEF CON CON 24/DEF CON 24... · BSidesDE, Black Hat Arsenal • Trainer: Black Hat USA 2016. About Us – Will Schroeder • Researcher at Veris Group’s

GoGetBloodHound!

• https://www.github.com/adaptivethreat/bloodhound

• ContactUs:• AndyRobbins-- @_wald0• RohanVazarkar -- @CptJesus• WillSchroeder-- @harmj0y