SlideShare uma empresa Scribd logo
1 de 37
Josh Madeley
Cloudy with a Chance of APT
Novel Microsoft 365 Attacks in the Wild
Doug Bienstock
©2021 Mandiant
©2021 Mandiant
• Incident Response Manager – 7
years @ Mandiant
• Incident Response and Red
Team lead
• Author of adfsdump/spoof,
pwnauth
• Lifelong Green Bay Packers fan
Doug Bienstock
@doughsec
©2021 Mandiant
©2021 Mandiant
 Manager of professional services
– ~6 years @ Mandiant
 Incident Response lead
 Not an author of public tools
 Canadian Ex-Pat that has
adopted the Patriots as my team
of choice
Josh Madeley
@MadeleyJosh
©2021 Mandiant
©2021 Mandiant
 Last year demonstrated that Apex threat actors have become all stars at
abusing Microsoft 365 to achieve their goals
 Large scale espionage campaigns targeted data stored within Microsoft 365
 Novel techniques used to:
– Evade detection
– Automate data theft
– Persistent access beyond credential theft
What's Going On?
Avoiding Detection
©2021 Mandiant
©2021 Mandiant
 Bypass mailbox audit logging
– Set-MailboxAuditBypassAssociation
– The following scenarios are not logged
 Mailbox Owner actions by specified users are not logged
 Delegate actions performed by the users on other mailboxes
 Admin Actions
 Downgrade licenses to E3
– Save the target organization some money
– Disables MailItemsAccessed logging
Disabling Security Features
Mailbox Folder Permission
Abuse
©2021 Mandiant
©2021 Mandiant
 Alternative to Mailbox Delegation
 Mailbox owner, administrator, or an account with full access permissions can
grant granular access to specific folders within a mailbox
 Part of Exchange Web Services (EWS)
 Many legitimate use cases will be seen in most environments
– Sharing calendars
– “Team” mailboxes
– Assistants
 First mentioned in red team context by Black Hills in 2017 post
Mailbox Folder Permissions
https://www.blackhillsinfosec.com/abusing-exchange-mailbox-permissions-mailsniper
©2021 Mandiant
©2021 Mandiant
 Permissions can be assigned as individual permissions or roles
 ReadItems grants access to read mail items in a specific folder
 Roles that have the ReadItems permission
– Author
– Editor
– NonEditingAuthor
– Owner
– PublishingEditor
– PublishingAuthor
– Reviewer*
Common Permissions
©2021 Mandiant
©2021 Mandiant
 Permissions can be assigned to individual users or mail-enabled security group
 Anonymous
– Any external, unauthenticated users
 Default (aka “Everyone” in certain logs)
– Any internal, authenticated users
 By default, the access for both special users is set to None.
Two Special Users
©2021 Mandiant
©2021 Mandiant
 Neat: Assign the “Default” user “Reviewer” role to allow any authenticated user
access to the mailbox folder
– Permissions do not cascade down from child to parent for existing folders, but newly
created folders do inherit
– Set-MailboxFolderPermission cmdlet OR EWS Managed API calls using a tool like
EWSEditor
Abuse
©2021 Mandiant
©2021 Mandiant
 Sign-Ins use EWS to access the modified folders and view email
– Coded as “non-interactive” sign-ins
– Non-existent in the Unified Audit Log and must be specifically enabled to forward to
SIEM from other MSFT sources
 Unified Audit Log records Set-MailboxPermission events
– There will be noise from legitimate admin and background EXO activity
 If Mail Items Accessed auditing is enabled look here
– Throttling concerns
 Enumerate Mailbox Folder Permissions with PowerShell
– Can be slow and should be targeted towards high value accounts
Detection
Hijacking Enterprise
Applications and App
Registrations
©2021 Mandiant
©2021 Mandiant
 Two types of Applications
– App Registrations
 Initial instance of an application, lives in the tenant that created the app
 Serves as a "blueprint" to create a service principal in any tenant that uses the application
