Do a check for powershell.exe before running it.
parent
381f6ffe0a
commit
3bc3614be6
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue