mirror of
https://github.com/MrAle98/sliver
synced 2026-06-08 11:54:46 +00:00
Extensions
Allows to load and execute 3rd party extensions.
Extensions must be loaded from a directory with the following architecture:
/path/to/extension/folder/
├── manifest.json
└── windows
├── 386
│ └── extension.x86.dll
└── amd64
└── extension.x64.dll
The extension folder structure must follow the GOOS/GOARCH/ scheme.
Here's an example manifest:
[
{
"name": "foo",
"help": "Help for foo command",
"entrypoint": "RunFoo",
"init" :"NimMain",
"dependsOn": "bar",
"files": [
{
"os": "windows",
"files":{
"x86": "extension.x86.o",
"x64": "extension.x64.o",
}
}
],
"arguments": [
{"name": "pid", "type": "int", "desc": "pid", "optional": false},
]
}
]
The structure is the following one:
name: name of the extension, which will also be the name of the command in the sliver clienthelp: the documentation for the new commandentrypoint: the name of the exported function to callfiles: a list of object pointing to the extensions files to load for each architectures and operating systemsinit: the initialization function name (if relevant, can be omitted)arguments: an optional list of objects (for DLLs), but mandatory for BOFsdependsOn: the name of an extension required by the current extension (won't load if the dependency is not loaded)
The type of an argument can be one of the following:
string: regular ASCII stringwstring: string that will be UTF16 encodedint: will be parsed as a 32 bit unsigned integershort: will be parsed as a 16 bit unsigned integerfile: a string to a file path on the client side which content will be passed to the BOF