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.

173 lines
5.4 KiB

  1. REM - Functional test script for IPSECPOL
  2. REM - by RandyRam and DKalin
  3. REM - Tests all flags in both modes
  4. REM - Verification is manual :( for now
  5. set WORKINGDIR=
  6. REM - This is for boundschecker or ntsd
  7. REM - each ipsecpol execution will be preceded with it
  8. set PREAMBLE=
  9. rem set PREAMBLE=ntsd -gG
  10. set IPSECPOL=ipseccmd.exe
  11. pushd %WORKINGDIR%
  12. net stop policyagent && net start policyagent
  13. if "%1"=="STATIC" goto STATIC
  14. REM -------------------
  15. REM - Dynamic Mode -
  16. REM -------------------
  17. echo General Test
  18. %PREAMBLE% %IPSECPOL% -f 10.*+11.* 172.31.240.0/255.255.248.0+157.55.0.0/255.255.0.0 144.92.*:21+144.93.*::TCP *+dkalin-00:5000:UDP -n AH[MD5] -aK PRE:supercalifragilisticexpialidocious -1s des-md5-1 3DES-Sha-2 dEs-MD5-1 -1k 20000S/20Q -1e 400 -1f0+* 10.*+11.* dkalin-00=dkalin-04 -confirm
  19. %PREAMBLE% %IPSECPOL% -f 10.*+11.*::TCP 172.31.232.0/255.255.248.0+157.54.0.0/255.255.0.0 144.94.*:21+144.95.*::TCP *+dkalin-00:5001:UDP -n AH[MD5]PFS esp[Des,sha]PFS Ah[Sha]+ESP[3des,NONE]21000K/600SPFS -aK CERT:"CN=CA1, OU=O, O=MEME,L=X, S=WA, C=DE, E=ME@here" -1p -confirm
  20. pause Check settings and press any key
  21. %PREAMBLE% %IPSECPOL% show filters
  22. pause Check settings and press any key
  23. echo Tunnel test
  24. %PREAMBLE% %IPSECPOL% -f 10.11.12.*=12.11.10.*::ICMP 10.11.12.*=12.11.10.*::TCP -t 12.11.10.1 -confirm
  25. %PREAMBLE% %IPSECPOL% -f 12.11.10.*=10.11.12.*::ICMP 12.11.10.*=10.11.12.*::TCP -t 10.11.12.1 -confirm
  26. pause Check settings and press any key
  27. %PREAMBLE% %IPSECPOL% show filters
  28. pause Check settings and press any key
  29. echo Me to Any dialup, soft
  30. %PREAMBLE% %IPSECPOL% -f 0+* -n AH[MD5] -dialup -soft -confirm
  31. pause Check settings and press any key
  32. %PREAMBLE% %IPSECPOL% show filters policies
  33. pause Check settings and press any key
  34. echo Shutting down PA test/dangling p1 flag
  35. net stop policyagent
  36. %PREAMBLE% %IPSECPOL% \\%COMPUTERNAME% -f (0+*) [0+products2]
  37. pause Check settings and press any key
  38. %PREAMBLE% %IPSECPOL% \\%COMPUTERNAME% show filters stats
  39. pause Check settings and press any key
  40. REM To test in dynamic mode yet:
  41. rem - pathos
  42. rem - lower case KSQ
  43. if "%1"=="DYNAMIC" goto EOF
  44. %PREAMBLE% %IPSECPOL% -u
  45. :STATIC
  46. echo Basic policy creation, using all flags
  47. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":100 -r Rule1 -f 0=* 10.*+11.* 172.31.240.0/255.255.248.0+157.55.0.0/255.255.0.0 144.92.*:21+144.93.*::TCP *+dkalin-00:5000:UDP -n AH[MD5] esp[Des,sha] Ah[Sha]+ESP[3des,NONE]21000K/600SPFS -aK -1s des-md5-1 3DES-Sha-2 dEs-MD5-1 -1k 20000S/20Q -x
  48. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":100 -r Rule10 -f *=0 12.*+13.* 172.31.232.0/255.255.248.0+157.54.0.0/255.255.0.0 144.94.*:21+144.95.*::TCP *+dkalin-00:5001:UDP -a PRE:supercalifragilisticexpialidocious CERT:"CN=CA1, OU=O, O=MEME,L=X, S=WA, C=DE, E=ME@here" -1s des-md5-1 3DES-Sha-2 dEs-MD5-1 -1k 20000S/20Q -x
  49. pause Check settings and press any key
  50. %PREAMBLE% %IPSECPOL% show filters auth
  51. pause Check settings and press any key
  52. echo Basic policy update, using all flags
  53. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":100 -r Rule1 -f 0+1.1.1.1 -n AH[MD5] INPASS -soft -aK -t 129.2.2.2 -lan -1s DES-SHA-1 -1k 20000S/20Q
  54. pause Check settings and press any key
  55. %PREAMBLE% %IPSECPOL% show filters sas
  56. pause Check settings and press any key
  57. net stop policyagent
  58. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":3 -r Rule2 -f 0+172.* -n BLOCK -1s DES-SHA-1 -1k 20000S/20Q -x
  59. pause Check settings and press any key
  60. %PREAMBLE% %IPSECPOL% show all
  61. pause Check settings and press any key
  62. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":3 -r Rule3 -f 0+172.* -n PASS -1p -1s DES-SHA-1 -y
  63. pause Check settings and press any key
  64. %PREAMBLE% %IPSECPOL% show filters
  65. pause Check settings and press any key
  66. %PREAMBLE% %IPSECPOL% -w REG -p "IPSECPOL TEST":3 -r Rule3 -o
  67. pause Check settings and press any key
  68. %PREAMBLE% %IPSECPOL% show filters
  69. pause Check settings and press any key
  70. echo DS policy creation
  71. %PREAMBLE% %IPSECPOL% -w DS -p "IPSECPOL TEST":100 -r Rule1 -f 0=* 10.*+11.* 172.31.240.0/255.255.248.0+157.55.0.0/255.255.0.0 144.92.*:21+144.93.*::TCP *+dkalin-00:5000:UDP -n AH[MD5] esp[Des,sha] Ah[Sha]+ESP[3des,NONE]21000K/600SPFS -aK -1s des-md5-1 3DES-Sha-2 dEs-MD5-1 -1k 20000S/20Q
  72. pause Check settings and press any key
  73. %PREAMBLE% %IPSECPOL% show filters
  74. pause Check settings and press any key
  75. %PREAMBLE% %IPSECPOL% -w DS -p "IPSECPOL TEST":100 -r Rule1 -o
  76. pause Check settings and press any key
  77. %PREAMBLE% %IPSECPOL% show filters
  78. pause Check settings and press any key
  79. echo policy creation using remote registry apis
  80. %PREAMBLE% %IPSECPOL% -w REG:%COMPUTERNAME% -p "IPSECPOL TEST":100 -r Rule1 -f 0=* 10.*+11.* 172.31.240.0/255.255.248.0+157.55.0.0/255.255.0.0 144.92.*:21+144.93.*::TCP *+dkalin-00:5000:UDP -n AH[MD5] esp[Des,sha] Ah[Sha]+ESP[3des,NONE]21000K/600SPFS -aK -1s des-md5-1 3DES-Sha-2 dEs-MD5-1 -1k 20000S/20Q
  81. pause Check settings and press any key
  82. %PREAMBLE% %IPSECPOL% show filters
  83. pause Check settings and press any key
  84. %PREAMBLE% %IPSECPOL% -w REG:%COMPUTERNAME% -p "IPSECPOL TEST":100 -r Rule1 -o
  85. pause Check settings and press any key
  86. %PREAMBLE% %IPSECPOL% show filters
  87. pause Check settings and press any key
  88. echo ******************************
  89. echo Don't forget to check the test
  90. echo version stuff: min rekey params
  91. echo des40, and export group
  92. echo ******************************
  93. :EOF
  94. echo removing stuff
  95. %PREAMBLE% %IPSECPOL% -u
  96. pause Check settings and press any key
  97. %PREAMBLE% %IPSECPOL% show all
  98. pause Check settings and press any key
  99. popd