2008-11-23 19:42:42 +00:00
|
|
|
##
|
|
|
|
# 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.
|
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
|
|
|
|
|
|
|
|
# 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'],
|
2008-11-23 19:42:42 +00:00
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
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',
|
|
|
|
'uri' => '*',
|
|
|
|
'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
|
|
|
|
|
|
|
rep_id = wmap_base_report_id(
|
2009-03-28 17:45:14 +00:00
|
|
|
wmap_target_host,
|
|
|
|
wmap_target_port,
|
|
|
|
wmap_target_ssl
|
2008-11-23 19:42:42 +00:00
|
|
|
)
|
2009-04-15 04:15:25 +00:00
|
|
|
|
|
|
|
report_note(
|
|
|
|
:host => target_host,
|
|
|
|
:proto => 'HTTP',
|
|
|
|
:port => rport,
|
|
|
|
:type => 'HTTP_OPTIONS',
|
|
|
|
:data => res.headers['Allow']
|
|
|
|
)
|
|
|
|
|
2008-11-23 19:42:42 +00:00
|
|
|
wmap_report(rep_id,'WEB_SERVER','OPTIONS',"#{res.headers['Allow']}",nil)
|
2008-11-30 22:41:09 +00:00
|
|
|
else
|
|
|
|
print_status("No options.")
|
2008-11-23 19:42:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|