Skip to content

Commit 542eb6e

Browse files
jvazquez-r7jhart-r7
authored andcommitted
Handle exception in brute force exploits
1 parent 4844447 commit 542eb6e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

modules/auxiliary/scanner/misc/sunrpc_portmapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run_host(ip)
3535
progver = 2
3636
procedure = 4
3737

38-
return unless sunrpc_create('udp', program, progver)
38+
sunrpc_create('udp', program, progver)
3939
sunrpc_authnull
4040
resp = sunrpc_call(procedure, "")
4141

modules/exploits/aix/rpc_cmsd_opcode21.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ def brute_exploit(brute_target)
103103
sunrpc_destroy
104104

105105
rescue Rex::Proto::SunRPC::RPCTimeout
106-
# print_error('RPCTimeout')
106+
vprint_error('RPCTimeout')
107+
rescue Rex::Proto::SunRPC::RPCError => e
108+
vprint_error(e.to_s)
107109
rescue EOFError
108-
# print_error('EOFError')
110+
vprint_error('EOFError')
109111
end
110112
end
111113

modules/exploits/solaris/sunrpc/sadmind_adm_build_path.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ def initialize(info = {})
9898
end
9999

100100
def brute_exploit(brute_target)
101-
sunrpc_create('udp', 100232, 10)
101+
begin
102+
sunrpc_create('udp', 100232, 10)
103+
rescue Rex::Proto::SunRPC::RPCTimeout, Rex::Proto::SunRPC::RPCError => e
104+
vprint_error(e.to_s)
105+
return
106+
end
102107

103108
unless @nops
104109
print_status('Creating nop block...')
@@ -145,6 +150,8 @@ def brute_exploit(brute_target)
145150
sunrpc_call(1, request, 2)
146151
rescue Rex::Proto::SunRPC::RPCTimeout
147152
print_status('Server did not respond, this is expected')
153+
rescue Rex::Proto::SunRPC::RPCError => e
154+
print_error(e.to_s)
148155
end
149156

150157
sunrpc_destroy

0 commit comments

Comments
 (0)