Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Teatime - A Blockchain RPC Attack Framework

https://img.shields.io/pypi/v/teatime.svg https://img.shields.io/travis/dmuhs/teatime.svg https://codecov.io/gh/dmuhs/teatime/branch/master/graph/badge.svg?token=RP0WZ6NXUP Documentation Status Updates

Deployed a node? Have a cup.

Teatime is an RPC attack framework aimed at making it easy to spot misconfigurations in blockchain nodes. It detects a large variety of issues, ranging from information leaks to open accounts, and configuration manipulation.

The goal is to enable tools scanning for vulnerable nodes and minimizing the risk of node-based attacks due to common vulnerabilities. Teatime uses a plugin-based architecture, so extending the library with your own checks is straightforward.

Please note that this library is still a PoC and lacks documentation. If there are plugins you would like to see, feel free to contact me on Twitter!

Installation

Teatime runs on Python 3.6+.

To get started, simply run

$ pip3 install teatime

Alternatively, clone the repository and run

$ pip3 install .

Or directly through Python’s setuptools:

$ python3 setup.py install

Example

To get started, simply instantiate a Scanner class and pass in the target IP, port, node type, and a list of instantiated plugins. Consider the following sample to check whether a node is synced and mining:

from teatime.scanner import Scanner
from teatime.plugins.context import NodeType
from teatime.plugins.eth1 import NodeSync, MiningStatus

TARGET_IP = "127.0.0.1"
TARGET_PORT = 8545
INFURA_URL = "Infura API Endpoint"

def get_scanner():
    return Scanner(
        ip=TARGET_IP,
        port=TARGET_PORT,
        node_type=NodeType.GETH,
        plugins=[
            NodeSync(infura_url=INFURA_URL, block_threshold=10),
            MiningStatus(should_mine=False)
        ]
    )

if __name__ == '__main__':
    scanner = get_scanner()
    report = scanner.run()
    print(report.to_dict())

Check out the examples directory for more small samples! Teatime is fully typed, so also feel free to explore options in your IDE if reading the documentation is not your preferred choice. :)

Future Development

The future of Teatime is uncertain, even though I would love to add broader checks that go beyond RPC interfaces, specifically for technologies such as:

  • Ethereum 2.0

  • Filecoin

  • IPFS

If you want to integrate plugins for smaller, less meaningful chains such as Bitcoin or Ethereum knock-offs, feel free to fork the project and integrate them separately.

Metadata

Release files for teatime 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teatime 0.3.1
File Size Uploaded
teatime-0.3.1.tar.gz 46.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for teatime 0.3.1
File Interpreter ABI Platform
teatime-0.3.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 99.6 kB

Release files / teatime-0.3.1.tar.gz

Download URL teatime-0.3.1.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
67f2aeec80ce2d9850eab8fa402835c940443fdfc052582fdbd7f0ddf75c6913
BLAKE2b-256 checksum
How to use checksums
d8b870233bbdb27b7b9489b460956688d3af1994d318b9902506e8421b17f1fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release files / teatime-0.3.1-py2.py3-none-any.whl

Download URL teatime-0.3.1-py2.py3-none-any.whl
Size 53.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
77b92d28fe32d421ab0bef9d3cf153cfbeb4a82888c0e43446e92ea97e3d4beb
BLAKE2b-256 checksum
How to use checksums
bac579dfca269bd9636645077ba38c7d450ebdf4fb1c0b8872fefa22ce0df545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page