Skip to main content

AbuseIPDb wrapper for IP checking and trouble reporting

Project description

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:

Abuse IP DB API

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

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

abuseipdb-1.3.0.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file abuseipdb-1.3.0.tar.gz.

File metadata

  • Download URL: abuseipdb-1.3.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for abuseipdb-1.3.0.tar.gz
Algorithm Hash digest
SHA256 e728ed5562c6239b84c2f509233ecf1f6c413216be8502bb40d52fad1585b924
MD5 ce82812226657474a79747732b7525d1
BLAKE2b-256 88daf264b16a5d6a9ad1e9b41aa7c71937300316ee7b0c190d841b74e99bf1a3

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