prefer reading directly with MetasploitPayloads where possible
parent
f0c989c1b5
commit
a066105a86
|
@ -98,10 +98,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
# We need this class as a wrapper to run in a thread. For some reason
|
# We need this class as a wrapper to run in a thread. For some reason
|
||||||
# the Payload class is giving illegal access exceptions without it.
|
# the Payload class is giving illegal access exceptions without it.
|
||||||
path = MetasploitPayloads.path("java", "metasploit", "PayloadServlet.class")
|
servlet = MetasploitPayloads.read("java", "metasploit", "PayloadServlet.class")
|
||||||
fd = File.open(path, "rb")
|
|
||||||
servlet = fd.read(fd.stat.size)
|
|
||||||
fd.close
|
|
||||||
zip.add_file("metasploit/PayloadServlet.class", servlet)
|
zip.add_file("metasploit/PayloadServlet.class", servlet)
|
||||||
|
|
||||||
contents = zip.pack
|
contents = zip.pack
|
||||||
|
|
Loading…
Reference in New Issue