Wrapping up the whole timeout sequence in a timeout to avoid getting stuck.
git-svn-id: file:///home/svn/framework3/trunk@8643 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
138d45d095
commit
bd35a70017
|
@ -50,6 +50,11 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
OptBool.new('VERBOSE', [ true, 'Verbose output', false])
|
OptBool.new('VERBOSE', [ true, 'Verbose output', false])
|
||||||
], Msf::Exploit::Remote::Telnet
|
], Msf::Exploit::Remote::Telnet
|
||||||
)
|
)
|
||||||
|
register_advanced_options(
|
||||||
|
[
|
||||||
|
OptInt.new('TIMEOUT', [ true, 'Default timeout for telnet connections. The greatest value of TelnetTimeout, TelnetBannerTimeout, or this option will be used as an overall timeout.', 0])
|
||||||
|
], self.class
|
||||||
|
)
|
||||||
|
|
||||||
@no_pass_prompt = []
|
@no_pass_prompt = []
|
||||||
end
|
end
|
||||||
|
@ -58,14 +63,21 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
attr_accessor :password_only
|
attr_accessor :password_only
|
||||||
|
|
||||||
def run_host(ip)
|
def run_host(ip)
|
||||||
|
overall_timeout ||= [
|
||||||
|
datastore['TIMEOUT'].to_i,
|
||||||
|
datastore['TelnetBannerTimeout'].to_i,
|
||||||
|
datastore['TelnetTimeout'].to_i
|
||||||
|
].sort.last
|
||||||
|
|
||||||
self.password_only = []
|
self.password_only = []
|
||||||
|
|
||||||
begin
|
begin
|
||||||
each_user_pass do |user, pass|
|
each_user_pass do |user, pass|
|
||||||
try_user_pass(user, pass)
|
Timeout.timeout(overall_timeout) do
|
||||||
|
try_user_pass(user, pass)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
rescue ::Rex::ConnectionError, ::EOFError
|
rescue ::Rex::ConnectionError, ::EOFError, ::Timeout::Error
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue