Skip to content

Commit 9981a24

Browse files
authored
Land rapid7#19235, Fixes an issue where zip paths were not being created correctly for Java payloads
2 parents cc9c104 + 798d79a commit 9981a24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/payload/java.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ def generate_war(opts={})
110110
zip.add_file('WEB-INF/', '')
111111
zip.add_file('WEB-INF/web.xml', web_xml)
112112
zip.add_file("WEB-INF/classes/", "")
113-
zip.add_file('metasploit/', '') # Create the metasploit dir
113+
zip.add_file('WEB-INF/classes/metasploit/', '') # Create the metasploit dir
114114

115115
paths.each do |path_parts|
116116
path = ['java', path_parts].flatten.join('/')
117117
contents = ::MetasploitPayloads.read(path)
118-
zip.add_file(path_parts.join('/'), contents)
118+
zip.add_file("WEB-INF/classes/" + path_parts.join('/'), contents)
119119
end
120120

121121
zip.add_file("WEB-INF/classes/metasploit.dat", stager_config(opts))

0 commit comments

Comments
 (0)