Skip to main content

pydronebl

Build Status

Installation

$ pip3 install dronebl

Usage

The RPC key, IP and ID below are fake.

Looking up an IP

>>> from dronebl import DroneBL
>>> d = DroneBL("04efa460cf244b6e88d9d2b8c31eb953")
>>> # by IP
>>> d.lookup("198.51.100.123")
[Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')]
>>> # by ID
>>> d.lookup(3174874)
[Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')]
>>> # non-existent
>>> d.lookup(3174875)
[]

Adding an IP

>>> d.add("198.51.100.123", 19, "abused VPN (connect verified)")
(3174874, 'Added 198.51.100.123')
>>> d.add("198.51.100.123", 19, "abused VPN (connect verified)")
(None, 'You already reported 198.51.100.123 as type 19')

Adding with a port

>>> d.add("198.51.100.123", 19, "abused VPN (connect verified)", 1337)
(3174874, 'Added 198.51.100.123')

Updating a comment

>>> d.update(3174874, "abused VPN")
(True, 'Updated 3174874')
>>> d.update(3174875, "abused VPN")
(False, 'The id 3174875 does not exist')

Removing an IP

>>> d.remove(3174874)
(True, 'Removed 3174874')
>>> d.remove(3174874)
(False, '3174874 already delisted')

Batches

>>> b = d.batch()
>>> b.remove(3174872)
>>> b.update(3174873, "abused VPN")
>>> b.add("198.51.100.123", 19, "abused VPN (connect verified)")
>>> b.add("198.51.100.124", 13, "ssh bruteforce")
>>> r = d.commit(b)
>>> for res in r:
...     print(res)
...
('remove', True, 'Removed 3174872')
('update', True, 'Updated 3174873')
('add', 3174874, 'Added 198.51.100.123')
('add', 3174875, 'Added 198.51.100.124')
>>> b = d.type_batch(19)
>>> b.add("198.51.100.125", "abused VPN (connect verified)")
>>> d.commit(b)
[('add', 3174876, 'Added 198.51.100.125')]

Asyncified!

identical methods are offered on the async version of DroneBL, AsyncDroneBL

>>> from dronebl import AsyncDroneBL
>>> d = AsyncDroneBL("04efa460cf244b6e88d9d2b8c31eb953")
>>> await d.lookup("198.51.100.123")
Lookup(198.51.100.123, id=3174874, type=19, datetime=2020-08-21T10:18:44, comment='abused VPN (connect verified)')

Contact

Come say hi at ##jess on freenode

Release files for dronebl 0.4.8

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

Source distribution (sdist)

Source distribution for dronebl 0.4.8
File Size Uploaded
dronebl-0.4.8.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dronebl 0.4.8
File Interpreter ABI Platform
dronebl-0.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / dronebl-0.4.8.tar.gz

Download URL dronebl-0.4.8.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
831ea85747356fe9fa6a68857b8785b5190fd16afd8b69267975d3dae8a077c7
BLAKE2b-256 checksum
How to use checksums
103e7161d2b1ff91a6342a018afce86adad601d2e174d81a8411788648269ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2

Release files / dronebl-0.4.8-py3-none-any.whl

Download URL dronebl-0.4.8-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c82ab59ac5eb42eda3e866b0b9547f6a64eda58ef658fa31fdbab8558b37356
BLAKE2b-256 checksum
How to use checksums
2f1c246376d7f2a18206cd6925f81602e2543f2de82406aa65e62f69800a0538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

1 release file

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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