CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/oracle/emc_sid.rb
Views: 1904
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
[
20
[ 'URL', 'http://dsecrg.com/files/pub/pdf/Different_ways_to_guess_Oracle_database_SID_(eng).pdf' ],
21
],
22
'Author' => [ 'MC' ],
23
'License' => MSF_LICENSE
24
)
25
26
register_options([Opt::RPORT(1158),])
27
end
28
29
def run_host(ip)
30
begin
31
res = send_request_raw({
32
'uri' => '/em/console/logon/logon',
33
'method' => 'GET',
34
}, 5)
35
36
return if not res
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,
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