AbuseIpDb
Wrapper around the AbuseIPDb service API
This was a project born of having to do this in an automated fashion for our internal systems, and not finding a decent Python 2.7 package worth installing.
In order to use it, all you need to do is:
import abuseipdb
Once imported into your project, configure the API key for further use (you need to sign up for a webmaster account for this):
abuseipdb.configure_api_key("[API KEY]")
This just updates the internal api key value in use. Update that as needed if you need to report into multiple accounts over the course of your script.
Following that, there are 3 main methods for use within the module. They are modelled against the AbuseIPDb API. These methods are:
check_ip
abuseip.check_ip(ip="[IP]",days="[DAYS]")
check_cidr
check_cidr(cidr="[CIDR]",days="[DAYS]")
report_ip
report_ip(categories="[CATEGORIES]", comment="[OPTIONAL COMMENT]", ip="[IP]")
Out of these 3 methods, the parameters follow the rules set forth by AbuseIPDb posted here:
| Field | Required | Default | Example | Description |
|---|---|---|---|---|
| [IP] | Y | NA | 8.8.8.8 | IPv4 Address |
| [DAYS] | N | 30 | 30 | Check for IP Reports in the last 30 days. |
| [CIDR] | Y | NA | 207.126.144.0/20 | IPv4 Address Block in CIDR notation |
| [CATEGORIES] | Y | NA | 10,12,15 | Comma delineated list of category IDs |
| [OPTIONAL COMMENT] | N | NA | This is a comment. | Describe the type of malicious activity |
| [API KEY] | Y | NA | Tzmp1...quWvaiO | Your API key. |
Source code can be found here:
####AbuseIpDB Repository
Metadata
Release files for abuseipdb 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| abuseipdb-1.3.0.tar.gz | 6.7 kB | Without provenance | Details for abuseipdb-1.3.0.tar.gz |
Release files / abuseipdb-1.3.0.tar.gz
| Download URL | abuseipdb-1.3.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e728ed5562c6239b84c2f509233ecf1f6c413216be8502bb40d52fad1585b924
|
|
BLAKE2b-256 checksum How to use checksums |
88daf264b16a5d6a9ad1e9b41aa7c71937300316ee7b0c190d841b74e99bf1a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for abuseipdb 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.