# README
Extensions
Allows to load and execute 3rd party extensions.
Extensions directory structures can be arbitrary, however in the root of the directory or .tar.gz there
must be a extension.json
or a alias.json
file. All paths are relative to the manifest/root directory,
parent directories are not allowed. Only files listed in the manifest are copied, any other files will
be ignored.
/path/to/extension/folder/
├── extension.json
└── windows
│ └── extension.x86.dll
│ └── extension.x64.dll
└── linux
│ └── extension.x86.so
│ └── extension.x64.so
└── darwin
└── extension.x86.dylib
└── extension.x64.dylib
Here's an example manifest (i.e., the extension.json
or a alias.json
):
{
"name": "foo",
"version": "1.0.0",
"extension_author": "ac1d-burn",
"original_author": "zer0-cool",
"repo_url": "https://github.com/foo/bar",
"help": "Help for foo command",
"entrypoint": "RunFoo",
"init" :"NimMain",
"depends_on": "bar",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "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 BOFsdepends_on
: 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
# Functions
CmdExists - checks if a command exists.
Commands returns the “ command and its subcommands.
ExtensionLoadCmd - Load extension command.
ExtensionRegisterCommand - Register a new extension command.
ExtensionsCmd - List information about installed extensions.
ExtensionsCommandNameCompleter - Completer for installed extensions command names.
ExtensionsInstallCmd - Install an extension.
ExtensionsListCmd - List all extension loaded on the active session/beacon.
ExtensionsRemoveCmd - Remove an extension.
Install an extension from a directory.
LoadExtensionManifest - Parse extension files.
No description provided by the author
parseExtensionManifest - Parse extension manifest from buffer (legacy, only parses one).
PrintExtensions - Print a list of loaded extensions.
PrintExtOutput - Print the ext execution output.
RemoveExtensionByCommandName - Remove an extension by command name.
RemoveExtensionByManifestName - remove by the named manifest, returns true if manifest was removed, false if no manifest with that name was found.
# Constants
ManifestFileName - Extension manifest file name.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author