Skip to main content
NewsPublished

Windows Kerberos AS-REQ "till" is a hardcoded constant and other AD time findings from chasing KRB_AP_ERR_SKEW

Source Reddit Cybersecurity

0

Discussion

This report discusses how Windows Domain Controllers (DCs) expose their exact time to unauthenticated clients over multiple protocols including CLDAP, SMB, NTP, Kerberos error messages, and NTLM. A notable finding is that the Kerberos AS-REQ "till" field is a hardcoded constant timestamp rather than a computed value, which can serve as a fingerprint. The research includes an open-source tool, Skewrun, that leverages these time disclosures to synchronize time for Kerberos authentication without changing the local system clock, addressing the KRB_AP_ERR_SKEW error. The findings also highlight protocol-specific behaviors that can be used for detection or evasion in security monitoring. No direct vulnerability or exploit is described, but the information aids red teams and defenders in understanding and detecting time-based protocol interactions with Active Directory.

r/cybersecurity (opens in a new tab)u/FrozenSuricats0 points0 comments

TL;DR: a Windows DC hands out its exact time to UNAUTHENTICATED clients over 5 protocols (CLDAP/SMB/NTP/Kerberos-error/NTLM). the AS-REQ "till" is a hardcoded constant (2037, or 9999 on Win11 22H2+) and getting it wrong can even break your own request. a few of these are cheap wire signatures for blue team to baseline. i wrapped it all in a small OSS tool + rust crate.

Hey hey, im a dev and i have been learning cybersec and acting as appsec eng and during the ctfs, boxes and authorized engagements the KRB_AP_ERR_SKEW found me a lot, the usual "correction" for it is to change the entire system clock or use some one liners that always get bugged or dont work in every environment, so i ended going down a rabbit hole to learn how the DC usually exposes its time (and also to find ways to slip past my own DetectionLab, so i could learn the detection/purple side too)

So, the DC leaks its time to UNAUTHENTICATED clients over several protocols:

  1. CLDAP rootDSE: the currentTime attribute in a base search
  2. SMB2 NEGOTIATE: the SystemTime field in the response (fixed offset, all dialects)
  3. NTP/SNTP: the obvious one
  4. Kerberos KRB-ERROR: stime/susec even from a failed AS-REQ
  5. NTLM type-2 challenge: MsvAvTimestamp in the target info

The last one was also the funniest when i was testing, so i started tuning my detectionLab to get weird reqs and in the research ended up finding that the AS-REQ till is a hardcoded Windows constant, not a computed value (in my dev mind it would be computed, something like now+XXhrs or idk) but Real Windows fixes it as a far future constant 20370913024805Z (Win11 22H2+ switched to 99990913024805Z) credits to a Heimdal bug report with the captures, so in theory any jittered till is potentially a fingerprint, but it also makes sense in a way of if your box is too far behind even an now+XXhrs could end up in the past and you wouldnt even get the regular KRB_AP_ERR_SKEW

Another fun thing now about SMB is that real win 10/11 send SMB 3.1.1 (0x0311) in the NEGOTIATE dialect list + the mandatory PREAUTH_INTEGRITY_CAPABILITIES context and set the CLDAP timeLimit to 0 which can become cheap wire signatures to baseline if you're detecting this kind of activity

Also the CLDAP query people call a "DC Locator Ping" is actually a rootDSE diagnostic query (objectClass=*), which is ldapsearch/PowerShell-shaped traffic, not the machine-account DC Locator ping, different hiding pool than commonly assumed

If anyone wants to know more, see it or is dealing with the KRB_AP_ERR_SKEW I applied all this in a small open-source tool + a Rust crate for the extraction part (Skewrun)

Anyone working in a SOC: do you have detection rules for these kinds of time-based protocol requests?
And to the ones attacking, has anybody dealt with this kind of problem without LD_PRELOAD, any ideas of how to make it deal with static bins and/or be truly OS agnostic?

References

Community reviews

Loading reviews…