Avoid String.fromCharCode which gets detected

bug/bundler_fix
Jeff Tang 2017-02-22 14:13:18 -05:00
parent 48f6740fee
commit 8ce10ac591
66 changed files with 73 additions and 73 deletions

View File

@ -372,7 +372,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
swf_uri = ('/' == get_resource[-1,1]) ? get_resource[0, get_resource.length-1] : get_resource

View File

@ -140,7 +140,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
myhost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address('50.50.50.50') : datastore['SRVHOST']

View File

@ -236,7 +236,7 @@ class MetasploitModule < Msf::Exploit::Remote
#Javascript obfuscation is optional
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
trigger_file_name = "#{get_resource}/#{rand_text_alpha(rand(3))}.swf"

View File

@ -139,7 +139,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -184,7 +184,7 @@ heapSpray(myoffset,myshellcode,myfillsled);
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
content = "<html>"

View File

@ -218,7 +218,7 @@ for (var i=0; i < 1600; i++) {
#obfuscate on demand
if datastore['OBFUSCATE']
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
js_spray.obfuscate
js_spray.obfuscate(memory_sensitive: true)
end
else
js_spray = <<-JS

View File

@ -134,7 +134,7 @@ class MetasploitModule < Msf::Exploit::Remote
#obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-EOS

View File

@ -95,7 +95,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|
<html>
<body>

View File

@ -100,7 +100,7 @@ vulnerable.OnBeforeVideoDownload(evil_string);
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
# Generate the final HTML
content = %Q|<html>

View File

@ -118,7 +118,7 @@ window.location = "#{hcp_url}";
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
=end
js = encrypt_js(js, @javascript_encode_key)

View File

@ -78,7 +78,7 @@ class MetasploitModule < Msf::Exploit::Remote
x.setAttribute("classid", "clsid:55963676-2F5E-4BAF-AC28-CF26AA587566");
x.url = "#{url}/#{dir}/";
|
js.obfuscate
js.obfuscate(memory_sensitive: true)
html = "<html>\n\t<script>#{js}\t</script>\n</html>"
print_status("Sending #{self.name}")
send_response_html(cli, html)

View File

@ -224,7 +224,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
end

View File

@ -398,7 +398,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
sploit = "http://"

View File

@ -154,7 +154,7 @@ class MetasploitModule < Msf::Exploit::Remote
spray = heaplib(spray, {:noobfu => true})
spray = ::Rex::Exploitation::JSObfu.new(spray)
spray.obfuscate
spray.obfuscate(memory_sensitive: true)
load = %Q|
var d=document.getElementById("nsepadiv");

View File

@ -161,7 +161,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -91,7 +91,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|<html>
<body>
<script><!--

View File

@ -147,7 +147,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-EOS

View File

@ -170,7 +170,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -179,7 +179,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -154,7 +154,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -207,7 +207,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
js_spray.obfuscate
js_spray.obfuscate(memory_sensitive: true)
end
bof = rand_text_alpha(my_target['Offset'])

View File

@ -96,7 +96,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|<html>
<body>
<script><!--

View File

@ -250,7 +250,7 @@ class MetasploitModule < Msf::Exploit::Remote
js = heaplib(js, {:noobfu => true})
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = %Q|

View File

@ -168,7 +168,7 @@ class MetasploitModule < Msf::Exploit::Remote
# Obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = "<html>"

View File

@ -180,7 +180,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -185,7 +185,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -221,7 +221,7 @@ class MetasploitModule < Msf::Exploit::Remote
#JS obfuscation on demand only for IE8
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
main_sym = js.sym('main')
end

View File

@ -98,7 +98,7 @@ class MetasploitModule < Msf::Exploit::Remote
JS
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
html = <<-EOS
<html>

View File

@ -268,7 +268,7 @@ else {
}
}
custom_js = ::Rex::Exploitation::ObfuscateJS.new(custom_js, opts).obfuscate()
custom_js = ::Rex::Exploitation::ObfuscateJS.new(custom_js, opts).obfuscate(memory_sensitive: true)
end
return <<-EOS

