2010-05-03 17:13:09 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
2008-11-23 19:42:42 +00:00
|
|
|
##
|
2009-12-13 06:56:01 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-11-23 19:42:42 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-11-23 19:42:42 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2009-12-13 06:56:01 +00:00
|
|
|
|
2008-11-23 19:42:42 +00:00
|
|
|
# Exploit mixins should be called first
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::WMAPScanServer
|
|
|
|
# Scanner mixin should be near last
|
|
|
|
include Msf::Auxiliary::Scanner
|
2009-04-15 04:15:25 +00:00
|
|
|
include Msf::Auxiliary::Report
|
2008-11-23 19:42:42 +00:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'HTTP Options Detection',
|
2009-07-19 17:27:36 +00:00
|
|
|
'Version' => '$Revision$',
|
2008-11-23 19:42:42 +00:00
|
|
|
'Description' => 'Display available HTTP options for each system',
|
2009-01-08 01:57:28 +00:00
|
|
|
'Author' => ['CG'],
|
2011-03-25 17:03:16 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2005-3398'],
|
|
|
|
[ 'CVE', '2005-3498'],
|
|
|
|
[ 'OSVDB', '877'],
|
|
|
|
[ 'BID', '11604'],
|
|
|
|
[ 'BID', '9506'],
|
|
|
|
[ 'BID', '9561']
|
|
|
|
]
|
2008-11-23 19:42:42 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2009-04-15 04:15:25 +00:00
|
|
|
def run_host(target_host)
|
2008-11-23 19:42:42 +00:00
|
|
|
|
|
|
|
begin
|
|
|
|
res = send_request_raw({
|
|
|
|
'version' => '1.0',
|
2009-12-13 06:56:01 +00:00
|
|
|
'uri' => '/',
|
2008-11-23 19:42:42 +00:00
|
|
|
'method' => 'OPTIONS'
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
if (res and res.headers['Allow'])
|
2009-04-15 04:15:25 +00:00
|
|
|
print_status("#{target_host} allows #{res.headers['Allow']} methods")
|
2008-11-23 19:42:42 +00:00
|
|
|
|
2009-04-15 04:15:25 +00:00
|
|
|
report_note(
|
2009-11-25 06:08:28 +00:00
|
|
|
:host => target_host,
|
2011-02-04 01:54:32 +00:00
|
|
|
:proto => 'tcp',
|
2011-02-22 20:49:44 +00:00
|
|
|
:sname => 'HTTP',
|
2009-11-25 06:08:28 +00:00
|
|
|
:port => rport,
|
|
|
|
:type => 'HTTP_OPTIONS',
|
|
|
|
:data => res.headers['Allow']
|
|
|
|
)
|
2009-04-15 04:15:25 +00:00
|
|
|
|
2009-12-13 06:56:01 +00:00
|
|
|
if(res.headers['Allow'].index('TRACE'))
|
2011-05-15 22:19:00 +00:00
|
|
|
print_status "#{target_host}:#{rport} - TRACE method allowed."
|
2010-02-02 23:11:18 +00:00
|
|
|
report_vuln(
|
2009-12-13 06:56:01 +00:00
|
|
|
:host => target_host,
|
|
|
|
:port => rport,
|
2011-02-04 01:54:32 +00:00
|
|
|
:proto => 'tcp',
|
2011-02-22 20:49:44 +00:00
|
|
|
:sname => 'http',
|
2011-03-25 17:03:16 +00:00
|
|
|
:name => self.fullname,
|
2010-06-17 14:03:53 +00:00
|
|
|
:info => res.headers['Allow'],
|
2011-05-15 22:19:00 +00:00
|
|
|
:refs => self.references,
|
|
|
|
:exploited_at => Time.now.utc
|
2009-12-13 06:56:01 +00:00
|
|
|
)
|
|
|
|
end
|
2008-11-23 19:42:42 +00:00
|
|
|
end
|
2009-12-13 06:56:01 +00:00
|
|
|
|
2008-11-23 19:42:42 +00:00
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|