@@ -64,7 +64,7 @@ class BESException < RuntimeError; end
64
64
:java , # Example: Return '1.6', or maybe '1.6.0.0' (depends)
65
65
:mshtml_build , # mshtml build. Example: Returns "65535"
66
66
:flash , # Example: Returns "12.0" (chrome/ff) or "12.0.0.77" (IE)
67
- :vuln_test # Example: "if(window.MyComponentIsInstalled)return true;",
67
+ :vuln_test , # Example: "if(window.MyComponentIsInstalled)return true;",
68
68
:activex # Example: [{:clsid=>'String', :method=>'String'}]
69
69
] )
70
70
@@ -187,15 +187,9 @@ def try_set_target(profile)
187
187
end
188
188
end
189
189
190
- # Returns true if a bad ActiveX is found, otherwise false
191
- #
192
- # @param expected_ax [Array] ActiveX requirements set by the module
193
- def has_bad_activex? ( user_ax )
194
- user_ax . each do |a |
195
- found = a [ :found ]
196
- return true unless found
197
- end
198
190
191
+ def has_bad_activex? ( ax )
192
+ return true unless ax . split ( ';' ) . empty?
199
193
false
200
194
end
201
195
@@ -211,7 +205,7 @@ def get_bad_requirements(profile)
211
205
vprint_debug ( "Comparing requirement: #{ k } =#{ expected } vs #{ k } =#{ profile [ k . to_sym ] } " )
212
206
213
207
if k == :activex
214
- bad_reqs << k unless has_bad_activex? ( v )
208
+ bad_reqs << k unless has_bad_activex? ( profile [ k . to_sym ] )
215
209
elsif k == :vuln_test
216
210
bad_reqs << k unless profile [ k . to_sym ] . to_s == 'true'
217
211
elsif v . is_a? Regexp
@@ -365,9 +359,12 @@ def has_proxy?(request)
365
359
# @param user_agent [String] The user-agent of the browser
366
360
# @return [String] Returns the HTML for detection
367
361
def get_detection_html ( user_agent )
362
+ print_debug ( user_agent )
368
363
ua_info = fingerprint_user_agent ( user_agent )
369
364
os = ua_info [ :os_name ]
370
365
client = ua_info [ :ua_name ]
366
+ print_debug ( os . inspect )
367
+ print_debug ( client . inspect )
371
368
372
369
code = ERB . new ( %Q|
373
370
<%= js_base64 %>
@@ -406,14 +403,12 @@ def get_detection_html(user_agent)
406
403
<%
407
404
activex = @requirements[:activex]
408
405
if activex
409
- %>
410
- d['activex'] = '';
411
- <%
412
406
activex.each do \| a\|
413
407
clsid = a[:clsid]
414
408
method = a[:method]
415
409
%>
416
410
var ax = ie_addons_detect.hasActiveX('<%=clsid%>', '<%=method%>');
411
+ d['activex'] = '';
417
412
if (ax == false) {
418
413
d['activex'] += "<%=clsid%>=<%=method%>;";
419
414
}
@@ -433,7 +428,7 @@ def get_detection_html(user_agent)
433
428
434
429
%Q|
435
430
<script>
436
- #{ js }
431
+ #{ code }
437
432
</script>
438
433
<noscript>
439
434
<img style="visibility:hidden" src="#{ get_resource . chomp ( "/" ) } /#{ @noscript_receiver_page } /">
0 commit comments