View File

@ -229,7 +229,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-HTML
@ -314,7 +314,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
js = js.gsub(/^ {4}/, '')

View File

@ -118,7 +118,7 @@ function heapspray()
prompt(fillmem, "");
}
|
heapspray.obfuscate
heapspray.obfuscate(memory_sensitive: true)
nofunc = ::Rex::Exploitation::JSObfu.new %Q|
@ -152,7 +152,7 @@ else
}
|
nofunc.obfuscate
nofunc.obfuscate(memory_sensitive: true)
main = %Q|
function #{func_main}()

View File

@ -148,7 +148,7 @@ history.go(0);
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
#<body onload="history.go(0); #{fnname}()">
# Build the final HTML

View File

@ -178,7 +178,7 @@ function heapspray(){
}
}
|
heapspray.obfuscate
heapspray.obfuscate(memory_sensitive: true)
# Construct the final page
case mytarget['Method']

View File

@ -189,7 +189,7 @@ EOS
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
#js.obfuscate()
#js.obfuscate(memory_sensitive: true)
# Construct the final page
html = <<-EOS

View File

@ -251,7 +251,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-HTML

View File

@ -117,7 +117,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
@heap_spray_func = js.sym("heap_spray")
end

View File

@ -143,7 +143,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_pivot = ::Rex::Exploitation::JSObfu.new(js_pivot)
js_pivot.obfuscate
js_pivot.obfuscate(memory_sensitive: true)
end
vsd_uri = ('/' == get_resource[-1,1]) ? get_resource[0, get_resource.length-1] : get_resource

View File

@ -272,9 +272,9 @@ class MetasploitModule < Msf::Exploit::Remote
end
if datastore['OBFUSCATE']
spray = ::Rex::Exploitation::JSObfu.new(spray).obfuscate
spray = ::Rex::Exploitation::JSObfu.new(spray).obfuscate(memory_sensitive: true)
trigger = ::Rex::Exploitation::JSObfu.new(trigger)
trigger.obfuscate
trigger.obfuscate(memory_sensitive: true)
trigger_fn = trigger.sym('trigger')
else
trigger_fn = 'trigger'

View File

@ -248,7 +248,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
spray_trigger_js = ::Rex::Exploitation::JSObfu.new(spray_trigger_js)
spray_trigger_js.obfuscate
spray_trigger_js.obfuscate(memory_sensitive: true)
end
# build html

View File

@ -195,7 +195,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
js_spray.obfuscate
js_spray.obfuscate(memory_sensitive: true)
trigger_f = rand_text_alpha(rand(5) + 4)
feng_shui_f = rand_text_alpha(rand(5) + 4)

View File

@ -107,7 +107,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end

View File

