SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
SpecterOps Webinar Week
Monday – Hunting from Home
Tuesday – Everything You Always Wanted To Know About BloodHound* (*But were afraid to ask)
Wednesday – Kerberoasting Revisited
Thursday – Capability Abstraction: Dumping LSASS
Friday – Remote Team Project Management and Reporting Construction
Introduction
• Job: Technical Architect at SpecterOps
• Code: Veil-Framework, Empire, PowerView/PowerUp, BloodHound,
GhostPack
• Cons: DerbyCon, BlackHat, DEF CON, Troopers, ShmooCon
• Training: Adversary Tactics: Red Team Operations, Adversary Tactics:
PowerShell (now open source!), veteran BlackHat trainer
-2-
Overview
• Exactly how Kerberoasting works
• msDS-SupportedEncryptionTypes
• Previous Kerberoasting Approaches
• Building a Better Kerberoast With Rubeus
• Defenses (and Kerberoasting OPSEC)
-3-
Kerberoasting: The Beginning
Thanks
@timmeddin!
-4-
-5-
WMI
computer.domain.com
PowerShell
Remoting
File
Share
SQL
HOST/
HTTP/
HOST/
RPCSS/
CIFS/
MSSQLSvc/
dir computer.domain.comC$
1. Here’s my TGT.
I want a service ticket for:
CIFS/computer.domain.com
2. Service ticket
returned:
CIFS/computer.domain.com
3. Use service ticket:
CIFS/computer.domain.com
domain.com
Domain Controller
Attacker
-6-
dir computer.domain.comC$
1. Here’s my TGT.
I want a service ticket for:
CIFS/computer.domain.com
2. Look up which (user or
computer$) account has the
CIFS/computer.domain.com
service principal name
(SPN) registered
3. Encrypt part of the service
ticket with the key of looked-
up account (computer$
here)
4. Target service decrypts
the service ticket w/ shared
computer$ key.
Target service decides
whether to allow access!
computer.domain.com
File
Share
CIFS/
domain.com
Domain Controller
Attacker
Kerberoasting 101:Background
• The target service and the domain controller have to share some key
so the service can decrypt the ticket
• For most service principal names (SPNs) this is the computer$
account key/hash
• Computer accounts (by default) have random passwords that every 30 days
• But if the SPN is registered for a user account, we now have a piece of
data that’s encrypted with their key
• Requesting this and cracking offline == Kerberoasting !
-7-
Kerberoasting 101: Using the Goods
• If a user account has an SPN registered, the user often:
• has admin privileges on the machine specified in the SPN
• and/or is in other privileged domain groups
• Even if they don’t/aren’t, with the key cracked, we can forge service
tickets as ANY user to the specific service principal name
• This is what “silver tickets” are!
-8-
Kerberoasting 101: Why Care
• ANY user can request a service ticket for ANY SPN (by design!)
• This service ticket give us a piece of information encrypted with the
key/hash of the (user) account that backs that SPN
• We only communicate with the DC - no packets are sent to the service
target unless we try to use the requested ticket!
• Translation: if a user has a non-null servicePrincipalName property,
we can crack their password offline (with GPU-accelerated software!)
-9-
Kerberoasting 201: Key Encryption Types
• Service tickets (just like TGTs) generally use either
AES256_CTS_HMAC_SHA1_96 (AES256) or RC4_HMAC_MD5
(RC4/NTLM) keys for ticket encryption
• AES encryption was introduced with domain functional level 2008, but RC4 has
been kept for backwards compatibility reasons
• From an offensive perspective, we really want responses encrypted
with RC4, since it’s orders of magnitude faster to crack than AES
-10-
Sidenote:Kerberoasting Defenses
• Modern (2008+ functional level) Active Directory domains are
supposed to use AES keys by default for Kerberos exchanges
• So requesting a RC4 service ticket should result in “encryption
downgrade activity”
• But built-in request methods for user-backed SPNs nearly always
return RC4-encrypted service tickets 🤔
-11-
Encryption “Downgrade”
-12-
msDS-SupportedEncryptionTypes
• Active Directory user/computer account property touched on by Jim
Shaver and Mitchell Hennigan in their DerbyCon 7.0 “Return From
The Underworld” talk
• According to Microsoft’s [MS-ADA2], “The Key Distribution Center
(KDC) uses this information [msDS-SupportedEncryptionTypes] while
generating a service ticket for this account.”
• Translation: this property (on an account with a non-null SPN)
determines the encryption used for service tickets requested for that
account’s SPN(s)
-13-
msDS-SupportedEncryptionTypes
• According to MS-KILE 3.1.1.5 the default value for this field is 0x1C
(RC4 | AES128 | AES256 = 28) for Windows 7+ and Server 2008R2+
• However, this property is only set by default on computer accounts
(not user or trust accounts!)
• If this property is not defined (or is set to 0) [MS-KILE] 3.3.5.7 says default
behavior is to use a value of 0x7 (RC4)
-14-
However we can set user accounts to
explicitly support AES 128/256
encryption
0x18 (AES128 | AES256 = 24)
-15-
-16-
However…
🤔
So What?
• There doesn’t seem to be an easy way to disable RC4_HMAC service
ticket requests on user accounts, meaning we can’t “stop” RC4
Kerberoasting
• The reason for this behavior is in case accounts were created in a 2003
functional level domain and haven’t had their passwords changed since
• We can disable RC4 for the entire domain, but this also kills RC4 TGTs, which
isn’t feasible for most environments
• However setting AES support for user accounts at least gives us the
“encryption downgrade” detection back
-17-
Kerberoasting Approaches
-18-
External-In
-Need creds (pw/hash) of existing
domain account to first get a TGT so
service tickets can be requested
-More difficult over high latency C2
-But can granularly control all
aspects of the exchange (i.e. RC4)
Domain-Joined Windows Host
-Don’t need credentials, just
execution in a domain user’s context
-Easier over high latency C2
-Built-in request methods don’t let
you control aspects (like encryption
levels) of the exchange
Previous Kerberoasting Approaches (Host)
• The previous domain-joined Kerberoasting methods involve using
setspn.exe or .NET’s KerberosRequestorSecurityToken class to request
a service ticket for a target SPN
• The tickets are then carved out of memory (Mimikatz) or extracted
using the .NET methods (PowerView)
• Unintended downside: this will cache a ticket on the requesting
machine for each SPN we roast! (could be hundreds of tickets…)
-19-
Downsides of Built-in Ticket Request Methods
• .NET/setspn approaches request/cache dozens (or hundreds) of
service tickets on the attacker host
• .NET’s KerberosRequestorSecurityToken method doesn’t let you
specify encryption levels (RC4 vs AES) for ticket requests
• Since we don’t have a proper TGT, we can’t hard specify RC4 like
Impacket/Metasploit
• Normally, the session key for the TGT is not exportable for non-
elevated contexts, so we can’t get a usable TGT for a regular user
• Or can we…
-20-
Obtaining a User’s TGT: The “tgtdeleg” Trick
• @gentilkiwi realized we can request an outgoing service ticket
request for a SPN on an unconstrained delegation server (the domain
controller)
• This results in a delegated TGT for the current user being present in
the AP-REQ in a way we can retrieve it
• Translation: we get a usable TGT for the current user!
-21-
Rubeus:Building a Better Kerberoast
• Rubeus implements the structures needed for service ticket
requests/responses
• Rubeus also implements Kekeo’s tgtdeleg trick
• Combined, this allows us to kerberoast while:
• not needing the current user’s key/password
• avoiding caching service tickets on the attacker-controlled host
• specifying RC4 in the service ticket requests
-22-
Rubeus:
Kerberoasting Opsec
-23-
Kerberoasting Defenses
• Use long passwords for accounts with SPNs, or use a password
vaulting solution to rotate service account passwords
• Still the best solution (in my opinion)
• Check for RC4 encryption in service ticket requests/responses
• Not useful unless the account is explicitly configured for AES
• Detect “anomalous” service ticket requests
• Requires tracking state of all ticket requests in a domain, not a trivial task
• Use of a Kerberoasting “honeypot”
• Talked about by Sean Metcalf – create an account with a non-null SPN and
monitor for any ticket requests (event 4769)
-24-
OPSEC: Defeating the Defenses
• Don’t just Rubeus.exe kerberoast the entire domain at once!
• Plan your attack paths first and only Kerberoast necessarily accounts
• Check group membership and other properties of your target before roasting
• Rubeus.exe kerberoast /stats will break down encryption types and password
last set years for kerberoastable users
• Why not just Kerberoast accounts with password last set date prior
to, say, Sean’s blog post J
• Rubeus.exe kerberoast /pwdsetbefore:01-01-2017 /resultlimit:10
-25-
Thank you!
• Any Questions?
• https://twitter.com/harmj0y
• Get Rubeus
• https://github.com/GhostPack/Rubeus
• Read More:
• https://posts.specterops.io/kerberoasting-revisited-d434351bd4d1
-26-
Monday – Hunting from Home
Tuesday – Everything You Always Wanted To Know About BloodHound* (*But were afraid to ask)
Wednesday – Kerberoasting Revisited
Thursday – Capability Abstraction: Dumping LSASS
Friday – Remote Team Project Management and Reporting Construction
www.specterops.io
@specterops
info@specterops.io

Mais conteúdo relacionado

Mais procurados

Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
Ross Wolf
 
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
DirkjanMollema
 

Mais procurados (20)

Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]
 
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsAn ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
 
Evading Microsoft ATA for Active Directory Domination
Evading Microsoft ATA for Active Directory DominationEvading Microsoft ATA for Active Directory Domination
Evading Microsoft ATA for Active Directory Domination
 
Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
 
0wn-premises: Bypassing Microsoft Defender for Identity
0wn-premises: Bypassing Microsoft Defender for Identity0wn-premises: Bypassing Microsoft Defender for Identity
0wn-premises: Bypassing Microsoft Defender for Identity
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs Blue
 
Here Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLsHere Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLs
 
BloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active DirectoryBloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active Directory
 
I Have the Power(View)
I Have the Power(View)I Have the Power(View)
I Have the Power(View)
 
RACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory DominanceRACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory Dominance
 
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
 
Trusts You Might Have Missed
Trusts You Might Have MissedTrusts You Might Have Missed
Trusts You Might Have Missed
 
Red Team Revenge - Attacking Microsoft ATA
Red Team Revenge - Attacking Microsoft ATARed Team Revenge - Attacking Microsoft ATA
Red Team Revenge - Attacking Microsoft ATA
 
Certified Pre-Owned
Certified Pre-OwnedCertified Pre-Owned
Certified Pre-Owned
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)
 
(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory Pwnage(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory Pwnage
 
Forging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active DirectoryForging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active Directory
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
Derbycon - Passing the Torch
Derbycon - Passing the TorchDerbycon - Passing the Torch
Derbycon - Passing the Torch
 

Semelhante a SpecterOps Webinar Week - Kerberoasting Revisisted

Kerberos Survival Guide - St. Louis Day of .Net
Kerberos Survival Guide - St. Louis Day of .NetKerberos Survival Guide - St. Louis Day of .Net
Kerberos Survival Guide - St. Louis Day of .Net
J.D. Wade
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
J.D. Wade
 
Kerberos survival guide
Kerberos survival guideKerberos survival guide
Kerberos survival guide
J.D. Wade
 
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
Shakacon
 
Demystifying Secure enclave processor
Demystifying Secure enclave processorDemystifying Secure enclave processor
Demystifying Secure enclave processor
Priyanka Aash
 
Shytikov on NTLM Authentication
Shytikov on NTLM AuthenticationShytikov on NTLM Authentication
Shytikov on NTLM Authentication
shytikov
 

Semelhante a SpecterOps Webinar Week - Kerberoasting Revisisted (20)

In the Wake of Kerberoast
In the Wake of KerberoastIn the Wake of Kerberoast
In the Wake of Kerberoast
 
Walking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOS
Walking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOSWalking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOS
Walking the Bifrost: An Operator's Guide to Heimdal & Kerberos on macOS
 
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defenseDEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
 
Symmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan DohertySymmetric Crypto for DPDK - Declan Doherty
Symmetric Crypto for DPDK - Declan Doherty
 
Kerberos Survival Guide - St. Louis Day of .Net
Kerberos Survival Guide - St. Louis Day of .NetKerberos Survival Guide - St. Louis Day of .Net
Kerberos Survival Guide - St. Louis Day of .Net
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
 
SharePoint Saturday Kansas City - Kerberos Survival Guide
SharePoint Saturday Kansas City - Kerberos Survival GuideSharePoint Saturday Kansas City - Kerberos Survival Guide
SharePoint Saturday Kansas City - Kerberos Survival Guide
 
Wireless LAN Security Fundamentals
Wireless LAN Security FundamentalsWireless LAN Security Fundamentals
Wireless LAN Security Fundamentals
 
Kerberos survival guide
Kerberos survival guideKerberos survival guide
Kerberos survival guide
 
Hacktive Directory Forensics - HackCon18, Oslo
Hacktive Directory Forensics - HackCon18, OsloHacktive Directory Forensics - HackCon18, Oslo
Hacktive Directory Forensics - HackCon18, Oslo
 
Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)
 
Single Sign-On, Two Factor & more: Advanced Authentication & Authorization at...
Single Sign-On, Two Factor & more: Advanced Authentication & Authorization at...Single Sign-On, Two Factor & more: Advanced Authentication & Authorization at...
Single Sign-On, Two Factor & more: Advanced Authentication & Authorization at...
 
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
 
Demystifying Secure enclave processor
Demystifying Secure enclave processorDemystifying Secure enclave processor
Demystifying Secure enclave processor
 
Kerberos survival guide-STL 2015
Kerberos survival guide-STL 2015Kerberos survival guide-STL 2015
Kerberos survival guide-STL 2015
 
TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
 
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent ConnectionsBuilding an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent Connections
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryption
 
Kerberos Survival Guide: SharePoint Saturday Nashville 2015
Kerberos Survival Guide: SharePoint Saturday Nashville 2015Kerberos Survival Guide: SharePoint Saturday Nashville 2015
Kerberos Survival Guide: SharePoint Saturday Nashville 2015
 
Shytikov on NTLM Authentication
Shytikov on NTLM AuthenticationShytikov on NTLM Authentication
Shytikov on NTLM Authentication
 

Mais de Will Schroeder

Mais de Will Schroeder (17)

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Nemesis - SAINTCON.pdf
Nemesis - SAINTCON.pdfNemesis - SAINTCON.pdf
Nemesis - SAINTCON.pdf
 
Ace Up the Sleeve
Ace Up the SleeveAce Up the Sleeve
Ace Up the Sleeve
 
Defending Your "Gold"
Defending Your "Gold"Defending Your "Gold"
Defending Your "Gold"
 
A Case Study in Attacking KeePass
A Case Study in Attacking KeePassA Case Study in Attacking KeePass
A Case Study in Attacking KeePass
 
The Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to CompromiseThe Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to Compromise
 
A Year in the Empire
A Year in the EmpireA Year in the Empire
A Year in the Empire
 
Trusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44conTrusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44con
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with Python
 
PSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShellPSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShell
 
Bridging the Gap
Bridging the GapBridging the Gap
Bridging the Gap
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShell
 
Drilling deeper with Veil's PowerTools
Drilling deeper with Veil's PowerToolsDrilling deeper with Veil's PowerTools
Drilling deeper with Veil's PowerTools
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
Adventures in Asymmetric Warfare
Adventures in Asymmetric WarfareAdventures in Asymmetric Warfare
Adventures in Asymmetric Warfare
 
Pwnstaller
PwnstallerPwnstaller
Pwnstaller
 
PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege Escalation
 

Último

哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 

Último (20)

APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 

SpecterOps Webinar Week - Kerberoasting Revisisted

  • 1. SpecterOps Webinar Week Monday – Hunting from Home Tuesday – Everything You Always Wanted To Know About BloodHound* (*But were afraid to ask) Wednesday – Kerberoasting Revisited Thursday – Capability Abstraction: Dumping LSASS Friday – Remote Team Project Management and Reporting Construction
  • 2. Introduction • Job: Technical Architect at SpecterOps • Code: Veil-Framework, Empire, PowerView/PowerUp, BloodHound, GhostPack • Cons: DerbyCon, BlackHat, DEF CON, Troopers, ShmooCon • Training: Adversary Tactics: Red Team Operations, Adversary Tactics: PowerShell (now open source!), veteran BlackHat trainer -2-
  • 3. Overview • Exactly how Kerberoasting works • msDS-SupportedEncryptionTypes • Previous Kerberoasting Approaches • Building a Better Kerberoast With Rubeus • Defenses (and Kerberoasting OPSEC) -3-
  • 5. -5- WMI computer.domain.com PowerShell Remoting File Share SQL HOST/ HTTP/ HOST/ RPCSS/ CIFS/ MSSQLSvc/ dir computer.domain.comC$ 1. Here’s my TGT. I want a service ticket for: CIFS/computer.domain.com 2. Service ticket returned: CIFS/computer.domain.com 3. Use service ticket: CIFS/computer.domain.com domain.com Domain Controller Attacker
  • 6. -6- dir computer.domain.comC$ 1. Here’s my TGT. I want a service ticket for: CIFS/computer.domain.com 2. Look up which (user or computer$) account has the CIFS/computer.domain.com service principal name (SPN) registered 3. Encrypt part of the service ticket with the key of looked- up account (computer$ here) 4. Target service decrypts the service ticket w/ shared computer$ key. Target service decides whether to allow access! computer.domain.com File Share CIFS/ domain.com Domain Controller Attacker
  • 7. Kerberoasting 101:Background • The target service and the domain controller have to share some key so the service can decrypt the ticket • For most service principal names (SPNs) this is the computer$ account key/hash • Computer accounts (by default) have random passwords that every 30 days • But if the SPN is registered for a user account, we now have a piece of data that’s encrypted with their key • Requesting this and cracking offline == Kerberoasting ! -7-
  • 8. Kerberoasting 101: Using the Goods • If a user account has an SPN registered, the user often: • has admin privileges on the machine specified in the SPN • and/or is in other privileged domain groups • Even if they don’t/aren’t, with the key cracked, we can forge service tickets as ANY user to the specific service principal name • This is what “silver tickets” are! -8-
  • 9. Kerberoasting 101: Why Care • ANY user can request a service ticket for ANY SPN (by design!) • This service ticket give us a piece of information encrypted with the key/hash of the (user) account that backs that SPN • We only communicate with the DC - no packets are sent to the service target unless we try to use the requested ticket! • Translation: if a user has a non-null servicePrincipalName property, we can crack their password offline (with GPU-accelerated software!) -9-
  • 10. Kerberoasting 201: Key Encryption Types • Service tickets (just like TGTs) generally use either AES256_CTS_HMAC_SHA1_96 (AES256) or RC4_HMAC_MD5 (RC4/NTLM) keys for ticket encryption • AES encryption was introduced with domain functional level 2008, but RC4 has been kept for backwards compatibility reasons • From an offensive perspective, we really want responses encrypted with RC4, since it’s orders of magnitude faster to crack than AES -10-
  • 11. Sidenote:Kerberoasting Defenses • Modern (2008+ functional level) Active Directory domains are supposed to use AES keys by default for Kerberos exchanges • So requesting a RC4 service ticket should result in “encryption downgrade activity” • But built-in request methods for user-backed SPNs nearly always return RC4-encrypted service tickets 🤔 -11-
  • 13. msDS-SupportedEncryptionTypes • Active Directory user/computer account property touched on by Jim Shaver and Mitchell Hennigan in their DerbyCon 7.0 “Return From The Underworld” talk • According to Microsoft’s [MS-ADA2], “The Key Distribution Center (KDC) uses this information [msDS-SupportedEncryptionTypes] while generating a service ticket for this account.” • Translation: this property (on an account with a non-null SPN) determines the encryption used for service tickets requested for that account’s SPN(s) -13-
  • 14. msDS-SupportedEncryptionTypes • According to MS-KILE 3.1.1.5 the default value for this field is 0x1C (RC4 | AES128 | AES256 = 28) for Windows 7+ and Server 2008R2+ • However, this property is only set by default on computer accounts (not user or trust accounts!) • If this property is not defined (or is set to 0) [MS-KILE] 3.3.5.7 says default behavior is to use a value of 0x7 (RC4) -14-
  • 15. However we can set user accounts to explicitly support AES 128/256 encryption 0x18 (AES128 | AES256 = 24) -15-
  • 17. So What? • There doesn’t seem to be an easy way to disable RC4_HMAC service ticket requests on user accounts, meaning we can’t “stop” RC4 Kerberoasting • The reason for this behavior is in case accounts were created in a 2003 functional level domain and haven’t had their passwords changed since • We can disable RC4 for the entire domain, but this also kills RC4 TGTs, which isn’t feasible for most environments • However setting AES support for user accounts at least gives us the “encryption downgrade” detection back -17-
  • 18. Kerberoasting Approaches -18- External-In -Need creds (pw/hash) of existing domain account to first get a TGT so service tickets can be requested -More difficult over high latency C2 -But can granularly control all aspects of the exchange (i.e. RC4) Domain-Joined Windows Host -Don’t need credentials, just execution in a domain user’s context -Easier over high latency C2 -Built-in request methods don’t let you control aspects (like encryption levels) of the exchange
  • 19. Previous Kerberoasting Approaches (Host) • The previous domain-joined Kerberoasting methods involve using setspn.exe or .NET’s KerberosRequestorSecurityToken class to request a service ticket for a target SPN • The tickets are then carved out of memory (Mimikatz) or extracted using the .NET methods (PowerView) • Unintended downside: this will cache a ticket on the requesting machine for each SPN we roast! (could be hundreds of tickets…) -19-
  • 20. Downsides of Built-in Ticket Request Methods • .NET/setspn approaches request/cache dozens (or hundreds) of service tickets on the attacker host • .NET’s KerberosRequestorSecurityToken method doesn’t let you specify encryption levels (RC4 vs AES) for ticket requests • Since we don’t have a proper TGT, we can’t hard specify RC4 like Impacket/Metasploit • Normally, the session key for the TGT is not exportable for non- elevated contexts, so we can’t get a usable TGT for a regular user • Or can we… -20-
  • 21. Obtaining a User’s TGT: The “tgtdeleg” Trick • @gentilkiwi realized we can request an outgoing service ticket request for a SPN on an unconstrained delegation server (the domain controller) • This results in a delegated TGT for the current user being present in the AP-REQ in a way we can retrieve it • Translation: we get a usable TGT for the current user! -21-
  • 22. Rubeus:Building a Better Kerberoast • Rubeus implements the structures needed for service ticket requests/responses • Rubeus also implements Kekeo’s tgtdeleg trick • Combined, this allows us to kerberoast while: • not needing the current user’s key/password • avoiding caching service tickets on the attacker-controlled host • specifying RC4 in the service ticket requests -22-
  • 24. Kerberoasting Defenses • Use long passwords for accounts with SPNs, or use a password vaulting solution to rotate service account passwords • Still the best solution (in my opinion) • Check for RC4 encryption in service ticket requests/responses • Not useful unless the account is explicitly configured for AES • Detect “anomalous” service ticket requests • Requires tracking state of all ticket requests in a domain, not a trivial task • Use of a Kerberoasting “honeypot” • Talked about by Sean Metcalf – create an account with a non-null SPN and monitor for any ticket requests (event 4769) -24-
  • 25. OPSEC: Defeating the Defenses • Don’t just Rubeus.exe kerberoast the entire domain at once! • Plan your attack paths first and only Kerberoast necessarily accounts • Check group membership and other properties of your target before roasting • Rubeus.exe kerberoast /stats will break down encryption types and password last set years for kerberoastable users • Why not just Kerberoast accounts with password last set date prior to, say, Sean’s blog post J • Rubeus.exe kerberoast /pwdsetbefore:01-01-2017 /resultlimit:10 -25-
  • 26. Thank you! • Any Questions? • https://twitter.com/harmj0y • Get Rubeus • https://github.com/GhostPack/Rubeus • Read More: • https://posts.specterops.io/kerberoasting-revisited-d434351bd4d1 -26-
  • 27. Monday – Hunting from Home Tuesday – Everything You Always Wanted To Know About BloodHound* (*But were afraid to ask) Wednesday – Kerberoasting Revisited Thursday – Capability Abstraction: Dumping LSASS Friday – Remote Team Project Management and Reporting Construction www.specterops.io @specterops info@specterops.io