Leaked source code of windows server 2003
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.

215 lines
8.4 KiB

  1. set PE=/pe:s
  2. set AN=/ANSI
  3. rem Test generic creds
  4. crtest /w:ta /ty:g %PE% %AN%
  5. crtest /r:ta /ty:g %AN%
  6. rem test attributes on creds
  7. crtest /w:t1 /ty:p %PE% /com:"my comment" /password:MyPasswordIsReallyLong /user:[email protected] /at:f,g=1 %AN%
  8. crtest /r:t1 /ty:p %AN%
  9. rem ensure I can write over a cred
  10. crtest /w:t1 /ty:p %PE% /com:"c comment" /password:Pwd2 /user:[email protected] %AN%
  11. crtest /r:t1 /ty:p %AN%
  12. rem ensure a cred matches both the netbios and dns name
  13. crtest /w:s1 /ty:p %PE% /com:"c comment" /password:Pwd3 /user:[email protected] %AN%
  14. crtest /r /tins:s1 %AN%
  15. crtest /r /tids:s1 %AN%
  16. crtest /r /tids:s1.ms.com %AN%
  17. rem ... even if it has a target alias
  18. crtest /w:s2.ms.com /targeta:s2 /ty:p %PE% /com:"c comment" /password:Pwd4 /user:[email protected] %AN%
  19. crtest /r /tins:s2 %AN%
  20. crtest /r /tids:s2 %AN%
  21. crtest /r /tids:s2.ms.com %AN%
  22. rem Try it with a dns host name as target name
  23. crtest /w:s3.ms.com /ty:p %PE% /com:"c comment" /password:Pwd5 /user:[email protected] %AN%
  24. crtest /r /tins:s3 %AN%
  25. crtest /r /tids:s3 %AN%
  26. crtest /r /tids:s3.ms.com %AN%
  27. rem Try a wildcarded server name
  28. crtest /w:*.hp.com /ty:p %PE% /com:"c comment" /password:Pwd6 /user:[email protected] %AN%
  29. crtest /r /tins:hp %AN%
  30. crtest /r /tins:hp.com %AN%
  31. crtest /r /tids:hp.com %AN%
  32. crtest /r /tids:fred.hp.com %AN%
  33. crtest /r /tids:p.com %AN%
  34. crtest /r /tids:fred.hp.com. %AN%
  35. rem Another random test
  36. crtest /w:cliffvdom.nttest.microsoft.com /ti:cliffv2 /ty:p %PE% %AN%
  37. crtest /r /ti:cliffv %AN%
  38. rem Two dots at end of UPN are bogus
  39. crtest /w:*.hp.com /ty:p %PE% /com:"c comment" /password:Pwd1 /user:[email protected].. %AN%
  40. rem This one should make up a tagert alias of "bob" (in an older design)
  41. crtest /w:bob.hp.com /ty:p %PE% /com:"c comment" /password:Pwd8 /user:[email protected] /tids:bob.hp.com %AN%
  42. crtest /r:bob.hp.com /ty:p %AN%
  43. rem Create a credential with a netbios server name
  44. crtest /w:zoe /ty:p %PE% /com:"c comment" /password:Pwd9 /user:[email protected] /tins:zoe %AN%
  45. crtest /e:zoe* %AN%
  46. rem prune it
  47. crtest /w:zoe.hp.com /ty:p %PE% /com:"c comment" /password:Pwd10 /user:[email protected] /tins:zoe /tids:zoe.hp.com %AN%
  48. crtest /e:zoe* %AN%
  49. rem Create a credential with a netbios domain name
  50. crtest /w:zat /ty:p %PE% /password:Pwd11 /user:[email protected] /tins:zat5 /tind:zat %AN%
  51. rem Create a corresponding password credential
  52. crtest /w:zat /ty:p %PE% /password:Pwd12 /user:[email protected] /tins:zat5 /tind:zat %AN%
  53. crtest /e:zat* %AN%
  54. rem Get the domain credentials
  55. crtest /r:zat /tins:zat5 /tind:zat /tidd:zat.ms.com %AN%
  56. crtest /e:zat* %AN%
  57. rem Create the Dns counterparts
  58. crtest /w:zat.ms.com /ty:c %PE% /password:Cert13 /user:@@BCIgACIgACIgACIgACIgACIgACIA /tins:zat5 /tidd:zat.ms.com %AN%
  59. crtest /w:zat.ms.com /ty:p %PE% /password:Pwd14 /user:[email protected]. /tins:zat5 /tidd:zat.ms.com %AN%
  60. crtest /e:zat* %AN%
  61. rem Now prune them
  62. crtest /r:zat /tins:zat5 /tind:zat /tidd:zat.ms.com %AN%
  63. crtest /e:zat* %AN%
  64. rem If I have a cred with TN=dns and TA=Netbios ...
  65. crtest /w:yat.ms.com /ty:p %PE% /password:Pwd15 /user:[email protected]. /tins:yat /tids:yat.ms.com /targetalias:yat %AN%
  66. rem ... then write an entry with TN=netbios, prune should fail
  67. crtest /w:yat /ty:p %PE% /password:Pwd16 /user:[email protected]. /tins:yat %AN%
  68. rem If I have a server cred ...
  69. crtest /w:wat.ms.com /ty:p %PE% /password:Pwd17 /user:[email protected]. /tins:wat /tids:wat.ms.com /targetalias:wat %AN%
  70. crtest /e:wat*
  71. rem ... and a domain cred ...
  72. crtest /w:vat.ms.com /ty:p %PE% /password:Pwd18 /user:[email protected]. /tind:vat /tidd:vat.ms.com /targetalias:vat %AN%
  73. crtest /e:vat*
  74. rem ... prune the server cred as soon as we find out the relationship
  75. crtest /r /tins:wat /tind:vat %AN%
  76. crtest /e:wat*
  77. crtest /e:vat*
  78. rem If I have a domain cred ...
  79. crtest /w:qat.ms.com /ty:p %PE% /password:Pwd19 /user:[email protected]. /tind:qat /tidd:qat.ms.com /targetalias:qat %AN%
  80. crtest /e:qat* %AN%
  81. rem ... morph it to a forest cred as soon as we find out the name
  82. crtest /r /tins:wat /tind:qat /tidt:rat.ms.com %AN%
  83. crtest /e:qat* %AN%
  84. crtest /e:rat* %AN%
  85. rem If I have a domain cred ...
  86. crtest /w:tat.ms.com /ty:p %PE% /password:Pwd20 /user:[email protected]. /tind:tat /tidd:tat.ms.com /targetalias:tat %AN%
  87. crtest /e:tat* %AN%
  88. rem ... and a forest cred ...
  89. crtest /w:sat.ms.com /ty:p %PE% /password:Pwd21 /user:[email protected]. /tidt:sat.ms.com %AN%
  90. crtest /e:sat* %AN%
  91. rem ... prune the domain cred as soon as we find out the relationship
  92. crtest /r /tins:wat /tind:tat /tidt:sat.ms.com %AN%
  93. crtest /e:tat* %AN%
  94. crtest /e:sat* %AN%
  95. rem If I have a domain cred ...
  96. crtest /w:qat.ms.com /ty:p %PE% /password:Pwd22 /user:[email protected]. /tind:qat /tidd:qat.ms.com /targetalias:qat %AN%
  97. crtest /e:qat* %AN%
  98. rem ... morph it to a forest cred as soon as we find out the name
  99. crtest /r /tins:wat /tind:qat /tidt:rat.ms.com %AN%
  100. crtest /e:qat* %AN%
  101. crtest /e:rat* %AN%
  102. rem If I have another domain cred ...
  103. crtest /w:pat.ms.com /ty:p %PE% /password:Pwd23 /user:[email protected]. /tind:pat /tidd:pat.ms.com /targetalias:pat %AN%
  104. rem ... morph it into the same forest
  105. crtest /r /tins:wat /tind:pat /tidt:rat.ms.com %AN%
  106. crtest /e:pat* %AN%
  107. crtest /e:rat* %AN%
  108. rem Add yet another domain alias ...
  109. crtest /w:nat.ms.com /ty:p %PE% /password:Pwd24 /user:[email protected]. /tind:nat /tidd:nat.ms.com /targetalias:nat %AN%
  110. rem ... morph it into the same forest
  111. crtest /r /tins:wat /tind:nat /tidt:rat.ms.com %AN%
  112. crtest /e:nat* %AN%
  113. crtest /e:rat* %AN%
  114. rem Move "pat" to a new forest
  115. crtest /r /tins:wat /tind:pat /tidd:pat.ms.com /tidt:mat.ms.com %AN%
  116. crtest /e:rat* %AN%
  117. rem Note that password creds allow marshaled user names
  118. crtest /w:lat /ty:p %PE% /password:Pwd25 /user:@@BCIgACIgACIgACIgACIgACIgACIA %AN%
  119. rem ensure cert creds don't allow normal user names
  120. crtest /w:lat /ty:c %PE% /password:Pwd26 /user:[email protected]. %AN%
  121. rem ensure we can get the session type
  122. crtest /gst
  123. rem Ensure runas target name matches user name (all canonical combinations)
  124. crtest /w:Nowislat /ty:p %PE% /password:Pwd27 /user:[email protected]. %AN% /credUsernameTarget
  125. crtest /w:[email protected] /ty:p %PE% /password:Pwd27 /user:[email protected] %AN% /credUsernameTarget
  126. crtest /w:[email protected] /ty:p %PE% /password:Pwd27 /user:[email protected] %AN% /credUsernameTarget
  127. crtest /w:[email protected] /ty:p %PE% /password:Pwd27 /user:[email protected]. %AN% /credUsernameTarget
  128. crtest /w:[email protected]. /ty:p %PE% /password:Pwd27 /user:[email protected] %AN% /credUsernameTarget
  129. crtest /w:[email protected]. /ty:p %PE% /password:Pwd27 /user:[email protected]. %AN% /credUsernameTarget
  130. crtest /r:[email protected] /ty:p %AN%
  131. rem Ensure we support canonicalization <domain>/user
  132. crtest /w:cat /ty:p %PE% /password:Pwd27 /user:ms.com.\u26 %AN%
  133. crtest /r:cat /ty:p %AN%
  134. rem Ensure runas support domain\user format
  135. crtest /w:ms.com\u27 /ty:p %PE% /password:Pwd27 /user:ms.com\u27 %AN% /credUsernameTarget
  136. crtest /w:ms.com\u27 /ty:p %PE% /password:Pwd27 /user:ms.com.\u27 %AN% /credUsernameTarget
  137. crtest /w:ms.com.\u27 /ty:p %PE% /password:Pwd27 /user:ms.com\u27 %AN% /credUsernameTarget
  138. crtest /w:ms.com.\u27 /ty:p %PE% /password:Pwd27 /user:ms.com.\u27 %AN% /credUsernameTarget
  139. crtest /r:ms.com\u27 /ty:p %AN%
  140. rem Ensure /Delete supports canonicalization
  141. crtest /w:cat.ms.com /ty:p %PE% /password:Pwd27 /user:ms.com.\u28 %AN%
  142. crtest /de:cat.ms.com. /ty:p %AN%
  143. crtest /w:ms.com\u29 /ty:p %PE% /password:Pwd27 /user:ms.com.\u29 %AN% /credUsernameTarget
  144. crtest /de:ms.com.\u29 /ty:p %AN%
  145. rem Create the special credentials
  146. crtest /w:* /ty:p %PE% /password:Pwd27 /user:ms.com.\u30 %AN%
  147. crtest /w:*Session /ty:p %PE% /password:Pwd27 /user:ms.com.\u30 %AN%
  148. rem Try renaming 'from' the special credentials
  149. crtest /old:* /new:bat.ms.com /ty:p
  150. crtest /r:bat.ms.com /ty:p
  151. crtest /r:* /ty:p
  152. crtest /old:*Session /new:aat.ms.com /ty:p
  153. crtest /r:aat.ms.com /ty:p
  154. crtest /r:*Session /ty:p
  155. rem Try renaming 'to' the special credentials
  156. crtest /old:bat.ms.com /new:* /ty:p
  157. crtest /r:bat.ms.com /ty:p
  158. crtest /r:* /ty:p
  159. crtest /old:aat.ms.com /new:*session /ty:p
  160. crtest /r:aat.ms.com /ty:p
  161. crtest /r:*Session /ty:p
  162. rem Create the session cred with the wrong persistance
  163. crtest /w:*Session /ty:p /pe:l /password:Pwd27 /user:ms.com.\u30 %AN%
  164. rem Rename to the session cred with the wrong persistance
  165. crtest /w:dat.ms.com /ty:p /pe:l /password:Pwd27 /user:ms.com.\u31 %AN%
  166. crtest /old:dat.ms.com /new:*session /ty:p
  167. rem test the DFS syntax
  168. crtest /w:dfsroot\dfsshare /ty:p %PE% /password:Pwd31 /user:ms.com.\u31 %AN%
  169. crtest /r /titn:dfsroot\dfsshare
  170. rem test a non-existent cert
  171. crtest /w:t28 /ty:c %PE% /com:"t28 comment" /password:Cert28 /user:@@BCIgACIgACIgACIgACIgACIgACIA %AN%