– Enterprise Applications
 AKA Service Principals
 A ”copy” of the app registration that lives in the consuming tenant
 Everything in Microsoft 365 uses this model, Microsoft Services like EXO are
“first-party” Service Principals
 The term "application" is used to refer to both Enterprise Applications and App
Registrations
Types of Applications
©2021 Mandiant
©2021 Mandiant
 Two types of permissions can be assigned:
– Delegated Permissions: Enable apps to perform API operations on behalf of a user –
limited to access data that user has access to. Users consent to the permissions at
runtime. The application acts as that user.
– Application Permissions: Enable apps to perform API operations without a signed in
user and access tenant wide data. Requires Admin Consent. The application acts as
itself
 Both App Registrations and Enterprise Applications can be assigned
permissions
Application Permissions
©2021 Mandiant
©2021 Mandiant
 Applications can have secrets or certificates associated with them to allow
authentication as the identity of the app
– Roughly analogous to API Keys
– Applications can have multiple secrets or certificates associated with them
 Once created, they cannot be extracted from Azure AD
 Both App Registrations and Enterprise Apps can have secrets assigned to them
– Enterprise Apps can only have secrets assigned via PowerShell
Secrets and Certificates
©2021 Mandiant
©2021 Mandiant
 Attackers have modified two key components of existing applications
– Adding new MS Graph Application Permissions, specifically file.read and
mail.read
– Adding new credentials (both secrets and certificates)
 Access tenant data remotely using the Graph API
– Conditional Access Policies DO NOT APPLY when authenticating using app secrets
– Service Principal sign-in logs were not available until mid-2020 and they don’t show in
the UAL
 There are dozens of Graph permissions to choose from
– Domain.ReadWrite.All – Add a rogue IdP
– Directory.ReadWrite.All
Enterprise Application Hijacking
©2021 Mandiant
©2021 Mandiant
 Apps can be created as multi-tenant – customers can “add an app” to their
tenant
– The App Registration is the “master copy” of the app and is linked to all Enterprise
Apps in customer tenants
 If we compromise the App Registration we can access data stored in any
tenant that has the Enterprise App copy
– All we need is the friendly name (e.g. Microsoft.com) of the tenant we want to access
– Good luck auditing activities that occur in someone else’s tenant
 Caveats
– Permissions in each individual tenant may be different
Abuse of App Registrations
©2021 Mandiant
©2021 Mandiant
Golden SAML
©2021 Mandiant
©2021 Mandiant
(3)
(4)
(5)
(6)
<t:RequestSecurityTokenResponse
xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/tru
st">
<saml:Assertion
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion”>
<saml:Attribute AttributeName="UPN"
AttributeNamespace="http://schemas.xmlsoap.org/cl
aims">
<saml:AttributeValue>
robin@doughcorp.co</saml:AttributeValue>
</saml:Attribute>
©2021 Mandiant
©2021 Mandiant
Decrypting the SigningToken
22
©2021 Mandiant
©2021 Mandiant
DKM
23
©2021 Mandiant
©2021 Mandiant
 Uses Key Derivation Function from NIST SP 800-108 in Counter Mode
– DKM key is not used itself to decrypt Signing Certificate
– Used as initial input for HMAC-SHA256 Key Derivation (NIST SP 800-108)
 Mostly, but not exactly, follows the standard (because standards are hard ;)
– Context is the Nonce decoded from blob
– Label is the OIDs of the encryption algorithms decoded from blob
– Outputs keys to use for AES encryption as well as SHA256 HMAC for verification of
ciphertext
Key Derivation
24
©2021 Mandiant
©2021 Mandiant
 Claims issuance rules
– Determines the claims that will be
included in the issued SAML
token
– Order of rules matters
– Defenders cannot see the claims
that are put in the token BUT
 MSFT can, to a degree
 May be monitoring for tokens
that have abnormal or unneeded
claims
Are we there yet?
©2021 Mandiant
©2021 Mandiant
 Token Lifetime
– Set per Relying Party Trust
– Default value of 0 == 60 minutes
– Defenders cannot see the Token Lifetime of submitted SAML tokens BUT
 Microsoft can
 May be monitoring for abnormal token lifetimes
