Handle exception in brute force exploits

bug/bundler_fix
jvazquez-r7 2014-11-18 11:20:41 -06:00 committed by Jon Hart
parent 4844447d17
commit 542eb6e301
3 changed files with 13 additions and 4 deletions

View File

@ -35,7 +35,7 @@ class Metasploit3 < Msf::Auxiliary
progver = 2
procedure = 4
return unless sunrpc_create('udp', program, progver)
sunrpc_create('udp', program, progver)
sunrpc_authnull
resp = sunrpc_call(procedure, "")

View File

@ -103,9 +103,11 @@ class Metasploit3 < Msf::Exploit::Remote
sunrpc_destroy
rescue Rex::Proto::SunRPC::RPCTimeout
# print_error('RPCTimeout')
vprint_error('RPCTimeout')
rescue Rex::Proto::SunRPC::RPCError => e
vprint_error(e.to_s)
rescue EOFError
# print_error('EOFError')
vprint_error('EOFError')
end
end

View File

@ -98,7 +98,12 @@ class Metasploit3 < Msf::Exploit::Remote
end
def brute_exploit(brute_target)
sunrpc_create('udp', 100232, 10)
begin
sunrpc_create('udp', 100232, 10)
rescue Rex::Proto::SunRPC::RPCTimeout, Rex::Proto::SunRPC::RPCError => e
vprint_error(e.to_s)
return
end
unless @nops
print_status('Creating nop block...')
@ -145,6 +150,8 @@ class Metasploit3 < Msf::Exploit::Remote
sunrpc_call(1, request, 2)
rescue Rex::Proto::SunRPC::RPCTimeout
print_status('Server did not respond, this is expected')
rescue Rex::Proto::SunRPC::RPCError => e
print_error(e.to_s)
end
sunrpc_destroy