Do a check for powershell.exe before running it.

unstable
wchen-r7 2015-05-15 11:48:21 -05:00
parent 381f6ffe0a
commit 3bc3614be6
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,7 @@
<script language="VBScript">
Set %{var_shell} = CreateObject("Wscript.Shell")
%{var_shell}.Run "%{powershell}"
Set %{var_shell} = CreateObject("Wscript.Shell")
Set %{var_fso} = CreateObject("Scripting.FileSystemObject")
If %{var_fso}.FileExists(%{var_shell}.ExpandEnvironmentStrings("%%PSModulePath%%") + "..\powershell.exe") Then
%{var_shell}.Run "%{powershell}"
End If
</script>

View File

@ -1132,6 +1132,7 @@ require 'msf/core/exe/segment_appender'
# Intialize rig and value names
rig = Rex::RandomIdentifierGenerator.new()
rig.init_var(:var_shell)
rig.init_var(:var_fso)
hash_sub = rig.to_h
hash_sub[:powershell] = powershell