Handle exception in brute force exploits
parent
4844447d17
commit
542eb6e301
|
@ -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, "")
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue