Updated to reflect HD's comments on indents and name of local script.

bug/bundler_fix
benpturner 2015-08-16 10:47:20 +01:00
parent b3754d750f
commit 8800d89424
3 changed files with 7 additions and 11 deletions

View File

@ -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

View File

@ -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(

View File

@ -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