– Spoofed tokens could have a lifetime of years, but will not be valid once the ADFS
signing token is rotated after normal 365-day lifespan
Are we there yet?
26
©2021 Mandiant
©2021 Mandiant
 Why dump the existing signing certificates when we can just use our own?
– Access to the AD FS server not required
– Similar to @DrAzureAD AAD Backdoor, but a little stealthier
 Set-MsolDomainFederationSettings
– Global Admin and other privileged roles have access through MSOnline PowerShell
– Nothing happens on the AD FS server
Bring your own signing cert
27
©2021 Mandiant
©2021 Mandiant
28
©2021 Mandiant
©2021 Mandiant
 Nothing to see here,
totally normal, nothing
was modified
 No IP Address recorded
Bring your own signing cert
29
ADFS Replication
©2021 Mandiant
©2021 Mandiant
 For larger orgs, AD FS servers can exist in a farm configuration
 By default, all farm nodes use the same configuration and secrets
 Nodes are kept in sync by a replication service that runs on the primary AD FS
server (the first server that the AD FS role was installed on)
– It actually runs on all farm nodes, useful for attackers
Farmville
31
©2021 Mandiant
©2021 Mandiant
 Replication service uses Windows Communication Framework (WCF)
– Framework to easily build client server applications
– Developer can build on top of preset channels (HTTP) and security (WS-Security,
Kerberos)
 Endpoint is available at http://sts.acme.com:80/policystoretransfer
– Kerberos based authentication using WS-TRUST SPNEGO
– Data payloads are encrypted using shared secret derived from the Kerberos session
key
Replicating
32
©2021 Mandiant
©2021 Mandiant
Replicating
33
©2021 Mandiant
©2021 Mandiant
 Quick and dirty WCF
client to interact with
the replication service
 ~150 lines of code,
most of it boilerplate
WCF initialization
Replicating
34
©2021 Mandiant
©2021 Mandiant
 Edit the ObjectACL for the DKM key to
allow domain users read access
 Insert a new Authorization Policy into
the AD FS database to permit access
for the domain users GroupSID
 Any domain user can obtain the AD FS
signing key from anywhere on the
internal network
Escalate, persistently
35
©2021 Mandiant
©2021 Mandiant
 AD FS servers expose port 80 to all systems by default
– The AD FS role creates default firewall rules for us
 Stealth is built in for us 
– Replication events are not logged at all
– Editing the AD FS configuration database is not logged either
– Auditing editing domain object ACLs (SACLs) is not often enabled in environments
Why?
36
The End
37

Mais conteúdo relacionado

Mais procurados

Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Peter Selch Dahl
 
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-On
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-OnEWUG - Azure AD Pass-through Authentication and Seamless Single Sign-On
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-OnPeter Selch Dahl
 
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t HappenShopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t HappenGreg Castle
 
Getting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: AzureGetting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: AzureBeau Bullock
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentRoy Kim
 
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA Will Tran
 
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGAzure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGRoy Kim
 
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Roy Kim
 
Azure Global Bootcamp 2017 Azure AD Deployment
Azure Global Bootcamp 2017 Azure AD DeploymentAzure Global Bootcamp 2017 Azure AD Deployment
Azure Global Bootcamp 2017 Azure AD DeploymentAnthony Clendenen
 
Secure your M365 resources using Azure AD Identity Governance
Secure your M365 resources using Azure AD Identity GovernanceSecure your M365 resources using Azure AD Identity Governance
Secure your M365 resources using Azure AD Identity GovernanceVignesh Ganesan I Microsoft MVP
 
Foreman Single Sign-On Made Easy with Keycloak
Foreman Single Sign-On Made Easy with KeycloakForeman Single Sign-On Made Easy with Keycloak
Foreman Single Sign-On Made Easy with KeycloakNikhil Kathole
 
Best Practices in Cloud Security
Best Practices in Cloud SecurityBest Practices in Cloud Security
Best Practices in Cloud SecurityAlert Logic
 
application security basics
application security basicsapplication security basics
application security basicsAravindan A
 
[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilitiesOWASP
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
Identity and o365 on Azure
Identity and o365 on AzureIdentity and o365 on Azure
Identity and o365 on AzureMostafa
 
User expert forum user-id
User expert forum   user-idUser expert forum   user-id
User expert forum user-idAlberto Rivai
 
Secure Your Cloud Environment with Azure Active Directory (AD)
Secure Your Cloud Environment with Azure Active Directory (AD)Secure Your Cloud Environment with Azure Active Directory (AD)
Secure Your Cloud Environment with Azure Active Directory (AD)WinWire Technologies Inc
 
SQL Server Security
SQL Server SecuritySQL Server Security
SQL Server Securitysunitkanyan
 

Mais procurados (20)

Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...
 
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-On
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-OnEWUG - Azure AD Pass-through Authentication and Seamless Single Sign-On
EWUG - Azure AD Pass-through Authentication and Seamless Single Sign-On
 
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t HappenShopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
 
Getting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: AzureGetting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: Azure
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
 
OAuth 2.0 Security Reinforced
OAuth 2.0 Security ReinforcedOAuth 2.0 Security Reinforced
OAuth 2.0 Security Reinforced
 
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
 
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGAzure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
 
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
 
Azure Global Bootcamp 2017 Azure AD Deployment
Azure Global Bootcamp 2017 Azure AD DeploymentAzure Global Bootcamp 2017 Azure AD Deployment
Azure Global Bootcamp 2017 Azure AD Deployment
 
Secure your M365 resources using Azure AD Identity Governance
Secure your M365 resources using Azure AD Identity GovernanceSecure your M365 resources using Azure AD Identity Governance
Secure your M365 resources using Azure AD Identity Governance
 
Foreman Single Sign-On Made Easy with Keycloak
Foreman Single Sign-On Made Easy with KeycloakForeman Single Sign-On Made Easy with Keycloak
Foreman Single Sign-On Made Easy with Keycloak
 
Best Practices in Cloud Security
Best Practices in Cloud SecurityBest Practices in Cloud Security
Best Practices in Cloud Security
 
application security basics
application security basicsapplication security basics
application security basics
 
[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
Identity and o365 on Azure
Identity and o365 on AzureIdentity and o365 on Azure
Identity and o365 on Azure
 
User expert forum user-id
User expert forum   user-idUser expert forum   user-id
User expert forum user-id
 
Secure Your Cloud Environment with Azure Active Directory (AD)
Secure Your Cloud Environment with Azure Active Directory (AD)Secure Your Cloud Environment with Azure Active Directory (AD)
Secure Your Cloud Environment with Azure Active Directory (AD)
 
SQL Server Security
SQL Server SecuritySQL Server Security
SQL Server Security
 

Semelhante a BHUSA 2021 - Cloud with a Chance of APT

Webinar: Best Practices for Securing and Protecting MongoDB Data
Webinar: Best Practices for Securing and Protecting MongoDB DataWebinar: Best Practices for Securing and Protecting MongoDB Data
Webinar: Best Practices for Securing and Protecting MongoDB DataMongoDB
 
Ransomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
 
Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...CoLaboraDK
 
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...ITProceed
 
Introduction to ThousandEyes
Introduction to ThousandEyesIntroduction to ThousandEyes
Introduction to ThousandEyesThousandEyes
 
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceOptimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceThousandEyes
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with RailsPaul Gallagher
 
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...Peter Selch Dahl
 
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server:  A Dive into Attacker InfrastructureHoney, I Stole Your C2 Server:  A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server: A Dive into Attacker InfrastructureShakacon
 
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...SolarWinds
 
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...apidays
 
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceOptimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceThousandEyes
 
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceEMEA Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceThousandEyes
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...Marcia Villalba
 
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021VMware Tanzu
 
Ivanti Momentum | What's New in User Workspace Manager 2020.2
Ivanti Momentum | What's New in User Workspace Manager 2020.2Ivanti Momentum | What's New in User Workspace Manager 2020.2
Ivanti Momentum | What's New in User Workspace Manager 2020.2Ivanti
 
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)Okta-Inc
 
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEBecome a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEPlasma Computing Group
 

Semelhante a BHUSA 2021 - Cloud with a Chance of APT (20)

Webinar: Best Practices for Securing and Protecting MongoDB Data
Webinar: Best Practices for Securing and Protecting MongoDB DataWebinar: Best Practices for Securing and Protecting MongoDB Data
Webinar: Best Practices for Securing and Protecting MongoDB Data
 
Ransomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
 
Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...
 
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...
Sysctr Track: Managing your hybrid Mobile cloud Workforce Demystified with Sy...
 
Introduction to ThousandEyes
Introduction to ThousandEyesIntroduction to ThousandEyes
Introduction to ThousandEyes
 
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceOptimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
 
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server:  A Dive into Attacker InfrastructureHoney, I Stole Your C2 Server:  A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
 
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...
Government and Education Webinar: How to Reduce Vulnerabilities and Harden yo...
 
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...
apidays LIVE New York 2021 - Simplify Open Policy Agent with Styra DAS by Tim...
 
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceOptimizing and Troubleshooting Digital Experience for a Hybrid Workforce
Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
 
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid WorkforceEMEA Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
EMEA Optimizing and Troubleshooting Digital Experience for a Hybrid Workforce
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...
 
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021
Achieving DevSecOps Outcomes with Tanzu Advanced- May 25, 2021
 
Ivanti Momentum | What's New in User Workspace Manager 2020.2
Ivanti Momentum | What's New in User Workspace Manager 2020.2Ivanti Momentum | What's New in User Workspace Manager 2020.2
Ivanti Momentum | What's New in User Workspace Manager 2020.2
 
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)
Avoiding the Hidden Costs of Active Directory Federation Services (AD FS)
 
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEBecome a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
 
Presentaion final
Presentaion finalPresentaion final
Presentaion final
 
ARAVINDA CHANDRASEKARAPPA
ARAVINDA CHANDRASEKARAPPAARAVINDA CHANDRASEKARAPPA
ARAVINDA CHANDRASEKARAPPA
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

BHUSA 2021 - Cloud with a Chance of APT

  • 1. Josh Madeley Cloudy with a Chance of APT Novel Microsoft 365 Attacks in the Wild Doug Bienstock
  • 2. ©2021 Mandiant ©2021 Mandiant • Incident Response Manager – 7 years @ Mandiant • Incident Response and Red Team lead • Author of adfsdump/spoof, pwnauth • Lifelong Green Bay Packers fan Doug Bienstock @doughsec
  • 3. ©2021 Mandiant ©2021 Mandiant  Manager of professional services – ~6 years @ Mandiant  Incident Response lead  Not an author of public tools  Canadian Ex-Pat that has adopted the Patriots as my team of choice Josh Madeley @MadeleyJosh
  • 4. ©2021 Mandiant ©2021 Mandiant  Last year demonstrated that Apex threat actors have become all stars at abusing Microsoft 365 to achieve their goals  Large scale espionage campaigns targeted data stored within Microsoft 365  Novel techniques used to: – Evade detection – Automate data theft – Persistent access beyond credential theft What's Going On?
  • 6. ©2021 Mandiant ©2021 Mandiant  Bypass mailbox audit logging – Set-MailboxAuditBypassAssociation – The following scenarios are not logged  Mailbox Owner actions by specified users are not logged  Delegate actions performed by the users on other mailboxes  Admin Actions  Downgrade licenses to E3 – Save the target organization some money – Disables MailItemsAccessed logging Disabling Security Features
  • 8. ©2021 Mandiant ©2021 Mandiant  Alternative to Mailbox Delegation  Mailbox owner, administrator, or an account with full access permissions can grant granular access to specific folders within a mailbox  Part of Exchange Web Services (EWS)  Many legitimate use cases will be seen in most environments – Sharing calendars – “Team” mailboxes – Assistants  First mentioned in red team context by Black Hills in 2017 post Mailbox Folder Permissions https://www.blackhillsinfosec.com/abusing-exchange-mailbox-permissions-mailsniper
  • 9. ©2021 Mandiant ©2021 Mandiant  Permissions can be assigned as individual permissions or roles  ReadItems grants access to read mail items in a specific folder  Roles that have the ReadItems permission – Author – Editor – NonEditingAuthor – Owner – PublishingEditor – PublishingAuthor – Reviewer* Common Permissions
  • 10. ©2021 Mandiant ©2021 Mandiant  Permissions can be assigned to individual users or mail-enabled security group  Anonymous – Any external, unauthenticated users  Default (aka “Everyone” in certain logs) – Any internal, authenticated users  By default, the access for both special users is set to None. Two Special Users
  • 11. ©2021 Mandiant ©2021 Mandiant  Neat: Assign the “Default” user “Reviewer” role to allow any authenticated user access to the mailbox folder – Permissions do not cascade down from child to parent for existing folders, but newly created folders do inherit – Set-MailboxFolderPermission cmdlet OR EWS Managed API calls using a tool like EWSEditor Abuse
  • 12. ©2021 Mandiant ©2021 Mandiant  Sign-Ins use EWS to access the modified folders and view email – Coded as “non-interactive” sign-ins – Non-existent in the Unified Audit Log and must be specifically enabled to forward to SIEM from other MSFT sources  Unified Audit Log records Set-MailboxPermission events – There will be noise from legitimate admin and background EXO activity  If Mail Items Accessed auditing is enabled look here – Throttling concerns  Enumerate Mailbox Folder Permissions with PowerShell – Can be slow and should be targeted towards high value accounts Detection
  • 14. ©2021 Mandiant ©2021 Mandiant  Two types of Applications – App Registrations  Initial instance of an application, lives in the tenant that created the app  Serves as a "blueprint" to create a service principal in any tenant that uses the application – Enterprise Applications  AKA Service Principals  A ”copy” of the app registration that lives in the consuming tenant  Everything in Microsoft 365 uses this model, Microsoft Services like EXO are “first-party” Service Principals  The term "application" is used to refer to both Enterprise Applications and App Registrations Types of Applications
  • 15. ©2021 Mandiant ©2021 Mandiant  Two types of permissions can be assigned: – Delegated Permissions: Enable apps to perform API operations on behalf of a user – limited to access data that user has access to. Users consent to the permissions at runtime. The application acts as that user. – Application Permissions: Enable apps to perform API operations without a signed in user and access tenant wide data. Requires Admin Consent. The application acts as itself  Both App Registrations and Enterprise Applications can be assigned permissions Application Permissions
  • 16. ©2021 Mandiant ©2021 Mandiant  Applications can have secrets or certificates associated with them to allow authentication as the identity of the app – Roughly analogous to API Keys – Applications can have multiple secrets or certificates associated with them  Once created, they cannot be extracted from Azure AD  Both App Registrations and Enterprise Apps can have secrets assigned to them – Enterprise Apps can only have secrets assigned via PowerShell Secrets and Certificates
  • 17. ©2021 Mandiant ©2021 Mandiant  Attackers have modified two key components of existing applications – Adding new MS Graph Application Permissions, specifically file.read and mail.read – Adding new credentials (both secrets and certificates)  Access tenant data remotely using the Graph API – Conditional Access Policies DO NOT APPLY when authenticating using app secrets – Service Principal sign-in logs were not available until mid-2020 and they don’t show in the UAL  There are dozens of Graph permissions to choose from – Domain.ReadWrite.All – Add a rogue IdP – Directory.ReadWrite.All Enterprise Application Hijacking
  • 18. ©2021 Mandiant ©2021 Mandiant  Apps can be created as multi-tenant – customers can “add an app” to their tenant – The App Registration is the “master copy” of the app and is linked to all Enterprise Apps in customer tenants  If we compromise the App Registration we can access data stored in any tenant that has the Enterprise App copy – All we need is the friendly name (e.g. Microsoft.com) of the tenant we want to access – Good luck auditing activities that occur in someone else’s tenant  Caveats – Permissions in each individual tenant may be different Abuse of App Registrations
  • 21. ©2021 Mandiant ©2021 Mandiant (3) (4) (5) (6) <t:RequestSecurityTokenResponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/tru st"> <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion”> <saml:Attribute AttributeName="UPN" AttributeNamespace="http://schemas.xmlsoap.org/cl aims"> <saml:AttributeValue> robin@doughcorp.co</saml:AttributeValue> </saml:Attribute>
  • 24. ©2021 Mandiant ©2021 Mandiant  Uses Key Derivation Function from NIST SP 800-108 in Counter Mode – DKM key is not used itself to decrypt Signing Certificate – Used as initial input for HMAC-SHA256 Key Derivation (NIST SP 800-108)  Mostly, but not exactly, follows the standard (because standards are hard ;) – Context is the Nonce decoded from blob – Label is the OIDs of the encryption algorithms decoded from blob – Outputs keys to use for AES encryption as well as SHA256 HMAC for verification of ciphertext Key Derivation 24
  • 25. ©2021 Mandiant ©2021 Mandiant  Claims issuance rules – Determines the claims that will be included in the issued SAML token – Order of rules matters – Defenders cannot see the claims that are put in the token BUT  MSFT can, to a degree  May be monitoring for tokens that have abnormal or unneeded claims Are we there yet?
  • 26. ©2021 Mandiant ©2021 Mandiant  Token Lifetime – Set per Relying Party Trust – Default value of 0 == 60 minutes – Defenders cannot see the Token Lifetime of submitted SAML tokens BUT  Microsoft can  May be monitoring for abnormal token lifetimes – Spoofed tokens could have a lifetime of years, but will not be valid once the ADFS signing token is rotated after normal 365-day lifespan Are we there yet? 26
  • 27. ©2021 Mandiant ©2021 Mandiant  Why dump the existing signing certificates when we can just use our own? – Access to the AD FS server not required – Similar to @DrAzureAD AAD Backdoor, but a little stealthier  Set-MsolDomainFederationSettings – Global Admin and other privileged roles have access through MSOnline PowerShell – Nothing happens on the AD FS server Bring your own signing cert 27
  • 29. ©2021 Mandiant ©2021 Mandiant  Nothing to see here, totally normal, nothing was modified  No IP Address recorded Bring your own signing cert 29
  • 31. ©2021 Mandiant ©2021 Mandiant  For larger orgs, AD FS servers can exist in a farm configuration  By default, all farm nodes use the same configuration and secrets  Nodes are kept in sync by a replication service that runs on the primary AD FS server (the first server that the AD FS role was installed on) – It actually runs on all farm nodes, useful for attackers Farmville 31
  • 32. ©2021 Mandiant ©2021 Mandiant  Replication service uses Windows Communication Framework (WCF) – Framework to easily build client server applications – Developer can build on top of preset channels (HTTP) and security (WS-Security, Kerberos)  Endpoint is available at http://sts.acme.com:80/policystoretransfer – Kerberos based authentication using WS-TRUST SPNEGO – Data payloads are encrypted using shared secret derived from the Kerberos session key Replicating 32
  • 34. ©2021 Mandiant ©2021 Mandiant  Quick and dirty WCF client to interact with the replication service  ~150 lines of code, most of it boilerplate WCF initialization Replicating 34
  • 35. ©2021 Mandiant ©2021 Mandiant  Edit the ObjectACL for the DKM key to allow domain users read access  Insert a new Authorization Policy into the AD FS database to permit access for the domain users GroupSID  Any domain user can obtain the AD FS signing key from anywhere on the internal network Escalate, persistently 35
  • 36. ©2021 Mandiant ©2021 Mandiant  AD FS servers expose port 80 to all systems by default – The AD FS role creates default firewall rules for us  Stealth is built in for us  – Replication events are not logged at all – Editing the AD FS configuration database is not logged either – Auditing editing domain object ACLs (SACLs) is not often enabled in environments Why? 36