Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.5 KiB

  1. //=============================================================================
  2. // MODULE: kerbGlob.h
  3. //
  4. // Description:
  5. //
  6. // Bloodhound Parser DLL for Kerberos Authentication Protocol
  7. //
  8. // Modification History
  9. //
  10. // Michael Webb & Kris Frost Date: 06/04/99
  11. //=============================================================================
  12. #include <windows.h>
  13. #include <string.h>
  14. #include <bh.h>
  15. #include <netmon.h>
  16. //#define FORMAT_BUFFER_SIZE 80
  17. // Using a typedef enum instead of all the defines
  18. typedef enum{
  19. KerberosSummary = 0x00,
  20. KerberosIDSummary,
  21. KerberosClassTag,
  22. PCIdentifier,
  23. ASN1UnivTag,
  24. LengthSummary,
  25. LengthFlag,
  26. LengthBits,
  27. LongLength1,
  28. LongLength2,
  29. ASNIdentifier,
  30. UniversalTagID,
  31. KdcReqTagID,
  32. KdcReqSeq,
  33. KdcReqSeqLength,
  34. ASN1UnivTagSumID,
  35. KdcContentsValue,
  36. PaDataSummary,
  37. PaDataSeq,
  38. DispString,
  39. KerberosIdentifier,
  40. lblTagNumber,
  41. KdcRepTagID,
  42. KrbPrincipalNamelSet,
  43. KrbPrincNameType,
  44. KrbPrincipalNamelBitF,
  45. KrbTicketID,
  46. KrbTixApp1ID,
  47. KrbErrTagID,
  48. DispTimeID,
  49. KrbErrTagSumID,
  50. KrbTixAppSumID,
  51. KrbTicketSumID,
  52. KrbErrCodeID,
  53. KrbMsgTypeID,
  54. PadataTypeValID,
  55. CipherTextDisp,
  56. FragUdpID,
  57. KdcReqBodyID,
  58. KdcReqBodyBitF,
  59. HostAddressesID,
  60. HostAddressesBitF,
  61. DispStringCliName,
  62. DispStringRealmName,
  63. DispStringServerName,
  64. DispStringTixFlag,
  65. DispStringExpDate,
  66. DispStringPostDate,
  67. DispStringRenewTill,
  68. DispSumRandomNumber,
  69. DispSumEtype,
  70. DispStringAddresses,
  71. DispSummary,
  72. DispStringCliRealm,
  73. DispProtocolVer,
  74. DispKerbMsgType,
  75. DispSumPreAuth,
  76. DispSumReqBody,
  77. DispSumKerbTix,
  78. DispSumTixVer,
  79. DispCipherText,
  80. DispStringCliTime,
  81. DispSumCuSec,
  82. DispStringSrvTime,
  83. DispSumSuSec,
  84. DispSumKerbErr,
  85. DispStringErrorText,
  86. DispStringErrorData,
  87. DispFlagKdcOptions,
  88. DispStringServNameGS,
  89. DispSumEtype2,
  90. EncryptedDataTag,
  91. EncryptedDataTagBitF,
  92. KrbApReqID,
  93. KrbApReqBitF,
  94. DispApOptionsSum,
  95. DispFlagApOptions,
  96. DispSumTicket,
  97. ApTicketID,
  98. ApTicketBitF,
  99. TicketStructID,
  100. TicketStructBitF,
  101. KerberosDefaultlbl,
  102. PaDataSummaryMulti,
  103. Certificatelbl,
  104. DispEncryptionOptions,
  105. MethodDataSummary,
  106. MethodDataBitF,
  107. DispReqAddInfo
  108. };
  109. // Global functions in kerbparser.c
  110. LPBYTE EntryFrame(HFRAME, LPBYTE, DWORD);
  111. // Used to breakdown and display padata fields
  112. LPBYTE HandlePaData(HFRAME hFrame, LPBYTE TempFrame, int, DWORD TypeVal);
  113. LPBYTE CalcMsgType(HFRAME, LPBYTE, int, DWORD TypeVal);
  114. LPBYTE CalcLengthSummary(HFRAME, LPBYTE, int);
  115. LPBYTE DefineValue(HFRAME, LPBYTE, int, DWORD);
  116. LPBYTE DefinePrincipalName(HFRAME hFrame, LPBYTE TempFrame, int, DWORD TypeVal);
  117. LPBYTE DispASNTypes(HFRAME, LPBYTE, int, DWORD, DWORD);
  118. LPBYTE DispSeqOctets(HFRAME,LPBYTE, int, DWORD, DWORD);
  119. LPBYTE DispHostAddresses(HFRAME, LPBYTE, int);
  120. LPBYTE DispSum(HFRAME, LPBYTE, int ClassValue, int ClassValue2, int OffSet, DWORD TypeVal);
  121. LPBYTE DispTopSum(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal);
  122. LPBYTE DefineKdcOptions(HFRAME, LPBYTE, int, DWORD);
  123. LPBYTE DefineEtype(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal, DWORD TypeVal2, DWORD TypeVal3);
  124. LPBYTE HandleEncryptedData(HFRAME hFrame, LPBYTE TempFrame, int OffSet);
  125. LPBYTE DispPadata(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal);
  126. LPBYTE HandleAPReq(HFRAME hFrame, LPBYTE TempFrame);
  127. LPBYTE HandleTicket(HFRAME hFrame, LPBYTE TempFrame, int OffSet);
  128. // Function to display Padata within e-data of Kerb-Error
  129. LPBYTE HandlePadataKrbErr(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal);
  130. // Function to display Method-Data
  131. LPBYTE HandleMethodData(HFRAME hFrame, LPBYTE TempFrame);
  132. LPBYTE DispASNSum(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal);
  133. LPBYTE DispSumSec(HFRAME hFrame, LPBYTE TempFrame, int ClassValue, int ClassValue2, int OffSet, DWORD TypeVal);
  134. // Displays e-data
  135. LPBYTE DispEdata(HFRAME hFrame, LPBYTE TempFrame, int OffSet, DWORD TypeVal);
  136. // Creating this function to change the format of GeneralizedTime
  137. LPBYTE DispSumTime(HFRAME hFrame, LPBYTE TempFrame, int ClassValue, int OffSet, DWORD TypeVal);
  138. // Created this function display the FQDN of sname at the top level
  139. LPBYTE DispSumString(HFRAME hFrame, LPBYTE TempFrame, int ClassValue, int OffSet, DWORD TypeVal);
  140. int CalcMsgLength(LPBYTE);
  141. int CalcLenOctet(LPBYTE);
  142. LPBYTE IncTempFrame(LPBYTE);
  143. BYTE TempAsnMsg;