Kerberoasting
0x00 Preface
Kerberoasting is a technique often used in domain penetration. This article will refer to public information and combine my own understanding to introduce the principle and implementation of Kerberoasting, as well as a method of backdoor utilization, and finally give defense suggestions.
Reference materials:
0x01 introduction
This article will introduce the following:
Kerberoasting related concepts
Principle of Kerberoasting
Implementation of Kerberoasting
Kerberoasting's backdoor utilization
Kerberoasting defense
0x02 basic concepts
SPN
Official documents:
Full nameService Principal Names
The Service Principal Name (SPN) is a unique identifier for a service instance. Active Directory Domain Services and Windows provide support for Service Principal Names (SPNs), which are key components of the Kerberos mechanism through which a client authenticates a service.
There are two types of SPN, one is registered under the machine account (Computers) on the AD, and the other is registered under the domain user account (Users)
When the authority of a service is Local System
OR Network Service
, the SPN is registered under the machine account (Computers)
When the authority of a service is a domain user, the SPN is registered under the domain user account (Users)
SPN format
Description:
serviceclass can be understood as the name of the service, common ones include
www
,ldap
,SMTP
,DNS
,HOST
, etc.There are two forms of host, FQDN and NetBIOS name, such as server01.test.com and server01
If the service is running on the default port, the port number (port) can be omitted
Query SPN
Initiating an LDAP query to the domain controller is part of the normal kerberos ticket behavior, so the operation of querying the SPN is difficult to detect
(1) Use SetSPN
Tools that come with Win7 and Windows Server2008
View all SPNs in the current domain: