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.

105 lines
2.6 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>SCE-XML Analysis Export with VBScript</TITLE>
  4. <SCRIPT LANGUAGE="VBScript">
  5. dim SecDB
  6. set SecDB = CreateObject("SecMan.SecurityDatabase")
  7. sub cmdImport_OnClick
  8. SecDB.FileName=document.importForm.sdbFile.value
  9. MsgBox SecDB.FileName
  10. SecDB.ImportTemplateFile document.importForm.infFile.value
  11. MsgBox "Done!"
  12. end sub
  13. sub cmdAnalyze_OnClick
  14. SecDB.FileName=document.analyzeForm.sdbFile.value
  15. SecDB.Analyze ()
  16. MsgBox "Done!"
  17. end sub
  18. sub cmdExport_OnClick
  19. SecDB.FileName=document.exportForm.inFile.value
  20. SecDB.ExportAnalysisToXML document.exportForm.outFile.value, ""
  21. MsgBox "Done!"
  22. end sub
  23. sub cmdViewXML_OnClick
  24. window.open (document.exportForm.outFile.value)
  25. end sub
  26. sub cmdTransform_OnClick
  27. dim fso, file1
  28. Set fso = CreateObject("Scripting.FileSystemObject")
  29. Set sourceFile = fso.OpenTextFile(document.transForm.xmlFile.value)
  30. contents = sourceFile.ReadAll
  31. sourceFile.Close
  32. Set file1 = fso.CreateTextFile(document.transForm.xmlFile.value)
  33. file1.WriteLine("<?xml-stylesheet type='text/xsl' href='c:\public\scexml.xslt'?>")
  34. file1.WriteLine(contents)
  35. file1.Close
  36. MsgBox "Done!"
  37. end sub
  38. sub cmdViewXML2_OnClick
  39. window.open (document.transForm.xmlFile.value)
  40. end sub
  41. </SCRIPT>
  42. </HEAD>
  43. <BODY>
  44. <HR><H2>1. Import an INF template:</H2>
  45. <FORM NAME="importForm">
  46. INF Template to import:<BR>
  47. <INPUT TYPE="File" NAME="infFile" SIZE="100""><BR>
  48. Security Database to import to:<BR>
  49. <INPUT TYPE="File" NAME="sdbFile" SIZE="100""> <BR>
  50. <INPUT TYPE="Button" NAME="cmdImport" VALUE="Import">
  51. </FORM>
  52. <HR><H2>2. Perform Analysis</H2>
  53. <FORM NAME="analyzeForm">
  54. Security Database to analyze:<BR>
  55. <INPUT TYPE="File" NAME="sdbFile" SIZE="100""> <BR>
  56. <INPUT TYPE="Button" NAME="cmdAnalyze" VALUE="Analyze System">
  57. </FORM>
  58. <HR><H2>3. Export Analysis Results to XML</H2>
  59. <FORM NAME="exportForm">
  60. Security Database to export:<BR>
  61. <INPUT TYPE="File" NAME="inFile" SIZE="100""><BR>
  62. XML output file:<BR>
  63. <INPUT TYPE="File" NAME="outFile" SIZE="100""> <BR>
  64. <INPUT TYPE="Button" NAME="cmdExport" VALUE="Export">
  65. <INPUT TYPE="Button" NAME="cmdViewXML" VALUE="ViewXML">
  66. </FORM>
  67. <HR><H2>4. Apply XSLT to XML</H2>
  68. <FORM NAME="transForm">
  69. XML file:<BR>
  70. <INPUT TYPE="File" NAME="xmlFile" SIZE="100""><BR>
  71. <INPUT TYPE="Button" NAME="cmdTransform" VALUE="Transform">
  72. <INPUT TYPE="Button" NAME="cmdViewXML2" VALUE="ViewXML">
  73. </FORM>
  74. </BODY>