Skip to content

Commit bc9a402

Browse files
committed
Land rapid7#7214, print_brute ip:rport fix
2 parents 2b6576b + 5f8ef66 commit bc9a402

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/msf/core/auxiliary/auth_brute.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,12 @@ def build_brute_message(host_ip,host_port,proto,msg,legacy)
594594
msg_regex = /(#{ip})(:#{port})?(\s*-?\s*)(#{proto.to_s})?(\s*-?\s*)(.*)/ni
595595
if old_msg.match(msg_regex) and !old_msg.match(msg_regex)[6].to_s.strip.empty?
596596
complete_message = ''
597-
complete_message << (old_msg.match(msg_regex)[4] || proto).to_s
597+
unless ip.blank? && port.blank?
598+
complete_message << "#{ip}:#{rport}"
599+
else
600+
complete_message << (old_msg.match(msg_regex)[4] || proto).to_s
601+
end
602+
598603
complete_message << " - "
599604
progress = tried_over_total(ip,port)
600605
complete_message << progress if progress

modules/auxiliary/scanner/http/tomcat_mgr_login.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ def run_host(ip)
128128
print_good "#{ip}:#{rport} - LOGIN SUCCESSFUL: #{result.credential}"
129129
else
130130
invalidate_login(credential_data)
131-
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status}: #{result.proof})"
131+
if result.proof
132+
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status}: #{result.proof})"
133+
else
134+
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"
135+
end
132136
end
133137
end
134138
end

0 commit comments

Comments
 (0)