Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/oracle/emc_sid.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Exploit::Remote::HttpClient8include Msf::Auxiliary::Scanner910def initialize11super(12'Name' => 'Oracle Enterprise Manager Control SID Discovery',13'Description' => %q{14This module makes a request to the Oracle Enterprise Manager Control Console15in an attempt to discover the SID.16},17'References' =>18[19[ 'URL', 'http://dsecrg.com/files/pub/pdf/Different_ways_to_guess_Oracle_database_SID_(eng).pdf' ],20],21'Author' => [ 'MC' ],22'License' => MSF_LICENSE23)2425register_options([Opt::RPORT(1158),])26end2728def run_host(ip)29begin30res = send_request_raw({31'uri' => '/em/console/logon/logon',32'method' => 'GET',33}, 5)3435return if not res36if (res.code == 200)37sid = res.body.scan(/Login to Database:(\w+)/)38report_note(39:host => ip,40:port => datastore['RPORT'],41:proto => 'tcp',42:type => 'oracle_sid',43:data => sid,44:update => :unique_data45)46print_status("Discovered SID: '#{sid}' for host #{ip}")47else48print_error("Unable to retrieve SID for #{ip}...")49end50rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout51rescue ::Timeout::Error, ::Errno::EPIPE52end53end54end555657