From afe28523f318930c76330c1fca42d4e39adeb7ea Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 17 Apr 2012 18:54:26 -0600 Subject: [PATCH] Puts testAXO() on window so we can access it from anywhere Also uses the new :method property which allows an array syntax. See ie_createobject for a usage example. --- modules/auxiliary/server/browser_autopwn.rb | 50 +++++++-------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/modules/auxiliary/server/browser_autopwn.rb b/modules/auxiliary/server/browser_autopwn.rb index 3b105c31d1..0b3498d05e 100644 --- a/modules/auxiliary/server/browser_autopwn.rb +++ b/modules/auxiliary/server/browser_autopwn.rb @@ -230,24 +230,7 @@ class Metasploit3 < Msf::Auxiliary ENDJS if (datastore['DEBUG']) - print_status("Adding debug code") - @init_js << <<-ENDJS - if (!(typeof(debug) == 'function')) { - function htmlentities(str) { - str = str.replace(/>/g, '>'); - str = str.replace(/"')} @@ -699,7 +685,7 @@ class Metasploit3 < Msf::Auxiliary return true; } return false; - } + }; ENDJS # End of IE-specific test functions end @@ -719,9 +705,9 @@ class Metasploit3 < Msf::Auxiliary document.body.innerHTML += (str); } window.next_exploit = function (exploit_idx) { - #{js_debug("'next_exploit(' + exploit_idx +')'")} + #{js_debug("'next_exploit(' + exploit_idx +')
'")} if (!global_exploit_list[exploit_idx]) { - #{js_debug("'End'")} + #{js_debug("'End
'")} return; } #{js_debug("'trying ' + global_exploit_list[exploit_idx].resource + '
'")} @@ -739,8 +725,6 @@ class Metasploit3 < Msf::Auxiliary //document.body.appendChild(tn); if (!test) { test = "true"; - } else { - test = "try {" + test + "} catch (e) { is_vuln = false; }; is_vuln"; } if (eval(test)) {