Lucene search
+L

Oracle TNS Listener Service Version Query

🗓️ 30 Apr 2009 15:51:06Reported by CG <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 11 Views

Oracle TNS Listener Service Version Quer

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
  include Msf::Auxiliary::Report
  include Msf::Auxiliary::Scanner
  include Msf::Exploit::Remote::TNS

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Oracle TNS Listener Service Version Query',
      'Description'    => %q{
        This module simply queries the tnslsnr service for the Oracle build.
      },
      'Author'         => ['CG'],
      'License'        => MSF_LICENSE,
      'DisclosureDate' => '2009-01-07'))

    register_options(
      [
        Opt::RPORT(1521)
      ])
  end

  def run_host(ip)
    begin
      connect

      pkt = tns_packet("(CONNECT_DATA=(COMMAND=VERSION))")

      sock.put(pkt)

      select(nil,nil,nil,0.5)

      data = sock.get_once

        if ( data && data =~ /\\*.TNSLSNR for (.*)/ )
          ora_version = data.match(/\\*.TNSLSNR for (.*)/)[1]
          report_service(
            :host => ip,
            :port => datastore['RPORT'],
            :name => "oracle",
            :info => ora_version
          )
          print_good("#{ip}:#{datastore['RPORT']} Oracle - Version: " + ora_version)
        elsif ( data && data =~ /\(ERR=(\d+)\)/ )
          case $1.to_i
          when 1189
            print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown - Error code #{$1} - The listener could not authenticate the user")
          else
            print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown - Error code #{$1}")
          end
        else
          print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown")
        end
      disconnect
    rescue ::Rex::ConnectionError
    rescue ::Errno::EPIPE
    end
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

02 Oct 2020 20:00Current
0.4Low risk
Vulners AI Score0.4
11