Skip to content

Commit

Permalink
Fixes an issue where zip paths were not being created correctly for J…
Browse files Browse the repository at this point in the history
…ava payloads
  • Loading branch information
cgranleese-r7 committed Jun 5, 2024
1 parent ddaa21d commit 798d79a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/msf/core/payload/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ def generate_war(opts={})
zip.add_file('WEB-INF/', '')
zip.add_file('WEB-INF/web.xml', web_xml)
zip.add_file("WEB-INF/classes/", "")
zip.add_file('metasploit/', '') # Create the metasploit dir
zip.add_file('WEB-INF/classes/metasploit/', '') # Create the metasploit dir

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

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

0 comments on commit 798d79a

Please sign in to comment.