Package eu.tneitzel.rmg.operations
Enum Operation
- java.lang.Object
-
- java.lang.Enum<Operation>
-
- eu.tneitzel.rmg.operations.Operation
-
- All Implemented Interfaces:
eu.tneitzel.argparse4j.global.IAction,Serializable,Comparable<Operation>
public enum Operation extends Enum<Operation> implements eu.tneitzel.argparse4j.global.IAction
The Operation enum class contains one item for each possible rmg action. An enum item consists out of the corresponding method name, the expected positional parameters and the helpstring that should be displayed for the method. This allows to keep all this information structured in one place without having to maintain it elsewhere. During the construction, the constructor of the Operation class looks up the specified method within the Dispatcher class and saves a reference to it. Methods are then invoked by using the Operation.invoke function. To create a new rmg action, a new enum item has to be created and the corresponding method has to be added to the Dispatcher class.- Author:
- Tobias Neitzel (@qtc_de)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BINDBinds an object to the registry that points to listenerCALLRegularly calls a method with the specified argumentsCODEBASEPerform remote class loading attacksENUMEnumerate common vulnerabilities on Java RMI endpointsGUESSGuess methods on bound namesKNOWNDisplay details of known remote objectsLISTENOpen ysoserials JRMP listenerOBJIDPrint information contained within an ObjIDREBINDRebinds boundname as object that points to listenerROGUEJMXCreates a rogue JMX listener (collect credentials)SCANPerform an RMI service scan on common RMI portsSERIALPerform deserialization attacks against default RMI componentsUNBINDRemoves the specified bound name from the registry
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsOption(RMGOption option)Check whether an operation contains the specified option.static eu.tneitzel.argparse4j.global.ActionContextgetActionContext()Create an ActionContext for the Operation enum.StringgetArgs()static OperationgetByName(String name)Iterates over the Operation enumeration and returns the operation that equals the specified operation name.StringgetDescription()eu.tneitzel.argparse4j.global.IActionGroupgetGroup()MethodgetMethod()StringgetName()eu.tneitzel.argparse4j.global.IOption[]getOptions()voidinvoke(Dispatcher dispatcherObject)Invokes the method that was saved within the Operation.static OperationvalueOf(String name)Returns the enum constant of this type with the specified name.static Operation[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BIND
public static final Operation BIND
Binds an object to the registry that points to listener
-
CALL
public static final Operation CALL
Regularly calls a method with the specified arguments
-
CODEBASE
public static final Operation CODEBASE
Perform remote class loading attacks
-
ENUM
public static final Operation ENUM
Enumerate common vulnerabilities on Java RMI endpoints
-
GUESS
public static final Operation GUESS
Guess methods on bound names
-
KNOWN
public static final Operation KNOWN
Display details of known remote objects
-
LISTEN
public static final Operation LISTEN
Open ysoserials JRMP listener
-
OBJID
public static final Operation OBJID
Print information contained within an ObjID
-
REBIND
public static final Operation REBIND
Rebinds boundname as object that points to listener
-
ROGUEJMX
public static final Operation ROGUEJMX
Creates a rogue JMX listener (collect credentials)
-
SCAN
public static final Operation SCAN
Perform an RMI service scan on common RMI ports
-
SERIAL
public static final Operation SERIAL
Perform deserialization attacks against default RMI components
-
UNBIND
public static final Operation UNBIND
Removes the specified bound name from the registry
-
-
Method Detail
-
values
public static Operation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Operation c : Operation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Operation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getMethod
public Method getMethod()
- Returns:
- method
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceeu.tneitzel.argparse4j.global.IAction- Returns:
- description
-
getArgs
public String getArgs()
- Returns:
- arguments
-
invoke
public void invoke(Dispatcher dispatcherObject)
Invokes the method that was saved within the Operation.- Parameters:
dispatcherObject- object to invoke the method on
-
containsOption
public boolean containsOption(RMGOption option)
Check whether an operation contains the specified option.- Parameters:
option- RMGOption to check for- Returns:
- true if the option is contained within the operation.
-
getByName
public static Operation getByName(String name)
Iterates over the Operation enumeration and returns the operation that equals the specified operation name.- Parameters:
name- desired Operation to return- Returns:
- requested Operation object or null if not found
-
getActionContext
public static eu.tneitzel.argparse4j.global.ActionContext getActionContext()
Create an ActionContext for the Operation enum.- Returns:
- ActionContext that can be used to create argument parsers from.
-
getGroup
public eu.tneitzel.argparse4j.global.IActionGroup getGroup()
- Specified by:
getGroupin interfaceeu.tneitzel.argparse4j.global.IAction
-
getName
public String getName()
- Specified by:
getNamein interfaceeu.tneitzel.argparse4j.global.IAction
-
getOptions
public eu.tneitzel.argparse4j.global.IOption[] getOptions()
- Specified by:
getOptionsin interfaceeu.tneitzel.argparse4j.global.IAction
-
-