modules/illScrappy/metasploit-framework/lib/msf/core/payload_generator.rb
# This method generates Java payloads which are a special case.
# They can be generated in raw or war formats, which respectively
# produce a JAR or WAR file for the java payload.
# @return [String] Java payload as a JAR or WAR file
This method generates Java payloads which are a special case.
They can be generated in raw or war formats, which respectively
produce a JAR or WAR file for the java payload.
This method generates Java payloads which are a special case . They can be generated in raw or war formats which respectively produce a JAR or WAR file for the java payload .
def generate_java_payload
      payload_module = framework.payloads.create(payload)
      payload_module.datastore.merge!(datastore)
      case format
      when "raw", "jar"
        if payload_module.respond_to? :generate_jar
          payload_module.generate_jar.pack
        else
          payload_module.generate
        end
      when "war"
        if payload_module.respond_to? :generate_war
          payload_module.generate_war.pack
        else
          raise InvalidFormat, "#{payload} is not a Java payload"
        end
      when "axis2"
        if payload_module.respond_to? :generate_axis2
          payload_module.generate_axis2.pack
        else
          raise InvalidFormat, "#{payload} is not a Java payload"
        end
      else
        raise InvalidFormat, "#{format} is not a valid format for Java payloads"
      end
    end
def generate_java_payload payload_module = framework . payloads . create ( payload ) payload_module . datastore . merge! ( datastore ) case format when "raw" , "jar" if payload_module . respond_to? :generate_jar payload_module . generate_jar . pack else payload_module . generate end when "war" if payload_module . respond_to? :generate_war payload_module . generate_war . pack else raise InvalidFormat , "#{payload} is not a Java payload" end when "axis2" if payload_module . respond_to? :generate_axis2 payload_module . generate_axis2 . pack else raise InvalidFormat , "#{payload} is not a Java payload" end else raise InvalidFormat , "#{format} is not a valid format for Java payloads" end end
This method generates Java payloads which are a special case.
This method generates Java payloads which are a special case .
Java payload as a JAR or WAR file
Java payload as a JAR or WAR file
String