Making sure we connect to RMI

GSoC/Meterpreter_Web_Console
Sergey Gorbaty 2018-07-30 23:25:32 -07:00
parent c3534a479e
commit a0b7a4986e
1 changed files with 10 additions and 2 deletions

View File

@ -44,9 +44,17 @@ class MetasploitModule < Msf::Auxiliary
end
mbean_server = discover_endpoint
disconnect
if mbean_server.nil?
print_status("#{rhost}:#{rport} Java JMX MBean not detected")
return
end
connect(true, { 'RHOST' => mbean_server[:address], 'RPORT' => mbean_server[:port] })
unless is_rmi?
print_status("#{rhost}:#{rport} Java JMX RMI not detected")
disconnect
return
end
@ -55,10 +63,10 @@ class MetasploitModule < Msf::Auxiliary
disconnect
if jmx_endpoint == false
print_status("#{rhost}:#{rport} Java JMX MBean authenticated")
print_status("#{mbean_server[:address]}:#{mbean_server[:port]} Java JMX MBean authentication required")
return
elsif jmx_endpoint.nil?
print_status("#{rhost}:#{rport} Java JMX MBean status unknown")
print_status("#{mbean_server[:address]}:#{mbean_server[:port]} Java JMX MBean status unknown")
return
end