SlideShare a Scribd company logo
#RSAC
SESSION ID:
Paula Januszkiewicz
Understand Credential Security: Important Things
You Need to Know About Storing Your Identity
IDY-W03
CQURE: CEO, Penetration Tester / Security Expert
CQURE Academy: Trainer
MVP: Enterprise Security, MCT
Microsoft Regional Director
Contact: paula@cqure.us | http://cqure.us
#RSAC
#RSAC
#RSAC
Definition of credentials
#RSAC
Bootkey:
Class names for keys from HKLMSYSTEMCCSControlLsa
SAM/NTDS.dit
(MD4 Hashes)
C:windowssystem32config
C:windowssystem32NTDS
MSDCC2
(Cached Logon Data)
HKLMSECURITYCache
LSA Secrets
(Service Accounts)
HKLMSECURITYPolicySecrets
$MACHINE.ACC
(SYSTEM’s Clear Text Password)
DPAPI_SYSTEM (Master Keys)
HKLMSECURITYPolicySecrets
#RSAC
Are ‘cached credentials’ safe?
#RSAC
Encrypted Cached Credentials
DK = PBKDF2(PRF, Password, Salt, c, dkLen)
Microsoft’s implementation: MSDCC2=
PBKDF2(HMAC-SHA1, DCC1, username, 10240, 16)
Encrypted Cached Credentials:
Legend
#RSAC
Cached Logons: It used to be like this…
The encryption algorithm is RC4.
The hash is used to verify authentication is calculated as follows:
DCC1 = MD4(MD4(Unicode(password)) .
LowerUnicode(username))
is
DCC1 = MD4(hashNTLM . LowerUnicode(username))
Before the attacks facilitated by pass-the-hash, we can only rejoice the
"salting" by the username.
There are a number pre-computed tables for users as Administrator
facilitating attacks on these hashes.
#RSAC
Cached Logons: Now it is like this!
The encryption algorithm is AES128.
The hash is used to verify authentication is calculated as
follows:
MSDCC2 = PBKDF2(HMAC-SHA1, Iterations,
DCC1, LowerUnicode(username))
with DCC 1 calculated in the same way as for 2003 / XP.
There is actually not much of a difference with XP / 2003!
No additional salting.
PBKDF2 introduced a new variable: the number of iterations
SHA1 with the same salt as before (username).
#RSAC
Cached Logons: Iterations
The number of iterations in PBKDF2, it is configurable
through the registry:
HKEY_LOCAL_MACHINESECURITYCache
DWORD (32) NL$IterationCount
If the number is less than 10240, it is a multiplier by
1024 (20 therefore gives 20480 iterations)
If the number is greater than 10240, it is the number
of iterations (rounded to 1024)
#RSAC
Demo: Cached Credentials
#RSAC
Classic Data Protection API
Based on the following components:
Password, data blob, entropy
Is not prone to password resets!
Protects from outsiders when being in offline access
Effectively protects users data
Stores the password history
You need to be able to get access to some of your passwords
from the past
Conclusion:OS greatlyhelpsustoprotectsecrets
#RSAC
+ getting access to user’s secrets in the domain
Demo: Classic DPAPI
#RSAC
+ Keepass
Demo: DPAPI Taken Further
#RSAC
When centralization should be done with a bit more
awareness
Demo: RDG Passwords
#RSAC
IIS Structure
HTTP.SYS
#RSAC
Application Pools
Used to group one or more Web Applications
Purpose: Assign resources, serve as a security sandbox
Use Worker Processes (w3wp.exe)
Their identity is defined in Application Pool settings
Process requests to the applications
Passwords for AppPool identity can be ’decrypted’ even offline
They are stored in the encrypted form in applicationHost.config
Conclusion: IIS relies it’s securityon Machine Keys(Local System)
#RSAC
Getting password from IIS configuration
Demo: Application Pools
#RSAC
+ extracting the data from the registry
IISWasKey
#RSAC
Services
Store configuration in the registry
Always need some identity to run the executable!
Local Security Authority (LSA) Secrets
Must be stored locally, especially when domain credentials are used
Can be accessed when we impersonate to Local System
Their accounts should be monitored
If you cannot use gMSA, MSA, use subscription for svc_ accounts (naming convention)
Conclusion: Think twice before using an Administrativeaccount, use gMSA
#RSAC
Getting password from LSA Secrets
Demo: Services
#RSAC
Chasing the obvious: NTDS.DIT, SAM
Theabovemeans:Toreadthecleartextpasswordyouneedtostruggle!
#RSAC
Hash spree - offline
Demo: SAM/NTDS.dit
#RSAC
#RSAC
Two AMAZING discoveries!
Smart card logon is possible without a smart card
Private keys can be extracted from the PFX files without having
a password
#RSAC
Securing Yourself for a Rainy Day
Kerberos Pre-Auth
#RSAC
SID-Protected PFX Files… Unprotected
DPAPI-NG
#RSAC
Credentials Security Takeways
Cryptography that relies on keys stored in the registry
is as safe as your offline access.
We all know that they should log on to the Domain
Controllers only.
Who are they? Can we trust them?
…when extracted. In practice they are as safe as
your approach.
Thank you!
#RSAC
SESSION ID:
Paula Januszkiewicz
Understand Credential Security: Important Things
You Need to Know About Storing Your Identity
IDY-W03
CQURE: CEO, Penetration Tester / Security Expert
CQURE Academy: Trainer
MVP: Enterprise Security, MCT
Microsoft Regional Director
Contact: paula@cqure.us | http://cqure.us

