Plugins
Plugin
Base class for all pwninit plugins.
Plugins must inherit from this class and implement the provide and/or setup methods.
Plugins can also define provide_args and setup_args to specify CLI arguments for each role.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the plugin. |
description |
str
|
A brief description of the plugin's purpose. |
provide_args |
list
|
List of argument dictionaries for the |
setup_args |
list
|
List of argument dictionaries for the |
Source code in src/pwninit/plugins/__init__.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
has_provide
property
Check if the plugin implements the provide method.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if the plugin overrides |
has_setup
property
Check if the plugin implements the setup method.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if the plugin overrides |
provide(args, path)
Provide functionality for the plugin (e.g., generate payloads, files, or configurations).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Parsed arguments for the |
required | |
path
|
Path to the target binary or directory. |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If not overridden by the subclass. |
Source code in src/pwninit/plugins/__init__.py
31 32 33 34 35 36 37 38 39 40 41 42 | |
setup(args, bins)
Set up the environment or perform pre-exploitation tasks (e.g., start a service, patch a binary).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Parsed arguments for the |
required | |
bins
|
List of binaries to set up. |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If not overridden by the subclass. |
Source code in src/pwninit/plugins/__init__.py
44 45 46 47 48 49 50 51 52 53 54 55 | |
arg(name, **kwargs)
Helper function to define a plugin argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the argument. |
required |
**kwargs
|
Additional keyword arguments for |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
A dictionary representing the argument configuration. |
Source code in src/pwninit/plugins/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 | |
print_plugin_list()
Print a list of all available plugins and their usage information.
Source code in src/pwninit/plugins/__init__.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
run_plugins(args, role, settings)
Run a plugin with the specified role and arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
list
|
CLI arguments, where the first element is the plugin name. |
required |
role
|
str
|
The role ( |
required |
settings
|
Additional settings or context for the plugin. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
The result of the plugin's |
Source code in src/pwninit/plugins/__init__.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |