3.1 Log Sources
The Kerberoasting technique is targeting Kerberos
mechanism used to authenticate users who access
protected network resources. The variety of events
which contain useful information for this scenario
narrows to a single subcategory of Advanced security
audit policies: Account Logon\Kerberos Service
Ticket Operations. This policy subcategory should
generate three events:
4769(S, F) A Kerberos service ticket was
requested;
4770(S) A Kerberos service ticket was renewed;
4773(F) A Kerberos service ticket request failed.
The Microsoft documentation narrows the choice of
events even more. The event 4773 is defined but
never invoked, and failure event 4769 is generated
instead. Event 4770 logs every TGS ticket renewal.
However, it has only informational character, and no
security monitoring recommendations exist for it
(Microsoft, 2017).
The event 4769 generates every time KDC gets a
Kerberos TGS ticket request. The event generates
only on DCs, however, it is one of the most numerous
events logged (Metcalf, 2017). This event contains
lots of valuable information, including account,
service, or network information, encryption type used,
and failure code. It is a key element for monitoring
suspicious activities related to services.
Another type of logs that may be useful for this
scenario, although not so directly, are PowerShell
logs. PowerShell Script Block Logging records
compiled blocks of scripts into event 4104;
PowerShell Module Logging records module usage
into event 4103.
3.2 Detection Scenarios
Kerberoasting technique, as described in the previous
section, involves the use of a valid domain user’s
authentication ticket (TGT) to request one or several
service tickets using their SPNs. Since the goal of an
attacker is to crack the service ticket offline, tickets
encrypted with weak cipher suites are preferred.
Sean Metcalf did some research and published
several articles on this topic, which name elements
suitable for detection of Kerberoasting. We were
inspired by ideas published in these articles (Metcalf,
2017) while designing the detection scenarios.
3.2.1 Detecting Kerberoasting via Event
4769
Unless there are incompatible or legacy systems used
in the environment, all Kerberos authentication
should use AES cipher suites, and therefore, any
requests for TGS tickets with lower encryption types
can be considered suspicious. The detection rule D01
- Possible Kerberoasting activity looks for any ticket
requests with encryption type constants equal to the
values of these cipher suites (visible from Table 1).
The snippet of the search is in Listing 1.
Listing 1: D01 – Possible Kerberoasting activity (snippet).
source=XmlWinEventLog:Security
EventCode=4769 (TicketEncryptionType=0x1 OR
TicketEncryptionType=0x3 OR
TicketEncryptionType=0x17 OR
TicketEncryptionType=0x18)
|eval Source=if(IpAddress=="::1", Computer,
IpAddress)
|table _time, host, Source, TargetUserName,
ServiceName, TicketEncryptionType
|sort - _time
| ...
3.2.2 Suspicious Service Ticket Requests
The next two detection searches focus on service
ticket requests and aim to detect suspicious usage of
services more generally. The rule D02 - Excessive
service ticket requests from one source (Listing 2)
triggers if there is a higher amount of different service
requests observed in a short time from a single source.
This kind of activity is even more suspicious if the
service names are not related to each other, or if the
type of requested services is unusual for that
particular source.
The search uses events 4769. Service ticket
requests for krbtgt service and computer account
service names (those ending with $ character) are
filtered out from the results, as the search focuses
mostly on service accounts that were intentionally
created for specific resources. Subsequent events are
grouped on IpAddress field by the transaction
command. The number of services in each transaction
is calculated and filtered to display only results where
the number is higher than the one specified in the
condition. The number constant and time span used
in the condition represent a variable and have to be
adjusted to the needs of the particular environment.
The values presented in the search snippet were used
in the lab environment.
Listing 2: D02 – Excessive service ticket requests from one
source (snippet).
source=XmlWinEventLog:Security
EventCode=4769 ServiceName != krbtgt
|regex ServiceName != "\$$"
|transaction IpAddress maxpause=5m
maxevents=-1