ctfcli
plugins are essentially additions to to the command line interface via dynamic class modifications.
ctfcli
is an alpha project! The plugin interface is likely to change!
ctfcli
expects plugins to be shared via git repositories. The ctf plugins install
command will clone a given plugin repository to the plugin directory.
❯ ctf plugins install URL
❯ ctf plugins dir
/Users/user/Library/Application Support/ctfcli/plugins
Create a new Python module with an __init__.py
file inside of it. Inside of the __init__.py
file you should specify a load function that takes a single argument (the pre-defined command classes)
.
└── plugin
└── __init__.py
❯ cat plugin/__init__.py
from types import MethodType
def load(commands):
pass
from types import MethodType
def cow(self):
a_cow = """
^__^
(oo)\_______
(__)\ )\\/\\
||----w |
|| ||
"""
print(a_cow)
def load(commands):
plugins = commands["plugins"]
plugins.cow = MethodType(cow, plugins)
❯ ctf plugins cow
Loading /Users/user/Library/Application Support/ctfcli/plugins/plugin/__init__.py as plugin
^__^
(oo)\_______
(__)\ )\/\
||----w |
|| ||