Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/oracle/emc_sid.rb
19778 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Auxiliary::Report
8
include Msf::Exploit::Remote::HttpClient
9
include Msf::Auxiliary::Scanner
10
11
def initialize
12
super(
13
'Name' => 'Oracle Enterprise Manager Control SID Discovery',
14
'Description' => %q{
15
This module makes a request to the Oracle Enterprise Manager Control Console
16
in an attempt to discover the SID.
17
},
18
'References' => [
19
[ 'URL', 'http://dsecrg.com/files/pub/pdf/Different_ways_to_guess_Oracle_database_SID_(eng).pdf' ],
20
],
21
'Author' => [ 'MC' ],
22
'License' => MSF_LICENSE
23
)
24
25
register_options([Opt::RPORT(1158),])
26
end
27
28
def run_host(ip)
29
begin
30
res = send_request_raw({
31
'uri' => '/em/console/logon/logon',
32
'method' => 'GET',
33
}, 5)
34
35
return if not res
36
37
if (res.code == 200)
38
sid = res.body.scan(/Login to Database:(\w+)/)
39
report_note(
40
:host => ip,
41
:port => datastore['RPORT'],
42
:proto => 'tcp',
43
:type => 'oracle_sid',
44
:data => { :sid => sid },
45
:update => :unique_data
46
)
47
print_status("Discovered SID: '#{sid}' for host #{ip}")
48
else
49
print_error("Unable to retrieve SID for #{ip}...")
50
end
51
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
52
rescue ::Timeout::Error, ::Errno::EPIPE
53
end
54
end
55
end
56
57