Skip to main content

OSINTBuddy - mine, merge, and map data for novel insights

Project description

Total Downloads Downloads

Extending OSINTBuddy with plugins

The plugins library for osintbuddy osintbuddy-demo

This project follows the Python Standards declared in PEP 621. It uses a pyproject.yaml file to configure the project and Flit to simplify the build process and publish to PyPI.

Creating your first plugin

In this guide, we will dive into creating a custom plugin for OSINTBuddy that extends its capabilities. This will enable you to incorporate additional sources and transformations into the OSINTBuddy toolbox. We will use the provided code example as a reference to build our plugin.

Step-by-step guide to create a new plugin

Start by importing the necessary modules:

import socket
import osintbuddy as ob

Define a class for your plugin, inheriting from ob.Plugin. Set the required attributes such as label, and optionally set an icon like world-www (using tabler-icon names), and a node which contains a list of elements used as a blueprint for creating the node displayed on the OSINTBuddy UI.

class WebsitePlugin(ob.Plugin):
    label = 'Website'
    name = 'Website'
    color = '#1D1DB8'
    icon = 'world-www'
    node = [
        ob.elements.TextInput(label='Domain', icon='world-www'),
    ]

Now, define a transformation method to gather and transform the data from the input node. In this case, the transform_to_ip function uses the socket.gethostbyname() Python module to obtain the IP address for a given domain. Decorate the method with @transform() and set the metadata attributes such as label and icon.

@transform(label='To IP', icon='building-broadcast-tower')
def transform_to_ip(self, node, **kwargs):
    blueprint = IPAddressPlugin.blueprint(
        ip_address=socket.gethostbyname(node['data'][0])
    )
    return blueprint

Using the new plugin

To use the new plugin, simply add it to the existing OSINTBuddy plugins folder inside the application, in development mode it will be detected automatically and loaded by the platform. Once added, you can access your 'Website' plugin and use the 'To IP' transformation.

Creating a custom plugin for OSINTBuddy is an easy and effective way to enhance the capabilities of the tool, allowing you to fetch information from additional sources or transform the data in new ways. By following this guide and using the provided code example as a reference, you'll be able to create your own unique plugins to extend the functionality of OSINTBuddy to fit your specific needs.

Full example

import socket
import osintbuddy as ob

class WebsitePlugin(ob.Plugin):
    label = 'Website'
    name = 'Website'
    color = '#1D1DB8'
    icon = 'world-www'
    node = [
        ob.elements.TextInput(label='Domain', icon='world-www'),
    ]

    @ob.transform(label='To IP', icon='building-broadcast-tower')
    async def transform_to_ip(self, node, **kwargs):
        blueprint = IPAddressPlugin.blueprint(
            ip_address=socket.gethostbyname(node['data'][0])
        )
        return blueprint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osintbuddy-0.0.3rc36.post1.tar.gz (21.3 kB view hashes)

Uploaded Source

Built Distribution

osintbuddy-0.0.3rc36.post1-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page