Skip to main content

Python SDK for BBEye MITM proxy decrypt scripts

Project description

BBEye Python SDK

bbeye is the Python SDK used by BBEye decrypt scripts.

It provides:

  • Request / Response wrappers
  • Result helpers for text, JSON, hex, and protobuf views
  • console() for printing messages back into the BBEye console
  • test() for local script debugging
  • python -m bbeye your_script.py as the runtime entrypoint used by BBEye

Install

pip install bbeye

Basic example

from bbeye import Result, console


def onResponse(response):
    console("url:", response.url)
    return Result.showText(response.body)

JSON example

from bbeye import Result


def onRequest(request):
    return Result.showJson(request.json())

Local test

from bbeye import Result, test


def onResponse(response):
    return Result.showText(response.body)


if __name__ == "__main__":
    test(
        onResponse,
        url="https://example.com/api/demo",
        body=b'{"ok":true}',
        direction="response",
    )

Runtime model

BBEye invokes user scripts like this:

python3 -m bbeye your_script.py

The user script should define one or both of:

  • onRequest(request)
  • onResponse(response)

Each callback can return:

  • Result.showText(...)
  • Result.showJson(...)
  • Result.showHex(...)
  • Result.showProtobuf(...)
  • Result.error(...)

Returning raw str or bytes is also supported and will be treated as text.

API summary

Request / Response

Common properties:

  • url
  • headers
  • body
  • direction

Common methods:

  • text(encoding="utf-8")
  • json()
  • header(name)

Result

  • Result.showText(data)
  • Result.showJson(data)
  • Result.showHex(data)
  • Result.showProtobuf(data)
  • Result.error(message)

Helpers

  • console(*args, **kwargs)
  • test(func, url=..., headers=..., body=..., direction=...)

Publishing

For maintainers:

cd python-sdk
./publish.sh check
./publish.sh testpypi
./publish.sh pypi

Credentials should be provided via:

  • TWINE_USERNAME / TWINE_PASSWORD, or
  • ~/.pypirc

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

bbeye-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bbeye-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file bbeye-0.1.0.tar.gz.

File metadata

  • Download URL: bbeye-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for bbeye-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf728533a9f4781816320dbff246e634181428f68099c82d61665861401abdc6
MD5 d1e15730c8c2401a825d8c9143a65d90
BLAKE2b-256 7b84076547f765ba77737684cc250281ad8a1d91b45007b08ced1c87b8a9e578

See more details on using hashes here.

File details

Details for the file bbeye-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bbeye-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for bbeye-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 620367a182afedfb4723b176270a48d3b7e63b6e5716ed00bfa39493c94f58b5
MD5 9bf59944ff4a446dd491140b0db83021
BLAKE2b-256 5ea69b792d77505498776e7f2e0c7a14c50374028cda516dc5aee6a4ebeaa398

See more details on using hashes here.

Supported by

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