Skip to content

Commit 46a0ec8

Browse files
committed
Make timeout for Powershell scripts configurable
1 parent bd0a20a commit 46a0ec8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/post/windows/gather/outlook.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ def initialize(info={})
4242
OptString.new('A_TRANSLATION', [ false, 'Fill in the translation of the word "Allow" in the targets system language, to click on the security popup.' ]),
4343
OptString.new('ACF_TRANSLATION', [ false, 'Fill in the translation of the phrase "Allow access for" in the targets system language, to click on the security popup.' ]),
4444
], self.class)
45+
46+
register_advanced_options(
47+
[
48+
OptInt.new('TIMEOUT', [true, 'The maximum time (in seconds) to wait for any Powershell scripts to complete', 120])
49+
], self.class)
4550
end
4651

4752
def execute_outlook_script(command)
4853
base_script = File.read(File.join(Msf::Config.data_directory, "post", "powershell", "outlook.ps1"))
4954
psh_script = base_script << command
5055
compressed_script = compress_script(psh_script)
51-
cmd_out, runnings_pids, open_channels = execute_script(compressed_script, 120)
56+
cmd_out, runnings_pids, open_channels = execute_script(compressed_script, datastore['TIMEOUT'])
5257
while(d = cmd_out.channel.read)
5358
print ("#{d}")
5459
end

0 commit comments

Comments
 (0)