Skip to main content

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

Project description

Total Downloads Downloads

OSINTBuddy 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.

Extending OSINTBuddy with plugins

The OsintBuddy API provides an easy way to create and extend plugins in a modular manner. In the given code example, the IPAddressPlugin is created as an extension to the OsintBuddy framework using the OBPlugin class. This IP address plugin has the following features:

  1. Customizable plugin attributes such as label, name, and color.
  2. A node definition for user input, in this case, a TextInput for IP addresses.
  3. A transform method (transform_to_website) with a specified label and icon. This method can take the input data (an IP address) and convert it to a different format, like a website.
  4. Error handling capabilities using the OBPluginError class if an issue occurs during data transformation.

The extensible nature of the OsintBuddy API allows developers to seamlessly integrate custom plugins such as an IPAddressPlugin into their applications and workflows, simplifying the process of transforming and manipulating data across various formats. Not shown here is also the ability to access a selenium driver context with kwargs['get_driver']()

from osintbuddy.plugins import OBPlugin
from osintbuddy.node import TextInput

class IPAddressPlugin(OBPlugin):
    label = 'IP'
    name = 'IP address'
    color = '#F47C00'
    node = [
        TextInput(label='IP Address', icon='map-pin')  # tabler-icon names
    ]

    @transform(label='To website', icon='world', prompt="""""")
    def transform_to_website(self, node, **kwargs):
        try:
            resolved = socket.gethostbyaddr(node['data'][0])
            if len(resolved) >= 1:
                blueprint = WebsitePlugin.blueprint(domain=resolved[0])
                return blueprint
            else:
                raise OBPluginError('No results found')
        except (socket.gaierror, socket.herror):
            raise OBPluginError('We ran into a socket error. Please try again')

Creating a plugin with dependent plugins

class GoogleResult(OBPlugin):
    label = 'Google Result'
    show_label = False
    name = 'Google result'
    color = '#308e49'
    node = [
        Title(label='result'),
        CopyText(label='url')
    ]

    @transform(label='To website', icon='world')
    def transform_to_website(self, node, **kwargs):
        blueprint = WebsitePlugin.blueprint(
            domain=urlparse(node['data'][3]).netloc
        )
        return blueprint


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

    @transform(label='To google', icon='world')
    def transform_to_google(self, node, **kwargs):
        # @todo
        domain = node['data'][0]
        query = f"{domain}"
        results = []
        for result in GoogleSearchPlugin().search_google(query=query, pages="3"):
            blueprint = GoogleResult.blueprint(
                result={
                    'title': result.get('title'),
                    'subtitle': result.get('breadcrumb'),
                    'text': result.get('description'),
                },
                url=result.get('url')
            )
            results.append(blueprint)
        return results

Development

  1. Create and active a python3 venv
  2. python -m pip install .
  3. pip install .[test]
  4. Develop...

License

MIT

Project Organization

  • .github/workflows: Contains GitHub Actions used for building, testing, and publishing.
  • src: source code
    • src/node: elements used to define a nodes appearance and input elements
  • tests: Contains Python-based test cases to validate source code.
  • pyproject.toml: Contains metadata about the project and configurations for additional tools used to format, lint, type-check, and analyze Python code.

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.3rc33.post1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

osintbuddy-0.0.3rc33.post1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file osintbuddy-0.0.3rc33.post1.tar.gz.

File metadata

  • Download URL: osintbuddy-0.0.3rc33.post1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for osintbuddy-0.0.3rc33.post1.tar.gz
Algorithm Hash digest
SHA256 ba4cea9205fa69096f348c2983d7b2edadd93e90a2cb09f57d20073ed0444cdc
MD5 fe9dfcf079e932162a0dc853ff7612d4
BLAKE2b-256 f04cf4c5d73a8ca68a952bc023ffe704d519ba83653f4ad7aec204c06acabe79

See more details on using hashes here.

File details

Details for the file osintbuddy-0.0.3rc33.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for osintbuddy-0.0.3rc33.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee86ed7dcf662c8428261a350e88745ce6d703276d2fce3a69c81ca045d32d00
MD5 7323b4d458d15433365db9dc9d85c475
BLAKE2b-256 fa6475e07f7a6322021724854d46f32e14c72904096a4feafc45c994188fa73c

See more details on using hashes here.

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