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/test.machine.examaple.com@EXAMPLE.COM)—————>
<——— 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?