Announcement

Collapse
No announcement yet.

Run MS Baseline Analyser On remote Computer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run MS Baseline Analyser On remote Computer

    Follow these steps and the following VB script to add a cool tool to Hyena that will allow you to run MBSA on a whatever computer you select

    1) Install MBSA 1.2 into its default location. You can download it here: http://www.microsoft.com/technet/sec.../mbsahome.mspx
    2) Copy the below code into notepad and name it "Run MBSA.vbs" and then save it to a location of your choosing.
    3) In Hyena Select Tools, Settings, and then the Tools tab.
    4) Click the "New" button and type "Scan with MBSA" for the Caption and in the Command Line box, type "wscript.exe <path you chose in step 2>Run MBSA.vbs //I //NoLogo %E%". For example, "wscript.exe "\\Server\stevec\Hyena Scripts\Run MBSA.vbs" //I //NoLogo %E%". Now click OK.


    To use, R-click a computer in Hyena and select Tools, "Scan with MBSA".


    Start of vb script code:
    '-----------------------------

    '================================================= =========================
    '
    ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.0
    '
    ' NAME: Run MBSA.vbs
    '
    ' AUTHOR: Steve Cathersal
    ' DATE : 6/13/2004
    '
    ' COMMENT:
    '
    '================================================= =========================
    Option Explicit
    'On Error Resume Next

    Dim strComputer, intProcessID, objWMIService, colProcessList, objProcess
    Dim objArgs, objShell, ObjFileSys

    Set objArgs = WScript.Arguments ' create object with collection
    Set objShell = CreateObject("WScript.Shell")
    Set ObjFileSys= CreateObject("Scripting.FileSystemObject")

    strComputer = objArgs(0) 'assign the passed computer name to a variable

    If strComputer = "" Or IsNull(strComputer) Then
    WScript.Echo "Failure - You must have a Computer highlighted when you run this script."
    WScript.Quit
    End If


    ' Delete old report if it exists
    If ObjFileSys.FileExists("""" & objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "SecurityScans" & strComputer & ".xml""") Then
    ObjFileSys.DeleteFile("""" & objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "SecurityScans" & strComputer & ".xml""")
    End If


    ' Call MSBasline against supplied computer
    objShell.Run "%comspec% /c ""C:\Program Files\Microsoft Baseline Security Analyzer\mbsacli.exe"" /c " & strComputer & " /o " & strComputer & ".xml",1,TRUE

    'Once scan is complete open in Gui
    objShell.Run """C:\Program Files\Microsoft Baseline Security Analyzer\mbsa.exe"" """ & objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "SecurityScans" & strComputer & ".xml""",1,FALSE

  • #2
    Re: Run MS Baseline Analyser On remote Computer

    I have tried the script with no luck. I keep getting Subscript out of Range on Line 25 and Char 1. I am new to the scripting side of the house and have done some research but I had no luck. I guess I need some more instruction on the issue for resolution.

    Thanks in advance

    Comment


    • #3
      Re: Run MS Baseline Analyser On remote Computer

      Are you running this as a Hyena tool, or just executing the script by itself. I think line 25 is the Arguments portion, and if no argument is recieved in the command line calling the script, it will bomb on you.

      Comment


      • #4
        Re: Run MS Baseline Analyser On remote Computer

        I too am having problems running this. I am receiving the following error when running as a Hyena tool:

        There is no file extension in "C:\Documents and Settings\<profile name>\files\hyena\run".

        I have installed WSH 5.6, but that didn't help. Any ideas?

        Brian

        Comment


        • #5
          Re: Run MS Baseline Analyser On remote Computer

          Rename the Vbs file from "Run MBSA.vbs" to "RunMBSA.vbs" and modify the tools command line and it will work

          Comment


          • #6
            Re: Run MS Baseline Analyser On remote Computer

            Am having trouble with this one as well. I am using MBSA 2.0.1 and have updated the path to reflect the 2 at the end of the install folder. The MBSA screen comes up at the end but there is a Runtime Error on line 69 saying that an Object is required.

            Not being a scripter of any kind I have no idea what to look for.

            Anyone got any clues?

            Comment


            • #7
              Re: Run MS Baseline Analyser On remote Computer

              I messed with it a little and did the following:

              Corrected the installation location for the MBSA

              Commented the following line out by adding a ':
              objShell.Run "%comspec% /c ""C:\Program Files\Microsoft Baseline Security Analyzer 2\mbsacli.exe"" /c " & strComputer & " /o " & strComputer & ".xml",1,TRUE

              Changed it to this:
              objShell.Run "%comspec% /c ""C:\Program Files\Microsoft Baseline Security Analyzer 2\mbsacli.exe"" /target " & strComputer & " /o " & strComputer & ".xml",1,TRUE

              It appears the commandline options have changed since the original script and MBSA 2. Hope this helps.

              Comment

              Working...
              X