From 9dbdaf13ea2af65e641d5ec0d109f0c38b8fd5fe Mon Sep 17 00:00:00 2001 From: OJ Date: Wed, 17 Jun 2015 00:20:59 +1000 Subject: [PATCH] Add AutoVerifySessionTimeout Meterpreter advanced option --- lib/msf/base/sessions/meterpreter_options.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/msf/base/sessions/meterpreter_options.rb b/lib/msf/base/sessions/meterpreter_options.rb index aa0b5c4136..b070950371 100644 --- a/lib/msf/base/sessions/meterpreter_options.rb +++ b/lib/msf/base/sessions/meterpreter_options.rb @@ -13,6 +13,7 @@ module MeterpreterOptions [ OptBool.new('AutoLoadStdapi', [true, "Automatically load the Stdapi extension", true]), OptBool.new('AutoVerifySession', [true, "Automatically verify and drop invalid sessions", true]), + OptInt.new('AutoVerifySessionTimeout', [false, "Timeout period to wait for session validation to occur, in seconds", 10]), OptString.new('InitialAutoRunScript', [false, "An initial script to run on session creation (before AutoRunScript)", '']), OptString.new('AutoRunScript', [false, "A script to run automatically on session creation.", '']), OptBool.new('AutoSystemInfo', [true, "Automatically capture system information on initialization.", true]), @@ -43,7 +44,7 @@ module MeterpreterOptions valid = true if datastore['AutoVerifySession'] == true - if not session.is_valid_session? + if not session.is_valid_session?(datastore['AutoVerifySessionTimeout'].to_i) print_error("Meterpreter session #{session.sid} is not valid and will be closed") valid = false end