diff --git a/modules/post/windows/manage/exec_powershell.rb b/modules/post/windows/manage/exec_powershell.rb index e2a719be9b..7d6b75efb2 100644 --- a/modules/post/windows/manage/exec_powershell.rb +++ b/modules/post/windows/manage/exec_powershell.rb @@ -30,7 +30,7 @@ class Metasploit3 < Msf::Post register_options( [ - OptString.new( 'SCRIPT', [true, 'Path to the PS script or command string to execute' ]), + OptString.new( 'SCRIPT', [true, 'Path to the local PS script or command string to execute' ]), ], self.class) register_advanced_options( @@ -40,22 +40,18 @@ class Metasploit3 < Msf::Post end - - def run # Make sure we meet the requirements before running the script, note no need to return # unless error raise "Powershell not available" if ! have_powershell? - # Preprocess the Powershell::Script object with substitions from Exploit::Powershell - script = make_subs(read_script(datstore['SCRIPT']),process_subs(datstore['SUBSTITUTIONS'])) + # Preprocess the Powershell::Script object with substitions from Exploit::Powershell + script = make_subs(read_script(datstore['SCRIPT']),process_subs(datstore['SUBSTITUTIONS'])) - # Execute in session + # Execute in session print_status psh_exec(script) print_good('Finished!') end - - end diff --git a/modules/post/windows/manage/powershell/exec_powershell.rb b/modules/post/windows/manage/powershell/exec_powershell.rb index 7afb15379d..8707cb705e 100644 --- a/modules/post/windows/manage/powershell/exec_powershell.rb +++ b/modules/post/windows/manage/powershell/exec_powershell.rb @@ -39,7 +39,7 @@ class Metasploit3 < Msf::Post register_options( [ - OptPath.new( 'SCRIPT', [true, 'Path to the PS script', ::File.join(Msf::Config.install_root, "scripts", "ps", "msflag.ps1") ]), + OptPath.new( 'SCRIPT', [true, 'Path to the local PS script', ::File.join(Msf::Config.install_root, "scripts", "ps", "msflag.ps1") ]), ], self.class) register_advanced_options( diff --git a/modules/post/windows/manage/powershell/load_script.rb b/modules/post/windows/manage/powershell/load_script.rb index 77ddebfc97..e3d270f9e9 100644 --- a/modules/post/windows/manage/powershell/load_script.rb +++ b/modules/post/windows/manage/powershell/load_script.rb @@ -28,8 +28,8 @@ class Metasploit3 < Msf::Post register_options( [ - OptPath.new( 'SCRIPT', [false, 'Path to the PS script', ::File.join(Msf::Config.install_root, "scripts", "ps", "msflag.ps1") ]), - OptPath.new( 'FOLDER', [false, 'Path to a folder of PS scripts']) + OptPath.new( 'SCRIPT', [false, 'Path to the local PS script', ::File.join(Msf::Config.install_root, "scripts", "ps", "msflag.ps1") ]), + OptPath.new( 'FOLDER', [false, 'Path to a local folder of PS scripts']) ], self.class) end