Skip to content

Commit e520ace

Browse files
committed
Stash
1 parent 1565203 commit e520ace

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

lib/msf/core/exploit/remote/browser_exploit_server.rb

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class BESException < RuntimeError; end
6464
:java, # Example: Return '1.6', or maybe '1.6.0.0' (depends)
6565
:mshtml_build, # mshtml build. Example: Returns "65535"
6666
: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;",
6868
:activex # Example: [{:clsid=>'String', :method=>'String'}]
6969
])
7070

@@ -187,15 +187,9 @@ def try_set_target(profile)
187187
end
188188
end
189189

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
198190

191+
def has_bad_activex?(ax)
192+
return true unless ax.split(';').empty?
199193
false
200194
end
201195

@@ -211,7 +205,7 @@ def get_bad_requirements(profile)
211205
vprint_debug("Comparing requirement: #{k}=#{expected} vs #{k}=#{profile[k.to_sym]}")
212206

213207
if k == :activex
214-
bad_reqs << k unless has_bad_activex?(v)
208+
bad_reqs << k unless has_bad_activex?(profile[k.to_sym])
215209
elsif k == :vuln_test
216210
bad_reqs << k unless profile[k.to_sym].to_s == 'true'
217211
elsif v.is_a? Regexp
@@ -365,9 +359,12 @@ def has_proxy?(request)
365359
# @param user_agent [String] The user-agent of the browser
366360
# @return [String] Returns the HTML for detection
367361
def get_detection_html(user_agent)
362+
print_debug(user_agent)
368363
ua_info = fingerprint_user_agent(user_agent)
369364
os = ua_info[:os_name]
370365
client = ua_info[:ua_name]
366+
print_debug(os.inspect)
367+
print_debug(client.inspect)
371368

372369
code = ERB.new(%Q|
373370
<%= js_base64 %>
@@ -406,14 +403,12 @@ def get_detection_html(user_agent)
406403
<%
407404
activex = @requirements[:activex]
408405
if activex
409-
%>
410-
d['activex'] = '';
411-
<%
412406
activex.each do \|a\|
413407
clsid = a[:clsid]
414408
method = a[:method]
415409
%>
416410
var ax = ie_addons_detect.hasActiveX('<%=clsid%>', '<%=method%>');
411+
d['activex'] = '';
417412
if (ax == false) {
418413
d['activex'] += "<%=clsid%>=<%=method%>;";
419414
}
@@ -433,7 +428,7 @@ def get_detection_html(user_agent)
433428

434429
%Q|
435430
<script>
436-
#{js}
431+
#{code}
437432
</script>
438433
<noscript>
439434
<img style="visibility:hidden" src="#{get_resource.chomp("/")}/#{@noscript_receiver_page}/">

0 commit comments

Comments
 (0)