From 4ac15b3a835a841f854fa73106ae65e9f65785c9 Mon Sep 17 00:00:00 2001 From: cg <> Date: Wed, 7 Jan 2009 23:34:03 +0000 Subject: [PATCH] oracle version auxiliary module using tns mixin git-svn-id: file:///home/svn/framework3/trunk@6087 4d416f70-5f16-0410-b530-b9f4589650da --- .../scanner/oracle/oracle_version.rb | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 modules/auxiliary/scanner/oracle/oracle_version.rb diff --git a/modules/auxiliary/scanner/oracle/oracle_version.rb b/modules/auxiliary/scanner/oracle/oracle_version.rb new file mode 100644 index 0000000000..4d3ea543c7 --- /dev/null +++ b/modules/auxiliary/scanner/oracle/oracle_version.rb @@ -0,0 +1,60 @@ +## +# This file is part of the Metasploit Framework and may be subject to +# redistribution and commercial restrictions. Please see the Metasploit +# Framework web site for more information on licensing and terms of use. +# http://metasploit.com/projects/Framework/ +## + +require 'msf/core' + +class Metasploit3 < Msf::Auxiliary + + include Msf::Exploit::Remote::TNS + + def initialize(info = {}) + super(update_info(info, + 'Name' => 'Oracle Version Enumeration.', + 'Description' => %q{ + This module simply queries the TNS listner for the Oracle build.. + }, + 'Author' => [ 'CG'], + 'License' => MSF_LICENSE, + 'Version' => '$Revision$', + 'DisclosureDate' => 'Jan 7 2009')) + + register_options( + [ + Opt::RPORT(1521), + ], self.class) + + end + + def run + + connect_data = "(CONNECT_DATA=(COMMAND=VERSION))" + + pkt = tns_packet(connect_data) + + begin + connect + rescue => e + print_error("#{e}") + return false + end + + sock.put(pkt) + + sleep(0.5) + + data = sock.get_once + + if ( data and data =~ /\\*.TNSLSNR for (.*)/ ) + return print_status("Host #{rhost} is running: " + $1) + else + return print_error("Unable to determine version info for #{rhost}...") + + disconnect + + end + end +end