I have a question on validating the KDC from TGS-REP.
I have a legacy test tool written in c++ that validates the user's AD credentials. This test-tool invokes krb5 library methods for performing the authentication and runs on client (linux machine). I could see in the packet capture that the test-tool is validating the user from AS-REP.
test-tool on client <-------> AD Server
-———----——— AS-REQ—————>
<-———----——— AS-REP—————
(user will be validated by now)
The test-tool is validating the user from AS-REP.
It is not sending/receiving TGS-REQ/TGS-REP. ***I learned that from TGS-REP, we can validate the KDC as well. *** So am extending that tool to do the below:
test-tool on client <-------> AD Server
-———----——— AS-REQ—————>
<----——— AS-REP —————
—————— TGS-REQ (with sname: host/[email protected])—————>
<——— TGS-REP—————
....... my test-toold will validate the KDC by comparing the secret key for the KDC with a pre-configured keytab. I have created a keytab for the above SPN.
Q: From some online readings, I could read that this can be done by comparing the secret key for the KDC with a pre-configured keytab file. Am sure that I do not get this completely. Please help me to understand this part. Why can not we get this validation from AS-REP?
I am not really getting what you meant by validating KDC. Usually an incoming kerberos ticket is validated. When validating the incoming token, there is no need to make a round trip to KDC.
The incoming kerberos token is encrypted using SPN's password (key). This key to decrypt the token is present in keytab only.
Check this link to understand how its done.
Further, there are two main parts to consider - Acceptor and Initiator.
The service where the token is validated, can be
The Kerberos flavor I use has a configuration to make the application as Initiator or Acceptor. Based on that GSS-API decide whether to communicate with KDC or not.