More Related Content

PPTX
RSA Conference 2017 session: What System Stores on the Disk Without Telling You
PDF
Gartner Security & Risk Management Summit 2018
PDF
CQURE_BHAsia19_Paula_Januszkiewicz_slides
PDF
Top 10 Ways To Make Hackers Excited: All About The Shortcuts Not Worth Taking
PDF
Dear Hacker: Infrastructure Security Reality Check
PPTX
RSA 2018: Adventures in the Underland: Techniques against Hackers Evading the...
PPTX
Adventures in Underland: Is encryption solid as a rock or a handful of dust?
PDF
rsa-usa-2019-keynote-paula-januszkiewicz
RSA Conference 2017 session: What System Stores on the Disk Without Telling You
Gartner Security & Risk Management Summit 2018
CQURE_BHAsia19_Paula_Januszkiewicz_slides
Top 10 Ways To Make Hackers Excited: All About The Shortcuts Not Worth Taking
Dear Hacker: Infrastructure Security Reality Check
RSA 2018: Adventures in the Underland: Techniques against Hackers Evading the...
Adventures in Underland: Is encryption solid as a rock or a handful of dust?
rsa-usa-2019-keynote-paula-januszkiewicz

What's hot (20)

PDF
Black Hat Europe 2017. DPAPI and DPAPI-NG: Decryption Toolkit
PDF
DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017
PDF
Carlos García - Pentesting Active Directory Forests [rooted2019]
PDF
Hiding secrets in Vault
PPTX
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
PDF
Insecurity-In-Security version.2 (2011)
PDF
Insecurity-In-Security version.1 (2010)
PDF
Issuing temporary credentials for my sql using hashicorp vault
PPTX
Vault - Secret and Key Management
PDF
Password (in)security
PDF
Vault 101
PDF
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
PPTX
Lets Encrypt!
PPTX
Passwords#14 - mimikatz
PDF
HashiCorp's Vault - The Examples
PDF
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
PPTX
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
PDF
HashiCorp Vault Plugin Infrastructure
PDF
BlueHat v18 || Malicious user profiling using a deep neural net
PPTX
Webinar: Securing your data - Mitigating the risks with MongoDB
Black Hat Europe 2017. DPAPI and DPAPI-NG: Decryption Toolkit
DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017
Carlos García - Pentesting Active Directory Forests [rooted2019]
Hiding secrets in Vault
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.1 (2010)
Issuing temporary credentials for my sql using hashicorp vault
Vault - Secret and Key Management
Password (in)security
Vault 101
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Lets Encrypt!
Passwords#14 - mimikatz
HashiCorp's Vault - The Examples
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
HashiCorp Vault Plugin Infrastructure
BlueHat v18 || Malicious user profiling using a deep neural net
Webinar: Securing your data - Mitigating the risks with MongoDB
Ad

Similar to rsa_usa_2019_paula_januszkiewicz (20)

PDF
Eyes Wide Shut: What Do Your Passwords Do When No One is Watching?
PPT
RSA Secur id for windows
PDF
Tips to Remediate your Vulnerability Management Program
PPT
Windows Security in Operating System
PDF
Windows Security Internals: A Deep Dive into Windows Authentication, Authoriz...
PDF
Windows Security Internals 1 / converted Edition James Forshaw
PDF
Hunting for Privilege Escalation in Windows Environment
PPT
Bh Win 03 Rileybollefer
PPS
Microsoft (Data Protection Solutions)
PPTX
Naked and Vulnerable - A Cybersecurity Starter Kit from Camp IT Dec 2016
PPTX
Introduccion a la seguridad Windows 7
PPTX
mimikatz @ rmll
PPT
Dominique
PPT
Windows network security
PPTX
Operating system security
PDF
The Infosec Revival
PPTX
Extracting Credentials From Windows
PDF
Dakotacon 2017
PPTX
Securing Windows with Group Policy
PPTX
[PU&D] - Securing IT Against Modern Threats with Microsoft Cloud Security Tools
Eyes Wide Shut: What Do Your Passwords Do When No One is Watching?
RSA Secur id for windows
Tips to Remediate your Vulnerability Management Program
Windows Security in Operating System
Windows Security Internals: A Deep Dive into Windows Authentication, Authoriz...
Windows Security Internals 1 / converted Edition James Forshaw
Hunting for Privilege Escalation in Windows Environment
Bh Win 03 Rileybollefer
Microsoft (Data Protection Solutions)
Naked and Vulnerable - A Cybersecurity Starter Kit from Camp IT Dec 2016
Introduccion a la seguridad Windows 7
mimikatz @ rmll
Dominique
Windows network security
Operating system security
The Infosec Revival
Extracting Credentials From Windows
Dakotacon 2017
Securing Windows with Group Policy
[PU&D] - Securing IT Against Modern Threats with Microsoft Cloud Security Tools
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
KodekX | Application Modernization Development
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KodekX | Application Modernization Development
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
Spectral efficient network and resource selection model in 5G networks
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