@ -126,7 +126,7 @@ for (var i=1; i < 0x300; i++) {
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js
@ -245,7 +245,7 @@ function exploit(){
if datastore['OBFUSCATE']
js_trigger = ::Rex::Exploitation::JSObfu.new(js_trigger)
js_trigger.obfuscate
js_trigger.obfuscate(memory_sensitive: true)
create_rects_func = js_trigger.sym("createRects")
exploit_func = js_trigger.sym("exploit")
end
@ -332,7 +332,7 @@ function exploit(){
if datastore['OBFUSCATE']
js_trigger = ::Rex::Exploitation::JSObfu.new(js_trigger)
js_trigger.obfuscate
js_trigger.obfuscate(memory_sensitive: true)
create_rects_func = js_trigger.sym("createRects")
exploit_func = js_trigger.sym("exploit")
end

View File

@ -96,7 +96,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|<html>
<body>
<script><!--

View File

@ -342,7 +342,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
object_id = rand_text_alpha(4)

View File

@ -93,7 +93,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|<html>
<body>
<script><!--

View File

@ -156,7 +156,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_click_link = ::Rex::Exploitation::JSObfu.new(js_click_link)
js_click_link.obfuscate
js_click_link.obfuscate(memory_sensitive: true)
js_click_link_fn = js_click_link.sym('clickLink')
else
js_click_link_fn = 'clickLink'

View File

@ -180,7 +180,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -303,7 +303,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
# The overflow occurs after strcat'ing controlled data to

View File

@ -140,7 +140,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
address = 0x0c0c0c0c / 0x134

View File

@ -362,7 +362,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
if my_target['Rop'].nil?

View File

@ -100,7 +100,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|
<html>
<body>

View File

@ -127,7 +127,7 @@ EOS
#JS obfuscation on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
main_sym = js.sym('main')
else
main_sym = "main"

View File

@ -183,7 +183,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
return js

View File

@ -127,7 +127,7 @@ class MetasploitModule < Msf::Exploit::Remote
vprint_status("Obfuscating javascript...")
if datastore['OBFUSCATE']
spray = Rex::Exploitation::JSObfu.new(spray)
spray.obfuscate
spray.obfuscate(memory_sensitive: true)
end
vprint_status("Building html...")

View File

@ -129,7 +129,7 @@ class MetasploitModule < Msf::Exploit::Remote
#obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
bof = Rex::Text.to_unescape("\x0c" * 2048, Rex::Arch.endian(my_target.arch))

View File

@ -181,7 +181,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_content = ::Rex::Exploitation::JSObfu.new(js_content)
js_content.obfuscate
js_content.obfuscate(memory_sensitive: true)
end
print_status("Sending javascript...")
@ -192,9 +192,9 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js_content = ::Rex::Exploitation::JSObfu.new(js_content)
js_content.obfuscate
js_content.obfuscate(memory_sensitive: true)
onlick = ::Rex::Exploitation::JSObfu.new(onlick)
onlick.obfuscate
onlick.obfuscate(memory_sensitive: true)
end
# we can bypass Access-Control-Allow-Origin (CORS) in all browsers using iframe since it makes a GET request

View File

@ -348,7 +348,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
@heap_spray_fn = js.sym("heap_spray")
else
@heap_spray_fn = "heap_spray"

View File

@ -96,7 +96,7 @@ class MetasploitModule < Msf::Exploit::Remote
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.update_opts(js_heap_spray.opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
content = %Q|<html>
<body>
<script><!--

View File

@ -235,7 +235,7 @@ EOS
#JS obfuscation on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
main_sym = js.sym('main')
end
end

View File

@ -234,7 +234,7 @@ class MetasploitModule < Msf::Exploit::Remote
#obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-EOS

View File

@ -114,7 +114,7 @@ obj.HttpUpload(arg1, arg2, sploit);
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
# Build the final HTML
content = %Q|<html>

View File

@ -174,7 +174,7 @@ class MetasploitModule < Msf::Exploit::Remote
# Obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
# Randomize the javascript variable names

View File

@ -206,7 +206,7 @@ class MetasploitModule < Msf::Exploit::Remote
#obfuscate on demand
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
#Value for the 'Src' parameter of our ActiveX control

View File

@ -152,7 +152,7 @@ class MetasploitModule < Msf::Exploit::Remote
#obfuscate on demand
if datastore['OBFUSCATE']
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
js_spray.obfuscate
js_spray.obfuscate(memory_sensitive: true)
end

View File

@ -123,7 +123,7 @@ obj.NewObject(sploit);
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.obfuscate()
js.obfuscate(memory_sensitive: true)
# Build the final HTML
content = %Q|<html>

View File

@ -143,7 +143,7 @@ class MetasploitModule < Msf::Exploit::Remote
if datastore['OBFUSCATE']
js = ::Rex::Exploitation::JSObfu.new(js)
js.obfuscate
js.obfuscate(memory_sensitive: true)
end
html = <<-EOS