Options can be both module-defined and kit-defined.
Module-defined
Declaration
Options can be defined for modules, payloads and encoders. They are variables that user can set
before executing the module, payload or encoder.
To declare an option, you should select the specific data type that this option should accept. These are available options:
Option
- any valueIPv4Option
- IPv4IPv6Option
- IPv6IPOption
- both IPv4 and IPv6MACOption
- MAC addressIPv4CIDROption
- IPv4 CIDRIPv6CIDROption
- IPv6 CIDRPortOption
- network port numberPortRangeOption
- range of network portsNumberOption
- both integer and floatIntegerOption
- integerFloatOption
- floatBooleanOption
- yes or noPayloadOption
- payload nameEncoderOption
- encoder nameSessionOption
- session ID
Option should be declared inside __init__
method of module and have this syntax:
self.myvar = IPv4Option("127.0.0.1", "IP address.", True)
First argument is a default value, second is the description and third is a flag, which makes this option required or optional.
If you want to make an option advanced, so it won’t be displayed with all other options, do this:
self.myvar = IPv4Option("127.0.0.1", "IP address.", False, True)
Forth argument is a flag, which makes an option advanced or regular.
You can set option value calling set
method:
self.myvar.set("0.0.0.0")
Acknowledge that you can hide an option by setting visible
to False
.
self.myvar.visible = False
NOTE: Options which are not visible can be set from module (in code), but can’t be set using set
command.
You may also lock variable, so it will be impossible to set it. Locked options can’t be set using set
command and also from the module.
self.myvar.locked = True
Usage
You can get option value inside the module by just accessing self.myvar.value
, considering that self.myvar
is a declaration of an option.
Option-specific usage
IPOption
,IPv4Option
,IPv6Option
andPortOption
:self.myvar.little
- Byte representation of value (little endian)self.myvar.big
- Byte representation of value (big endian)
Kit-defined
Kit-defined options are options that come with the kit. They still can be modified and accessed by the module.
For example, if your module exploits ADB
which is an Android Debug Bridge, you can use ADB
kit. This way you won’t need to declare any options related to host and port. Kit will declare them for you.
You can read more about kits in kits section.