rsa_usa_2019_paula_januszkiewicz

  • 1. #RSAC SESSION ID: Paula Januszkiewicz Understand Credential Security: Important Things You Need to Know About Storing Your Identity IDY-W03 CQURE: CEO, Penetration Tester / Security Expert CQURE Academy: Trainer MVP: Enterprise Security, MCT Microsoft Regional Director Contact: paula@cqure.us | http://cqure.us
  • 5. #RSAC Bootkey: Class names for keys from HKLMSYSTEMCCSControlLsa SAM/NTDS.dit (MD4 Hashes) C:windowssystem32config C:windowssystem32NTDS MSDCC2 (Cached Logon Data) HKLMSECURITYCache LSA Secrets (Service Accounts) HKLMSECURITYPolicySecrets $MACHINE.ACC (SYSTEM’s Clear Text Password) DPAPI_SYSTEM (Master Keys) HKLMSECURITYPolicySecrets
  • 7. #RSAC Encrypted Cached Credentials DK = PBKDF2(PRF, Password, Salt, c, dkLen) Microsoft’s implementation: MSDCC2= PBKDF2(HMAC-SHA1, DCC1, username, 10240, 16) Encrypted Cached Credentials: Legend
  • 8. #RSAC Cached Logons: It used to be like this… The encryption algorithm is RC4. The hash is used to verify authentication is calculated as follows: DCC1 = MD4(MD4(Unicode(password)) . LowerUnicode(username)) is DCC1 = MD4(hashNTLM . LowerUnicode(username)) Before the attacks facilitated by pass-the-hash, we can only rejoice the "salting" by the username. There are a number pre-computed tables for users as Administrator facilitating attacks on these hashes.
  • 9. #RSAC Cached Logons: Now it is like this! The encryption algorithm is AES128. The hash is used to verify authentication is calculated as follows: MSDCC2 = PBKDF2(HMAC-SHA1, Iterations, DCC1, LowerUnicode(username)) with DCC 1 calculated in the same way as for 2003 / XP. There is actually not much of a difference with XP / 2003! No additional salting. PBKDF2 introduced a new variable: the number of iterations SHA1 with the same salt as before (username).
  • 10. #RSAC Cached Logons: Iterations The number of iterations in PBKDF2, it is configurable through the registry: HKEY_LOCAL_MACHINESECURITYCache DWORD (32) NL$IterationCount If the number is less than 10240, it is a multiplier by 1024 (20 therefore gives 20480 iterations) If the number is greater than 10240, it is the number of iterations (rounded to 1024)
  • 12. #RSAC Classic Data Protection API Based on the following components: Password, data blob, entropy Is not prone to password resets! Protects from outsiders when being in offline access Effectively protects users data Stores the password history You need to be able to get access to some of your passwords from the past Conclusion:OS greatlyhelpsustoprotectsecrets
  • 13. #RSAC + getting access to user’s secrets in the domain Demo: Classic DPAPI
  • 15. #RSAC When centralization should be done with a bit more awareness Demo: RDG Passwords
  • 17. #RSAC Application Pools Used to group one or more Web Applications Purpose: Assign resources, serve as a security sandbox Use Worker Processes (w3wp.exe) Their identity is defined in Application Pool settings Process requests to the applications Passwords for AppPool identity can be ’decrypted’ even offline They are stored in the encrypted form in applicationHost.config Conclusion: IIS relies it’s securityon Machine Keys(Local System)
  • 18. #RSAC Getting password from IIS configuration Demo: Application Pools
  • 19. #RSAC + extracting the data from the registry IISWasKey
  • 20. #RSAC Services Store configuration in the registry Always need some identity to run the executable! Local Security Authority (LSA) Secrets Must be stored locally, especially when domain credentials are used Can be accessed when we impersonate to Local System Their accounts should be monitored If you cannot use gMSA, MSA, use subscription for svc_ accounts (naming convention) Conclusion: Think twice before using an Administrativeaccount, use gMSA
  • 21. #RSAC Getting password from LSA Secrets Demo: Services
  • 22. #RSAC Chasing the obvious: NTDS.DIT, SAM Theabovemeans:Toreadthecleartextpasswordyouneedtostruggle!
  • 23. #RSAC Hash spree - offline Demo: SAM/NTDS.dit
  • 24. #RSAC
  • 25. #RSAC Two AMAZING discoveries! Smart card logon is possible without a smart card Private keys can be extracted from the PFX files without having a password
  • 26. #RSAC Securing Yourself for a Rainy Day Kerberos Pre-Auth
  • 27. #RSAC SID-Protected PFX Files… Unprotected DPAPI-NG
  • 28. #RSAC Credentials Security Takeways Cryptography that relies on keys stored in the registry is as safe as your offline access. We all know that they should log on to the Domain Controllers only. Who are they? Can we trust them? …when extracted. In practice they are as safe as your approach.
  • 30. #RSAC SESSION ID: Paula Januszkiewicz Understand Credential Security: Important Things You Need to Know About Storing Your Identity IDY-W03 CQURE: CEO, Penetration Tester / Security Expert CQURE Academy: Trainer MVP: Enterprise Security, MCT Microsoft Regional Director Contact: paula@cqure.us | http://cqure.us