1c19800e8SDoug Rabson@c $Id$ 25e9cd1aeSAssar Westerlund 3adb0ddaeSAssar Westerlund 4b528cefcSMark Murray@node Windows compatibility, Programming with Kerberos, Kerberos 4 issues, Top 5b528cefcSMark Murray@comment node-name, next, previous, up 6b528cefcSMark Murray@chapter Windows compatibility 7b528cefcSMark Murray 8b528cefcSMark MurrayMicrosoft Windows, starting from version 2000 (formerly known as Windows NT 5), implements Kerberos 5. Their implementation, however, has some quirks, 9b528cefcSMark Murraypeculiarities, and bugs. This chapter is a short summary of the compatibility 10b528cefcSMark Murrayissues between Heimdal and various Windows versions. 11b528cefcSMark Murray 125e9cd1aeSAssar WesterlundThe big problem with the Kerberos implementation in Windows 13c19800e8SDoug Rabsonis that the available documentation is more focused on getting 145e9cd1aeSAssar Westerlundthings to work rather than how they work, and not that useful in figuring 15b528cefcSMark Murrayout how things really work. It's of course subject to change all the time and 16b528cefcSMark Murraymostly consists of our not so inspired guesses. Hopefully it's still 17c19800e8SDoug Rabsonsomewhat useful. 18c19800e8SDoug Rabson 19c19800e8SDoug Rabson@menu 20b528cefcSMark Murray* Configuring Windows to use a Heimdal KDC:: 21b528cefcSMark Murray* Inter-Realm keys (trust) between Windows and a Heimdal KDC:: 225e9cd1aeSAssar Westerlund* Create account mappings:: 235e9cd1aeSAssar Westerlund* Encryption types:: 245e9cd1aeSAssar Westerlund* Authorisation data:: 25b528cefcSMark Murray* Quirks of Windows 2000 KDC:: 26c19800e8SDoug Rabson* Useful links when reading about the Windows:: 275e9cd1aeSAssar Westerlund@end menu 285e9cd1aeSAssar Westerlund 29b528cefcSMark Murray@node Configuring Windows to use a Heimdal KDC, Inter-Realm keys (trust) between Windows and a Heimdal KDC, Windows compatibility, Windows compatibility 30b528cefcSMark Murray@comment node-name, next, precious, up 315e9cd1aeSAssar Westerlund@section Configuring Windows to use a Heimdal KDC 325e9cd1aeSAssar Westerlund 335e9cd1aeSAssar WesterlundYou need the command line program called @command{ksetup.exe}. This program comes with the Windows Support Tools, available from either the installation CD-ROM (@file{SUPPORT/TOOLS/SUPPORT.CAB}), or from Microsoft web site. Starting from Windows 2008, it is already installed. This program is used to configure the Kerberos settings on a Workstation. 345e9cd1aeSAssar Westerlund 35c19800e8SDoug Rabson@command{Ksetup} store the domain information under the registry key: 36c19800e8SDoug Rabson@code{HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\Kerberos\Domains}. 375e9cd1aeSAssar Westerlund 385e9cd1aeSAssar WesterlundUse the @command{kadmin} program in Heimdal to create a host principal in the 395e9cd1aeSAssar WesterlundKerberos realm. 40c19800e8SDoug Rabson 415e9cd1aeSAssar Westerlund@example 425e9cd1aeSAssar Westerlundunix% kadmin 43c19800e8SDoug Rabsonkadmin> ank --password=password host/datan.example.com 445e9cd1aeSAssar Westerlund@end example 455e9cd1aeSAssar Westerlund 465e9cd1aeSAssar WesterlundThe name @samp{datan.example.com} should be replaced with DNS name of 475e9cd1aeSAssar Westerlundthe workstation. 48c19800e8SDoug Rabson 495e9cd1aeSAssar WesterlundYou must configure the workstation as a member of a workgroup, as opposed 505e9cd1aeSAssar Westerlundto a member in an NT domain, and specify the KDC server of the realm 51c19800e8SDoug Rabsonas follows: 52c19800e8SDoug Rabson@example 53c19800e8SDoug RabsonC:> ksetup /setdomain EXAMPLE.COM 54c19800e8SDoug RabsonC:> ksetup /addkdc EXAMPLE.COM kdc.example.com 555e9cd1aeSAssar Westerlund@end example 565e9cd1aeSAssar Westerlund 575e9cd1aeSAssar WesterlundSet the machine password, i.e.@: create the local keytab: 58c19800e8SDoug Rabson@example 59c19800e8SDoug RabsonC:> ksetup /SetComputerPassword password 605e9cd1aeSAssar Westerlund@end example 615e9cd1aeSAssar Westerlund 62c19800e8SDoug RabsonThe password used in @kbd{ksetup /setmachpassword} must be the same 635e9cd1aeSAssar Westerlundas the password used in the @kbd{kadmin ank} command. 64c19800e8SDoug Rabson 655e9cd1aeSAssar WesterlundThe workstation must now be rebooted. 665e9cd1aeSAssar Westerlund 67c19800e8SDoug RabsonA mapping between local NT users and Kerberos principals must be specified. 68c19800e8SDoug RabsonYou have two choices. First: 69c19800e8SDoug Rabson 705e9cd1aeSAssar Westerlund@example 715e9cd1aeSAssar WesterlundC:> ksetup /mapuser user@@MY.REALM nt_user 72c19800e8SDoug Rabson@end example 73c19800e8SDoug Rabson 745e9cd1aeSAssar WesterlundThis will map a user to a specific principal; this allows you to have 755e9cd1aeSAssar Westerlundother usernames in the realm than in your NT user database. (Don't ask 765e9cd1aeSAssar Westerlundme why on earth you would want that@enddots{}) 775e9cd1aeSAssar Westerlund 785e9cd1aeSAssar WesterlundYou can also say: 79c19800e8SDoug Rabson@example 805e9cd1aeSAssar WesterlundC:> ksetup /mapuser * * 81c19800e8SDoug Rabson@end example 825e9cd1aeSAssar WesterlundThe Windows machine will now map any user to the corresponding principal, 835e9cd1aeSAssar Westerlundfor example @samp{nisse} to the principal @samp{nisse@@MY.REALM}. 845e9cd1aeSAssar Westerlund(This is most likely what you want.) 855e9cd1aeSAssar Westerlund 865e9cd1aeSAssar Westerlund@node Inter-Realm keys (trust) between Windows and a Heimdal KDC, Create account mappings, Configuring Windows to use a Heimdal KDC, Windows compatibility 875e9cd1aeSAssar Westerlund@comment node-name, next, precious, up 885e9cd1aeSAssar Westerlund@section Inter-Realm keys (trust) between Windows and a Heimdal KDC 895e9cd1aeSAssar Westerlund 905e9cd1aeSAssar WesterlundSee also the Step-by-Step guide from Microsoft, referenced below. 915e9cd1aeSAssar Westerlund 925e9cd1aeSAssar WesterlundInstall Windows, and create a new controller (Active Directory 935e9cd1aeSAssar WesterlundServer) for the domain. 945e9cd1aeSAssar Westerlund 955e9cd1aeSAssar WesterlundBy default the trust will be non-transitive. This means that only users 965e9cd1aeSAssar Westerlunddirectly from the trusted domain may authenticate. This can be changed 975e9cd1aeSAssar Westerlundto transitive by using the @command{netdom.exe} tool. @command{netdom.exe} 985e9cd1aeSAssar Westerlundcan also be used to add the trust between two realms. 995e9cd1aeSAssar Westerlund 1005e9cd1aeSAssar WesterlundYou need to tell Windows on what hosts to find the KDCs for the 1015e9cd1aeSAssar Westerlundnon-Windows realm with @command{ksetup}, see @xref{Configuring Windows 102c19800e8SDoug Rabsonto use a Heimdal KDC}. 103c19800e8SDoug Rabson 1045e9cd1aeSAssar WesterlundThis needs to be done on all computers that want enable cross-realm 1055e9cd1aeSAssar Westerlundlogin with @code{Mapped Names}. @c XXX probably shouldn't be @code 106c19800e8SDoug Rabson 1075e9cd1aeSAssar WesterlundThen you need to add the inter-realm keys on the Windows KDC@. Start the 1085e9cd1aeSAssar WesterlundDomain Tree Management tool (found in Programs, Administrative tools, 109c19800e8SDoug RabsonActive Directory Domains and Trusts). 110c19800e8SDoug Rabson 1115e9cd1aeSAssar WesterlundRight click on Properties of your domain, select the Trust tab. Press 112c19800e8SDoug RabsonAdd on the appropriate trust windows and enter domain name and 113c19800e8SDoug Rabsonpassword. When prompted if this is a non-Windows Kerberos realm, press 1145e9cd1aeSAssar WesterlundOK. 1155e9cd1aeSAssar Westerlund 1165e9cd1aeSAssar WesterlundDo not forget to add trusts in both directions (if that's what you want). 1175e9cd1aeSAssar Westerlund 1185e9cd1aeSAssar WesterlundIf you want to use @command{netdom.exe} instead of the Domain Tree 1195e9cd1aeSAssar WesterlundManagement tool, you do it like this: 1205e9cd1aeSAssar Westerlund 121c19800e8SDoug Rabson@example 1225e9cd1aeSAssar Westerlundnetdom trust NT.REALM.EXAMPLE.COM /Domain:EXAMPLE.COM /add /realm /passwordt:TrustPassword 123c19800e8SDoug Rabson@end example 124c19800e8SDoug Rabson 1255e9cd1aeSAssar WesterlundYou also need to add the inter-realm keys to the Heimdal KDC. But take 1265e9cd1aeSAssar Westerlundcare to the encryption types and salting used for those keys. There should be 127c19800e8SDoug Rabsonno encryption type stronger than the one configured on Windows side for this 1285e9cd1aeSAssar Westerlundrelationship, itself limited to the ones supported by this specific version of 1295e9cd1aeSAssar WesterlundWindows, nor any Kerberos 4 salted hashes, as Windows does not seem to 130c19800e8SDoug Rabsonunderstand them. Otherwise, the trust will not works. 131c19800e8SDoug Rabson 1325e9cd1aeSAssar WesterlundHere are the version-specific needed information: 1335e9cd1aeSAssar Westerlund@enumerate 1345e9cd1aeSAssar Westerlund@item Windows 2000: maximum encryption type is DES 1355e9cd1aeSAssar Westerlund@item Windows 2003: maximum encryption type is DES 1365e9cd1aeSAssar Westerlund@item Windows 2003RC2: maximum encryption type is RC4, relationship defaults to DES 1375e9cd1aeSAssar Westerlund@item Windows 2008: maximum encryption type is AES, relationship defaults to RC4 1385e9cd1aeSAssar Westerlund@end enumerate 139c19800e8SDoug Rabson 140c19800e8SDoug RabsonFor Windows 2003RC2, to change the trust encryption type, you have to use the 1415e9cd1aeSAssar Westerlund@command{ktpass}, from the Windows 2003 Resource kit *service pack2*, available 1425e9cd1aeSAssar Westerlundfrom Microsoft web site. 143c19800e8SDoug Rabson 144c19800e8SDoug Rabson@example 145c19800e8SDoug RabsonC:> ktpass /MITRealmName UNIX.EXAMPLE.COM /TrustEncryp RC4 146c19800e8SDoug Rabson@end example 147c19800e8SDoug Rabson 148c19800e8SDoug RabsonFor Windows 2008, the same operation can be done with the @command{ksetup}, installed by default. 149c19800e8SDoug Rabson 150c19800e8SDoug Rabson@example 151c19800e8SDoug RabsonC:> ksetup /SetEncTypeAttre EXAMPLE.COM AES256-SHA1 152c19800e8SDoug Rabson@end example 153c19800e8SDoug Rabson 154c19800e8SDoug RabsonOnce the relationship is correctly configured, you can add the required 1555e9cd1aeSAssar Westerlundinter-realm keys, using heimdal default encryption types: 1565e9cd1aeSAssar Westerlund 1575e9cd1aeSAssar Westerlund@example 1585e9cd1aeSAssar Westerlundkadmin add krbtgt/NT.REALM.EXAMPLE.COM@@EXAMPLE.COM 1595e9cd1aeSAssar Westerlundkadmin add krbtgt/REALM.EXAMPLE.COM@@NT.EXAMPLE.COM 1605e9cd1aeSAssar Westerlund@end example 1615e9cd1aeSAssar Westerlund 1625e9cd1aeSAssar WesterlundUse the same passwords for both keys. 1635e9cd1aeSAssar Westerlund 1645e9cd1aeSAssar WesterlundAnd if needed, to remove unsupported encryptions, such as the following ones for a Windows 2003RC2 server. 165c19800e8SDoug Rabson 166c19800e8SDoug Rabson@example 167c19800e8SDoug Rabsonkadmin del_enctype krbtgt/REALM.EXAMPLE.COM@@NT.EXAMPLE.COM aes256-cts-hmac-sha1-96 1685e9cd1aeSAssar Westerlundkadmin del_enctype krbtgt/REALM.EXAMPLE.COM@@NT.EXAMPLE.COM des3-cbc-sha1 1695e9cd1aeSAssar Westerlundkadmin del_enctype krbtgt/NT.EXAMPLE.COM@@EXAMPLE.COM aes256-cts-hmac-sha1-96 1705e9cd1aeSAssar Westerlundkadmin del_enctype krbtgt/NT.EXAMPLE.COM@@EXAMPLE.COM des3-cbc-sha1 1715e9cd1aeSAssar Westerlund@end example 1725e9cd1aeSAssar Westerlund 1735e9cd1aeSAssar WesterlundDo not forget to reboot before trying the new realm-trust (after 1745e9cd1aeSAssar Westerlundrunning @command{ksetup}). It looks like it might work, but packets are 1755e9cd1aeSAssar Westerlundnever sent to the non-Windows KDC. 1765e9cd1aeSAssar Westerlund 1775e9cd1aeSAssar Westerlund@node Create account mappings, Encryption types, Inter-Realm keys (trust) between Windows and a Heimdal KDC, Windows compatibility 1785e9cd1aeSAssar Westerlund@comment node-name, next, precious, up 1795e9cd1aeSAssar Westerlund@section Create account mappings 1805e9cd1aeSAssar Westerlund 181c19800e8SDoug RabsonStart the @code{Active Directory Users and Computers} tool. Select the 182c19800e8SDoug RabsonView menu, that is in the left corner just below the real menu (or press 183c19800e8SDoug RabsonAlt-V), and select Advanced Features. Right click on the user that you 184c19800e8SDoug Rabsonare going to do a name mapping for and choose Name mapping. 185c19800e8SDoug Rabson 186c19800e8SDoug RabsonClick on the Kerberos Names tab and add a new principal from the 187b528cefcSMark Murraynon-Windows domain. 188b528cefcSMark Murray 189b528cefcSMark Murray@c XXX check entry name then I have network again 190c19800e8SDoug RabsonThis adds @samp{authorizationNames} entry to the users LDAP entry to 191c19800e8SDoug Rabsonthe Active Directory LDAP catalog. When you create users by script you 192c19800e8SDoug Rabsoncan add this entry instead. 1935e9cd1aeSAssar Westerlund 1945e9cd1aeSAssar Westerlund@node Encryption types, Authorisation data, Create account mappings, Windows compatibility 1955e9cd1aeSAssar Westerlund@comment node-name, next, previous, up 1965e9cd1aeSAssar Westerlund@section Encryption types 197b528cefcSMark Murray 198c19800e8SDoug RabsonWindows 2000 supports both the standard DES encryptions (@samp{des-cbc-crc} and 199b528cefcSMark Murray@samp{des-cbc-md5}) and its own proprietary encryption that is based on MD4 and 200c19800e8SDoug RabsonRC4 that is documented in and is supposed to be described in 201b528cefcSMark Murray@file{draft-brezak-win2k-krb-rc4-hmac-03.txt}. New users will get both 202c19800e8SDoug RabsonMD4 and DES keys. Users that are converted from a NT4 database, will 203b528cefcSMark Murrayonly have MD4 passwords and will need a password change to get a DES 2045e9cd1aeSAssar Westerlundkey. 2055e9cd1aeSAssar Westerlund 2065e9cd1aeSAssar Westerlund@node Authorisation data, Quirks of Windows 2000 KDC, Encryption types, Windows compatibility 2075e9cd1aeSAssar Westerlund@comment node-name, next, previous, up 208b528cefcSMark Murray@section Authorisation data 209b528cefcSMark Murray 210b528cefcSMark MurrayThe Windows 2000 KDC also adds extra authorisation data in tickets. 211b528cefcSMark MurrayIt is at this point unclear what triggers it to do this. The format of 212b528cefcSMark Murraythis data is only available under a ``secret'' license from Microsoft, 213b528cefcSMark Murraywhich prohibits you implementing it. 214b528cefcSMark Murray 215b528cefcSMark MurrayA simple way of getting hold of the data to be able to understand it 216b528cefcSMark Murraybetter is described here. 217b528cefcSMark Murray 218b528cefcSMark Murray@enumerate 219c19800e8SDoug Rabson@item Find the client example on using the SSPI in the SDK documentation. 220c19800e8SDoug Rabson@item Change ``AuthSamp'' in the source code to lowercase. 221b528cefcSMark Murray@item Build the program. 222b528cefcSMark Murray@item Add the ``authsamp'' principal with a known password to the 223c19800e8SDoug Rabsondatabase. Make sure it has a DES key. 224b528cefcSMark Murray@item Run @kbd{ktutil add} to add the key for that principal to a 225b528cefcSMark Murraykeytab. 226c19800e8SDoug Rabson@item Run @kbd{appl/test/nt_gss_server -p 2000 -s authsamp 2275e9cd1aeSAssar Westerlund@kbd{--dump-auth}=@var{file}} where @var{file} is an appropriate file. 2285e9cd1aeSAssar Westerlund@item It should authenticate and dump for you the authorisation data in 2295e9cd1aeSAssar Westerlundthe file. 230c19800e8SDoug Rabson@item The tool @kbd{lib/asn1/asn1_print} is somewhat useful for 231c19800e8SDoug Rabsonanalysing the data. 232c19800e8SDoug Rabson@end enumerate 2335e9cd1aeSAssar Westerlund 234c19800e8SDoug Rabson@node Quirks of Windows 2000 KDC, Useful links when reading about the Windows, Authorisation data, Windows compatibility 2355e9cd1aeSAssar Westerlund@comment node-name, next, previous, up 2365e9cd1aeSAssar Westerlund@section Quirks of Windows 2000 KDC 2375e9cd1aeSAssar Westerlund 238c19800e8SDoug RabsonThere are some issues with salts and Windows 2000. Using an empty salt---which is the only one that Kerberos 4 supported, and is therefore known 239c19800e8SDoug Rabsonas a Kerberos 4 compatible salt---does not work, as far as we can tell 240c19800e8SDoug Rabsonfrom out experiments and users' reports. Therefore, you have to make 2415e9cd1aeSAssar Westerlundsure you keep around keys with all the different types of salts that are 2425e9cd1aeSAssar Westerlundrequired. Microsoft have fixed this issue post Windows 2003. 2435e9cd1aeSAssar Westerlund 2445e9cd1aeSAssar WesterlundMicrosoft seems also to have forgotten to implement the checksum 2455e9cd1aeSAssar Westerlundalgorithms @samp{rsa-md4-des} and @samp{rsa-md5-des}. This can make Name 2465e9cd1aeSAssar Westerlundmapping (@pxref{Create account mappings}) fail if a @samp{des-cbc-md5} key 2475e9cd1aeSAssar Westerlundis used. To make the KDC return only @samp{des-cbc-crc} you must delete 2485e9cd1aeSAssar Westerlundthe @samp{des-cbc-md5} key from the kdc using the @kbd{kadmin 2495e9cd1aeSAssar Westerlunddel_enctype} command. 2505e9cd1aeSAssar Westerlund 2515e9cd1aeSAssar Westerlund@example 2525e9cd1aeSAssar Westerlundkadmin del_enctype lha des-cbc-md5 2535e9cd1aeSAssar Westerlund@end example 2545e9cd1aeSAssar Westerlund 2555e9cd1aeSAssar WesterlundYou should also add the following entries to the @file{krb5.conf} file: 2565e9cd1aeSAssar Westerlund 2575e9cd1aeSAssar Westerlund@example 2585e9cd1aeSAssar Westerlund[libdefaults] 2595e9cd1aeSAssar Westerlund default_etypes = des-cbc-crc 2605e9cd1aeSAssar Westerlund default_etypes_des = des-cbc-crc 2615e9cd1aeSAssar Westerlund@end example 262c19800e8SDoug Rabson 2634137ff4cSJacques VidrineThese configuration options will make sure that no checksums of the 264c19800e8SDoug Rabsonunsupported types are generated. 2654137ff4cSJacques Vidrine 266c19800e8SDoug Rabson@node Useful links when reading about the Windows, , Quirks of Windows 2000 KDC, Windows compatibility 2675e9cd1aeSAssar Westerlund@comment node-name, next, previous, up 2685e9cd1aeSAssar Westerlund@section Useful links when reading about the Windows 2695e9cd1aeSAssar Westerlund 2705e9cd1aeSAssar WesterlundSee also our paper presented at the 2001 Usenix Annual Technical 271c19800e8SDoug RabsonConference, available in the proceedings or at 272c19800e8SDoug Rabson@uref{http://www.usenix.org/publications/library/proceedings/usenix01/freenix01/westerlund.html}. 273c19800e8SDoug Rabson 2745e9cd1aeSAssar WesterlundThere are lots of texts about Kerberos on Microsoft's web site, here is a 275c19800e8SDoug Rabsonshort list of the interesting documents that we have managed to find. 276c19800e8SDoug Rabson 2775e9cd1aeSAssar Westerlund@itemize @bullet 278c19800e8SDoug Rabson 279c19800e8SDoug Rabson@item Step-by-Step Guide to Kerberos 5 (krb5 1.0) Interoperability: 2805e9cd1aeSAssar Westerlund@uref{http://www.microsoft.com/technet/prodtechnol/windows2000serv/howto/kerbstep.mspx}. 2815e9cd1aeSAssar WesterlundKerberos GSS-API (in Windows-eze SSPI), Windows as a client in a 282c19800e8SDoug Rabsonnon-Windows KDC realm, adding unix clients to a Windows 2000 KDC, and 283c19800e8SDoug Rabsonadding cross-realm trust (@pxref{Inter-Realm keys (trust) between Windows 2845e9cd1aeSAssar Westerlundand a Heimdal KDC}). 2855e9cd1aeSAssar Westerlund 286c19800e8SDoug Rabson@item Windows 2000 Kerberos Authentication: 287c19800e8SDoug Rabson@uref{www.microsoft.com/technet/prodtechnol/windows2000serv/deploy/confeat/kerberos.mspx}. 288c19800e8SDoug RabsonWhite paper that describes how Kerberos is used in Windows 2000. 2895e9cd1aeSAssar Westerlund 290c19800e8SDoug Rabson@item Overview of Kerberos: 291c19800e8SDoug Rabson@uref{http://support.microsoft.com/support/kb/articles/Q248/7/58.ASP}. 292c19800e8SDoug RabsonLinks to useful other links. 2935e9cd1aeSAssar Westerlund 2945e9cd1aeSAssar Westerlund@c @item Klist for Windows: 2955e9cd1aeSAssar Westerlund@c @uref{http://msdn.microsoft.com/library/periodic/period00/security0500.htm}. 2965e9cd1aeSAssar Westerlund@c Describes where to get a klist for Windows 2000. 297c19800e8SDoug Rabson 298c19800e8SDoug Rabson@item Event logging for Kerberos: 2995e9cd1aeSAssar Westerlund@uref{http://support.microsoft.com/support/kb/articles/Q262/1/77.ASP}. 3005e9cd1aeSAssar WesterlundBasically it say that you can add a registry key 3015e9cd1aeSAssar Westerlund@code{HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters\LogLevel} 3025e9cd1aeSAssar Westerlundwith value DWORD equal to 1, and then you'll get logging in the Event 3035e9cd1aeSAssar WesterlundLogger. 3045e9cd1aeSAssar Westerlund 3055e9cd1aeSAssar Westerlund@c @item Access to the Active Directory through LDAP: 306c19800e8SDoug Rabson@c @uref{http://msdn.microsoft.com/library/techart/kerberossamp.htm} 307 308@end itemize 309 310Other useful programs include these: 311 312@itemize @bullet 313@item pwdump2 314@uref{http://www.bindview.com/Support/RAZOR/Utilities/Windows/pwdump2_readme.cfm}@end itemize 315